yyb
8 小时以前 23a2fda728ade70c01976f9624dd410b103c206f
生产订单:注释掉流程路径绑定功能
已修改2个文件
208 ■■■■ 文件已修改
src/views/productionManagement/productionOrder/New.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/index.vue 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionOrder/New.vue
@@ -37,7 +37,7 @@
          <el-input v-model="formState.unit"  disabled />
        </el-form-item>
        <el-form-item label="工艺路线">
        <!-- <el-form-item label="工艺路线">
          <el-select v-model="formState.routeId"
                     placeholder="请选择工艺路线"
                     style="width: 100%;"
@@ -47,7 +47,7 @@
                       :label="`${item.processRouteCode || ''}`"
                       :value="item.id" />
          </el-select>
        </el-form-item>
        </el-form-item> -->
        <el-form-item
            label="需求数量"
@@ -97,6 +97,7 @@
const formState = ref({
  productId: undefined,
  productModelId: undefined,
  // 工艺路线ID:随产品型号切换而重置,由工艺路线下拉框回填
  routeId: undefined,
  productName: "",
  productModelName: "",
@@ -140,14 +141,20 @@
    formState.value.productModelId = product.id;
    formState.value.unit = product.unit;
    showProductSelectDialog.value = false;
    // 选中产品后,按产品型号拉取可用工艺路线并清空旧选择
    fetchRouteOptions( product.id);
    // 触发表单验证更新
    proxy.$refs["formRef"]?.validateField('productModelId');
  }
};
// 当前产品型号可选的工艺路线列表(供 routeId 下拉框展示)
const routeOptions = ref([]);
// 工艺路线绑定查询的加载状态
const bindRouteLoading = ref(false);
// 根据产品型号加载工艺路线:
// 1) 先清空已选工艺路线,避免型号切换后提交旧 routeId
// 2) 再查询并回填 routeOptions,供用户选择
const fetchRouteOptions = (productModelId) => {
  formState.value.routeId = undefined;
  routeOptions.value = []
src/views/productionManagement/productionOrder/index.vue
@@ -65,7 +65,8 @@
        </template>
      </PIMTable>
    </div>
    <el-dialog v-model="bindRouteDialogVisible"
    <!-- 工艺路线绑定弹窗暂时注释 -->
    <!-- <el-dialog v-model="bindRouteDialogVisible"
               title="绑定工艺路线"
               width="500px">
      <el-form label-width="90px">
@@ -89,7 +90,7 @@
          <el-button @click="bindRouteDialogVisible = false">取 消</el-button>
        </span>
      </template>
    </el-dialog>
    </el-dialog> -->
    <new-product-order v-if="isShowNewModal"
                         v-model:visible="isShowNewModal"
@@ -104,11 +105,8 @@
  import { useRouter } from "vue-router";
  import {
    productOrderListPage,
    listProcessRoute,
    bindingRoute,
    listProcessBom, delProductOrder,
  } from "@/api/productionManagement/productionOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  import {fileDel} from "@/api/financialManagement/revenueManagement.js";
  import PIMTable from "@/components/PIMTable/PIMTable.vue";
  const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
@@ -182,20 +180,20 @@
      formatData: val => (val ? dayjs(val).format("YYYY-MM-DD") : ""),
      width: 120,
    },
    {
      dataType: "action",
      label: "操作",
      align: "center",
      fixed: "right",
      width: 200,
      operation: [
        {
          name: "工艺路线",
          type: "text",
          clickFun: row => {
            showRouteItemModal(row);
          },
        },
   // {
   //   dataType: "action",
   //   label: "操作",
   //   align: "center",
   //   fixed: "right",
   //   width: 200,
   //   operation: [
        // {
        //   name: "工艺路线",
        //   type: "text",
        //   clickFun: row => {
        //     showRouteItemModal(row);
        //   },
        // },
        // {
        //   name: "绑定工艺路线",
        //   type: "text",
@@ -211,8 +209,8 @@
        //     showProductStructure(row);
        //   },
        // },
      ],
    },
      //],
    //},
  ]);
  const tableData = ref([]);
  const tableLoading = ref(false);
