From 6c16bede88a1d776f0eced7028cca2080a1a606f Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 23 四月 2025 09:36:23 +0800
Subject: [PATCH] art: 设备管理-周保工单-按钮权限控制,批量领取

---
 src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
index f70bca9..9fb7779 100644
--- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
+++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -78,8 +78,8 @@
         <a-row>
           <a-form-model-item prop="imageFilesResult" label="鐐规鍥剧墖" :labelCol="{span:2}" :wrapperCol="{span:21}">
             <lx-upload :returnUrl="false" :isMultiple="true" file-type="image" :number="3"
-                       :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'"
-                       v-model="tableRowRecord.imageFiles"/>
+                       :disabled="isDisableOperation||!hasInspectionDateArrived"
+                       v-model="tableRowRecord.fileList"/>
           </a-form-model-item>
         </a-row>
 
@@ -105,7 +105,7 @@
             >
               <template v-slot:inspectionResult="props">
                 <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
-                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'"
+                                   :disabled="isDisableOperation"
                                    placeholder="璇烽�夋嫨鐐规缁撴灉"
                                    @change="handleInspectionResultSelectChange($event,props.row)"
                                    style="width: 100%"/>
@@ -114,13 +114,13 @@
               <template v-slot:exceptionDescription="props">
                 <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
                             :placeholder="props.row.inspectionResult==='2'?'璇疯緭鍏ュ紓甯告弿杩�':''"
-                            :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
+                            :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
               </template>
 
               <template v-slot:reportFlag="props">
                 <j-dict-select-tag v-model="props.row.reportFlag"
                                    :placeholder="props.row.inspectionResult==='2'?'璇烽�夋嫨寮傚父鏄惁淇濅慨':''"
-                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='UNDER_INSPECTION'||!props.row.inspectionResult||props.row.inspectionResult==='1'"
+                                   :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                    dictCode="yn"
                                    style="width: 100%"/>
               </template>
@@ -150,7 +150,7 @@
           </template>
 
           <a-button
-            v-if="selectedRowKeys.length>0&&!disableSubmit&&tableRowRecord.inspectionStatus==='UNDER_INSPECTION'&&hasInspectionDateArrived&&activeTabKey==='1'"
+            v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'"
             slot="tabBarExtraContent" type="primary"
             @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父
           </a-button>
@@ -175,8 +175,7 @@
             <a-col :span="12">
               <a-form-model-item prop="confirmDealType" label="澶勭悊绫诲瀷">
                 <j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected'
-                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"/>
+                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"/>
               </a-form-model-item>
             </a-col>
 
@@ -305,8 +304,6 @@
             }
           ]
         },
-        isDisplayBmp: false,
-        showBmpButtonLoading: false,
         selectedRowKeys: [],
         disableSubmit: false,
         activeTabKey: '1',
@@ -319,11 +316,14 @@
       },
       isDisplayConfirm() {
         return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus)
+      },
+      isDisableOperation() {
+        return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION'
       }
     },
     methods: {
       /**
-       * 鑾峰彇娴佺▼鑺傜偣
+       * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘
        * @param record 寰呭姙璁板綍淇℃伅
        */
       getAllApproveData(record) {
@@ -366,7 +366,7 @@
         getAction(this.url.queryBomDataById, param)
           .then((res => {
             if (res.success) {
-              that.tableRowRecord = res.result[0]
+              that.tableRowRecord = { ... res.result[0], fileList: JSON.parse(res.result[0].imageFiles) }
               if (!this.hasInspectionDateArrived && !this.disableSubmit) this.title += `锛堟湭鍒扮偣妫�鏃ユ湡涓嶈兘鎻愬墠鐐规锛塦
               that.detail.dataSource = res.result[0].tableDetailList
               console.log('that.tableRowRecord----->', that.tableRowRecord)
@@ -392,6 +392,7 @@
             flowTaskVo.values = this.selectShenpiData.variables
             flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType
             flowTaskVo.confirmComment = this.tableRowRecord.confirmComment
+            flowTaskVo.fileList = this.tableRowRecord.fileList
             flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData()
             const that = this
             console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo)
@@ -474,11 +475,6 @@
   }
 </script>
 <style scoped>
-  .btn-custom {
-    background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
-    color: #fff; /* 鐧借壊鏂囧瓧 */
-  }
-
   /deep/ .ant-select-dropdown-menu {
     text-align: left;
   }

--
Gitblit v1.9.3