From 196f9692aa3a607b4d0edf10945004fbe728547d Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期五, 16 五月 2025 15:14:45 +0800
Subject: [PATCH] art: 设备管理-设备处置 借用 列表,新增

---
 src/views/eam/dispose/EamEquipmentLeanOutList.vue          |  341 ++++++++++++++++++++++++------------------
 src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue |   90 ++++++----
 2 files changed, 246 insertions(+), 185 deletions(-)

diff --git a/src/views/eam/dispose/EamEquipmentLeanOutList.vue b/src/views/eam/dispose/EamEquipmentLeanOutList.vue
index d8711d2..afab556 100644
--- a/src/views/eam/dispose/EamEquipmentLeanOutList.vue
+++ b/src/views/eam/dispose/EamEquipmentLeanOutList.vue
@@ -5,45 +5,23 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍒犻櫎鏍囪">
-              <a-input placeholder="璇疯緭鍏ュ垹闄ゆ爣璁�" v-model="queryParam.delFlag"></a-input>
+          <a-col :xl="4" :lg="7" :md="8" :sm="24">
+            <a-form-item label="璁惧缂栧彿">
+              <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储"
+                                          v-model="queryParam.equipmentId"></lx-search-equipment-select>
             </a-form-item>
           </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="璁惧ID">
-              <a-input placeholder="璇疯緭鍏ヨ澶嘔D" v-model="queryParam.equipmentId"></a-input>
-            </a-form-item>
-          </a-col>
-        <template v-if="toggleSearchStatus">
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+          <a-col :xl="4" :lg="7" :md="8" :sm="24">
             <a-form-item label="鍗曟嵁鍙�">
               <a-input placeholder="璇疯緭鍏ュ崟鎹彿" v-model="queryParam.code"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍊熷叆閮ㄩ棬">
-              <a-input placeholder="璇疯緭鍏ュ�熷叆閮ㄩ棬" v-model="queryParam.leanDepartId"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍊熷叆璐d换浜�">
-              <a-input placeholder="璇疯緭鍏ュ�熷叆璐d换浜�" v-model="queryParam.leanPerson"></a-input>
-            </a-form-item>
-          </a-col>
-          </template>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
+              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button>
             </span>
           </a-col>
-
         </a-row>
       </a-form>
     </div>
@@ -51,22 +29,24 @@
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
       <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>
-      </a-upload>
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item>
+          <a-menu-item key="1" @click="batchDel">
+            <a-icon type="delete" />
+            鍒犻櫎
+          </a-menu-item>
         </a-menu>
-        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button>
+        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
+          <a-icon type="down" />
+        </a-button>
       </a-dropdown>
     </div>
 
     <!-- table鍖哄煙-begin -->
     <div>
       <div 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">娓呯┖</a>
       </div>
 
@@ -79,24 +59,35 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        class="j-table-force-nowrap"
+        :scroll="{ x: 'max-content' }"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
 
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
-
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
-                  <a>鍒犻櫎</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <template v-if="record.leanStatus === 'WAIT_SUBMIT'">
+            <a @click="handleEdit(record)">缂栬緫</a>
+            <a-divider type="vertical" />
+            <a-popconfirm title="纭畾鎻愪氦鍚�?" @confirm="() => handleSubmit(record.id)">
+              <a>鎻愪氦</a>
+            </a-popconfirm>
+            <a-divider type="vertical" />
+            <a-dropdown>
+              <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a>
+              <a-menu slot="overlay">
+                 <a-menu-item>
+                  <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a>
+                </a-menu-item>
+                <a-menu-item>
+                  <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+                    <a>鍒犻櫎</a>
+                  </a-popconfirm>
+                </a-menu-item>
+              </a-menu>
+            </a-dropdown>
+          </template>
+           <template v-else>
+              <a @click="handleDetail(record)">璇︽儏</a>
+          </template>
         </span>
 
       </a-table>
@@ -109,112 +100,164 @@
 </template>
 
 <script>
-  import '@/assets/less/TableExpand.less'
-  import EamEquipmentLeanOutModal from './modules/EamEquipmentLeanOutModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+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'
 
