<template>
|
<wd-form ref="form" :model="model" class="relative form_box">
|
<wd-cell-group :border="true">
|
<wd-input
|
v-model="model.model"
|
label="规格型号"
|
label-width="100px"
|
prop="model"
|
clearable
|
placeholder="请输入规格型号"
|
/>
|
<wd-input
|
v-model="model.monofilamentNumber"
|
label="样品编号"
|
label-width="100px"
|
prop="monofilamentNumber"
|
clearable
|
placeholder="请输入盘号"
|
/>
|
<wd-input
|
v-model="model.amount"
|
label="数量"
|
label-width="100px"
|
prop="amount"
|
clearable
|
placeholder="请输入长度"
|
/>
|
<wd-input
|
v-model="model.manufacturers"
|
label="厂家"
|
label-width="100px"
|
prop="manufacturers"
|
clearable
|
placeholder="请输入厂家"
|
/>
|
</wd-cell-group>
|
</wd-form>
|
</template>
|
|
<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>
|
|
<style lang="scss" scoped>
|
.form_box {
|
}
|
.submit_btn {
|
position: absolute;
|
bottom: 0;
|
width: 100%;
|
}
|
</style>
|