| | |
| | | productForm.value.taxInclusiveUnitPrice, |
| | | productForm.value.quantity |
| | | ); |
| | | // 优化:使带税和不带税价格一致 |
| | | productForm.value.taxExclusiveTotalPrice = productForm.value.taxInclusiveTotalPrice; |
| | | |
| | | // 根据税率计算不含税总价 |
| | | const taxRate = Number(productForm.value.taxRate) || 0; |
| | | productForm.value.taxExclusiveTotalPrice = ( |
| | | Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100) |
| | | ).toFixed(2); |
| | | }; |
| | | const reverseMathNum = field => { |
| | | // 确保输入值不为负数 |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | const taxRate = Number(productForm.value.taxRate) || 0; |
| | | |
| | | if (field === "taxInclusiveTotalPrice") { |
| | | // 已知含税总价和数量,反算含税单价 |
| | |
| | | productForm.value.quantity = "0"; |
| | | } |
| | | } |
| | | // 优化:使带税和不带税价格一致 |
| | | productForm.value.taxExclusiveTotalPrice = productForm.value.taxInclusiveTotalPrice; |
| | | // 根据税率计算不含税总价 |
| | | productForm.value.taxExclusiveTotalPrice = ( |
| | | Number(productForm.value.taxInclusiveTotalPrice) / (1 + taxRate / 100) |
| | | ).toFixed(2); |
| | | } else if (field === "taxExclusiveTotalPrice") { |
| | | // 优化:使带税和不带税价格一致 |
| | | productForm.value.taxInclusiveTotalPrice = productForm.value.taxExclusiveTotalPrice; |
| | | // 根据税率计算含税总价 |
| | | productForm.value.taxInclusiveTotalPrice = ( |
| | | Number(productForm.value.taxExclusiveTotalPrice) * (1 + taxRate / 100) |
| | | ).toFixed(2); |
| | | |
| | | // 已知数量,反算含税单价 |
| | | if (productForm.value.quantity) { |
| | | productForm.value.taxInclusiveUnitPrice = ( |