From 09cdacb5994bc840723b4292fb863d947f5d58c8 Mon Sep 17 00:00:00 2001
From: cuikaidong <ckd2942379034@163.com>
Date: 星期二, 27 五月 2025 17:38:53 +0800
Subject: [PATCH] 设备报废功能增加

---
 src/views/eam/dispose/EamEquipmentScrapList.vue |  379 ++++++++++++++++++++++++++++++-----------------------
 1 files changed, 213 insertions(+), 166 deletions(-)

diff --git a/src/views/eam/dispose/EamEquipmentScrapList.vue b/src/views/eam/dispose/EamEquipmentScrapList.vue
index 61fbecf..d9986e6 100644
--- a/src/views/eam/dispose/EamEquipmentScrapList.vue
+++ b/src/views/eam/dispose/EamEquipmentScrapList.vue
@@ -1,46 +1,47 @@
 <template>
-  <a-card :bordered="false">
+  <a-card :bordered='false'>
 
     <!-- 鏌ヨ鍖哄煙 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="searchQuery">
-        <a-row :gutter="24">
+    <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 :lg='7' :md='8' :sm='24' :xl='6'>
+            <a-form-item label='璁惧缂栧彿'>
+              <lx-search-equipment-select v-model='queryParam.equipmentId'
+                                          placeholder='璇疯緭鍏ヨ澶囩紪鍙锋垨鍚嶇О鎼滅储'></lx-search-equipment-select>
             </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.code"></a-input>
+          <a-col :lg='7' :md='8' :sm='24' :xl='6'>
+            <a-form-item label='鍗曟嵁鍙�'>
+              <a-input v-model='queryParam.code' placeholder='璇疯緭鍏ュ崟鎹彿'></a-input>
             </a-form-item>
           </a-col>
-        <template v-if="toggleSearchStatus">
-          <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>
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
-            <a-form-item label="杞/鎶ュ簾">
-              <a-input placeholder="璇疯緭鍏ヨ浆璁�/鎶ュ簾" v-model="queryParam.scrapType"></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.reportUser"></a-input>
-            </a-form-item>
-          </a-col>
+          <template v-if='toggleSearchStatus'>
+            <a-col :lg='7' :md='8' :sm='24' :xl='6'>
+              <a-form-item label='璁惧ID'>
+                <a-input v-model='queryParam.equipmentId' placeholder='璇疯緭鍏ヨ澶嘔D'></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :lg='7' :md='8' :sm='24' :xl='6'>
+              <a-form-item label='杞/鎶ュ簾'>
+                <a-input v-model='queryParam.scrapType' placeholder='璇疯緭鍏ヨ浆璁�/鎶ュ簾'></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :lg='7' :md='8' :sm='24' :xl='6'>
+              <a-form-item label='鐢宠浜�'>
+                <a-input v-model='queryParam.reportUser' placeholder='璇疯緭鍏ョ敵璇蜂汉'></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-col :lg='7' :md='8' :sm='24' :xl='6'>
+            <span class='table-page-search-submitButtons' style='float: left;overflow: hidden;'>
+              <a-button icon='search' type='primary' @click='searchQuery'>鏌ヨ</a-button>
+              <a-button icon='reload' style='margin-left: 8px' type='primary' @click='searchReset'>閲嶇疆</a-button>
+              <!--              <a @click="handleToggleSearch" style="margin-left: 8px">-->
+              <!--                {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}-->
+              <!--                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
+              <!--              </a>-->
             </span>
           </a-col>
 
@@ -49,54 +50,66 @@
     </div>
 
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
-    <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>
+    <div class='table-operator'>
+      <a-button icon='plus' type='primary' @click='handleAdd'>鏂板</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-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>椤�
-        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+      <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>椤�
+        <a style='margin-left: 24px' @click='onClearSelected'>娓呯┖</a>
       </div>
 
       <a-table
-        ref="table"
-        size="middle"
+        ref='table'
+        :columns='columns'
+        :dataSource='dataSource'
+        :loading='loading'
+        :pagination='ipagination'
+        :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
         bordered
-        rowKey="id"
-        :columns="columns"
-        :dataSource="dataSource"
-        :pagination="ipagination"
-        :loading="loading"
-        class="j-table-force-nowrap"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
+        class='j-table-force-nowrap'
+        rowKey='id'
+        size='middle'
+        @change='handleTableChange'>
 
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
+         <span slot='action' slot-scope='text, record'>
+          <template v-if="record.scrapStatus === 'WAIT_SUBMIT'">
+              <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-menu slot="overlay">
+            <a class='ant-dropdown-link'>鏇村 <a-icon type='down' /></a>
+            <a-menu slot='overlay'>
+               <a-menu-item>
+                 <a @click='handleEdit(record)'>缂栬緫</a>
+              </a-menu-item>
               <a-menu-item>
-                <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">
+                <a-popconfirm title='纭畾鍒犻櫎鍚�?' @confirm='() => handleDelete(record.id)'>
                   <a>鍒犻櫎</a>
                 </a-popconfirm>
               </a-menu-item>
             </a-menu>
           </a-dropdown>
+            </template>
+          <template v-else>
+            <a href='javascript:;' @click='handleDetail(record)'>璇︽儏</a>
+          </template>
         </span>
 
       </a-table>
@@ -104,122 +117,156 @@
     <!-- table鍖哄煙-end -->
 
     <!-- 琛ㄥ崟鍖哄煙 -->
