Commit f4d6fd3cfd3bc7e15686d6aa52a6ea71cebb3bd9
1 parent
1b499e8a
fix: 更改数值显示逻辑
Showing
4 changed files
with
44 additions
and
12 deletions
src/views/project/order/FormDetail/index.vue
... | ... | @@ -216,19 +216,37 @@ |
216 | 216 | }); |
217 | 217 | // 利润分析 |
218 | 218 | profitFormPanelRef.value.fields = { ...data.lockFields?.profitAnalysisFields } || {}; |
219 | + // if (data?.orderUpdateInfoVO?.profitAnalysisFields) { | |
220 | + // // 编辑了但是还没审核,先将页面的值变化 | |
221 | + // profitFormPanelRef?.value?.setFieldsValue({ | |
222 | + // ...toRaw(data?.orderUpdateInfoVO?.profitAnalysisFields), | |
223 | + // packetPrice: packetPrice?.relationValue || 0, | |
224 | + // exchangeRate: exchangeRate?.settingValue, | |
225 | + // }); | |
226 | + // } else { | |
219 | 227 | profitFormPanelRef?.value?.setFieldsValue({ |
220 | 228 | ...toRaw(data.profitAnalysisInfo), |
221 | 229 | packetPrice: packetPrice?.relationValue || 0, |
222 | 230 | exchangeRate: exchangeRate?.settingValue, |
223 | 231 | }); |
232 | + // } | |
233 | + profitFormPanelRef?.value?.clearValidate(); | |
224 | 234 | } |
225 | 235 | |
226 | 236 | if (reportFormPanelRef.value) { |
227 | 237 | // 项目报告书 |
228 | 238 | reportFormPanelRef.value.fields = { ...data.lockFields?.reportFields } || {}; |
239 | + // if (data?.orderUpdateInfoVO?.reportFields) { | |
240 | + // data?.orderUpdateInfoVO?.reportFields; | |
241 | + // // 编辑了但是还没审核,先将页面的值变化 | |
242 | + // reportFormPanelRef?.value?.setFieldsValue({ | |
243 | + // ...data?.orderUpdateInfoVO?.reportFields, | |
244 | + // }); | |
245 | + // } else { | |
229 | 246 | reportFormPanelRef?.value?.setFieldsValue({ |
230 | 247 | ...toRaw(data.reportInfo), |
231 | 248 | }); |
249 | + // } | |
232 | 250 | } |
233 | 251 | if (trackFormPanelRef.value) { |
234 | 252 | // 跟单信息 | ... | ... |
src/views/project/order/ProfitAnalysis.vue
... | ... | @@ -82,20 +82,24 @@ |
82 | 82 | { |
83 | 83 | field: 'customerTotalPrice', |
84 | 84 | label: '客户总金额', |
85 | + render: (val) => '$ ' + (val || ''), | |
85 | 86 | }, |
86 | 87 | { |
87 | 88 | field: 'packetTotalPrice', |
88 | 89 | label: '供应商总价', |
90 | + render: (val) => '¥ ' + (val || ''), | |
89 | 91 | }, |
90 | 92 | { |
91 | 93 | field: 'productionDepartmentTotalPrice', |
92 | 94 | label: '包装费用', |
93 | 95 | show: isTracker, |
96 | + render: (val) => '$' + (val || ''), | |
94 | 97 | }, |
95 | 98 | { |
96 | 99 | field: 'profitRate', |
97 | 100 | label: '总利润率', |
98 | 101 | show: isTracker, |
102 | + render: (val) => (Number(val || 0) * 100).toFixed(2) + '%', | |
99 | 103 | }, |
100 | 104 | ]; |
101 | 105 | ... | ... |
src/views/project/order/tableData.tsx
... | ... | @@ -240,7 +240,10 @@ export const ORDER_LIST_PROFIT_FIELDS = [ |
240 | 240 | dataIndex: 'customerTotalPrice', |
241 | 241 | customRender: (column) => { |
242 | 242 | const { record } = column || {}; |
243 | - return record?.profitAnalysisInfo?.customerTotalPrice; | |
243 | + | |
244 | + return `${record?.profitAnalysisInfo?.customerCurrency || ''} ${ | |
245 | + record?.profitAnalysisInfo?.customerTotalPrice || '' | |
246 | + }`; | |
244 | 247 | }, |
245 | 248 | }, |
246 | 249 | { |
... | ... | @@ -260,7 +263,9 @@ export const ORDER_LIST_PROFIT_FIELDS = [ |
260 | 263 | dataIndex: 'productionDepartmentTotalPrice', |
261 | 264 | customRender: (column) => { |
262 | 265 | const { record } = column || {}; |
263 | - return record?.profitAnalysisInfo?.productionDepartmentTotalPrice; | |
266 | + return `${record?.profitAnalysisInfo?.productionDepartmentCurrency || ''} ${ | |
267 | + record?.profitAnalysisInfo?.productionDepartmentTotalPrice || '' | |
268 | + }`; | |
264 | 269 | }, |
265 | 270 | }, |
266 | 271 | { |
... | ... | @@ -269,9 +274,9 @@ export const ORDER_LIST_PROFIT_FIELDS = [ |
269 | 274 | dataIndex: 'packetPrice', |
270 | 275 | customRender: (column) => { |
271 | 276 | const { record } = column || {}; |
272 | - return `${record?.profitAnalysisInfo?.packetCurrency || ''} ${ | |
273 | - record?.profitAnalysisInfo?.packetPrice || '' | |
274 | - }`; | |
277 | + return record?.profitAnalysisInfo?.packetPrice !== undefined | |
278 | + ? `$ ${record?.profitAnalysisInfo?.packetPrice || 0}` | |
279 | + : ''; | |
275 | 280 | }, |
276 | 281 | }, |
277 | 282 | { |
... | ... | @@ -280,7 +285,9 @@ export const ORDER_LIST_PROFIT_FIELDS = [ |
280 | 285 | dataIndex: 'packetTotalPrice', |
281 | 286 | customRender: (column) => { |
282 | 287 | const { record } = column || {}; |
283 | - return record?.profitAnalysisInfo?.packetTotalPrice; | |
288 | + return record?.profitAnalysisInfo?.packetTotalPrice !== undefined | |
289 | + ? '$ ' + record?.profitAnalysisInfo?.packetTotalPrice | |
290 | + : ''; | |
284 | 291 | }, |
285 | 292 | }, |
286 | 293 | { |
... | ... | @@ -298,7 +305,10 @@ export const ORDER_LIST_PROFIT_FIELDS = [ |
298 | 305 | dataIndex: 'profitRate', |
299 | 306 | customRender: (column) => { |
300 | 307 | const { record } = column || {}; |
301 | - return record?.profitAnalysisInfo?.profitRate; | |
308 | + // 保留两位小数 | |
309 | + return record?.profitAnalysisInfo?.profitRate !== undefined | |
310 | + ? (record?.profitAnalysisInfo?.profitRate * 100).toFixed(2) + '%' | |
311 | + : ''; | |
302 | 312 | }, |
303 | 313 | }, |
304 | 314 | { |
... | ... | @@ -420,7 +430,7 @@ export const ORDER_LIST_TRACK_FIELDS = [ |
420 | 430 | dataIndex: 'barcodeStickerArrivalTime', |
421 | 431 | customRender: (column) => { |
422 | 432 | const { record } = column || {}; |
423 | - return record?.trackStageInfo?.barcodeStickerArrivalTime; | |
433 | + return formatToDate(record?.trackStageInfo?.barcodeStickerArrivalTime); | |
424 | 434 | }, |
425 | 435 | }, |
426 | 436 | { |
... | ... | @@ -429,7 +439,7 @@ export const ORDER_LIST_TRACK_FIELDS = [ |
429 | 439 | dataIndex: 'latestArrivalTime', |
430 | 440 | customRender: (column) => { |
431 | 441 | const { record } = column || {}; |
432 | - return formatToDate(record?.trackStageInfo?.latestArrivalTime); | |
442 | + return record?.trackStageInfo?.latestArrivalTime; | |
433 | 443 | }, |
434 | 444 | }, |
435 | 445 | { |
... | ... | @@ -438,7 +448,7 @@ export const ORDER_LIST_TRACK_FIELDS = [ |
438 | 448 | dataIndex: 'latestBkTime', |
439 | 449 | customRender: (column) => { |
440 | 450 | const { record } = column || {}; |
441 | - return formatToDate(record?.trackStageInfo?.latestBkTime); | |
451 | + return record?.trackStageInfo?.latestBkTime; | |
442 | 452 | }, |
443 | 453 | }, |
444 | 454 | ], | ... | ... |
vite.config.ts
... | ... | @@ -20,8 +20,8 @@ export default defineApplicationConfig({ |
20 | 20 | server: { |
21 | 21 | proxy: { |
22 | 22 | '/basic-api/order': { |
23 | - target: 'http://localhost:8000', | |
24 | - // target: 'http://39.108.227.113:8000', | |
23 | + // target: 'http://localhost:8000', | |
24 | + target: 'http://39.108.227.113:8000', | |
25 | 25 | // target: 'http://39.108.227.113:3000/mock/35', |
26 | 26 | // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code |
27 | 27 | changeOrigin: true, | ... | ... |