From d874bd91420c40d3f04b21235486953643d575ed Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 19 五月 2025 09:31:02 +0800
Subject: [PATCH] art: 设备管理-设备处置 借用 列表,流程页面

---
 src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue |  257 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/flowable/workflow/FlowTodo.vue                              |   16 +++
 2 files changed, 272 insertions(+), 1 deletions(-)

diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue
index 758545c..0791ea4 100644
--- a/src/views/flowable/workflow/FlowTodo.vue
+++ b/src/views/flowable/workflow/FlowTodo.vue
@@ -118,6 +118,8 @@
 
     <week-maintenance-batch-approval-modal ref="weenMaintenanceBatchApprovalModalRef" @searchReset="searchReset"
                                            :taskList="selectionRows"/>
+    <equipment-lean-out-approval-modal ref="equipmentLeanOutApprovalModelRef" @searchReset="searchReset"/>
+
   </a-card>
 </template>
 
@@ -138,6 +140,8 @@
   import DispatchFileHandle from '@views/flowable/workflow/dispatchFile/DispatchFileHandle.vue'
   import DispatchFileBachHandleStyle from '@views/flowable/workflow/dispatchFile/DispatchFileBachHandleStyle#Drawer.vue'
 
+  import EquipmentLeanOutApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue'
+
   export default {
     name: 'NcDeviceCharactersList',
     mixins: [JeecgListMixin, mixinDevice],
@@ -150,7 +154,8 @@
       JDictSelectTag,
       WeekMaintenanceApprovalModal,
       RepairOrderApprovalModal,
-      InspectionOrderHandle
+      InspectionOrderHandle,
+      EquipmentLeanOutApprovalModal
     },
     data() {
       return {
@@ -301,6 +306,9 @@
           case 'eam_repair':
             this.handleRepairOrder(item)
             break
+          case 'equipment_lean_out':
+            this.handleEquipmentLeanOut(item)
+            break
           default:
             alert('娌℃壘鍒拌娴佺▼')
         }
@@ -384,6 +392,12 @@
         this.$refs.repairOrderApprovalModal.title = record.name
         this.$refs.repairOrderApprovalModal.getAllApproveData(record)
         this.$refs.repairOrderApprovalModal.getBasicInformation(record)
+      },
+      handleEquipmentLeanOut(item) {
+        this.$refs.equipmentLeanOutApprovalModelRef.visible = true
+        this.$refs.equipmentLeanOutApprovalModelRef.title = item.name
+        this.$refs.equipmentLeanOutApprovalModelRef.handleDetail(item)
+        this.$refs.equipmentLeanOutApprovalModelRef.disableSubmit = false
       }
     }
   }