-  export default {
-    name: "EamEquipmentLeanOutList",
-    mixins:[JeecgListMixin],
-    components: {
-      EamEquipmentLeanOutModal
-    },
-    data () {
-      return {
-        description: '璁惧鍊熷嚭褰掕繕绠$悊椤甸潰',
-        // 琛ㄥご
-        columns: [
-          {
-            title: '#',
-            dataIndex: '',
-            key:'rowIndex',
-            width:60,
-            align:"center",
-            customRender:function (t,r,index) {
-              return parseInt(index)+1;
-            }
-           },
-		   {
-            title: '鍒犻櫎鏍囪',
-            align:"center",
-            dataIndex: 'delFlag'
-           },
-		   {
-            title: '璁惧ID',
-            align:"center",
-            dataIndex: 'equipmentId'
-           },
-		   {
-            title: '鍗曟嵁鍙�',
-            align:"center",
-            dataIndex: 'code'
-           },
-		   {
-            title: '鍊熷叆閮ㄩ棬',
-            align:"center",
-            dataIndex: 'leanDepartId'
-           },
-		   {
-            title: '鍊熷叆璐d换浜�',
-            align:"center",
-            dataIndex: 'leanPerson'
-           },
-		   {
-            title: '鍊熷嚭鐘舵��',
-            align:"center",
-            dataIndex: 'leanStatus'
-           },
-		   {
-            title: '鍊熷嚭寮�濮嬫椂闂�',
-            align:"center",
-            dataIndex: 'leanStartTime'
-           },
-		   {
-            title: '鍊熷嚭褰掕繕鏃堕棿',
-            align:"center",
-            dataIndex: 'leanEndTime'
-           },
-		   {
-            title: '瀹℃牳浜�',
-            align:"center",
-            dataIndex: 'approvalUser'
-           },
-		   {
-            title: '瀹℃牳鏃堕棿',
-            align:"center",
-            dataIndex: 'approvalTime'
-           },
-		   {
-            title: '澶囨敞',
-            align:"center",
-            dataIndex: 'remark'
-           },
-          {
-            title: '鎿嶄綔',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+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
           }
-        ],
-		url: {
-          list: "/eam/eamEquipmentLeanOut/list",
-          delete: "/eam/eamEquipmentLeanOut/delete",
-          deleteBatch: "/eam/eamEquipmentLeanOut/deleteBatch",
-          exportXlsUrl: "eam/eamEquipmentLeanOut/exportXls",
-          importExcelUrl: "eam/eamEquipmentLeanOut/importExcel",
-       },
+        },
+        {
+          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: 'approvalUser_dictText'
+        },
+        {
+          title: '瀹℃牳鎰忚',
+          align: 'center',
+          dataIndex: 'approvalComment'
+        },
+        {
+          title: '瀹℃牳鏃堕棿',
+          align: 'center',
+          dataIndex: 'approvalTime'
+        },
+        {
+          title: '褰掕繕纭浜�',
+          align: 'center',
+          dataIndex: 'confirmUser_dictText'
+        },
+        {
+          title: '纭鎰忚',
+          align: 'center',
+          dataIndex: 'confirmComment'
+        },
+        {
+          title: '纭鏃堕棿',
+          align: 'center',
+          dataIndex: 'confirmTime'
+        },
+        {
+          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',
+      }
     }
   },
-  computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    }
-  },
-    methods: {
-     
+  computed: {},
+  methods: {
+    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
+          })
+        }
+      })
     }
   }
+}
 </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/eam/dispose/modules/EamEquipmentLeanOutModal.vue b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
index 196ce87..920acdd 100644
--- a/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
+++ b/src/views/eam/dispose/modules/EamEquipmentLeanOutModal.vue
@@ -8,60 +8,53 @@
     @ok="handleOk"
     @cancel="handleCancel"
     cancelText="鍏抽棴">
-    
+
     <a-spin :spinning="confirmLoading">
       <a-form-model ref="form" :model="model" :rules="validatorRules">
-      
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="鍒犻櫎鏍囪">
-          <a-input-number v-model="model.delFlag"/>
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧ID">
-          <a-input placeholder="璇疯緭鍏ヨ澶嘔D" v-model="model.equipmentId" />
-        </a-form-model-item>
         <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code" label="鍗曟嵁鍙�">
-          <a-input placeholder="璇疯緭鍏ュ崟鎹彿" v-model="model.code" />
+          <a-input placeholder="缂栫爜绯荤粺鑷姩鐢熸垚" v-model="model.code" disabled />
         </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId" label="鍊熷叆閮ㄩ棬">
-          <a-input placeholder="璇疯緭鍏ュ�熷叆閮ㄩ棬" v-model="model.leanDepartId" />
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="璁惧缂栧彿">
+          <lx-search-equipment-select placeholder="璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储"
+                                      v-model="model.equipmentId"></lx-search-equipment-select>
         </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanPerson" label="鍊熷叆璐d换浜�">
