diff --git a/src/views/dayPlan/Demand/components/basicForm.vue b/src/views/dayPlan/Demand/components/basicForm.vue index a5eabc4..f033401 100644 --- a/src/views/dayPlan/Demand/components/basicForm.vue +++ b/src/views/dayPlan/Demand/components/basicForm.vue @@ -186,11 +186,11 @@ const res = await getCompDept(userInfo.id) formState.value.cuCode = res?.comp?.code formState.value.comId = res?.comp?.id - } - if (pageType.value!=='view' && pageType.value!=='compare') { const res1 = await getLngPngDemandRate({}) || [] formState.value.rateM3Gj = res1[0].rateM3Gj } + + }) async function numChange (k, record) { if (k == 'qtyDemandGj') { diff --git a/src/views/dayPlan/Demand/components/createForm.vue b/src/views/dayPlan/Demand/components/createForm.vue index 47e6fd4..afa294d 100644 --- a/src/views/dayPlan/Demand/components/createForm.vue +++ b/src/views/dayPlan/Demand/components/createForm.vue @@ -39,7 +39,7 @@ import type { Rule } from 'ant-design-vue/es/form'; import { getDictionary } from '/@/api/sales/Customer'; import { useModal } from '/@/components/Modal'; - import { addLngPngDemand, submitLngPngDemand,getLngPngDemand,getLngPngDemandUpdate,getLngPngDemandCompare } from '/@/api/dayPlan/Demand'; + import { addLngPngDemand, submitLngPngDemand,getLngPngDemand,getLngPngDemandUpdate,getLngPngDemandCompare,updateLngPngDemand } from '/@/api/dayPlan/Demand'; import dayjs from 'dayjs'; import { getAppEnvConfig } from '/@/utils/env'; import { message } from 'ant-design-vue'; @@ -172,8 +172,10 @@ lngPngDemandPurList:arr } spinning.value = true; - let request = '' - request = type == 'save'? addLngPngDemand : submitLngPngDemand + let request = submitLngPngDemand + if (type == 'save') { + request = !pageId.value ? addLngPngDemand : updateLngPngDemand + } await request(obj) spinning.value = false; notification.success({ diff --git a/src/views/dayPlan/Demand/index.vue b/src/views/dayPlan/Demand/index.vue index 82edff5..9952dff 100644 --- a/src/views/dayPlan/Demand/index.vue +++ b/src/views/dayPlan/Demand/index.vue @@ -206,7 +206,7 @@ formPath: 'dayPlan/Demand', formName: formName, formId:currentRoute.value.meta.formId, - id: record.Id, + id: record.id, type:'view' } });