From e48436b9c5dd3f0365f77339f84b37eea95b56e2 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 16 六月 2025 15:22:19 +0800
Subject: [PATCH] 提取刀具选择刀具 修改文件名称展示

---
 src/api/dnc.js                                                                       |    2 +
 src/views/dnc/base/modules/ProductStructure/GuideCardBatch/GuideCardBatchList.vue    |    3 +
 src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue |    6 ++
 src/views/tms/modules/baseTools/DncToolsSelectModal.vue                              |   27 ++++++++++++-
 src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue     |    6 ++
 src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue               |   72 +++++++++++++++++++++++++++++++++--
 6 files changed, 105 insertions(+), 11 deletions(-)

diff --git a/src/api/dnc.js b/src/api/dnc.js
index 4fa01c3..aae51bc 100644
--- a/src/api/dnc.js
+++ b/src/api/dnc.js
@@ -29,6 +29,8 @@
   assignDocumentToDeviceApi: params => postAction('/nc/activit/assign/file/apply', params),
   // 鎻愬彇鍒�鍏�
   extractToolsApi: ({ docId,attributionType, attributionId}) => getAction(`/nc/cutter/extractCutterInfo/${docId}/${attributionType}/${attributionId}`),
+  // 鍙戦�佸垁鍏风郴缁�
+  sendToolsApi: ({ docId,attributionType, attributionId}) => getAction(`/nc/cutter/sendCutterInfo/${docId}/${attributionType}/${attributionId}`),
   // 涓嬭浇鏂囨。
   downloadDocumentApi: ({ docId, docName }) => requestGetDownLoad(`/nc/doc/download/${docId}`, docName),
   // 鍒犻櫎鏂囨。
diff --git a/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue b/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
index c56927b..2fad9dd 100644
--- a/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
+++ b/src/views/dnc/base/modules/DeviceStructure/Document/HasReceivedDocumentTableList.vue
@@ -2,7 +2,10 @@
   <div>
     <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
              :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
-
+      <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず-->
+      <span slot="docName" slot-scope="text">
+          <j-ellipsis :value="text"/>
+        </span>
     </a-table>
 
     <DocumentModal ref="modalForm" @ok="modalFormOk"/>
@@ -48,6 +51,7 @@
             dataIndex: 'docName',
             key: 'docName',
             align: 'center',
+            scopedSlots: {customRender: 'docName'},
             width: 300,
             sorter: true
           },
diff --git a/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue b/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
index e9a470b..443a97a 100644
--- a/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
+++ b/src/views/dnc/base/modules/DeviceStructure/Document/HasSentDocumentTableList.vue
@@ -2,7 +2,10 @@
   <div>
     <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading"
              :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange">
-
+      <!-- 瀛楃涓茶秴闀挎埅鍙栫渷鐣ュ彿鏄剧ず-->
+      <span slot="docName" slot-scope="text">
+          <j-ellipsis :value="text"/>
+        </span>
     </a-table>
 
     <DocumentModal ref="modalForm" @ok="modalFormOk"/>
@@ -48,6 +51,7 @@
             dataIndex: 'docName',
             key: 'docName',
             align: 'center',
+            scopedSlots: {customRender: 'docName'},
             width: 300,
             sorter: true
           },
diff --git a/src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue b/src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue
index 451c5bb..610fa74 100644
--- a/src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue
+++ b/src/views/dnc/base/modules/ProductStructure/Cutter/CutterTableList.vue
@@ -20,7 +20,7 @@
             <a-space>
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
               <a-button type="primary" @click="handleAdd" icon="plus" v-has="'cutter_add'">鏂板</a-button>
-              <a-button type="primary" @click="handleAdd()" icon="export">鍙戦�佸垁鍏风郴缁�</a-button>
+              <a-button type="primary" @click="handleSend()" icon="export">鍙戦�佸垁鍏风郴缁�</a-button>
             </a-space>
           </a-col>
         </a-row>
@@ -31,7 +31,7 @@
              @change="handleTableChange" :scroll="{y:189}">
       <template slot="action" slot-scope="text, record">
 
-        <a @click="handleEdit(record)">閫夋嫨鍒�鍏�</a>
+        <a @click="handleChoose(record)">閫夋嫨鍒�鍏�</a>
 
         <a-divider type="vertical"/>
 
@@ -56,16 +56,21 @@
     </a-table>
 
     <CutterModal ref="cutterModalRef" :currentTreeNodeInfo="currentLevelInfo" @submitSuccess="loadData"/>
+
+    <DncToolsSelectModal ref="dncToolsSelectModal" @submitSuccess="loadData"/>
   </div>
 </template>
 
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import CutterModal from '@views/dnc/base/modules/ProductStructure/Cutter/CutterModal.vue'
+import DncToolsSelectModal from '@views/tms/modules/baseTools/DncToolsSelectModal.vue'
+import { getAction, httpAction } from '@api/manage'
+import dncApi from '@api/dnc'
 
 export default {
   name: 'CutterTableList',
-  components: { CutterModal },
+  components: { DncToolsSelectModal, CutterModal },
   mixins: [JeecgListMixin],
   props: {
     currentLevelInfo: {
@@ -89,7 +94,7 @@
             return parseInt(index) + 1
           }
         },
-        { title: '鍒�鍏风紪鍙�', dataIndex: 'cutterCode', width: 100, align: 'center' },
+        { title: '鍒�鍏风紪鍙�', dataIndex: 'cutterCode', width: 200, align: 'center' },
         { title: '鍒�鍏峰悕绉�', dataIndex: 'cutterName', width: 100, align: 'center' },
         { title: '鍒�鍏风畝绉�', dataIndex: 'cutterType', width: 80, align: 'center' },
         { title: '鍒�鍏疯鏍�', dataIndex: 'cutterSpec', align: 'center' },
@@ -103,7 +108,8 @@
         list: '/nc/cutter/getByBusinessId',
         delete: '/nc/cutter/delete',
         exportXlsUrl: '/nc/cutter/exportXls',
-        importExcelUrl: '/nc/cutter/importExcel'
+        importExcelUrl: '/nc/cutter/importExcel',
+        sendCutterUrl: '/nc/cutter/sendCutterUrl',
       }
     }
   },
