From 88a01935759943d38e1ab5d318ace12e3d948a60 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期五, 05 九月 2025 10:32:11 +0800
Subject: [PATCH] 刀具刃磨功能,增加刃磨后刀具信息变更

---
 src/views/tms/requirement/ToolSharpeningList .vue     |    5 +
 src/views/tms/modules/inbound/InboundModel.vue        |   31 ++++++
 src/views/tms/modules/outBound/OutboundListRight.vue  |    2 
 src/views/tms/modules/inbound/ChangeClassifyModal.vue |  257 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 294 insertions(+), 1 deletions(-)

diff --git a/src/views/tms/modules/inbound/ChangeClassifyModal.vue b/src/views/tms/modules/inbound/ChangeClassifyModal.vue
new file mode 100644
index 0000000..6616683
--- /dev/null
+++ b/src/views/tms/modules/inbound/ChangeClassifyModal.vue
@@ -0,0 +1,257 @@
+<template>
+  <!--鏀寔鍏ㄥ睆缂╂斁-->
+  <j-modal
+    :visible="visible"
+    :title="title"
+    switchFullscreen
+    :width="1200"
+    @ok="handleSubmit"
+    @cancel="close"
+    style="top: 50px"
+    cancelText="鍏抽棴"
+  >
+    <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="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="宸ュ叿缂栫爜">
+                <a-input placeholder="璇疯緭鍏ュ伐鍏风紪鐮�,鏀寔妯$硦鏌ヨ" v-model="queryParam.toolCode"></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.groupCompanySign"></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.shortCalled"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <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-row>
+        </a-form>
+      </div>
+      <!--宸ュ叿鍒楄〃-->
+      <a-table
+        ref="table"
+        :scroll="scrollTrigger"
+        size="middle"
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
+        :loading="loading"
+        @change="handleTableChange"
+      >
+      </a-table>
+    </a-card>
+  </j-modal>
+</template>
+
+<script>
+import { filterObj } from '@/utils/util'
+import { getAction } from '@/api/manage'
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+export default {
+  name: 'ChangeClassifyModal',
+  mixins: [JeecgListMixin],
+  components: {},
+  props: {
+    classifyId:{
+        type:String
+      }
+  },
+  data() {
+    return {
+      queryParam: {},
+      columns: [
+        {
+          title: '#',
+          dataIndex: '',
+          key: 'rowIndex',
+          width: 50,
+          align: 'center',
+          customRender: function (t, r, index) {
+            return parseInt(index) + 1
+          },
+        },
+        {
+          title: '宸ュ叿缂栫爜',
+          align: 'center',
+          dataIndex: 'toolCode',
+        },
+        {
+          title: '宸ュ叿鍚嶇О',
+          align: 'center',
+          dataIndex: 'chineseName',
+        },
+        {
+          title: '宸ュ叿绠�绉�',
+          align: 'center',
+          dataIndex: 'shortCalled',
+        },
+        {
+          title: '鏍囪',
+          align: 'center',
+          dataIndex: 'groupCompanySign',
+        },
+        {
+          title: '搴撲綅鍙�',
+          align: 'center',
+          dataIndex: 'positionCode',
+        },
+        {
+          title: '鍨嬪彿/鍥惧彿',
+          align: 'center',
+          dataIndex: 'toolModel',
+        },
+        {
+          title: '宸ュ叿绫诲瀷',
+          align: 'center',
+          dataIndex: 'applicationTypeName',
+        },
+      ],
+      selectedRowKeys: [],
+      oldSlelectRows: [],
+      scrollTrigger: {},
+      dataSource: [],
+      selectionRows: [],
+      allSelectionRows: [],
+      title: '鏍规嵁鏌ヨ缁撴灉閫夋嫨宸ュ叿缂栫爜',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['5', '10', '20'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0,
+      },
+      isorter: {
+        column: 'toolCode',
+        order: 'desc',
+      },
+      departTree: [],
+      visible: false,
+      loading: false,
+      url: {
+        // list: '/base/tooling/list',
+         list: '/tms/baseTools/paraCommonToolList',
+      },
+      oldId:''
+    }
+  },
+  computed: {
+    
+  },
+  watch: {},
+  created() {},
+  methods: {
+    
+    
+    showModal(oldId) {
+      this.oldId = oldId
+      this.visible = true
+      this.loadData(1)
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    //鏌ヨ鏉′欢澶勭悊
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    async loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      let that = this
+      this.loading = true
+      let params = this.getQueryParams() //鏌ヨ鏉′欢
+      params.classifyId = this.classifyId
+      await getAction(this.url.list, params).then((res) => {
+        if (res.success) {
+          this.dataSource = res.result.records
+          this.ipagination.total = res.result.total
+        }
+        if (res.code === 510) {
+          this.$message.warning(res.message)
+        }
+        this.loading = false
+      })
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.loadData(1)
+      }
+      that.selectborrowIds = []
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys;
+      this.selectionRows = selectionRows;
+      this.selectionRows[0].oldId = this.oldId
+    },
+    close() {
+      this.searchReset(0)
+      this.selectedRowKeys = []
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //TODO 绛涢��
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      this.$bus.$emit('selectionToolCode', this.selectionRows[0]);
+      this.searchReset(0)
+      this.close()
+    },
+    onSearch() {
+      this.loadData(1)
+    },
+     searchQuery() {
+      this.loadData(1);
+    },
+    searchReset() {
+      this.queryParam = {}
+      this.loadData(1)
+    },
+  },
+}
+</script>
+
+<style scoped>
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>
\ No newline at end of file
diff --git a/src/views/tms/modules/inbound/InboundModel.vue b/src/views/tms/modules/inbound/InboundModel.vue
index 623e2a6..66cf019 100644
--- a/src/views/tms/modules/inbound/InboundModel.vue
+++ b/src/views/tms/modules/inbound/InboundModel.vue
@@ -86,6 +86,8 @@
         </div>
       </template>
       <span slot="action" slot-scope="text, record, index">
