Compare commits
2 Commits
9ac419d46a
...
a0d0705c96
| Author | SHA1 | Date |
|---|---|---|
|
|
a0d0705c96 | |
|
|
80671c55e8 |
|
|
@ -67,6 +67,12 @@
|
|||
]"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="审核栏标题">
|
||||
<a-input v-model:value="node.auditTitle" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
<a-form-item label="审核内容名称">
|
||||
<a-input v-model:value="node.auditName" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="2" header="审核人员设置">
|
||||
<a-space>
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
title: '',
|
||||
});
|
||||
const rules = reactive({
|
||||
title: [{ required: true, message: '请选择流程标题', trigger: 'blur' }],
|
||||
title: [{ required: true, message: '请填写流程标题', trigger: 'blur' }],
|
||||
userId: [{ required: true, message: '请选择流程发起人', trigger: 'blur' }],
|
||||
});
|
||||
function changeActive(activeKey) {
|
||||
|
|
@ -163,6 +163,8 @@
|
|||
let content = JSON.parse(data.scheme.content);
|
||||
let wfData = content.wfData;
|
||||
const currentNode = wfData.find((t) => t.type == 'bpmn:StartEvent');
|
||||
console.log(currentNode);
|
||||
designerData.isCustmerTitle = currentNode.isCustmerTitle;
|
||||
if (currentNode.authFields.length > 0) {
|
||||
// 有自定义表单时
|
||||
formVisble.value = true;
|
||||
|
|
@ -202,33 +204,52 @@
|
|||
designerData.delegateUsers = data;
|
||||
}
|
||||
async function handleSaveDraft() {
|
||||
var processId = buildGUID();
|
||||
var commit = {
|
||||
schemeId: designerData.formCurrentNode.formVerison,
|
||||
pkey: keyValue.value,
|
||||
pkeyValue: processId,
|
||||
};
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : props.code,
|
||||
userId: formData.userId,
|
||||
title: formData.title,
|
||||
processId: processId,
|
||||
InstanceInfo: JSON.stringify(commit),
|
||||
ParentNodeId: props.ParentNodeId,
|
||||
ParentTaskId: props.ParentTaskId,
|
||||
ParentProcessId: props.ParentProcessId,
|
||||
};
|
||||
if (props.ParentNodeId) {
|
||||
querys.isChild = 1;
|
||||
}
|
||||
const data = await saveDraft(querys);
|
||||
querys.schemeCode = '';
|
||||
designerData.isDraft = true;
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('保存草稿成功');
|
||||
let values;
|
||||
if (designerData.isCustmerTitle) {
|
||||
values = await formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
return true;
|
||||
})
|
||||
.catch((error: ValidateErrorEntity<FormState>) => {
|
||||
console.log('error', error);
|
||||
processVisble.value = true;
|
||||
activeName.value = 'flow';
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
return createMessage.error('保存草稿失败');
|
||||
values = true;
|
||||
}
|
||||
console.log(values);
|
||||
if (values) {
|
||||
var processId = buildGUID();
|
||||
var commit = {
|
||||
schemeId: designerData.formCurrentNode.formVerison,
|
||||
pkey: keyValue.value,
|
||||
pkeyValue: processId,
|
||||
};
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : props.code,
|
||||
userId: formData.userId,
|
||||
title: formData.title,
|
||||
processId: processId,
|
||||
InstanceInfo: JSON.stringify(commit),
|
||||
ParentNodeId: props.ParentNodeId,
|
||||
ParentTaskId: props.ParentTaskId,
|
||||
ParentProcessId: props.ParentProcessId,
|
||||
};
|
||||
if (props.ParentNodeId) {
|
||||
querys.isChild = 1;
|
||||
}
|
||||
const data = await saveDraft(querys);
|
||||
querys.schemeCode = '';
|
||||
designerData.isDraft = true;
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('保存草稿成功');
|
||||
} else {
|
||||
return createMessage.error('保存草稿失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
function handleSubmit() {
|
||||
|
|
@ -278,35 +299,54 @@
|
|||
}
|
||||
}
|
||||
async function handleCreateFlow(processId) {
|
||||
var commit = {
|
||||
schemeId: designerData.formCurrentNode.formVerison,
|
||||
pkey: keyValue.value,
|
||||
pkeyValue: processId,
|
||||
};
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : props.code,
|
||||
userId: formData.userId,
|
||||
title: formData.title,
|
||||
processId: processId,
|
||||
InstanceInfo: JSON.stringify(commit),
|
||||
ParentNodeId: props.ParentNodeId,
|
||||
ParentTaskId: props.ParentTaskId,
|
||||
ParentProcessId: props.ParentProcessId,
|
||||
};
|
||||
if (props.ParentNodeId) {
|
||||
querys.isChild = 1;
|
||||
}
|
||||
if (!designerData.isDraft) {
|
||||
await saveDraft(querys);
|
||||
querys.schemeCode = '';
|
||||
designerData.isDraft = true;
|
||||
}
|
||||
const data = await create(querys);
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('发起流程成功');
|
||||
let values;
|
||||
if (designerData.isCustmerTitle) {
|
||||
values = await formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
return true;
|
||||
})
|
||||
.catch((error: ValidateErrorEntity<FormState>) => {
|
||||
console.log('error', error);
|
||||
processVisble.value = true;
|
||||
activeName.value = 'flow';
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
return createMessage.error('发起流程失败');
|
||||
values = true;
|
||||
}
|
||||
console.log(values);
|
||||
if (values) {
|
||||
var commit = {
|
||||
schemeId: designerData.formCurrentNode.formVerison,
|
||||
pkey: keyValue.value,
|
||||
pkeyValue: processId,
|
||||
};
|
||||
var querys = {
|
||||
schemeCode: designerData.isDraft ? '' : props.code,
|
||||
userId: formData.userId,
|
||||
title: formData.title,
|
||||
processId: processId,
|
||||
InstanceInfo: JSON.stringify(commit),
|
||||
ParentNodeId: props.ParentNodeId,
|
||||
ParentTaskId: props.ParentTaskId,
|
||||
ParentProcessId: props.ParentProcessId,
|
||||
};
|
||||
if (props.ParentNodeId) {
|
||||
querys.isChild = 1;
|
||||
}
|
||||
if (!designerData.isDraft) {
|
||||
await saveDraft(querys);
|
||||
querys.schemeCode = '';
|
||||
designerData.isDraft = true;
|
||||
}
|
||||
const data = await create(querys);
|
||||
if (data) {
|
||||
closePreview();
|
||||
return createMessage.success('发起流程成功');
|
||||
} else {
|
||||
return createMessage.error('发起流程失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
async function getFormHistory() {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<!-- <a-divider type="vertical" /> -->
|
||||
<a-layout-sider v-if="props.isRead == 0">
|
||||
<a-tabs v-model:activeKey="auditName">
|
||||
<a-tab-pane key="audit" tab="审批栏">
|
||||
<a-tab-pane key="audit" :tab="auditTitleVal">
|
||||
<div class="approval-column">
|
||||
<a-form
|
||||
ref="formRef"
|
||||
|
|
@ -74,10 +74,7 @@
|
|||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-item
|
||||
:label="designerData.isCreateAgain ? '备注' : '审批意见'"
|
||||
name="des"
|
||||
/>
|
||||
<a-form-item :label="auditNameVal" />
|
||||
<a-form-item label="">
|
||||
<a-textarea
|
||||
v-model:value="formData.des"
|
||||
|
|
@ -234,6 +231,8 @@
|
|||
});
|
||||
const activeName = ref('form');
|
||||
const auditName = ref('audit');
|
||||
const auditTitleVal = ref('审批栏');
|
||||
const auditNameVal = ref('审批意见');
|
||||
function changeActive(activeKey) {
|
||||
if (activeKey == 'flow') {
|
||||
processVisble.value = true;
|
||||
|
|
@ -262,6 +261,16 @@
|
|||
console.log(wfData);
|
||||
const auditNode = wfData.find((t) => t.id == data.task.unitId);
|
||||
console.log(auditNode);
|
||||
if (auditNode.auditTitle) {
|
||||
auditTitleVal.value = auditNode.auditTitle;
|
||||
}
|
||||
if (designerData.isCreateAgain) {
|
||||
auditNameVal.value = '备注';
|
||||
} else {
|
||||
if (auditNode.auditName) {
|
||||
auditNameVal.value = auditNode.auditName;
|
||||
}
|
||||
}
|
||||
let currentNode;
|
||||
if (auditNode.isInherit) {
|
||||
currentNode = wfData.find((t) => t.type == 'bpmn:StartEvent');
|
||||
|
|
@ -495,10 +504,10 @@
|
|||
async function handleBtnClick(btn) {
|
||||
const instanceInfo = JSON.parse(designerData.process.instanceInfo);
|
||||
// 验证审批栏必填项
|
||||
const data = await validateForm();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
// const data = await validateForm();
|
||||
// if (!data) {
|
||||
// return;
|
||||
// }
|
||||
// 有表单先提交表单数据
|
||||
if (formVisble.value) {
|
||||
var querys = {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
v-if="formVisble"
|
||||
/>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="flow" tab="流程信息(审核)" force-render>
|
||||
<a-tab-pane key="flow" tab="流程信息" force-render>
|
||||
<div class="process-design" :style="'display: flex; height:' + designerData.height">
|
||||
<process-viewer
|
||||
v-if="processVisble"
|
||||
|
|
|
|||
Loading…
Reference in New Issue