<template>
    <div>
        <el-row :gutter="10">
            <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
                <el-card>
                    <div class="tit">客户基本资料</div>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="客户姓名" prop="field101">
                                <el-input v-model="formData.field101" placeholder="请输入本文行单客户姓名" clearable
                                    :style="{ width: '100%' }"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="客户属性" prop="field103">
                                <el-select v-model="formData.field103" placeholder="请选择客户属性" clearable
                                    :style="{ width: '100%' }">
                                    <el-option v-for="(item, index) in field103Options" :key="index" :label="item.label"
                                        :value="item.value" :disabled="item.disabled"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="上级公司" prop="field104">
                                <el-input v-model="formData.field104" placeholder="请输入上级公司" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="电话" prop="field105">
                                <el-input v-model="formData.field105" placeholder="请输入电话" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="信用度" prop="field106">
                                <el-radio-group v-model="formData.field106" size="medium">
                                    <el-radio v-for="(item, index) in field106Options" :key="index" :label="item.value"
                                        :disabled="item.disabled">{{ item.label }}</el-radio>
                                </el-radio-group>
                            </el-form-item>
                        </el-col>
                        <el-col :span="16">
                            <el-form-item label="客户地址" prop="field107">
                                <el-select v-model="formData.field107" placeholder="请选择客户地址" clearable
                                    :style="{ width: '100%' }">
                                    <el-option v-for="(item, index) in field107Options" :key="index" :label="item.label"
                                        :value="item.value" :disabled="item.disabled"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="24">
                            <el-form-item label="备注" prop="field108">
                                <el-input v-model="formData.field108" type="textarea" placeholder="请输入备注"
                                    :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                            </el-form-item>
                        </el-col>

                    </el-row>
                </el-card>
                <el-card>
                    <div class="tit">主要负责人</div>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="姓名" prop="field109">
                                <el-input v-model="formData.field109" placeholder="请输入姓名" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="职位" prop="field110">
                                <el-input v-model="formData.field110" placeholder="请输入职位" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="手机" prop="field111">
                                <el-input v-model="formData.field111" placeholder="请输入手机" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="邮箱" prop="field112">
                                <el-input v-model="formData.field112" placeholder="请输入邮箱" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="电话" prop="field113">
                                <el-input v-model="formData.field113" placeholder="请输入电话" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="备注" prop="field114">
                                <el-input v-model="formData.field114" placeholder="请输入备注" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>



                    </el-row>
                </el-card>


                <el-card>
                    <div class="tit">其他联系人</div>
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label="姓名" prop="field116">
                                <el-input v-model="formData.field116" placeholder="请输入姓名" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="职位" prop="field117">
                                <el-input v-model="formData.field117" placeholder="请输入职位" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="手机" prop="field118">
                                <el-input v-model="formData.field118" placeholder="请输入手机" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="电话" prop="field119">
                                <el-input v-model="formData.field119" placeholder="请输入电话" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9">
                            <el-form-item label="邮箱" prop="field120">
                                <el-input v-model="formData.field120" placeholder="请输入邮箱" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="9">
                            <el-form-item label="备注" prop="field121">
                                <el-input v-model="formData.field121" placeholder="请输入备注" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
                            <el-form-item label="附件" prop="field122">
                                <el-upload ref="field122" :file-list="field122fileList" :action="field122Action"
                                    :before-upload="field122BeforeUpload">
                                    <el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
                                </el-upload>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-card>

                <el-card>
                    <div class="tit">开票信息</div>
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="开票公司" prop="field123">
                                <el-input v-model="formData.field123" placeholder="请输入开票公司" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="纳税人识别" prop="field124">
                                <el-input v-model="formData.field124" placeholder="请输入纳税人识别" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="开户地址" prop="field125">
                                <el-input v-model="formData.field125" placeholder="请输入开户地址" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="电话" prop="field126">
                                <el-input v-model="formData.field126" placeholder="请输入电话" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="开户地址" prop="field127">
                                <el-input v-model="formData.field127" placeholder="请输入开户地址" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="银行账号" prop="field128">
                                <el-input v-model="formData.field128" placeholder="请输入银行账号" clearable
                                    :style="{ width: '100%' }">
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="24">
                            <el-form-item size="large">
                                <el-button type="primary" @click="submitForm">提交</el-button>
                                <el-button @click="resetForm">重置</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-card>
            </el-form>
        </el-row>
    </div>
</template>
<script>
export default {
    components: {},
    props: [],
    data() {
        return {
            formData: {
                field101: undefined,
                field103: undefined,
                field104: undefined,
                field105: undefined,
                field106: undefined,
                field107: undefined,
                field108: undefined,
                field109: undefined,
                field110: undefined,
                field111: undefined,
                field112: undefined,
                field113: undefined,
                field114: undefined,
                field116: undefined,
                field117: undefined,
                field118: undefined,
                field119: undefined,
                field120: undefined,
                field121: undefined,
                field122: null,
                field123: undefined,
                field124: undefined,
                field125: undefined,
                field126: undefined,
                field127: undefined,
                field128: undefined,
            },
            rules: {
                field101: [{
                    required: true,
                    message: '请输入本文行单客户姓名',
                    trigger: 'blur'
                }],
                field103: [],
                field104: [],
                field105: [{
                    required: true,
                    message: '请输入电话',
                    trigger: 'blur'
                }],
                field106: [],
                field107: [],
                field108: [],
                field109: [{
                    required: true,
                    message: '请输入姓名',
                    trigger: 'blur'
                }],
                field110: [],
                field111: [],
                field112: [],
                field113: [],
                field114: [],
                field116: [],
                field117: [],
                field118: [],
                field119: [],
                field120: [],
                field121: [],
                field123: [],
                field124: [],
                field125: [],
                field126: [],
                field127: [{
                    required: true,
                    message: '请输入开户地址',
                    trigger: 'blur'
                }],
                field128: [],
            },
            field122Action: 'https://jsonplaceholder.typicode.com/posts/',
            field122fileList: [],
            field103Options: [{
                "label": "选项一",
                "value": 1
            }, {
                "label": "选项二",
                "value": 2
            }],
            field106Options: [{
                "label": "良好",
                "value": 1
            }, {
                "label": "一般",
                "value": 2
            }, {
                "label": "较差",
                "value": ""
            }],
            field107Options: [{
                "label": "选项一",
                "value": 1
            }, {
                "label": "选项二",
                "value": 2
            }],
        }
    },
    computed: {},
    watch: {},
    created() { },
    mounted() { },
    methods: {
        submitForm() {
            this.$refs['elForm'].validate(valid => {
                if (!valid) return
                // TODO 提交表单
            })
        },
        resetForm() {
            this.$refs['elForm'].resetFields()
        },
        field122BeforeUpload(file) {
            let isRightSize = file.size / 1024 / 1024 < 2
            if (!isRightSize) {
                this.$message.error('文件大小超过 2MB')
            }
            return isRightSize
        },
    }
}

</script>
<style>
.el-upload__tip {
    line-height: 1.2;
}

.tit {
    font-size: 17px;
    margin-bottom: 10px;
}
</style>
  