From 76029cd765175055f1b05c22f86914b8c6726e89 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期日, 27 四月 2025 16:25:13 +0800
Subject: [PATCH] art: 我的待办-批量审批-代码迁移

---
 src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue |  208 ++++++++++++++++++++
 src/views/flowable/workflow/InspectionOrder/InspectionOrderBatchHandle.vue        |  161 ++++++++++++++++
 src/views/eam/repair/EamReportRepairList.vue                                      |   23 ++
 src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue      |   74 +++++++
 src/views/flowable/workflow/FlowTodo.vue                                          |  124 ++++++++---
 src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue      |    2 
 6 files changed, 551 insertions(+), 41 deletions(-)

diff --git a/src/views/eam/repair/EamReportRepairList.vue b/src/views/eam/repair/EamReportRepairList.vue
index 8e41d23..54655ba 100644
--- a/src/views/eam/repair/EamReportRepairList.vue
+++ b/src/views/eam/repair/EamReportRepairList.vue
@@ -61,8 +61,8 @@
       <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
       <!--<a-button type="primary" icon="download" @click="handleExportXls('鏁呴殰鎶ヤ慨')">瀵煎嚭</a-button>-->
       <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
-                <!--@change="handleImportExcel">-->
-        <!--<a-button type="primary" icon="import">瀵煎叆</a-button>-->
+      <!--@change="handleImportExcel">-->
+      <!--<a-button type="primary" icon="import">瀵煎叆</a-button>-->
       <!--</a-upload>-->
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
@@ -107,6 +107,10 @@
 
           <a-divider type="vertical"/>
 
+          <a @click="handleAssign(record)">鎸囨淳</a>
+
+          <a-divider type="vertical"/>
+
           <a-popconfirm title="纭畾浣滃簾鍚�?" @confirm="() => handleDelete(record.id)">
             <a>浣滃簾</a>
           </a-popconfirm>
@@ -121,6 +125,8 @@
                            @ok="modalFormOk"/>
     <!-- 鍥剧墖棰勮寮圭獥 -->
     <images-preview-modal ref="imagesPreviewModalRef" :imageListUrl="currentImageListUrl"/>
+    <!--鎸囨淳鎶ヤ慨寮圭獥-->
+    <assign-repair-report-modal ref="assignRepairReportModalRef" @ok="modalFormOk"/>
   </a-card>
 </template>
 
@@ -132,12 +138,14 @@
   import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
   import ImagesPreviewModal from '@views/eam/repair/modules/ImagesPreviewModal.vue'
   import { getAction } from '@/api/manage'
+  import AssignRepairReportModal from './modules/EamReportRepairList/AssignRepairReportModal'
 
 
   export default {
     name: 'EamReportRepairList',
     mixins: [JeecgListMixin],
     components: {
+      AssignRepairReportModal,
       ImagesPreviewModal,
       LxSearchEquipmentSelect,
       EamReportRepairModal
@@ -252,7 +260,7 @@
           dataIndex: 'action',
           align: 'center',
           scopedSlots: { customRender: 'action' },
-          width: 150
+          width: 200
         }
         this.columns = [...this.columns, operationColumn]
         this.getFaultReasonListByApi()
@@ -307,6 +315,15 @@
         this.$refs.imagesPreviewModalRef.visible = true
       },
 
