Browse Source

Merge branch 'dev' of http://git.aseanbusiness.cn/qzyReal/market-admin-ui into dev

qzyReal 1 year ago
parent
commit
4b3efd7db9

+ 18 - 9
sa-view/tb-group/tb-group-add.html

@@ -38,17 +38,14 @@
 						<sa-item type="text" name="编号" v-model="m.code" br></sa-item>
 						<div class="c-item">
 							<label class="c-label"><span style="color: red;">*</span>互市区:</label>
-							<el-select @change="getPeopleByTradeAreaId" v-model="m.tradeAreaId" placeholder="请选择" filterable size="mini">
-								<el-option v-for="(item,index) in tradeAreaList" :key="index" :label="item.name"
-									:value="item.id"> </el-option>
+							<el-select @change="getPeopleByTradeAreaId" v-model="m.tradeAreaName" placeholder="请选择" filterable size="mini">
+								<el-option v-for="(item,index) in tradeAreaList" :key="index" :label="item.name" :value="item"> </el-option>
 							</el-select>
 						</div>
 						<div class="c-item">
 							<label class="c-label">组长:</label>
-							<el-select v-model="m.leaderId" placeholder="请选择" filterable size="mini"
-								:disabled="!m.tradeAreaId">
-								<el-option v-for="(item,index) in personList" :key="index" :label="item.name"
-									:value="item.id"> </el-option>
+							<el-select @change="getpersonList" v-model="m.leaderName" placeholder="请选择" filterable size="mini" :disabled="!m.tradeAreaId">
+								<el-option v-for="(item,index) in personList" :key="index" :label="item.name" :value="item"> </el-option>
 							</el-select>
 						</div>
 						<sa-item name="" class="s-ok" br>
@@ -84,11 +81,23 @@
 							this.tradeAreaList = resp.data;
 						}.bind(this));
 					},
