Эх сурвалжийг харах

pms 保养工单 修改退回的保养工单 提交

zhangcl 7 цаг өмнө
parent
commit
0d7acc5753

+ 5 - 0
src/api/pms/iotmainworkorder/index.ts

@@ -80,6 +80,11 @@ export const IotMainWorkOrderApi = {
     return await request.put({ url: `/pms/iot-main-work-order/fillWorkOrder`, data })
   },
 
+  // 修改保养工单
+  modifyWorkOrder: async (data: any) => {
+    return await request.put({ url: `/pms/iot-main-work-order/modifyWorkOrder`, data })
+  },
+
   // 手工新增保养工单
   addWorkOrder: async (data: any) => {
     return await request.put({ url: `/pms/iot-main-work-order/addWorkOrder`, data })

+ 5 - 8
src/views/pms/iotmainworkorder/IotMainWorkOrderModify.vue

@@ -160,7 +160,6 @@
               v-model="scope.row.rule"
               :active-value="0"
               :inactive-value="1"
-              disabled
             />
           </template>
         </el-table-column>
@@ -440,7 +439,6 @@
           type="primary"
           :icon="Box"
           @click="handleSelectMaterial"
-          :disabled="!currentBomItem || isButtonsDisabled"
         >
           {{ t('stock.selectMaterial') }}
         </el-button>
@@ -457,7 +455,6 @@
           type="primary"
           :icon="Plus"
           @click="handleAddMaterial"
-          :disabled="!currentBomItem || isButtonsDisabled"
         >
           新增物料
         </el-button>
@@ -938,7 +935,7 @@ const isMaterialDisabled = (material) => {
   // 如果保养项不存在,默认不禁用
   if (!bomItem) return false;
   // 如果保养项状态为已完成(status=1),则禁用该物料
-  if (bomItem.status === 1) return true;
+  // if (bomItem.status === 1) return true;
   // 如果保养项rule=1(不消耗物料),则禁用
   if (bomItem.rule === 1) return true;
   return false;
@@ -1881,10 +1878,10 @@ const submitForm = async () => {
   }
 
   // 保养时 累计运行时长 mainRuntime 全局校验
-  if (!validateAllMainRuntimes()) {
+  /* if (!validateAllMainRuntimes()) {
     message.error(t('mainPlan.mainRuntimeError'));
     return;
-  }
+  } */
 
   // 保养时 累计运行公里数 mainMileage 全局校验
   if (!validateAllMainMileages()) {
@@ -1948,8 +1945,8 @@ const submitForm = async () => {
       mainWorkOrderBom: convertedList,
       mainWorkOrderMaterials: allMaterials
     }
-    await IotMainWorkOrderApi.fillWorkOrder(data)
-    message.success(t('common.createSuccess'))
+    await IotMainWorkOrderApi.modifyWorkOrder(data)
+    message.success(t('common.updateSuccess'))
     close()
     // 发送操作成功的事件
     emit('success')