<template>
    <div>
        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="124px" 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="请输入标书信息" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="购买人员" prop="field102">
                            <el-input v-model="formData.field102" placeholder="请输入购买人员" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="客户名称" prop="field103">
                            <el-input v-model="formData.field103" placeholder="请输入客户名称" 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="请输入项目名称" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <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="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" placeholder="请输入购买标书金额" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="招标项目资金来源" prop="field108">
                            <el-input v-model="formData.field108" placeholder="请输入招标项目资金来源" clearable
                                :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="投标时间" prop="field110">
                            <el-date-picker v-model="formData.field110" 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="field111">
                            <el-date-picker v-model="formData.field111" 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="field112">
                            <el-date-picker v-model="formData.field112" 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="field113">
                            <el-date-picker v-model="formData.field113" 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="field114">
                            <el-radio-group v-model="formData.field114" size="medium">
                                <el-radio v-for="(item, index) in field114Options" :key="index" :label="item.value"
                                    :disabled="item.disabled">{{ item.label }}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="保证金金额" prop="field115">
                            <el-input v-model="formData.field115" placeholder="请选择保证金金额" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="开标日期" prop="field117">
                            <el-date-picker v-model="formData.field117" 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="field118">
                            <el-date-picker v-model="formData.field118" 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="24">
                        <el-form-item label="招标项目情况" prop="field119">
                            <el-input v-model="formData.field119" type="textarea" placeholder="请输入招标项目情况"
                                :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="项目简介" prop="field121">
                            <el-input v-model="formData.field121" type="textarea" placeholder="请输入项目简介"
                                :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <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 :gutter="10">
                    <el-col :span="24">
                        <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="24">
                        <el-form-item label="协议偏差处理方案" prop="field126">
                            <el-input v-model="formData.field126" type="textarea" placeholder="请输入协议偏差处理方案"
                                :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="附件" prop="field128">
                            <el-upload ref="field128" :file-list="field128fileList" :action="field128Action"
                                :before-upload="field128BeforeUpload">
                                <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 :gutter="10">


                    <el-col :span="12">
                        <el-form-item label="总金额" prop="field129">
                            <el-input v-model="formData.field129" placeholder="请输入总金额" clearable :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="税率" prop="field130">
                            <el-input v-model="formData.field130" placeholder="请输入税率" clearable :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="付款方式" prop="field131">
                            <el-select v-model="formData.field131" placeholder="请选择付款方式" clearable
                                :style="{ width: '100%' }">
                                <el-option v-for="(item, index) in field131Options" :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="field132">
                            <el-input v-model="formData.field132" placeholder="请输入付款比例" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="商务合同偏差" prop="field133">
                            <el-input v-model="formData.field133" placeholder="请输入商务合同偏差" clearable
                                :style="{ width: '100%' }">
                            </el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="偏差处理方案" prop="field134">
                            <el-input v-model="formData.field134" type="textarea" placeholder="请输入偏差处理方案"
                                :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="24">
                        <el-form-item label="附件" prop="field135">
                            <el-upload ref="field135" :file-list="field135fileList" :action="field135Action"
                                :before-upload="field135BeforeUpload">
                                <el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
                            </el-upload>
                        </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: undefined,
                field103: undefined,
                field104: undefined,
                field105: undefined,
                field106: undefined,
                field107: undefined,
                field108: undefined,
                field110: null,
                field111: null,
                field112: null,
                field113: null,
                field114: undefined,
                field115: null,
                field117: null,
                field118: null,
                field119: undefined,
                field121: undefined,
                field122: null,
                field124: undefined,
                field126: undefined,
                field128: null,
                field129: undefined,
                field130: undefined,
                field131: undefined,
                field132: undefined,
                field133: undefined,
                field134: undefined,
                field135: null,
            },
            rules: {
                field101: [{
                    required: true,
                    message: '请输入标书信息',
                    trigger: 'blur'
                }],
                field102: [{
                    required: true,
                    message: '请输入购买人员',
                    trigger: 'blur'
                }],
                field103: [{
                    required: true,
                    message: '请输入客户名称',
                    trigger: 'blur'
                }],
                field104: [{
                    required: true,
                    message: '请输入项目名称',
                    trigger: 'blur'
                }],
                field105: [],
                field106: [],
                field107: [],
                field108: [],
                field110: [],
                field111: [],
                field112: [],
                field113: [],
                field114: [],
                field115: [],
                field117: [],
                field118: [],
                field119: [],
                field121: [],
                field124: [],
                field126: [],
                field129: [],
                field130: [],
                field131: [],
                field132: [],
                field133: [],
                field134: [],
            },
            field122Action: 'https://jsonplaceholder.typicode.com/posts/',
            field122fileList: [],
            field128Action: 'https://jsonplaceholder.typicode.com/posts/',
            field128fileList: [],
            field135Action: 'https://jsonplaceholder.typicode.com/posts/',
            field135fileList: [],
            field114Options: [{
                "label": "是",
                "value": 1
            }, {
                "label": "否",
                "value": 2
            }],
            field131Options: [{
                "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
        },
        field128BeforeUpload(file) {
            let isRightSize = file.size / 1024 / 1024 < 2
            if (!isRightSize) {
                this.$message.error('文件大小超过 2MB')
            }
            return isRightSize
        },
        field135BeforeUpload(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>
  