gongchunyi
19 小时以前 b401f28ff6adc15cfe733fabc4629a144cfb3548
fix: 发货数量精度计算修复
已修改1个文件
27 ■■■■ 文件已修改
src/views/salesManagement/salesLedger/index.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue
@@ -1102,6 +1102,7 @@
    tableAmountFormatter,
    formatDecimal,
    buildAmountSummaryFormat,
    roundAmount,
  } from "@/utils/numberFormat";
  import ImageUpload from "@/components/AttachmentUpload/image/index.vue";
  import { getCurrentDate } from "@/utils/index.js";
@@ -1244,7 +1245,7 @@
      item?.qualifiedUnLockedQuantity ??
      item?.qualifiedQuantity ??
      item?.stockQuantity;
    return quantity ?? 0;
    return roundAmount(quantity ?? 0);
  };
  const formatDeliveryBatchSalesOrderNo = item =>
    item?.salesContractNo || "--";
@@ -1263,14 +1264,14 @@
      rawList.forEach(item => {
        total += Number(getDeliveryBatchQuantity(item) || 0);
      });
      currentStock.value = total;
      currentStock.value = roundAmount(total);
    } catch (e) {
      console.error(e);
      currentStock.value = 0;
    }
  };
  const getCurrentDeliveryRowQuantity = () => {
    return Number(currentDeliveryRow.value?.noQuantity || 0);
    return roundAmount(Number(currentDeliveryRow.value?.noQuantity || 0));
  };
  const getDeliveryBatchDeliveryMax = row => {
    const productQuantity = getCurrentDeliveryRowQuantity();
@@ -1282,9 +1283,8 @@
      },
      0
    );
    const remainingProductQuantity = Math.max(
      0,
      productQuantity - otherBatchTotal
    const remainingProductQuantity = roundAmount(
      Math.max(0, productQuantity - otherBatchTotal)
    );
    return Math.max(0, Math.min(batchQuantity, remainingProductQuantity));
  };
@@ -1298,9 +1298,8 @@
      },
      0
    );
    const remainingProductQuantity = Math.max(
      0,
      productQuantity - otherBatchTotal
    const remainingProductQuantity = roundAmount(
      Math.max(0, productQuantity - otherBatchTotal)
    );
    const currentValue = Number(row?.deliveryQuantity || 0);
@@ -2522,16 +2521,18 @@
          proxy.$modal.msgWarning("请至少填写一个批号的发货数量");
          return;
        }
        const totalDeliveryQuantity = selectedBatchRows.reduce(
          (sum, item) => sum + Number(item.deliveryQuantity || 0),
          0
        const totalDeliveryQuantity = roundAmount(
          selectedBatchRows.reduce(
            (sum, item) => sum + Number(item.deliveryQuantity || 0),
            0
          )
        );
        const currentRowNoQuantity = Number(
          currentDeliveryRow.value?.noQuantity || 0
        );
        if (
          currentRowNoQuantity > 0 &&
          totalDeliveryQuantity > currentRowNoQuantity
          totalDeliveryQuantity > roundAmount(currentRowNoQuantity)
        ) {
          proxy.$modal.msgWarning("批号发货总数不能超过待发货数量");
          return;