gongchunyi
2026-06-18 cd1f2d9605c2e208bb7e70f5d3bc83b45a9ec8a6
src/views/salesManagement/salesLedger/index.vue
@@ -847,6 +847,7 @@
            <el-button type="primary"
                       plain
                       @click="handleImport">导入</el-button>
            <el-button @click="handleOut">导出</el-button>
          </el-space>
          <el-space v-else-if="activeStatusTab === 'reviewed'"
                    wrap
@@ -863,6 +864,7 @@
            <el-button type="primary"
                       @click="handleBulkDelivery"
                       :disabled="isBatchButtonDisabled('delivery')">发货</el-button>
            <el-button @click="handleOut">导出</el-button>
            <el-date-picker v-model="processRouteExportDateRange"
                            type="datetimerange"
                            range-separator="至"
@@ -887,6 +889,7 @@
            <el-button type="primary"
                       @click="handleBulkDelivery"
                       :disabled="isBatchButtonDisabled('delivery')">发货</el-button>
            <el-button @click="handleOut">导出</el-button>
          </el-space>
          <el-space v-else-if="activeStatusTab === 'delivered'"
                    wrap
@@ -897,12 +900,12 @@
            <el-button type="primary"
                       @click="handleReverseAudit"
                       :disabled="isBatchButtonDisabled('reverseAudit')">反审</el-button>
            <el-button @click="handleOut">导出</el-button>
          </el-space>
          <el-space v-else-if="activeStatusTab === 'completed'"
                    wrap
                    class="sales-ledger-toolbar-group">
            <el-button @click="handleOut"
                       :disabled="isBatchButtonDisabled('export')">导出</el-button>
            <el-button @click="handleOut">导出</el-button>
            <el-button type="primary"
                       plain
                       @click="handlePrintCommand('salesOrder')"
@@ -911,6 +914,11 @@
                       plain
                       @click="handlePrintLabel"
                       :disabled="isBatchButtonDisabled('print')">打印标签</el-button>
          </el-space>
          <el-space v-else-if="activeStatusTab === 'all'"
                    wrap
                    class="sales-ledger-toolbar-group">
            <el-button @click="handleOut">导出</el-button>
          </el-space>
          <el-space wrap class="sales-ledger-toolbar-group sales-ledger-toolbar-group--muted">
            <el-dropdown @command="handleHistoryImportCommand">
@@ -2996,12 +3004,19 @@
  });
  const getPinnedProductPrefill = async () => {
    if (!pinnedProductTemplate.value) return {};
    await getProductOptions();
    if (!pinnedProductTemplate.value) {
      const models = await modelList({});
      modelOptions.value = models || [];
      return {};
    }
    if (pinnedProductTemplate.value.__productCategoryId) {
      const models = await modelList({
        id: pinnedProductTemplate.value.__productCategoryId,
      });
      modelOptions.value = models || [];
    } else {
      const models = await modelList({});
      modelOptions.value = models || [];
    }
    return { ...pinnedProductTemplate.value };
@@ -3838,8 +3853,9 @@
    shipped: "销售发货历史数据导入模板-已发货.xlsx",
  };
  const currentImportCommand = ref("default");
  const activeStatusTab = ref("pendingReview");
  const activeStatusTab = ref("all");
  const salesLedgerStatusTabs = [
    { key: "all", label: "全部" },
    { key: "pendingReview", label: "未审核" },
    { key: "reviewed", label: "已审核" },
    { key: "reverseReviewed", label: "反审核" },
@@ -3859,6 +3875,8 @@
    activeStatusTab.value = tabKey;
    resetStatusFilters();
    switch (tabKey) {
      case "all":
        break;
      case "pendingReview":
        searchForm.reviewStatus = 0;
        break;
@@ -4431,20 +4449,30 @@
  };
  // 获取tree子数据
  const getModels = value => {
    // 产品大类变化时,重置规格型号与厚度,避免旧值残留
    productForm.value.productModelId = null;
    productForm.value.specificationModel = "";
    productForm.value.thickness = null;
    if (!value) {
      productForm.value.productCategory = "";
      modelOptions.value = [];
      modelList({}).then(res => {
        modelOptions.value = res || [];
      });
      return;
    }
    productForm.value.productCategory = findNodeById(productOptions.value, value);
    modelList({ id: value }).then(res => {
      modelOptions.value = res || [];
      const currentModelId = productForm.value.productModelId;
      if (currentModelId) {
        const isValid = modelOptions.value.some(item => item.id === currentModelId);
        if (!isValid) {
          productForm.value.productModelId = null;
          productForm.value.specificationModel = "";
          productForm.value.thickness = null;
        }
      } else {
        productForm.value.productModelId = null;
        productForm.value.specificationModel = "";
        productForm.value.thickness = null;
      }
    });
  };
  const getProductModel = value => {
@@ -4463,6 +4491,12 @@
        modelThickness === ""
          ? null
          : Number(modelThickness);
      const categoryId = selectedModel?.productId;
      if (categoryId && productForm.value.__productCategoryId !== categoryId) {
        productForm.value.__productCategoryId = categoryId;
        productForm.value.productCategory = findNodeById(productOptions.value, categoryId);
      }
    } else {
      productForm.value.specificationModel = null;
      productForm.value.thickness = null;