+        <a @click="handleChangeClassify(record)" v-if="sharpenShow && !disableSubmit">鍙樻洿宸ュ叿鍒嗙被</a>
+        <a-divider type="vertical" v-if="sharpenShow && !disableSubmit"/>
         <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit">
           <a>鍒犻櫎</a>
         </a-popconfirm>
@@ -102,6 +104,7 @@
     <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-tooling-modal>
     <j-select-return-list-modal ref="returnModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-return-list-modal>
     <j-select-sharpen-list-modal ref="sharpenModalForm" @ok="modalFormOk" :classifyId="classifyId"></j-select-sharpen-list-modal>
+    <change-classify-modal ref="changeClassifyModalForm" @ok="modalFormOk" :classifyId="classifyId"></change-classify-modal>
   
     <div id="printArea" style="display: block;">
       <div v-for="(item, index) in qrList" :key="index" class="qrcode-item">
@@ -117,6 +120,7 @@
 <script>
 import pick from 'lodash.pick'
 import JSelectToolingModal from '.././inboundOrder/JSelectToolingModal'
+import ChangeClassifyModal from './ChangeClassifyModal'
 import { ajaxGetDictItems } from '@/api/api'
 import moment from 'moment'
 import { getAction, postAction, requestPut } from '@/api/manage'
@@ -137,6 +141,7 @@
     JSelectReturnListModal,
     JSearchSelectTag,
     JSelectSharpenListModal,
+    ChangeClassifyModal
   },
   data() {
     return {
@@ -259,6 +264,11 @@
           align: 'center',
           dataIndex: 'inStorageQuantity',
           scopedSlots: { customRender: 'inStorageQuantity' },
+        },
+        {
+          title: '鏂板伐鍏风紪鐮�',
+          align: 'center',
+          dataIndex: 'newToolCode',
         },
         {
           title: '鎿嶄綔',
@@ -460,6 +470,12 @@
           scanStyles: false
         });
       });
+    },
+    //鍒冪(鍚庡彉鏇村伐鍏峰垎绫�
+    handleChangeClassify(record){
+      this.$refs.changeClassifyModalForm.showModal(record.id)
+      this.$refs.changeClassifyModalForm.title = '閫夋嫨宸ュ叿鍒嗙被'
+      this.$refs.changeClassifyModalForm.disableSubmit = false
     }
   },
   watch: {},
@@ -483,6 +499,21 @@
       }
       //this.ipaginationm.total = this.dataSource.length
     })
+    this.$bus.$on('selectionToolCode', (data) => {
+      //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟
+      for (let i = 0; i < this.dataSource.length; i++) {
+        console.log("1111",this.dataSource.length,data,this.dataSource[i])
+        if(this.dataSource[i].id == data.oldId){
+          this.dataSource[i].newToolCode = data.toolCode
+          this.dataSource[i].newToolCodeId = data.toolCodeId
+          this.dataSource[i].goodsShelvesId = data.positionCode
+          this.$set(this.dataSource[i],'newToolClassify',data.toolCode)
+        }
+      }
+      // 寮哄埗鏇存柊瑙嗗浘
+      this.$forceUpdate();
+      //this.ipaginationm.total = this.dataSource.length
+    })
   },
 }
 </script>
diff --git a/src/views/tms/modules/outBound/OutboundListRight.vue b/src/views/tms/modules/outBound/OutboundListRight.vue
index ecea874..0fd3f54 100644
--- a/src/views/tms/modules/outBound/OutboundListRight.vue
+++ b/src/views/tms/modules/outBound/OutboundListRight.vue
@@ -357,7 +357,7 @@
       onSelectChange(selectedRowKeys, selectionRows) {
         this.selectedRowKeys = selectedRowKeys;
         this.selectionRows = selectionRows;
-        const toolCode = this.selectionRows[0].toolCode
+        const toolCode = this.selectionRows[0].toolCodeId
         //閫氳繃id鏌ヨ绠$悊鍙傛暟鍜屽弬鏁版暟鎹�
         getAction(this.url.queryParaByToolCode, { toolCode: toolCode,paraTypeFlag:this.paraTypeFlag}).then((res) => {
           if (res.success) {
diff --git a/src/views/tms/requirement/ToolSharpeningList .vue b/src/views/tms/requirement/ToolSharpeningList .vue
index ef06cd2..6e0066d 100644
--- a/src/views/tms/requirement/ToolSharpeningList .vue
+++ b/src/views/tms/requirement/ToolSharpeningList .vue
@@ -142,6 +142,11 @@
           dataIndex: 'supplierId',
         },
         {
+          title:'鍒冪(鐘舵��',
+          align:"center",
+          dataIndex: 'sharpeningStatus_dictText'
+        },
+        {
           title:'鍒冪(鏃堕棿',
           align:"center",
           dataIndex: 'sharpeningTime'

--
Gitblit v1.9.3