gaoluyang
2 天以前 36b909e117c3ccc22dd266a94479e2a02335d261
src/views/productionManagement/productionOrder/index.vue
@@ -3,32 +3,8 @@
    <div class="search_form">
      <el-form :model="searchForm"
               :inline="true">
        <el-form-item label="客户名称:">
          <el-input v-model="searchForm.customerName"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 160px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="合同号:">
          <el-input v-model="searchForm.salesContractNo"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 160px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="产品名称:">
          <el-input v-model="searchForm.productCategory"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
                    style="width: 160px;"
                    @change="handleQuery" />
        </el-form-item>
        <el-form-item label="规格:">
          <el-input v-model="searchForm.specificationModel"
                    placeholder="请输入"
                    clearable
                    prefix-icon="Search"
@@ -93,6 +69,7 @@
    <new-product-order v-if="isShowNewModal"
                         v-model:visible="isShowNewModal"
                         type="qualified"
                         @completed="handleQuery" />
  </div>
</template>
@@ -106,7 +83,7 @@
    productOrderListPage,
    listProcessRoute,
    bindingRoute,
    listProcessBom, delProductOrder,
    listProcessBom, delProductOrder, startOrPause,
  } from "@/api/productionManagement/productionOrder.js";
  import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
  import {fileDel} from "@/api/financialManagement/revenueManagement.js";
@@ -125,16 +102,6 @@
      width: '120px',
    },
    {
      label: "销售合同号",
      prop: "salesContractNo",
      width: '150px',
    },
    {
      label: "客户名称",
      prop: "customerName",
      width: '200px',
    },
    {
      label: "产品名称",
      prop: "productCategory",
      width: '120px',
@@ -143,11 +110,6 @@
      label: "图纸编号",
      prop: "specificationModel",
      width: '160px',
    },
    {
      label: "规格型号",
      prop: "drawingNumber",
      width: '120px',
    },
    {
      label: "工艺路线编号",
@@ -196,8 +158,24 @@
      label: "操作",
      align: "center",
      fixed: "right",
      width: 200,
      width: 240,
      operation: [
        {
          name: "开始",
          type: "text",
          showHide: row => row.status === '待生产',
          clickFun: row => {
            handleStartOrPause(row);
          },
        },
        {
          name: "暂停",
          type: "text",
          showHide: row => row.status === '生产中',
          clickFun: row => {
            handleStartOrPause(row);
          },
        },
        {
          name: "工艺路线",
          type: "text",
@@ -214,7 +192,7 @@
          },
        },
        {
          name: "产品结构",
          name: "物料清单",
          type: "text",
          clickFun: row => {
            showProductStructure(row);
@@ -234,11 +212,8 @@
  const data = reactive({
    searchForm: {
      customerName: "",
      salesContractNo: "",
      projectName: "",
      productCategory: "",
      specificationModel: "",
    },
  });
  const { searchForm } = toRefs(data);
@@ -266,6 +241,8 @@
    if (row.isFh) return '';
    const diff = row.deliveryDaysDiff;
    if (diff === undefined || diff === null || diff === '' || diff < 0) return '';
    if (diff === 15) {
      return 'yellow';
    } else if (diff === 10) {
@@ -372,11 +349,12 @@
    const orderId = row.id;
    try {
      const res = await getOrderProcessRouteMain(orderId);
      const data = res.data || {};
      if (!data || !data.id) {
      const dataList = res.data || [];
      if (!dataList || dataList.length === 0 || !dataList[0].id) {
        proxy.$modal.msgWarning("未找到关联的工艺路线");
        return;
      }
      const data = dataList[0];
      router.push({
        path: "/productionManagement/processRouteItem",
        query: {
@@ -397,12 +375,37 @@
    }
  };
  const showProductStructure = row => {
  const handleStartOrPause = async (row) => {
    const operation = row.status === '待生产' ? 1 : 2;
    const operationText = operation === 1 ? "开始" : "暂停";
    try {
      await startOrPause({ id: row.id, operation });
      proxy.$modal.msgSuccess(`${operationText}成功`);
      getList();
    } catch (e) {
      console.error(`${operationText}失败:`, e);
      proxy.$modal.msgError(`${operationText}失败`);
    }
  };
  const showProductStructure = async row => {
    let bomNo = row.bomNo || "";
    if (!bomNo && row.id) {
      try {
        const res = await getOrderProcessRouteMain(row.id);
        const dataList = res.data || [];
        if (dataList && dataList.length > 0 && dataList[0].bomNo) {
          bomNo = dataList[0].bomNo;
        }
      } catch (e) {
        console.error("获取BOM编号失败:", e);
      }
    }
    router.push({
      path: "/productionManagement/productStructureDetail",
      query: {
        id: row.id,
        bomNo: row.bomNo || "",
        bomNo: bomNo,
        drawingNumber: row.drawingNumber || "",
        productName: row.productCategory || "",
        productModelName: row.specificationModel || "",
@@ -466,19 +469,19 @@
  align-items: start;
}
::v-deep .yellow {
:deep(.yellow) {
  background-color: #FAF0DE;
}
::v-deep .pink {
:deep(.pink) {
  background-color: #FAE1DE;
}
::v-deep .red {
  background-color: #f80202;
:deep(.red) {
  background-color: #FFCCCC;
}
::v-deep .purple{
:deep(.purple){
  background-color: #F4DEFA;
}
</style>