
<template>
    <layout-form>
        <el-form :model="form" :loading="loading" :rules="rules" size='small' label-width='100px' ref="form">
            <el-row>
                <Field label="物料ID" prop="materiaId" v-model="form.materiaId" />
                <Field label="供应商ID" prop="supplierId" v-model="form.supplierId" />
                <Field label="交货期" prop="deliveryPeriod" v-model="form.deliveryPeriod" />
                <Field label="交货期单位" prop="deliveryPeriodUnit" v-model="form.deliveryPeriodUnit" :enumData='dict.deliveryPeriodUnit' type='select' />
                <Field label="供应商物料代码" prop="supplierMateriaCode" v-model="form.supplierMateriaCode" />
                <Field label="计量单位" prop="unitOfMeasure" v-model="form.unitOfMeasure" />
                <Field label="供货成本" prop="costPlan" v-model="form.costPlan" />
            </el-row>
            <form-buttons @submit='submitForm' />
        </el-form>
    </layout-form>
</template>

<script>
import form from "@/assets/mixins/form";
export default {
    mixins: [form],
    data() {
        return {
            toString: ["deliveryPeriodUnit"],
            rules: {
                materiaId: [
                    {
                        required: true,
                        message: "请输入物料ID",
                        trigger: "blur",
                    },
                ],
                supplierId: [
                    {
                        required: true,
                        message: "请输入供应商ID",
                        trigger: "blur",
                    },
                ],
                deliveryPeriod: [
                    {
                        required: true,
                        message: "请输入交货期",
                        trigger: "blur",
                    },
                ],
                deliveryPeriodUnit: [
                    {
                        required: true,
                        message: "请选择交货期单位",
                        trigger: "blur",
                    },
                ],
                unitOfMeasure: [
                    {
                        required: true,
                        message: "请输入计量单位",
                        trigger: "blur",
                    },
                ],
                costPlan: [
                    {
                        required: true,
                        message: "请输入供货成本",
                        trigger: "blur",
                    },
                ],
            },
        };
    },
};
</script>
