From 8905bdd0a74c4bd6cabc206c36a299341488041e Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期四, 11 九月 2025 11:00:26 +0800
Subject: [PATCH] 合并设备借出与归还流程,增加借出归还列表详情功能

---
 src/views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue |   52 ++-
 src/views/eam/dispose/EamEquipmentLeanOutList.vue                              |  329 +++++++++++++------------
 /dev/null                                                                      |  247 -------------------
 src/views/dashboard/modules/TodoList.vue                                       |   40 +-
 src/views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue            |    2 
 src/views/flowable/workflow/FlowCompleted.vue                                  |   37 --
 src/views/flowable/workflow/FlowTodo.vue                                       |   40 +-
 7 files changed, 249 insertions(+), 498 deletions(-)

diff --git a/src/views/dashboard/modules/TodoList.vue b/src/views/dashboard/modules/TodoList.vue
index 42ca47a..d00ff07 100644
--- a/src/views/dashboard/modules/TodoList.vue
+++ b/src/views/dashboard/modules/TodoList.vue
@@ -73,12 +73,8 @@
       :taskList='selectionRows'
       @searchReset='searchReset'
     />
-    <equipment-lean-out-approval-modal
-      ref='equipmentLeanOutApprovalModelRef'
-      @searchReset='searchReset'
-    />
-    <equipment-return-approval-modal
-      ref='equipmentReturnApprovalModelRef'
+    <equipment-lean-out-and-return-approval-modal
+      ref='equipmentLeanOutAndReturnModalRef'
       @searchReset='searchReset'
     />
 
@@ -142,8 +138,7 @@
   import WeekMaintenanceApprovalModal from '@views/flowable/workflow/weekMaintenance/WeekMaintenanceApprovalModal.vue'
   import RepairOrderApprovalModal from '@views/flowable/workflow/repairOrder/RepairOrderApprovalModal.vue'
   import InspectionOrderHandle from '@views/flowable/workflow/InspectionOrder/InspectionOrderHandle.vue'
-  import EquipmentLeanOutApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue'
-  import EquipmentReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue'
+  import EquipmentLeanOutAndReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue'
   import SecondMaintenanceApprovalModal
     from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
   import ThirdMaintenanceApprovalModal
@@ -175,8 +170,7 @@
       WeekMaintenanceApprovalModal,
       RepairOrderApprovalModal,
       InspectionOrderHandle,
-      EquipmentLeanOutApprovalModal,
-      EquipmentReturnApprovalModal,
+      EquipmentLeanOutAndReturnApprovalModal,
       SecondMaintenanceApprovalModal,
       ThirdMaintenanceApprovalModal,
       OutBoundOrderHandle,
@@ -289,10 +283,8 @@
             this.handleRepairOrder(item)
             break
           case 'equipment_lean_out':
-            this.handleEquipmentLeanOut(item)
-            break
           case 'equipment_return':
-            this.handleEquipmentReturn(item)
+            this.handleEquipmentLeanOutAndReturn(item)
             break
           case 'second_maintenance':
             this.handleSecondMaintenance(item)
@@ -442,18 +434,18 @@
         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
+
+      /**
+       * 璁惧鍊熷嚭涓庡綊杩�
+       * @param item
+       */
+      handleEquipmentLeanOutAndReturn(item) {
+        this.$refs.equipmentLeanOutAndReturnModalRef.visible = true
+        this.$refs.equipmentLeanOutAndReturnModalRef.title = item.name
+        this.$refs.equipmentLeanOutAndReturnModalRef.handleDetail(item)
+        this.$refs.equipmentLeanOutAndReturnModalRef.disableSubmit = false
       },
