From f58c33cff459aa6544ecade64866d3ebb26bfac5 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期四, 31 七月 2025 18:21:02 +0800
Subject: [PATCH] 工具盘点-新增、编辑调整差异值可谓负数,和列表保持一致

---
 src/views/tms/requirement/ToolSharpeningList .vue |  197 ++++++++++++------------------------------------
 1 files changed, 51 insertions(+), 146 deletions(-)

diff --git a/src/views/tms/requirement/ToolSharpeningList .vue b/src/views/tms/requirement/ToolSharpeningList .vue
index d864f8c..ef06cd2 100644
--- a/src/views/tms/requirement/ToolSharpeningList .vue
+++ b/src/views/tms/requirement/ToolSharpeningList .vue
@@ -1,22 +1,23 @@
 <template>
   <a-card :bordered="false">
+
     <!-- 鏌ヨ鍖哄煙 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
-            <a-form-item label="鍒�鍏峰悕绉�">
-              <a-input placeholder="璇疯緭鍏ュ垁鍏峰悕绉�" v-model="queryParam.toolName"></a-input>
+            <a-form-item label="鍒�鍏风紪鍙�">
+              <a-input placeholder="璇疯緭鍏ュ垁鍏风紪鍙�" v-model="queryParam.toolId"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
             <a-form-item label="鍒冪(缁撴灉">
