Browse Source

边民绑定商铺

qzy 7 tháng trước cách đây
mục cha
commit
adf1a91c94

+ 8 - 0
login.html

@@ -167,6 +167,14 @@
 				</div>
 			</div>
 			<div class="sk-rotating-plane"></div>
+			<div style="position: absolute;bottom: 10px;left: 45%;">
+				<img src="static/icon/beian.png" style="width: 18px;height: 18px;"/>
+				
+				<a href="https://beian.mps.gov.cn/#/query/webSearch" target="_blank">
+				 	滇ICP备2024030692号</a>
+				<a style="margin-left: 10px;" href="https://beian.miit.gov.cn/?spm=5176.29125882.J_9220772140.60.f1522868kNvbiS" target="_blank">
+				 	滇ICP备2024030692号-1</a>
+				</div>
 		</div>
 
 		<!-- scripts -->

+ 7 - 1
sa-frame/menu-list-sp.js

@@ -233,12 +233,18 @@ window.menuList.unshift({
 				icon: 'el-icon-user',
 				name: '边民管理',
 				url: 'sa-view/tb-people/tb-people-list.html',
-				childList: [{
+				childList: [
+					{
 						id: 'tb-people-add',
 						name: '边民添加',
 						isShow: false
 					},
 					{
+						id: 'tb-people-bind-shop',
+						name: '绑定店铺',
+						isShow: false
+					},
+					{
 						id: 'tb-people-edit',
 						name: '边民更新',
 						isShow: false

+ 160 - 51
sa-view/tb-people/tb-people-list.html

@@ -3,7 +3,8 @@
 	<head>
 		<title>边民-列表</title>
 		<meta charset="utf-8">
-		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<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">
@@ -23,37 +24,76 @@
 				<!-- <div class="c-title">检索参数</div> -->
 				<el-form ref="form" :model='p' @submit.native.prevent>
 					<sa-item type="text" name="姓名" v-model="p.name" :need="false"></sa-item>
+					<div class="c-item">
+						<label class="c-label">商铺:</label>
+						<el-select v-model="p.shopId" placeholder="输入关键字搜索" filterable size="mini">
+							<el-option label="请选择" :value="0" disabled></el-option>
+							<el-option v-for="(item,index) in shopList" :key="index"
+								:label="item.shopName+'('+item.shopNo+')'" :value="item.id"> </el-option>
+						</el-select>
+					</div>
 					<!-- <sa-item type="text" name="边民号" v-model="p.code" :need="false"></sa-item> -->
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 					<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
-					<el-button v-if="sa.isAuth('tb-people-add')" size="mini" type="primary" @click="add()">新增</el-button>
+					<el-button v-if="sa.isAuth('tb-people-add')" size="mini" type="primary"
+						@click="add()">新增</el-button>
+					<el-button v-if="sa.isAuth('tb-people-bind-shop')" size="mini" type="primary"
+						@click="bindShopBatch()">批量绑定店铺</el-button>
 				</el-form>
 				<!-- ------------- 数据列表 ------------- -->
-				<el-table class="data-table" ref="data-table" :data="dataList" >
-					<sa-td type="index" name="序号"></sa-td>
-					<sa-td name="姓名" prop="name" ></sa-td>
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td type="selection" name="序号"></sa-td>
+					<sa-td name="姓名" prop="name"></sa-td>
 					<!-- <sa-td name="边民号" prop="code" ></sa-td> -->
-					<sa-td name="手机号码" prop="phone" ></sa-td>
-					<sa-td name="身份证" prop="idCard" ></sa-td>
-					<sa-td name="互助组名称" prop="groupName" ></sa-td>
+					<sa-td name="手机号码" prop="phone"></sa-td>
+					<sa-td name="身份证" prop="idCard"></sa-td>
+					<sa-td name="互助组名称" prop="groupName"></sa-td>
+					<sa-td name="所属商铺" prop="shopName">
+						<template slot-scope="s">
+							<div>{{s.row.shopName}}
+								<el-link v-if="sa.isAuth('tb-people-bind-shop')&&s.row.shopName" type="primary"
+									@click="removeBind(s.row)" style="font-size: 12px;">(解绑)</el-link>
+							</div>
+							<el-link v-if="sa.isAuth('tb-people-bind-shop')&&!s.row.shopName" type="primary"
+								@click="selectShop(s.row)">选择</el-link>
+						</template>
+					</sa-td>
 					<sa-td name="角色" prop="role" type="enum" :jv="{'1': '普通边民', '2': '兼组长'}"></sa-td>
 					<sa-td name="是否锁定" prop="isLock" type="enum" :jv="{1: '否', 2: '是'}"></sa-td>
-					<el-table-column label="操作"  width="240px">
+					<sa-td name="创建时间" prop="createTime"></sa-td>
+					<el-table-column label="操作" width="240px">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
-							<el-button v-if="sa.isAuth('tb-people-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
-							<el-button v-if="sa.isAuth('tb-people-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+							<el-button class="c-btn" type="success" icon="el-icon-view"
+								@click="get(s.row)">查看</el-button>
+							<el-button v-if="sa.isAuth('tb-people-edit')" class="c-btn" type="primary"
+								icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+							<el-button v-if="sa.isAuth('tb-people-del')" class="c-btn" type="danger"
+								icon="el-icon-delete" @click="del(s.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
-			<div class="page-box">
-				<el-pagination background  layout="total, prev, pager, next, sizes, jumper"
-					:current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
-					:page-sizes="[10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
-				</el-pagination>
-			</div>
+				<div class="page-box">
+					<el-pagination background layout="total, prev, pager, next, sizes, jumper"
+						:current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
+						:page-sizes="[10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
+					</el-pagination>
+				</div>
 			</div>
+			<el-dialog :title="model.title" :visible.sync="model.visible" width="500px">
+				<div class="c-item">
+					<label class="c-label"><span style="color: red;">*</span>选择商铺:</label>
+					<el-select v-model="model.form.shopId" placeholder="输入关键字搜索" filterable size="mini">
+						<el-option label="请选择" :value="0" disabled></el-option>
+						<el-option v-for="(item,index) in shopList" :key="index"
+							:label="item.shopName+'('+item.shopNo+')'" :value="item.id"> </el-option>
+					</el-select>
+				</div>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="model.visible = false">取 消</el-button>
+					<el-button type="primary" @click="sureSelect">确 定</el-button>
+				</span>
+			</el-dialog>
 		</div>
 		<script>
 			var app = new Vue({
@@ -63,43 +103,106 @@
 				},
 				el: '.vue-box',
 				data: {
+					model: {
+						title: '选择商铺',
+						visible: false,
+						form: {
+							ids: '',
+							shopId: '',
+							shopName: ""
+						}
+					},
+					shopList: [],
 					p: { // 查询参数
-						name: '',		// 姓名
-						code: '',		// 边民号
-						sex: '',		// 性别(1=男,2=女)
-						age: '',		// 年龄
-						idCard: '',		// 身份证
-						phone: '',		// 手机号码
-						bankNo: '',		// 银行编号
-						bankCode: '',		// 银行卡号
-						bankName: '',		// 银行名称
-						groupId: '',		// 所属互助组(1=测试组)
-						groupName: '',		// 互助组名称
-						status: '',		// 是否可用(0=否,1=是)
-						role: '',		// 角色(1=普通边民,2=兼组长)
-						lng: '',		// 经度
-						lat: '',		// 纬度
-						lastLocation: '',		// 最后一次下单定位
-						address: '',		// 联系地址
-						addressIds: '',		// 地址ID
-						detailAddress: '',		// 详细地址
-						isLock: '',		// 是否锁定
-						leftPrice: '',		// 当天剩余额度
-						pageNo: 1,		// 当前页
-						pageSize: 10,	// 页大小
-						sortType: 0		// 排序方式
+						name: '', // 姓名
+						code: '', // 边民号
+						sex: '', // 性别(1=男,2=女)
+						age: '', // 年龄
+						idCard: '', // 身份证
+						phone: '', // 手机号码
+						bankNo: '', // 银行编号
+						bankCode: '', // 银行卡号
+						bankName: '', // 银行名称
+						groupId: '', // 所属互助组(1=测试组)
+						groupName: '', // 互助组名称
+						status: '', // 是否可用(0=否,1=是)
+						role: '', // 角色(1=普通边民,2=兼组长)
+						shopId: '', // 经度
+						address: '', // 联系地址
+						addressIds: '', // 地址ID
+						detailAddress: '', // 详细地址
+						isLock: '', // 是否锁定
+						leftPrice: '', // 当天剩余额度
+						pageNo: 1, // 当前页
+						pageSize: 10, // 页大小
+						sortType: 0 // 排序方式
 					},
 					dataCount: 0,
 					dataList: [], // 数据集合
 				},
 				methods: {
+					bindShopBatch() {
+						// 获取选中元素的id列表
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if (selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						this.model = {
+							title: '批量绑定商铺',
+							visible: true,
+							form: {
+								ids: ids.join(','),
+								shopId: '',
+							}
+						}
+					},
+					selectShop(data) {
+						this.model = {
+							title: '绑定【' + data.name + '】商铺',
+							visible: true,
+							form: {
+								ids: data.id,
+								shopId: data.shopId,
+								shopName: data.shopName
+							}
+						}
+					},
+					sureSelect() {
+						let data = this.model.form;
+						if (!data.shopId) {
+							sa.error('请选择商铺')
+							return;
+						}
+						sa.ajax('/level-one-server/TbPeople/bindShop', data, function(res) {
+							sa.ok('绑定成功');
+							this.model.visible = false;
+							this.f5()
+						}.bind(this));
+					},
+					removeBind(data) {
+						sa.confirm('是否解绑商铺?', function() {
+							sa.ajax('/level-one-server/TbPeople/removeBind?id=' + data.id, function(res) {
+								sa.ok('解绑成功');
+								this.f5()
+							}.bind(this))
+						}.bind(this));
+					},
+					getShopList() {
+						sa.ajax('/level-one-server/TbShop/getList', {
+							pageNo: 1,
+							pageSize: 100,
+						}, function(res) {
+							this.shopList = res.data; // 数据
+						}.bind(this));
+					},
 					// 刷新
 					f5: function() {
 						sa.ajax('/level-one-server/TbPeople/getList', sa.removeNull(this.p), function(res) {
-							console.log("res",res)
+							console.log("res", res)
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数
-							sa.f5TableHeight();		// 刷新表格高度
+							sa.f5TableHeight(); // 刷新表格高度
 						}.bind(this));
 					},
 					// 查看
@@ -120,7 +223,7 @@
 							sa.ajax('/level-one-server/TbPeople/delete?id=' + data.id, function(res) {
 								sa.arrayDelete(this.dataList, data);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度
+								sa.f5TableHeight(); // 刷新表格高度
 							}.bind(this))
 						}.bind(this));
 					},
@@ -129,15 +232,17 @@
 						// 获取选中元素的id列表
 						let selection = this.$refs['data-table'].selection;
 						let ids = sa.getArrayField(selection, 'id');
-						if(selection.length == 0) {
+						if (selection.length == 0) {
 							return sa.msg('请至少选择一条数据')
 						}
 						// 提交删除
 						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/level-one-server/TbPeople/deleteByIds', {ids: ids.join(',')}, function(res) {
+							sa.ajax('/level-one-server/TbPeople/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
 								sa.arrayDelete(this.dataList, selection);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度
+								sa.f5TableHeight(); // 刷新表格高度
 							}.bind(this))
 						}.bind(this));
 					},
@@ -146,13 +251,16 @@
 						// 声明变量记录是否成功
 						var isOk = false;
 						var oldValue = data.deleteStatus;
-						var ajax = sa.ajax('/level-one-server/TbPeople/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
+						var ajax = sa.ajax('/level-one-server/TbPeople/updateDeleteStatus', {
+							id: data.id,
+							value: data.deleteStatus
+						}, function(res) {
 							isOk = true;
 							sa.msg('修改成功');
 						}.bind(this));
 						// 如果未能修改成功, 则回滚
 						$.when(ajax).done(function() {
-							if(isOk == false) {
+							if (isOk == false) {
 								data.status = oldValue;
 							}
 						})
@@ -160,9 +268,10 @@
 				},
 				created: function() {
 					this.f5();
+					this.getShopList()
 					sa.onInputEnter();
 				}
 			})
 		</script>
 	</body>
-</html>
+</html>

+ 117 - 0
sa-view/tb-shop/tb-sho-people-list.html

@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>边民-列表</title>
+		<meta 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="../../static/kj/vue.min.js"></script>
+		<script src="../../static/kj/element-ui/index.js"></script>
+		<script src="../../static/kj/httpVueLoader.js"></script>
+		<script src="../../static/kj/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+		<script src="../../static/kj/upload-util.js"></script>
+
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<!-- <div class="c-title">检索参数</div> -->
+				<el-form ref="form" :model='p' @submit.native.prevent>
+					<sa-item type="text" name="姓名" v-model="p.name" :need="false"></sa-item>
+					<sa-item type="text" name="姓名" v-model="p.name" :need="false"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
+					<el-button v-if="sa.isAuth('tb-shop-people-add')" size="mini" type="primary"
+						@click="add()">新增</el-button>
+				</el-form>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td type="index" name="序号"></sa-td>
+					<sa-td name="姓名" prop="name"></sa-td>
+					<sa-td name="手机号码" prop="phone"></sa-td>
+					<sa-td name="身份证" prop="idCard"></sa-td>
+					<sa-td name="互助组名称" prop="groupName"></sa-td>
+					<el-table-column label="操作" width="140px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="danger" icon="el-icon-delete"
+								@click="delBind(s.row)">移除绑定</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<div class="page-box">
+					<el-pagination background layout="total, prev, pager, next, sizes, jumper"
+						:current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
+						:page-sizes="[10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
+					</el-pagination>
+				</div>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
+					"sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
+				},
+				el: '.vue-box',
+				data: {
+					p: { // 查询参数
+						name: '', // 姓名
+						code: '', // 边民号
+						sex: '', // 性别(1=男,2=女)
+						age: '', // 年龄
+						idCard: '', // 身份证
+						phone: '', // 手机号码
+						bankNo: '', // 银行编号
+						bankCode: '', // 银行卡号
+						bankName: '', // 银行名称
+						groupId: '', // 所属互助组(1=测试组)
+						groupName: '', // 互助组名称
+						status: '', // 是否可用(0=否,1=是)
+						role: '', // 角色(1=普通边民,2=兼组长)
+						shopId: sa.p('shopId', -1),
+						address: '', // 联系地址
+						addressIds: '', // 地址ID
+						detailAddress: '', // 详细地址
+						isLock: '', // 是否锁定
+						leftPrice: '', // 当天剩余额度
+						pageNo: 1, // 当前页
+						pageSize: 10, // 页大小
+						sortType: 0 // 排序方式
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合
+				},
+				methods: {
+					// 刷新
+					f5: function() {
+						sa.ajax('/level-one-server/TbPeople/getList', sa.removeNull(this.p), function(res) {
+							console.log("res", res)
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数
+							sa.f5TableHeight(); // 刷新表格高度
+						}.bind(this));
+					},
+					delBind(data) {
+						sa.confirm('是否解绑该边民?', function() {
+							sa.ajax('/level-one-server/TbPeople/removeBind?id=' + data.id, function(res) {
+								sa.ok('解绑成功');
+								this.f5()
+							}.bind(this))
+						}.bind(this));
+					}
+				},
+				created: function() {
+					this.f5();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 6 - 1
sa-view/tb-shop/tb-shop-list.html

@@ -65,8 +65,10 @@
 					<el-table-column align="center" prop="agentName" label="代理人"> </el-table-column>
 					<el-table-column align="center" prop="agentTel" label="代理人联系"> </el-table-column>
 					<el-table-column align="center" prop="createTime" label="创建时间"  width="160"> </el-table-column>
-					<el-table-column align="center" label="操作" fixed="right" width="240px">
+					<el-table-column align="center" label="操作" fixed="right" width="260px">
 						<template slot-scope="s">
+							<el-button class="c-btn" type="primary" icon="el-icon-s-custom" @click="peopleFn(s.row)">边民
+							</el-button>
 							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
 							</el-button>
 							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
@@ -101,6 +103,9 @@
 					dataList: [], // 数据集合
 				},
 				methods: {
+					peopleFn(data){
+						sa.showIframe('边民列表', 'tb-sho-people-list.html?shopId=' + data.id, '80%', '90%');
+					},
 					getTradeArea() {
 						sa.ajax('/level-one-server/TbTradeArea/getList', {
 							pageSize: 100,

BIN
static/icon/beian.png