+      /**
+       * 鎸囨淳鎶ヤ慨鍗�
+       * @param record 琛ㄦ牸琛屼俊鎭�
+       */
+      handleAssign(record) {
+        this.$refs.assignRepairReportModalRef.visible = true
+        this.$refs.assignRepairReportModalRef.model = Object.assign({}, { id: record.id })
+      },
+
       getCheckboxProps(record) {
         return {
           props: {
diff --git a/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue b/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue
new file mode 100644
index 0000000..5951a14
--- /dev/null
+++ b/src/views/eam/repair/modules/EamReportRepairList/AssignRepairReportModal.vue
@@ -0,0 +1,74 @@
+<template>
+  <j-modal :visible="visible" title="鎸囨淳鎶ヤ慨" :width="500" @ok="handleSubmit" @cancel="handleCancel"
+           :confirmLoading="confirmLoading">
+    <a-spin :spinning="confirmLoading">
+      <a-form-model ref="form" :model="model" :rules="validateRules" :labelCol="{span:4}" :wrapperCol="{span:18}">
+        <a-form-model-item label="缁翠慨宸�" prop="repairer">
+          <j-search-select-tag v-model="model.repairer" placeholder="璇烽�夋嫨缁翠慨宸�"
+                               dict="sys_user,realname, username, del_flag=0 and post='PCR0002' and status=1"/>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  import { postAction } from '@/api/manage'
+
+  export default {
+    name: 'AssignRepairReportModal',
+    data() {
+      return {
+        visible: false,
+        confirmLoading: false,
+        model: {},
+        validateRules: {
+          repairer: [
+            { required: true, message: '璇烽�夋嫨缁翠慨宸�' }
+          ]
+        },
+        url: {
+          assign: '/eam/eamRepairOrder/assign'
+        }
+      }
+    },
+    methods: {
+      handleSubmit() {
+        const that = this
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true
+            postAction(that.url.assign, that.model)
+              .then(res => {
+                if (res.success) {
+                  that.$message.success(res.message)
+                  that.handleCancel()
+                  that.$emit('ok')
+                } else {
+                  that.$message.warning(res.message)
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = false
+              })
+          } else {
+            return false
+          }
+        })
+      },
+
+      handleCancel() {
+        this.visible = false
+      }
+    }
+  }
+</script>
+
+<style scoped>
+  .container {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-content: center;
+  }
+</style>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue
index 8f8957a..22eb578 100644
--- a/src/views/flowable/workflow/FlowTodo.vue
+++ b/src/views/flowable/workflow/FlowTodo.vue
@@ -15,11 +15,11 @@
                                  dictCode="flow_type"></j-dict-select-tag>
             </a-form-item>
           </a-col>
-          <a-col :xl="4" :lg="6" :md="8" :sm="24">
-            <a-form-item label="娴佺▼鍚嶇О">
-              <a-input placeholder="璇疯緭鍏ユ祦绋嬪悕绉�" v-model="queryParam.flowName"></a-input>
-            </a-form-item>
-          </a-col>
+          <!--<a-col :xl="4" :lg="6" :md="8" :sm="24">-->
+          <!--<a-form-item label="娴佺▼鍚嶇О">-->
+          <!--<a-input placeholder="璇疯緭鍏ユ祦绋嬪悕绉�" v-model="queryParam.flowName"></a-input>-->
+          <!--</a-form-item>-->
+          <!--</a-col>-->
           <a-col :xl="4" :lg="6" :md="8" :sm="24">
             <a-form-item label="褰撳墠鑺傜偣">
               <a-input placeholder="璇疯緭鍏ュ綋鍓嶈妭鐐圭簿纭煡璇�" v-model="queryParam.name"></a-input>
@@ -33,10 +33,12 @@
           <template v-if="toggleSearchStatus">
             <a-col :xl="8" :lg="8" :md="12" :sm="24">
               <a-form-item label="浠诲姟鏃堕棿鑼冨洿">
-                <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�" class="query-group-cust"
+                <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨寮�濮嬫椂闂�"
+                        class="query-group-cust"
                         v-model="queryParam.startTime"></j-date>
                 <span class="query-group-split-cust"></span>
-                <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿" class="query-group-cust"
+                <j-date :show-time="false" date-format="YYYY-MM-DD HH:mm:ss" placeholder="璇烽�夋嫨缁撴潫鏃堕棿"
+                        class="query-group-cust"
                         v-model="queryParam.endTime"></j-date>
               </a-form-item>
             </a-col>
@@ -100,12 +102,20 @@
       </a-table>
     </div>
 
+    <!--鍗曚釜娴佺▼澶勭悊-->
     <InspectionOrderHandle ref="modalFormInspectionOrder" :selectShenpiData="selectInspectionOrderData"
                            @searchReset="searchReset"></InspectionOrderHandle>
     <week-maintenance-approval-modal ref="weekMaintenanceApprovalModal" :selectShenpiData="selectWeekMaintenanceData"
                                      @searchReset="searchReset"></week-maintenance-approval-modal>
     <repair-order-approval-modal ref="repairOrderApprovalModal" @searchReset="searchReset"
                                  :selectShenpiData="selectRepairOrderData"></repair-order-approval-modal>
+
+    <!--鎵归噺澶勭悊-->
+    <inspection-order-batch-handle ref="inspectionOrderBatchHandleRef" @searchReset="searchReset"
+                                   :taskList="selectionRows"/>
+
+    <week-maintenance-batch-approval-modal ref="weenMaintenanceBatchApprovalModalRef" @searchReset="searchReset"
+                                           :taskList="selectionRows"/>
   </a-card>
 </template>
 
@@ -120,11 +130,15 @@
   import InspectionOrderHandle from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue'
 
   import { getAction } from '@api/manage'
+  import InspectionOrderBatchHandle from './InspectionOrder/InspectionOrderBatchHandle'
+  import WeekMaintenanceBatchApprovalModal from './weekMaintenance/WeekMaintenanceBatchApprovalModal'
 
   export default {
     name: 'NcDeviceCharactersList',
     mixins: [JeecgListMixin, mixinDevice],
     components: {
+      WeekMaintenanceBatchApprovalModal,
+      InspectionOrderBatchHandle,
       JDictSelectTag,
       WeekMaintenanceApprovalModal,
       RepairOrderApprovalModal,
@@ -148,7 +162,7 @@
           {
             title: '娴佺▼鍒嗙被',
             align: 'center',
-            dataIndex: 'category_dictText',
+            dataIndex: 'category_dictText'
           },
           {
             title: '娴佺▼鍚嶇О',
@@ -221,6 +235,40 @@
       }
     },
     methods: {
+      loadData(arg) {
+        if (!this.url.list) {
+          this.$message.error('璇疯缃畊rl.list灞炴��!')
+          return
+        }
+        //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭
+        if (arg === 1) {
+          this.ipagination.current = 1
+        }
+        var params = this.getQueryParams()//鏌ヨ鏉′欢
+        if (!params) {
+          return false
+        }
+        this.loading = true
+        getAction(this.url.list, params).then((res) => {
+          if (res.success) {
+            // console.log(res)
+            //update-begin---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+            this.dataSource = res.result.records || res.result
+            if (res.result.total) {
+              this.ipagination.total = res.result.total
+            } else {
+              this.ipagination.total = 0
+            }
+            if (this.selectedRowKeys.length > 0) this.selectedRowKeys = this.selectionRows = []
+            //update-end---author:zhangyafei    Date:20201118  for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------
+          } else {
+            this.$message.warning(res.message)
+          }
+        }).finally(() => {
+          this.loading = false
+        })
+      },
+
       handelDetail(item, index) {
         console.log('鐐瑰嚮浜嗚鎯�')
         console.log('item----->', item)
@@ -241,6 +289,37 @@
             alert('娌℃壘鍒拌娴佺▼')
         }
       },
+
+      batchHandle() {
+        const categorySet = new Set(this.selectionRows.map(item => item.category))
+        const nameSet = new Set(this.selectionRows.map(item => item.name))
+        if (categorySet.size !== 1 || nameSet.size !== 1) {
+          this.$notification.info({
+            message: '娑堟伅',
+            description: '璇烽�夋嫨鍚屼竴娴佺▼鍒嗙被涓嬬殑鍚屼竴褰撳墠鑺傜偣'
+          })
+          return
+        }
+
+        if (categorySet.has('eam_repair')) {
+          this.$notification.info({
+            message: '娑堟伅',
+            description: '璁惧缁翠慨娴佺▼鏃犳硶鎵归噺澶勭悊'
+          })
+          return
+        }
+
+        if (categorySet.has('sbdjApproval')) {
+          this.$refs.inspectionOrderBatchHandleRef.visible = true
+          this.$refs.inspectionOrderBatchHandleRef.title = this.selectionRows[0].name
+          this.$refs.inspectionOrderBatchHandleRef.getAllApproveData(this.selectionRows[0])
+          this.$refs.inspectionOrderBatchHandleRef.getBasicInformation(this.selectionRows[0])
+        } else if (categorySet.has('WEEK_MAINTENANCE')) {
+          this.$refs.weenMaintenanceBatchApprovalModalRef.handleDetail(this.selectionRows[0])
+          this.$refs.weenMaintenanceBatchApprovalModalRef.title = this.selectionRows[0].name
+        }
+      },
+
       splitAprocessType(title) {
         let parts = title.split('锛�') // 娉ㄦ剰鍐掑彿鏄叏瑙掑瓧绗︼紝浣跨敤瀵瑰簲鐨勫瓧杩涜鍒嗗壊
         let result = parts[0]
@@ -256,35 +335,6 @@
         this.$refs.modalFormInspectionOrder.getBasicInformation(record)
       },
 
-      batchHandle() {
-        if (this.selectedRowKeys.length <= 0) {
-          this.$notification.warning({
-            message: '娑堟伅',
-            description: '璇烽�夋嫨涓�鏉¤褰�'
-          })
-          return
-        } else {
-          let ids = ''
-          for (var a = 0; a < this.selectedRowKeys.length; a++) {
-            ids += this.selectedRowKeys[a] + ','
-          }
-          getAction(this.url.isSameNode + '?taskIds=' + ids).then((res) => {
-            if (res.success) {
-              let taskDefKey = res.result
-              this.selectBachData.taskIds = ids
-              this.selectBachData.taskDefKey = taskDefKey
-              this.$refs.modalFormDispatchFileBatch.title = '鎵归噺澶勭悊'
-              this.$refs.modalFormDispatchFileBatch.edit(this.selectBachData)
-              this.$refs.modalFormDispatchFileBatch.disableSubmit = false
-            } else {
-              this.$notification.warning({
-                message: '娑堟伅',
-                description: res.message
-              })
-            }
-          })
-        }
-      },
 
       handleWeekMaintenance(item) {
         if (item && item.dataId) {
diff --git a/src/views/flowable/workflow/InspectionOrder/InspectionOrderBatchHandle.vue b/src/views/flowable/workflow/InspectionOrder/InspectionOrderBatchHandle.vue
new file mode 100644
index 0000000..e6698e0
--- /dev/null
+++ b/src/views/flowable/workflow/InspectionOrder/InspectionOrderBatchHandle.vue
@@ -0,0 +1,161 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="1200"
+    :visible="visible"
+    :okButtonProps="{ class:{'jee-hidden': tableRowRecord.inspectionStatus!=='WAIT_CONFIRM'} }"
+    @ok="submitForm"
+    @cancel="handleCancel"
+    :mask-closable="false"
+    :confirmLoading="confirmLoading"
+    switchFullscreen
+    centered
+  >
+    <a-spin :spinning="spinning">
+      <a-tabs>
+        <a-tab-pane key='1' tab='娴佺▼鍥�'>
+          <img :src="imageSrc" alt="娴佺▼鍥捐幏鍙栦腑..."/>
+        </a-tab-pane>
+      </a-tabs>
+
+
+      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
+                    :rules="validatorRules" v-if="tableRowRecord.inspectionStatus==='WAIT_CONFIRM'">
+        <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'/>
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :span="12">
+            <a-form-model-item prop="confirmComment" label="澶勭悊鎰忚">
+              <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�" v-model="tableRowRecord.confirmComment"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  import { getAction, downFile, httpAction } from '@api/manage'
+
+  export default {
+    name: 'InspectionOrderBatchHandle',
+    props: {
+      taskList: {
+        type: Array
+      }
+    },
+    data() {
+      return {
+        confirmLoading: false,
+        spinning: false,
+        tableRowRecord: {},
+        hitaskDataSource: [],
+        validatorRules: {
+          confirmDealType: [
+            { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' }
+          ],
+          confirmComment: [
+            { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' }
+          ]
+        },
+        imageSrc: null,
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 6 }
+        },
+        wrapperCol: {
+          xs: { span: 30 },
+          sm: { span: 16 }
+        },
+        visible: false,
+        // 琛ㄥご
+        url: {
+          diagramView: '/assign/flow/diagramView',
+          batchApprove: '/eam/eamInspectionOrder/batchApproval',
+          queryById: '/eam/eamInspectionOrder/queryById'
+        },
+        title: ''
+      }
+    },
+    methods: {
+      /**
+       * 鑾峰彇娴佺▼鍥�
+       * @param record 寰呭姙璁板綍淇℃伅
+       */
+      getAllApproveData(record) {
+        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, imageParam, 'get')
+            .then((res => {
+              const urlObject = window.URL.createObjectURL(new Blob([res]))
+              that.imageSrc = urlObject
+            }))
+            .catch(err => {
+              that.$notification.error({
+                message: '娑堟伅',
+                description: res.message
+              })
+            })
+        }
+      },
+
+      /**
+       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
+       * @param record 寰呭姙璁板綍淇℃伅
+       */
+      async getBasicInformation(record) {
+        this.spinning = true
+        const param = { id: record.dataId }
+        let res = await getAction(this.url.queryById, param)
+        this.tableRowRecord = Object.assign({}, res.result)
+        this.spinning = false
+      },
+
+      async submitForm() {
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            this.confirmLoading = this.spinning = true
+            const flowTaskVo = {}
+            flowTaskVo.confirmDealType = this.tableRowRecord.confirmDealType
+            flowTaskVo.confirmComment = this.tableRowRecord.confirmComment
+            flowTaskVo.taskList = this.taskList
+            const that = this
+            console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo)
+            httpAction(this.url.batchApprove, 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 = that.spinning = false
+              })
+          } else {
+            return false
+          }
+        })
+      },
+
+      handleCancel() {
+        this.visible = false
+      }
+    }
+  }
+</script>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue
index 612bc6c..fc68d77 100644
--- a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue
+++ b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue
@@ -127,7 +127,7 @@
                 </a-card>
               </a-tab-pane>
               <a-tab-pane key='3' tab='娴佺▼鍥�'>