-          <a-input placeholder="璇疯緭鍏ュ�熷叆璐d换浜�" v-model="model.leanPerson" />
+
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanDepartId" label="鍊熷叆杞﹂棿">
+          <a-tree-select v-model="model.leanDepartId"
+                         style="width: 100%"
+                         :tree-data="treeData"
+                         :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                         placeholder="璇烽�夋嫨鍊熷叆杞﹂棿"
+                         allow-clear
+                         tree-default-expand-all
+          >
+          </a-tree-select>
         </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanStatus" label="鍊熷嚭鐘舵��">
-          <a-input placeholder="璇疯緭鍏ュ�熷嚭鐘舵��" v-model="model.leanStatus" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanStartTime" label="鍊熷嚭寮�濮嬫椂闂�">
-          <a-input placeholder="璇疯緭鍏ュ�熷嚭寮�濮嬫椂闂�" v-model="model.leanStartTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanEndTime" label="鍊熷嚭褰掕繕鏃堕棿">
-          <a-input placeholder="璇疯緭鍏ュ�熷嚭褰掕繕鏃堕棿" v-model="model.leanEndTime" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalUser" label="瀹℃牳浜�">
-          <a-input placeholder="璇疯緭鍏ュ鏍镐汉" v-model="model.approvalUser" />
-        </a-form-model-item>
-        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalTime" label="瀹℃牳鏃堕棿">
-          <a-input placeholder="璇疯緭鍏ュ鏍告椂闂�" v-model="model.approvalTime" />
+        <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leanReason" label="鍊熺敤鍘熷洜">
+          <a-textarea placeholder="璇疯緭鍏ュ�熺敤鍘熷洜" v-model="model.leanReason" />
         </a-form-model-item>
         <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark" label="澶囨敞">
-          <a-input placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" />
+          <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark" />
         </a-form-model-item>
-		
       </a-form-model>
     </a-spin>
   </j-modal>
 </template>
 
 <script>
-  import { httpAction } from '@/api/manage'
+import { getAction, httpAction } from '@/api/manage'
   import moment from "moment"
+  import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
 
   export default {
     name: "EamEquipmentLeanOutModal",
+    components: { LxSearchEquipmentSelect },
     data () {
       return {
         title:"鎿嶄綔",
         visible: false,
         model: {},
+        editable: false,
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -70,26 +63,42 @@
           xs: { span: 24 },
           sm: { span: 16 },
         },
-
         confirmLoading: false,
+        treeData: [],
         validatorRules:{
+          equipmentId: [
+            { required: true, message: '璇烽�夋嫨璁惧锛�' }
+          ],
+          leanDepartId: [
+            { required: true, message: '璇烽�夋嫨杞﹂棿锛�' }
+          ],
+          leanReason: [
+            { required: true, message: '璇疯緭鍏ュ�熺敤鍘熷洜锛�' }
+          ],
         },
         url: {
           add: "/eam/eamEquipmentLeanOut/add",
           edit: "/eam/eamEquipmentLeanOut/edit",
+          loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions',
         },
       }
     },
     created () {
+      this.loadAllProductionTree();
     },
     methods: {
       add () {
         //鍒濆鍖栭粯璁ゅ��
-        this.edit({});
+        //鍒濆鍖栭粯璁ゅ��
+        this.model = {}
+        this.visible = true
+        this.editable = false
       },
       edit (record) {
-        this.model = Object.assign({}, record);
-        this.visible = true;
+        this.model = Object.assign({}, record)
+        this.visible = true
+        this.editable = true
+        this.loadDetail(record.id)
       },
       close () {
         this.$emit('close');
@@ -115,12 +124,12 @@
               if(res.success){
                 that.$message.success(res.message);
                 that.$emit('ok');
+                that.close();
               }else{
                 that.$message.warning(res.message);
               }
             }).finally(() => {
               that.confirmLoading = false;
-              that.close();
             })
           }else{
              return false;
@@ -130,7 +139,16 @@
       handleCancel () {
         this.close()
       },
-
+      loadAllProductionTree() {
+        //鍔犺浇杞﹂棿閫夋嫨鏍�
+        getAction(this.url.loadProductionOptions).then(res => {
+          if (res.success) {
+            this.treeData = [...res.result]
+          }else {
+            that.$message.warning(res.message)
+          }
+        })
+      },
 
     }
   }

--
Gitblit v1.9.3