<!DOCTYPE html>
<html>
	<head>
		<title>互助组-详情</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 所有的 css js 资源 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
		<link rel="stylesheet" href="../../static/sa.css">
		<script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
		<script src="../../static/kj/layer/layer.js"></script>
		<script src="../../static/sa.js"></script>
		<style type="text/css">
			.c-panel .c-label {
				width: 8em;
			}
		</style>
	</head>
	<body>
		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
			<!-- ------- 内容部分 ------- -->
			<div class="s-body">
				<div class="c-panel">
					<el-form size="mini" v-if="m">
						<el-row>
							<el-col span=12>
								<div class="c-item br">
									<label class="c-label">名称：</label>
									<span>{{m.name}}</span>
								</div>
								<div class="c-item br">
									<label class="c-label">编号：</label>
									<span>{{m.code}}</span>
								</div>
								<div class="c-item br">
									<label class="c-label">地区：</label>
									<span>{{m.address}}</span>
								</div>

								<div class="c-item br">
									<label class="c-label">状态：</label>
									<b v-if="m.deleteStatus == 0">禁用</b>
									<b v-if="m.deleteStatus == 1">启用</b>
								</div>
							</el-col>
							<el-col span=12>
								<div class="c-item br">
									<label class="c-label">组长：</label>
									<span v-if="m.leaderName">{{m.leaderName}}</span>
									<span v-else style="color: #066CF3;cursor: pointer;"
										@click="addLeaderFn(m.id)">添加</span>
								</div>
								<div class="c-item br">
									<label class="c-label">组长电话：</label>
									<span>{{m.leaderPhone}}</span>
								</div>
								<div class="c-item br">
									<label class="c-label">限购额度：</label>
									<span>{{m.leftPrice}}元</span>
								</div>
								<div class="c-item br">
									<label class="c-label">创建时间：</label>
									<span class="tc-date">{{sa.forDate(m.createTime, 2)}}</span>
								</div>
							</el-col>
						</el-row>
					</el-form>
				</div>
			</div>
			<!-- ------- 底部按钮 ------- -->
			<div class="s-foot">
				<el-button size="mini" type="success" @click="sa.closeCurrIframe()">确定</el-button>
				<el-button size="mini" @click="sa.closeCurrIframe()">取消</el-button>
			</div>
		</div>
		<script>
			var app = new Vue({
				el: '.vue-box',
				data: {
					id: sa.p('id', 0), // 获取数据ID
					m: null
				},
				methods: {
					addLeaderFn(groupId) {
						sa.showIframe('添加组长', 'tb-group-leader.html?groupId=' + groupId, '950px', '90%');
					},
				},
				mounted: function() {
					sa.ajax('/level-one-server/TbGroup/getById?id=' + this.id, function(res) {
						this.m = res.data;
						if (res.data == null) {
							sa.alert('未能查找到 id=' + this.id + " 详细数据");
						}
					}.bind(this))
				}
			})
		</script>
	</body>
</html>
