<template>
	<div>
		<div class="search-term">
			<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
				<el-form-item label="手机号码" prop="phone">
					<el-input placeholder="请输入手机号码" v-model="searchInfo.phone" type="text" class="user-form-item" clearable></el-input>
				</el-form-item>

				<el-form-item label="姓名" prop="phone">
					<el-input placeholder="请输入姓名" v-model="searchInfo.nickname" type="text" class="user-form-item" clearable></el-input>
				</el-form-item>

				<el-form-item label="身份证" prop="cardId">
					<el-input placeholder="请输入身份证" v-model="searchInfo.cardId" type="text" class="user-form-item" clearable></el-input>
				</el-form-item>
				
				<el-form-item  label="状态" prop="type">
					<el-select  placeholder="审核状态"  v-model="searchInfo.confirm" style="width: 120px;">
						<el-option label="等待审核" :value="0"></el-option>
						<el-option label="审核通过" :value="1"></el-option>
						<el-option label="拒绝中" :value="2"></el-option>
					</el-select>
				</el-form-item>
			</el-form>
		</div>
		

		<el-table :data="tableData" border stripe>
			<el-table-column label="ID" width="70" prop="userId"> </el-table-column>
			<el-table-column label="姓名" prop="nickname"> </el-table-column>
			<el-table-column label="手机号码" prop="phone" > </el-table-column>
			<el-table-column label="身份证" prop="cardId"> </el-table-column>
			<el-table-column label="所在企业" prop="company" min-width="120" > </el-table-column>
			<el-table-column label="学历" prop="education" > </el-table-column>
			<el-table-column label="专业" prop="major" > </el-table-column>
			<el-table-column label="报考岗位" prop="courseName" > </el-table-column>
			<el-table-column label="施工现场实践年限" prop="years" min-width="100" align="center"> </el-table-column>

			<el-table-column label="审核状态" prop="years" >
				<template slot-scope="{ row }">
					<span  v-if="row.confirm==0">等待审核</span>
					<span  v-else-if="row.confirm==1">审核通过</span>
					<span  v-else>拒绝中</span>			
				</template>
			</el-table-column>
			
			<el-table-column label="操作" prop="create_at">
				<template slot-scope="{ row }">
					<el-button
					  type="primary"
					  size="small"
					  @click="confirmUser(row)"
					  >审核材料</el-button
					>
				</template>
			</el-table-column>
		</el-table>
		<el-pagination :current-page="page" :page-size="size" :page-sizes="[10, 30, 50, 100]" :style="{ float: 'right', padding: '20px' }"
		 :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>

		
	</div>
</template>

<script>
	import {getUserApplyList} from "@/api/xinpei.js";
	import infoList from "@/mixins/infoList";

	export default {
		name: "Api",
		data() {
			return {
				listApi: getUserApplyList,
				tableData: [],
			};
		},
		watch: {
			searchInfo:{
				handler(new_value,old_value){
					this.page = 1;
					  this.getTableData();
			    },
				deep: true,
			}
		},
		mixins: [infoList],
		methods: {
			confirmUser(row){
				this.$router.push({ name: "xinpei_student_info", query: { applyId: row.applyId } });
			}
		
		},
		created() {
			this.getTableData();
		},
	};
</script>
<style scoped lang="scss">
	.el-tag--mini {
		margin-left: 5px;
	}

	.warning {
		color: #dc143c;
	}
</style>
