From 54c22f2f0e98c35e48cdad6c4d0299d08beea630 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 28 七月 2025 10:15:13 +0800
Subject: [PATCH] update

---
 src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue |  528 ++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 327 insertions(+), 201 deletions(-)

diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
index c954873..9a8dc93 100644
--- a/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
+++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue
@@ -1,115 +1,117 @@
 <template>
-  <a-modal
-    :width="1000"
+  <j-modal
+    :title="title"
+    :width="1200"
     :visible="visible"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit||!hasInspectionDateArrived} }"
     @ok="submitForm"
-    @cancel="handCancel"
+    @cancel="handleCancel"
     :mask-closable="false"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
     centered
   >
-    <a-card :bordered="false">
-      <div>
-        <b>{{ selectShenpiData.title }}</b>
-        <br>
-        <br>
-        <a-tag color="blue">
-          褰撳墠澶勭悊浜� {{ selectShenpiData.assignee_dictText }}
-        </a-tag>
-        <a-tag color="blue">
-          浠诲姟鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }}
-        </a-tag>
-        <br>
-        <br>
-        <a-button @click="fetchAndShowBmp" class="btn-custom" :loading="showBmpButtonLoading">娴佺▼鍥�</a-button>
-        <div v-if="imageSrc&&isDisplayBmp">
-          <img :src="imageSrc" alt="Fetched Image"/>
-        </div>
-        <!--<hr class="shallow-hr">-->
-      </div>
+    <a-spin :spinning="spinning">
+      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
+                    :rules="validatorRules">
+        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 鐐规鍩虹淇℃伅</a-divider>
 
-      <a-spin :spinning="spinning">
-        <a-tabs default-active-key='1'>
-          <a-tab-pane key='1' tab='鍩烘湰淇℃伅'>
-            <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol"
-                          :wrapperCol="wrapperCol">
-              <a-row>
-                <a-col :span='span'>
-                  <a-form-model-item label="宸ュ崟鍙�">
-                    <a-input readOnly v-model="tableRowRecord.orderNum"/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span='span'>
-                  <a-form-model-item label="璁惧缂栧彿">
-                    <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
-                                                :maintenanceCategory="'POINT_INSPECTION'" disabled
-                                                @autocompleteForm="autoCompleteForm"/>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
+        <a-row>
+          <a-col :span='span'>
+            <a-form-model-item label="宸ュ崟鍙�">
+              <a-input readOnly v-model="tableRowRecord.orderNum"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="宸ュ崟鐘舵��">
+              <a-input readOnly v-model="tableRowRecord.inspectionStatus_dictText"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="璁惧缂栧彿">
+              <MaintenanceEquipmentSelect v-model="tableRowRecord.equipmentId"
+                                          :maintenanceCategory="'POINT_INSPECTION'" disabled
+                                          @autocompleteForm="autoCompleteForm"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
 
-              <a-row>
-                <a-col :span='span'>
-                  <a-form-model-item label="鏍囧噯鍚嶇О">
-                    <a-input readOnly v-model="tableRowRecord.standardName"/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span='span'>
-                  <a-form-model-item label="鏍囧噯缂栫爜">
-                    <a-input readOnly v-model="tableRowRecord.standardCode"/>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
-              <a-row>
-                <a-col :span='span'>
-                  <a-form-model-item label="淇濆吇鍛ㄦ湡">
-                    <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span='span'>
-                  <a-form-model-item label="鐐规浜�">
-                    <a-input v-model="tableRowRecord.operator" readOnly/>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
-              <a-row>
-                <a-col :span='span'>
-                  <a-form-model-item label="鐐规鏃ユ湡" prop="inspectionDate">
-                    <a-input v-model="tableRowRecord.inspectionDate" readOnly/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span='span'>
-                  <a-form-model-item label="鐐规杩囨湡鏃堕棿">
-                    <a-input v-model="tableRowRecord.expirationTime" readOnly/>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
-              <a-row>
-                <a-col :span="24">
-                  <a-form-model-item label="澶囨敞" :labelCol="{span:3}" :wrapperCol="{span:20}">
-                    <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/>
-                  </a-form-model-item>
-                </a-col>
-              </a-row>
-            </a-form-model>
-          </a-tab-pane>
-          <a-tab-pane key='2' tab='娴佺▼鑺傜偣'>
-            <a-card :bordered="false">
-              <a-timeline>
-                <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
-                  <div>
-                    <h3 style="font-weight: bold;">{{item.taskName}}</h3>
-                    <div>澶勭悊浜猴細{{item.assignee_dictText}}</div>
-                    <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div>
-                    <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div>
-                    <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div>
-                  </div>
-                </a-timeline-item>
-              </a-timeline>
-            </a-card>
-          </a-tab-pane>
-        </a-tabs>
+        <a-row>
+          <a-col :span='span'>
+            <a-form-model-item label="瀹夎浣嶇疆">
+              <a-input readOnly v-model="tableRowRecord.installationPosition_dictText"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="鏍囧噯鍚嶇О">
+              <a-input readOnly v-model="tableRowRecord.standardName"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="鏍囧噯缂栫爜">
+              <a-input readOnly v-model="tableRowRecord.standardCode"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
 
