1
yyb
13 小时以前 57bcf0bc0dad6758df94717963187d6b6122afaa
src/views/salesManagement/salesLedger/index.vue
@@ -118,8 +118,8 @@
            </el-button>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item command="notShipped">未发货</el-dropdown-item>
                <el-dropdown-item command="shipped">已发货</el-dropdown-item>
                <el-dropdown-item command="notShipped">未出库</el-dropdown-item>
                <el-dropdown-item command="shipped">已出库</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
@@ -158,7 +158,7 @@
                style="width: 100%"
                :summary-method="summarizeMainTable"
                @expand-change="expandChange"
                height="calc(100vh - 18.5em)">
                height="calc(100vh - 22em)">
        <el-table-column align="center"
                         type="selection"
                         width="55"
@@ -2908,7 +2908,15 @@
    notShipped: "/sales/ledger/salesHistory/notShippingImport",
    shipped: "/sales/ledger/salesHistory/shippingImport",
  };
  const HISTORY_IMPORT_TEMPLATE_URL_MAP = {
    notShipped: "/sales/ledger/salesHistory/notShippingImportTemplate",
    shipped: "/sales/ledger/salesHistory/shippingImportTemplate",
  };
  const HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP = {
    notShipped: "销售发货历史数据导入模板-未发货.xlsx",
    shipped: "销售发货历史数据导入模板-已发货.xlsx",
  };
  const currentImportCommand = ref("default");
  const changeDaterange = value => {
    if (value) {
      searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
@@ -3875,18 +3883,29 @@
  };
  // 导入
  const handleImport = () => {
    currentImportCommand.value = "default";
    openImportDialog("导入销售台账", "/sales/ledger/import");
  };
  // 历史迁移
  const handleHistoryImportCommand = command => {
    const url = HISTORY_IMPORT_URL_MAP[command];
    if (!url) return;
    const title = command === "shipped" ? "历史迁移-已发货" : "历史迁移-未发货";
    currentImportCommand.value = command;
    const title = command === "shipped" ? "历史迁移-已出库" : "历史迁移-未出库";
    openImportDialog(title, url);
  };
  // 下载导入模板
  const downloadTemplate = () => {
    const command = currentImportCommand.value;
    if (command && command !== "default") {
      const templateUrl = HISTORY_IMPORT_TEMPLATE_URL_MAP[command];
      const fileName = HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP[command];
      if (templateUrl) {
        proxy.download(templateUrl, {}, fileName || "销售发货历史数据导入模板.xlsx");
        return;
      }
    }
    proxy.download("/sales/ledger/exportTemplate", {}, "销售台账导入模板.xlsx");
  };
  const onClose = () => {