YLouie
2025-10-23 8460eac918d8c8e825a0f78ac0af1c03cad8fd49
src/pages/production/wire/report/wireForm.vue
@@ -51,9 +51,9 @@
        clearable
        placeholder="请输入杆包号"
      >
          <template #label>
            <span style="color: #F56C6C">杆包号</span>
          </template>
        <template #label>
          <span style="color: #f56c6c">杆包号</span>
        </template>
      </wd-input>
      <wd-input
        v-model="model.dishModel"
@@ -62,9 +62,9 @@
        clearable
        placeholder="请输入盘型号"
      >
          <template #label>
            <span style="color: #F56C6C">盘型号</span>
          </template>
        <template #label>
          <span style="color: #f56c6c">盘型号</span>
        </template>
      </wd-input>
      <wd-input
        v-model="model.actuallyLength"
@@ -73,9 +73,9 @@
        clearable
        placeholder="请输入实际长度"
      >
          <template #label>
            <span style="color: #F56C6C">实际长度(m)</span>
          </template>
        <template #label>
          <span style="color: #f56c6c">实际长度(m)</span>
        </template>
      </wd-input>
      <wd-input
        v-model="model.actuallyWeight"
@@ -84,9 +84,9 @@
        clearable
        placeholder="请输入实际重量"
      >
          <template #label>
            <span style="color: #F56C6C">实际重量(kg)</span>
          </template>
        <template #label>
          <span style="color: #f56c6c">实际重量(kg)</span>
        </template>
      </wd-input>
    </wd-cell-group>
    <wd-toast />
@@ -116,18 +116,29 @@
});
const submit = async () => {
  // 在调用API前先保存poleNumber的值,确保我们有正确的值
  const poleNumberValue = model.poleNumber;
  const { code } = await WireApi.addWireOutput({
    wireId: paramsId.value,
    type: "拉丝",
    ...model,
  });
  if (code == 200) {
    toast.success("提交成功");
    resetForm()
    return true;
    // 创建返回结果对象,使用提前保存的poleNumber值
    const result = {
      success: true,
      poleNumber: poleNumberValue,
    };
    // 在返回之前执行resetForm()
    resetForm();
    // 返回结果
    return result;
  } else {
    toast.error("提交失败");
    return false;
    return { success: false };
  }
};
@@ -142,7 +153,7 @@
  const arr = code.code.split(",");
  model.poleNumber = arr[3]; //  领用杆号
  model.poleWeight = arr[4]; //  杆重
  model.poleModel = 'Φ' + arr[1].slice(2); //  杆型号
  model.poleModel = arr[2]; //  杆型号
};
onLoad((options: any) => {