update 调整审批记录 添加流程导出
This commit is contained in:
parent
cba512f44f
commit
0df893a1bf
@ -12,7 +12,10 @@
|
|||||||
<el-table-column prop="nodeName" label="任务名称" sortable align="center"></el-table-column>
|
<el-table-column prop="nodeName" label="任务名称" sortable align="center"></el-table-column>
|
||||||
<el-table-column prop="approveName" :show-overflow-tooltip="true" label="办理人" sortable align="center">
|
<el-table-column prop="approveName" :show-overflow-tooltip="true" label="办理人" sortable align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="success">{{ scope.row.approveName || '无' }}</el-tag>
|
<template v-if="scope.row.approveName">
|
||||||
|
<el-tag v-for="(item, index) in scope.row.approveName.split(',')" :key="index" type="success">{{ item }}</el-tag>
|
||||||
|
</template>
|
||||||
|
<template v-else> <el-tag type="success">无</el-tag></template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="flowStatus" label="状态" width="80" sortable align="center">
|
<el-table-column prop="flowStatus" label="状态" width="80" sortable align="center">
|
||||||
@ -93,7 +96,7 @@ const init = async (businessKey: string | number) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(historyList.value,"2222222");
|
console.log(historyList.value, '2222222');
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -44,6 +44,17 @@
|
|||||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||||
<!-- 审批记录 -->
|
<!-- 审批记录 -->
|
||||||
<approvalRecord ref="approvalRecordRef" />
|
<approvalRecord ref="approvalRecordRef" />
|
||||||
|
<el-dialog v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose" width="500">
|
||||||
|
<el-select v-model="flowCode" placeholder="Select" style="width: 240px">
|
||||||
|
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="handleClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitFlow()"> 确认 </el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -80,6 +91,23 @@ const options = [
|
|||||||
label: '婚假'
|
label: '婚假'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
const flowCodeOptions = [
|
||||||
|
{
|
||||||
|
value: 'leave1',
|
||||||
|
label: '请假申请-普通'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'leave2',
|
||||||
|
label: '请假申请-排他网关'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const flowCode = ref<string>('');
|
||||||
|
|
||||||
|
const dialogVisible = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: '流程定义'
|
||||||
|
});
|
||||||
//提交组件
|
//提交组件
|
||||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||||
//审批记录组件
|
//审批记录组件
|
||||||
@ -119,6 +147,11 @@ const data = reactive<PageData<LeaveForm, LeaveQuery>>({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
flowCode.value = '';
|
||||||
|
buttonLoading.value = false;
|
||||||
|
};
|
||||||
const { form, rules } = toRefs(data);
|
const { form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
@ -168,12 +201,21 @@ const submitForm = (status: string) => {
|
|||||||
res = await addLeave(form.value);
|
res = await addLeave(form.value);
|
||||||
}
|
}
|
||||||
form.value = res.data;
|
form.value = res.data;
|
||||||
if (status === '0') {
|
if (status === 'draft') {
|
||||||
buttonLoading.value = false;
|
buttonLoading.value = false;
|
||||||
proxy?.$modal.msgSuccess('暂存成功');
|
proxy?.$modal.msgSuccess('暂存成功');
|
||||||
proxy.$tab.closePage(proxy.$route);
|
proxy.$tab.closePage(proxy.$route);
|
||||||
proxy.$router.go(-1);
|
proxy.$router.go(-1);
|
||||||
} else {
|
} else {
|
||||||
|
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||||
|
flowCode.value = flowCodeOptions[0].value;
|
||||||
|
dialogVisible.visible = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//说明启动过先随意穿个参数
|
||||||
|
if (flowCode.value === '' || flowCode.value === null) {
|
||||||
|
flowCode.value = 'xx';
|
||||||
|
}
|
||||||
await handleStartWorkFlow(res.data);
|
await handleStartWorkFlow(res.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,10 +225,14 @@ const submitForm = (status: string) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const submitFlow = async () => {
|
||||||
|
handleStartWorkFlow(form.value);
|
||||||
|
dialogVisible.visible = false;
|
||||||
|
};
|
||||||
//提交申请
|
//提交申请
|
||||||
const handleStartWorkFlow = async (data: LeaveVO) => {
|
const handleStartWorkFlow = async (data: LeaveVO) => {
|
||||||
try {
|
try {
|
||||||
submitFormData.value.flowCode = 'leaveFlow-serial1';
|
submitFormData.value.flowCode = flowCode.value;
|
||||||
submitFormData.value.businessKey = data.id;
|
submitFormData.value.businessKey = data.id;
|
||||||
//流程变量
|
//流程变量
|
||||||
taskVariables.value = {
|
taskVariables.value = {
|
||||||
|
@ -50,6 +50,9 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">部署流程文件</el-button>
|
<el-button type="primary" icon="UploadFilled" @click="uploadDialog.visible = true">部署流程文件</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" icon="Download" :disabled="single" @click="handleExportDef">导出</el-button>
|
||||||
|
</el-col>
|
||||||
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -272,8 +275,7 @@ type CategoryOption = {
|
|||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const ids = ref<Array<any>>([]);
|
const ids = ref<Array<any>>([]);
|
||||||
const deploymentIds = ref<Array<any>>([]);
|
const flowCodeList = ref<Array<any>>([]);
|
||||||
const keys = ref<Array<any>>([]);
|
|
||||||
const single = ref(true);
|
const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
@ -374,8 +376,7 @@ const resetQuery = () => {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
const handleSelectionChange = (selection: any) => {
|
const handleSelectionChange = (selection: any) => {
|
||||||
ids.value = selection.map((item: any) => item.id);
|
ids.value = selection.map((item: any) => item.id);
|
||||||
deploymentIds.value = selection.map((item: any) => item.deploymentId);
|
flowCodeList.value = selection.map((item: any) => item.flowCode);
|
||||||
keys.value = selection.map((item: any) => item.key);
|
|
||||||
single.value = selection.length !== 1;
|
single.value = selection.length !== 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
@ -410,7 +411,6 @@ const handleDelete = async (row?: FlowDefinitionVo) => {
|
|||||||
|
|
||||||
/** 发布流程定义 */
|
/** 发布流程定义 */
|
||||||
const handlePublish = async (row?: FlowDefinitionVo) => {
|
const handlePublish = async (row?: FlowDefinitionVo) => {
|
||||||
const id = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm(
|
await proxy?.$modal.confirm(
|
||||||
'是否确认发布流程定义KEY为【' + row.flowCode + '】版本为【' + row.version + '】的数据项?,发布后会将已发布流程定义改为失效!'
|
'是否确认发布流程定义KEY为【' + row.flowCode + '】版本为【' + row.version + '】的数据项?,发布后会将已发布流程定义改为失效!'
|
||||||
);
|
);
|
||||||
@ -526,4 +526,9 @@ const handleCopyDef = async (row: FlowDefinitionVo) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//导出
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExportDef = () => {
|
||||||
|
proxy?.download(`/workflow/definition/exportDef/${ids.value[0]}`, {}, `${flowCodeList.value[0]}.xml`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user