| | |
| | | placeholder="请输入实际重量" |
| | | /> |
| | | </wd-cell-group> |
| | | <wd-toast /> |
| | | </wd-form> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { useToast } from "wot-design-uni"; |
| | | import WireApi from "@/api/product/wire"; |
| | | |
| | | const paramsId = ref(); |
| | | const toast = useToast(); |
| | | const { form: model } = useFormData({ |
| | | poleNumber: undefined, // 领用杆号 |
| | | poleWeight: undefined, // 客户名称 |
| | | monofilamentNumber: undefined, // 单丝盘号 |
| | | model: undefined, // 规格型号 |
| | | ontLength: undefined, // 盘长 |
| | | oneLength: undefined, // 盘长 |
| | | singleDisc: undefined, // 单丝盘长 |
| | | }); |
| | | |
| | | const submit = async () => { |
| | | const { code } = await WireApi.addWireOutput({ |
| | | wireId: paramsId.value, |
| | | type: "拉丝", |
| | | ...model, |
| | | }); |
| | | if (code == 200) { |
| | | toast.success("提交成功"); |
| | | return true; |
| | | } else { |
| | | toast.error("提交失败"); |
| | | return false; |
| | | } |
| | | }; |
| | | |
| | | onLoad((options: any) => { |
| | | paramsId.value = options.id; |
| | | }); |
| | | |
| | | defineExpose({ |
| | | model, |
| | | submit, |
| | | }); |
| | | </script> |
| | | |