diff --git a/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue b/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue
new file mode 100644
index 0000000..8256df4
--- /dev/null
+++ b/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue
@@ -0,0 +1,257 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    switchFullscreen
+    @ok="handleOk"
+    @cancel="handleCancel"
+    centered
+    cancelText="鍏抽棴">
+
+    <a-spin :spinning="spinning">
+      <a-form-model ref="form" :model="model" :rules="validatorRules">
+        <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 :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�">
+              <a-input v-model="model.code" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栫爜">
+              <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储"
+                                          v-model="model.equipmentId" disabled></lx-search-equipment-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :guitter="24">
+          <a-col :span="12">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId_dictText" label="鍊熷叆杞﹂棿">
+              <a-input v-model="model.leanDepartId_dictText" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanPerson_dictText" label="鍊熺敤浜�">
+              <a-input v-model="model.leanPerson_dictText" disabled />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="鍊熺敤鍘熷洜">
+              <a-textarea v-model="model.leanReason" disabled />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞">
+              <a-textarea v-model="model.remark" disabled />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <div v-if="approvalDisable">
+          <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 :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalDealType" label="瀹℃壒绫诲瀷">
+                <j-dict-select-tag type="radio" v-model="model.approvalDealType" dictCode="approved_rejected"
+                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷" :disabled="disableSubmit || initialAcceptanceDisable" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalComment" label="瀹℃壒鎰忚">
+                <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.approvalComment"
+                            :disabled="disableSubmit || returnDisable" />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+        <div v-if="returnDisable">
+          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 褰掕繕淇℃伅
+          </a-divider>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="returnComment"
+                                 label="褰掕繕澶囨敞">
+                <a-textarea placeholder="璇疯緭鍏ュ綊杩樺娉�" v-model="model.returnComment"
+                            :disabled="disableSubmit || confirmDisable" />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+        <div v-if="confirmDisable">
+          <a-divider orientation="center" style="font-size: large;font-style: italic;color: #66aeed;"> 绠$悊鍛樼‘璁�
+          </a-divider>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmComment"
+                                 label="纭鎰忚">
+                <a-textarea placeholder="璇疯緭鍏ユ剰瑙�" v-model="model.confirmComment"
+                            :disabled="disableSubmit || completionDisable" />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+      </a-form-model>
+    </a-spin>
+  </j-modal>
+</template>
+
+<script>
+import { getAction, httpAction } from '@/api/manage'
+import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
+
+export default {
+  name: 'EquipmentLeanOutApprovalModal',
+  components: {
+    LxSearchEquipmentSelect
+  },
+  props: {
+    selectShenpiData: {
+      type: Object
+    }
+  },
+  data() {
+    return {
+      title: '鎿嶄綔',
+      visible: false,
+      editable: false,
+      model: {},
+      treeData: [],
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 18 }
+      },
+      labelColLong: {
+        xs: { span: 24 },
+        sm: { span: 2 }
+      },
+      wrapperColLong: {
+        xs: { span: 24 },
+        sm: { span: 21 }
+      },
+      confirmLoading: false,
+      spinning: false,
+      imageSrc: null,
+      validatorRules: {
+        approvalDealType: [
+          { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
+        ],
+        approvalComment: [
+          { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }
+        ],
+        returnComment: [
+          { required: true, message: '璇疯緭鍏ュ綊杩樺娉�!' }
+        ],
+        confirmComment: [
+          { required: true, message: '璇疯緭鍏ョ‘璁ゆ剰瑙�!' }
+        ]
+      },
+      url: {
+        queryById: '/eam/eamEquipmentLeanOut/queryById',
+        approval: '/eam/eamEquipmentLeanOut/approval',
+        loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
+      },
+      disableSubmit: false
+    }
+  },
+  created() {
+    this.loadAllProductionTree()
+  },
+  computed: {
+    approvalDisable: function() {
+      return ['WAIT_APPROVAL', 'WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
+    },
+    returnDisable: function() {
+      return ['WAIT_RETURN', 'WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
+    },
+    confirmDisable: function() {
+      return ['WAIT_CONFIRM', 'COMPLETE'].includes(this.model.leanStatus)
+    },
+    completionDisable: function() {
+      return ['COMPLETE'].includes(this.model.leanStatus)
+    }
+  },
+  methods: {
+    async handleDetail(item) {
+      this.initParams()
+      this.model = {}
+      let res = await getAction(this.url.queryById, { id: item.dataId })
+      this.model = Object.assign({}, res.result)
+      this.model.dataId = item.dataId
+      this.model.taskId = item.id
+      this.model.userId = item.assignee
+      this.model.instanceId = item.procInstId
+      this.model.values = item.variables
+      this.spinning = false;
+    },
+
+    recordDetail(record) {
+      console.log('record', record)
+      this.initParams()
+      this.model = Object.assign({}, record)
+    },
+
+    initParams() {
+      this.visible = true
+      this.spinning = true
+    },
+
+    async handleOk() {
+      const that = this
+      // 瑙﹀彂琛ㄥ崟楠岃瘉
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          that.confirmLoading = that.spinning = true
+          let httpurl = this.url.approval
+          let method = 'put'
+          httpAction(httpurl, this.model, method).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
+      this.$refs.form.clearValidate()
+    },
+    loadAllProductionTree() {
+      //鍔犺浇杞﹂棿閫夋嫨鏍�
+      getAction(this.url.loadProductionOptions).then(res => {
+        if (res.success) {
+          this.treeData = [...res.result]
+        } else {
+          that.$message.warning(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+
+</style>
\ No newline at end of file

--
Gitblit v1.9.3