diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue index 8ee89b13c9..626825d3a8 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingAdd.vue @@ -354,40 +354,20 @@ export default { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' this.formobj.withRebateTotal = sums[index] += '' - } else if (column.property === 'expectItureCost') { + } else if (column.property === 'expectItureCost' || column.property === 'expectTreatCost' || column.property === 'expectSuppCost') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectTreatCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectSuppCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' diff --git a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue index 9788389f1f..454ef97fa9 100644 --- a/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatewithholding/specialrebatewithholdingInfo.vue @@ -147,43 +147,13 @@ export default { return } const values = data.map(item => Number(item[column.property])) - if (column.property === 'withRebate') { + if (column.property === 'withRebate' || column.property === 'expectItureCost' || column.property === 'expectTreatCost' || column.property === 'expectSuppCost') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectItureCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectTreatCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectSuppCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue index 9f19d418d0..690f2a35ae 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiDaiBanInfo.vue @@ -251,43 +251,13 @@ export default { return } const values = data.map(item => Number(item[column.property])) - if (column.property === 'withRebate') { + if (column.property === 'withRebate' || column.property === 'expectItureCost' || column.property === 'expectTreatCost' || column.property === 'expectSuppCost') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectItureCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectTreatCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectSuppCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue index 0cb0db8d49..9ccf852a69 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiEdit.vue @@ -333,47 +333,27 @@ export default { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' this.formobj.withRebateTotal = sums[index] += '' - } else if (column.property === 'expectItureCost') { + } else if (column.property === 'expectItureCost' || column.property === 'expectTreatCost' || column.property === 'expectSuppCost') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectTreatCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectSuppCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += '' } }) return sums - } + }, } } diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue index 56a5452f29..0c82fcb7c7 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliyutiFlow/zhuanxiangfanliyutiYiBanInfo.vue @@ -182,43 +182,13 @@ export default { return } const values = data.map(item => Number(item[column.property])) - if (column.property === 'withRebate') { + if (column.property === 'withRebate' || column.property === 'expectItureCost' || column.property === 'expectTreatCost' || column.property === 'expectSuppCost') { sums[index] = values.reduce((prev, curr) => { const value = Number(curr) if (!isNaN(value)) { - return prev + curr + return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100 } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectItureCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectTreatCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev - } - }, 0) - sums[index] += '' - } else if (column.property === 'expectSuppCost') { - sums[index] = values.reduce((prev, curr) => { - const value = Number(curr) - if (!isNaN(value)) { - return prev + curr - } else { - return prev + return Math.round((parseFloat(prev)) * 100) / 100 } }, 0) sums[index] += ''