From c4bd5940bcd71de72d05c341a110e8eb7e9346a1 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 02 六月 2025 09:57:20 +0800
Subject: [PATCH] art: 工作流-维修审批详情修改

---
 src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue |  117 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 84 insertions(+), 33 deletions(-)

diff --git a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
index 07f5254..d1b9f35 100644
--- a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
+++ b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
@@ -1,11 +1,13 @@
 <template>
-  <a-modal
+  <j-modal
     :width="1200"
     :visible="visible"
     :title="title"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handCancel"
     @ok="submitForm"
     :mask-closable="false"
+    :confirmLoading="confirmLoading"
     centered
   >
     <a-spin :spinning="spinning">
@@ -20,13 +22,47 @@
             </a-form-model-item>
           </a-col>
           <a-col :span='threeColSpan'>
+            <a-form-model-item label='宸ュ崟鐘舵��'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairStatus_dictText'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='threeColSpan'>
             <a-form-model-item label='璁惧缂栧彿'>
               <lx-search-equipment-select disabled v-model='tableRowRecord.equipmentId'/>
             </a-form-model-item>
           </a-col>
+        </a-row>
+        <a-row>
           <a-col :span='threeColSpan'>
-            <a-form-model-item label='缁翠慨璐熻矗浜�'>
-              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer'/>
+            <a-form-model-item label='瀹夎浣嶇疆'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.installationPosition_dictText'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='鎶ヤ慨浜�'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.reporter_dictText'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='鎶ヤ慨浜虹數璇�'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.reporterPhone_dictText'/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='缁翠慨浜�'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer_dictText'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='缁翠慨浜虹數璇�'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairerPhone_dictText'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='鏁呴殰绠�绉�'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.faultName'/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -45,7 +81,13 @@
             </a-form-model-item>
           </a-col>
         </a-row>
-
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item label='鏁呴殰鎻忚堪' :labelCol='labelColLong' :wrapperCol='wrapperColLong'>
+              <a-textarea :readOnly='inputReadOnly' v-model='tableRowRecord.faultDescription'/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
         <a-row>
           <a-col :span='threeColSpan*3'>
             <a-form-model-item label='鎶ヤ慨鍥剧墖' :labelCol='labelColLong' :wrapperCol='wrapperColLong'>
@@ -62,7 +104,8 @@
             <a-row>
               <a-col :span="twoColSpan*2">
                 <a-form-model-item label="鏄惁闇�瑕侀鐢ㄥ浠�" prop="isUseSpare">
-                  <a-radio-group v-model="tableRowRecord.isUseSpare">
+                  <a-radio-group v-model="tableRowRecord.isUseSpare"
+                                 :disabled="isDisableUseSpare">
                     <a-radio :value="1">鏄�</a-radio>
                     <a-radio :value="0">鍚�</a-radio>
                   </a-radio-group>
@@ -95,42 +138,44 @@
             </a-row>
           </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>
+          <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>
+            <a-tab-pane key='3' tab='娴佺▼鍥�'>
+              <img :src="imageSrc" alt="Fetched Image"/>-->
+            </a-tab-pane>
+          </template>
         </a-tabs>
 
-        <template v-if="isDisplayConfirmSpare">
+        <template v-if="tableRowRecord.isUseSpare===1&&isDisableUseSpare">
           <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">绠$悊鍛橀鐢ㄥ浠�
           </a-divider>
 
           <a-row>
             <a-col :span="twoColSpan*2">
               <a-form-model-item prop="sparePartDescription" label="澶囦欢鎻忚堪">
-                <a-textarea :readOnly="disableSubmit||tableRowRecord.repairStatus!=='WAIT_SPARES'"
-                            v-model="tableRowRecord.sparePartDescription"/>
+                <a-textarea placeholder="璇疯緭鍏ュ浠舵弿杩�" :readOnly="disableSubmit||tableRowRecord.repairStatus!=='WAIT_SPARES'"
+                            v-model="tableRowRecord.sparePartDescription"></a-textarea>
               </a-form-model-item>
             </a-col>
           </a-row>
         </template>
 
-        <template v-if="tableRowRecord.sparePartDescription">
+        <template v-if="Boolean(tableRowRecord.sparePartDescription)&&isDisplayRepairResult">
           <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">缁翠慨缁撴灉涓婃姤</a-divider>
           <a-row>
             <a-col :span="twoColSpan*2">
@@ -163,7 +208,7 @@
         </template>
       </a-form-model>
     </a-spin>
-  </a-modal>
+  </j-modal>
 </template>
 
 <script>
@@ -187,6 +232,7 @@
         twoColSpan: 12,
         inputReadOnly: true,
         disableSubmit: false,
+        confirmLoading: false,
         spinning: false,
         tableRowRecord: {},
         hitaskDataSource: [],
@@ -234,8 +280,11 @@
       }
     },
     computed: {
-      isDisplayConfirmSpare() {
-        return ['WAIT_SPARES', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
+      isDisableUseSpare() {
+        return this.disableSubmit || this.tableRowRecord.repairStatus !== 'UNDER_REPAIR' || Boolean(this.tableRowRecord.sparePartDescription)
+      },
+      isDisplayRepairResult() {
+        return ['UNDER_REPAIR', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
       },
       isDisableSubmitRepairResult() {
         return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.tableRowRecord.repairStatus)
@@ -247,6 +296,7 @@
        * @param record 寰呭姙璁板綍淇℃伅
        */
       getAllApproveData(record) {
+        if (!record.procInstId) return
         console.log('record----->', record)
         const { procInstId, processDefinitionId, processInstanceId, processDefinitionKey } = record
         const param = { procInstId }
@@ -302,7 +352,7 @@
         // 瑙﹀彂琛ㄥ崟楠岃瘉
         this.$refs.form.validate(valid => {
           if (valid) {
-            that.confirmLoading = true
+            that.confirmLoading = that.spinning = true
             const { isUseSpare, faultReason, repairDescription, sparePartDescription, imageFiles, equipmentId } = that.tableRowRecord
             const { dataId, id, procInstId, taskDefKey, variables } = that.selectShenpiData
 
@@ -324,12 +374,13 @@
               .then((res) => {
                 if (res.success) {
                   that.$message.success(res.message)
-                  that.$emit('ok')
+                  that.handCancel()
+                  that.$emit('searchReset')
                 } else {
                   that.$message.warning(res.message)
                 }
               }).finally(() => {
-              that.confirmLoading = false
+              that.confirmLoading = that.spinning = false
             })
           } else {
             return false

--
Gitblit v1.9.3