-        <a-tabs default-active-key='1'>
+        <a-row>
+          <a-col :span='span'>
+            <a-form-model-item label="淇濆吇鍛ㄦ湡">
+              <a-input v-model="tableRowRecord.maintenancePeriod" readOnly/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="鐐规鏃ユ湡">
+              <a-input v-model="tableRowRecord.inspectionDate" readOnly/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="鐐规杩囨湡鏃堕棿">
+              <a-input v-model="tableRowRecord.expirationTime" readOnly/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row>
+
+          <a-col :span='span'>
+            <a-form-model-item label="鐐规浜�">
+              <a-input v-model="tableRowRecord.operator_dictText" readOnly/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="鐐规浜虹數璇�">
+              <a-input v-model="tableRowRecord.operatorPhone_dictText" readOnly/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='span'>
+            <a-form-model-item label="浣滀笟鎸囧">
+              <a-button  @click="handlePreview(tableRowRecord.referenceFile)" type="primary" icon="eye">棰勮</a-button>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row>
+          <a-col :span="span*3">
+            <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:21}">
+              <a-textarea v-model="tableRowRecord.remark" rows="3" readOnly/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <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="isDisableOperation||!hasInspectionDateArrived"
+                       v-model="tableRowRecord.fileList"/>
+          </a-form-model-item>
+        </a-row>
+
+        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">
+          淇濆吇椤逛俊鎭�
+        </a-divider>
+
+        <a-tabs v-model="activeTabKey">
           <a-tab-pane key="1" tab="淇濆吇椤规槑缁�">
             <j-vxe-table
               ref="editableDetailTable"
@@ -127,6 +129,7 @@
             >
               <template v-slot:inspectionResult="props">
                 <j-dict-select-tag v-model="props.row.inspectionResult" dictCode="eam_inspection_result"
+                                   :disabled="isDisableOperation"
                                    placeholder="璇烽�夋嫨鐐规缁撴灉"
                                    @change="handleInspectionResultSelectChange($event,props.row)"
                                    style="width: 100%"/>
@@ -134,20 +137,46 @@
 
               <template v-slot:exceptionDescription="props">
                 <a-textarea style="height: 32px" v-model="props.row.exceptionDescription"
-                            :disabled="!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
+                            :placeholder="props.row.inspectionResult==='2'?'璇疯緭鍏ュ紓甯告弿杩�':''"
+                            :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"/>
               </template>
 
               <template v-slot:reportFlag="props">
                 <j-dict-select-tag v-model="props.row.reportFlag"
-                                   :disabled="!props.row.inspectionResult||props.row.inspectionResult==='1'"
+                                   :placeholder="props.row.inspectionResult==='2'?'璇烽�夋嫨寮傚父鏄惁鎶ヤ慨':''"
+                                   :disabled="isDisableOperation||!props.row.inspectionResult||props.row.inspectionResult==='1'"
                                    dictCode="yn"
                                    style="width: 100%"/>
               </template>
             </j-vxe-table>
           </a-tab-pane>
 
