zhangwencui
2026-04-25 93d2a0bd19ffb1d86c6807a4d93d0eff580c14f1
src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -80,7 +80,7 @@
                       prop="technologyOperationId"
                       width="200">
        <template #default="scope">
          {{ getProcessName(scope.row.technologyOperationId) || '-' }}
          {{ scope.row.technologyOperationName || scope.row.operationName || '-' }}
        </template>
      </el-table-column>
      <el-table-column label="参数列表"
@@ -158,7 +158,7 @@
            <!-- 序号圆圈 -->
            <div class="card-header">
              <div class="card-number">{{ index + 1 }}</div>
              <div class="card-process-name">{{ getProcessName(item.technologyOperationId) || '-' }}</div>
              <div class="card-process-name">{{ item.technologyOperationName || item.operationName || '-' }}</div>
            </div>
            <!-- 产品信息 -->
            <div class="card-content">
@@ -206,7 +206,7 @@
    <div class="section-header"
         style="margin-top: 20px;">
      <div class="section-title">BOM 结构</div>
      <div class="section-actions"
      <!-- <div class="section-actions"
           v-if="pageType === 'order'">
        <el-button v-if="!bomDataValue.isEdit"
                   type="primary"
@@ -223,7 +223,7 @@
                   :loading="bomDataValue.loading">
          保存BOM
        </el-button>
      </div>
      </div> -->
    </div>
    <el-table :data="bomTableData"
              border
@@ -369,6 +369,7 @@
               :rules="rules"
               label-width="120px">
        <el-form-item label="工序"
                      v-if="operationType === 'add' || pageType === 'route'"
                      prop="technologyOperationId">
          <el-select v-model="form.technologyOperationId"
                     placeholder="请选择工序"
@@ -381,7 +382,12 @@
                       :value="process.id" />
          </el-select>
        </el-form-item>
        <el-form-item label="工序"
                      v-else>
          <span>{{ getProcessName(form.technologyOperationId) }}</span>
        </el-form-item>
        <el-form-item label="产品名称"
                      v-if="operationType === 'add' || pageType === 'route'"
                      prop="productModelId">
          <el-button type="primary"
                     @click="showProductSelectDialog = true">
@@ -390,12 +396,21 @@
              : '选择产品' }}
          </el-button>
        </el-form-item>
        <el-form-item label="产品名称"
                      v-else>
          <span>{{ form.productName }}{{ form.model ? ' - ' + form.model : '' }}</span>
        </el-form-item>
        <el-form-item label="单位"
                      v-if="operationType === 'add' || pageType === 'route'"
                      prop="unit">
          <el-input v-model="form.unit"
                    :placeholder="form.productModelId ? '根据选择的产品自动带出' : '请先选择产品'"
                    clearable
                    :disabled="true" />
        </el-form-item>
        <el-form-item label="单位"
                      v-else>
          <span>{{ form.unit }}</span>
        </el-form-item>
        <el-form-item label="是否质检"
                      prop="isQuality">
@@ -424,7 +439,7 @@
    <!-- 参数列表对话框 -->
    <!-- :editable="!routeInfo.status" -->
    <ProcessParamListDialog v-model="showParamListDialog"
                            :title="`${currentProcess ? (currentProcess.processName || getProcessName(currentProcess.technologyOperationId)) : ''} - 参数列表`"
                            :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 参数列表`"
                            :route-id="routeId"
                            :order-id="orderId"
                            :process="currentProcess"
@@ -470,6 +485,7 @@
  import { listProcessBom } from "@/api/productionManagement/productionOrder.js";
  import {
    queryList,
    queryList2,
    addBomDetail,
  } from "@/api/productionManagement/productStructure.js";
@@ -720,9 +736,11 @@
          const addPromise = isOrderPage
            ? addRouteItem({
                productOrderId: orderId.value,
                productRouteId: routeId.value,
                productionOrderId: Number(orderId.value),
                orderRoutingId: Number(routeId.value),
                technologyOperationId: form.value.technologyOperationId,
                technologyRoutingId: Number(routeId.value),
                operationName: getProcessName(form.value.technologyOperationId),
                productModelId: form.value.productModelId,
                isQuality: form.value.isQuality,
                isProduction: form.value.isProduction,
@@ -757,6 +775,7 @@
            ? addOrUpdateProductProcessRouteItem({
                id: form.value.id,
                technologyOperationId: form.value.technologyOperationId,
                operationName: getProcessName(form.value.technologyOperationId),
                productModelId: form.value.productModelId,
                isQuality: form.value.isQuality,
                isProduction: form.value.isProduction,
@@ -994,7 +1013,8 @@
  });
  const syncProcessOperationFields = item => {
    const processId = item.processId ?? item.operationId ?? "";
    const processId =
      item.processId ?? item.operationId ?? item.technologyOperationId ?? "";
    if (!processId) {
      item.processId = "";
      return;
@@ -1006,7 +1026,11 @@
      option?.name || item.processName || item.operationName || "";
    item.processId = processId;
    item.operationId = processId;
    if (pageType.value === "order") {
      item.technologyOperationId = processId;
    } else {
      item.operationId = processId;
    }
    item.processName = processName;
    item.operationName = processName;
  };
@@ -1041,7 +1065,10 @@
  const fetchBomData = async () => {
    try {
      const { data } = await queryList(routeInfo.value.bomId);
      const isOrderPage = pageType.value === "order";
      const { data } = await (isOrderPage ? queryList2 : queryList)(
        routeInfo.value.bomId
      );
      bomDataValue.value.dataList = data || [];
      normalizeTreeData(bomDataValue.value.dataList);
    } catch (err) {
@@ -1153,7 +1180,8 @@
        productModelId: undefined,
        processId: "",
        processName: "",
        operationId: "",
        [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
          "",
        operationName: "",
        unitQuantity: 1,
        demandedQuantity: 0,
@@ -1188,7 +1216,8 @@
          productModelId: undefined,
          processId: "",
          processName: "",
          operationId: "",
          [pageType.value === "order" ? "technologyOperationId" : "operationId"]:
            "",
          operationName: "",
          unitQuantity: 1,
          demandedQuantity: 0,
@@ -1260,12 +1289,14 @@
  const handleSaveBom = () => {
    bomDataValue.value.loading = true;
    console.log(bomDataValue.value.dataList, "bomDataValue.value.dataList");
    normalizeTreeData(bomDataValue.value.dataList);
    const valid = validateAllBom();
    if (valid) {
      addBomDetail({
        bomId: routeInfo.value.bomId,
        bomId: Number(routeInfo.value.bomId),
        children: buildSubmitTree(bomDataValue.value.dataList || []),
      })
        .then(() => {