liyong
2026-05-06 8024273d640673e504cd7914f010d3bfb2a95b38
src/views/productionManagement/processRoute/processRouteItem/index.vue
@@ -38,6 +38,15 @@
            <span class="info-value">{{ routeInfo.bomNo || '-' }}</span>
          </div>
        </div>
        <div class="info-item"
             v-if="routeInfo.quantity && routeInfo.quantity !== 0">
          <div class="info-label-wrapper">
            <span class="info-label">需求数量</span>
          </div>
          <div class="info-value-wrapper">
            <span class="info-value">{{ routeInfo.quantity || '-' }}</span>
          </div>
        </div>
        <div class="info-item full-width"
             v-if="routeInfo.description">
          <div class="info-label-wrapper">
@@ -59,7 +68,8 @@
                   style="margin-right: 10px;">
          卡片视图
        </el-button>
        <el-button type="primary"
        <el-button v-if="editable"
                   type="primary"
                   @click="handleAdd">新增</el-button>
      </div>
    </div>
@@ -124,12 +134,12 @@
                     link
                     size="small"
                     @click="handleEdit(scope.row)"
                     :disabled="scope.row.isComplete">编辑</el-button>
                     :disabled="scope.row.isComplete || !editable">编辑</el-button>
          <el-button type="danger"
                     link
                     size="small"
                     @click="handleDelete(scope.row)"
                     :disabled="scope.row.isComplete">删除</el-button>
                     :disabled="scope.row.isComplete || !editable">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -143,7 +153,8 @@
                     style="margin-right: 10px;">
            表格视图
          </el-button>
          <el-button type="primary"
          <el-button v-if="editable"
                     type="primary"
                     @click="handleAdd">新增</el-button>
        </div>
      </div>
@@ -187,7 +198,7 @@
                         link
                         size="small"
                         @click="handleEdit(item)"
                         :disabled="item.isComplete">编辑</el-button>
                         :disabled="item.isComplete || !editable">编辑</el-button>
              <el-button type="info"
                         link
                         size="small"
@@ -196,7 +207,7 @@
                         link
                         size="small"
                         @click="handleDelete(item)"
                         :disabled="item.isComplete">删除</el-button>
                         :disabled="item.isComplete || !editable">删除</el-button>
            </div>
          </div>
        </div>
@@ -206,8 +217,8 @@
    <div class="section-header"
         style="margin-top: 20px;">
      <div class="section-title">BOM 结构</div>
      <!-- <div class="section-actions"
           v-if="pageType === 'order'">
      <div class="section-actions"
           v-if="pageType === 'order' && editable">
        <el-button v-if="!bomDataValue.isEdit"
                   type="primary"
                   @click="bomDataValue.isEdit = true">
@@ -223,7 +234,7 @@
                   :loading="bomDataValue.loading">
          保存BOM
        </el-button>
      </div> -->
      </div>
    </div>
    <el-table :data="bomTableData"
              border
@@ -293,6 +304,7 @@
                                     :step="1"
                                     controls-position="right"
                                     style="width: 100%"
                                     @change="handleUnitQuantityChange(row)"
                                     :disabled="!bomDataValue.isEdit || bomDataValue.dataList.some(item => (item).tempId === row.tempId)" />
                  </el-form-item>
                </template>
@@ -437,7 +449,6 @@
                         @confirm="handleProductSelect"
                         single />
    <!-- 参数列表对话框 -->
    <!-- :editable="!routeInfo.status" -->
    <ProcessParamListDialog v-model="showParamListDialog"
                            :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 参数列表`"
                            :route-id="routeId"
@@ -445,6 +456,7 @@
                            :process="currentProcess"
                            :page-type="pageType"
                            :param-list="paramList"
                            :editable="editable"
                            @getsyncProcessParamItem="getsyncProcessParamItem"
                            @refresh="refreshParamList" />
  </div>
@@ -486,7 +498,7 @@
  import {
    queryList,
    queryList2,
    addBomDetail,
    add2,
  } from "@/api/productionManagement/productStructure.js";
  import { useRoute } from "vue-router";
@@ -499,6 +511,7 @@
  const routeId = computed(() => route.query.id);
  const orderId = computed(() => route.query.orderId);
  const pageType = computed(() => route.query.type);
  const editable = computed(() => route.query.editable !== "false");
  const tableLoading = ref(false);
  const tableData = ref([]);
@@ -516,6 +529,7 @@
    model: "",
    bomNo: "",
    description: "",
    quantity: 0,
  });
  const processOptions = ref([]);
@@ -646,6 +660,7 @@
      bomNo: route.query.bomNo || "",
      bomId: route.query.bomId || "",
      description: route.query.description || "",
      quantity: route.query.quantity || 0,
      status: !(route.query.status == 1 || route.query.status === "false"),
    };
    bomTableData.value[0].productName = routeInfo.value.productName;
@@ -831,15 +846,19 @@
  // 查看参数列表
  const handleViewParams = row => {
    currentProcess.value = row;
    const query = {
    const param = {
      productionOrderRoutingOperationId: row.id,
      productionOrderId: orderId.value,
    };
    const param1 = {
      technologyRoutingOperationId: row.id,
      productionOrderId: orderId.value,
    };
    const apiPromise =
      pageType.value === "order"
        ? findProcessParamListOrder(query)
        : getProcessParamList(query);
        ? findProcessParamListOrder(param)
        : getProcessParamList(param1);
    apiPromise
      .then(res => {
@@ -862,6 +881,7 @@
  // 初始化拖拽排序
  const initSortable = () => {
    destroySortable();
    if (!editable.value) return;
    if (viewMode.value === "table") {
      // 表格视图的拖拽排序
@@ -1166,6 +1186,12 @@
    });
  };
  const handleUnitQuantityChange = row => {
    if (routeInfo.value.quantity && routeInfo.value.quantity !== 0) {
      row.demandedQuantity = (row.unitQuantity || 0) * routeInfo.value.quantity;
    }
  };
  const addchildItem = (item, tempId) => {
    if (item.tempId === tempId) {
      if (!item.children) {
@@ -1184,7 +1210,10 @@
          "",
        operationName: "",
        unitQuantity: 1,
        demandedQuantity: 0,
        demandedQuantity:
          routeInfo.value.quantity && routeInfo.value.quantity !== 0
            ? 1 * routeInfo.value.quantity
            : 0,
        children: [],
        unit: "",
        tempId: new Date().getTime(),
@@ -1220,7 +1249,10 @@
            "",
          operationName: "",
          unitQuantity: 1,
          demandedQuantity: 0,
          demandedQuantity:
            routeInfo.value.quantity && routeInfo.value.quantity !== 0
              ? 1 * routeInfo.value.quantity
              : 0,
          unit: "",
          children: [],
          tempId: new Date().getTime(),
@@ -1295,8 +1327,9 @@
    const valid = validateAllBom();
    if (valid) {
      addBomDetail({
        bomId: Number(routeInfo.value.bomId),
      add2({
        // bomId: Number(routeInfo.value.bomId),
        productionOrderBomId: Number(routeInfo.value.bomId) || null,
        children: buildSubmitTree(bomDataValue.value.dataList || []),
      })
        .then(() => {