zhangwencui
2026-06-16 19f0e68b3fe3cf5244a2b936bfef4e0712bdf025
src/views/productionPlan/productionPlan/index.vue
@@ -13,6 +13,14 @@
                    style="width: 160px;"
                    @keyup.enter="handleQuery" />
        </el-form-item>
        <el-form-item label="销售合同号:"
                      prop="salesContractNo">
          <el-input v-model="searchForm.salesContractNo"
                    placeholder="请输入"
                    clearable
                    style="width: 160px;"
                    @keyup.enter="handleQuery" />
        </el-form-item>
        <el-form-item label="需求日期范围:"
                      prop="dateRange">
          <el-date-picker v-model="searchForm.dateRange"
@@ -134,9 +142,10 @@
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="isShowNewModal = false">取消</el-button>
          <el-button type="primary"
                     :loading="mergeSubmitLoading"
                     @click="handleMergeSubmit">确定下发</el-button>
          <el-button @click="isShowNewModal = false">取消</el-button>
        </span>
      </template>
    </el-dialog>
@@ -228,9 +237,9 @@
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary"
                     @click="handleSubmit">确定</el-button>
          <el-button @click="dialogVisible = false">取消</el-button>
        </span>
      </template>
    </el-dialog>
@@ -258,6 +267,7 @@
    productionPlanUpdate,
    productionPlanDelete,
    productionPlanCombine,
    exportProductionPlan,
  } from "@/api/productionPlan/productionPlan.js";
  import { productTreeList, modelListPage } from "@/api/basicData/product.js";
  import PIMTable from "./components/PIMTable.vue";
@@ -269,11 +279,6 @@
  const loadProdData = () => {
    console.log("Mock loadProdData called");
    return Promise.resolve({ code: 200, msg: "同步成功" });
  };
  const exportProductionPlan = () => {
    console.log("Mock exportProductionPlan called");
    return Promise.resolve();
  };
  // const productionPlanCombine = payload => {
@@ -298,6 +303,13 @@
      formatData: params => {
        return params == "销售" ? "销售" : "内部";
      },
    },
    {
      label: "销售合同号",
      prop: "salesContractNo",
      width: "200px",
      dataType: "slot",
      slot: "salesContractNo",
    },
    {
@@ -324,7 +336,6 @@
      label: "所需数量",
      prop: "qtyRequired",
      width: "150px",
      align: "right",
      dataType: "slot",
      slot: "qtyRequired",
      className: "volume-cell",
@@ -373,13 +384,7 @@
      className: "date-cell",
      formatData: cell => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
    },
    {
      label: "销售合同号",
      prop: "salesContractNo",
      width: "200px",
      dataType: "slot",
      slot: "salesContractNo",
    },
    {
      label: "客户名称",
      prop: "customerName",
@@ -407,7 +412,7 @@
          type: "primary",
          link: true,
          showHide: row => {
            return row.status == 0;
            return row.status == 0 && row.source != "销售";
          },
          clickFun: row => {
            handleEdit(row);
@@ -462,6 +467,7 @@
  // 合并下发弹窗控制
  const isShowNewModal = ref(false);
  const mergeSubmitLoading = ref(false);
  // 合并下发表单数据
  const mergeForm = reactive({
    productName: "",
@@ -593,6 +599,7 @@
  const data = reactive({
    searchForm: {
      mpsNo: "",
      salesContractNo: "",
      productName: "",
      model: "",
      status: "",
@@ -621,6 +628,7 @@
    }
    Object.assign(searchForm.value, {
      mpsNo: "",
      salesContractNo: "",
      productName: "",
      model: "",
      status: "",
@@ -772,6 +780,7 @@
    const payload = {
      ...mergeForm,
    };
    mergeSubmitLoading.value = true;
    productionPlanCombine(payload)
      .then(res => {
        if (res.code === 200) {
@@ -787,6 +796,9 @@
      .catch(err => {
        console.error("合并下发异常:", err);
        ElMessage.error("系统异常,合并下发失败");
      })
      .finally(() => {
        mergeSubmitLoading.value = false;
      });
    // 可以选择刷新列表或其他操作
  };