LAPTOP-16IUEB3P\Lenovo пре 3 година
родитељ
комит
b2fddf802a

+ 18 - 0
src/api/maintenance/repair_report.js

@@ -85,4 +85,22 @@ export async function checkOrBack (data) {
      return res.data.data;
    }
    return Promise.reject(new Error(res.data.message));
+ }
+ 
+ // 获取维修计划列表数据 
+ export async function getPlanList (data) {
+   const res = await request.get('/eam/plan/page', {params:data});
+   if (res.data.code == 0) {
+     return res.data.data;
+   }
+   return Promise.reject(new Error(res.data.message));
+ }
+ 
+ // 维修计划撤销
+ export async function removePlan(data) {
+   const res = await request.delete(`/eam/plan/delete`,{data} );
+   if (res.data.code == 0) {
+     return res.data.data;
+   }
+   return Promise.reject(new Error(res.data.message));
  }

+ 22 - 33
src/views/maintenance/repair/maintenancePlan/index.vue

@@ -75,8 +75,10 @@
 <script>
   import MaintenanceSearch from './components/maintenance-search.vue';
   import DetailDialog from './components/detailDialog.vue';
-  import { pageRoles } from '@/api/system/role';
+  import { getPlanList , removePlan } from '@/api/maintenance/repair_report';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+	mixins: [dictMixins],
     components: {
       MaintenanceSearch,
 	  DetailDialog
@@ -102,50 +104,31 @@
 		    minWidth: 110
 		  },
 		  {
-		    prop: 'groupId',
+		    prop: 'name',
 		    label: '计划名称',
 		    align: 'center',
 		    showOverflowTooltip: true,
 		    minWidth: 110
 		  },
 		  {
-		    prop: 'enable',
-		    label: '计划规则',
+		    prop: 'number',
+		    label: '报修设备数量',
 		    align: 'center',	
 		    showOverflowTooltip: true,
-		    slot: 'enable',
 		    minWidth: 110
 		  },
 		  {
-		    prop: 'name',
-		    label: '设备分类',
+		    prop: 'planStatus',
+		    label: '状态',
 		    align: 'center',	
 		    showOverflowTooltip: true,
-		    minWidth: 110
-		  },
-		  {
-		    prop: 'cycle',
-		    label: '设备性质',
-		    align: 'center',	
-		    showOverflowTooltip: true,
-		    minWidth: 110
+		    minWidth: 110,
+			formatter: (_row, _column, cellValue) => {
+			  return this.getDictValue('维修计划状态', _row.planStatus);
+			}
 		  },
-			{
-			  prop: 'auto',
-			  label: '状态',
-			  align: 'center',	
-			  showOverflowTooltip: true,
-			  minWidth: 110
-			},
-			{
-			  prop: 'status',
-			  label: '审批人',
-			  align: 'center',	
-			  showOverflowTooltip: true,
-			  minWidth: 110
-			},
 		  {
-		    prop: 'creater',
+		    prop: 'executor',
 		    label: '创建人',
 		    align: 'center',	
 		    showOverflowTooltip: true,
@@ -153,7 +136,7 @@
 		  },
 		  {
 		    prop: 'createTime',
-		    label: '生成时间',
+		    label: '创建时间',
 		    align: 'center',
 		    showOverflowTooltip: true,
 		    minWidth: 110,
@@ -184,10 +167,13 @@
     computed: {
 
     },
+	created () {
+	  this.requestDict('维修计划状态')
+	},
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return pageRoles({ pageNum: page, size: limit, ...where });
+        return getPlanList({ pageNum: page, size: limit, ...where });
       },
       async changeEnable(row) {
         const res = await putRoles(row);
@@ -222,7 +208,10 @@
 	  },
 		// 撤销
 		cancel(row){
-				  
+			removePlan([row.id]).then(res=>{
+				this.$message.success('撤销成功!')
+				this.reload()
+			})	  
 		}
 	  
     }