-    <eamEquipmentScrap-modal ref="modalForm" @ok="modalFormOk"></eamEquipmentScrap-modal>
+    <eamEquipmentScrap-modal ref='modalForm' @ok='modalFormOk'></eamEquipmentScrap-modal>
   </a-card>
 </template>
 
 <script>
-  import '@/assets/less/TableExpand.less'
-  import EamEquipmentScrapModal from './modules/EamEquipmentScrapModal'
-  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import '@/assets/less/TableExpand.less'
+import EamEquipmentScrapModal from './modules/EamEquipmentScrapModal'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
+import { getAction } from '@api/manage'
 
-  export default {
-    name: "EamEquipmentScrapList",
-    mixins:[JeecgListMixin],
-    components: {
-      EamEquipmentScrapModal
-    },
-    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: '鍗曟嵁鍙�',
-            align:"center",
-            dataIndex: 'code'
-           },
-		   {
-            title: '璁惧ID',
-            align:"center",
-            dataIndex: 'equipmentId'
-           },
-		   {
-            title: '杞/鎶ュ簾',
-            align:"center",
-            dataIndex: 'scrapType'
-           },
-		   {
-            title: '鐢宠浜�',
-            align:"center",
-            dataIndex: 'reportUser'
-           },
-		   {
-            title: '澶勭疆鏃堕棿',
-            align:"center",
-            dataIndex: 'scrapTime'
-           },
-		   {
-            title: '澶勭疆鐞嗙敱',
-            align:"center",
-            dataIndex: 'scrapReason'
-           },
-		   {
-            title: '澶勭疆閲戦',
-            align:"center",
-            dataIndex: 'scrapAmount'
-           },
-		   {
-            title: '瀹℃牳浜�',
-            align:"center",
-            dataIndex: 'approvalUser'
-           },
-		   {
-            title: '瀹℃牳鎰忚',
-            align:"center",
-            dataIndex: 'approvalComment'
-           },
-		   {
-            title: '瀹℃牳鏃堕棿',
-            align:"center",
-            dataIndex: 'approvalTime'
-           },
-		   {
-            title: '澶囨敞',
-            align:"center",
-            dataIndex: 'remark'
-           },
-          {
-            title: '鎿嶄綔',
-            dataIndex: 'action',
-            align:"center",
-            scopedSlots: { customRender: 'action' },
+
+export default {
+  name: 'EamEquipmentScrapList',
+  mixins: [JeecgListMixin],
+  components: {
+    EamEquipmentScrapModal,
+    LxSearchEquipmentSelect
+  },
+  data() {
+    return {
+      description: '璁惧鎶ュ簾(杞)绠$悊椤甸潰',
+      // 琛ㄥご
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 60,
+          align: 'center',
+          customRender: function(t, r, index) {
+            return parseInt(index) + 1
           }
-        ],
-		url: {
-          list: "/eam/eamEquipmentScrap/list",
-          delete: "/eam/eamEquipmentScrap/delete",
-          deleteBatch: "/eam/eamEquipmentScrap/deleteBatch",
-          exportXlsUrl: "eam/eamEquipmentScrap/exportXls",
-          importExcelUrl: "eam/eamEquipmentScrap/importExcel",
-       },
+        },
+        {
+          title: '鍗曟嵁鍙�',
+          align: 'center',
+          dataIndex: 'code'
+        },
+        {
+          title: '璁惧缂栧彿',
+          align: 'center',
+          dataIndex: 'equipmentCode'
+        },
+        {
+          title: '璁惧鍚嶇О',
+          align: 'center',
+          dataIndex: 'equipmentName'
+        },
+        {
+          title: '杞/鎶ュ簾',
+          align: 'center',
+          dataIndex: 'scrapType_dictText'
+        },
+        {
+          title: '鐢宠浜�',
+          align: 'center',
+          dataIndex: 'reportUser_dictText'
+        },
+        {
+          title: '澶勭疆鏃堕棿',
+          align: 'center',
+          dataIndex: 'scrapTime'
+        },
+        {
+          title: '澶勭疆鐞嗙敱',
+          align: 'center',
+          dataIndex: 'scrapReason'
+        },
+        {
+          title: '澶勭疆閲戦',
+          align: 'center',
+          dataIndex: 'scrapAmount'
+        },
+        {
+          title: '澶勭疆鐘舵��',
+          align: 'center',
+          dataIndex: 'scrapStatus_dictText'
+        },
+        {
+          title: '瀹℃牳浜�',
+          align: 'center',
+          dataIndex: 'approvalUser_dictText'
+        },
+        {
+          title: '瀹℃牳鎰忚',
+          align: 'center',
+          dataIndex: 'approvalComment'
+        },
+        {
+          title: '瀹℃牳鏃堕棿',
+          align: 'center',
+          dataIndex: 'approvalTime'
+        },
+        {
+          title: '澶囨敞',
+          align: 'center',
+          dataIndex: 'remark'
+        },
+        {
+          title: '鎿嶄綔',
+          dataIndex: 'action',
+          align: 'center',
+          fixed: 'right',
+          width: 150,
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      url: {
+        list: '/eam/eamEquipmentScrap/list',
+        delete: '/eam/eamEquipmentScrap/delete',
+        deleteBatch: '/eam/eamEquipmentScrap/deleteBatch',
+        submit: '/eam/eamEquipmentScrap/submit'
+      }
     }
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
-    methods: {
-     
+  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

--
Gitblit v1.9.3