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 | 151 | const businessUsers = ref([]); |
152 | 152 | const checkingMsg = ref(''); |
153 | 153 | |
154 | + //修改之前的包装费用 | |
155 | + const originPackagePrice = ref(-1.0); | |
156 | + | |
154 | 157 | onMounted(async () => { |
155 | 158 | // 获取包装费用和客户编码的关联关系 |
156 | 159 | const res = await getConfigList({ |
... | ... | @@ -176,6 +179,7 @@ |
176 | 179 | let fields = reactive({ baseFields: {} }); |
177 | 180 | |
178 | 181 | const [register, { closeDrawer }] = useDrawerInner((data) => { |
182 | + // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', false); | |
179 | 183 | activeKey.value = |
180 | 184 | role.value === ROLE.INSPECT ? '5' : role.value === ROLE.BUSINESS ? '2' : '1'; |
181 | 185 | |
... | ... | @@ -233,6 +237,9 @@ |
233 | 237 | ); |
234 | 238 | }); |
235 | 239 | |
240 | + //原始的包装费用 | |
241 | + originPackagePrice.value = data.profitAnalysisInfo.packetPrice; | |
242 | + | |
236 | 243 | const exchangeRate = find(configList.value, (item) => { |
237 | 244 | return item.settingCode === 'exchangeRate'; |
238 | 245 | }); |
... | ... | @@ -250,6 +257,7 @@ |
250 | 257 | data?.profitAnalysisInfo?.packetPrice |
251 | 258 | ) { |
252 | 259 | checkingMsg.value += ',包装费用有修改'; |
260 | + // baseFormPanelRef.value.setFieldValue('isEditPacketPrice', true); | |
253 | 261 | } |
254 | 262 | |
255 | 263 | // 编辑了但是还没审核,先将页面的值变化 |
... | ... | @@ -355,7 +363,10 @@ |
355 | 363 | // 比重相加等于1 |
356 | 364 | const values = reportFormPanelRef?.value?.getFieldsValue() || {}; |
357 | 365 | if ( |
358 | - values.ideaSourceRate + values.manualPreform1Rate + values.manualPreform2Rate !== | |
366 | + (values.ideaSourceRate * 100 + | |
367 | + values.manualPreform1Rate * 100 + | |
368 | + values.manualPreform2Rate * 100) / | |
369 | + 100 !== | |
359 | 370 | 1 |
360 | 371 | ) { |
361 | 372 | return message.error('占比相加不等于1'); |
... | ... | @@ -367,6 +378,17 @@ |
367 | 378 | } else if (activeKey.value === '5') { |
368 | 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 | 392 | await orderUpdate(forms); |
371 | 393 | closeDrawer(); |
372 | 394 | emit('success', {}); |
... | ... |