<?php
/**
 * 机构认证
 * $Id: org_accredited_list.inc,v 1.1 2020/01/03 11:18:46  Exp $
 * @author lixq
 * @access public
 * @package manager.templates
 */

?>
<style type="text/css">
	.m-l{
		margin-left: 10px;
	}
</style>
<div id="classSetting">
	<div class="list_title">
		机构认证
	</div>
	<br/>
	<form id="search_form" action="org_accredited_list.php" method="post">
		<input type="hidden"  name="status" value="<?=$status?>"/>
		机构名称:<input type="text" value="<?=$title?>" name="title" class="el-input__inner input_100 m-l"/>
		状态:<el-select v-model="status" size="small" style="margin-left: 10px;">
        <el-option
            v-for="item in status_list"
            :key="item.id"
            :label="item.title"
            :value="item.id">
        </el-option>
    	</el-select>
	
	<el-button type="primary" @click="search()" class="edit_btn search_btn">检索</el-button>
	</form>
  <br />
  <div class="result_list">
  	<el-table :data="tableData" border>
  	<el-table-column  prop="organization_no" label="编号" width=""></el-table-column>
  		<el-table-column  prop="organization_title" label="机构名称" width=""></el-table-column>
  		<el-table-column  prop="legal_person" label="法人姓名" width=""></el-table-column>
  		<el-table-column  prop="organization_contact" label="联系方式" width=""></el-table-column>
  		<el-table-column  prop="organization_submit_date" label="上传时间" width=""></el-table-column>
  		<el-table-column  prop="status_title" label="状态" width=""></el-table-column>
  		<el-table-column  label="操作"  width="150">
			<template slot-scope="scope"  >
				<el-button @click="handleChange(scope.row)" type="text" size="small":key="Math.random()">审阅</el-button>
				<el-button type="text" size="small" v-if="scope.row.org_status == 'OK'" @click="addAcount(scope.row)":key="Math.random()">账号生成</el-button>
			</template>
			
  			</el-table-column>
  	</el-table>
  </div>
</div>
<?
if ($user_count > 0) {
?>
<!--page begin-->
<?
require_once("page_common.inc");
?>
<!--page end-->
<?
}
?>
<script type="text/javascript">
	var list=[];
	<?
	foreach ($user_list as $tmp) {
	?>
		var data={
			id:<?=$tmp->id ?>,
			organization_no:'<?=$tmp->organization_no?>',
			organization_title:'<?=$tmp->organization_title?>',
			legal_person:'<?=$tmp->legal_person?>',
			organization_contact:'<?=$tmp->organization_contact?>',
			organization_submit_date:'<?=$tmp->organization_submit_date?>',
			org_status:'<?=$tmp->organization_status?>',
			status_title:'<?=$tmp->organization_status == "NEW" ?"待审核":($tmp->organization_status == "OK" ?"审核通过":"审核未通过")?>'
		};
		list.push(data);
	<?
	}
	?>

	new Vue({
		el:'#classSetting',
		data:{
			tableData: list,
			status_list:[{"id":"","title":"请选择"},{"id":"NEW","title":"待审核"},{"id":"OK","title":"审核通过"},{"id":"NG","title":"审核未通过"}],
			status:'<?=$status?>'
		},
		methods:{
			handleChange(row) {
		  	window.location.href='org_accredited_input.php?id='+row.id;
		  },
		  addAcount(row){
		    window.location.href='org_account_list.php?id='+row.id;
		  },
		  search(){
    	  $("input[name='status']").val(this.status);
				$("#search_form").submit();
			}
		}
		 
	})
</script>