@@ -268,59 +266,59 @@
    }
  };
  // 绑定工艺路线弹框
  const bindRouteDialogVisible = ref(false);
  const bindRouteLoading = ref(false);
  const bindRouteSaving = ref(false);
  const routeOptions = ref([]);
  const bindForm = reactive({
    orderId: null,
    routeId: null,
  });
  // 工艺路线绑定功能暂时注释
  // const bindRouteDialogVisible = ref(false);
  // const bindRouteLoading = ref(false);
  // const bindRouteSaving = ref(false);
  // const routeOptions = ref([]);
  // const bindForm = reactive({
  //   orderId: null,
  //   routeId: null,
  // });
  const openBindRouteDialog = async row => {
    bindForm.orderId = row.id;
    bindForm.routeId = null;
    bindRouteDialogVisible.value = true;
    routeOptions.value = [];
    if (!row.productModelId) {
      proxy.$modal.msgWarning("当前订单缺少产品型号,无法查询工艺路线");
      bindRouteDialogVisible.value = false;
      return;
    }
    bindRouteLoading.value = true;
    try {
      const res = await listProcessRoute({ productModelId: row.productModelId });
      routeOptions.value = res.data || [];
    } catch (e) {
      console.error("获取工艺路线列表失败:", e);
      proxy.$modal.msgError("获取工艺路线列表失败");
    } finally {
      bindRouteLoading.value = false;
    }
  };
  // const openBindRouteDialog = async row => {
  //   bindForm.orderId = row.id;
  //   bindForm.routeId = null;
  //   bindRouteDialogVisible.value = true;
  //   routeOptions.value = [];
  //   if (!row.productModelId) {
  //     proxy.$modal.msgWarning("当前订单缺少产品型号,无法查询工艺路线");
  //     bindRouteDialogVisible.value = false;
  //     return;
  //   }
  //   bindRouteLoading.value = true;
  //   try {
  //     const res = await listProcessRoute({ productModelId: row.productModelId });
  //     routeOptions.value = res.data || [];
  //   } catch (e) {
  //     console.error("获取工艺路线列表失败:", e);
  //     proxy.$modal.msgError("获取工艺路线列表失败");
  //   } finally {
  //     bindRouteLoading.value = false;
  //   }
  // };
  const handleBindRouteConfirm = async () => {
    if (!bindForm.routeId) {
      proxy.$modal.msgWarning("请选择工艺路线");
      return;
    }
    bindRouteSaving.value = true;
    try {
      await bindingRoute({
        id: bindForm.orderId,
        routeId: bindForm.routeId,
      });
      proxy.$modal.msgSuccess("绑定成功");
      bindRouteDialogVisible.value = false;
      getList();
    } catch (e) {
      console.error("绑定工艺路线失败:", e);
      proxy.$modal.msgError("绑定工艺路线失败");
    } finally {
      bindRouteSaving.value = false;
    }
  };
  // const handleBindRouteConfirm = async () => {
  //   if (!bindForm.routeId) {
  //     proxy.$modal.msgWarning("请选择工艺路线");
  //     return;
  //   }
  //   bindRouteSaving.value = true;
  //   try {
  //     await bindingRoute({
  //       id: bindForm.orderId,
  //       routeId: bindForm.routeId,
  //     });
  //     proxy.$modal.msgSuccess("绑定成功");
  //     bindRouteDialogVisible.value = false;
  //     getList();
  //   } catch (e) {
  //     console.error("绑定工艺路线失败:", e);
  //     proxy.$modal.msgError("绑定工艺路线失败");
  //   } finally {
  //     bindRouteSaving.value = false;
  //   }
  // };
  // 查询列表
  /** 搜索按钮操作 */
@@ -359,33 +357,34 @@
      });
  };
  const showRouteItemModal = async row => {
    const orderId = row.id;
    try {
      const res = await getOrderProcessRouteMain(orderId);
      const data = res.data || {};
      if (!data || !data.id) {
        proxy.$modal.msgWarning("未找到关联的工艺路线");
        return;
      }
      router.push({
        path: "/productionManagement/processRouteItem",
        query: {
          id: data.id,
          processRouteCode: data.processRouteCode || "",
          productName: data.productName || "",
          model: data.model || "",
          bomNo: data.bomNo || "",
          description: data.description || "",
          orderId,
          type: "order",
        },
      });
    } catch (e) {
      console.error("获取工艺路线主信息失败:", e);
      proxy.$modal.msgError("获取工艺路线信息失败");
    }
  };
  // 工艺路线详情入口暂时注释
  // const showRouteItemModal = async row => {
  //   const orderId = row.id;
  //   try {
  //     const res = await getOrderProcessRouteMain(orderId);
  //     const data = res.data || {};
  //     if (!data || !data.id) {
  //       proxy.$modal.msgWarning("未找到关联的工艺路线");
  //       return;
  //     }
  //     router.push({
  //       path: "/productionManagement/processRouteItem",
  //       query: {
  //         id: data.id,
  //         processRouteCode: data.processRouteCode || "",
  //         productName: data.productName || "",
  //         model: data.model || "",
  //         bomNo: data.bomNo || "",
  //         description: data.description || "",
  //         orderId,
  //         type: "order",
  //       },
  //     });
  //   } catch (e) {
  //     console.error("获取工艺路线主信息失败:", e);
  //     proxy.$modal.msgError("获取工艺路线信息失败");
  //   }
  // };
  const showProductStructure = row => {
    router.push({