<template>
|
<wd-form ref="form" :model="model" class="relative form_box">
|
<wd-cell-group :border="true">
|
<wd-input
|
v-model="model.diskMaterial"
|
label="盘具类型"
|
label-width="100px"
|
prop="diskMaterial"
|
clearable
|
placeholder="请输入盘具类型"
|
/>
|
<wd-input
|
v-model="model.model"
|
label="尺寸"
|
label-width="100px"
|
prop="model"
|
clearable
|
placeholder="请输入尺寸"
|
/>
|
<wd-input
|
v-model="model.amount"
|
label="数量"
|
label-width="100px"
|
prop="amount"
|
clearable
|
placeholder="请输入数量"
|
/>
|
<wd-input
|
v-model="model.supplier"
|
label="厂家"
|
label-width="100px"
|
prop="supplier"
|
clearable
|
placeholder="请输入厂家"
|
/>
|
</wd-cell-group>
|
<wd-toast />
|
</wd-form>
|
</template>
|
|
<script setup lang="ts">
|
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({
|
diskMaterial: undefined, // 盘具类型
|
model: undefined, // 尺寸
|
amount: undefined, // 数量
|
supplier: undefined,
|
});
|
|
const submit = async () => {
|
const { code } = await TwistApi.addStrandedWireDish([model]);
|
if (code == 200) {
|
toast.success("新增成功");
|
emits("refresh");
|
return true;
|
}
|
};
|
|
defineExpose({
|
submit,
|
});
|
</script>
|
<style lang="scss" scoped>
|
.form_box {
|
}
|
.submit_btn {
|
position: absolute;
|
bottom: 0;
|
width: 100%;
|
}
|
</style>
|