新增工序详情绑定
This commit is contained in:
parent
1b86052e7d
commit
d94027b2f0
@ -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
|
||||
})
|
||||
}
|
||||
@ -179,7 +179,7 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer @close="cancelClick" :close-on-click-modal="false" size="40%" v-model="drawer" title="详情">
|
||||
<el-drawer @close="cancelClick" :close-on-click-modal="false" size="1000" v-model="drawer" title="详情">
|
||||
|
||||
<el-form ref="form1Ref" inline :model="form1" label-width="110px">
|
||||
<el-row>
|
||||
@ -211,11 +211,13 @@
|
||||
<h4>关联流程列表</h4>
|
||||
<el-button type="primary" size="small" @click="addTableRow">新增</el-button>
|
||||
</div>
|
||||
<el-button style="margin-bottom: 10px;" type="primary" @click="addSubmit">保存</el-button>
|
||||
<el-table :data="tableData" style="width: 100%" border>
|
||||
<el-table-column prop="flowName" label="流程名称">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowName" placeholder="请输入流程名称" />
|
||||
<el-select @change="handleFlowName($event, scope.row)" v-model="scope.row.flowName" placeholder="请选择流程名称">
|
||||
<el-option v-for="item in options.flowNameOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="flowCode" label="流程编码">
|
||||
@ -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()
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .el-drawer__header {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
overflow: hidden;
|
||||
margin-bottom: -5px;
|
||||
}
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user