From e4faae7013473a55ed9fef7c5f4359365e2958ff Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 21 四月 2025 11:24:32 +0800
Subject: [PATCH] 1、我的待办页面 设备点检 分类审批新增添加点检照片功能 2、我的待办页面 设备周保流程 分类审批弹窗功能逻辑开发并复用至我的已办页面 3、我的待办页面 设备维修 分类审批弹窗样式与其他保持一致 4、故障保修调整保修图片上传逻辑 5、保养标准页面 调整导入对应的方法名

---
 src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue |  337 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 171 insertions(+), 166 deletions(-)

diff --git a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
index 98b7bea..f158743 100644
--- a/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
+++ b/src/views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue
@@ -1,140 +1,158 @@
 <template>
   <a-modal
-    :width="1000"
+    :width="1200"
     :visible="visible"
+    :title="title"
     @cancel="handCancel"
+    @ok="submitForm"
     :mask-closable="false"
     centered
   >
-    <a-card :bordered="false">
-      <div>
-        <b>{{ selectShenpiData.title }}</b>
-        <br/>
-        <br/>
-        <a-tag color="blue">
-          澶勭悊浜� {{ selectShenpiData.assignee }}
-        </a-tag>
-        <a-tag color="blue">
-          鍒涘缓鏃堕棿 {{ selectShenpiData.createTime }}
-        </a-tag>
-        <br>
-        <br>
-        <a-button @click="fetchAndShowBmp" :loading="showBmpButtonLoading" class="btn-custom">娴佺▼鍥�</a-button>
-        <div v-if="imageSrc&&isDisplayBmp">
-          <img :src="imageSrc" alt="Fetched Image"/>
-        </div>
-        <hr class="shallow-hr"/>
-      </div>
-      <div>
-        <b>鎸囨淳璇︽儏</b>
-        <br>
-        <a-form :form='form'>
-          <a-spin :spinning="spinning">
-            <a-tabs default-active-key='1'>
-              <a-tab-pane key='1' tab='鍩烘湰淇℃伅'>
-                <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules' :labelCol='labelCol'
-                              :wrapperCol='wrapperCol'>
-                  <a-row>
-                    <a-col :span='span'>
-                      <a-form-model-item label='宸ュ崟缂栧彿'>
-                        <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairCode'/>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col :span='span'>
-                      <a-form-model-item label='璁惧缂栧彿'>
-                        <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.equipmentId_dictText'/>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col :span='span'>
-                      <a-form-model-item label='鍗曟嵁鐘舵��'>
-                        <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairStatus_dictText'/>
-                      </a-form-model-item>
-                    </a-col>
-                    <a-col :span='span'>
-                      <a-form-model-item label='缁翠慨璐熻矗浜�'>
-                        <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairer'/>
-                      </a-form-model-item>
-                    </a-col>
-                  </a-row>
-                </a-form-model>
-              </a-tab-pane>
+    <a-spin :spinning="spinning">
+      <a-form-model :model='tableRowRecord' :rules='validatorRules' :labelCol='labelCol'
+                    :wrapperCol='wrapperCol'>
+        <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">鎶ヤ慨鍩虹淇℃伅</a-divider>
 
