gongchunyi
2026-09-03 9840e565b021ca4ed199ea40d2c8b47bc9feeb3f
fix: 金额优化
已修改2个文件
24 ■■■■ 文件已修改
src/views/procurementManagement/paymentLedger/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/paymentLedger/index.vue
@@ -202,6 +202,14 @@
    page.size = obj.limit;
    getList();
  };
  // 将未入库金额并入已入库金额,未入库金额置0
  const mergeUnshippedAmount = row => {
    if (row && row.unshippedAmount) {
      row.shippedAmount = (Number(row.shippedAmount) || 0) + (Number(row.unshippedAmount) || 0);
      row.unshippedAmount = 0;
    }
    return row;
  };
  const getList = () => {
    tableLoading.value = true;
    paymentLedgerList({
@@ -210,7 +218,7 @@
    }).then(res => {
      let result = res.data;
      tableLoading.value = false;
      tableData.value = result.records || [];
      tableData.value = (result.records || []).map(mergeUnshippedAmount);
      total.value = result.total || 0;
      if (tableData.value.length > 0) {
        currentSupplierId.value = tableData.value[0].supplierId;
@@ -231,11 +239,11 @@
        tableLoadingSon.value = false;
        let result = res.data;
        if (Array.isArray(result)) {
          tableDataSon.value = result;
          tableDataSon.value = result.map(mergeUnshippedAmount);
          sonPage.total = result.length;
          handlePagination({ page: sonPage.current, limit: sonPage.size });
        } else {
          originalTableDataSon.value = result.records || [];
          originalTableDataSon.value = (result.records || []).map(mergeUnshippedAmount);
          sonPage.total = result.total || 0;
        }
      })
src/views/procurementManagement/procurementLedger/index.vue
@@ -90,7 +90,7 @@
        <el-table-column label="入库状态" prop="stockInStatus" width="100" show-overflow-tooltip>
          <template #default="scope">
            <el-tag :type="getStockInStatusType(scope.row.stockInStatus)" size="small">
              {{ scope.row.stockInStatus || '--' }}
              {{ formatStockInStatus(scope.row.stockInStatus) || '--' }}
            </el-tag>
          </template>
        </el-table-column>
@@ -480,11 +480,17 @@
  return typeMap[status] || "";
};
// 入库状态显示:入库中也展示为完全入库
const formatStockInStatus = status => {
  if (status === "入库中") return "完全入库";
  return status;
};
// 获取入库状态标签类型
const getStockInStatusType = status => {
  const typeMap = {
    "待入库": "info", // 待入库 - 灰色
    "入库中": "warning", // 入库中 - 橙色
    "入库中": "success", // 入库中 - 绿色
    "完全入库": "success", // 完全入库 - 绿色
  };
  return typeMap[status] || "";