From 385e27c9b88f33088bb9dc5e81801c8e9de7e187 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 21 八月 2025 18:11:18 +0800
Subject: [PATCH] 430详情点进流转节点与流程图

---
 src/views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue |  250 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 203 insertions(+), 47 deletions(-)

diff --git a/src/views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue b/src/views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue
index 1eadc4c..e00179b 100644
--- a/src/views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue
+++ b/src/views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue
@@ -73,7 +73,7 @@
                           (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE')">
                 <j-vxe-table ref="editableDetailTable1" :rowNumber="false" rowSelection bordered
                              alwaysEdit keep-source
-                             :dataSource="detail.operatorMaintenanceList" :columns="detail.columns"
+                             :dataSource="detail.operatorMaintenanceList" :columns="getColumns()"
                              @selectRowChange="handleTableSelectRowChange($event,'Operator')">
                   <template v-slot:maintenanceResult="props">
                     <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="maintenance_result"
@@ -95,11 +95,19 @@
                   <template v-slot:reportFlag="props">
                     <j-dict-select-tag v-model="props.row.reportFlag" dictCode="yn" style="width: 100%"
                                        :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!=='1'?'璇烽�夋嫨寮傚父鏄惁鎶ヤ慨':''"
-                                       :disabled="disableSubmit ||
-                                       (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE') ||
-                                        !props.row.maintenanceResult ||
-                                         props.row.maintenanceResult === '1'"/>
+                                       :disabled="true"/>
                   </template>
+
+                  <!-- 鎿嶄綔 -->
+                  <template v-slot:action="props">
+                    <a
+                      v-if="shouldShowActionColumn"
+                      :class="{ 'disabled-link': shouldDisableRepairButton(props.row) }"
+                      @click="!shouldDisableRepairButton(props.row) && handleRepairReporting(props.row)">
+                      鎶ヤ慨濉姤
+                    </a>
+                  </template>
+
                 </j-vxe-table>
               </a-tab-pane>
 
@@ -108,7 +116,7 @@
                           (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE')">
                 <j-vxe-table ref="editableDetailTable2" :rowNumber="false" rowSelection bordered
                              alwaysEdit kee-source
-                             :dataSource="detail.repairerMaintenanceList" :columns="detail.columns"
+                             :dataSource="detail.repairerMaintenanceList" :columns="getColumns()"
                              @selectRowChange="handleTableSelectRowChange($event,'Repairer')">
                   <template v-slot:maintenanceResult="props">
                     <j-dict-select-tag v-model="props.row.maintenanceResult" dictCode="maintenance_result"
@@ -131,35 +139,40 @@
                     <j-dict-select-tag v-model="props.row.reportFlag"
                                        :placeholder="props.row.maintenanceResult&&props.row.maintenanceResult!=='1'?'璇烽�夋嫨寮傚父鏄惁鎶ヤ慨':''"
                                        dictCode="yn" style="width: 100%"
-                                       :disabled="disableSubmit||
-                                       (model.maintenanceStatus&&model.maintenanceStatus!=='UNDER_MAINTENANCE') ||
-                                       !props.row.maintenanceResult ||
-                                        props.row.maintenanceResult === '1'"/>
+                                       :disabled="true"/>
                   </template>
+
+                  <!-- 鎿嶄綔 -->
+                  <template v-slot:action="props">
+                    <a :class="{ 'disabled-link': shouldDisableRepairButton(props.row) }"
+                       @click="!shouldDisableRepairButton(props.row) && handleRepairReporting(props.row)">
+                      鎶ヤ慨濉姤
+                    </a>
+                  </template>
+
                 </j-vxe-table>
               </a-tab-pane>
 
-              <template v-if="selectShenpiData.processDefinitionKey">
-                <a-tab-pane key='3' tab='娴佺▼鍥�'>
-                  <img :src="imageSrc" alt="Fetched Image"/>
+              <template v-if="selectShenpiData.procInstId">
+                <a-tab-pane key='3' tab='娴佺▼鍥�' style="overflow: auto">
+                  <img :src="imageSrc" v-if="imageSrc"/>
+                </a-tab-pane>
+                <a-tab-pane key='4' tab='娴佽浆鑺傜偣'>
+                  <a-card>
+                    <a-timeline style="padding:0 1% 0 12%">
+                      <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1">
+                        <div class="bottom">
+                          <p>澶勭悊浜猴細{{item.assignee_dictText}}</p>
+                          <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p>
+                          <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p>
+                          <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p>
+                          <div class="left_qiu"><span>{{item.taskName}}</span></div>
+                        </div>
+                      </a-timeline-item>
+                    </a-timeline>
+                  </a-card>
                 </a-tab-pane>
               </template>
-
-              <a-tab-pane key='4' tab='娴佽浆鑺傜偣'>
-                <a-card>
-                  <a-timeline style="padding:0 1% 0 12%" >
-                    <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1">
-                      <div class="bottom">
-                        <p>澶勭悊浜猴細{{item.assignee_dictText}}</p>
-                        <p v-if="index1 !==0">澶勭悊鏃堕暱锛歿{item.duration}}</p>
-                        <p v-if="item.name !== '鎻愪氦鐢宠'">澶勭悊绫诲瀷锛歿{item.sequenceFlowName}}</p>
-                        <p v-if="item.description != null">澶勭悊鎰忚锛歿{item.description}}</p>
-                        <div class="left_qiu"><span>{{item.taskName}}</span></div>
-                      </div>
-                    </a-timeline-item>
-                  </a-timeline>
-                </a-card>
-              </a-tab-pane>
 
               <a-button
                 v-if="activeTabKey!=='3'"