-              <a-input placeholder="璇疯緭鍏ュ垉纾ㄧ粨鏋�" v-model="queryParam.grindingResult"></a-input>
+              <a-input placeholder="璇疯緭鍏ュ垉纾ㄧ粨鏋�" v-model="queryParam.sharpeningResult"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鍒冪(鏃堕棿">
-              <a-range-picker v-model="queryParam.inspectionDateRange" @change="onInspectionDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
+              <a-range-picker v-model="queryParam.sharpeningTime" @change="onToolSharpeningDateChange" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />
             </a-form-item>
           </a-col>
           <a-col :xl="4" :lg="7" :md="8" :sm="24">
@@ -28,78 +29,86 @@
         </a-row>
       </a-form>
     </div>
-    <!-- 鏌ヨ鍖哄煙-END -->
 
     <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
     <div class="table-operator">
-      <div class="table-operator">
-        <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button>
-      </div>
+      <a-button @click="handleAdd" type="primary" icon="plus">鏂板</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-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>
 
       <a-table
         ref="table"
         size="middle"
-        :scroll="{x:true}"
         bordered
         rowKey="id"
         :columns="columns"
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="null"
         class="j-table-force-nowrap"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         @change="handleTableChange">
 
-
-
         <span slot="action" slot-scope="text, record">
-          <a @click="handleDetail(record)">璇︽儏</a>
+          <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 @click="handleEdit(record)">缂栬緫</a>
+                <a @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>
         </span>
 
       </a-table>
     </div>
+    <!-- table鍖哄煙-end -->
 
-    <tools-sharpening-modal ref="modalForm" :treeSelected="treeSelected" @ok="modalFormOk"></tools-sharpening-modal>
+    <tools-sharpening-modal ref="modalForm"  @ok="modalFormOk"></tools-sharpening-modal>
   </a-card>
 </template>
 
 <script>
-
 import '@/assets/less/TableExpand.less'
-import { mixinDevice } from '@/utils/mixin'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import ToolsSharpeningModal from './modules/ToolsSharpeningModal'
 import { getAction, putAction, deleteAction } from '../../../api/manage'
-
 export default {
-  name: 'ToolSharpeningList ',
-  mixins:[JeecgListMixin, mixinDevice],
+  name: 'ToolSharpeningList',
+  mixins: [JeecgListMixin],
   components: {
     ToolsSharpeningModal
   },
-  data () {
+  data() {
     return {
-      description: '鍒�鍏峰垉纾�',
+      description: '鍒�鍏峰垉纾ㄩ〉闈�',
       // 琛ㄥご
       columns: [
         {
@@ -115,48 +124,37 @@
         {
           title:'鍒�鍏峰垎绫�',
           align:"center",
-          dataIndex: 'warehouseId'
+          dataIndex: 'paramaTableName_dictText'
         },
         {
           title:'鍒�鍏风紪鍙�',
           align:"center",
-          dataIndex: 'warehouseName'
+          dataIndex: 'toolId'
         },
-        {
-          title:'鍒�鍏峰悕绉�',
-          align:"center",
-          dataIndex: 'warehouseName'
-        },
-        {
-          title:'鍒�鍏锋潗鏂�',
-          align:"center",
-          dataIndex: 'parentWarehouseName',
-        },
+        // {
+        //   title:'鍒�鍏峰悕绉�',
+        //   align:"center",
+        //   dataIndex: 'typeName'
+        // },
         {
           title:'鍘傚',
           align:"center",
-          dataIndex: 'status',
+          dataIndex: 'supplierId',
         },
-        {
-          title:'闆朵欢鏉愭枡',
-          align:"center",
-          dataIndex: 'remark'
-        },
-
         {
           title:'鍒冪(鏃堕棿',
           align:"center",
-          dataIndex: 'createBy'
+          dataIndex: 'sharpeningTime'
         },
         {
           title:'鍒冪(缁撴灉鍙婂缓璁�',
           align:"center",
-          dataIndex: 'createBy'
+          dataIndex: 'sharpeningResult'
         },
         {
           title:'璐d换浜�',
           align:"center",
-          dataIndex: 'createBy'
+          dataIndex: 'responsiblePerson_dictText'
         },
 
         {
@@ -180,123 +178,30 @@
         }
       ],
       url: {
-        list: "/tms/toolSharpening/list",
+        list: "/tms/toolSharpening/listToolSharpening",
+        add: "/tms/toolSharpening/add",
         delete: "/tms/toolSharpening/delete",
         edit: "/tms/toolSharpening/edit",
         deleteBatch: "/tms/toolSharpening/deleteBatch",
         exportXlsUrl: "/tms/toolSharpening/exportXls",
         importExcelUrl: "tms/toolSharpening/importExcel",
-
       },
-      dictOptions:{},
-      superFieldList:[],
-      treeSelected: {},
     }
-  },
-  created() {
-    this.getSuperFieldList();
   },
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    },
-    addFlag: function(){
-      return !(this.treeSelected.key && this.treeSelected.entity.leafFlag === '2');
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
-  },
-  mounted() {
-    this.handleGetCurrSelected = (data) => {
-      this.treeSelected = data;
-      this.queryParam.parentId = data.key;
-      this.loadData();
-    }
-    this.$bus.$on('getCurrSelected', this.handleGetCurrSelected);
-  },
-  beforeDestroy() {
-    this.$bus.$off('getCurrSelected', this.handleGetCurrSelected);
   },
   methods: {
-    handleStatus(record) {
-      getAction(this.url.list, { parentId: record.id }).then((res) => {
-        if (res.success) {
-          if (res.result.total > 0) {
-            this.$message.warning('璇ヨ妭鐐逛笅瀛樺湪瀛愯妭鐐癸紝涓嶈兘鍙樻洿鐘舵�侊紒')
-          } else {
-            const params = {
-              id: record.id,
-              status: record.status === '1' ? '2' : '1'
-            }
-            putAction(this.url.edit, params).then((res) => {
-              if (res.success) {
-                this.$message.success(res.message)
-                this.loadData()
-              } else {
-                this.$message.warning(res.message)
-              }
-            })
-          }
-        } else {
-          this.$message.warning(res.message);
-        }
-      });
+        onToolSharpeningDateChange: function(value, dateString) {
+          this.queryParam.sharpeningTimeBegin = dateString[0]
+          this.queryParam.sharpeningTimeEnd = dateString[1]
+        },
 
-    },
-    handleDelete(id) {
-      getAction(this.url.list, { parentId: id }).then((res) => {
-        if (res.success) {
-          if (res.result.total > 0) {
-            this.$message.warning('璇峰厛鍒犻櫎瀛愯妭鐐�');
-          } else {
-            deleteAction(this.url.delete, {id: id}).then((res) => {
-              if (res.success) {
-                //閲嶆柊璁$畻鍒嗛〉闂
-                this.loadData()
-                this.$message.success(res.message);
-                this.$bus.$emit('queryTreeData')
-              } else {
-                this.$message.warning(res.message);
-              }
-            });
-          }
-        } else {
-          this.$message.warning(res.message);
-        }
-      })
-    },
-    searchReset() {
-      this.queryParam = {
-        parentId: this.treeSelected.key
-      }
-      this.loadData(1)
-    },
-    modalFormOk() {
-      this.loadData()
-      this.$bus.$emit('queryTreeData')
-    },
-    initDictConfig(){
-    },
-    getSuperFieldList(){
-      let fieldList=[];
-      fieldList.push({type:'string',value:'toolId',text:'宸ュ叿缂栧彿',dictCode:''})
-      fieldList.push({type:'string',value:'warehouseName',text:'浠撳簱鍚嶇О',dictCode:''})
-      fieldList.push({type:'string',value:'parentId',text:'鐖惰妭鐐圭紪鍙�',dictCode:''})
-      fieldList.push({type:'string',value:'seq',text:'灞曠ず搴忓彿',dictCode:''})
-      fieldList.push({type:'string',value:'leafFlag',text:'鏄惁鍙跺瓙鑺傜偣(1鏄�;2鍚�)',dictCode:''})
-      fieldList.push({type:'string',value:'status',text:'鐘舵�侊紙1鍚敤;2鍋滅敤锛�',dictCode:''})
-      fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''})
-      fieldList.push({type:'string',value:'createBy',text:'鍒涘缓浜�',dictCode:''})
-      fieldList.push({type:'date',value:'createTime',text:'鍒涘缓鏃堕棿'})
-      this.superFieldList = fieldList
-    }
   }
 }
 </script>
 <style scoped>
 @import '~@assets/less/common.less';
-.enable {
-  color: green;
-}
-.disable {
-  color: red;
-}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3