gongchunyi
21 小时以前 0a251e40e30e7c8a96d71b3b9b6c459d4dfa4b22
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"
@@ -88,6 +96,13 @@
        <template #qtyRequired="{ row }">
          {{ row.qtyRequired || '-' }}<span style="color:rgba(12, 46, 40, 0.76)"> {{ row.unit || '方' }}</span>
        </template>
        <template #salesContractNo="{ row }">
          <el-button type="primary"
                     text
                     link
                     @click="showDetail(row)">{{ row.salesContractNo }}
          </el-button>
        </template>
      </PIMTable>
    </div>
    <!-- 合并下发弹窗 -->
@@ -127,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>
@@ -221,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>
@@ -251,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";
@@ -262,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 => {
@@ -293,6 +305,14 @@
      },
    },
    {
      label: "销售合同号",
      prop: "salesContractNo",
      width: "200px",
      dataType: "slot",
      slot: "salesContractNo",
    },
    {
      label: "产品名称",
      prop: "productName",
      width: "200px",
@@ -316,7 +336,6 @@
      label: "所需数量",
      prop: "qtyRequired",
      width: "150px",
      align: "right",
      dataType: "slot",
      slot: "qtyRequired",
      className: "volume-cell",
@@ -365,6 +384,17 @@
      className: "date-cell",
      formatData: cell => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
    },
    {
      label: "客户名称",
      prop: "customerName",
      width: "150px",
    },
    {
      label: "项目名称",
      prop: "projectName",
      width: "150px",
    },
    {
      label: "备注",
      width: "150px",
@@ -382,7 +412,7 @@
          type: "primary",
          link: true,
          showHide: row => {
            return row.status == 0;
            return row.status == 0 && row.source != "销售";
          },
          clickFun: row => {
            handleEdit(row);
@@ -437,6 +467,7 @@
  // 合并下发弹窗控制
  const isShowNewModal = ref(false);
  const mergeSubmitLoading = ref(false);
  // 合并下发表单数据
  const mergeForm = reactive({
    productName: "",
@@ -568,6 +599,7 @@
  const data = reactive({
    searchForm: {
      mpsNo: "",
      salesContractNo: "",
      productName: "",
      model: "",
      status: "",
@@ -596,6 +628,7 @@
    }
    Object.assign(searchForm.value, {
      mpsNo: "",
      salesContractNo: "",
      productName: "",
      model: "",
      status: "",
@@ -720,6 +753,14 @@
    // 打开弹窗
    isShowNewModal.value = true;
  };
  const showDetail = row => {
    router.push({
      path: "/salesManagement/salesLedger",
      query: {
        salesContractNo: row.salesContractNo,
      },
    });
  };
  // 处理合并下发提交
  const handleMergeSubmit = () => {
@@ -739,6 +780,7 @@
    const payload = {
      ...mergeForm,
    };
    mergeSubmitLoading.value = true;
    productionPlanCombine(payload)
      .then(res => {
        if (res.code === 200) {
@@ -754,6 +796,9 @@
      .catch(err => {
        console.error("合并下发异常:", err);
        ElMessage.error("系统异常,合并下发失败");
      })
      .finally(() => {
        mergeSubmitLoading.value = false;
      });
    // 可以选择刷新列表或其他操作
  };