-          <a-button v-if="selectedRowKeys.length>0" slot="tabBarExtraContent" type="primary"
-                    @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父
+          <template v-if="selectShenpiData.procInstId">
+            <a-tab-pane key='2' tab='娴佺▼鑺傜偣'>
+              <a-card :bordered="false">
+                <a-timeline>
+                  <a-timeline-item v-for="(item,index) in hitaskDataSource" :key="index">
+                    <div>
+                      <h3 style="font-weight: bold;">{{item.taskName}}</h3>
+                      <div>澶勭悊浜猴細{{item.assignee_dictText}}</div>
+                      <div v-if="index !==0">澶勭悊鏃堕暱锛歿{item.duration}}</div>
+                      <div v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</div>
+                      <div v-if="item.description">澶勭悊鎰忚锛歿{item.description}}</div>
+                    </div>
+                  </a-timeline-item>
+                </a-timeline>
+              </a-card>
+            </a-tab-pane>
+
+            <a-tab-pane key='3' tab='娴佺▼鍥�'>
+              <img :src="imageSrc" alt="Fetched Image"/>
+            </a-tab-pane>
+          </template>
+
+          <a-button
+            v-if="selectedRowKeys.length>0&&!isDisableOperation&&hasInspectionDateArrived&&activeTabKey==='1'"
+            slot="tabBarExtraContent" type="primary"
+            @click="handleSelectAllInspectionResult">鎵归噺鐐规姝e父
           </a-button>
 
           <!--<a-dropdown slot="tabBarExtraContent" v-if="selectedRowKeys.length>0">-->
@@ -161,9 +190,33 @@
           <!--</a-button>-->
           <!--</a-dropdown>-->
         </a-tabs>
-      </a-spin>
-    </a-card>
-  </a-modal>
+
+        <template v-if="isDisplayConfirm">
+          <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 prop="confirmDealType" label="澶勭悊绫诲瀷">
+                <j-dict-select-tag type='radio' v-model='tableRowRecord.confirmDealType' dictCode='approved_rejected'
+                                   :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"/>
+              </a-form-model-item>
+            </a-col>
+
+            <a-col :span="12">
+              <a-form-model-item prop="confirmComment" label="澶勭悊鎰忚">
+                <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�"
+                            :disabled="disableSubmit||tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'"
+                            v-model="tableRowRecord.confirmComment"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </template>
+      </a-form-model>
+    </a-spin>
+
+    <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview>
+  </j-modal>
 </template>
 
 <script>
@@ -171,22 +224,32 @@
   import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
   import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect.vue'
   import { JVXETypes } from '@comp/jeecg/JVxeTable'
