<template>
    <layout-form>
        <el-form :model="form" :loading="loading" :rules="rules" size='small' style="width:100%" label-width='120px' ref="form">
            <el-row>
                                    <Field label="用户账号" prop="loginName" v-model="form.loginName" placeholder="请输入用户账号"/>
                        <Field label="密码" prop="password" v-model="form.password" placeholder="请输入密码"/>
                        <Field label="客户类型" prop="custType" v-model="form.custType" type="select" :enumData="dict.custType" placeholder="请选择客户类型"/>
                        <Field label="行业类型" prop="tradeId" v-model="form.tradeId" type="select" :enumData="dict.tradeId" placeholder="请选择行业类型"/>
                        <Field label="客户名称" prop="custName" v-model="form.custName" placeholder="请输入客户名称"/>
                        <Field label="地址" prop="address" v-model="form.address" placeholder="请输入地址"/>
                        <Field label="联系电话" prop="contactTelphone" v-model="form.contactTelphone" placeholder="请输入联系电话"/>
                        <Field label="状态" prop="status" v-model="form.status" type="select" :enumData="dict.status" placeholder="请选择状态"/>
                        <Field label="颁发给用户的访问服务所用的密钥ID" prop="accessKey" v-model="form.accessKey" placeholder="请输入颁发给用户的访问服务所用的密钥ID"/>
            </el-row>

            <form-buttons @submit='submitForm'/>
        </el-form>
    </layout-form>
</template>

<script>
    import form from "@/assets/mixins/form";
    export default {
        mixins: [form],
        components: {
        },
        toString:[
            "custType",
            "tradeId",
            "status",
        ],
        methods: {

        },
        data() {
            return {
                rules: {
                    loginName: [
                        {required: true, trigger: "blur" },
                    ],
                    password: [
                        {required: true, trigger: "blur" },
                    ],
                    custType: [
                        {required: true, type: 'integer',trigger: "blur" },
                    ],
                    tradeId: [
                        {required: true, type: 'integer',trigger: "blur" },
                    ],
                    custName: [
                        {required: true, trigger: "blur" },
                    ],
                    address: [
                        { trigger: "blur" },
                    ],
                    contactTelphone: [
                        {required: true, trigger: "blur" },
                    ],
                    status: [
                        {required: true, type: 'integer',trigger: "blur" },
                    ],
                    accessKey: [
                        {required: true, trigger: "blur" },
                    ],
                }
            };
        }
    };
</script>