Sfoglia il codice sorgente

fix(维护管理): 优化维修计划撤销接口并修复执行部门和执行人名称获取逻辑

yusheng 4 mesi fa
parent
commit
e7eb7271ff

+ 2 - 2
src/api/maintenance/repair_report.js

@@ -113,8 +113,8 @@ export async function getPlanList(data) {
 }
 
 // 维修计划撤销
-export async function removePlan(data) {
-  const res = await request.delete(`/eam/plan/delete`, { data });
+export async function plannedMaintenanceRevocation(id) {
+  const res = await request.get(`/eam/plan/plannedMaintenanceRevocation/`+id);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 10 - 3
src/views/maintenance/components/planRepaireDialog.vue

@@ -266,6 +266,7 @@
                   <deptSelect
                     v-model="row.executeDeptId"
                     @changeGroup="areaPersonGroup($index)"
+                    :ref="'deptSelectRef' + $index"
                     v-if="dialogTitle != '详情'"
                   />
                   <span v-else>{{ row.executeDeptName }}</span>
@@ -284,6 +285,7 @@
                     v-model="row.executeUserId"
                     placeholder="请选择"
                     v-if="dialogTitle != '详情'"
+                    :ref="'userSelectRef' + $index"
                   >
                     <el-option
                       v-for="item in row.areaPersonList"
@@ -594,7 +596,12 @@
           let isRepairGroupId = true,
             isRepairUserId = true;
           if (valid) {
-            const planDeviceList = this.equipmentList.map((item) => {
+            const planDeviceList = this.equipmentList.map((item, index) => {
+              let repairGroupName = this.$refs[
+                'deptSelectRef' + index
+              ].$refs.treeSelect.getNodeByValue(item.executeDeptId)?.name;
+              let repairUserName = item.areaPersonList.find(areaPerson=>areaPerson.id==item.executeUserId)?.name;
+
               if (!item.executeDeptId) {
                 isRepairGroupId = false;
               }
@@ -609,8 +616,8 @@
                 workItems: [],
                 repairGroupId: item.executeDeptId,
                 repairUserId: item.executeUserId,
-                repairGroupName: item.executeDeptName,
-                repairUserName: item.executeUserName
+                repairGroupName,
+                repairUserName
               };
             });
             let boolen = planDeviceList.length > 0;

+ 2 - 2
src/views/maintenance/repair/planRepair/index.vue

@@ -84,7 +84,7 @@
   import planRepaireDialog from '../../components/planRepaireDialog.vue';
   import MaintenanceSearch from './components/maintenance-search.vue';
   import DetailDialog from './components/detailDialog.vue';
-  import { removePlan } from '@/api/maintenance/repair_report';
+  import { plannedMaintenanceRevocation } from '@/api/maintenance/repair_report';
   import { getPage } from '@/api/maintenance/patrol_maintenance';
   import dictMixins from '@/mixins/dictMixins';
   export default {
@@ -236,7 +236,7 @@
       },
       // 撤销
       cancel(row) {
-        removePlan([row.id]).then((res) => {
+        plannedMaintenanceRevocation(row.id).then((res) => {
           this.$message.success('撤销成功!');
           this.reload();
         });