From aeb4d26b6c546f4abfcf31c636b70f40f2e49788 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期六, 05 七月 2025 17:26:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue |  380 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 380 insertions(+), 0 deletions(-)

diff --git a/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue b/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue
new file mode 100644
index 0000000..b8e631e
--- /dev/null
+++ b/src/views/flowable/workflow/MaintenanceStandard/MaintenanceStandardApprovalModal.vue
@@ -0,0 +1,380 @@
+<template>
+  <j-modal :title="title" :visible="visible" fullscreen
+           :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="submitForm"
+           @cancel="handleCancel" :mask-closable="false" :confirmLoading="confirmLoading">
+    <a-spin :spinning="spinning">
+      <a-form-model ref='form' :model='tableRowRecord' :labelCol="labelCol" :wrapperCol="wrapperCol"
+                    :rules="validatorRules">
+        <a-row :gutter="48">
+          <a-col :span="10">
+            <a-tabs default-active-key="1">
+              <a-tab-pane tab="鍩虹淇℃伅" key="1">
+                <a-row>
+                  <a-col :span="span">
+                    <a-form-model-item prop="standardCode" label="瑙勮寖缂栫爜">
+                      <a-input v-model="tableRowRecord.standardCode" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span="span">
+                    <a-form-model-item prop="standardName" label="瑙勮寖鍚嶇О">
+                      <a-input v-model="tableRowRecord.standardName" 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.equipmentCode" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="淇濆吇鍒嗙被">
+                      <a-input v-model="tableRowRecord.maintenanceCategory_dictText" 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.periodUnit" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="淇濆吇鍛ㄦ湡">
+                      <a-input v-model="tableRowRecord.maintenancePeriod" 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.initialDate" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col :span='span'>
+                    <a-form-model-item label="瑙勮寖鐘舵��">
+                      <a-input v-model="tableRowRecord.standardStatus_dictText" 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.standardVersion" readOnly/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-tab-pane>
+
+              <a-tab-pane key="2" tab="淇濆吇椤规槑缁�" forceRender>
+                <j-vxe-table ref="editableDetailTable" :rowNumber="false" :bordered="true"
+                             :alwaysEdit="true" :toolbar="false" keep-source :loading="detail.loading"
+                             :dataSource="detail.dataSource" :columns="detail.columns">
+                  <template v-slot:itemCategory="props">
+                    <j-dict-select-tag v-model="props.row.itemCategory" :dict-code="encodedDictCode" disabled/>
+                  </template>
+                </j-vxe-table>
+              </a-tab-pane>
+            </a-tabs>
+          </a-col>
+
+          <a-col :span="8">
+            <a-tabs>
+              <template v-if="selectShenpiData.procInstId">
+                <a-tab-pane tab='娴佺▼鍥�'>
+                  <img :src="imageSrc" width="100%" v-if="imageSrc"/>
+                </a-tab-pane>
+              </template>
+            </a-tabs>
+          </a-col>
+
+          <a-col :span="6">
+            <a-tabs>
+              <a-tab-pane tab="缁翠慨涓讳换瀹℃壒">
+                <a-row :gutter="24">
+                  <a-col :span="24">
+                    <a-form-model-item prop="repairManagerApproveResult" label="澶勭悊绫诲瀷">
+                      <j-dict-select-tag type='radio' v-model='tableRowRecord.repairManagerApproveResult'
+                                         dictCode='approved_rejected'
+                                         :disabled="disableSubmit||tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'"/>
+                    </a-form-model-item>
+                  </a-col>
+
+                  <a-col :span="24">
+                    <a-form-model-item prop="repairManagerApproveComment" label="澶勭悊鎰忚">
+                      <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�"
+                                  :disabled="disableSubmit||tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'"
+                                  v-model="tableRowRecord.repairManagerApproveComment"/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-tab-pane>
+            </a-tabs>
+
+            <a-tabs v-if="tableRowRecord.standardStatus&&tableRowRecord.standardStatus!=='WAIT_REPAIR_DIRECTOR'">
+              <a-tab-pane tab="鎶�鏈富绠″鎵�">
+                <a-row :gutter="24">
+                  <a-col :span="24">
+                    <a-form-model-item prop="technicalManagerApproveResult" label="澶勭悊绫诲瀷">
+                      <j-dict-select-tag type='radio' v-model='tableRowRecord.technicalManagerApproveResult'
+                                         dictCode='approved_rejected'/>
+                    </a-form-model-item>
+                  </a-col>
+
+                  <a-col :span="24">
+                    <a-form-model-item prop="technicalManagerApproveComment" label="澶勭悊鎰忚">
+                      <a-textarea placeholder="璇疯緭鍏ュ鐞嗘剰瑙�" v-model="tableRowRecord.technicalManagerApproveComment"/>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-tab-pane>
+            </a-tabs>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+  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: 'MaintenanceStandardApprovalModal',
+    components: { MaintenanceEquipmentSelect },
+    props: {
+      selectShenpiData: {
+        type: Object
+      }
+    },
+    data() {
+      return {
+        span: 12,
+        confirmLoading: false,
+        spinning: false,
+        tableRowRecord: {},
+        validatorRules: {
+          repairManagerApproveResult: [
+            { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' }
+          ],
+          repairManagerApproveComment: [
+            { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' }
+          ],
+          technicalManagerApproveResult: [
+            { required: true, message: '璇烽�夋嫨澶勭悊绫诲瀷' }
+          ],
+          technicalManagerApproveComment: [
+            { required: true, message: '璇疯緭鍏ュ鐞嗘剰瑙�' }
+          ]
+        },
+        imageSrc: null,
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 8 }
+        },
+        wrapperCol: {
+          xs: { span: 30 },
+          sm: { span: 16 }
+        },
+        visible: false,
+        // 琛ㄥご
+        url: {
+          diagramView: '/assign/flow/diagramView',
+          queryHisTaskList: '/assign/flow/queryHisTaskList',
+          approve: '/eam/maintenanceStandard/audit',
+          queryById: '/eam/maintenanceStandard/list',
+          detailList: '/eam/eamMaintenanceStandardDetail/queryList'
+        },
+        detail: {
+          loading: false,
+          dataSource: [],
+          columns: [],
+          defaultColumns: [
+            {
+              title: 'ID',
+              key: 'id',
+              type: JVXETypes.hidden
+            },
+            {
+              title: 'standardId',
+              key: 'standardId',
+              type: JVXETypes.hidden
+            },
+            {
+              title: '椤圭洰搴忓彿',
+              key: 'itemCode',
+              type: JVXETypes.inputNumber,
+              align: 'center',
+              disabled: true
+            },
+            {
+              title: '閮ㄤ綅',
+              key: 'itemPart',
+              type: JVXETypes.textarea,
+              align: 'center',
+              disabled: true
+            },
+            {
+              title: '淇濆吇椤瑰垎绫�',
+              key: 'itemCategory',
+              type: JVXETypes.slot,
+              slotName: 'itemCategory',
+              align: 'center'
+            },
+            {
+              title: '淇濆吇椤圭洰',
+              key: 'itemName',
+              type: JVXETypes.textarea,
+              align: 'center',
+              disabled: true
+            },
+            {
+              title: '淇濆吇瑙勮寖鎴栬姹�',
+              key: 'itemDemand',
+              type: JVXETypes.textarea,
+              align: 'center',
+              disabled: true
+            }
+          ]
+        },
+        disableSubmit: false,
+        title: ''
+      }
+    },
+    watch: {
+      'tableRowRecord.maintenanceCategory': {
+        handler(val) {
+          if (val) {
+            if (val != 'THIRD_MAINTENANCE') this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemPart')]
+            else this.detail.columns = [...this.detail.defaultColumns.filter(item => item.key != 'itemCategory')]
+          }
+          else this.detail.columns = [...this.detail.defaultColumns]
+        }
+      }
+    },
+    computed: {
+      encodedDictCode() {
+        const dictCode = `sys_dict_item,item_text,item_value,dict_id='1940598438685134850'`
+        return encodeURIComponent(dictCode)
+      }
+    },
+    methods: {
+      /**
+       * 鑾峰彇娴佺▼鑺傜偣鍜屾祦绋嬪浘
+       * @param record 寰呭姙璁板綍淇℃伅
+       */
+      getAllApproveData(record) {
+        if (record.procInstId) {
+          const { processDefinitionId, processInstanceId, processDefinitionKey, procInstId } = record
+          const imageParam = { processDefinitionId, processInstanceId, TaskDefinitionKey: processDefinitionKey }
+          const that = this
+          this.imageSrc = null
+
+          downFile(this.url.diagramView, imageParam, 'get')
+            .then((res => {
+              const urlObject = window.URL.createObjectURL(new Blob([res]))
+              that.imageSrc = urlObject
+            }))
+            .finally(() => {
+              this.spinning = false
+            })
+        }
+      },
+
+      /**
+       * 鑾峰彇寰呭姙璁板綍鐨勫熀鏈俊鎭�
+       * @param record 寰呭姙璁板綍淇℃伅
+       */
+      async getBasicInformation(record) {
+        this.detail.dataSource = []
+        this.tableRowRecord = {}
+        this.spinning = true
+        const param = { id: record.dataId }
+        let res = await getAction(this.url.queryById, param)
+        this.tableRowRecord = Object.assign({}, res.result.records[0])
+        await this.loadDetail(record.dataId)
+      },
+
+      /**
+       * 鑾峰彇淇濆吇鏄庣粏
+       * @param dataId 涓氬姟ID
+       */
+      loadDetail(dataId) {
+        if (dataId) {
+          getAction(this.url.detailList, { standardId: dataId })
+            .then(res => {
+              if (res.success) {
+                this.detail.dataSource = [...res.result]
+              }
+            })
+        }
+      },
+
+      async submitForm() {
+        let errMap = await this.$refs.editableDetailTable.validateTable()
+        if (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
+            if (this.tableRowRecord.standardStatus == 'WAIT_REPAIR_DIRECTOR') {
+              flowTaskVo.repairManagerApproveResult = this.tableRowRecord.repairManagerApproveResult
+              flowTaskVo.repairManagerApproveComment = this.tableRowRecord.repairManagerApproveComment
+            } else {
+              flowTaskVo.technicalManagerApproveResult = this.tableRowRecord.technicalManagerApproveResult
+              flowTaskVo.technicalManagerApproveComment = this.tableRowRecord.technicalManagerApproveComment
+            }
+            const that = this
+            console.log('琛ㄥ崟鎻愪氦鏁版嵁', flowTaskVo)
+            httpAction(this.url.approve, flowTaskVo, 'post')
+              .then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  //鍒锋柊琛ㄦ牸
+                  that.$emit('modalFormOk')
+                  that.handleCancel()
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = this.spinning = false
+              })
+          } else {
+            return false
+          }
+        })
+      },
+
+      handleCancel() {
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style scoped>
+  /deep/ .ant-select-dropdown-menu {
+    text-align: left;
+  }
+</style>
\ No newline at end of file

--
Gitblit v1.9.3