From f489271afc774d500e66d3bc6f20e603bd3dbb5e Mon Sep 17 00:00:00 2001 From: zhangdi <15053473693@163.com> Date: Thu, 5 Feb 2026 11:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=88=A0=E9=99=A4=E5=B7=A5?= =?UTF-8?q?=E5=BA=8F=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/processManagement/taskProcessing.js | 9 +++++ .../processMainte/processPlanning.vue | 34 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/api/processManagement/taskProcessing.js b/src/api/processManagement/taskProcessing.js index 4ee1dd5..c09460b 100644 --- a/src/api/processManagement/taskProcessing.js +++ b/src/api/processManagement/taskProcessing.js @@ -261,4 +261,13 @@ export const getStandardList = (params) => { method: 'get', params: params, }); +} + +// 一键删除 工序和下面所包含的检验项目、尺寸、工装的信息 dsCraft/craftBatchRemoval +export const craftBatchRemoval = (params) => { + return request({ + url: '/blade-desk/dsCraft/craftBatchRemoval', + method: 'post', + data: params, + }); } \ No newline at end of file diff --git a/src/views/processManagement/components/processMainte/processPlanning.vue b/src/views/processManagement/components/processMainte/processPlanning.vue index 65145d9..bbb1be2 100644 --- a/src/views/processManagement/components/processMainte/processPlanning.vue +++ b/src/views/processManagement/components/processMainte/processPlanning.vue @@ -922,7 +922,7 @@ export default { if (node.level !== 2) { this.$message.warning('仅工艺节点支持右键操作'); - this.contextMenuVisible = false + this.contextMenuVisible = false; return; } @@ -945,6 +945,38 @@ export default { this.contextNodeData = null; this.contextTreeNode = null; }, + async handleDeleteNode() { + if (!this.contextTreeNode) { + this.closeContextMenu(); + return; + } + + const node = this.contextTreeNode; + const nodeId = node.data.id; + console.log('删除的节点ID:', node, nodeId); + try { + // 弹出确认框 + await this.$confirm('此操作将删除该工艺及所有子工序,是否继续?', '警告', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }); + let deleteIds = node.childNodes.map(child => child.id); + console.log('需要删除的子工序ID列表:', deleteIds); + // 调用删除API(替换为你的实际API) + // await deleteCraft({ id: deleteIds.join(',') }).then(res => { + // this.$message.success('删除成功'); + // this.getDetails(); + // }); + } catch (error) { + if (error !== 'cancel') { + console.error('删除失败:', error); + this.$message.error('删除失败,请重试'); + } + } finally { + this.closeContextMenu(); + } + }, // 右侧tab切换 handleClick(value) {