+  import moment from 'moment'
 
   export default {
     name: 'InspectionOrderHandle',
     components: { MaintenanceEquipmentSelect },
     props: {
       selectShenpiData: {
-        type: Object,
-        required: true
+        type: Object
       }
     },
     data() {
       return {
-        span: 12,
+        span: 8,
+        confirmLoading: false,
         spinning: false,
         tableRowRecord: {},
+        assignFileStream: {},
         hitaskDataSource: [],
+        validatorRules: {
+          confirmDealType: [
+            { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' }
+          ],
+          confirmComment: [
+            { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' }
+          ]
+        },
         imageSrc: null,
         labelCol: {
           xs: { span: 24 },
@@ -199,10 +262,12 @@
         visible: false,
         // 琛ㄥご
         url: {
-          queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
+          // queryBomDataById: '/eam/eamInspectionOrder/selectVoById',
           diagramView: '/assign/flow/diagramView',
           queryHisTaskList: '/assign/flow/queryHisTaskList',
-          approve: '/eam/eamInspectionOrder/approval'
+          approve: '/eam/eamInspectionOrder/approval',
+          queryById: '/eam/eamInspectionOrder/queryById',
+          detailList: '/eam/eamInspectionOrderDetail/queryList'
         },
         detail: {
           loading: false,
@@ -212,7 +277,7 @@
               title: '搴忓彿',
               key: 'itemCode',
               type: JVXETypes.normal,
-              width: '10%',
+              width: '5%',
               align: 'center',
               fixed: 'left'
             },
@@ -220,7 +285,7 @@
               title: '淇濆吇椤�',
               key: 'itemName',
               type: JVXETypes.normal,
-              width: '20%',
+              width: '15%',
               align: 'center',
               fixed: 'left'
             },
@@ -228,7 +293,7 @@
               title: '淇濆吇瑕佹眰',
               key: 'itemDemand',
               type: JVXETypes.normal,
-              width: '30%',
+              width: '15%',
               align: 'center',
               fixed: 'left'
             },
@@ -237,16 +302,22 @@
               key: 'inspectionResult',
               type: JVXETypes.slot,
               slotName: 'inspectionResult',
-              width: '20%',
-              align: 'center'
+              width: '15%',
+              align: 'center',
+              validateRules: [
+                { required: true, message: '${title}涓嶈兘涓虹┖锛�' }
+              ]
             },
             {
               title: '寮傚父鎻忚堪',
               key: 'exceptionDescription',
               type: JVXETypes.slot,
               slotName: 'exceptionDescription',
-              width: '30%',
-              align: 'center'
+              width: '20%',
+              align: 'center',
+              validateRules: [
+                { handler: this.customValidator }
+              ]
             },
             {
               title: '寮傚父鏄惁鎶ヤ慨',
@@ -254,60 +325,52 @@
               type: JVXETypes.slot,
               slotName: 'reportFlag',
               width: '20%',
-              align: 'center'
+              align: 'center',
+              validateRules: [
+                { handler: this.customValidator }
+              ]
             }
           ]
         },
-        isDisplayBmp: false,
-        showBmpButtonLoading: false,
-        selectedRowKeys: []
+        selectedRowKeys: [],
+        disableSubmit: false,
+        activeTabKey: '1',
+        title: '',
+        fileUrl: '',
+      }
+    },
+    computed: {
+      hasInspectionDateArrived() {
+        return moment(this.tableRowRecord.inspectionDate).diff(moment(), 'hours') <= 0
+      },
+      isDisplayConfirm() {
+        return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.inspectionStatus)
+      },
+      isDisableOperation() {
+        return this.disableSubmit || this.tableRowRecord.inspectionStatus !== 'UNDER_INSPECTION'
       }
     },
     methods: {
       /**
-       * 鑾峰彇娴佺▼鑺傜偣
+       * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘
        * @param record 寰呭姙璁板綍淇℃伅
        */
       getAllApproveData(record) {
-        const param = { 'procInstId': record.procInstId }
-        getAction(this.url.queryHisTaskList, param)
-          .then(res => {
-            this.hitaskDataSource = res.result
-          })
-      },
-
-      /**
-       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
-       * @param record 寰呭姙璁板綍淇℃伅
-       */
-      getBasicInformation(record) {
-        this.tableRowRecord = {}
-        this.detail.dataSource = []
-        this.spinning = true
-        const param = { id: record.dataId }
-        const that = this
-        getAction(this.url.queryBomDataById, param)
-          .then((res => {
-            if (res.success) {
-              that.tableRowRecord = res.result[0]
-              that.detail.dataSource = res.result[0].tableDetailList
-              console.log('that.tableRowRecord----->', that.tableRowRecord)
-            }
-          }))
-      },
-
-      // 鑾峰彇骞跺睍寮�娴佺▼鍥�
-      fetchAndShowBmp() {
-        this.isDisplayBmp = !this.isDisplayBmp
-        if (!this.imageSrc) {
-          const { processDefinitionId, processInstanceId, processDefinitionKey } = this.selectShenpiData
-          let param = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
-          this.showBmpButtonLoading = true
+        if (record.procInstId) {
+          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record
+          const param = { procInstId }
+          const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
           const that = this
-          downFile(this.url.diagramView, param, 'get')
+
+          getAction(this.url.queryHisTaskList, param)
+            .then(res => {
+              that.hitaskDataSource = res.result
+            })
+
+          downFile(this.url.diagramView, imageParam, 'get')
             .then((res => {
               const urlObject = window.URL.createObjectURL(new Blob([res]))
-              this.imageSrc = urlObject
+              that.imageSrc = urlObject
             }))
             .catch(err => {
               that.$notification.error({
@@ -315,44 +378,74 @@
                 description: res.message
               })
             })
-            .finally(() => {
-              this.showBmpButtonLoading = false
-            })
         }
       },
 
-      submitForm() {
-        const flowTaskVo = {}
-        flowTaskVo.dataId = this.selectShenpiData.dataId
-        flowTaskVo.taskId = this.selectShenpiData.id
-        flowTaskVo.userId = this.selectShenpiData.assignee
-        flowTaskVo.instanceId = this.selectShenpiData.procInstId
-        flowTaskVo.values = this.selectShenpiData.variables
-        flowTaskVo.tableDetailList = this.$refs.editableDetailTable.getTableData()
-        const that = this
-        this.confirmLoading = true
-        console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo)
-        // httpAction(this.url.approve, flowTaskVo, 'post')
-        //   .then((res) => {
-        //     if (res.success) {
-        //       that.$message.success(res.message)
-        //       //鍒锋柊琛ㄦ牸
-        //       that.$emit('searchReset')
-        //       that.handleCancel()
-        //     } else {
-        //       that.$message.warning(res.message)
-        //     }
-        //   })
-        //   .finally(() => {
-        //     that.confirmLoading = false
-        //   })
+      /**
+       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
+       * @param record 寰呭姙璁板綍淇℃伅
+       */
+      async getBasicInformation(record) {
+        this.activeTabKey = '1'
+        this.detail.dataSource = []
+        this.spinning = true
+        const param = { id: record.dataId }
+        let res = await getAction(this.url.queryById, param);
+        this.tableRowRecord = Object.assign({}, res.result);
+        if (this.tableRowRecord.imageFiles) {
+          let obj = JSON.parse(this.tableRowRecord.imageFiles)
+          this.tableRowRecord.fileList = [...obj]
+        }
+        await this.loadDetail(record.dataId)
       },
 
-      autoCompleteForm({ standardName, maintenancePeriod, standardCode }) {
+      async submitForm() {
+        let errMap = await this.$refs.editableDetailTable.validateTable()
+        if (errMap) {
+          console.log('err', errMap)
+          return
+        }
+
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            this.confirmLoading = this.spinning = true
+            const flowTaskVo = {}
+            flowTaskVo.dataId = this.selectShenpiData.dataId
+            flowTaskVo.taskId = this.selectShenpiData.id
+            flowTaskVo.userId = this.selectShenpiData.assignee
+            flowTaskVo.instanceId = this.selectShenpiData.procInstId
+            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)
+            httpAction(this.url.approve, flowTaskVo, 'post')
+              .then((res) => {
+                if (res.success) {
+                  that.$message.success(res.message)
+                  //鍒锋柊琛ㄦ牸
+                  that.$emit('searchReset')
+                  that.handleCancel()
+                } else {
+                  that.$message.warning(res.message)
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = this.spinning = false
+              })
+          } else {
+            return false
+          }
+        })
+      },
+
+      autoCompleteForm({ standardName, maintenancePeriod, standardCode, referenceFile }) {
         this.$set(this.tableRowRecord, 'standardName', standardName)
         this.$set(this.tableRowRecord, 'maintenancePeriod', maintenancePeriod)
         this.$set(this.tableRowRecord, 'standardCode', standardCode)
-        this.spinning = false
+        this.$set(this.tableRowRecord, 'referenceFile', referenceFile)
       },
 
       // 鎵归噺閫夋嫨鎵�鏈夌偣妫�缁撴灉