@@ -224,6 +237,9 @@
           </a-col>
         </a-row>
       </a-form-model>
+
+      <eamReportRepair-modal ref="modalForm" @ok="handleRepairComplete" @close="handleRepairClose"/>
+
     </a-spin>
   </j-modal>
 </template>
@@ -233,11 +249,13 @@
   import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
   import { JVXETypes } from '@comp/jeecg/JVxeTable'
   import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect'
+  import EamReportRepairModal from '@views/eam/repair/modules/EamReportRepairList/EamReportRepairModal.vue'
 
   export default {
     name: 'SecondMaintenanceApprovalModal',
     mixins: [JVxeTableModelMixin],
     components: {
+      EamReportRepairModal,
       MaintenanceEquipmentSelect
     },
     props: {
@@ -250,6 +268,7 @@
         title: '鎿嶄綔',
         visible: false,
         model: {},
+        currentRepairRow: null,
         labelCol: {
           xs: { span: 24 },
           sm: { span: 6 }
@@ -279,12 +298,12 @@
           detail: '/eam/secondMaintenanceOrderDetail/queryList',
           approval: '/eam/secondMaintenanceOrder/approval',
           diagramView: '/assign/flow/diagramView',
-          queryHisTaskList:'/assign/flow/queryHisTaskList',
+          queryHisTaskList: '/assign/flow/queryHisTaskList'
         },
         disableSubmit: false,
         selectedOperatorMaintenanceRowKeys: [],
         selectedRepairerMaintenanceRowKeys: [],
-        hitaskDataSource:[],
+        hitaskDataSource: [],
         detail: {
           operatorMaintenanceList: [],
           repairerMaintenanceList: [],
@@ -341,6 +360,14 @@
               validateRules: [
                 { handler: this.customValidator }
               ]
+            },
+            {
+              title: '鎿嶄綔',
+              align: 'center',
+              type: JVXETypes.slot,
+              width: 150,
+              slotName: 'action',
+              fixed: 'right'
             }
           ]
         }
