gongchunyi
6 天以前 7a40bd827a87152998a36694da6155b690008d66
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -411,7 +411,11 @@
          modelOptions.value = res || [];
          // 同步回填 model / unit(有些接口返回的 row 里可能没带全)
          if (form.value.productModelId) {
            handleChangeModel(form.value.productModelId);
            const selectedModel = modelOptions.value.find(item => item.id == form.value.productModelId);
            if (selectedModel) {
              form.value.model = selectedModel.model || "";
              form.value.unit = selectedModel.unit || "";
            }
          }
        } catch (e) {
          console.error("加载规格型号失败", e);
@@ -423,6 +427,7 @@
        // 先加载指标选项
        let params = {
          productId: currentProductId.value,
          productModelId: form.value.productModelId || undefined,
          inspectType: 1,
          process: form.value.process || "",
        };
@@ -497,6 +502,8 @@
      modelOptions.value.find(item => item.id == value)?.model || "";
    form.value.unit =
      modelOptions.value.find(item => item.id == value)?.unit || "";
    // 规格型号变化后按 产品+规格型号 重新过滤可选指标
    getList(value);
  };
  const handleQualifiedQuantityChange = (value) => {
@@ -591,7 +598,7 @@
      }
    });
  };
  const getList = () => {
  const getList = (modelId) => {
    if (!currentProductId.value) {
      testStandardOptions.value = [];
      tableData.value = [];
@@ -600,6 +607,7 @@
    const processName = form.value.process || "";
    let params = {
      productId: currentProductId.value,
      productModelId: modelId ?? form.value.productModelId ?? undefined,
      inspectType: 1,
      process: processName,
    };