From f6f8dc9a6d4111a541fffe105d3979b40a2c2f75 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期二, 10 六月 2025 09:42:15 +0800
Subject: [PATCH] 刀具刃磨-新增异常调整  工具报损 -选择工具调整  刃磨-选择工具调整

---
 src/views/tms/lossBound/LossboundList.vue                     |   11 --
 src/views/tms/requirement/ToolSharpeningList .vue             |  111 +++++++---------------
 src/views/tms/lossBound/modules/LossboundModal.vue            |   10 +-
 src/views/tms/requirement/modules/ToolsSharpeningModal.vue    |  112 ++++++++++------------
 src/views/tms/requirement/modules/ToolsModal.vue              |    6 
 src/views/tms/lossBound/LossboundDetailList.vue               |    2 
 src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue |    2 
 7 files changed, 98 insertions(+), 156 deletions(-)

diff --git a/src/views/tms/lossBound/LossboundDetailList.vue b/src/views/tms/lossBound/LossboundDetailList.vue
index bc54001..7702c7c 100644
--- a/src/views/tms/lossBound/LossboundDetailList.vue
+++ b/src/views/tms/lossBound/LossboundDetailList.vue
@@ -82,7 +82,7 @@
         {
           title: '鍒�鍏风紪鍙�',
           align: 'center',
-          dataIndex: 'toolCode'
+          dataIndex: 'toolId'
         },
         {
           title: '宸ュ叿绫诲瀷',
diff --git a/src/views/tms/lossBound/LossboundList.vue b/src/views/tms/lossBound/LossboundList.vue
index 67bac90..b04d6bd 100644
--- a/src/views/tms/lossBound/LossboundList.vue
+++ b/src/views/tms/lossBound/LossboundList.vue
@@ -190,16 +190,7 @@
     }
   },
   methods: {
-    // handleEdit: function (record) {
-    //   this.$refs.modalForm.edit(record);
-    //   this.$refs.modalForm.title = "缂栬緫";
-    //   this.$refs.modalForm.disableSubmit = false;
-    // },
-    // handleAdd: function () {
-    //   this.$refs.modalForm.add();
-    //   this.$refs.modalForm.title = "鏂板";
-    //   this.$refs.modalForm.disableSubmit = false;
-    // },
+
     modalFormOk() {
       this.$refs.lossboundDetailList.clearList()
       this.loadData()
diff --git a/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue b/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue
index ad06f5d..5df3d78 100644
--- a/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue
+++ b/src/views/tms/lossBound/modules/JSelectLossboundToolModal.vue
@@ -64,7 +64,7 @@
         {
           title: '宸ュ叿缂栫爜',
           align: 'center',
-          dataIndex: 'toolCode'
+          dataIndex: 'toolId'
         },
         {
           title: '涓枃鍚嶇О',
diff --git a/src/views/tms/lossBound/modules/LossboundModal.vue b/src/views/tms/lossBound/modules/LossboundModal.vue
index 2017454..bfa9ba6 100644
--- a/src/views/tms/lossBound/modules/LossboundModal.vue
+++ b/src/views/tms/lossBound/modules/LossboundModal.vue
@@ -193,10 +193,10 @@
           width: 50
         },
         {
-          title: '鍒�鍏风紪鍙�',
-          dataIndex: 'toolCode',
+          title: '鍒�鍏风紪鐮�',
+          dataIndex: 'toolId',
           align: 'center',
-          width: 150
+          width: 200
         },
 
         {
@@ -304,8 +304,8 @@
     this.$bus.$on('selectionRows', (data) => {
       for (let i = 0; i < data.length; i++) {
         this.dataSource.push({
-          toolId: data[i].id,
-          toolCode: data[i].toolCode,
+          toolCode:data[i].toolCode,
+          toolId:data[i].toolId,
           classifyId: data[i].classifyId,
           applicationType: data[i].applicationType_dictText,
           chineseName: data[i].chineseName,
diff --git a/src/views/tms/requirement/ToolSharpeningList .vue b/src/views/tms/requirement/ToolSharpeningList .vue
index cf8841a..abaa2ab 100644
--- a/src/views/tms/requirement/ToolSharpeningList .vue
+++ b/src/views/tms/requirement/ToolSharpeningList .vue
@@ -1,5 +1,6 @@
 <template>
   <a-card :bordered="false">
+
     <!-- 鏌ヨ鍖哄煙 -->
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
@@ -16,7 +17,7 @@
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鍒冪(鏃堕棿">
-              <a-range-picker v-model="queryParam.sharpeningTime" @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"  @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: [
         {
@@ -178,72 +187,22 @@
         exportXlsUrl: "/tms/toolSharpening/exportXls",
         importExcelUrl: "tms/toolSharpening/importExcel",
       },
-      dictOptions:{},
-      superFieldList:[],
-
     }
   },
-  created() {},
   computed: {
-    importExcelUrl: function(){
-      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-    },
+    importExcelUrl: function() {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
+    }
   },
-
   methods: {
-    onInspectionDateChange: function(value, dateString) {
-      this.queryParam.sharpeningTimeBegin = dateString[0]
-      this.queryParam.sharpeningTimeEnd = dateString[1]
-    },
-
-
-    handleEdit: function (record) {
-      console.log('record:', record)
-      this.$refs.modalForm.title = '缂栬緫'
-      this.$refs.modalForm.disableSubmit = false
-      this.$refs.modalForm.edit(record)
-
-    },
-    handleDetail:function(record){
-      this.$refs.modalForm.title="璇︽儏";
-      this.$refs.modalForm.disableSubmit = true;
-      this.$refs.modalForm.edit(record);
-    },
-
-
-    handleDelete: function (id) {
-      if (!this.url.delete) {
-        this.$message.error('璇疯缃畊rl.delete灞炴��!')
-        return
-      }
-      deleteAction(this.url.delete, { id: id }).then((res) => {
-        if (res.success) {
-          //閲嶆柊璁$畻鍒嗛〉闂
-          this.$message.success(res.message)
-          this.ipagination.current = 1
-          this.loadData() // 寮哄埗浠庣涓�椤靛姞杞�
-        } else {
-          this.$message.warning(res.message)
-        }
-      })
-    },
-    searchReset() {
-      this.loadData(1)
-    },
-    modalFormOk() {
-      this.loadData()
-    },
-
+        onToolSharpeningDateChange: function(value, dateString) {
+          this.queryParam.sharpeningTimeBegin = dateString[0]
+          this.queryParam.sharpeningTimeEnd = dateString[1]
+        },
 
   }
 }
 </script>
 <style scoped>
 @import '~@assets/less/common.less';
-.enable {
-  color: green;
-}
-.disable {
-  color: red;
-}
 </style>
\ No newline at end of file
diff --git a/src/views/tms/requirement/modules/ToolsModal.vue b/src/views/tms/requirement/modules/ToolsModal.vue
index 8b6e337..a8e1f42 100644
--- a/src/views/tms/requirement/modules/ToolsModal.vue
+++ b/src/views/tms/requirement/modules/ToolsModal.vue
@@ -70,7 +70,7 @@
       columns: [{
         title: '宸ュ叿缂栫爜',
         align: 'center',
-        dataIndex: 'toolCode'
+        dataIndex: 'toolId'
       },
         {
           title: '宸ュ叿绫诲瀷',
@@ -90,7 +90,7 @@
         {
           title: '宸ュ叿鍙傛暟鏍囪瘑',
           align: 'center',
-          dataIndex: 'paramaTableName'
+          dataIndex: 'paramaTableName_dictText'
         },
         {
           title: '鍨嬪彿/鍥惧彿',
@@ -198,7 +198,7 @@
       this.close()
     },
     handleOk() {
-      this.$bus.$emit('selectionRows', this.selectionRows)
+      this.$emit('sendSelectionRows', this.selectionRows[0])
       this.close()
     },
   }
diff --git a/src/views/tms/requirement/modules/ToolsSharpeningModal.vue b/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
index 9346322..d49bc28 100644
--- a/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
+++ b/src/views/tms/requirement/modules/ToolsSharpeningModal.vue
@@ -11,18 +11,20 @@
     @cancel="handleCancel"
     cancelText="鍏抽棴">
 
+
+
     <a-spin :spinning="spinning">
       <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item prop="standardCode" label="宸ュ叿缂栧彿">
-              <a-input-search v-model="model.toolId" placeholder="璇烽�夋嫨宸ュ叿缂栧彿" :disabled="disableSubmit"
+            <a-form-model-item prop="standardCode" label="宸ュ叿缂栫爜">
+              <a-input-search v-model="model.toolId" placeholder="璇烽�夋嫨宸ュ叿缂栫爜" :disabled="disableSubmit"
                               @search="selectTools" enter-button
               />
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item prop="classify_id" label="宸ュ叿鍒嗙被缂栫爜">
+            <a-form-model-item prop="classify_id" label="宸ュ叿鍒嗙被鍚嶇О">
               <a-input placeholder="璇疯緭鍏ュ伐鍏峰垎绫诲悕绉�" v-model="model.classifyId" readOnly :disabled="disableSubmit" />
             </a-form-model-item>
           </a-col>
@@ -31,13 +33,13 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-model-item prop="paramaTableName" label="宸ュ叿鍙傛暟鏍囪瘑">
-              <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.paramaTableName" readOnly
+              <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" readOnly v-model="model.paramaTableName_dictText" readOnly
                        :disabled="disableSubmit" />
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="宸ュ叿绫诲瀷">
-              <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.applicationType" readOnly
+              <a-input placeholder="閫夋嫨璁惧鍚庤嚜鍔ㄥ甫鍑�" v-model="model.applicationType_dictText" readOnly
                        :disabled="disableSubmit" />
             </a-form-model-item>
           </a-col>
@@ -99,13 +101,7 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="瀛樺偍浣嶇疆" prop="storageLocation">
-              <a-input placeholder="閫夋嫨濉啓瀛樺偍浣嶇疆" v-model="model.positionCode" readOnly
-                       :disabled="disableSubmit" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-model-item label="澶囨敞">
+            <a-form-model-item label="澶囨敞" prop="remark">
               <a-textarea v-model="model.remark" rows="3" placeholder="璇疯緭鍏ュ娉�" :disabled="disableSubmit" />
             </a-form-model-item>
           </a-col>
@@ -119,7 +115,7 @@
 
       <a-button @click="handleOk()" :disabled="disableSubmit" type="primary" :loading="confirmLoading">纭畾</a-button>
     </template>
-    <tools-modal ref="toolListModel"></tools-modal>
+    <tools-modal ref="toolListModel"  @sendSelectionRows="getRows"></tools-modal>
 
 
   </j-modal>
@@ -129,11 +125,14 @@
 import { getAction, postAction, requestPut } from '@/api/manage'
 import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
 import ToolsModal from '@views/tms/requirement/modules/ToolsModal.vue'
+import pick from 'lodash.pick'
+import DeviceListModel from '@views/mdc/base/modules/EquipmentList/DeviceListModal.vue'
 
 export default {
   name: 'ToolsSharpeningModal',
   mixins: [JVxeTableModelMixin],
   components: {
+    DeviceListModel,
     ToolsModal
   },
   data() {
@@ -165,36 +164,33 @@
           { required: true, message: '璇疯緭鍏ュ垉纾ㄧ粨鏋滃強寤鸿!' }
         ]
       },
+      lastSelectionData: null,
       url: {
         add: '/tms/toolSharpening/add',
         edit: '/tms/toolSharpening/edit',
-        queryDetailList: '/tms/toolSharpening/listToolSharpening'
+        // queryDetailList: '/tms/toolSharpening/listToolSharpening'
       }
     }
   },
   created() {
   },
-  mounted() {
-    this.$bus.$on('selectionRows', (data) => {
-      console.log('selectionRows', data)
-      if (data && data.length > 0) {
-        const item = data[0]
-        // 浣跨敤 $set 纭繚 model 鐨勫睘鎬ф槸鍝嶅簲寮忕殑
-        this.$set(this.model, 'toolId', item.toolCode)
-        this.$set(this.model, 'toolCode', item.id)
+
+  methods: {
+    getRows(item) {
+      console.log(item)
+      if (item.id) {
+        this.$set(this.model, 'toolId', item.toolId)
+        this.$set(this.model, 'toolCode', item.toolCode)
         this.$set(this.model, 'classifyId', item.classifyId)
-        this.$set(this.model, 'paramaTableName', item.paramaTableName_dictText)
-        this.$set(this.model, 'applicationType', item.applicationType_dictText)
+        this.$set(this.model, 'paramaTableName_dictText', item.paramaTableName_dictText)
+        this.$set(this.model, 'applicationType_dictText', item.applicationType_dictText)
         this.$set(this.model, 'toolModel', item.toolModel)
         this.$set(this.model, 'provinceCity', item.provinceCity)
         this.$set(this.model, 'warehouseId', item.warehouseId)
         this.$set(this.model, 'positionCode', item.positionCode)
         this.$set(this.model, 'mainUnit', item.mainUnit)
       }
-    })
-
-  },
-  methods: {
+    },
 
     selectTools: function() {
       this.$refs.toolListModel.showModals()
@@ -203,35 +199,32 @@
     },
 
     add() {
-      this.addShow = false
-      this.edit()
+      this.edit({})
     },
-
     edit(record) {
-      console.log(record)
-      // this.model = Object.assign({}, record)
-      this.visible = true
-      getAction(this.url.queryDetailList, {
-        id: record.id,
-        pageNo: 1,
-        pageSize: 99999
-      }).then((res) => {
-        if (res.success) {
-          const readOnlyData = res.result.records[0] || {}
-          this.model = Object.assign({}, this.model, {
-            paramaTableName: readOnlyData.paramaTableName_dictText,
-            applicationType: readOnlyData.applicationType_dictText,
-            provinceCity: readOnlyData.provinceCity,
-            warehouseId: readOnlyData.warehouseId,
-            positionCode: readOnlyData.positionCode,
-            mainUnit: readOnlyData.mainUnit,
-            toolModel: readOnlyData.toolModel
-          })
+      let that = this
+      that.visible = true
+      that.model = Object.assign({}, record)
+      // this.$nextTick(() => {
+      //   this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
+      //     'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue'))
+      // })
+    },
+    // edit(record) {
+    //   let that = this
+    //   that.visible = true
+    //   that.model = Object.assign({}, record)
+    //
+    //   // 濡傛灉鏈� selectionRows 鏁版嵁锛屽垯閲嶆柊璧嬪��
+    //   if (this.lastSelectionData && this.lastSelectionData.length > 0) {
+    //     this.assignModelFromSelection(this.lastSelectionData[0])
+    //     console.log('this.model',this.assignModelFromSelection(this.lastSelectionData[0]))
+    //   }
+    // },
+    close() {
+      this.$emit('close')
+      this.visible = false
 
-        } else {
-          this.dataSource = null
-        }
-      })
     },
     handleOk() {
       const that = this
@@ -272,15 +265,14 @@
       this.close()
     },
 
-    close() {
-      this.$emit('close')
-      this.visible = false
-      this.$refs.form.clearValidate()
-    }
+
   }
 }
 </script>
 
 <style lang="less" scoped>
 
-</style>
\ No newline at end of file
+</style>
+
+
+

--
Gitblit v1.9.3