diff --git a/frontend/src/views/plan/planList/components/childrenPlan.vue b/frontend/src/views/plan/planList/components/childrenPlan.vue index 02f4fd4..9a56d08 100644 --- a/frontend/src/views/plan/planList/components/childrenPlan.vue +++ b/frontend/src/views/plan/planList/components/childrenPlan.vue @@ -684,9 +684,11 @@ const exportPlan = async () => { const params = { id: subPlanFormContent.id } - ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', { type: 'warning' }).then(() => - useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip') - ) + ElMessageBox.confirm(`确认导出${subPlanFormContent.name}子计划元信息?`, '温馨提示', { + type: 'warning', + confirmButtonText: '确定', + cancelButtonText: '取消' + }).then(() => useDownload(exportSubPlan, `${subPlanFormContent.name}_子计划元信息`, params, false, '.zip')) } const exportPlanCheckResultData = async (selectedListIds: string[]) => { diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index 1e74f28..cd554d3 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -7,7 +7,6 @@ align-center v-bind="dialogBig" @close="close" - > @@ -366,7 +365,6 @@ /> - @@ -672,15 +670,24 @@ const save = () => { if (planType.value == 1) { formContent.fatherPlanId = formContent.id formContent.id = '' - formContent.memberIds = formContent.memberIds ? [formContent.memberIds?.toString()] : [] + formContent.memberIds = + formContent.memberIds && formContent.memberIds.length > 0 + ? typeof formContent.memberIds === 'string' + ? [formContent.memberIds] + : formContent.memberIds.map(id => id.toString()) + : [] await addPlan(formContent) emit('update:tab') // 编辑子计划 } else if (planType.value == 2) { - formContent.memberIds = formContent.memberIds ? [formContent.memberIds?.toString()] : [] + formContent.memberIds = + formContent.memberIds && formContent.memberIds.length > 0 + ? typeof formContent.memberIds === 'string' + ? [formContent.memberIds] + : formContent.memberIds.map(id => id.toString()) + : [] await updatePlan(formContent) emit('update:tab') - } else { formContent.sourceIds = null await updatePlan(formContent) @@ -754,7 +761,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: user_Result: any if (mode.value === '比对式') { - [ + ;[ PqErrSys_Result, pqDevList_Result, pqReportName_Result, @@ -794,7 +801,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: } } } else { - [pqSource_Result, PqScript_Result, PqErrSys_Result, pqDevList_Result, pqReportName_Result] = + ;[pqSource_Result, PqScript_Result, PqErrSys_Result, pqDevList_Result, pqReportName_Result] = await Promise.all([ getTestSourceList(data), getPqScriptList(data), @@ -829,8 +836,8 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: const datasourceDicts = dictStore.getDictData('Datasource') formContent.datasourceIds = datasourceDicts - .filter(item => ['real', 'wave_data'].includes(item.code)) - .map(item => item.code) + .filter(item => ['real', 'wave_data'].includes(item.code)) + .map(item => item.code) } else { //编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值 @@ -907,7 +914,7 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan: } } } else { - [ + ;[ pqSource_Result, PqScript_Result, PqErrSys_Result, @@ -1058,8 +1065,8 @@ const handleErrorSysChange = async (value: string) => { }) } formContent.testItems = secondLevelOptions - .filter(option => option.label !== '闪变') - .map(option => option.value) + .filter(option => option.label !== '闪变') + .map(option => option.value) } catch (error) { formContent.testItems = [] console.error('获取检测项失败:', error) @@ -1090,9 +1097,9 @@ const loadTestItemsForErrorSys = async (errorSysId: string) => { label: (res.data as Record)[key] }) }) - formContent.testItems = secondLevelOptions - .filter(option => option.label !== '闪变') - .map(option => option.value) + formContent.testItems = secondLevelOptions + .filter(option => option.label !== '闪变') + .map(option => option.value) } } catch (error) { console.error('获取检测项失败:', error) @@ -1235,7 +1242,6 @@ const props = defineProps<{