-                <img :src="imageSrc" alt="Fetched Image"/>-->
+                <img :src="imageSrc" alt="Fetched Image"/>
               </a-tab-pane>
             </template>
             <a-button v-if="!disableSubmit &&!confirmDisable&& selectedRowKeys.length > 0" slot="tabBarExtraContent"
diff --git a/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue
new file mode 100644
index 0000000..a51d614
--- /dev/null
+++ b/src/views/flowable/workflow/weekMaintenance/WeekMaintenanceBatchApprovalModal.vue
@@ -0,0 +1,208 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    :okButtonProps="{ class:{'jee-hidden': !isDisplaySubmitButton} }"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    centered
+    cancelText="鍏抽棴">
+    <a-spin :spinning="spinning">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+        <a-row :gutter="24">
+          <a-tabs>
+            <a-tab-pane key='1' tab='娴佺▼鍥�'>
+              <img :src="imageSrc" alt="娴佺▼鍥捐幏鍙栦腑..."/>
+            </a-tab-pane>
+          </a-tabs>
+        </a-row>
+
+        <div v-if="model.maintenanceStatus==='WAIT_CONFIRM'">
+          <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='model.confirmDealType' dictCode='approved_rejected'
+                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item prop="confirmComment" label="纭鎰忚">
+                <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+
+        <div v-if="model.maintenanceStatus==='WAIT_INITIAL_ACCEPTANCE'">
+          <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="initialAcceptanceComment"
+                                 label="鍒濋獙鏀舵剰瑙�">
+                <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.initialAcceptanceComment"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item prop="initialAcceptanceFilesResult"
+                                 label="鍒濋獙鏀堕檮浠�">
+                <lx-upload :returnUrl="false" :isMultiple="true" v-model="model.initialAcceptanceFilesResult"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+
+        <div v-if="model.maintenanceStatus==='WAIT_FINAL_ACCEPTANCE'">
+          <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="finalAcceptanceComment"
+                                 label="缁堥獙鏀舵剰瑙�">
+                <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.finalAcceptanceComment"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item prop="finalAcceptanceFilesResult"
+                                 label="缁堥獙鏀堕檮浠�">
+                <lx-upload :returnUrl="false" :isMultiple="true" v-model="model.finalAcceptanceFilesResult"/>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  import { downFile, getAction, httpAction } from '@/api/manage'
+
+  export default {
+    name: 'WeekMaintenanceBatchApprovalModal',
+    props: {
+      taskList: {
+        type: Array
+      }
+    },
+    data() {
+      return {
+        title: '',
+        visible: false,
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 6 }
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 }
+        },
+        confirmLoading: false,
+        spinning: false,
+        imageSrc: null,
+        validatorRules: {
+          confirmDealType: [
+            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
+          ],
+          confirmComment: [
+            { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' }
+          ],
+          initialAcceptanceComment: [
+            { required: true, message: '璇疯緭鍏ュ垵楠屾敹鎰忚!' }
+          ],
+          finalAcceptanceComment: [
+            { required: true, message: '璇疯緭鍏ョ粓楠屾敹鎰忚!' }
+          ]
+        },
+        url: {
+          queryById: '/eam/weekMaintenanceOrder/queryById',
+          batchApprove: '/eam/weekMaintenanceOrder/batchApproval',
+          diagramView: '/assign/flow/diagramView'
+        }
+      }
+    },
+    computed: {
+      isDisplaySubmitButton: function() {
+        return ['WAIT_CONFIRM', 'WAIT_INITIAL_ACCEPTANCE', 'WAIT_FINAL_ACCEPTANCE'].includes(this.model.maintenanceStatus)
+      }
+    },
+    methods: {
+      async handleDetail(item) {
+        this.visible = true
+        this.spinning = true
+        this.imageSrc = null
+        if (item.procInstId) {
+          const { processDefinitionId, processInstanceId, processDefinitionKey } = item
+
+          downFile(this.url.diagramView, {
+            processDefinitionId,
+            processInstanceId,
+            TaskDefinitionKey: processDefinitionKey
+          }, 'get')
+            .then((res => {
+              const urlObject = window.URL.createObjectURL(new Blob([res]))
+              this.imageSrc = urlObject
+            }))
+            .catch(err => {
+              this.$notification.error({
+                message: '娑堟伅',
+                description: res.message
+              })
+            })
+        }
+        let res = await getAction(this.url.queryById, { id: item.dataId })
+        this.model = Object.assign({}, res.result)
+        this.spinning = false
+      },
+
+      async handleOk() {
+        const that = this
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = that.spinning = true
+            const { confirmComment, confirmDealType, initialAcceptanceComment, initialAcceptanceFilesResult, finalAcceptanceComment, finalAcceptanceFilesResult } = that.model
+            const params = {}
+            params.taskList = that.taskList
+            params.confirmComment = confirmComment
+            params.confirmDealType = confirmDealType
+            params.initialAcceptanceComment = initialAcceptanceComment
+            params.initialAcceptanceFilesResult = initialAcceptanceFilesResult
+            params.finalAcceptanceComment = finalAcceptanceComment
+            params.finalAcceptanceFilesResult = finalAcceptanceFilesResult
+            console.log('params', params)
+            httpAction(this.url.batchApprove, params, 'post').then((res) => {
+              if (res.success) {
+                that.$message.success(res.message)
+                that.$emit('searchReset')
+                that.close()
+              } else {
+                that.$message.warning(res.message)
+              }
+            }).finally(() => {
+              that.confirmLoading = that.spinning = false
+            })
+          } else {
+            return false
+          }
+        })
+      },
+
+      handleCancel() {
+        this.close()
+      },
+
+      close() {
+        this.$emit('close')
+        this.visible = false
+        if (this.$refs.form) this.$refs.form.clearValidate()
+      }
+    }
+  }
+</script>
\ No newline at end of file

--
Gitblit v1.9.3