| | |
| | | }); |
| | | }; |
| | | const onBlur = value => { |
| | | // 限制四位小数 |
| | | mergeForm.totalAssignedQuantity = Number(value.toFixed(4)); |
| | | mergeForm.totalAssignedQuantity = Number(Number(value).toFixed(10)); |
| | | }; |
| | | |
| | | const fetchProductOptions = () => { |
| | |
| | | }; |
| | | } |
| | | summary[category].totalAssignedQuantity += Number( |
| | | (Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0)).toFixed( |
| | | 4 |
| | | ) |
| | | ( |
| | | Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0) |
| | | ).toFixed(10) |
| | | ); |
| | | }); |
| | | |
| | |
| | | const totalAssignedQuantity = selectedRows.value.reduce((sum, row) => { |
| | | return sum + Number(row.qtyRequired || 0) - Number(row.quantityIssued || 0); |
| | | }, 0); // 避免浮点数精度问题(如 37.800000000000004) |
| | | const fixedTotal = Math.round(totalAssignedQuantity * 100) / 100; |
| | | const fixedTotal = Number(totalAssignedQuantity.toFixed(10)); |
| | | sumAssignedQuantity.value = fixedTotal; |
| | | console.log(fixedTotal); |
| | | // 设置表单数据 |