|
|
@@ -109,9 +109,11 @@
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
|
|
|
- const operate = computed(() => (route.query.operate as string) || 'work-plan-dept-view');
|
|
|
+
|
|
|
const currentId = computed(() => Number(route.query.id));
|
|
|
+ const currentPlanId = computed(() => Number(route.query.planId));
|
|
|
|
|
|
+ const operate = computed(() => (route.query.operate as string) || 'work-plan-dept-view');
|
|
|
const isEditMode = computed(() => operate.value === 'work-plan-dept-issue');
|
|
|
const isViewMode = computed(() => operate.value === 'work-plan-dept-view');
|
|
|
|
|
|
@@ -246,10 +248,10 @@
|
|
|
};
|
|
|
|
|
|
const getDetail = async () => {
|
|
|
- console.log(currentId.value, 'currentId.value');
|
|
|
- if (!currentId.value) return;
|
|
|
+ const id = currentPlanId.value;
|
|
|
+ if (!id) return;
|
|
|
try {
|
|
|
- const res = await queryWorkPlanDetail(currentId.value);
|
|
|
+ const res = await queryWorkPlanDetail(id);
|
|
|
if (res) {
|
|
|
// 映射接口字段到表单字段
|
|
|
const cooperateDeptIdsArray = parseDeptIds(res.cooperateDeptIds);
|
|
|
@@ -275,17 +277,6 @@
|
|
|
// 处理附件格式
|
|
|
form.fileUrl = JSON.parse(form.fileUrl)[0].url;
|
|
|
}
|
|
|
- // const basePayload = {
|
|
|
- // workContent: form.workContent,
|
|
|
- // categoryName: form.categoryName,
|
|
|
- // trainingPlanName: form.trainingPlanName,
|
|
|
- // executGroupIds: '',
|
|
|
- // plannedComplateTime: formatDate(form.plannedComplateTime),
|
|
|
- // cooperateDeptIds: form.cooperateDeptIds.toString(),
|
|
|
- // responsibleDeptIds: form.responsibleDeptIds.toString(),
|
|
|
- // fileUrl: form.fileUrl,
|
|
|
- // };
|
|
|
- // console.log(basePayload, 'basePayload')
|
|
|
if (isEditMode.value && currentId.value) {
|
|
|
await issueWorkPlanDept({
|
|
|
id: currentId.value,
|