| | |
| | | |
| | | <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 toast = useToast(); |
| | | const { form: model } = useFormData({ |
| | | model: undefined, // 规格型号 |
| | | monofilamentNumber: undefined, // 样品编号 |
| | | amount: undefined, // 数量 |
| | | manufacturers: undefined, // 厂家 |
| | | type: "钢芯", |
| | | }); |
| | | |
| | | const submit = async () => { |
| | | const { code } = await TwistApi.addStrandedWireDish([model]); |
| | | if (code == 200) { |
| | | toast.success("新增成功"); |
| | | emits("refresh"); |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | defineExpose({ |
| | | submit, |
| | | }); |
| | | </script> |
| | | |