This commit is contained in:
2025-09-06 15:58:47 +08:00
parent 3e4b85fc48
commit 6380ee505f
6 changed files with 32 additions and 28 deletions

View File

@ -104,6 +104,7 @@ import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { useUserStoreHook } from '@/store/modules/user';
import { getMonthInfo, isSubmit } from '@/api/out/monthPlan';
import { id } from 'element-plus/es/locale/index.mjs';
// 获取用户 store
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
@ -169,14 +170,11 @@ const getInfo = () => {
loading.value = true;
buttonLoading.value = false;
nextTick(async () => {
console.log('🚀 ~ routeParams.value:', routeParams.value.businessId);
const projectId = routeParams.value.businessId ? routeParams.value.businessId.split('_')[0] : currentProject.value?.id;
const res = await getMonthInfo({ projectId: projectId, planMonth: routeParams.value.planMonth });
routeParams.value.businessId ? routeParams.value.businessId.split('_')[0] : currentProject.value?.id;
const res = await getMonthInfo({ id: routeParams.value.id });
form.value = res.data as any;
console.log('🚀 ~ getInfo ~ form.value:', form.value[0].projectId);
form.value[0].mid = form.value[0].id;
form.value[0].id = form.value[0].projectId + '_' + form.value[0].planMonth;
form.value[0].id = form.value[0].projectId + '_plan';
loading.value = false;
buttonLoading.value = false;
});
@ -239,12 +237,12 @@ const submit = async (status, data) => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1);
} else {
const res = await isSubmit(data[0]?.mid);
// const res = await isSubmit(data[0]?.mid);
if (!res.data) {
proxy?.$modal.msgError('三种计划产值必须填写');
return;
}
// if (!res.data) {
// proxy?.$modal.msgError('三种计划产值必须填写');
// return;
// }
if ((form.value[0]?.planAuditStatus === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
flowCode.value = flowCodeOptions[0].value;
dialogVisible.visible = true;
@ -261,12 +259,9 @@ const submit = async (status, data) => {
onMounted(() => {
nextTick(async () => {
routeParams.value = proxy.$route.query;
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
reset();
loading.value = false;
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
console.log('🚀 ~ routeParams.value:', routeParams.value);
getInfo();
}
});