@@ -352,9 +379,87 @@
       },
       displayInspectorConfirmFlag() {
         return ['WAIT_INSPECTOR_CONFIRM', 'COMPLETE', 'REJECTED'].includes(this.model.maintenanceStatus) && this.model.manageUserResult === '1'
+      },
+      // 鎿嶄綔鍒椾粎鍦ㄤ繚鍏讳腑鐘舵�佷笅鏄剧ず
+      shouldShowActionColumn() {
+        return this.model.maintenanceStatus === 'UNDER_MAINTENANCE'
       }
     },
     methods: {
+
+      // 娣诲姞鑾峰彇鍒楃殑鏂规硶
+      getColumns() {
+        const columns = [
+          {
+            title: 'ID',
+            key: 'id',
+            type: JVXETypes.hidden
+          },
+          {
+            title: 'orderId',
+            key: 'orderId',
+            type: JVXETypes.hidden
+          },
+          {
+            title: '搴忓彿',
+            key: 'itemCode',
+            type: JVXETypes.normal,
+            width: 60,
+            align: 'center'
+          },
+          {
+            title: '淇濆吇椤�',
+            key: 'itemName',
+            type: JVXETypes.normal,
+            align: 'center'
+          },
+          {
+            title: '淇濆吇缁撴灉',
+            key: 'maintenanceResult',
+            type: JVXETypes.slot,
+            align: 'center',
+            slotName: 'maintenanceResult',
+            validateRules: [
+              { required: true, message: '璇烽�夋嫨${title}' }
+            ]
+          },
+          {
+            title: '寮傚父鎻忚堪',
+            key: 'exceptionDescription',
+            type: JVXETypes.slot,
+            align: 'center',
+            slotName: 'exceptionDescription',
+            validateRules: [
+              { handler: this.customValidator }
+            ]
+          },
+          {
+            title: '鏄惁鎶ヤ慨',
+            key: 'reportFlag',
+            type: JVXETypes.slot,
+            align: 'center',
+            slotName: 'reportFlag',
+            validateRules: [
+              { handler: this.customValidator }
+            ]
+          }
+        ]
+
+        // 浠呭湪淇濆吇涓姸鎬佷笅娣诲姞鎿嶄綔鍒�
+        if (this.shouldShowActionColumn) {
+          columns.push({
+            title: '鎿嶄綔',
+            align: 'center',
+            type: JVXETypes.slot,
+            width: 150,
+            slotName: 'action',
+            fixed: 'right'
+          })
+        }
+
+        return columns
+      },
+
       /**
        * 涓婚〉闈㈢偣鍑绘墽琛屽鎵规椂瑙﹀彂
        * @param record 涓婚〉闈㈠垪琛ㄨ璁板綍
@@ -363,7 +468,6 @@
         this.spinning = true
         this.model = {}
         this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = []
-        this.handleTabToFirstTable()
         this.getBasicInformationByApi(record)
         this.getFlowChartImageByApi(record)
         this.getFlowTaskListByApi(record)
@@ -379,6 +483,7 @@
         this.activeTabKey = 1
         this.detail.operatorMaintenanceList = this.detail.repairerMaintenanceList = []
         this.model = Object.assign({}, record)
+        this.getFlowChartImageByApi(record)
         this.getFlowTaskListByApi(record)
         this.loadDetail(record.id)
       },
@@ -397,6 +502,7 @@
               that.model.taskId = record.id
               that.model.userId = record.assignee
               that.model.instanceId = record.procInstId
+              this.handleTabToFirstTable()
             }
             else {
               that.$notification.warning({
@@ -412,12 +518,11 @@
        * @param record
        */
       getFlowTaskListByApi(record) {
-        console.log("sss",record)
-        let parmhis={
+        let parmhis = {
           'procInstId': record.procInstId
         }
-        getAction(this.url.queryHisTaskList,parmhis).then(res=>{
-          this.hitaskDataSource=res.result
+        getAction(this.url.queryHisTaskList, parmhis).then(res => {
+          this.hitaskDataSource = res.result
         }).finally(
           this.visible = true,
           console.log('this.approveData---->', this.approveData)
@@ -610,6 +715,42 @@
         }
       },
 
+      shouldDisableRepairButton(row) {
+        return (
+          this.model.maintenanceStatus !== 'UNDER_MAINTENANCE' ||
+          row.maintenanceResult === '1' ||
+          row.reportFlag === '1'
+        )
+      },
+
+      handleRepairComplete(success) {
+        if (success && this.currentRepairRow) {
+          this.$set(this.currentRepairRow, 'reportFlag', '1')
+          this.$message.success('鎶ヤ慨宸叉垚鍔熸彁浜�')
+        }
+        this.currentRepairRow = null
+      },
+
+      /**
+       * 寮傚父鎻忚堪濉姤鏁呴殰鎶ヤ慨
+       * @param exceptionDescription
+       */
+      handleRepairReporting(row) {
+        this.currentRepairRow = row // 瀛樺偍褰撳墠鎿嶄綔琛�
+        let record = {
+          faultDescription: row.exceptionDescription,
+          equipmentId: this.model.equipmentId
+        }
+        this.$refs.modalForm.handleRepair(record)
+      },
+
+      handleRepairClose(success) {
+        if (!success && this.currentRepairRow) {
+          this.currentRepairRow = null // 娓呴櫎鏈垚鍔熺殑鎿嶄綔
+        }
+      },
+
+
       handleCancel() {
         this.close()
       },
@@ -648,6 +789,7 @@
       }
     }
   }
+
   /* 鍏ㄥ眬绂侀�夋牱寮� - 浣滅敤浜庢暣涓〉闈� */
   html.submitting,
   html.submitting body {
@@ -693,6 +835,7 @@
     background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */
     margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */
   }
+
   .btn-custom {
     background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
     color: white; /* 鐧借壊鏂囧瓧 */
@@ -711,13 +854,14 @@
     font-weight: bold;
     font-size: 20px; /* 鎴栦綘闇�瑕佺殑浠讳綍澶у皬 */
   }
-  .left_qiu{
+
+  .left_qiu {
     position: absolute;
     left: -74px;
     top: 0;
-    width:54px;
+    width: 54px;
     border-radius: 50%;
-    height:54px;
+    height: 54px;
     font-size: 13px;
     margin: auto;
     display: flex;
@@ -727,20 +871,23 @@
     background: #0099ff;
     transform: translate(0, 0);
   }
-  /deep/ .ant-timeline-item-tail{
+
+  /deep/ .ant-timeline-item-tail {
     left: -29px !important;
   }
-  .left_qiu span{
+
+  .left_qiu span {
     width: 3em;
     display: block;
     color: #fff;
     text-align: center;
   }
-  .img{
+
+  .img {
     width: 75%;
   }
 
-  .wrap{
+  .wrap {
     clear: both;
     width: 100%;
     display: flex;
@@ -748,14 +895,23 @@
     border: 1px solid #ccc;
     /* background-color: aqua; */
   }
-  .box{
-    width:21%;
-    height:50px;
+
+  .box {
+    width: 21%;
+    height: 50px;
     border-right: 1px solid #ccc;
     line-height: 50px;
     /* background: red; */
-    text-align:center;
+    text-align: center;
     margin: auto;
   }
 
+  /* 娣诲姞绂佺敤鏍峰紡 */
+  .disabled-link {
+    color: #999;
+    cursor: not-allowed;
+    pointer-events: none;
+    text-decoration: none;
+  }
+
 </style>
\ No newline at end of file

--
Gitblit v1.9.3