From ae36cbb17356f8f92c7bc5920e1b50789725317c Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 27 五月 2025 14:50:14 +0800
Subject: [PATCH] art: 设备管理-三保-审批页面

---
 src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue |  156 +++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 129 insertions(+), 27 deletions(-)

diff --git a/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue b/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue
index 6c9d5fa..9b8b397 100644
--- a/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue
+++ b/src/views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue
@@ -74,7 +74,7 @@
         </a-divider>
         <a-row :gutter="24">
           <a-tabs v-model="activeTabKey">
-            <a-tab-pane key="1" tab="淇濆吇椤规槑缁�">
+            <a-tab-pane key="1" tab="淇濆吇椤规槑缁�" v-if="!isPrecisionCheck">
               <j-vxe-table
                 ref="editableDetailTable"
                 :rowNumber="false"
@@ -110,6 +110,25 @@
                 </template>
               </j-vxe-table>
             </a-tab-pane>
+            <a-tab-pane key='4' tab='绮惧害妫�楠�' v-if="!isMaintenance">
+              <j-vxe-table
+                ref="editablePrecisionDetailTable"
+                :rowNumber="true"
+                :rowSelection="true"
+                :bordered="true"
+                :alwaysEdit="true"
+                :toolbar="false"
+                :toolbarConfig="precisionDetail.toolbarConfig"
+                keep-source
+                :height="300"
+                :dataSource="precisionDetail.dataSource"
+                :columns="precisionDetail.columns"
+                style="margin-top: 8px;" >
+                <template v-slot:actualValue="props">
+                  <a-input-number v-model="props.row.actualValue" :disabled="disableSubmit || confirmDisable" style="width: 100%" />
+                </template>
+              </j-vxe-table>
+            </a-tab-pane>
             <template v-if="selectShenpiData.procInstId">
               <a-tab-pane key='2' tab='娴佺▼鑺傜偣'>
                 <a-card :bordered="false">
@@ -139,14 +158,8 @@
           <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鏈哄姩鍔炵‘璁や俊鎭�
           </a-divider>
           <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmDealType" label="纭绫诲瀷">
-                <j-dict-select-tag type='radio' v-model='model.confirmDealType' dictCode='approved_rejected'
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷" :disabled="disableSubmit || leaderConfirmDisable"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment" label="纭鎰忚">
+            <a-col :span="24">
+              <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="confirmComment" label="纭鎰忚">
                 <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment"
                             :disabled="disableSubmit || leaderConfirmDisable"/>
               </a-form-model-item>
@@ -222,9 +235,6 @@
         imageSrc: null,
         activeTabKey: '1',
         validatorRules: {
-          confirmDealType: [
-            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
-          ],
           confirmComment: [
             { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' }
           ],
@@ -238,7 +248,8 @@
           approval: '/eam/thirdMaintenanceOrder/approval',
           userSelect: '/eam/user_select/list',
           queryHisTaskList: '/assign/flow/queryHisTaskList',
-          diagramView: '/assign/flow/diagramView'
+          diagramView: '/assign/flow/diagramView',
+          precisionCheckDetail: '/eam/precisionCheckDetail/queryList',
         },
         disableSubmit: false,
         taskData: [],
@@ -327,6 +338,70 @@
             // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳
             btn: ['clearSelection']
           }
+        },
+        precisionDetail: {
+          loading: false,
+          dataSource: [],
+          columns: [
+            {
+              title: 'ID',
+              key: 'id',
+              type: JVXETypes.hidden
+            },
+            {
+              title: 'orderId',
+              key: 'orderId',
+              type: JVXETypes.hidden
+            },
+            {
+              title: 'equipmentId',
+              key: 'equipmentId',
+              type: JVXETypes.hidden
+            },
+            {
+              title: 'parameterId',
+              key: 'parameterId',
+              type: JVXETypes.hidden
+            },
+            {
+              title: '妫�娴嬮」鐩�',
+              key: 'parameterId_dictText',
+              type: JVXETypes.normal,
+              width: '25%',
+              align: 'center'
+            },
+            {
+              title: '鍙傛暟缂栫爜',
+              key: 'parameterCode_dictText',
+              type: JVXETypes.normal,
+              width: '20%',
+              align: 'center',
+            },
+            {
+              title: '鍏佸樊鍊�',
+              key: 'parameterValue',
+              type: JVXETypes.normal,
+              width: '15%',
+              align: 'center',
+            },
+            {
+              title: '瀹炴祴鍊�',
+              key: 'actualValue',
+              type: JVXETypes.slot,
+              width: '15%',
+              align: 'center',
+              slotName: 'actualValue',
+              validateRules: [
+                { required: true, message: '璇疯緭鍏ュ疄娴嬪�硷紒' }
+              ]
+            }
+          ],
+          toolbarConfig: {
+            // prefix 鍓嶇紑锛泂uffix 鍚庣紑
+            slot: ['prefix', 'suffix'],
+            // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳
+            btn: ['add', 'remove', 'clearSelection']
+          }
         }
       }
     },