-              <a-tab-pane key='2' 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.startTime}}</p>
-                        <p>缁撴潫鏃堕棿锛歿{item.endTime}}</p>
-                        <p>澶勭悊浜猴細{{item.assignee}}</p>
-                        <p>鍔炵悊绫诲瀷锛歿{item.bllx_dictText}}</p>
-                        <p v-if="item.name == '鎻愪氦鐢宠'">鎸囨淳鍘熷洜锛歿{item.cause}}</p>
-                        <p v-else>澶勭悊鎰忚锛歿{item.cause}}</p>
-                        <div class="left_qiu"><span>{{item.name}}</span></div>
-                      </div>
-                    </a-timeline-item>
-                  </a-timeline>
-                </a-card>
-              </a-tab-pane>
-            </a-tabs>
-          </a-spin>
-        </a-form>
-      </div>
-      <div>
-        <hr class="shallow-hr">
-        <br>
-        <b>瀹℃壒璇︽儏</b>
-        <br>
-        <br>
-        <a-form-model ref="form" :model="approveData" :rules="validatorRules" :labelCol='labelCol'
-                      :wrapperCol='wrapperCol'>
+        <a-row>
+          <a-col :span='threeColSpan'>
+            <a-form-model-item label='宸ュ崟缂栧彿'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairCode'/>
+            </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-col :span='threeColSpan'>
+            <a-form-model-item label='鍗曟嵁鐘舵��'>
+              <a-input :readOnly='inputReadOnly' v-model='tableRowRecord.repairStatus_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'/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="threeColSpan">
+            <a-form-model-item label="鏁呴殰寮�濮嬫椂闂�">
+              <a-input :readOnly='inputReadOnly' v-model="tableRowRecord.faultStartTime"/>
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :span="threeColSpan">
+            <a-form-model-item label="鏄惁鍋滄満">
+              <j-dict-select-tag type='radio' v-model='tableRowRecord.breakdownFlag' dictCode='breakdown_flag'
+                                 disabled/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row>
+          <a-col :span='threeColSpan*3'>
+            <a-form-model-item label='鎶ヤ慨鍥剧墖' :labelCol='labelColLong' :wrapperCol='wrapperColLong'>
+              <j-image-upload v-model="tableRowRecord.imageFiles" disabled :is-multiple="true" :number="3"/>
+            </a-form-model-item>
+          </a-col>
+        </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="棰嗙敤澶囦欢">
+            <a-form-model ref="form" :model="approveData" :rules="validatorRules" :labelCol='labelCol'
+                          :wrapperCol='wrapperCol'>
+              <a-row>
+                <a-col :span="twoColSpan*2">
+                  <a-form-model-item label="鏄惁闇�瑕侀鐢ㄥ浠�" prop="status">
+                    <a-radio-group v-model="approveData.status">
+                      <a-radio :value="1">鏄�</a-radio>
+                      <a-radio :value="0">鍚�</a-radio>
+                    </a-radio-group>
+                  </a-form-model-item>
+                </a-col>
+
+                <template v-if="approveData.status===0">
+                  <a-col :span="twoColSpan*2">
+                    <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason">
+                      <a-input v-model="approveData.faultReason" rows="4" placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span="twoColSpan*2">
+                    <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairResultDescription">
+                      <a-textarea v-model="approveData.repairResultDescription" placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span="twoColSpan*2">
+                    <a-form-model-item label="缁翠慨鍥剧墖">
+                      <j-image-upload v-model="approveData.imageFiles" :is-multiple="true" :number="3"/>
+                    </a-form-model-item>
+                  </a-col>
+                </template>
+              </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-tab-pane key='3' tab='娴佺▼鍥�'>
+            <img :src="imageSrc" alt="Fetched Image"/>-->
+          </a-tab-pane>
+        </a-tabs>
+
+        <template>
+          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;">绠$悊鍛橀鐢ㄥ浠�
+          </a-divider>
+
           <a-row>
-            <a-col :span="24">
-              <a-form-model-item label="鏄惁闇�瑕侀鐢ㄥ浠�" prop="status">
-                <a-radio-group v-model="approveData.status">
-                  <a-radio :value="1">鏄�</a-radio>
-                  <a-radio :value="0">鍚�</a-radio>
-                </a-radio-group>
+            <a-col :span="twoColSpan">
+              <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="璇烽�夋嫨澶勭悊绫诲瀷"/>
               </a-form-model-item>
             </a-col>
 
-            <template v-if="approveData.status===0">
-              <a-col :span="24">
-                <a-form-model-item label="鏁呴殰鍘熷洜" prop="faultReason">
-                  <a-input v-model="approveData.faultReason" rows="4" placeholder="璇疯緭鍏ユ晠闅滃師鍥�"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24">
-                <a-form-model-item label="缁翠慨缁撴灉鎻忚堪" prop="repairResultDescription">
-                  <a-textarea v-model="approveData.repairResultDescription" placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�"/>
-                </a-form-model-item>
-              </a-col>
-              <a-col :span="24">
-                <a-form-model-item label="缁翠慨鍥剧墖">
-                  <j-image-upload v-model="approveData.imageFiles" :is-multiple="true" :number="3"/>
-                </a-form-model-item>
-              </a-col>
-            </template>
+            <a-col :span="twoColSpan">
+              <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>
-        </a-form-model>
-      </div>
-    </a-card>
+        </template>
 
-    <template slot="footer">
-      <div>
-        <a-button @click="handCancel">鍙栨秷</a-button>
-        <a-button @click="submitForm" type="primary">鎻� 浜�</a-button>
-      </div>
-    </template>
+      </a-form-model>
+    </a-spin>
   </a-modal>
 </template>
 
 <script>
   import '@assets/less/TableExpand.less'
   import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
