<template>
    <div>
        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px" label-position="left">
            <el-card>
                <div class="tit">退款申请</div>
                <el-row :gutter="10">
                    <el-col :span="12">
                        <el-form-item label="客户名称" prop="field101">
                            <el-input v-model="formData.field101" placeholder="点击选择客户" :disabled='true' clearable
                                :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="退款日期" prop="field102">
                            <el-date-picker v-model="formData.field102" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
                                :style="{ width: '100%' }" placeholder="请选择退款日期" clearable></el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="合同编号" prop="field103">
                            <el-input v-model="formData.field103" placeholder="点击选择销售/项目合同" :disabled='true' clearable
                                :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="合同名称" prop="field104">
                            <el-input v-model="formData.field104" placeholder="系统自动填写" :disabled='true' clearable
                                :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="退款原因" prop="field105">
                            <el-input v-model="formData.field105" type="textarea" placeholder="请输入退款原因"
                                :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="退款金额" prop="field106">
                            <el-input v-model="formData.field106" placeholder="请输入退款金额" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="金额大写" prop="field107">
                            <el-input v-model="formData.field107" :disabled='true' clearable :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="退款方式" prop="field108">
                            <el-select v-model="formData.field108" placeholder="请选择退款方式" clearable
                                :style="{ width: '100%' }">
                                <el-option v-for="(item, index) in field108Options" :key="index" :label="item.label"
                                    :value="item.value" :disabled="item.disabled"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="退款人" prop="field109">
                            <el-input v-model="formData.field109" :disabled='true' clearable :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <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="24">
                        <el-form-item label="附件" prop="field111">
                            <el-upload ref="field111" :file-list="field111fileList" :before-upload="field111BeforeUpload"
                                accept=".pdf">
                                <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="24">
                        <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="24">
                        <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="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>
    </div>
</template>
<script>
export default {
    components: {},
    props: [],
    data() {
        return {
            formData: {
                field101: undefined,
                field102: null,
                field103: undefined,
                field104: undefined,
                field105: undefined,
                field106: undefined,
                field107: undefined,
                field108: undefined,
                field109: undefined,
                field110: undefined,
                field111: null,
                field112: undefined,
                field113: undefined,
            },
            rules: {
                field101: [{
                    required: true,
                    message: '点击选择客户',
                    trigger: 'blur'
                }],
                field102: [],
                field103: [{
                    required: true,
                    message: '点击选择销售/项目合同',
                    trigger: 'blur'
                }],
                field104: [],
                field105: [{
                    required: true,
                    message: '请输入退款原因',
                    trigger: 'blur'
                }],
                field106: [{
                    required: true,
                    message: '请输入退款金额',
                    trigger: 'blur'
                }],
                field107: [],
                field108: [],
                field109: [],
                field110: [],
                field112: [{
                    required: true,
                    message: '请输入收款银行',
                    trigger: 'blur'
                }],
                field113: [{
                    required: true,
                    message: '请输入收款账号',
                    trigger: 'blur'
                }],
            },
            field108Options: [{
                "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()
        },
    }
}

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

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