<!DOCTYPE html>
<div class="train">
    <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="train-title">
            <el-row>
                <el-col :span="3"><span>编号</span></el-col>
                <el-col :span="6"><span>起止时间</span></el-col>
                <el-col :span="8"><span>机构名称</span></el-col>
                <el-col :span="4"><span>培训主题</span></el-col>
                <el-col :span="3"><span>操作</span></el-col>
            </el-row>
        </div>
        <div class="train-list">
            <el-row type="flex" v-for="(item,i) in TrainingList" :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="8" align="middle"> <span>{{item.training}}</span> </el-col>
                <el-col :span="4" align="middle"> <span>{{item.title}}</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="deleteTraining(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="getUserJobTrainingList" v-if="pageCount > 0" />
        <ks-empty msg="该分类下暂无内容" v-else />
    </div>
    <el-dialog :title="status == 1 ? '添加培训经历' : '修改培训经历'" :visible.sync="dialogVisible" width="800px">
        <div class="train-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.training" placeholder="请输入机构"></el-input>
                </el-form-item>
                <el-form-item label=" 培训主题:">
                    <el-input v-model="form.title" placeholder="请输入主题"></el-input>
                </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>