From ad25e454286ab33f1f3f63539f527ebee4f86183 Mon Sep 17 00:00:00 2001 From: Aoi_Tori <2547614904@qq.com> Date: Mon, 14 Jul 2025 17:36:50 +0800 Subject: [PATCH] 2025/7/14 --- src/api/tool/toolApply.js | 1 + src/views/modules/tooling/searchToolApply.vue | 434 +++++++++++++++--- 2 files changed, 361 insertions(+), 74 deletions(-) diff --git a/src/api/tool/toolApply.js b/src/api/tool/toolApply.js index 5fb4ce4..f25b9a6 100644 --- a/src/api/tool/toolApply.js +++ b/src/api/tool/toolApply.js @@ -19,6 +19,7 @@ export const searchProjectToolApplyHeaderByAnyField = data => createAPI(`/plm/pr export const searchProjectToolApplyDetail = data => createAPI(`/plm/projectToolingApplication/searchProjectToolApplyDetail`,'post',data) export const toolDetailBatchDelete = data => createAPI(`/plm/projectToolingApplication/toolDetailBatchDelete`,'post',data) +export const toolDetailBatchSave = data => createAPI(`/plm/projectToolingApplication/toolDetailBatchSave`,'post',data) export const comfirmProjectToolApply = data => createAPI(`/plm/projectToolingApplication/comfirmProjectToolApply`,'post',data) diff --git a/src/views/modules/tooling/searchToolApply.vue b/src/views/modules/tooling/searchToolApply.vue index d597506..092663c 100644 --- a/src/views/modules/tooling/searchToolApply.vue +++ b/src/views/modules/tooling/searchToolApply.vue @@ -304,8 +304,8 @@
- - + 新增 + 删除 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + +
+ + 应用 + 保存 + 关闭 + +
@@ -743,7 +746,11 @@ import DictDataSelect from "../sys/dict-data-select.vue" import orderAttribute from "../demoComponents/orderProperties" import FilterSearch from "../../common/filterSearch.vue"; import {technicalSpecificationListSearchByAnyField} from "../../../api/sampleManagement/technicalSpecificationList"; -import {searchProjectToolApplyHeaderByAnyField, toolDetailBatchDelete} from "../../../api/tool/toolApply"; +import { + queryProjectPartToolForApply, + searchProjectToolApplyHeaderByAnyField, + toolDetailBatchDelete, toolDetailBatchSave +} from "../../../api/tool/toolApply"; import {isAuth} from "../../../utils"; /*組件*/ export default { @@ -809,6 +816,8 @@ export default { toolData: [], fileList: [], selectionDataList: [], + dataSelections: [], + chooseDataList: [], visibleU: false, plmChangeApplyHeaderArr: [], plmChangeApplyDetailArr: [], @@ -850,7 +859,17 @@ export default { remark2: '', }, toolDetailSearchData:{ - + projectId: '', + projectName: '', + customerName: '', + testPartNo: '', + finalPartNo: '', + partName: '', + customerPartNo: '', + toolId: '', + toolDescription: '', + no:1, + size:20, }, toolDetailData:{ @@ -860,8 +879,10 @@ export default { currentRow: {}, currentRow2: {}, height: 200, + dataList2: [], dataList1: [], detailList: [], + toolDetailList: [], dataListLoading: false, // 导出 start exportData: [], @@ -1598,6 +1619,143 @@ export default { fixed: false }, ], + columnList3: [ + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'projectId', + headerAlign: 'center', + align: 'center', + columnLabel: '项目号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'projectName', + headerAlign: 'center', + align: 'center', + columnLabel: '项目名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'customerName', + headerAlign: 'center', + align: 'center', + columnLabel: '客户名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'testPartNo', + headerAlign: 'center', + align: 'center', + columnLabel: 'PLM物料编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'finalPartNo', + headerAlign: 'center', + align: 'center', + columnLabel: 'IFS物料编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'partName', + headerAlign: 'center', + align: 'center', + columnLabel: '物料名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'customerPartNo', + headerAlign: 'center', + align: 'center', + columnLabel: '客户料号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'toolId', + headerAlign: 'center', + align: 'center', + columnLabel: '工具编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 106002, + columnProp: 'toolDescription', + headerAlign: 'center', + align: 'center', + columnLabel: '工具描述', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + } + ], toolDetailRules:{ agentId:[ { @@ -1645,6 +1803,24 @@ export default { visible(newV, oldV){ this.$refs.oss.handleQuery() this.$refs.dialogAttribute.getProperties() + }, + + toolDetailFlag(newV, oldV){ + if(newV === false){ + this.toolDetailSearchData={ + projectId: '', + projectName: '', + customerName: '', + testPartNo: '', + finalPartNo: '', + partName: '', + customerPartNo: '', + toolId: '', + toolDescription: '', + no:1, + size:20, + } + } } }, @@ -2423,6 +2599,111 @@ export default { this.selectionDataList = val; }, + selectionData (val) { + this.dataSelections = val + }, + + addChangeDetail(){ + this.toolDetailFlag = true + queryProjectPartToolForApply(this.toolDetailSearchData).then(({data})=>{ + if (data && data.code === 0){ + this.dataList2 = data.rows + // this.dataList2 = data.rows.map(row => { + // const match = this.toolData.some(toolItem => + // toolItem.site === row.site && + // toolItem.applyNo === row.applyNo && + // toolItem.seqNo === row.seqNo + // ); + // return { + // ...row, + // added: match + // }; + // }); + this.total = data.total + }else { + this.$message.error(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, + + addDetail(){ + if (this.dataSelections.length === 0) { + this.$message.warning("请勾选工具明细!") + return + } + this.dataSelections.forEach(item => { + // 确保没有重复的元素 + if (!this.chooseDataList.some(cdItem => cdItem.site === item.site && cdItem.projectId === item.projectId && cdItem.testPartNo === item.testPartNo && cdItem.toolId === item.toolId)) { + this.chooseDataList.push(item) + } + }) + this.chooseDataList = this.chooseDataList.map(item => { + return { + ...item, + applyNo: this.dataForm.applyNo + }; + }); + toolDetailBatchSave(this.chooseDataList).then(({data})=>{ + if (data && data.code === 0){ + this.$message.success("添加成功") + searchProjectToolApplyDetail({ + site: this.dataForm.site, + applyNo: this.dataForm.applyNo, + }).then(({data}) => { + if (data.code == 0) { + this.toolData = data.rows + } + }) + }else { + this.$message.error(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + + this.toolDetailFlag = false + this.dataSelections = [] + }, + + applyDetail(){ + if (this.dataSelections.length === 0) { + this.$message.warning("请勾选工具明细!") + return + } + this.dataSelections.forEach(item => { + // 确保没有重复的元素 + if (!this.chooseDataList.some(cdItem => cdItem.site === item.site && cdItem.projectId === item.projectId && cdItem.testPartNo === item.testPartNo && cdItem.toolId === item.toolId)) { + this.chooseDataList.push(item) + } + }) + this.chooseDataList = this.chooseDataList.map(item => { + return { + ...item, + applyNo: this.dataForm.applyNo + }; + }); + toolDetailBatchSave(this.chooseDataList).then(({data})=>{ + if (data && data.code === 0){ + this.$message.success("添加成功") + }else { + this.$message.error(data.msg) + searchProjectToolApplyDetail({ + site: this.dataForm.site, + applyNo: this.dataForm.applyNo, + }).then(({data}) => { + if (data.code == 0) { + this.toolData = data.rows + } + }) + } + }).catch((error)=>{ + this.$message.error(error) + }) + this.dataSelections = [] + }, + toolDetailBatchDelete(){ if (this.selectionDataList.length === 0) { this.$message.warning('请勾选要删除的工具明细信息!') @@ -2433,13 +2714,18 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - // let tempData = { - // ____: this.selectionDataList - // } toolDetailBatchDelete(this.selectionDataList).then(({data}) => { if (data && data.code === 0) { this.searchToolApplyDetail() this.selectionDataList = [] + searchProjectToolApplyDetail({ + site: this.dataForm.site, + applyNo: this.dataForm.applyNo, + }).then(({data}) => { + if (data.code == 0) { + this.toolData = data.rows + } + }) this.$message({ message: '操作成功', type: 'success',