<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta name="format-detection" content="telephone=no" />
		<title>潜山市个人创业担保贷款</title>
		<meta name="keywords" content="潜山市个人创业担保贷款">
		<meta name="description" content="潜山市个人创业担保贷款">
		<script src="static/js/vue.js"></script>
		<script type="text/javascript" src="static/js/vue-router.js"></script>
		<script src="static/js/index.js" type="text/javascript"></script>
		<script src="static/js/croods-1.3.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="./static/js/jquery.min.js"></script>
		
		<script src="static/js/common.js"></script>
		<link href="static/css/common.css" rel="stylesheet" />
		<link href="static/css/style.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/theme-chalk/index.css">
		<style></style>
	</head>
	<body class="dbody">
		<div id="app">
			<div id="appse">
				<header>
					<div class="dtop act" >
						<div class="back backimg"><img src="static/images/wback.png" /></div>
						<div class="tit over">当前进度</div>
					</div>
				</header>
			</div>
			<main>
				<div class="dqbox">
					<div class="dqlist flexat" v-for="(ite,idx) in dksqLcjlList" :key="idx">
						<div class="listl">{{Number(idx)+1}}</div>
						<div class="listr">
							<div class="tit">{{keyType(ite.type,typelist)}}</div>
							<div class="flexat">
								<div class="flex0 ltit">{{ite.statetit}}状态：</div>
								<div class="rtxt">
									<span v-if="ite.type==1">请等待{{keyType(2,typelist)}}</span>
									<span v-if="ite.type==2">
										<span v-if="ite.result==2">已完成审查，请等待{{keyType(3,typelist)}}</span>
										<span v-if="ite.result==3">已完成审查，请重新提交</span>
									</span>
									<span v-if="ite.type==3">
										<span v-if="ite.result==1">申请已提交，请等待{{keyType(3,typelist)}}</span>
										<span v-if="ite.result==2">已完成评估，请等待{{keyType(4,typelist)}}</span>
										<span v-if="ite.result==3">已完成评估，请等待{{keyType(2,typelist)}}重新推荐</span>
									</span>
									<span v-if="ite.type==4">
										<span v-if="ite.result==1">申请已提交，请等待放贷完成</span>
										<span v-if="ite.result==2">已完成放贷完成</span>
										<span v-if="ite.result==3">已拒绝放贷</span>
									</span>
								</div>
							</div>
							<div class="flexat ">
								<div class="flex0 ltit">
									<span v-if="ite.type==1">提交结果：</span>
									<span v-if="ite.type==2">审查结果：</span>
									<span v-if="ite.type==3">评估结果：</span>
									<span v-if="ite.type==4">放贷结果：</span>
								</div>
								<div class="rtxt co1" v-if="ite.result==2">
									<span v-if='ite.type==1'>已提交</span>
									<span v-else>已通过</span>
									</div>
								<div class="rtxt co2" v-if="ite.result==3">未通过</div>
								<div class="rtxt co3" v-if="ite.result==1">等待</div>
							</div>
						</div>
					</div>
					<!-- <div class="dqlist flexat">
						<div class="listl">2</div>
						<div class="listr">
							<div class="tit">提交申请</div>
							<div class="flexat">
								<div class="flex0 ltit">申请状态：</div>
								<div class="rtxt">请等待潜山市人社局审查</div>
							</div>
							<div class="flexat ">
								<div class="flex0 ltit">提交结果：</div>
								<div class="rtxt cf3">未通过</div>
							</div>
						</div>
					</div> -->
				</div>
			</main>
		</div>
		<script type="text/javascript">
			var app = new Vue({
				el: '#app',
				data: {
					// base_url: 'https://qsfy.qs163.cn/prod-api',
					base_url: 'http://192.168.101.11:8020',
					id:'',
					dksqLcjlList:[],
					typelist:[],
					jdlist:[
						{tit:'提交申请',statetit:'申请',statetxt:'请等待潜山市人社局审查',ispass:'2',type:1},
						{tit:'潜山市人社局审查',statetit:'审查',statetxt:'已完成初审，请等待银行评估',ispass:'1',type:2},
						// {tit:'提交申请',statetit:'申请',statetxt:'请等待潜山市人社局审查',ispass:'2',type:1},
						// {tit:'提交申请',statetit:'申请',statetxt:'请等待潜山市人社局审查',ispass:'2',type:1},
						// {tit:'提交申请',statetit:'申请',statetxt:'请等待潜山市人社局审查',ispass:'2',type:1},
					]
				},
				created() {
		
				},
				mounted() {
					this.init()
					this.id=decodeURI(this.getQueryString("id"))
					this.getDataFn()
				},
				destroyed() {

				},
				methods: {
					// 获取路由参数
					getQueryString(name) {
					     try {
							var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
							var r = window.location.href.split('?')[1].match(reg);						
							if(r != null) {
							    return r[2];
							}
							 return "";//如果此处只写return;则返回的是undefined
						} catch(e) {
							 return "";//如果此处只写return;则返回的是undefined
						}
					},
					init(){
						this.getDictionaryFn('shqzht')
					},
					getDictionaryFn(data){
						var that = this;
						var header='Bearer '+this.getToken()
						$.ajax({
							url: this.base_url + '/system/dict/data/type/'+data,
							type: 'get',
							data: {},
							dataType: 'json',
							headers: {
							    'Authorization': header
							},
							success: function(res) {
								that.loading=false;
								if (res.code == 200) {
									var datalist = res.data.map(v => {
										return {
											dictLabel: v.dictLabel,
											dictValue: Number(v.dictValue)
										}
									})
									if(data=='shqzht'){
										that.typelist=datalist;
									}
								} else {
									that.$message({
										message: res.msg,
										type: 'error',
										center: true,
									});
								}
							},
							fail:function(res){
								that.loading=false;
								that.$message({
									message: "网络请求错误",
									type: 'error',
									center: true,
								});
							}
						})
					},
					getToken(){
						return window.localStorage.getItem('token')
					},
					keyType(data,list){
						return this.selectDictValue(list,data)	
					},
					selectDictValue(datas, value){
						var actions = [];
						Object.keys(datas).some((key) => {
							if (datas[key].dictValue == ('' + value)) {
								actions.push(datas[key].dictLabel);
								return true;
							}
						})
						return actions.join('');
					},
					getDataFn(){
						var that=this;
						var header='Bearer '+this.getToken();
						$.ajax({
							url: this.base_url + '/system/dksq/'+this.id,
							type: 'get',
							data: {},
							dataType: 'json',
							headers: {
							    'Authorization': header
							},
							success: function(res) {
								that.loading=false;
								if (res.code == 200) {
									that.dksqLcjlList=res.data.dksqLcjlList
								} else {
									that.$message({
										message: res.msg,
										type: 'error',
										center: true,
									});
								}
							},
							fail:function(res){
								that.loading=false;
								that.$message({
									message: "网络请求错误",
									type: 'error',
									center: true,
								});
							}
						})
					},
				}
			})
		</script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('.backimg').click(function() {
					window.history.go(-1)
				})
			})
		</script>
	</body>
</html>