gaoluyang
10 天以前 a2c33664f683aee11fdc62391c8d1e21cc74f5b2
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -42,7 +42,7 @@
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="尺寸:"
            <el-form-item label="规格型号:"
                          prop="productModelId">
              <el-select v-model="form.productModelId"
                         placeholder="请选择"
@@ -297,7 +297,7 @@
    };
    testStandardOptions.value = [];
    tableData.value = [];
    // 先确保产品树已加载,否则编辑时产品/尺寸无法反显
    // 先确保产品树已加载,否则编辑时产品/规格型号无法反显
    await getProductOptions();
    if (operationType.value === "edit") {
      // 先保存 testStandardId,避免被清空
@@ -305,7 +305,7 @@
      // 先设置表单数据,但暂时清空 testStandardId,等选项加载完成后再设置
      form.value = { ...row, testStandardId: "" };
      currentProductId.value = row.productId || 0;
      // 关键:编辑时加载尺寸下拉选项,才能反显 productModelId
      // 关键:编辑时加载规格型号下拉选项,才能反显 productModelId
      if (currentProductId.value) {
        try {
          const res = await modelList({ id: currentProductId.value });
@@ -315,7 +315,7 @@
            handleChangeModel(form.value.productModelId);
          }
        } catch (e) {
          console.error("加载尺寸失败", e);
          console.error("加载规格型号失败", e);
          modelOptions.value = [];
        }
      }