|
|
@ -42,8 +42,11 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #differencePrice="{ row }"> |
|
|
|
<!-- 参考英泰修复四舍六入修改逻辑toFixed |
|
|
|
// 原逻辑: Number(row.differencePrice).toFixed(5) |
|
|
|
--> |
|
|
|
<span :class="{ 'red-text': row.differencePrice != 0 }">{{ |
|
|
|
Number(row.differencePrice).toFixed(5) |
|
|
|
Math.round(Number(row.differencePrice) * 100000) / 100000 |
|
|
|
}}</span> |
|
|
|
</template> |
|
|
|
<template #action="{ row, $index }"> |
|
|
@ -107,7 +110,7 @@ |
|
|
|
beforeTaxDiffAmount: beforeTaxAmount - amount, //未税差额:未税金额-系统未税金额 |
|
|
|
taxAmountDiff: totalTaxAmount - taxAmount, // 税额差异:税额-系统税额 |
|
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff, // 价税合计差额=未税差额+税额差异 |
|
|
|
rebateTax:Number(Number(discountAmount1*taxRate*0.01).toFixed(2)), |
|
|
|
rebateTax:Number(Math.round(Number(discountAmount1*taxRate*0.01) * 100) / 100), // 参考英泰修复四舍六入修改逻辑toFixed 原逻辑:Number(Number(discountAmount1*taxRate*0.01).toFixed(2)) |
|
|
|
rebateTotal:rebateTax+discountAmount1 |
|
|
|
}) |
|
|
|
} else if (formType == 'create') { |
|
|
@ -118,11 +121,12 @@ |
|
|
|
(prev, item) => |
|
|
|
prev + |
|
|
|
Number( |
|
|
|
Number( |
|
|
|
taxRate * |
|
|
|
0.01 * |
|
|
|
Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)) |
|
|
|
).toFixed(2) |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
taxRate * |
|
|
|
0.01 * |
|
|
|
Number(Math.round(Number(item['singlePrice'] * item['invoicableQuantity']) * 100) / 100) //参考英泰修复四舍六入修改逻辑toFixed Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)) |
|
|
|
) * 100) / 100 |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
@ -135,7 +139,7 @@ |
|
|
|
beforeTaxDiffAmount: beforeTaxAmount - amount, //未税差额:未税金额-系统未税金额 |
|
|
|
taxAmountDiff: totalTaxAmount - taxAmount, // 税额差异:税额-系统税额 |
|
|
|
totalTaxDiffAmount: beforeTaxDiffAmount + taxAmountDiff, // 价税合计差额=未税差额+税额差异 |
|
|
|
rebateTax:Number(Number(discountAmount1*taxRate*0.01).toFixed(2)), |
|
|
|
rebateTax:Number(Math.round(Number(discountAmount1*taxRate*0.01) * 100) / 100), //参考英泰修复四舍六入修改逻辑toFixed Number(Number(discountAmount1*taxRate*0.01).toFixed(2)) |
|
|
|
rebateTotal:rebateTax+discountAmount1 |
|
|
|
}) |
|
|
|
} |
|
|
@ -148,18 +152,19 @@ |
|
|
|
const sumObject = { |
|
|
|
amount: tableData.reduce( |
|
|
|
(prev, item) => |
|
|
|
prev + Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)), |
|
|
|
prev + Number(Math.round(Number(item['singlePrice'] * item['invoicableQuantity']) * 100) / 100), |
|
|
|
0 |
|
|
|
), |
|
|
|
taxAmount: tableData.reduce( |
|
|
|
(prev, item) => |
|
|
|
prev + |
|
|
|
Number( |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
taxRate * |
|
|
|
0.01 * |
|
|
|
Number(Number(item['singlePrice'] * item['invoicableQuantity']).toFixed(2)) |
|
|
|
).toFixed(2) |
|
|
|
Number(Math.round(Number(item['singlePrice'] * item['invoicableQuantity']) * 100) / 100) |
|
|
|
) * 100) / 100 |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
@ -183,18 +188,20 @@ |
|
|
|
<template #selectionsActionspoLine="{ selections }"> |
|
|
|
<div style="text-align: left; margin-right: 10px"> |
|
|
|
{{t('ts.系统未税金额')}}:{{ |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
selections.reduce( |
|
|
|
(prev, item) => |
|
|
|
prev + |
|
|
|
Number( |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
Number(Number(item['purchasePrice']).toFixed(5)) * item['invoicableQuantity'] |
|
|
|
).toFixed(2) |
|
|
|
Number(Math.round(Number(item['purchasePrice']) * 100000) / 100000) * item['invoicableQuantity'] |
|
|
|
) * 100) / 100 |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
|
).toFixed(2) |
|
|
|
) * 100) / 100 |
|
|
|
}} |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -207,7 +214,7 @@ |
|
|
|
<el-input |
|
|
|
:disabled="true" |
|
|
|
:class="{ 'is-red': row['singlePrice'] - row['purchasePrice'] > 0 }" |
|
|
|
:modelValue="(row['singlePrice'] - row['purchasePrice']).toFixed(5)" |
|
|
|
:modelValue="Math.round((row['singlePrice'] - row['purchasePrice']) * 100000) / 100000" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
@ -293,7 +300,7 @@ |
|
|
|
(formRef, formModel) => { |
|
|
|
const { singlePrice = 0, purchasePrice = 0 } = formModel |
|
|
|
formRef.value.setValues({ |
|
|
|
differencePrice: Number((Number(singlePrice) - Number(purchasePrice)).toFixed(5)) |
|
|
|
differencePrice: Number(Math.round((Number(singlePrice) - Number(purchasePrice)) * 100000) / 100000) |
|
|
|
}) |
|
|
|
} |
|
|
|
" |
|
|
@ -337,18 +344,20 @@ |
|
|
|
<template #selectionsActionspoLine="{ selections }"> |
|
|
|
<div style="text-align: left; margin-right: 10px"> |
|
|
|
{{t('ts.系统未税金额')}}:{{ |
|
|
|
Number( |
|
|
|
selections.reduce( |
|
|
|
(prev, item) => |
|
|
|
prev + |
|
|
|
Number( |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
selections.reduce( |
|
|
|
(prev, item) => |
|
|
|
prev + |
|
|
|
Number( |
|
|
|
Number(Number(item['purchasePrice']).toFixed(5)) * item['invoicableQuantity'] |
|
|
|
).toFixed(2) |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
|
).toFixed(2) |
|
|
|
Math.round( |
|
|
|
Number( |
|
|
|
Number(Math.round(Number(item['purchasePrice']) * 100000) / 100000) * item['invoicableQuantity'] |
|
|
|
) * 100 ) / 100 |
|
|
|
), |
|
|
|
0 |
|
|
|
) |
|
|
|
) * 100 ) / 100 |
|
|
|
}} |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -1408,7 +1417,7 @@ const submitForm = async (formType, submitData) => { |
|
|
|
let data = { ...submitData } |
|
|
|
tableData.value.forEach((item) => { |
|
|
|
item.differencePrice = Number( |
|
|
|
(Number(item?.singlePrice) - Number(item?.purchasePrice)).toFixed(5) |
|
|
|
Math.round((Number(item?.singlePrice) - Number(item?.purchasePrice)) * 100000 ) / 100000 |
|
|
|
) |
|
|
|
}) |
|
|
|
let flagInvoicableQuantity = false |
|
|
|