@@ -341,11 +416,21 @@
       },
       completionDisable: function() {
         return ['COMPLETE', 'ABOLISH'].includes(this.model.maintenanceStatus)
-      }
+      },
+      isMaintenance: function() {
+        return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'maintenance_execution';
+      },
+      isPrecisionCheck: function() {
+        return this.selectShenpiData && this.selectShenpiData.taskDefKey === 'precision_check';
+      },
     },
     methods: {
       async handleDetail(item) {
         this.initParams()
+        //閲嶆柊璁$畻defaultKey
+        if(item && item.taskDefKey === 'precision_check') {
+          this.activeTabKey = '4';
+        }
         this.model = {}
         if (item.procInstId) {
           const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = item
@@ -381,6 +466,7 @@
         this.model.instanceId = item.procInstId
         this.model.values = item.variables
         await this.loadDetail(item.dataId)
+        await this.loadPrecisionDetail(item.dataId);
       },
 
       recordDetail(record) {
@@ -392,28 +478,40 @@
           this.model.imageFilesResult = [...obj]
         }
         this.loadDetail(record.id)
+        this.loadPrecisionDetail(record.id);
       },
-
       initParams() {
         this.detail.dataSource = []
         this.visible = true
-        this.activeTabKey = '1'
+        this.activeTabKey = '1';
+        if(this.selectShenpiData &&  this.selectShenpiData.taskDefKey === 'precision_check') {
+          this.activeTabKey = '4';
+        }
         this.spinning = true
       },
-
       async handleOk() {
         const that = this
-        let errMap = await that.$refs.editableDetailTable.validateTable()
-        if (errMap) {
-          this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�')
-          return
+        if(that.$refs.editableDetailTable) {
+          let errMap = await that.$refs.editableDetailTable.validateTable()
+          if (errMap) {
+            this.$message.warning('鏁版嵁鏍¢獙澶辫触锛�')
+            return
+          }
         }
         // 瑙﹀彂琛ㄥ崟楠岃瘉
         this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = that.spinning = true
-            let tableData = that.$refs.editableDetailTable.getTableData()
+            let tableData = [];
+            let precisionTableData = [];
+            if(that.$refs.editableDetailTable) {
+              tableData = that.$refs.editableDetailTable.getTableData()
+            }
+            if(that.$refs.editablePrecisionDetailTable) {
+              precisionTableData = that.$refs.editablePrecisionDetailTable.getTableData()
+            }
             that.model.tableDetailList = [...tableData]
+            that.model.precisionDetailList = [...precisionTableData]
             let httpurl = this.url.approval
             let method = 'put'
 
@@ -433,7 +531,6 @@
           }
         })
       },
-
       autocompleteForm(selectObj) {
         this.$set(this.model, 'standardName', selectObj.standardName)
         this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod)
@@ -445,7 +542,6 @@
         }
         this.loadMaintenanceOperatorList(this.model.equipmentId)
       },
-
       //鏍囧噯閫夋嫨鍙樺寲
       loadDetail(orderId) {
         if (orderId) {
@@ -460,7 +556,15 @@
             })
         }
       },
-
+      loadPrecisionDetail(orderId) {
+        if (orderId) {
+          getAction(this.url.precisionCheckDetail, { orderId: orderId }).then(res => {
+            if (res.success) {
+              this.precisionDetail.dataSource = [...res.result]
+            }
+          })
+        }
+      },
       loadMaintenanceOperatorList(equipmentId) {
         this.maintenanceOperatorOptions = []
         let params = { positionCode: 'PCR0001' }
@@ -477,12 +581,10 @@
           }
         })
       },
-
       handleInspectionResultSelectChange(value, record) {
         if (record.exceptionDescription) delete record.exceptionDescription
         if (record.reportFlag) delete record.reportFlag
       },
-
       // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉
       handleSelectAllInspectionResult() {
         this.selectedRowKeys.forEach(key => {

--
Gitblit v1.9.3