曹睿
2025-05-21 15d3b001720d3baa8a30f5f6a105a6809e9ec063
src/pages/production/twist/receive/steelCore/form.vue
@@ -39,12 +39,40 @@
<script lang="ts" setup>
import useFormData from "@/hooks/useFormData";
import TwistApi from "@/api/product/twist";
import { useToast } from "wot-design-uni";
const emits = defineEmits(["refresh"]);
const paramsId = ref();
const toast = useToast();
const { form: model } = useFormData({
  model: undefined, // 规格型号
  monofilamentNumber: undefined, // 样品编号
  amount: undefined, // 数量
  manufacturers: undefined, // 厂家
  type: "钢芯",
});
const submit = async () => {
  const { code } = await TwistApi.addStrandedWireDish([
    {
      wireId: paramsId.value,
      ...model,
    },
  ]);
  if (code == 200) {
    toast.success("新增成功");
    emits("refresh");
    return true;
  }
};
onLoad((options: any) => {
  paramsId.value = options.id;
});
defineExpose({
  submit,
});
</script>