Commit 2d14be427d3c7aa147dc1a82e4f634a26b1458f7
1 parent
ebac4c7d
feat: update 1、占比相加浮点数精确问题调整。2、利润分析新增isEditPacketPrice判断
Showing
1 changed file
with
23 additions
and
1 deletions
src/views/project/order/FormDetail/index.vue
@@ -151,6 +151,9 @@ | @@ -151,6 +151,9 @@ | ||
151 | const businessUsers = ref([]); | 151 | const businessUsers = ref([]); |
152 | const checkingMsg = ref(''); | 152 | const checkingMsg = ref(''); |
153 | 153 | ||
154 | + //修改之前的包装费用 | ||
155 | + const originPackagePrice = ref(-1.0); | ||
156 | + | ||
154 | onMounted(async () => { | 157 | onMounted(async () => { |
155 | // 获取包装费用和客户编码的关联关系 | 158 | // 获取包装费用和客户编码的关联关系 |
156 | const res = await getConfigList({ | 159 | const res = await getConfigList({ |
@@ -176,6 +179,7 @@ | @@ -176,6 +179,7 @@ | ||
176 | let fields = reactive({ baseFields: {} }); | 179 | let fields = reactive({ baseFields: {} }); |
177 | 180 | ||
178 | const [register, { closeDrawer }] = useDrawerInner((data) => { | 181 | const [register, { closeDrawer }] = useDrawerInner((data) => { |
182 | + // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', false); | ||
179 | activeKey.value = | 183 | activeKey.value = |
180 | role.value === ROLE.INSPECT ? '5' : role.value === ROLE.BUSINESS ? '2' : '1'; | 184 | role.value === ROLE.INSPECT ? '5' : role.value === ROLE.BUSINESS ? '2' : '1'; |
181 | 185 | ||
@@ -233,6 +237,9 @@ | @@ -233,6 +237,9 @@ | ||
233 | ); | 237 | ); |
234 | }); | 238 | }); |
235 | 239 | ||
240 | + //原始的包装费用 | ||
241 | + originPackagePrice.value = data.profitAnalysisInfo.packetPrice; | ||
242 | + | ||
236 | const exchangeRate = find(configList.value, (item) => { | 243 | const exchangeRate = find(configList.value, (item) => { |
237 | return item.settingCode === 'exchangeRate'; | 244 | return item.settingCode === 'exchangeRate'; |
238 | }); | 245 | }); |
@@ -250,6 +257,7 @@ | @@ -250,6 +257,7 @@ | ||
250 | data?.profitAnalysisInfo?.packetPrice | 257 | data?.profitAnalysisInfo?.packetPrice |
251 | ) { | 258 | ) { |
252 | checkingMsg.value += ',包装费用有修改'; | 259 | checkingMsg.value += ',包装费用有修改'; |
260 | + // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', true); | ||
253 | } | 261 | } |
254 | 262 | ||
255 | // 编辑了但是还没审核,先将页面的值变化 | 263 | // 编辑了但是还没审核,先将页面的值变化 |
@@ -355,7 +363,10 @@ | @@ -355,7 +363,10 @@ | ||
355 | // 比重相加等于1 | 363 | // 比重相加等于1 |
356 | const values = reportFormPanelRef?.value?.getFieldsValue() || {}; | 364 | const values = reportFormPanelRef?.value?.getFieldsValue() || {}; |
357 | if ( | 365 | if ( |
358 | - values.ideaSourceRate + values.manualPreform1Rate + values.manualPreform2Rate !== | 366 | + (values.ideaSourceRate * 100 + |
367 | + values.manualPreform1Rate * 100 + | ||
368 | + values.manualPreform2Rate * 100) / | ||
369 | + 100 !== | ||
359 | 1 | 370 | 1 |
360 | ) { | 371 | ) { |
361 | return message.error('占比相加不等于1'); | 372 | return message.error('占比相加不等于1'); |
@@ -367,6 +378,17 @@ | @@ -367,6 +378,17 @@ | ||
367 | } else if (activeKey.value === '5') { | 378 | } else if (activeKey.value === '5') { |
368 | forms.inspectionStageInfo = inspectionFormPanelRef?.value?.getFieldsValue() || {}; | 379 | forms.inspectionStageInfo = inspectionFormPanelRef?.value?.getFieldsValue() || {}; |
369 | } | 380 | } |
381 | + | ||
382 | + //默认没有修改包装费用 | ||
383 | + forms.profitAnalysisInfo.isEditPacketPrice = false; | ||
384 | + //如果包装费用有修改过,那么传参isEditPacketPrice为true | ||
385 | + if ( | ||
386 | + originPackagePrice.value != -1 && | ||
387 | + originPackagePrice.value !== forms?.profitAnalysisInfo?.packetPrice | ||
388 | + ) { | ||
389 | + forms.profitAnalysisInfo.isEditPacketPrice = true; | ||
390 | + } | ||
391 | + | ||
370 | await orderUpdate(forms); | 392 | await orderUpdate(forms); |
371 | closeDrawer(); | 393 | closeDrawer(); |
372 | emit('success', {}); | 394 | emit('success', {}); |