@@ -360,7 +453,6 @@
         this.selectedRowKeys.forEach(key => {
           const dataItem = this.detail.dataSource.find(item => item.id === key)
           if (dataItem && dataItem.inspectionResult !== '1') {
-            console.log('dataItem', dataItem)
             delete dataItem.exceptionDescription
             delete dataItem.reportFlag
             dataItem.inspectionResult = '1'
@@ -388,19 +480,53 @@
         if (record.reportFlag) delete record.reportFlag
       },
 
-      handCancel() {
+      customValidator({ cellValue, row }, callback) {
+        if (row.inspectionResult === '2') {
+          if (!cellValue) {
+            callback(false, '${title}涓嶈兘涓虹┖锛�') // false = 鏈�氳繃锛屽彲浠ヨ窡鑷畾涔夋彁绀�
+          } else {
+            callback(true) // true = 閫氳繃楠岃瘉
+          }
+        } else {
+          callback(true)
+        }
+      },
+
+      handleCancel() {
         this.selectedRowKeys = []
         this.visible = false
-      }
+      },
+      //鏍囧噯閫夋嫨鍙樺寲
+      loadDetail(orderId) {
+        if (orderId) {
+          getAction(this.url.detailList, { orderId: orderId })
+            .then(res => {
+              if (res.success) {
+                this.detail.dataSource = [...res.result]
+              }
+            })
+            .finally(() => {
+              this.spinning = false
+            })
+        }
+      },
+      handlePreview: function (fileJson) {
+        if(fileJson) {
+          let obj = JSON.parse(fileJson)
+          if(obj.filePath) {
+            this.$refs.lxFilePreview.preview(obj.filePath);
+          }else {
+            that.$message.warning('娌℃湁涓婁紶鎿嶄綔鎸囧鍥剧墖')
+          }
+        }else {
+          that.$message.warning('娌℃湁涓婁紶鎿嶄綔鎸囧鍥剧墖')
+        }
+
+      },
     }
   }
 </script>
 <style scoped>
-  .btn-custom {
-    background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
-    color: #fff; /* 鐧借壊鏂囧瓧 */
-  }
-
   /deep/ .ant-select-dropdown-menu {
     text-align: left;
   }

--
Gitblit v1.9.3