| | |
| | | :min="0" |
| | | v-model="productForm.taxInclusiveUnitPrice" |
| | | style="width: 100%" |
| | | :precision="4" |
| | | :precision="5" |
| | | placeholder="请输入" |
| | | clearable |
| | | @change="calculateFromQuantity" /> |
| | |
| | | if (Number.isNaN(num)) return "0.0000"; |
| | | return num.toFixed(4); |
| | | }; |
| | | const formatAmount5 = value => { |
| | | if (value === undefined || value === null || value === "") return "0.00000"; |
| | | const num = Number(value); |
| | | if (Number.isNaN(num)) return "0.00000"; |
| | | return num.toFixed(5); |
| | | }; |
| | | const findLedgerRecordByRow = row => { |
| | | if (!row) return null; |
| | | if ( |
| | |
| | | productForm.value.taxInclusiveUnitPrice !== null && |
| | | productForm.value.taxInclusiveUnitPrice !== "" |
| | | ) { |
| | | productForm.value.taxInclusiveUnitPrice = formatAmount4( |
| | | productForm.value.taxInclusiveUnitPrice = formatAmount5( |
| | | productForm.value.taxInclusiveUnitPrice |
| | | ); |
| | | } |
| | |
| | | productForm.value.taxInclusiveTotalPrice = totalPrice.toFixed(4); |
| | | |
| | | // 计算含税单价 = 含税总价 / 数量 |
| | | productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4); |
| | | productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(5); |
| | | |
| | | // 如果有税率,计算不含税总价 |
| | | if (productForm.value.taxRate) { |
| | |
| | | // 计算含税单价 = 含税总价 / 数量 |
| | | productForm.value.taxInclusiveUnitPrice = ( |
| | | inclusiveTotalPrice / quantity |
| | | ).toFixed(4); |
| | | ).toFixed(5); |
| | | |
| | | isCalculating.value = false; |
| | | }; |