spring
8 天以前 20dbdee5a002544f6a4e12b5e39e338052418782
src/pages/production/wire/report/wire.vue
@@ -150,11 +150,12 @@
              label-width="100px"
              placeholder="请输入领用杆号"
            />
            <wd-input
            <wd-picker
              v-model="newParentData.poleModel"
              label="杆型号"
              label-width="100px"
              placeholder="请输入杆型号"
              :columns="poleModelOptions"
              placeholder="请选择杆型号"
            />
            <wd-input
              v-model="newParentData.polePackageNumber"
@@ -220,6 +221,9 @@
const paramsId = ref();
const model = ref();
const oneLength = ref();
const isMonofil = ref();
const meterWeight = ref();
const totalWeight = ref();
// 父级数据列表
const parentDataList = ref<any[]>([]);
@@ -228,6 +232,10 @@
// 供应商选项
const supplierOptions = ref<any[]>([]);
// 规格型号选项
const poleModelOptions = ref<any[]>([]);
// 父级物料编码
const materialCode = ref<string>("");
// 父级弹框相关
const parentDialogVisible = ref(false);
@@ -258,8 +266,25 @@
    const { data } = await WireDetailApi.getWireDetailById({ id });
    model.value = data.model;
    oneLength.value = data.oneLength;
    await loadPoleModelOptions();
  } catch (error) {
    console.error("获取详情失败:", error);
  }
};
// 加载规格型号列表
const loadPoleModelOptions = async () => {
  try {
    const { code, data } = await WireApi.getMaterialByParentCode("003001");
    if (code == 200 && Array.isArray(data)) {
      poleModelOptions.value = data.map((item: any) => ({
        label: item.specificationModel || "",
        value: item.specificationModel || "",
      }));
    }
  } catch (error) {
    console.error("加载规格型号列表失败:", error);
    toast.error("加载规格型号列表失败");
  }
};
@@ -496,8 +521,11 @@
  }
  // 跳转到报工管理页面
  const isMonofilParam = isMonofil.value !== undefined && isMonofil.value !== null ? isMonofil.value : "";
  const meterWeightParam = meterWeight.value !== undefined && meterWeight.value !== null ? meterWeight.value : "";
  const totalWeightParam = totalWeight.value !== undefined && totalWeight.value !== null ? totalWeight.value : "";
  uni.navigateTo({
    url: `/pages/production/wire/report/reportManage?wireId=${paramsId.value}&parentId=${parentRow.id}&poleNumber=${parentRow.poleNumber}&poleModel=${parentRow.poleModel}&polePackageNumber=${parentRow.polePackageNumber}&poleWeight=${parentRow.poleWeight}&supplier=${parentRow.supplier || ""}`,
    url: `/pages/production/wire/report/reportManage?wireId=${paramsId.value}&parentId=${parentRow.id}&poleNumber=${parentRow.poleNumber}&poleModel=${parentRow.poleModel}&polePackageNumber=${parentRow.polePackageNumber}&poleWeight=${parentRow.poleWeight}&supplier=${parentRow.supplier || ""}&isMonofil=${isMonofilParam}&meterWeight=${meterWeightParam}&totalWeight=${totalWeightParam}`,
  });
};
@@ -590,6 +618,11 @@
onLoad(async (options: any) => {
  paramsId.value = options.id;
  model.value = options.model;
  oneLength.value = options.oneLength;
  isMonofil.value = options.isMonofil;
  meterWeight.value = options.meterWeight;
  totalWeight.value = options.totalWeight;
  await getDetailData(options.id);
  await loadSupplierDict();
  await getData();