From d7eb75dab736410c1c23577d164cfab61ed8c67d Mon Sep 17 00:00:00 2001 From: Aoi_Tori <2547614904@qq.com> Date: Mon, 23 Jun 2025 11:01:51 +0800 Subject: [PATCH] 2025/6/23 --- src/views/modules/part/part_create.vue | 23 +- src/views/modules/part/quicklyCreateBom.vue | 326 +++++++++++++++++++- 2 files changed, 330 insertions(+), 19 deletions(-) diff --git a/src/views/modules/part/part_create.vue b/src/views/modules/part/part_create.vue index 431c90c..d908e00 100644 --- a/src/views/modules/part/part_create.vue +++ b/src/views/modules/part/part_create.vue @@ -2221,6 +2221,7 @@ export default { duration: 1500, onClose: () => {} }) + this.saveQuicklyCreate() } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -2254,8 +2255,6 @@ export default { this.saveLoading = false }) } - EventBus.$emit('refreshInquiryOneDetail1') - EventBus.$emit('refreshInquiryOneDetail2') }, // 列表表格选择替换 @@ -3226,6 +3225,26 @@ export default { this.modalData.templateName = val.template_name } }, + + saveQuicklyCreate(){ + let inData = { + id: this.initData.id, + testPartId: this.initData.testPartId, + testPartDesc: this.initData.partDesc, + partBomStatus: this.initData.partBomStatus, + updateBy: this.$store.state.user.name, + } + updateInquiryDetailStatusAndPart(inData).then(({data}) => { + if (data && data.code === 0) { + EventBus.$emit('refreshInquiryOneDetail1') + EventBus.$emit('refreshInquiryOneDetail2') + } else { + this.$alert('自动完成失败,请手动点击完成键', '错误', { + confirmButtonText: '确定' + }) + } + }) + } } } diff --git a/src/views/modules/part/quicklyCreateBom.vue b/src/views/modules/part/quicklyCreateBom.vue index 718c293..3c2b3db 100644 --- a/src/views/modules/part/quicklyCreateBom.vue +++ b/src/views/modules/part/quicklyCreateBom.vue @@ -20,13 +20,45 @@ 完成 + + + + + + + + + + + + + + + +
- + 新增节点 刷新 批量Build @@ -91,6 +123,35 @@ + + + + + + + + + + + + + 保存 @@ -178,6 +239,7 @@ import RoutingCreate from "./routing_create.vue"; import PartCreate from "./part_create.vue"; import {updateInquiryDetailStatusAndPart} from "../../../api/inquiry/inquiryDetail"; import {EventBus} from "../../../main"; +import {getPartItem} from "../../../api/part/partInformation"; export default { components: { PartCreate, @@ -191,12 +253,38 @@ export default { handler: function (newV, oldV) { this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase() } + }, + 'nodeData.pId': { + deep: true, + handler: function (newV, oldV) { + if (!newV || newV.trim().length === 0) { + this.childrenNodeList = []; + return; + } + const findNodeById = (nodes, targetId) => { + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + if (node.id === targetId) { + return node; + } + if (node.nodeList && node.nodeList.length > 0) { + const result = findNodeById(node.nodeList, targetId); + if (result) return result; + } + } + return null; + }; + const foundNode = findNodeById(this.treeData1, newV); + this.childrenNodeList = foundNode ? foundNode.nodeList : []; + } } }, data () { return { activeTable: 'bom_info', treeData: [], + treeData1: [], + childrenNodeList: [], defaultProps: { children: "nodeList", label: "nodeName", @@ -220,7 +308,8 @@ export default { site: '', buNo: '', partNo: '', - partDesc: '' + partDesc: '', + codeNo: '', }, nodeData: { flag: '', @@ -229,8 +318,10 @@ export default { nodeName: '', id: '', pId: '', + parentNodeName: '', createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, + mainPart: '', }, partData: { flag: '', @@ -255,8 +346,148 @@ export default { trigger: ['blur','change'] } ], + parentNodeName:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + id:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ] }, + dataList: [ + { + Family: '', + Orientation: '', + Lanes: '', + WebWidth: '', + PrintingLanes: null, + BodingPitch: null, + BondingLanes: null, + ConvertingUp: null, + } + ], currentNode: {}, + columnList: [ + { + userId: this.$store.state.user.name, + columnProp: 'Family', + headerAlign: 'left', + align: 'left', + columnLabel: 'Family', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'Orientation', + headerAlign: 'left', + align: 'left', + columnLabel: 'Orientation', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'Lanes', + headerAlign: 'left', + align: 'left', + columnLabel: 'Lanes', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'WebWidth', + headerAlign: 'left', + align: 'right', + columnLabel: 'Web width', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'PrintingLanes', + headerAlign: 'left', + align: 'right', + columnLabel: 'Printing lanes', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'BodingPitch', + headerAlign: 'left', + align: 'right', + columnLabel: 'Boding Pitch', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'BondingLanes', + headerAlign: 'left', + align: 'right', + columnLabel: 'Bonding lanes', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'ConvertingUp', + headerAlign: 'left', + align: 'right', + columnLabel: 'Converting up', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + } + ], partColumnList: [ { columnProp: 'partNo', @@ -334,7 +565,8 @@ export default { buildAllLoading: false, resetAllLoading: false, bomLoading: false, - routingLoading: false + routingLoading: false, + treeVisible: false } }, created () { @@ -360,7 +592,9 @@ export default { if (this.$route.query.data) { this.searchData = this.$route.query.data this.searchData.partDesc = this.$route.query.data.testPartDesc + this.searchData.codeNo = this.$route.query.data.partCodeNo this.getNodeTree(); + this.getPartItem() } }, methods: { @@ -391,7 +625,7 @@ export default { }) }, - // 新增首节点 + // 新增节点 addTree () { this.nodeData = { flag: '1', @@ -401,25 +635,36 @@ export default { pId: '0', createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, + mainPart: this.searchData.partNo, + } + this.treeData1 = [ + { + id: '0', + nodeName: '首节点', + nodeList: [] + } + ] + if (Array.isArray(this.treeData) && this.treeData.length > 0) { + this.treeData1[0].nodeList = [...this.treeData] } this.nodeModalDisableFlag = false this.nodeModalFlag = true }, // 新增子节点 - addTreeItem (data) { - this.nodeData = { - flag: '1', - site: this.$store.state.user.site, - nodeId: '', - nodeName: '', - pId: data.id, - createBy: this.$store.state.user.name, - updateBy: this.$store.state.user.name, - } - this.nodeModalDisableFlag = false - this.nodeModalFlag = true - }, + // addTreeItem (data) { + // this.nodeData = { + // flag: '1', + // site: this.$store.state.user.site, + // nodeId: '', + // nodeName: '', + // pId: data.id, + // createBy: this.$store.state.user.name, + // updateBy: this.$store.state.user.name, + // } + // this.nodeModalDisableFlag = false + // this.nodeModalFlag = true + // }, // 修改节点 editTreeItem (data) { @@ -929,11 +1174,58 @@ export default { this.authDelete = !deleteFlag }, + nodeListTreeCurrentChangeHandle (data, node) { + this.nodeData.pId = data.id + this.nodeData.parentNodeName = data.nodeName + this.treeVisible = false + }, + + getPartItem() { + let tempData = { + site: this.$store.state.user.site, + buNo: this.searchData.buNo, + partNo: this.searchData.partNo, + codeNo: this.searchData.codeNo, + recordType: 'IP' + } + getPartItem(tempData).then(({data}) => { + if (data && data.code === 0) { + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].itemDesc === 'Family1'){ + this.dataList[0].Family = data.rows[i].textValue + } else if (data.rows[i].itemDesc === 'Family2'){ + this.dataList[0].Orientation = data.rows[i].textValue + } else if (data.rows[i].itemDesc === 'Lanes0 web'){ + this.dataList[0].Lanes = data.rows[i].textValue + } else if (data.rows[i].itemDesc === 'Lamination width'){ + this.dataList[0].WebWidth = data.rows[i].textValue + } else if (data.rows[i].itemDesc === 'Printing lanes'){ + this.dataList[0].PrintingLanes = data.rows[i].numValue + } else if (data.rows[i].itemDesc === 'Bonding Pitch'){ + this.dataList[0].BodingPitch = data.rows[i].numValue + } else if (data.rows[i].itemDesc === '绑定列数'){ + this.dataList[0].BondingLanes = data.rows[i].numValue + } else if (data.rows[i].itemDesc === 'CL60k-UP'){ + this.dataList[0].ConvertingUp = data.rows[i].textValue + } + } + console.log(this.dataList[0]) + } else { + this.dataList = [] + } + }) + } + } }