fix(系统管理): 组织模板修改cr

This commit is contained in:
xinxin.wu 2023-11-03 17:40:28 +08:00 committed by Craftsman
parent 1eb66b2a8e
commit 7e5a86f881
3 changed files with 15 additions and 19 deletions

View File

@ -131,12 +131,12 @@ export interface WorkFlowType {
// 创建组织工作流状态 // 创建组织工作流状态
export interface OrdWorkStatus { export interface OrdWorkStatus {
scopeId: string; scopeId?: string;
id: string; id?: string;
name: string; name: string;
scene: SeneType; scene?: SeneType;
remark: string; remark: string;
allTransferTo: boolean; // 是否允许所有状态流转到该状态 allTransferTo?: boolean; // 是否允许所有状态流转到该状态
} }
// 状态列表 // 状态列表

View File

@ -92,10 +92,8 @@
await formRef.value?.validate().then(async (error) => { await formRef.value?.validate().then(async (error) => {
if (!error) { if (!error) {
try { try {
if (!isEdit.value) {
form.value.allTransferTo = enable as boolean;
}
if (!form.value.id) { if (!form.value.id) {
form.value.allTransferTo = enable as boolean;
await createWorkFlowStatus(form.value); await createWorkFlowStatus(form.value);
Message.success(t('system.orgTemplate.addSuccessState')); Message.success(t('system.orgTemplate.addSuccessState'));
} else { } else {
@ -115,9 +113,13 @@
// //
function handleEdit(record: OrdWorkStatus) { function handleEdit(record: OrdWorkStatus) {
visible.value = true; visible.value = true;
form.value.name = record.name; const { name, id, remark, scene } = record;
form.value.id = record.id; form.value = {
form.value.remark = record.remark; name,
id,
remark,
scene,
};
} }
watch( watch(

View File

@ -43,7 +43,7 @@
<span class="mb-2">{{ t('system.orgTemplate.startState') }} </span> <span class="mb-2">{{ t('system.orgTemplate.startState') }} </span>
<MsTag>{{ startState }}</MsTag> <MsTag>{{ startState }}</MsTag>
</div> </div>
<icon-arrow-right :style="{ 'font-size': '16px' }" class="mt-8 text-[var(--color-text-brand)]" /> <icon-arrow-right class="mt-8 text-[16px] text-[var(--color-text-brand)]" />
<div class="flex flex-col"> <div class="flex flex-col">
<span class="mb-2"> {{ t('system.orgTemplate.endState') }}</span> <span class="mb-2"> {{ t('system.orgTemplate.endState') }}</span>
<MsTag>{{ endState }}</MsTag> <MsTag>{{ endState }}</MsTag>
@ -124,18 +124,12 @@
// //
const startState = computed(() => { const startState = computed(() => {
const startStatus = props.totalData.find((item: WorkFlowType) => item.id === props.stateItem.id); return props.totalData.find((item: WorkFlowType) => item.id === props.stateItem.id)?.name;
if (startStatus) {
return startStatus.name;
}
}); });
// //
const endState = computed(() => { const endState = computed(() => {
const endStatus = props.totalData.find((item: WorkFlowType) => item.id === props.columnItem.dataIndex); return props.totalData.find((item: WorkFlowType) => item.id === props.columnItem.dataIndex)?.name;
if (endStatus) {
return endStatus.name;
}
}); });
// //