-      handleEquipmentReturn(item) {
-        this.$refs.equipmentReturnApprovalModelRef.visible = true
-        this.$refs.equipmentReturnApprovalModelRef.title = item.name
-        this.$refs.equipmentReturnApprovalModelRef.handleDetail(item)
-        this.$refs.equipmentReturnApprovalModelRef.disableSubmit = false
-      },
+
       handleSecondMaintenance(item) {
         if (item && item.dataId) {
           this.selectSecondMaintenanceData = Object.assign({}, item)
diff --git a/src/views/eam/dispose/EamEquipmentLeanOutList.vue b/src/views/eam/dispose/EamEquipmentLeanOutList.vue
index fd28150..47e6bb6 100644
--- a/src/views/eam/dispose/EamEquipmentLeanOutList.vue
+++ b/src/views/eam/dispose/EamEquipmentLeanOutList.vue
@@ -26,7 +26,8 @@
           </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
             <a-form-item label="鍊熺敤鐘舵��">
-              <j-dict-select-tag placeholder="璇烽�夋嫨鍊熺敤鐘舵��" dictCode="equipment_lean_out_status" v-model="queryParam.leanStatus"
+              <j-dict-select-tag placeholder="璇烽�夋嫨鍊熺敤鐘舵��" dictCode="equipment_lean_out_status"
+                                 v-model="queryParam.leanStatus"
                                  allow-clear/>
             </a-form-item>
           </a-col>
@@ -58,19 +59,20 @@
         @click="handleAdd"
         type="primary"
         icon="plus"
-      >鏂板</a-button>
+      >鏂板
+      </a-button>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item
             key="1"
             @click="batchDel"
           >
-            <a-icon type="delete" />
+            <a-icon type="delete"/>
             鍒犻櫎
           </a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
-          <a-icon type="down" />
+          <a-icon type="down"/>
         </a-button>
       </a-dropdown>
     </div>
@@ -81,7 +83,8 @@
         class="ant-alert ant-alert-info"
         style="margin-bottom: 16px;"
       >
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{
+        selectedRowKeys.length }}</a>椤�
         <a
           style="margin-left: 24px"
           @click="onClearSelected"
@@ -108,16 +111,16 @@
         >
           <template v-if="record.leanStatus === 'WAIT_SUBMIT'">
             <a @click="handleEdit(record)">缂栬緫</a>
-            <a-divider type="vertical" />
+            <a-divider type="vertical"/>
             <a-popconfirm
               title="纭畾鎻愪氦鍚�?"
               @confirm="() => handleSubmit(record.id)"
             >
               <a>鎻愪氦</a>
             </a-popconfirm>
-            <a-divider type="vertical" />
+            <a-divider type="vertical"/>
             <a-dropdown>
-              <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+              <a class="ant-dropdown-link">鏇村 <a-icon type="down"/></a>
               <a-menu slot="overlay">
                 <a-menu-item>
                   <a
@@ -136,14 +139,15 @@
               </a-menu>
             </a-dropdown>
           </template>
+
            <template v-if="record.leanStatus === 'WAIT_RETURN'">
              <a-popconfirm title='纭畾褰掕繕鍚�?' @confirm='() => equipmentReturn(record.id)'>
               <a>褰掕繕</a>
             </a-popconfirm>
-             <a-divider type='vertical' />
-              <a @click='handleDetail(record)'>璇︽儏</a>
+             <a-divider type='vertical'/>
           </template>
-          <template v-if="record.leanStatus !== 'WAIT_RETURN' && record.leanStatus !== 'WAIT_SUBMIT'">
+
+          <template v-if="record.leanStatus !== 'WAIT_SUBMIT'">
             <a
               href="javascript:;"
               @click="handleDetail(record)"
@@ -160,164 +164,169 @@
       ref="modalForm"
       @ok="modalFormOk"
     ></eamEquipmentLeanOut-modal>
+
+    <!--瀹℃壒寮圭獥-->
+    <equipment-lean-out-and-return-approval-modal ref="approvalModal"
+                                                  :selectShenpiData="selectRowData"/>
   </a-card>
 </template>
 
 <script>
-import '@/assets/less/TableExpand.less'
-import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal'
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
-import { getAction } from '@api/manage'
+  import '@/assets/less/TableExpand.less'
+  import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
+  import { getAction } from '@api/manage'
+  import EquipmentLeanOutAndReturnApprovalModal
+    from '../../flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal'
 
-export default {
-  name: 'EamEquipmentLeanOutList',
-  mixins: [JeecgListMixin],
-  components: {
-    LxSearchEquipmentSelect,
-    EamEquipmentLeanOutModal
-  },
-  data() {
-    return {
-      description: '璁惧鍊熷嚭褰掕繕绠$悊椤甸潰',
-      // 琛ㄥご
-      columns: [
-        {
-          title: '#',
-          dataIndex: '',
-          key: 'rowIndex',
-          width: 60,
-          fixed: 'left',
-          align: 'center',
-          customRender: function (t, r, index) {
-            return parseInt(index) + 1
-          }
-        },
-        {
-          title: '璁惧缂栧彿',
-          align: 'center',
-          dataIndex: 'equipmentCode',
-          fixed: 'left',
-        },
-        {
-          title: '璁惧鍚嶇О',
-          align: 'center',
-          dataIndex: 'equipmentName',
-          fixed: 'left',
-        },
-        {
-          title: '鍗曟嵁鍙�',
-          align: 'center',
-          dataIndex: 'code'
-        },
-        {
-          title: '鍊熷叆杞﹂棿',
-          align: 'center',
-          dataIndex: 'leanDepartId_dictText'
-        },
-        {
-          title: '鍊熷叆浜�',
-          align: 'center',
-          dataIndex: 'leanPerson_dictText'
-        },
-        {
-          title: '鍊熺敤鍘熷洜',
-          align: 'center',
-          dataIndex: 'leanReason'
-        },
-        {
-          title: '鍊熺敤鐘舵��',
-          align: 'center',
-          dataIndex: 'leanStatus_dictText'
-        },
-        {
-          title: '鍊熺敤寮�濮嬫椂闂�',
-          align: 'center',
-          dataIndex: 'leanStartTime'
-        },
-        {
-          title: '鍊熺敤褰掕繕鏃堕棿',
-          align: 'center',
-          dataIndex: 'leanEndTime'
-        },
-        {
-          title: '澶囨敞',
-          align: 'center',
-          dataIndex: 'remark'
-        },
-        {
-          title: '鎿嶄綔',
-          dataIndex: 'action',
-          align: 'center',
-          fixed: 'right',
-          width: 200,
-          scopedSlots: { customRender: 'action' }
-        }
-      ],
-      url: {
-        list: '/eam/eamEquipmentLeanOut/list',
-        delete: '/eam/eamEquipmentLeanOut/delete',
-        deleteBatch: '/eam/eamEquipmentLeanOut/deleteBatch',
-        submit: '/eam/eamEquipmentLeanOut/submit',
-        equipmentReturn: '/eam/eamEquipmentLeanOut/equipmentReturn',
-      }
-    }
-  },
-  computed: {},
-  methods: {
-    equipmentReturn(id) {
-      if (!this.url.equipmentReturn) {
-        this.$message.error('璇疯缃畊rl.submit灞炴��!')
-        return
-      }
-      let that = this
-      getAction(that.url.equipmentReturn, { id: id }).then((res) => {
-        if (res.success) {
-          //閲嶆柊璁$畻鍒嗛〉闂
-          that.reCalculatePage(1)
-          // that.$message.success(res.message);
-          that.$notification.success({
-            message: '娑堟伅',
-            description: res.message
-          })
-          that.loadData()
-        } else {
-          // that.$message.warning(res.message);
-          that.$notification.warning({
-            message: '娑堟伅',
-            description: res.message
-          })
-        }
-      })
+  export default {
+    name: 'EamEquipmentLeanOutList',
+    mixins: [JeecgListMixin],
+    components: {
+      EquipmentLeanOutAndReturnApprovalModal,
+      LxSearchEquipmentSelect,
+      EamEquipmentLeanOutModal
     },
-    handleSubmit(id) {
-      if (!this.url.submit) {
-        this.$message.error('璇疯缃畊rl.submit灞炴��!')
-        return
-      }
-      let that = this
-      getAction(that.url.submit, { id: id }).then((res) => {
-        if (res.success) {
-          //閲嶆柊璁$畻鍒嗛〉闂
-          that.reCalculatePage(1)
-          // that.$message.success(res.message);
-          that.$notification.success({
-            message: '娑堟伅',
-            description: res.message
-          })
-          that.loadData()
-        } else {
-          // that.$message.warning(res.message);
-          that.$notification.warning({
-            message: '娑堟伅',
-            description: res.message
-          })
+    data() {
+      return {
+        description: '璁惧鍊熷嚭褰掕繕绠$悊椤甸潰',
+        selectRowData: {},
+        // 琛ㄥご
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 60,
+            fixed: 'left',
+            align: 'center',
+            customRender: function(t, r, index) {
+              return parseInt(index) + 1
+            }
+          },
+          {
+            title: '璁惧缂栧彿',
+            align: 'center',
+            dataIndex: 'equipmentCode',
+            fixed: 'left'
+          },
+          {
+            title: '璁惧鍚嶇О',
+            align: 'center',
+            dataIndex: 'equipmentName',
+            fixed: 'left'
+          },
+          {
+            title: '鍗曟嵁鍙�',
+            align: 'center',
+            dataIndex: 'code'
+          },
+          {
+            title: '鍊熷叆杞﹂棿',
+            align: 'center',
+            dataIndex: 'leanDepartId_dictText'
+          },
+          {
+            title: '鍊熷叆浜�',
+            align: 'center',
+            dataIndex: 'leanPerson_dictText'
+          },
+          {
+            title: '鍊熺敤鍘熷洜',
+            align: 'center',
+            dataIndex: 'leanReason'
+          },
+          {
+            title: '鍊熺敤鐘舵��',
+            align: 'center',
+            dataIndex: 'leanStatus_dictText'
+          },
+          {
+            title: '鍊熺敤寮�濮嬫椂闂�',
+            align: 'center',
+            dataIndex: 'leanStartTime'
+          },
+          {
+            title: '鍊熺敤褰掕繕鏃堕棿',
+            align: 'center',
+            dataIndex: 'leanEndTime'
+          },
+          {
+            title: '澶囨敞',
+            align: 'center',
+            dataIndex: 'remark'
+          },
+          {
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            align: 'center',
+            fixed: 'right',
+            width: 200,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: '/eam/eamEquipmentLeanOut/list',
+          delete: '/eam/eamEquipmentLeanOut/delete',
+          deleteBatch: '/eam/eamEquipmentLeanOut/deleteBatch',
+          submit: '/eam/eamEquipmentLeanOut/submit',
+          equipmentReturn: '/eam/eamEquipmentLeanOut/equipmentReturn'
         }
-      })
+      }
+    },
+    computed: {},
+    methods: {
+      equipmentReturn(id) {
+        this.loading = true
+        let that = this
+        getAction(that.url.equipmentReturn, { id: id }).then((res) => {
+          if (res.success) {
+            //閲嶆柊璁$畻鍒嗛〉闂
+            that.reCalculatePage(1)
+            that.$notification.success({
+              message: '娑堟伅',
+              description: res.message
+            })
+            that.loadData()
+          } else {
+            that.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+          }
+        })
+      },
+      handleSubmit(id) {
+        this.loading = true
+        let that = this
+        getAction(that.url.submit, { id: id }).then((res) => {
+          if (res.success) {
+            //閲嶆柊璁$畻鍒嗛〉闂
+            that.reCalculatePage(1)
+            that.$notification.success({
+              message: '娑堟伅',
+              description: res.message
+            })
+            that.loadData()
+          } else {
+            that.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+          }
+        })
+      },
+
+      handleDetail(record) {
+        this.selectRowData = Object.assign({}, record)
+        this.$refs.approvalModal.recordDetail(record)
+        this.$refs.approvalModal.title = '璇︽儏'
+        this.$refs.approvalModal.disableSubmit = true
+      }
     }
   }
-}
 </script>
 <style scoped>
-@import '~@assets/less/common.less';
+  @import '~@assets/less/common.less';
 </style>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/FlowCompleted.vue b/src/views/flowable/workflow/FlowCompleted.vue
index 5c172da..0038b4a 100644
--- a/src/views/flowable/workflow/FlowCompleted.vue
+++ b/src/views/flowable/workflow/FlowCompleted.vue
@@ -144,11 +144,6 @@
       :selectShenpiData="selectLossBoundOrderData"
       @searchReset="searchReset"
     ></loss-bound-handle>
-
-    <equipment-lean-out-approval-modal
-      ref='equipmentLeanOutApprovalModelRef'
-      @searchReset='searchReset'
-    />
     <equipment-seal-up-approval-modal
       ref='equipmentSealUpApprovalModelRef'
       @searchReset='searchReset'
@@ -166,8 +161,8 @@
       @searchReset='searchReset'
       :selectSparePartApplyData='selectSparePartApplyData'
     ></spare-part-apply-handle>
-    <equipment-return-approval-modal
-      ref='equipmentReturnApprovalModelRef'
+    <equipment-lean-out-and-return-approval-modal
+      ref='EquipmentLeanOutAndReturnApprovalModalRef'
       @searchReset='searchReset'
     />
     <inbound-order-handle-xq
@@ -207,12 +202,11 @@
 import OutBoundOrderHandle from '@views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue'
 import lossBoundHandle from '@views/flowable/workflow/lossBound/lossBoundHandle.vue'
 import stocktakingBoundHandle from '@views/flowable/workflow/stocktakingBound/stocktakingBoundHandle.vue'
-import EquipmentLeanOutApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue'
 import EquipmentSealUpApprovalModal from '@views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue'
 import EquipmentTransferApprovalModal from '@views/flowable/workflow/transfer/EquipmentTransferApprovalModal.vue'
 import EquipmentScrapApprovalModal from '@views/flowable/workflow/scrap/EquipmentScrapApprovalModal.vue'
 import SparePartApplyHandle from '@views/flowable/workflow/sparePartApply/SparePartApplyHandle.vue'
-import EquipmentReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue'
+import EquipmentLeanOutAndReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue'
 import GuideCardBatchXq from '@views/flowable/workflow/guideCardBatch/GuideCardBatchXq.vue'
 import SecondMaintenanceApprovalModal from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
 import ThirdMaintenanceApprovalModal from '@views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue'
@@ -231,12 +225,11 @@
     InspectionOrderHandle,
     JDictSelectTag,
     OutBoundOrderHandle,
-    EquipmentLeanOutApprovalModal,
     EquipmentSealUpApprovalModal,
     EquipmentTransferApprovalModal,
     EquipmentScrapApprovalModal,
     SparePartApplyHandle,
-    EquipmentReturnApprovalModal,
+    EquipmentLeanOutAndReturnApprovalModal,
     SecondMaintenanceApprovalModal,
     ThirdMaintenanceApprovalModal,
     InboundOrderHandleXq,
@@ -373,9 +366,6 @@
         case 'equipment_unseal':
           this.handleEquipmentUnSeal(item)
           break
-        case 'equipment_lean_out':
-          this.handleEquipmentLeanOut(item)
-          break
         case 'equipment_transfer':
           this.handleEquipmentTransfer(item)
           break
@@ -385,8 +375,9 @@
         case 'spare_part_apply':
           this.handleSparePartApplyApproval(item)
           break
+        case 'equipment_lean_out':
         case 'equipment_return':
-          this.handleEquipmentReturn(item)
+          this.handleEquipmentLeanOutAndReturn(item)
           break
         case 'toolInStorageApproval':
           this.handleToolInStorage(item)
@@ -411,11 +402,11 @@
       return result
     },
 
-    handleEquipmentReturn(item) {
-      this.$refs.equipmentReturnApprovalModelRef.visible = true
-      this.$refs.equipmentReturnApprovalModelRef.title = item.name
-      this.$refs.equipmentReturnApprovalModelRef.handleDetail(item)
-      this.$refs.equipmentReturnApprovalModelRef.disableSubmit = true
+    handleEquipmentLeanOutAndReturn(item) {
+      this.$refs.EquipmentLeanOutAndReturnApprovalModalRef.visible = true
+      this.$refs.EquipmentLeanOutAndReturnApprovalModalRef.title = item.name
+      this.$refs.EquipmentLeanOutAndReturnApprovalModalRef.handleDetail(item)
+      this.$refs.EquipmentLeanOutAndReturnApprovalModalRef.disableSubmit = true
     },
     handleToolInStorage(item) {
       console.log('item----->', item)
@@ -545,12 +536,6 @@
       this.$refs.lossBoundHandle.clearTableSource()
       this.$refs.lossBoundHandle.getAllApproveData(item)
 
-    },
-    handleEquipmentLeanOut(item) {
-      this.$refs.equipmentLeanOutApprovalModelRef.visible = false
-      this.$refs.equipmentLeanOutApprovalModelRef.disableSubmit = true
-      this.$refs.equipmentLeanOutApprovalModelRef.handleDetail(item)
-      this.$refs.equipmentLeanOutApprovalModelRef.title = item.name
     },
     handleEquipmentSealUp(item) {
       this.$refs.equipmentSealUpApprovalModelRef.visible = true
diff --git a/src/views/flowable/workflow/FlowTodo.vue b/src/views/flowable/workflow/FlowTodo.vue
index 5cb6bc9..e952e41 100644
--- a/src/views/flowable/workflow/FlowTodo.vue
+++ b/src/views/flowable/workflow/FlowTodo.vue
@@ -238,12 +238,8 @@
       :taskList='selectionRows'
       @searchReset='searchReset'
     />
-    <equipment-lean-out-approval-modal
-      ref='equipmentLeanOutApprovalModelRef'
-      @searchReset='searchReset'
-    />
-    <equipment-return-approval-modal
-      ref='equipmentReturnApprovalModelRef'
+    <equipment-lean-out-and-return-approval-modal
+      ref='equipmentLeanOutAndReturnModalRef'
       @searchReset='searchReset'
     />
 
@@ -310,8 +306,7 @@
 import GuideCardBatchHandle from '@views/flowable/workflow/guideCardBatch/GuideCardBatchHandle.vue'
 import AssignEquipmentFileStreamHandle from '@views/flowable/workflow/assignEquipmentFileStream/AssignEquipmentFileStreamHandle.vue'
 import OutBoundOrderHandle from '@views/flowable/workflow/outBoundOrder/OutBoundOrderHandle.vue'
-import EquipmentLeanOutApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue'
-import EquipmentReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue'
+import EquipmentLeanOutAndReturnApprovalModal from '@views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue'
 import SecondMaintenanceApprovalModal from '@views/flowable/workflow/secondMaintenance/SecondMaintenanceApprovalModal.vue'
 import ThirdMaintenanceApprovalModal from '@views/flowable/workflow/thirdMaintenance/ThirdMaintenanceApprovalModal.vue'
 import EquipmentSealUpApprovalModal from '@views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue'
@@ -338,8 +333,7 @@
     WeekMaintenanceApprovalModal,
     RepairOrderApprovalModal,
     InspectionOrderHandle,
-    EquipmentLeanOutApprovalModal,
-    EquipmentReturnApprovalModal,
+    EquipmentLeanOutAndReturnApprovalModal,
     SecondMaintenanceApprovalModal,
     ThirdMaintenanceApprovalModal,
     OutBoundOrderHandle,
@@ -516,10 +510,8 @@
           this.handleRepairOrder(item)
           break
         case 'equipment_lean_out':
-          this.handleEquipmentLeanOut(item)
-          break
         case 'equipment_return':
-          this.handleEquipmentReturn(item)
+          this.handleEquipmentLeanOutAndReturn(item)
           break
         case 'second_maintenance':
           this.handleSecondMaintenance(item)
@@ -669,18 +661,18 @@
       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
+
+    /**
+     * 璁惧鍊熷嚭涓庡綊杩�
+     * @param item
+     */
+    handleEquipmentLeanOutAndReturn(item) {
+      this.$refs.equipmentLeanOutAndReturnModalRef.visible = true
+      this.$refs.equipmentLeanOutAndReturnModalRef.title = item.name
+      this.$refs.equipmentLeanOutAndReturnModalRef.handleDetail(item)
+      this.$refs.equipmentLeanOutAndReturnModalRef.disableSubmit = false
     },
-    handleEquipmentReturn(item) {
-      this.$refs.equipmentReturnApprovalModelRef.visible = true
-      this.$refs.equipmentReturnApprovalModelRef.title = item.name
-      this.$refs.equipmentReturnApprovalModelRef.handleDetail(item)
-      this.$refs.equipmentReturnApprovalModelRef.disableSubmit = false
-    },
+
     handleSecondMaintenance(item) {
       if (item && item.dataId) {
         this.selectSecondMaintenanceData = Object.assign({}, item)
diff --git a/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue b/src/views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue
similarity index 84%
rename from src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue
rename to src/views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue
index e837873..ceb7e8b 100644
--- a/src/views/flowable/workflow/leanOut/EquipmentReturnApprovalModal.vue
+++ b/src/views/flowable/workflow/leanOut/EquipmentLeanOutAndReturnApprovalModal.vue
@@ -53,38 +53,43 @@
           </a-col>
         </a-row>
 
-        <div>
+        <div v-if="leanOutApprovalDisable">
           <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" label="瀹℃壒绫诲瀷">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="瀹℃壒绫诲瀷" prop="useApprovalDealType">
                 <j-dict-select-tag type="radio" v-model="model.useApprovalDealType" dictCode="approved_rejected"
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷" disabled/>
+                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"
+                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鎰忚">
-                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.useApprovalComment" disabled/>
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="纭鎰忚" prop="useApprovalComment">
+                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.useApprovalComment"
+                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
               </a-form-model-item>
             </a-col>
           </a-row>
         </div>
 
-        <div>
+        <div v-if="leanInApprovalDisable">
           <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" label="瀹℃壒绫诲瀷">
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutApprovalDealType"
+                                 label="瀹℃壒绫诲瀷">
                 <j-dict-select-tag type="radio" v-model="model.leanOutApprovalDealType" dictCode="approved_rejected"
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷" disabled/>
+                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"
+                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
               </a-form-model-item>
             </a-col>
             <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol"
+              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutApprovalComment"
                                  label="纭鎰忚">
-                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.leanOutApprovalComment" disabled/>
+                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.leanOutApprovalComment"
+                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
               </a-form-model-item>
             </a-col>
           </a-row>
@@ -143,7 +148,7 @@
   import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
 
   export default {
-    name: 'EquipmentLeanOutApprovalModal',
+    name: 'EquipmentLeanOutAndReturnApprovalModal',
     components: {
       LxSearchEquipmentSelect
     },
@@ -179,6 +184,18 @@
         spinning: false,
         imageSrc: null,
         validatorRules: {
+          useApprovalDealType: [
+            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
+          ],
+          leanOutApprovalDealType: [
+            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
+          ],
+          useApprovalComment: [
+            { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }
+          ],
+          leanOutApprovalComment: [
+            { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }
+          ],
           leanOutConfirmDealType: [
             { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
           ],
@@ -204,6 +221,12 @@
       this.loadAllProductionTree()
     },
     computed: {
+      leanOutApprovalDisable: function() {
+        return ['WAIT_APPROVAL_OUT', 'WAIT_APPROVAL_IN', 'WAIT_RETURN', 'WAIT_CONFIRM_RETURN', 'WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus)
+      },
+      leanInApprovalDisable: function() {
+        return ['WAIT_APPROVAL_IN', 'WAIT_RETURN', 'WAIT_CONFIRM_RETURN', 'WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus)
+      },
       returnConfirmApprovalDisable: function() {
         return ['WAIT_CONFIRM_RETURN', 'WAIT_CONFIRM_BORROW', 'COMPLETE'].includes(this.model.leanStatus)
       },
@@ -229,6 +252,7 @@
         console.log('record', record)
         this.initParams()
         this.model = Object.assign({}, record)
+        this.spinning = false
       },
 
       initParams() {
@@ -275,14 +299,10 @@
           if (res.success) {
             this.treeData = [...res.result]
           } else {
-            that.$message.warning(res.message)
+            this.$message.warning(res.message)
           }
         })
       }
     }
   }
 </script>
-
-<style lang="less" scoped>
-
-</style>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue b/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue
deleted file mode 100644
index ff9ec7d..0000000
--- a/src/views/flowable/workflow/leanOut/EquipmentLeanOutApprovalModal.vue
+++ /dev/null
@@ -1,247 +0,0 @@
-<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 :gutter="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="leanOutApprovalDisable">
-          <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="useApprovalDealType" label="瀹℃壒绫诲瀷">
-                <j-dict-select-tag type="radio" v-model="model.useApprovalDealType" dictCode="approved_rejected"
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"
-                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="useApprovalComment" label="纭鎰忚">
-                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.useApprovalComment"
-                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_OUT'"/>
-              </a-form-model-item>
-            </a-col>
-          </a-row>
-        </div>
-
-        <div v-if="leanInApprovalDisable">
-          <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="leanOutApprovalDealType" label="瀹℃壒绫诲瀷">
-                <j-dict-select-tag type="radio" v-model="model.leanOutApprovalDealType" dictCode="approved_rejected"
-                                   placeholder="璇烽�夋嫨澶勭悊绫诲瀷"
-                                   :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanOutApprovalComment" label="纭鎰忚">
-                <a-textarea placeholder="璇疯緭鍏ョ‘璁ゆ剰瑙�" v-model="model.leanOutApprovalComment"
-                            :disabled="disableSubmit || model.leanStatus!=='WAIT_APPROVAL_IN'"/>
-              </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: {
-          useApprovalDealType: [
-            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
-          ],
-          leanOutApprovalDealType: [
-            { required: true, message: '璇烽�夋嫨閫氳繃鎴栭┏鍥�!' }
-          ],
-          useApprovalComment: [
-            { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }
-          ],
-          leanOutApprovalComment: [
-            { required: true, message: '璇疯緭鍏ュ鎵规剰瑙�!' }
-          ],
-        },
-        url: {
-          queryById: '/eam/eamEquipmentLeanOut/queryById',
-          approval: '/eam/eamEquipmentLeanOut/approval',
-          loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
-        },
-        disableSubmit: false
-      }
-    },
-    created() {
-      this.loadAllProductionTree()
-    },
-    computed: {
-      leanOutApprovalDisable: function() {
-        return ['WAIT_APPROVAL_OUT', 'WAIT_APPROVAL_IN', 'COMPLETE'].includes(this.model.leanStatus)
-      },
-      leanInApprovalDisable: function() {
-        return ['WAIT_APPROVAL_IN', '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
-        if (this.$refs.form) this.$refs.form.clearValidate()
-      },
-      loadAllProductionTree() {
-        //鍔犺浇杞﹂棿閫夋嫨鏍�
-        getAction(this.url.loadProductionOptions).then(res => {
-          if (res.success) {
-            this.treeData = [...res.result]
-          } else {
-            this.$message.warning(res.message)
-          }
-        })
-      }
-    }
-  }
-</script>
-
-<style lang="less" scoped>
-
-</style>
\ No newline at end of file
diff --git a/src/views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue b/src/views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue
index 8fd8bdc..43e2ce2 100644
--- a/src/views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue
+++ b/src/views/flowable/workflow/sealUp/EquipmentSealUpApprovalModal.vue
@@ -183,7 +183,7 @@
 import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
 
 export default {
-  name: 'EquipmentLeanOutApprovalModal',
+  name: 'EquipmentSealUpApprovalModal',
   components: {
     LxSearchEquipmentSelect
   },

--
Gitblit v1.9.3