yuan
2026-08-29 35bca0a78746b8b97497f89c9e1e52e643dc4d5e
src/views/salesManagement/returnOrder/components/formDia.vue
@@ -216,7 +216,8 @@
  const total = Number(row?.stockOutNum ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0);
  const un = Number(row?.unQuantity ?? 0);
  if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
  return Math.max(total - un, 0);
  // 保留6位小数,避免浮点减法产生精度误差
  return Math.max(parseFloat((total - un).toFixed(6)), 0);
};
const tableColumn = ref([
@@ -437,7 +438,7 @@
    num,
    returnQuantity: Number.isFinite(num) ? num : 0,
    price: Number(raw?.taxInclusiveUnitPrice ?? raw?.price ?? 0),
    amount: Number(raw?.amount ?? 0).toFixed(2),
    amount: Number(raw?.amount ?? 0).toFixed(6),
    isQuality: raw?.isQuality ?? 2,
    remark: raw?.remark ?? "",
  };
@@ -666,14 +667,14 @@
const calculateRowAmount = (row) => {
  const stockOutNum = Number(row.returnQuantity || 0);
  const price = Number(row.price || 0);
  row.amount = (stockOutNum * price).toFixed(2);
  row.amount = (stockOutNum * price).toFixed(6);
};
const calculateTotalRefund = () => {
  const total = tableData.value.reduce((sum, row) => {
    return sum + Number(row.amount || 0);
  }, 0);
  form.value.refundAmount = total.toFixed(2);
  form.value.refundAmount = total.toFixed(6);
};
const availableProducts = ref([]);
@@ -715,7 +716,7 @@
        returnQuantity: 0,
        num: 0,
        price: Number(product.taxInclusiveUnitPrice ?? 0),
        amount: "0.00",
        amount: "0.000000",
        isQuality: 2,
        remark: "",
        productCategory: product.productCategory ?? product.productName ?? "",