src/views/salesManagement/salesLedger/index.vue
@@ -654,7 +654,7 @@
          align="right"
        >
          <template #default="scope">
            {{ Number(scope.row.totalAmount ?? 0).toFixed(6) }}
            {{ trimZeros(scope.row.totalAmount, 6) }}
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="120" align="center">
@@ -959,9 +959,11 @@
                      <td>{{ product.productCategory || "" }}</td>
                      <td>{{ product.specificationModel || "" }}</td>
                      <td>{{ product.unit || "" }}</td>
                      <td>{{ product.taxInclusiveUnitPrice || "0" }}</td>
                      <td>{{ product.quantity || "0" }}</td>
                      <td>{{ product.taxInclusiveTotalPrice || "0" }}</td>
                      <td>{{ trimZeros(product.taxInclusiveUnitPrice, 6) }}</td>
                      <td>{{ trimZeros(product.quantity, 6) }}</td>
                      <td>
                        {{ trimZeros(product.taxInclusiveTotalPrice, 6) }}
                      </td>
                    </tr>
                    <tr v-if="!item.products || item.products.length === 0">
                      <td colspan="6" style="text-align: center; color: #999">
@@ -1188,6 +1190,7 @@
import FileUpload from "@/components/AttachmentUpload/file/index.vue";
import ImageUpload from "@/components/AttachmentUpload/image/index.vue";
import { getCurrentDate } from "@/utils/index.js";
import { trimZeros } from "@/utils/formatNumber.js";
import { listCustomer } from "@/api/basicData/customer.js";
const FileList = defineAsyncComponent(() =>
@@ -1531,10 +1534,7 @@
  });
};
const formattedNumber = (row, column, cellValue) => {
  if (cellValue === undefined || cellValue === null || cellValue === "") {
    return "0.000000";
  }
  return parseFloat(cellValue).toFixed(6);
  return trimZeros(cellValue, 6);
};
const findLedgerRecordByRow = (row) => {
  if (!row) return null;
@@ -1694,9 +1694,9 @@
    param,
    ["contractAmount", "taxInclusiveTotalPrice", "taxExclusiveTotalPrice"],
    {
      contractAmount: { decimalPlaces: 6 },
      taxInclusiveTotalPrice: { decimalPlaces: 6 },
      taxExclusiveTotalPrice: { decimalPlaces: 6 },
      contractAmount: { decimalPlaces: 6, trimZeros: true },
      taxInclusiveTotalPrice: { decimalPlaces: 6, trimZeros: true },
      taxExclusiveTotalPrice: { decimalPlaces: 6, trimZeros: true },
    }
  );
};
@@ -1710,9 +1710,9 @@
      "taxExclusiveTotalPrice",
    ],
    {
      taxInclusiveUnitPrice: { decimalPlaces: 6 },
      taxInclusiveTotalPrice: { decimalPlaces: 6 },
      taxExclusiveTotalPrice: { decimalPlaces: 6 },
      taxInclusiveUnitPrice: { decimalPlaces: 6, trimZeros: true },
      taxInclusiveTotalPrice: { decimalPlaces: 6, trimZeros: true },
      taxExclusiveTotalPrice: { decimalPlaces: 6, trimZeros: true },
    }
  );
};
@@ -2535,7 +2535,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.quantity) || 0);
  }, 0);
  return total.toFixed(6);
  return trimZeros(total, 6);
};
// 计算产品总金额
@@ -2544,7 +2544,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
  }, 0);
  return total.toFixed(6);
  return trimZeros(total, 6);
};
// 用于打印的计算函数
@@ -2553,7 +2553,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.quantity) || 0);
  }, 0);
  return total.toFixed(6);
  return trimZeros(total, 6);
};
const getTotalAmountForPrint = (products) => {
@@ -2561,7 +2561,7 @@
  const total = products.reduce((sum, product) => {
    return sum + (parseFloat(product.taxInclusiveTotalPrice) || 0);
  }, 0);
  return total.toFixed(6);
  return trimZeros(total, 6);
};
const mathNum = () => {