| | |
| | | <el-form-item label="含税单价(元):" prop="taxInclusiveUnitPrice"> |
| | | <el-input-number |
| | | v-model="productForm.taxInclusiveUnitPrice" |
| | | :step="0.01" |
| | | :step="0.0001" |
| | | :min="0" |
| | | :precision="2" |
| | | :precision="4" |
| | | style="width: 100%" |
| | | placeholder="请输入" |
| | | clearable |
| | |
| | | |
| | | function formattedNumber(row, column, cellValue) { |
| | | const val = Number(cellValue ?? 0) |
| | | return Number.isFinite(val) ? val.toFixed(2) : '0.00' |
| | | if (!Number.isFinite(val)) return '0.00' |
| | | return column.property === 'taxInclusiveUnitPrice' ? val.toFixed(4) : val.toFixed(2) |
| | | } |
| | | |
| | | function summarizeProductTable(param) { |
| | |
| | | const quantity = parseFloat(productForm.value.quantity) |
| | | if (!totalPrice || !quantity || quantity <= 0) return |
| | | isCalculating.value = true |
| | | productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(2) |
| | | productForm.value.taxInclusiveUnitPrice = (totalPrice / quantity).toFixed(4) |
| | | if (productForm.value.taxRate) { |
| | | productForm.value.taxExclusiveTotalPrice = proxy.calculateTaxExclusiveTotalPrice(totalPrice, productForm.value.taxRate) |
| | | } |
| | |
| | | const taxRateDecimal = taxRate / 100 |
| | | const inclusiveTotalPrice = exclusiveTotalPrice / (1 - taxRateDecimal) |
| | | productForm.value.taxInclusiveTotalPrice = inclusiveTotalPrice.toFixed(2) |
| | | productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(2) |
| | | productForm.value.taxInclusiveUnitPrice = (inclusiveTotalPrice / quantity).toFixed(4) |
| | | isCalculating.value = false |
| | | } |
| | | |