<!DOCTYPE html>
<div class="education">
    <div style="text-align: right">
        <el-button style="margin-right:20px;margin-top:10px;" type="primary" size="medium" @click='dialogVisible = true,status = 1,form = []'>添加教育背景</el-button>
    </div>
    <div style="padding-bottom: 20px;">
        <div class="education-title">
            <el-row>
                <el-col :span="3"><span>编号</span></el-col>
                <el-col :span="6"><span>起止时间</span></el-col>
                <el-col :span="6"><span>学校名称</span></el-col>
                <el-col :span="3"><span>学历</span></el-col>
                <el-col :span="3"><span>专业名称</span></el-col>
                <el-col :span="3"><span>操作</span></el-col>
            </el-row>
        </div>
        <div class="education-list">
            <el-row type="flex" v-for="(item,i) in backgroundList" :key="i">
                <el-col :span="3" align="middle">
                    {{item.orderid}}
                </el-col>
                <el-col :span="6" align="middle"> <span @click="open(item.view_url)">{{item.begindate}}-{{item.enddate}}</span></el-col>
                <el-col :span="6" align="middle"> <span>{{item.school}}</span></el-col>
                <el-col :span="3" align="middle"> <span>{{item.qualifications}}</span> </el-col>
                <el-col :span="3" align="middle"> <span>{{item.professional}}</span> </el-col>
                <el-col :span="3">
                    <div>
                        <span style="cursor: pointer;margin: 0 5px;" @click="modify(item)">编辑</span>
                        <span style="cursor: pointer;margin: 0 5px;" @click="deleteBackground(item.id)">删除</span>
                    </div>
                </el-col>
            </el-row>
        </div>
        <el-pagination style="text-align: center;background: #fff;" background layout="prev, pager, next" :total="pageCount" @current-change="getUserJobBackgroundList" v-if="pageCount > 0" />
        <ks-empty msg="该分类下暂无内容" v-else />
    </div>
    <el-dialog :title="status == 1 ? '添加教育背景' : '修改教育背景'" :visible.sync="dialogVisible" width="800px">
        <div class="education-dialog">
            <el-form label-width="114px">
                <el-form-item label="编号：">
                    <el-input v-model="form.orderid" placeholder="请输入编号"></el-input>
                </el-form-item>
                <el-form-item label="起止时间：">
                    <el-date-picker v-model="form.date" value-format="yyyy-M" type="monthrange" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="学校名称：">
                    <el-input v-model="form.school" placeholder="请输入学校"></el-input>
                </el-form-item>
                <el-form-item label="学校地址:">
                    <el-input v-model="form.schooladdress" placeholder="请输入学校地址"></el-input>
                </el-form-item>
                <el-form-item label="专业类别：">
                    <el-cascader v-model="form.majorId" :options="majorList" :props="{ expandTrigger: 'hover',children:'childs',label:'name',value:'id',checkStrictly: true}" @change="handleChange" filterable></el-cascader>
                </el-form-item>
                <el-form-item label="专业名称:">
                    <el-input v-model="form.professional" placeholder="请输入专业"></el-input>
                </el-form-item>
                <el-form-item label="学历:">
                    <el-select v-model="form.qualifications" placeholder="请选择" @change="" @visible-change="">
                        <el-option v-for="item in educationList" :key="item.name" :label="item.name" :value="item.name">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="获得证书:">
                    <el-input style="width: 500px" v-model="form.certificate" type="textarea" :autosize="{ minRows: 4, maxRows: 6}" placeholder="请输入相关证书"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: center">
                <el-button type=primary round size="medium" @click="save">{{status == 1 ? '保存提交' : '修改提交'}}</el-button>
                <el-button style="padding: 10px 34px;" round size="medium" @click="dialogVisible = false">返回</el-button>
            </div>
        </div>
    </el-dialog>
</div>