-					getPeopleByTradeAreaId(value){
-						sa.ajax('/level-one-server/TbPeople/getPeopleForGroup', {tradeAreaId:value}, function(resp) {
+					getPeopleByTradeAreaId(item){
+						// 互市区信息加入到互助组管理表
+						this.m.address = item.address
+						this.m.addressIds = item.addressIds
+						this.m.detailAddress = item.detailAddress
+						this.m.tradeAreaId = item.id
+						this.m.tradeAreaName = item.name
+						sa.ajax('/level-one-server/TbPeople/getPeopleForGroup', {tradeAreaId:item.id}, function(resp) {
 							this.personList = resp.data;
 						}.bind(this));
 					},
+					getpersonList(item) {
+						this.m.leaderId = item.id
+						this.m.leaderName = item.name
+						this.m.leaderPhone = item.phone
+						console.log("this.m",this.m)
+					},
 					// 创建一个 默认Model
 					createModel: function() {
 						return {

+ 9 - 12
sa-view/tb-group/tb-group-info.html

@@ -11,7 +11,7 @@
 		<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/js/layer.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<style type="text/css">
 			.c-panel .c-label {
@@ -42,8 +42,8 @@
 
 								<div class="c-item br">
 									<label class="c-label">状态:</label>
-									<b v-if="m.status == 0">禁用</b>
-									<b v-if="m.status == 1">启用</b>
+									<b v-if="m.deleteStatus == 0">禁用</b>
+									<b v-if="m.deleteStatus == 1">启用</b>
 								</div>
 							</el-col>
 							<el-col span=12>
@@ -84,20 +84,17 @@
 					m: null
 				},
 				methods: {
-					f5() {
-						sa.ajax('/levelone-server/TbGroup/getById?id=' + this.id, function(res) {
-							this.m = res.data;
-							if (res.data == null) {
-								sa.alert('未能查找到 id=' + this.id + " 详细数据");
-							}
-						}.bind(this))
-					},
 					addLeaderFn(groupId) {
 						sa.showIframe('添加组长', 'tb-group-leader.html?groupId=' + groupId, '950px', '90%');
 					},
 				},
 				mounted: function() {
-					this.f5();
+					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>

+ 9 - 9
sa-view/tb-group/tb-group-leader.html

@@ -11,7 +11,7 @@
 		<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/js/layer.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 		<script src="../../static/kj/upload-util.js"></script>
 		<style type="text/css">
@@ -127,7 +127,7 @@
 				},
 				methods: {
 					getBankList() {
-						sa.ajax('/levelone-server/TbBank/getAll', function(resp) {
+						sa.ajax('/sp-admin/TbBank/getAll', function(resp) {
 							this.bankList = resp.data;
 						}.bind(this));
 					},
@@ -154,11 +154,11 @@
 						}
 						// 开始增加或修改
 						if (this.id <= 0) { // 添加
-							sa.ajax('/levelone-server/TbGroupLeader/add', sa.removeNull(this.m), function(res) {
+							sa.ajax('/level-one-server/TbPeople/add', sa.removeNull(this.m), function(res) {
 								sa.alert('增加成功', this.clean);
 							}.bind(this));
 						} else { // 修改
-							sa.ajax('/levelone-server/TbGroupLeader/update', sa.removeNull(this.m), function(res) {
+							sa.ajax('/level-one-server/TbPeople/update', sa.removeNull(this.m), function(res) {
 								sa.alert('修改成功', this.clean);
 							}.bind(this));
 						}
@@ -171,19 +171,19 @@
 					initFn() {
 						// 初始化数据
 						if (this.id > 0) {
-							sa.ajax('/levelone-server/TbGroupLeader/getById?id=' + this.id, function(res) {
+							sa.ajax('/level-one-server/TbPeople/getById?id=' + this.id, function(res) {
 								res.data.idCardImg_arr = sa.isNull(res.data.idCardImg) ? [] : res.data.idCardImg.split(',');		// 身份证复印件 字符串转数组
 								this.m = res.data;
 								if (res.data == null) {
 									sa.alert('未能查找到 id=' + this.id + " 详细数据");
 								}
 							}.bind(this))
-						}
+						};
 					}
 				},
-				mounted() {
-					this.initFn();
-					this.getBankList();
+				mounted: function() {
+					this.initFn()
+					this.getBankList()
 				}
 			})
 		</script>

+ 2 - 2
sa-view/tb-group/tb-group-list.html

@@ -62,7 +62,7 @@
 						</template>
 					</el-table-column>
 					<el-table-column align="center" label="创建时间" class-name="tc-date">
-						<template slot-scope="s">{{sa.forDate(s.row.createTime, 2)}}</template>
+						<template slot-scope="s">{{s.row.createTime}}</template>
 					</el-table-column>
 					<el-table-column align="center" label="操作" fixed="right" width="270px">
 						<template slot-scope="s">
@@ -216,7 +216,7 @@
 					},
 					// 修改
 					update: function(data) {
-						sa.showIframe('修改数据', 'tb-group-add.html?id=' + data.id, '900px', '90%');
+						sa.showIframe('修改数据', 'tb-group-add.html?id=' + data.id, '550px', '90%');
 					},
 					// 新增
 					add: function(data) {

+ 4 - 5
sa-view/tb-group/tb-group-people-add.html

@@ -11,7 +11,7 @@
 		<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/js/layer.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
 		<script src="../../static/sa.js"></script>
 	</head>
 	<body>
@@ -82,7 +82,6 @@
 						this.select = selection;
 					},
 					sureFn() {
-						console.log(this.groupId);
 						let selectList = this.select;
 						if (selectList.length == 0) {
 							sa.alert('请选择边民');
@@ -91,16 +90,16 @@
 						let idArray = selectList.map(selection => selection.id);
 						let obj = {
 							groupId: this.groupId,
-							ids: idArray.join(',')
+							peopleIds: idArray.join(',')
 						};
-						sa.ajax('/levelone-server/TbPeople/joinGroup', obj, function(resp) {
+						sa.ajax('/level-one-server/TbPeople/applyAddGroup', obj, function(resp) {
 							parent.app.f5(); // 刷新父页面列表
 							sa.closeCurrIframe(); // 关闭本页
 						}.bind(this));
 					},
 					// 刷新
 					f5: function() {
-						sa.ajax('/levelone-server/TbPeople/getLeftPeople',{groupId:this.groupId}, function(res) {
+						sa.ajax('/level-one-server/TbPeople/getLeftPeople',{groupId:this.groupId}, function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数
 							sa.f5TableHeight(); // 刷新表格高度

+ 62 - 25
sa-view/tb-people/tb-people-add.html

@@ -70,26 +70,34 @@
 						</el-row>
 						<el-row :gutter="50">
 							<el-col :span="12">
-								<sa-item type="enum" name="所属互助组" v-model="m.groupId" :jv="{1: '测试组'}" jtype="3" br></sa-item>
+								<sa-item type="text" name="所属互助组"  br>
+									<el-select @change="groupChange" v-model="m.groupName" placeholder="请选择" filterable size="mini">
+										<el-option v-for="(item,index) in groupList" :key="index" :label="item.name" :value="item"> </el-option>
+									</el-select>
+								</sa-item>
 							</el-col>
 							<el-col :span="12">
-								<sa-item type="text" name="互助组名称" v-model="m.groupName" br></sa-item>
+								<sa-item type="text" name="所属互市区"  br>
+									<el-select @change="tradeAreaChange" v-model="m.tradeAreaName" placeholder="请选择" filterable size="mini">
+										<el-option v-for="(item,index) in tradeAreaList" :key="index" :label="item.name" :value="item"> </el-option>
+									</el-select>
+								</sa-item>
 							</el-col>
 						</el-row>
 						<el-row :gutter="50">
 							<el-col :span="12">
-								<sa-item type="enum" name="是否可用" v-model="m.status" :jv="{0: '否', 1: '是'}" jtype="3" br></sa-item>
+								<sa-item type="text" name="经度" v-model="m.lng" br></sa-item>
 							</el-col>
 							<el-col :span="12">
-								<sa-item type="text" name="经度" v-model="m.lng" br></sa-item>
+								<sa-item type="text" name="纬度" v-model="m.lat" br></sa-item>
 							</el-col>
 						</el-row>
 						<el-row :gutter="50">
 							<el-col :span="12">
-								<sa-item type="text" name="纬度" v-model="m.lat" br></sa-item>
+								<sa-item type="text" name="最后一次下单定位" v-model="m.lastLocation" br></sa-item>
 							</el-col>
 							<el-col :span="12">
-								<sa-item type="text" name="最后一次下单定位" v-model="m.lastLocation" br></sa-item>
+								<sa-item type="text" name="当天剩余额度" v-model="m.leftPrice" br></sa-item>
 							</el-col>
 						</el-row>
 						<el-row :gutter="50">
@@ -102,10 +110,10 @@
 						</el-row>
 						<el-row :gutter="50">
 							<el-col :span="12">
-								<sa-item type="text" name="是否锁定" v-model="m.isLock" br></sa-item>
+								<sa-item type="enum" name="是否锁定" v-model="m.isLock" :jv="{1: '启用', 2: '锁定'}" jtype="3" br></sa-item>
 							</el-col>
 							<el-col :span="12">
-								<sa-item type="text" name="当天剩余额度" v-model="m.leftPrice" br></sa-item>
+								<sa-item type="enum" name="是否可用" v-model="m.deleteStatus" :jv="{0: '否', 1: '是'}" jtype="3" br></sa-item>
 							</el-col>
 						</el-row>
 						
@@ -142,6 +150,8 @@
 				data: {
 					id: sa.p('id', 0),		// 获取超链接中的id参数(0=添加,非0=修改)
 					m: null,		// 实体对象
+					groupList: null,
+					tradeAreaList: null,
 				},
 				methods: {
 					// 创建一个 默认Model
@@ -169,6 +179,8 @@
 							detailAddress: '',		// 详细地址
 							isLock: '',		// 是否锁定
 							leftPrice: '',		// 当天剩余额度
+							tradeAreaId: '',	// 互市区Id
+							tradeAreaName: '',	// 互市区名称
 							// judgeStatus: '',		//
 							// judgeContent: '',		//
 							// registerTime: '',		//
@@ -182,6 +194,7 @@
 						// 表单校验
 						let m = this.m;
 						// sa.checkNull(m.id, '请输入 [主键]');
+						sa.checkNull(m.tradeAreaName, '请选择 [互市区]');
 						sa.checkNull(m.name, '请输入 [姓名]');
 						sa.checkNull(m.code, '请输入 [边民号]');
 						sa.checkNull(m.sex, '请输入 [性别]');
@@ -192,30 +205,30 @@
 						sa.checkNull(m.bankNo, '请输入 [银行编号]');
 						sa.checkNull(m.bankCode, '请输入 [银行卡号]');
 						sa.checkNull(m.bankName, '请输入 [银行名称]');
-						sa.checkNull(m.groupId, '请输入 [所属互助组]');
+						//sa.checkNull(m.groupId, '请输入 [所属互助组]');
 						sa.checkNull(m.groupName, '请输入 [互助组名称]');
-						sa.checkNull(m.status, '请输入 [是否可用]');
+						sa.checkNull(m.deleteStatus, '请输入 [是否可用]');
 						// sa.checkNull(m.role, '请输入 [角色]');
 						sa.checkNull(m.lng, '请输入 [经度]');
 						sa.checkNull(m.lat, '请输入 [纬度]');
 						sa.checkNull(m.lastLocation, '请输入 [最后一次下单定位]');
 						sa.checkNull(m.address, '请输入 [联系地址]');
-						sa.checkNull(m.addressIds, '请输入 [地址ID]');
+						//sa.checkNull(m.addressIds, '请输入 [地址ID]');
 						sa.checkNull(m.detailAddress, '请输入 [详细地址]');
 						sa.checkNull(m.isLock, '请输入 [是否锁定]');
 						sa.checkNull(m.leftPrice, '请输入 [当天剩余额度]');
-						sa.checkNull(m.judgeStatus, '请输入 []');
-						sa.checkNull(m.judgeContent, '请输入 []');
-						sa.checkNull(m.registerTime, '请输入 []');
-						sa.checkNull(m.judgeTime, '请输入 []');
-						sa.checkNull(m.personId, '请输入 []');
-						sa.checkNull(m.createTime, '请输入 [创建时间]');
-						sa.checkNull(m.createBy, '请输入 [创建人编号]');
-						sa.checkNull(m.createName, '请输入 [创建人名称]');
-						sa.checkNull(m.updateTime, '请输入 [更新时间]');
-						sa.checkNull(m.updateBy, '请输入 [更新人编号]');
-						sa.checkNull(m.updateName, '请输入 [更新人名称]');
-						sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
+						//sa.checkNull(m.judgeStatus, '请输入 []');
+						//sa.checkNull(m.judgeContent, '请输入 []');
+						//sa.checkNull(m.registerTime, '请输入 []');
+						//sa.checkNull(m.judgeTime, '请输入 []');
+						//sa.checkNull(m.personId, '请输入 []');
+						//sa.checkNull(m.createTime, '请输入 [创建时间]');
+						//sa.checkNull(m.createBy, '请输入 [创建人编号]');
+						//sa.checkNull(m.createName, '请输入 [创建人名称]');
+						//sa.checkNull(m.updateTime, '请输入 [更新时间]');
+						//sa.checkNull(m.updateBy, '请输入 [更新人编号]');
+						//sa.checkNull(m.updateName, '请输入 [更新人名称]');
+						//sa.checkNull(m.deleteStatus, '请输入 [删除状态]');
 
 						// 开始增加或修改
 						if(this.id <= 0) {	// 添加
@@ -236,7 +249,28 @@
 							parent.app.f5();		// 刷新父页面列表
 							sa.closeCurrIframe();	// 关闭本页
 						}
-					}
+					},
+					getGroupList: function() {
+						sa.ajax('/level-one-server/TbGroup/getList', function(res) {
+							this.groupList = res.data; // 数据
+						}.bind(this));
+					},
+					groupChange(item) {
+						this.m.groupId = item.id
+						this.m.groupName = item.name
+					},
+					getTradeArea: function() {
+						sa.ajax('/level-one-server/TbTradeArea/getList', {
+							pageSize: 100,
+							pageNo: 1
+						}, function(resp) {
+							this.tradeAreaList = resp.data;
+						}.bind(this));
+					},
+					tradeAreaChange(item) {
+						this.m.tradeAreaId = item.id
+						this.m.tradeAreaName = item.name
+					},
 				},
 				mounted: function(){
 					// 初始化数据
@@ -249,7 +283,10 @@
 								sa.alert('未能查找到 id=' + this.id + " 详细数据");
 							}
 						}.bind(this))
-					}
+					};
+					
+					this.getGroupList();
+					this.getTradeArea();
 				}
 			})
 

+ 1 - 1
sa-view/tb-people/tb-people-list.html

@@ -38,7 +38,7 @@
 					<sa-td name="互助组名称" prop="groupName" ></sa-td>
 					<sa-td name="角色" prop="role" type="num" :jv="{'1': '普通边民', '2': '兼组长'}"></sa-td>
 					<sa-td name="联系地址" prop="address" ></sa-td>
-					<sa-td name="是否锁定" prop="isLock" type="enum" :jv="{0: '否', 1: '是'}"></sa-td>
+					<sa-td name="是否锁定" prop="isLock" type="enum" :jv="{1: '否', 2: '是'}"></sa-td>
 					<el-table-column label="操作" fixed="right"  width="240px">
 						<template slot-scope="s">
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>