From d94027b2f004ff9db94526b267983659d8b31e8f Mon Sep 17 00:00:00 2001 From: 17630416519 Date: Wed, 31 Dec 2025 14:56:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=BA=8F=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/processoperation.js | 16 ++++ .../Process/ProcessOperation.vue | 76 +++++++++++++++++-- 2 files changed, 85 insertions(+), 7 deletions(-) diff --git a/src/api/masterDataManagement/process/processoperation.js b/src/api/masterDataManagement/process/processoperation.js index dcbf5b3..114c53d 100644 --- a/src/api/masterDataManagement/process/processoperation.js +++ b/src/api/masterDataManagement/process/processoperation.js @@ -96,4 +96,20 @@ export function getProcessRoutingOperationDetail(operationId) { }) } +//工序增加流程 +export function addProcessRoutingOperation(data) { + return request({ + url: 'MasterDataManagement/Process/ProcessOperation/operation_add_flow', + method: 'post', + data: data + }) +} +//删除 +export function delProcessRoutingOperation(data) { + return request({ + url: 'MasterDataManagement/Process/ProcessOperation/operation_delete_flow', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/views/masterDataManagement/Process/ProcessOperation.vue b/src/views/masterDataManagement/Process/ProcessOperation.vue index 1bc3e66..c071e43 100644 --- a/src/views/masterDataManagement/Process/ProcessOperation.vue +++ b/src/views/masterDataManagement/Process/ProcessOperation.vue @@ -179,7 +179,7 @@ - + @@ -211,11 +211,13 @@

关联流程列表

新增 - 保存 @@ -254,7 +256,8 @@ import { addProcessOperation, delProcessOperation, updateProcessOperation, getProcessOperation, getProcessRoutingOperationDetail, - getDictsSelect, getDictsType, getProcessRoutingOperation, bindProcessRoutingOperation + getDictsSelect, getDictsType, getProcessRoutingOperation, bindProcessRoutingOperation, + addProcessRoutingOperation } from '@/api/masterDataManagement/process/processoperation.js' const { proxy } = getCurrentInstance() @@ -273,7 +276,6 @@ const fkRoutingCode = ref('') const operationCode = ref('') const ids = ref([]) const drawer = ref(false) -// ✅ 新增form1的ref,用于表单重置 const form1Ref = ref(null) const columns = ref([ { visible: true, prop: 'operationId', label: '工序id' }, @@ -337,10 +339,39 @@ function getSelectWorkmanship() { } getSelectWorkmanship() + +function handleFlowName(val, row) { + + if (!options.value.flowNameOptions || options.value.flowNameOptions.length === 0) { + console.log('流程名称选项数据未加载完成'); + return; + } + const flowItem = options.value.flowNameOptions.find(item => item.value === val) + console.log(flowItem, '当前流程名称项'); + console.log(); + if (flowItem) { + row.flowCode = flowItem.value + } else { + row.flowCode = '' + } + let data = { + fkRoutingCode: fkRoutingCodeData.value, + fkOperationCode: operationCodeData.value, + flowCode: flowItem.value, + flowName: flowItem.label + } + console.log(data, '熙增data'); + addProcessRoutingOperation(data).then(res => { + if (res.code == 200) { + proxy.$modal.msgSuccess("新增成功") + } + }) +} + function cancelClick() { console.log('取消'); drawer.value = false - // ✅ 关闭抽屉时重置form1 + resetForm1() } function confirmClick() { @@ -520,6 +551,7 @@ const state = reactive({ { dictLabel: '停用', dictValue: '0' }, { dictLabel: '启用', dictValue: '1' }, ], + flowNameOptions: [] } }) @@ -588,10 +620,29 @@ function handleAdd() { initTransferData() } +const fkRoutingCodeData = ref('') +const operationCodeData = ref('') function handleView(val) { + fkRoutingCodeData.value = val.fkRoutingCode + operationCodeData.value = val.operationCode resetForm1() drawer.value = true form1.value = { ...val } + getProcessOperation(val.operationId).then(res => { + if (res.code == 200) { + tableData.value = res.data.operationFlows + } + }) + getProcessRoutingOperation().then(res => { + if (res.code == 200) { + options.value.flowNameOptions = res.data.map(item => { + return { + label: item.flowName, + value: item.flowCode, + } + }) + } + }) } // 修改按钮操作 @@ -662,4 +713,15 @@ function handleDelete(row) { } handleQuery() - \ No newline at end of file + + + \ No newline at end of file