| | |
| | | <el-form-item label="税率(%):" |
| | | prop="taxRate"> |
| | | <el-select v-model="productForm.taxRate" |
| | | placeholder="请选择" |
| | | placeholder="请选择或输入" |
| | | clearable |
| | | filterable |
| | | remote |
| | | :remote-method="handleTaxRateRemote" |
| | | @change="calculateFromTaxRate"> |
| | | <el-option label="1" |
| | | value="1" /> |
| | |
| | | value="6" /> |
| | | <el-option label="13" |
| | | value="13" /> |
| | | <el-option v-if="customTaxRate" |
| | | :label="customTaxRate" |
| | | :value="customTaxRate" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | const productFormVisible = ref(false); |
| | | const productOperationType = ref(""); |
| | | const currentId = ref(""); |
| | | const customTaxRate = ref(""); |
| | | const productFormData = reactive({ |
| | | productForm: { |
| | | productCategory: "", |
| | |
| | | <tr> |
| | | <td>${index + 1}</td> |
| | | <td>${product.productName || ""}</td> |
| | | <td>${product.specificationModel || ""}</td> |
| | | <td>${ |
| | | product.specificationModel || "" |
| | | }</td> |
| | | <td>${product.unit || ""}</td> |
| | | <td>${formatNumber(product.unitPrice)}</td> |
| | | <td>${formatNumber( |
| | | product.unitPrice |
| | | )}</td> |
| | | <td>${product.quantity || 0}</td> |
| | | <td>${formatNumber(product.totalPrice)}</td> |
| | | <td>${formatDate(product.deliveryDate)}</td> |
| | | <td>${formatNumber( |
| | | product.totalPrice |
| | | )}</td> |
| | | <td>${formatDate( |
| | | product.deliveryDate |
| | | )}</td> |
| | | <td>${product.licensePlate || ""}</td> |
| | | <td>${product.customerName || ""}</td> |
| | | <td>${product.salesContractNo || ""}</td> |
| | | <td>${ |
| | | product.salesContractNo || "" |
| | | }</td> |
| | | </tr> |
| | | `; |
| | | }); |
| | |
| | | <tr class="total-row"> |
| | | <td colspan="5">合计</td> |
| | | <td>${totalQuantity}</td> |
| | | <td>${formatNumber(totalAmount)}</td> |
| | | <td>${formatNumber( |
| | | totalAmount |
| | | )}</td> |
| | | <td colspan="4"></td> |
| | | </tr> |
| | | </tbody> |
| | |
| | | isCalculating.value = false; |
| | | }; |
| | | |
| | | // 处理税率远程搜索 |
| | | const handleTaxRateRemote = query => { |
| | | if (query) { |
| | | // 验证输入是否为数字且在0-100之间 |
| | | const num = parseFloat(query); |
| | | if (!isNaN(num) && num > 0 && num < 100) { |
| | | customTaxRate.value = query; |
| | | } else { |
| | | customTaxRate.value = ""; |
| | | } |
| | | } else { |
| | | customTaxRate.value = ""; |
| | | } |
| | | }; |
| | | // 根据税率变化计算不含税总价 |
| | | const calculateFromTaxRate = () => { |
| | | // 对私客户不需要税率计算 |