<template>
	<div class="app-container">
		<el-table :data="tableData" style="width: 100%">
			<el-table-column   label="期次" align="center">
				<template slot-scope="scope">
					{{scope.row.qiciyear+"第"+scope.row.qici+"期"}}
				</template>
			</el-table-column>
			<el-table-column prop="pxlb" label="培训类别" align="center">
				<template slot-scope="scope">
					{{scope.row.zhuanye === ""?scope.row.pxlb:scope.row.pxlb+"（"+scope.row.zhuanye+"）"}}
				</template>
			</el-table-column>
			<el-table-column prop="trainName" label="培训计划名称" align="center" width="400px">
			</el-table-column>
			<el-table-column prop="zxs" label="总学时" align="center">
			</el-table-column>
			<el-table-column prop="yxsj" label="已学时间(分钟)" align="center">
				<template slot-scope="scope">
					<span style="color: #F56C6C;">
						{{scope.row.yxsj}}
					</span>
				</template>
			</el-table-column>
			<el-table-column prop="sysj" label="剩余时间(分钟)" align="center">
			</el-table-column>
			<el-table-column label="考试截止日期" align="center">
				<template slot-scope="scope">
					{{parseTime(scope.row.ksjzrq, '{y}-{m}-{d}')}}
				</template>
			</el-table-column>
			<el-table-column prop="address" label="状态" align="center">
				<template slot-scope="scope">
					<el-button size="mini" type="text" icon="el-icon-coin" style="color:#F56C6C ;" @click="studyShow = true" v-if="scope.row.feeflg == 0">缴费</el-button>
					<el-button size="mini" type="text" icon="el-icon-reading" @click="ksxx(scope.row)" v-else-if="scope.row.feeflg == 1 && scope.row.wanchengflg == 0 ">开始学习</el-button>
					<el-button size="mini" type="text" icon="el-icon-edit" style="color:#E6A23C;" @click="ksxx(scope.row)" v-else-if="scope.row.feeflg == 1 && scope.row.wanchengflg == 1">开始考试</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div style="display: flex;color:#F56C6C ;margin-top: 40px;">
			<div>
				备注：
			</div>
			<div>
				<div>
					1、完成学时后即可进行网上考试，请单击左侧查看成绩菜单进行成绩的查询。
				</div>
				<div>
					2、每人有3次网上考试机会，考试通过后，方可打印合格证明。
				</div>
				<div>
					3、如未交费情况下显示微信支付，请用手机微信“扫一扫”功能进行交费；如显示按照交费说明进行交费，请按照说明书进行操作。
				</div>
			</div>
		</div>
		<div style="color:#F56C6C ;margin-top: 20px;">
			<div>
				关于铁路监理工程师网上继续教育的有关注意事项：
			</div>
			<div style="padding-left: 46px;">
				<div>
					1、持铁监证在证书到期前半年可以报名学习，可持续学习至证书到期日止；
				</div>
				<div>
					2、持铁监证在证书到期前3个月 - 到期日的，报名学习时间自报名日起，为三个月；
				</div>
				<div>
					3、持铁监证过期报名的，自报名成功学习时间为3个月。以上要求是根据网络资源所限，请各单位负责培训人员督促报名人员抓紧时间学习。
				</div>
			</div>

		</div>
		<el-dialog title="继续教育学习" :visible.sync="studyShow" fullscreen destroy-on-close :before-close="studyOver">
			<xuexi :classData="classData"></xuexi>
		</el-dialog>
	</div>
</template>

<script>
	import {
		getJxjy
	} from "@/api/jianliyuan/index"
	import xuexi from "../../components/xuexi/index"
	export default {
		name: "PeixunList",
		components:{
			xuexi
		},
		data() {
			return {
				tableData: [],
				studyShow: false,
				classData:null,
			}
		},
		created() {
			this.getList()
		},
		methods: {
			getList(){
				getJxjy().then(res=>{
					this.tableData = res.data
				})
			},
			ksxx(row){
				console.log(row)
				this.classData = row
				this.studyShow = true
			},
			studyOver(){
				this.studyShow = false
			}
		}
	}
</script>

<style lang="scss" scoped>
	
</style>