+  import LxSearchEquipmentSelect from '../../../eam/equipment/modules/LxSearchEquipmentSelect'
 
   export default {
     name: 'RepairOrderApprovalModal',
+    components: { LxSearchEquipmentSelect },
     props: {
       selectShenpiData: {
         type: Object,
@@ -143,21 +161,32 @@
     },
     data() {
       return {
+        title: '',
         form: this.$form.createForm(this),
-        span: 12,
+        threeColSpan: 8,
+        twoColSpan: 12,
         inputReadOnly: true,
+        disableSubmit: false,
         spinning: false,
         tableRowRecord: {},
-        assignFileStream: {},
         hitaskDataSource: [],
         imageSrc: null,
+        activeTabKey: '1',
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 5 }
+          sm: { span: 6 }
         },
         wrapperCol: {
           xs: { span: 24 },
           sm: { span: 16 }
+        },
+        labelColLong: {
+          xs: { span: 24 },
+          sm: { span: 2 }
+        },
+        wrapperColLong: {
+          xs: { span: 24 },
+          sm: { span: 20 }
         },
         validatorRules: {
           status: [
@@ -171,7 +200,6 @@
           ]
         },
         approveData: {},
-        flowData: {},
         visible: false,
         // 琛ㄥご
         url: {
@@ -179,25 +207,36 @@
           diagramView: '/assign/flow/diagramView',
           queryHisTaskList: '/assign/flow/queryHisTaskList',
           approve: '/activit/assign/file/approve'
-        },
-        isDisplayBmp: false,
-        showBmpButtonLoading: false
+        }
       }
-    },
-    created() {
     },
     methods: {
       /**
-       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
+       * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘
        * @param record 寰呭姙璁板綍淇℃伅
        */
       getAllApproveData(record) {
-        console.log('selectShenpiData----->', this.selectShenpiData)
-        this.flowData = Object.assign({}, record)
-        const param = { 'procInstId': record.dataId }
+        console.log('record----->', record)
+        const { procInstId, processDefinitionId, processInstanceId, processDefinitionKey } = record
+        const param = { procInstId }
+        const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
+        const that = this
+
         getAction(this.url.queryHisTaskList, param)
           .then(res => {
-            this.hitaskDataSource = res.result
+            that.hitaskDataSource = res.result
+          })
+
+        downFile(this.url.diagramView, imageParam, 'get')
+          .then((res => {
+            const urlObject = window.URL.createObjectURL(new Blob([res]))
+            that.imageSrc = urlObject
+          }))
+          .catch(err => {
+            that.$notification.error({
+              message: '娑堟伅',
+              description: res.message
+            })
           })
       },
 
@@ -209,7 +248,9 @@
         this.spinning = true
         const that = this
         const param = { id: record.dataId }
-        this.tableRowRecord = this.approveData = {}
+        this.tableRowRecord = {}
+        this.approveData = { status: 0 }
+        this.activeTabKey = '1'
         getAction(this.url.queryBomDataById, param)
           .then((res => {
             if (res.success) {
@@ -220,34 +261,6 @@
           .finally(() => {
             that.spinning = false
           })
-      },
-
-      // 鑾峰彇骞跺睍寮�娴佺▼鍥�
-      fetchAndShowBmp() {
-        this.isDisplayBmp = !this.isDisplayBmp
-        if (!this.imageSrc) {
-          this.showBmpButtonLoading = true
-          const that = this
-          let param = {
-            processDefinitionId: this.flowData.processDefinitionId,
-            processInstanceId: this.flowData.processInstanceId,
-            TaskDefinitionKey: this.flowData.processDefinitionKey
-          }
-          downFile(this.url.diagramView, param, 'get')
-            .then((res => {
-              const urlObject = window.URL.createObjectURL(new Blob([res]))
-              this.imageSrc = urlObject
-            }))
-            .catch(err => {
-              that.$notification.error({
-                message: '娑堟伅',
-                description: res.message
-              })
-            })
-            .finally(() => {
-              this.showBmpButtonLoading = false
-            })
-        }
       },
 
       submitForm() {
@@ -285,20 +298,12 @@
 
       handCancel() {
         this.visible = false
-        this.isDisplayBmp = false
-        this.imageSrc = null
+        this.$refs.form.clearValidate()
       }
     }
   }
 </script>
 <style scoped>
-  .shallow-hr {
-    border: 0;
-    height: 1px; /* 鍒嗙晫绾跨殑楂樺害 */
-    background-color: rgba(0, 0, 0, 0.1); /* 浣跨敤 RGBA 棰滆壊锛屽苟璁剧疆杈冧綆鐨勯�忔槑搴� */
-    margin: 20px 0; /* 鍒嗙晫绾夸笂涓嬬殑澶栬竟璺� */
-  }
-
   .btn-custom {
     background-color: #4CAF50; /* 缁胯壊鑳屾櫙 */
     color: #fff; /* 鐧借壊鏂囧瓧 */

--
Gitblit v1.9.3