@@ -171,6 +177,62 @@
       this.$refs.cutterModalRef.title = '鍒�鍏疯鎯�'
       this.$refs.cutterModalRef.disableSubmit = true
       this.$refs.cutterModalRef.handleCutterEdit(record)
+    },
+    /**
+     * 閫夋嫨鍒�鍏�
+     */
+    handleChoose(record){
+      if (record.cutterName.match(/\d+(\.\d+)?/g) !== null) {
+        record.cutterName = record.cutterName.match(/\d+(\.\d+)?/g)[0]
+      }
+      const param = {
+        aliasLabel: record.cutterType,
+        diameter: record.cutterName,
+        cutterId: record.id
+      }
+      this.$refs.dncToolsSelectModal.open(param)
+      this.$refs.dncToolsSelectModal.title = '閫夋嫨鍒�鍏�'
+    },
+    /**
+     * 鍙戦�佸垁鍏风郴缁�
+     */
+    handleSend(){
+      const that = this
+      const { docId,attributionId, attributionType } = this.currentLevelInfo
+      that.$confirm({
+        title: '鎻愮ず',
+        content: `纭鍙戦�佸垁鍏风郴缁熷悧锛焋,
+        okText: '纭',
+        cancelText: '鍙栨秷',
+        onOk: () => {
+          dncApi.sendToolsApi({ docId, attributionId, attributionType })
+            .then(res => {
+              if (res.success) {
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              } else {
+                that.$notification.error({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              }
+            })
+            .catch(err => {
+              that.$notification.error({
+                message: '娑堟伅',
+                description: err.message
+              })
+            })
+            .finally(() => {
+              that.$destroyAll()
+            })
+        },
+        onCancel: () => {
+          that.$destroyAll()
+        }
+      })
     }
   }
 }
diff --git a/src/views/dnc/base/modules/ProductStructure/GuideCardBatch/GuideCardBatchList.vue b/src/views/dnc/base/modules/ProductStructure/GuideCardBatch/GuideCardBatchList.vue
index 79d4442..3b539f6 100644
--- a/src/views/dnc/base/modules/ProductStructure/GuideCardBatch/GuideCardBatchList.vue
+++ b/src/views/dnc/base/modules/ProductStructure/GuideCardBatch/GuideCardBatchList.vue
@@ -146,7 +146,8 @@
           {
             title:'娴佹按鍙�',
             align:"center",
-            dataIndex: 'serialNumber'
+            dataIndex: 'serialNumber',
+            width:150,
           },
           {
             title:'澶瑰叿',
diff --git a/src/views/tms/modules/baseTools/DncToolsSelectModal.vue b/src/views/tms/modules/baseTools/DncToolsSelectModal.vue
index 586fdf5..f26036c 100644
--- a/src/views/tms/modules/baseTools/DncToolsSelectModal.vue
+++ b/src/views/tms/modules/baseTools/DncToolsSelectModal.vue
@@ -656,7 +656,7 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import BaseToolsModal from './BaseToolsModal'
 import Tooltip from 'ant-design-vue/es/tooltip'
-import { getAction, postAction, deleteAction, requestPut } from '@api/manage'
+import { getAction, postAction, deleteAction, requestPut, httpAction } from '@api/manage'
 import ParaBaseModal from './ParaBaseModal.vue'
 import ParaHoleToolsModal from './ParaHoleToolsModal'
 import ParaMillToolModal from './ParaMillToolModal'
@@ -694,6 +694,11 @@
     ParaTurningToolsList,
     ParaCommonToolList,
     ParaBladeList
+  },
+  props: {
+    currentTreeNodeInfo: {
+      type: Object
+    }
   },
   data() {
     return {
@@ -793,7 +798,8 @@
         queryToolClassifyByParam: '/tms/toolsToDnc/queryToolClassifyByParam',
         queryParaByToolCode: '/tms/baseTools/queryByToolCode',
         queryByToolCode: '/tms/toolsConfigProperty/queryByToolCode',
-        queryToolsClassify: '/tms/toolsClassify/queryById'
+        queryToolsClassify: '/tms/toolsClassify/queryById',
+        cutterEdit: '/nc/cutter/edit'
       },
       dictOptions: {},
       nodeSelected: {}, // 褰撳墠閫変腑鐨勮妭鐐规暟鎹�
@@ -804,7 +810,7 @@
         toolCode: '',
         toolModel: '',
         chineseName: ''
-      }
+      },
     }
   },
   created() {
@@ -967,6 +973,21 @@
       this.clearQueryFlag()
       this.clearPara()
       this.visible = false
+      let formData = {};
+      formData.id=this.param.cutterId;
+      formData.cutterCode=record.toolCode;
+      formData.cutterName=record.classifyName;
+      formData.toolsId=record.toolId
+      httpAction(this.url.cutterEdit, formData, 'put').then((res) => {
+        if(res.success){
+          this.$message.success(res.message);
+          this.$emit('ok');
+        }else{
+          this.$message.warning(res.message);
+        }
+      }).finally(() => {
+        this.confirmLoading = false;
+      })
     },
     //璇︽儏
     handleDetail: function(record) {

--
Gitblit v1.9.3