src/views/salesManagement/salesLedger/index.vue
@@ -86,9 +86,7 @@
              :data="props.row.children"
              border
              show-summary
              :summary-method="
                (param) => summarizeChildrenTable(param, props.row)
              "
              :summary-method="summarizeChildrenTable"
            >
              <el-table-column align="center" label="序号" type="index" />
              <el-table-column label="产品大类" prop="productCategory" />
@@ -158,17 +156,17 @@
              <el-table-column
                label="含税单价(元)"
                prop="taxInclusiveUnitPrice"
                :formatter="sensitiveAmountFormatter"
                :formatter="formattedNumber"
              />
              <el-table-column
                label="含税总价(元)"
                prop="taxInclusiveTotalPrice"
                :formatter="sensitiveAmountFormatter"
                :formatter="formattedNumber"
              />
              <el-table-column
                label="不含税总价(元)"
                prop="taxExclusiveTotalPrice"
                :formatter="sensitiveAmountFormatter"
                :formatter="formattedNumber"
              />
              <!--操作-->
              <el-table-column Width="60px" label="操作" align="center">
@@ -1585,12 +1583,6 @@
};
const canEditLedger = (row) => isCurrentUserMaintainer(row);
const canDeleteLedger = (row) => isCurrentUserMaintainer(row);
const sensitiveAmountFormatter = (row, column, cellValue) => {
  if (!isCurrentUserMaintainer(row)) {
    return "*****";
  }
  return formattedNumber(row, column, cellValue);
};
// 获取tree子数据
const getModels = (value) => {
  productForm.value.productCategory = findNodeById(productOptions.value, value);
@@ -1654,9 +1646,7 @@
// 表格选择数据
const handleSelectionChange = (selection) => {
  // 过滤掉子数据
  selectedRows.value = selection.filter((item) => item.children !== undefined);
  console.log("selection", selectedRows.value);
  selectedRows.value = selection;
};
const productSelected = (selectedRows) => {
  productSelectedRows.value = selectedRows;
@@ -1711,25 +1701,7 @@
  );
};
// 子表合计方法
const summarizeChildrenTable = (param, parentRow) => {
  if (!isCurrentUserMaintainer(parentRow)) {
    const { columns } = param;
    return columns.map((column, index) => {
      if (index === 0) {
        return "合计";
      }
      if (
        [
          "taxInclusiveUnitPrice",
          "taxInclusiveTotalPrice",
          "taxExclusiveTotalPrice",
        ].includes(column.property)
      ) {
        return "*****";
      }
      return "";
    });
  }
const summarizeChildrenTable = (param) => {
  return proxy.summarizeTable(
    param,
    [
@@ -2089,13 +2061,22 @@
// 导出
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
  ElMessageBox.confirm(
    "勾选的台账将被导出;未勾选则导出当前搜索条件下的全部台账。是否确认导出?",
    "导出",
    {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    }
  )
    .then(() => {
      proxy.download("/sales/ledger/export", {}, "销售台账.xlsx");
      const { entryDate, ...rest } = searchForm;
      const params = { ...rest };
      if (selectedRows.value.length) {
        params.ids = selectedRows.value.map((item) => item.id);
      }
      proxy.download("/sales/ledger/export", params, "销售台账.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");