huminmin
8 天以前 ada2de76afaa9c884a860786ea97992f97dadff0
Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂
已修改3个文件
138 ■■■■ 文件已修改
src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/components/ProcessFlowConfigSelectDialog.vue
@@ -8,10 +8,28 @@
  >
    <el-row :gutter="20">
      <el-col :span="24">
        <div style="font-weight: 600; margin-bottom: 8px;">配置</div>
        <div style="font-size: 12px; margin-bottom: 8px;">
          <span v-if="boundRouteName" style="color: #67c23a;">已绑定:{{ boundRouteName }}</span>
          <span v-else style="color: #e6a23c;">未绑定</span>
        <div class="dialog-topbar">
          <div>
            <div style="font-weight: 600; margin-bottom: 8px;">配置</div>
            <div style="font-size: 12px; margin-bottom: 8px;">
              <span v-if="boundRouteName" style="color: #67c23a;">已绑定:{{ boundRouteName }}</span>
              <span v-else style="color: #e6a23c;">未绑定</span>
            </div>
          </div>
          <div class="export-toolbar">
            <el-date-picker
              v-model="exportDateRange"
              type="daterange"
              value-format="YYYY-MM-DD"
              format="YYYY-MM-DD"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              clearable
              style="width: 280px;"
            />
            <el-button type="success" plain @click="exportSelectedSteps">导出已勾选</el-button>
          </div>
        </div>
        <el-select
          v-model="selectedRouteId"
@@ -46,6 +64,11 @@
            class="process-diagram-segment"
          >
            <div class="process-diagram-node">
              <el-checkbox
                v-model="step.checked"
                class="process-diagram-checkbox"
                @change="() => handleStepCheckedChange(step)"
              />
              <div class="process-diagram-index">{{ idx + 1 }}</div>
              <div class="process-diagram-name">{{ step.processName }}</div>
            </div>
@@ -97,6 +120,7 @@
const routeList = ref([]);
const selectedRouteId = ref(null);
const steps = ref([]);
const exportDateRange = ref([]);
const saving = ref(false);
const normalizeStepsFromApi = (list) => {
@@ -106,6 +130,8 @@
    processId: s.processId ?? s.process_id ?? s.id ?? null,
    processName: s.processName ?? s.process_name ?? s.name ?? "",
    sortNo: s.sortNo ?? idx + 1,
    isCompleted: Number(s.isCompleted ?? s.completed ?? 0),
    checked: Boolean(s.checked ?? false),
  }));
};
@@ -163,6 +189,10 @@
  await fetchRouteSteps(selectedRouteId.value);
};
const handleStepCheckedChange = step => {
  step.checked = Boolean(step.checked);
};
const handleClose = () => {
  emit("update:visible", false);
  saving.value = false;
@@ -182,6 +212,38 @@
  } finally {
    saving.value = false;
  }
};
const exportSelectedSteps = () => {
  const selectedSteps = steps.value.filter(step => step.checked);
  if (selectedSteps.length === 0) {
    proxy?.$modal?.msgWarning?.("请先勾选要导出的工序");
    return;
  }
  const payload = {
    exportDateRange: Array.isArray(exportDateRange.value) ? exportDateRange.value : [],
    routeId: selectedRouteId.value,
    routeName: routeList.value.find(item => String(item.routeId) === String(selectedRouteId.value))?.processRouteName || "",
    steps: selectedSteps.map(step => ({
      processId: step.processId,
      processName: step.processName,
      sortNo: step.sortNo,
      isCompleted: Number(step.isCompleted ?? 0),
    })),
  };
  const blob = new Blob([JSON.stringify(payload, null, 2)], {
    type: "application/json;charset=utf-8",
  });
  const url = URL.createObjectURL(blob);
  const a = document.createElement("a");
  const dateText =
    Array.isArray(exportDateRange.value) && exportDateRange.value.length === 2
      ? `${exportDateRange.value[0]}_${exportDateRange.value[1]}`
      : "all";
  a.href = url;
  a.download = `工艺路线导出_${dateText}.json`;
  a.click();
  URL.revokeObjectURL(url);
};
</script>
@@ -213,6 +275,13 @@
  padding: 10px 12px;
  margin-right: 10px;
  box-sizing: border-box;
  position: relative;
}
.process-diagram-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
}
.process-diagram-index {
@@ -251,5 +320,18 @@
  justify-content: flex-end;
  gap: 10px;
}
</style>
.dialog-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.export-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
</style>
src/views/salesManagement/salesLedger/index.vue
@@ -5263,30 +5263,34 @@
    proxy.$refs["importUploadRef"].submit();
  };
  // 导出
  // 导出(按当前查询条件导出)
  const handleOut = () => {
    if (selectedRows.value.length === 0) {
      proxy.$modal.msgWarning("请至少选择一条数据进行导出");
      return;
    // 构建查询参数(与 getList 保持一致)
    const { entryDate, ...rest } = searchForm;
    const params = { ...rest };
    // 处理录入日期范围
    if (entryDate && entryDate.length === 2) {
      params.entryDateStart = entryDate[0];
      params.entryDateEnd = entryDate[1];
    }
    const hasUnapproved = selectedRows.value.some(
      row => Number(row.reviewStatus) !== 1
    // 处理客户名称查询
    const selectedCustomer = (customerOption.value || []).find(
      item => String(item?.id ?? "") === String(params.customerId ?? "")
    );
    if (hasUnapproved) {
      proxy.$modal.msgWarning("选中的数据中包含未审核项,无法导出");
      return;
    if (selectedCustomer?.customerName) {
      params.customerName = String(selectedCustomer.customerName).trim();
    }
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        proxy.download("/sales/ledger/export", {}, "销售台账.xlsx");
      })
      .catch(() => {
        proxy.$modal.msg("已取消");
      });
    delete params.customerId;
    // 处理产品宽高查询参数
    const widthValue = params.width != null ? String(params.width).trim() : "";
    const heightValue = params.height != null ? String(params.height).trim() : "";
    if (!widthValue) delete params.width;
    if (!heightValue) delete params.height;
    proxy.download("/sales/ledger/exportWithProducts", params, "销售台账.xlsx");
  };
  /** 判断单个产品是否已发货(根据shippingStatus判断,已发货或审核通过不可编辑和删除) */
  const isProductShipped = product => {
vite.config.js
@@ -8,7 +8,7 @@
  const { VITE_APP_ENV } = env;
  const baseUrl =
      env.VITE_APP_ENV === "development"
          ? "http://1.15.17.182:9003"
          ? "http://192.168.0.15:9009"
          : env.VITE_BASE_API;
  const javaUrl =
      env.VITE_APP_ENV === "development"