Browse Source

缺陷:FWHL-483

master_hella
赵雪冰 1 week ago
parent
commit
d8eed92847
  1. 65
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

65
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

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

Loading…
Cancel
Save