Browse Source

Merge branch 'dev' of http://47.101.143.145:8090/77975466/pco into dev

# Conflicts:
#	sp-server/app.pid
qzyReal 3 years ago
parent
commit
a22de049a4

+ 0 - 221
app/pages/account/index.vue

@@ -1,221 +0,0 @@
-<template>
-	<view>
-		<view class="top-bg"></view>
-		<view class="top-box">
-			<view class="top">
-				<text class="num">{{account.activeMoney}}</text>
-				<text class="p">账户余额</text>
-			</view>
-			<view class="bottom">
-				<view class="t">
-					<view class="p">账户:</view>
-					<view class="num">{{account.accountNo}}</view>
-				</view>
-				<view class="b">
-					<view class="item">
-						<view class="num">{{account.totalMoney}}</view>
-						<view class="p">总金额</view>
-					</view>
-					<view class="item">
-						<view class="num">{{account.deposit}}</view>
-						<view class="p">保证金</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="btn-box">
-			<view class="btn t" @click="chargeFn">立即充值</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				account: {
-					totalMoney: 0,
-					lockMoney: 0,
-					activeMoney: 0,
-					deposit: 0
-				},
-				info: {
-					saleCount: 0,
-					buyCount: 0
-				}
-			}
-		},
-		onShow() {
-			
-		},
-		methods: {
-			chargeFn(){
-				
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	page {
-		background-color: #fff;
-	}
-
-	.top-bg {
-		width: 100%;
-		height: 400rpx;
-		position: absolute;
-		z-index: 0;
-		background-image: linear-gradient(0deg, #fff 0%, #0080ff 40%);
-	}
-
-	.top-box {
-		position: relative;
-		z-index: 1;
-
-		.top {
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-
-			.num {
-				color: #fff;
-				font-size: 60rpx;
-				margin-top: 50rpx;
-			}
-
-			.p {
-				color: rgba(255, 255, 255, .7);
-				margin-top: 10rpx;
-			}
-		}
-
-		.bottom {
-			display: flex;
-			background-color: #fff;
-			border-radius: 20rpx;
-			margin: 40rpx;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-
-			.t {
-				display: flex;
-				width: 100%;
-				padding: 40rpx 30rpx;
-				box-sizing: border-box;
-				border-bottom: 1px solid #eee;
-
-				.p,
-				.num {
-					font-size: 30rpx;
-					color: #191919;
-				}
-
-				.num {
-					margin-left: auto;
-				}
-			}
-
-			.b {
-				display: flex;
-				width: 100%;
-				padding-bottom: 60rpx;
-
-				.item {
-					flex: 1;
-					display: flex;
-					flex-direction: column;
-					align-items: center;
-					justify-content: center;
-					box-sizing: border-box;
-
-					.num {
-						color: #191919;
-						font-size: 40rpx;
-						margin-top: 50rpx;
-						font-weight: bold;
-					}
-
-					.p {
-						color: #999;
-						margin-top: 10rpx;
-					}
-				}
-			}
-		}
-	}
-
-	.center-box {
-		position: relative;
-		z-index: 1;
-		background-color: #fff;
-		display: flex;
-		border-radius: 20rpx;
-		display: flex;
-		margin: 30rpx 40rpx;
-		padding: 15rpx;
-		box-shadow: 0 0 50rpx rgba(0, 0, 0, 0.07);
-
-		.item {
-			flex: 1;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			justify-content: center;
-			min-height: 150rpx;
-			border-radius: 999px;
-			margin: 15rpx;
-
-			.p {
-				color: #191919;
-				font-size: 32rpx;
-			}
-
-			.num {
-				font-size: 36rpx;
-				color: #0080ff;
-				margin-top: 10rpx;
-			}
-		}
-
-		.l {
-			background-color: #fff8f5;
-		}
-
-		.r {
-			background-color: #fffcf0;
-		}
-	}
-
-	.btn-box {
-		position: relative;
-		z-index: 1;
-		display: flex;
-		border-radius: 20rpx;
-		display: flex;
-		margin: 30rpx;
-		padding: 30rpx;
-		flex-direction: column;
-
-		.btn {
-			height: 88rpx;
-			width: 70%;
-			color: #fff;
-			margin: 20rpx auto;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			border-radius: 10rpx;
-		}
-
-		.t {
-			background-color: #0080ff;
-		}
-
-		.b {
-			background-color: #ffb400;
-		}
-	}
-</style>

+ 315 - 0
app/pages/wx/account-pay.vue

@@ -0,0 +1,315 @@
+<template>
+	<view>
+		<view class="top-bg"></view>
+		<view class="top-box">
+			<view class="top">
+				<text class="num">{{account.totalMoney}}</text>
+				<text class="p">账户余额</text>
+			</view>
+			<view class="bottom">
+				<view class="t">
+					<view class="p">账户:</view>
+					<view class="num">{{account.accountNo}}</view>
+				</view>
+			</view>
+		</view>
+		<view class="item">
+			<view class="l" style="margin-top: 15rpx;">
+				充值金额:
+			</view>
+			<view class="r">
+				<u-input type="number" style="border: 1rpx solid;margin-left: 8rpx;" placeholder="充值金额"
+					v-model="form.money">
+				</u-input>
+			</view>
+		</view>
+		<view v-if="money&&money>0" class="pay-money">
+			支付金额:<text>{{money}} 元</text>
+		</view>
+		<view class="btn-box">
+			<view class="btn t" @click="chargeFn">立即充值</view>
+		</view>
+		<view class="discount" v-if="discountList.length>0">
+			活动:
+			<view v-for="(item,index) in discountList">
+				{{index+1}}、充值满{{item.money}}元
+				<text v-if="item.discount<10">打{{item.discount}}折</text>
+				<text v-if="item.subtract">减{{item.subtract}}元</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var jweixin = require('@/components/jweixin-module/index.js');
+	export default {
+		data() {
+			return {
+				account: {
+					totalMoney: 0,
+					lockMoney: 0,
+					activeMoney: 0,
+					deposit: 0
+				},
+				form: {
+					money: ''
+				},
+				code: '',
+				openid: '',
+				discountList: []
+			}
+		},
+		onLoad(options) {
+			this.code = options.code;
+			this.getOpenidByCode();
+		},
+		onBackPress() {
+			this.$common.to('/pages/index/index');
+			return true;
+		},
+		mounted() {
+			this.getAccountInfo();
+			this.getDiscountInfo();
+			this.getWxConfig();
+		},
+		computed: {
+			money() {
+				let chargeMoney = this.form.money;
+				if (chargeMoney) {
+					let discountList = this.discountList;
+					let sub = 999999;
+					let obj = null;
+					for (let i in discountList) {
+						let discount = discountList[i];
+						let m = discount.money;
+						let diff = chargeMoney - m;
+						if (diff < sub && diff >= 0) {
+							sub = diff;
+							obj = discount;
+						}
+					}
+					if (obj != null) {
+						if (obj.type == 1) {
+							return (chargeMoney * (obj.discount / 10)).toFixed(2)
+						}
+						return chargeMoney - obj.subtract
+					}
+				}
+			}
+		},
+		methods: {
+			getWxConfig() {
+				let url = window.location.href;
+				this.$api.getWxConfig({
+					url: url
+				}).then(resp => {
+					jweixin.config({
+						//debug: true,
+						appId: resp.data.appId,
+						timestamp: resp.data.timestamp, // 必填,生成签名的时间戳
+						nonceStr: resp.data.noncestr, // 必填,生成签名的随机串
+						signature: resp.data.sign, // 必填,签名
+						jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表
+					});
+					jweixin.ready(function() {
+
+					});
+					jweixin.error(function(res) {
+						console.log(res)
+					});
+				})
+			},
+			getOpenidByCode() {
+				let storeOpenid = uni.getStorageSync('openid');
+				this.$api.getOpenidByCode({
+					code: this.code,
+					openid: storeOpenid
+				}).then(resp => {
+					let openid = resp.data;
+					this.openid = openid;
+					if (openid) {
+						uni.setStorageSync('openid', openid)
+					}
+
+				})
+			},
+			getAccountInfo() {
+				this.$api.getAccountInfo().then(resp => {
+					this.account = resp.data;
+				})
+			},
+			getDiscountInfo() {
+				this.$api.getDiscountInfo().then(resp => {
+					this.discountList = resp.data;
+				})
+			},
+			chargeFn() {
+				let money = this.form.money;
+				if (!money) {
+					this.$common.toast('请输入充值金额');
+				}
+				let a = {
+					id: this.account.id,
+					c: money
+				}
+				let p = {
+					a: JSON.stringify(a),
+					money: this.money>0?this.money:money,
+					tradeType: "JSAPI",
+					openid: this.openid
+				}
+				this.$api.getPrePay(this.$common.removeNull(p)).then(resp => {
+					let data = resp.data;
+					let that = this;
+					jweixin.chooseWXPay({
+						timestamp: data
+							.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
+						nonceStr: data.nonceStr, // 支付签名随机串,不长于 32 位
+						package: data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
+						signType: data.signType, // 微信支付V3的传入RSA,微信支付V2的传入格式与V2统一下单的签名格式保持一致
+						paySign: data.paySign, // 支付签名
+						success: function(res) {
+							if (res.errMsg === "chooseWXPay:ok") {
+								that.$common.toast('支付成功')
+								that.cars = [];
+								that.item.list = [];
+								that.total = 0
+								// wx.closeWindow();
+							}
+						}
+					});
+				})
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #fff;
+	}
+
+	.top-bg {
+		width: 100%;
+		height: 400rpx;
+		position: absolute;
+		z-index: 0;
+		background-image: linear-gradient(0deg, #fff 0%, #0080ff 40%);
+	}
+
+	.top-box {
+		position: relative;
+		z-index: 1;
+
+		.top {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+
+			.num {
+				color: #fff;
+				font-size: 60rpx;
+				margin-top: 50rpx;
+			}
+
+			.p {
+				color: rgba(255, 255, 255, .7);
+				margin-top: 10rpx;
+			}
+		}
+
+		.bottom {
+			display: flex;
+			background-color: #fff;
+			border-radius: 20rpx;
+			margin: 40rpx;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+
+			.t {
+				display: flex;
+				width: 100%;
+				padding: 40rpx 30rpx;
+				box-sizing: border-box;
+				border-bottom: 1px solid #eee;
+
+				.p,
+				.num {
+					font-size: 30rpx;
+					color: #191919;
+				}
+
+				.num {
+					margin-left: 30rpx;
+				}
+			}
+
+			.b {
+				display: flex;
+				width: 100%;
+				padding-bottom: 60rpx;
+
+			}
+		}
+	}
+
+
+	.item {
+		display: flex;
+		margin-top: 100rpx;
+		margin-left: 60rpx;
+	}
+
+	.btn-box {
+		position: relative;
+		z-index: 1;
+		display: flex;
+		border-radius: 20rpx;
+		display: flex;
+		margin: 30rpx;
+		padding: 30rpx;
+		flex-direction: column;
+
+		.btn {
+			height: 88rpx;
+			width: 70%;
+			color: #fff;
+			margin: 20rpx auto;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			border-radius: 10rpx;
+		}
+
+		.t {
+			background-color: #0080ff;
+		}
+
+		.b {
+			background-color: #ffb400;
+		}
+	}
+
+	.pay-money {
+		margin: 20rpx 0 0 120rpx;
+		font-size: 30rpx;
+
+		text {
+			color: red;
+			font-weight: bold;
+		}
+	}
+
+	.discount {
+		margin: 0 0 0 60rpx;
+		font-size: 27rpx;
+
+		view {
+			margin-left: 20rpx;
+			padding-top: 10rpx;
+		}
+	}
+</style>

+ 8 - 1
sp-admin/sa-frame/menu-list.js

@@ -27,7 +27,14 @@ var menuList =	[
 			{id: 'tb-costomer-maintain', name: '信息维护', url: 'sa-view/tb-costomer/tb-costomer-maintain.html'},
 		]
 	},
-	
+	{
+		id: 'tb-partner',
+		name: '合作伙伴管理',
+		icon: 'el-icon-s-custom',
+		childList: [
+			{id: 'tb-costomer-partner', name: '合作伙伴', url: 'sa-view/tb-partner/tb-partner-list.html'},
+		]
+	},
 	{
 		id: 'tb-business',
 		name: '业务录入',

+ 0 - 5
sp-admin/sa-view-sp/sp-role/menu-setup.html

@@ -86,8 +86,6 @@
 							// 只有原先有,现在没有,才会被这样判定 
 							if(this.haveList.indexOf(item) > -1 && keys.indexOf(item) == -1) {
 								isR = true;
-								console.log(item);
-								console.log(this.haveList);
 							}
 						}.bind(this))
 						// 提示 
@@ -127,7 +125,6 @@
 					},
 					// 点击回调, 处理其子节点跟随父节点的选中
 					node_click: function(node) {
-						console.log(node);
 						var is_select = this.$refs.tree.getCheckedKeys().indexOf(node.id) != -1;	// 此节点现在是否被选中 
 						if(node.children){
 							node.children.forEach(function(item) {
@@ -163,9 +160,7 @@
 					getCurrPer(){
 						sa.ajax('/SpRolePermission/getCustomerPcCode',function(resp){
 							let cuList=resp.data;
-							console.log(cuList);
 							let menu_list=	this.filterMenu(menuList,cuList);
-							console.log(menu_list);
 							this.handler(menu_list);
 						}.bind(this))
 					},

+ 1 - 1
sp-admin/sa-view-sp/sp-role/role-list.html

@@ -10,7 +10,7 @@
 		<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="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.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>

+ 1 - 1
sp-admin/sa-view/tb-costomer/customer-admin-add.html

@@ -9,7 +9,7 @@
 		<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="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.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>

+ 1 - 1
sp-admin/sa-view/tb-costomer/customer-admin-list.html

@@ -9,7 +9,7 @@
 		<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="https://unpkg.com/http-vue-loader@1.4.2/src/httpVueLoader.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>

+ 1 - 1
sp-admin/sa-view/tb-costomer/tb-costomer-add.html

@@ -101,7 +101,7 @@
 							sa.error('联系号码不正确')
 							return;
 						}
-						sa.checkNull(m.dutyPeople, '请输入 [负责人]');
+						sa.checkNull(m.dutyPeople, '请输入 [联系人]');
 						// this.m.addressIds = this.m.address_arry.join(',');
 						// sa.checkNull(m.addressIds, '请选择 [地址信息]');
 						// 开始增加或修改

+ 1 - 1
sp-admin/sa-view/tb-costomer/tb-costomer-list.html

@@ -110,7 +110,7 @@
 						}
 					},
 					p: { // 查询参数  
-						id: '', // 主键 
+						type: 0, // 主键 
 						name: '', // 名称 
 						phone: '', // 联系号码 
 						dutyPeople: '', // 负责人 

+ 106 - 0
sp-admin/sa-view/tb-partner/customer-admin-add.html

@@ -0,0 +1,106 @@
+<!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="../../static/kj/element-ui/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="https://unpkg.com/http-vue-loader@1.4.2/src/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">
+				<el-form>
+					<!-- 防止密码框被填充 -->
+					<div style="height: 0px; overflow: hidden;">
+						<el-input></el-input>
+						<el-input type="password"></el-input>
+					</div>
+					<!-- 表单 -->
+					<sa-item type="text" name="用户名" v-model="m.name" placeholder="请输入用户名" br></sa-item>
+					<sa-item type="password" name="密码" v-model="m.password" placeholder="请输入密码" br></sa-item>
+					<sa-item type="password" name="再输一次" v-model="m.againPassword" placeholder="请再输一次密码" br></sa-item>
+					<div class="c-item">
+						<label class="c-label"><span style="color: red;">*</span>角色:</label>
+					<el-select v-model="m.roleIds" multiple>
+						<el-option label="请选择" :value="0" disabled></el-option>
+						<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option>
+					</el-select>
+					</div>
+					<sa-item name="" br>
+						<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+					</sa-item>
+				</el-form>
+			</div>
+		</div>
+	
+        <script>
+			
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					sa: sa, 	// 超级对象
+					m: {
+						id: 0,
+						customerId:sa.p('customerId',''),
+						name: '',
+						avatar: '',
+						password: '',
+						againPassword:'',
+						roleIds: []
+					},
+					roleList: []
+				},
+				methods: {
+					// 修改
+					ok: function(){
+						console.log(this.m)
+						// 表单校验 
+						let m = this.m;
+						sa.checkNull(m.name, '请输入用户名');
+						sa.checkNull(m.password, '请输入密码');
+						if(m.password!==m.againPassword){
+							sa.error('两次输入密码不一致');
+							return ;
+						}
+						if(m.roleIds.length==0){
+							sa.error('请选择角色');
+							return ;
+						}
+						m.roleId=m.roleIds.join(',')
+						// 添加
+						sa.ajax('/admin/addCustomerAdmin', m, function(res){
+							sa.alert('增加成功', this.clean); 
+						
+						}.bind(this));
+						
+					},
+					clean(){
+						parent.app.f5();		// 刷新父页面列表
+						sa.closeCurrIframe();	// 关闭本页 
+					}
+				},
+				mounted: function(){
+					console.log(this.m);
+					// 加载角色 
+					sa.ajax('/role/getCustomerRoleList',{customerId:this.m.customerId}, function(res){
+						this.roleList = res.data;	// 数据  
+					}.bind(this), {msg: null});
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 278 - 0
sp-admin/sa-view/tb-partner/customer-admin-list.html

@@ -0,0 +1,278 @@
+<!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="../../static/kj/element-ui/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>
+		<style type="text/css">
+			.el-radio{margin-right: 10px;}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" style="display: none;" :style="'display: block;'">
+			<div class="c-panel">
+				<!-- ------------- 检索参数 ------------- -->
+				<h4 class="c-title">检索参数</h4>
+				<el-form>
+					<sa-item type="text" name="用户名" v-model="p.name"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<br>
+
+				</el-form>
+				<!-- ------------- 快捷按钮 ------------- -->
+				<sa-item type="fast-btn" show="add,delete,reset"></sa-item>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td type="selection"></sa-td>
+					<sa-td type="text" name="用户名" prop="name" min-width="120px"></sa-td>
+					<sa-td type="datetime" name="创建时间" prop="createTime" width="150px"></sa-td>
+					<sa-td type="datetime" name="最后登录" prop="loginTime" width="150px"></sa-td>
+					<sa-td type="text" name="登录次数" prop="loginCount" not="0" width="100px"></sa-td>
+					<sa-td type="switch" name="账号状态" prop="status" :jv="{1: '正常', 2: '禁用[#ff4949]'}" @change="s => updateStatus(s.row)" width="120px"></sa-td>
+					<el-table-column label="操作" fixed="right" width="450px">
+						<template slot-scope="s">
+							<span @click="getInfo(s.row)">
+								<el-button type="success" class="c-btn" icon="el-icon-view">查看</el-button>
+							</span>
+							<span @click="updateName(s.row)">
+								<el-button type="primary" class="c-btn" icon="el-icon-edit">改名称</el-button>
+							</span>
+							<span @click="updateAvatar(s.row)">
+								<el-button type="primary" class="c-btn" icon="el-icon-edit">改头像</el-button>
+							</span>
+							<span @click="updatePassword(s.row)">
+								<el-button type="primary" class="c-btn" icon="el-icon-edit">改密码</el-button>
+							</span>
+							<span @click="roleFn(s.row)">
+								<el-button type="primary" class="c-btn" icon="el-icon-edit">角色</el-button>
+							</span>
+							<span @click="del(s.row)">
+								<el-button type="danger" class="c-btn" icon="el-icon-delete">删除</el-button>
+							</span>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- 分页 -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+			</div>
+			<el-dialog
+			  :title="roleDialog.title"
+			  :visible.sync="roleDialog.visible"
+			  width="60%">
+			  <div >
+			  	 <el-checkbox   @change="handleCheckAllChange">全选</el-checkbox>
+			  	  <div style="margin: 15px 0;"></div>
+			  	  <el-checkbox-group v-model="roleDialog.form.roleId">
+			  	    <el-checkbox v-for="role in roleList" :label="role.id+''" :key="role.id">{{role.name}}</el-checkbox>
+			  	  </el-checkbox-group>
+			  </div>
+			  <span slot="footer" class="dialog-footer">
+			    <el-button @click="roleDialog.visible = false">取 消</el-button>
+			    <el-button type="primary" @click="confirmSetRole">确 定</el-button>
+			  </span>
+			</el-dialog>
+		</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: {
+					roleDialog:{
+						visible:false,
+						title:'',
+						form:{
+							id:'',
+							roleId:[],
+						}
+					},
+					sa: sa, 	// 超级对象
+					p: {		// 查询参数
+						name: '',
+						customerId:sa.p('customerId',''),
+						sort_type: 0,
+						pageNo: 1,
+						pageSize: 10,
+					},
+					dataCount: 0,
+					dataList: [],	// 数据集合
+					roleList: [],	// 角色集合 
+				},
+				methods: {
+					roleFn(data){
+						Object.assign(this.roleDialog,{
+							visible:true,
+							title:'设置['+data.name+']角色属性',
+							form:{
+								id:data.id,
+								roleId:data.roleId.split(',')
+							}
+						})
+					},
+					handleCheckAllChange(){
+						let roleId=this.roleDialog.form.roleId;
+						let allIds=this.roleList.map(obj=>obj.id+'');
+						this.roleDialog.form.roleId=roleId.length!=allIds.length?allIds:[];
+					},
+					confirmSetRole(){
+						let roleId=this.roleDialog.form.roleId;
+						if(roleId.length == 0) {
+							return sa.msg('请选择一个角色')
+						}
+						let o={
+							id:this.roleDialog.form.id,
+							roleId:this.roleDialog.form.roleId.join(',')
+						}
+						sa.ajax('/admin/setRole',o,function(resp){
+							this.f5();
+							this.roleDialog.visible=false;
+						}.bind(this))
+					},
+					// 刷新
+					f5: function(isPage){
+						sa.ajax('/admin/getCustomerAdminList', this.p, function(res){
+							this.dataList = res.data;	// 数据
+							this.dataCount = res.dataCount;
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 新增
+					add: function() {
+						sa.showIframe('新增用户', 'customer-admin-add.html?customerId=' + this.p.customerId, '550px', '75%');
+					},
+					// 查看详情
+					getInfo: function(data) {
+						sa.showIframe('账号详情', '../../sa-view-sp/sp-admin/admin-info.html?id=' + data.id, '700px', '80%');
+						//sa.$page.openAdminInfo(data.id, data.name);
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if(selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.getInfo(selection[0]);
+					},
+					// 修改名称 
+					updateName: function(data) {
+						layer.prompt({title: '修改账号名称'}, function(pass, index){
+							layer.close(index);
+							sa.ajax('/admin/update', {id: data.id, name: pass}, function(res){
+								data.name = pass;
+								layer.msg('修改成功');
+							})
+						});
+					},
+					// 修改头像 
+					updateAvatar: function(data) {
+						sa.uploadImage(function(src) {
+							var p = {id: data.id, avatar: src};
+							sa.ajax('/admin/updateAvatar', p, function(res) {
+								sa.msg('上传成功');
+								data.avatar = src;  
+							}.bind(this));
+						})
+					},
+					// 修改密码
+					updatePassword: function(data) {
+						layer.prompt({title: '修改密码'}, function(pass, index){
+							layer.close(index);
+							if(pass.length < 4) {
+								return layer.msg('新密码长度请不要低于4位');
+							}
+							sa.ajax('/admin/updatePassword', {id: data.id, password: pass}, function(res){
+								layer.msg('修改成功');
+							})
+						});
+					},
+					// 修改角色 
+					updateRoleId: function(data, roleId, roleName) {
+						if(data.id == sa.$sys.getCurrUser().id) {
+							return sa.alert('不能自己修改自己的角色');  
+						}
+						if(data.roleId == roleId) {
+							return sa.alert('该用户已经是' + roleName + '了');	
+						}
+						var str = '将此账号修改为 [' + roleName + '], 请确认?';
+						layer.confirm(str, {title: '请确认'}, function() {
+							sa.ajax('/admin/updateRole', {id: data.id, roleId: roleId}, function(res) {
+								sa.msg('修改成功');
+								data.roleId = roleId;
+								data.roleName = roleName;
+							}.bind(this));
+						}.bind(this));
+					},
+					// 修改用户的状态
+					updateStatus: function(data) {
+						if(data.id == sa.$sys.getCurrUser().id) {
+							data.status = 3 - data.status;  
+							return sa.alert('不能自己封禁自己');  
+						}
+						var is_ok = false;	// 记录是否成功 
+						var ajax = sa.ajax('/admin/updateStatus', {adminId: data.id, status: data.status}, function(res) {
+							sa.msg('修改成功');
+							is_ok = true;
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if(is_ok == false) {
+								data.status = 3 - data.status; 
+							}
+						})
+					},
+					// 删除 
+					del: function (data) {
+						sa.confirm('是否删除,此操作不可撤销', function(){
+							sa.ajax('/admin/delete', {id: data.id},function(res){
+								sa.arrayDelete(app.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							})
+						});
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/admin/deleteByIds', {ids: ids.join(',')}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					getRoleList(){
+						// 加载角色
+						sa.ajax('/role/getCustomerRoleList',{customerId:this.p.customerId}, function(res){
+							this.roleList = res.data;	// 数据  
+						}.bind(this), {msg: null});
+					}
+				},
+				created: function(){
+					this.f5();
+					sa.onInputEnter();	// 监听回车执行查询 
+					this.getRoleList();
+				}
+			})
+			
+		</script>
+	</body>
+</html>

+ 132 - 0
sp-admin/sa-view/tb-partner/tb-account-manager.html

@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<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="../../static/kj/element-ui/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/jquery.min.js"></script>
+		<script src="../../static/kj/layer/layer.js"></script>
+		<script src="../../static/sa.js"></script>
+
+	</head>
+	<body>
+		<div id='account' style="padding: 10px;">
+			<el-row :gutter="15">
+				<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
+					<el-col :span="24">
+						<el-form-item label="账户:" prop="accountNo">
+							{{formData.accountNo}}
+						</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="总金额:" prop="totalMoney">
+							{{formData.totalMoney}}元
+						</el-form-item>
+					</el-col>
+				<!-- 	<el-col :span="12">
+						<el-form-item label="冻结金额" prop="lockMoney">
+							<el-input v-model="formData.lockMoney" placeholder="请输入冻结金额" :disabled='true' clearable
+								:style="{width: '100%'}"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="可用余额" prop="actMoney">
+							<el-input v-model="formData.actMoney" placeholder="请输入可用余额" :disabled='true' clearable
+								:style="{width: '100%'}"></el-input>
+						</el-form-item>
+					</el-col> -->
+					<el-col :span="24">
+						<el-form-item label="充值(元):" prop="money">
+							<el-input-number v-model="money" placeholder="请输入充值金额" :step='1' step-strictly
+								:precision='1' controls-position=right :min='0'></el-input-number>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="" prop="field108">
+							<el-button type="primary" icon="el-icon-check" size="medium" @click="submitForm"> 确认充值
+							</el-button>
+						</el-form-item>
+					</el-col>
+					<el-col :span="12">
+						<el-form-item label="" prop="field109">
+							<el-button type="info" icon="el-icon-close" size="medium" @click="sa.closeCurrIframe()"> 关闭
+							</el-button>
+						</el-form-item>
+					</el-col>
+				</el-form>
+			</el-row>
+			<el-dialog title="核验身份" :visible="modal.visible" width="500px">
+				<el-form size="mini">
+					<div class="c-item br">
+						<label class="c-label"><label style="color: red">*</label>登录密码:</label>
+						<el-input placeholder="请输入登录密码" v-model="modal.form.password"></el-input>
+					</div>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-button @click="modal.visible=false">关闭</el-button>
+					<el-button type="primary" @click="subFn">确定</el-button>
+				</span>
+			</el-dialog>
+		</div>
+		<script>
+			var app = new Vue({
+				el: '#account',
+				data: {
+					customerId: sa.p('customerId', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					formData: {
+						accountNo: '',
+						totalMoney: '',
+						lockMoney: '',
+						actMoney: '',
+					},
+					money: '',
+					rules: {
+						money: [{
+							required: true,
+							message: '请输入充值金额',
+							trigger: 'blur'
+						}],
+					},
+					modal:{
+						visible:false,
+						form:{
+							password:''
+						}
+					}
+				},
+				methods: {
+					subFn(){
+						
+					},
+					submitForm() {
+						if (!this.money || this.money < 0) {
+							sa.alert('请输入充值金额')
+							return;
+						}
+						sa.ajax('/TbAccount/recharge', {
+							customerId: this.customerId,
+							money: this.money
+						}, function(resp) {
+							this.getCustomerAccount()
+						}.bind(this))
+					},
+					getCustomerAccount() {
+						sa.ajax('/TbAccount/getCustomerAccount', {
+							customerId: this.customerId
+						}, function(resp) {
+							this.formData = resp.data;
+						}.bind(this))
+					}
+				},
+				mounted: function() {
+					this.getCustomerAccount()
+				}
+			})
+		</script>
+	</body>
+</html>

+ 81 - 0
sp-admin/sa-view/tb-partner/tb-costomer-info.html

@@ -0,0 +1,81 @@
+<!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="../../static/kj/element-ui/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>
+		<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 v-if="m">
+						<el-row>
+							<el-col span="12">
+								<sa-info name="企业名称" br>{{m.name}}</sa-info>
+								<sa-info name="联系人" br>{{m.dutyPeople}}</sa-info>
+								<sa-info name="联系电话" br>{{m.phone}}</sa-info>
+								<sa-info name="结算类型" br>
+									<span v-if="m.payType == 1">现结</span>
+									<span v-if="m.payType == 2">月结</span>
+								</sa-info>
+								<!-- <sa-info name="地址" br>{{m.addressStr}}</sa-info> -->
+								<sa-info type="img" name="营业执照" :value="m.businessLicence" br></sa-info>
+								<sa-info type="enum" name="状态" :value="m.status" :jv="{0: '禁用', 1: '启用'}" br></sa-info>
+							</el-col>
+							<el-col span="12">
+								<sa-info name="创建时间" br>{{m.creareTime}}</sa-info>
+								<sa-info type="enum" name="审核状态" :value="m.judgeStatus"
+									:jv="{1: '未审核',2: '审核通过',3: '审核不通过'}" br></sa-info>
+								<sa-info name="审核时间" br>{{m.judgeTime}}</sa-info>
+								<sa-info name="审核意见" br>{{m.judgeContent}}</sa-info>
+								<sa-info name="创建时间" br>{{m.creareTime}}</sa-info>
+							</el-col>
+						</el-row>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="success" @click="sa.closeCurrIframe()">关闭</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-info": httpVueLoader('../../sa-frame/com/sa-info.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取数据ID
+					m: null
+				},
+				methods: {},
+				mounted: function() {
+					sa.ajax('/TbCostomer/getById?id=' + this.id, function(res) {
+						this.m = res.data;
+						if (res.data == null) {
+							sa.alert('未能查找到 id=' + this.id + " 详细数据");
+						}
+					}.bind(this))
+				}
+			})
+		</script>
+	</body>
+</html>

+ 232 - 0
sp-admin/sa-view/tb-partner/tb-costomer-judge.html

@@ -0,0 +1,232 @@
+<!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="../../static/kj/element-ui/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>
+	</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"></sa-item>
+					<sa-item type="text" name="联系号码" v-model="p.phone"></sa-item>
+					<sa-item type="text" name="负责人" v-model="p.dutyPeople"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<br />
+					<sa-item name="综合排序">
+						<el-radio-group v-model="p.sortType" class="s-radio-text">
+							<el-radio :label="0">默认</el-radio>
+							<el-radio :label="2">名称</el-radio>
+							<el-radio :label="8">创建时间</el-radio>
+						</el-radio-group>
+					</sa-item>
+				</el-form>
+				<el-button type="success" icon="el-icon-view" @click="getBySelect()" >查看</el-button>
+				<el-button type="info"  icon="el-icon-refresh"  @click="sa.f5()">重置</el-button>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList" >
+					<sa-td type="selection"></sa-td>
+					<sa-td name="名称" prop="name" ></sa-td>
+					<sa-td name="联系号码" prop="phone" ></sa-td>
+					<sa-td name="负责人" prop="dutyPeople" ></sa-td>
+					<sa-td name="结算类型" prop="payType" type="enum" :jv="{1: '现结', 2: '月结'}"></sa-td>
+					<sa-td name="地址" prop="addressStr" ></sa-td>
+					<sa-td name="营业执照" prop="businessLicence" type="img"></sa-td>
+					<sa-td name="创建时间" prop="creareTime" ></sa-td>
+					<sa-td name="审核状态" prop="judgeStatus" type="enum" :jv="{1: '未审核', 2: '已通过', 3: '不通过'}"></sa-td>
+					<el-table-column label="操作" fixed="right"  width="280px">
+						<template slot-scope="s">
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
+							<el-button class="c-btn" type="success" icon="el-icon-view" @click="judgeFn(s.row)">
+								审核
+							</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+			</div>
+			<el-dialog title="审核"  :visible="modal.visible" width="500px">
+				<el-form size="mini">
+					<div class="c-item br">
+						<label class="c-label"><label style="color: red">*</label>审核意见:</label>
+						<el-input placeholder="请输入审核意见" v-model="modal.form.judgeContent"></el-input>
+					</div>
+				</el-form>
+				<span slot="footer" class="dialog-footer">
+					<el-button  @click="closeFn">关闭</el-button>
+					<el-button type="danger" @click="sureJudge(3)">不通过</el-button>
+					<el-button type="primary" @click="sureJudge(2)">通过</el-button>
+				</span>
+			</el-dialog>
+		</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: {
+					modal:{
+					visible:false,
+						form:{
+							id:'',
+							judgeContent:'审核通过'
+						}
+					},
+					p: { // 查询参数  
+						id: '',		// 主键 
+						name: '',		// 名称 
+						phone: '',		// 联系号码 
+						dutyPeople: '',		// 负责人 
+						addressIds: '',		// 地址id 
+						addressStr: '',		// 地址 
+						status: '',		// 状态(0=否,1=是) 
+						creareTime: '',		// 创建时间 
+						judgeStatus: '',		// 审核状态(1=未审核,2审核通过,3审核不通过) 
+						judgeTime: '',		// 审核时间 
+						judgeContent: '',		// 审核意见 
+						pageNo: 1,		// 当前页 
+						pageSize: 10,	// 页大小 
+						sortType: 0		// 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+					currentCustomerId:'1',
+				},
+				methods: {
+					closeFn(){
+						this.modal.visible=false;
+					},
+					judgeFn(data){
+						Object.assign(this.modal,{
+							visible:true,
+							form:{
+								id:data.id,
+								judgeContent:data.judgeContent,
+								judgeStatus:data.judgeStatus
+							}
+						})
+					},
+					sureJudge(status){
+						if(this.modal.form.judgeStatus==2){
+							sa.error('已审核通过,无需再审核')
+							return;
+						}
+						let content="审核通过";
+						if(status==3){
+							if(!this.modal.form.judgeContent){
+								sa.error('请输入审核意见');
+								return;
+							}
+						}else{
+						this.modal.form.judgeContent=content;
+						}
+						this.modal.form.judgeStatus=status;
+						sa.ajax('/TbCostomer/judge',this.modal.form,function(resp){
+							this.modal.visible=false;
+							this.f5();
+						}.bind(this))
+					},
+					getCustomer(){
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							this.currentCustomerId=resp.data;
+						}.bind(this));
+					},
+					userFn(data){
+							sa.showIframe('企业用户', 'customer-admin-list.html?customerId=' + data.id, '1050px', '90%');
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbCostomer/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight();		// 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-costomer-info.html?id=' + data.id, '1050px', '90%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if(selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-costomer-add.html?id=' + data.id, '1000px', '90%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-costomer-add.html?id=-1', '550px', '80%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbCostomer/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if(selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/TbCostomer/deleteByIds', {ids: ids.join(',')}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight();		// 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 改 - 状态(0=否,1=是)
+					updateStatus: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;	
+						var oldValue = data.status;
+						var ajax = sa.ajax('/TbCostomer/updateStatus', {id: data.id, value: data.status}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if(isOk == false) {
+								data.status = oldValue; 
+							}
+						})
+					},
+				},
+				created: function() {
+					this.f5();
+					this.getCustomer();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>

+ 177 - 0
sp-admin/sa-view/tb-partner/tb-costomer-maintain.html

@@ -0,0 +1,177 @@
+<!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="../../static/kj/element-ui/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>
+</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"></sa-item>
+      <sa-item type="text" name="联系电话" v-model="p.phone"></sa-item>
+      <sa-item type="text" name="联系人" v-model="p.dutyPeople"></sa-item>
+      <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+      <br />
+    </el-form>
+    <el-button type="primary" icon="el-icon-plus" @click="add()" v-if="currentCustomerId=='1'">新增</el-button>
+<!--    <el-button type="success" icon="el-icon-view" @click="getBySelect()" >查看</el-button>-->
+    <el-button type="danger" icon="el-icon-delete" @click="deleteByIds()" v-if="currentCustomerId=='1'">删除</el-button>
+    <el-button type="info"  icon="el-icon-refresh"  @click="sa.f5()">重置</el-button>
+    <!-- ------------- 数据列表 ------------- -->
+    <el-table class="data-table" ref="data-table" :data="dataList" >
+      <sa-td type="selection"></sa-td>
+      <sa-td name="企业名称" prop="name"></sa-td>
+      <sa-td name="联系人" prop="dutyPeople"></sa-td>
+      <sa-td name="联系电话" prop="phone"></sa-td>
+      <sa-td name="结算类型" prop="payType" type="enum" :jv="{1: '现结', 2: '月结'}"></sa-td>
+      <!-- <sa-td name="地址" prop="addressStr" ></sa-td> -->
+      <sa-td name="营业执照" prop="businessLicence" type="img"></sa-td>
+      <sa-td name="状态" prop="status" type="switch" :jv="{0: '禁用[#ff0000]', 1: '启用[#005500]'}"
+             @change="s => updateStatus(s.row)"></sa-td>
+<!--      <sa-td name="创建时间" prop="creareTime"></sa-td>-->
+      <sa-td name="审核状态" prop="judgeStatus" type="enum" :jv="{1: '未审核', 2: '已通过', 3: '不通过'}"></sa-td>
+      <sa-td name="审核时间" prop="judgeTime" width="160px"></sa-td>
+      <el-table-column label="操作" fixed="right"  width="280px">
+        <template slot-scope="s">
+          <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)">修改</el-button>
+          <el-button class="c-btn" type="primary" icon="el-icon-user-solid" @click="userFn(s.row)">用户</el-button>
+          <el-button v-if="currentCustomerId==1" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- ------------- 分页 ------------- -->
+    <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
+  </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: { // 查询参数
+        id: '',		// 主键
+        name: '',		// 名称
+        phone: '',		// 联系号码
+        dutyPeople: '',		// 负责人
+        addressIds: '',		// 地址id
+        addressStr: '',		// 地址
+        status: '',		// 状态(0=否,1=是)
+        creareTime: '',		// 创建时间
+        judgeStatus: '',		// 审核状态(1=未审核,2审核通过,3审核不通过)
+        judgeTime: '',		// 审核时间
+        judgeContent: '',		// 审核意见
+        pageNo: 1,		// 当前页
+        pageSize: 10,	// 页大小
+        sortType: 0		// 排序方式
+      },
+      dataCount: 0,
+      dataList: [], // 数据集合
+      currentCustomerId:'1',
+    },
+    methods: {
+      getCustomer(){
+        sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+          this.currentCustomerId=resp.data;
+        }.bind(this));
+      },
+      userFn(data){
+        sa.showIframe('企业用户', 'customer-admin-list.html?customerId=' + data.id, '1050px', '90%');
+      },
+      // 刷新
+      f5: function() {
+        sa.ajax('/TbCostomer/getOwnList', sa.removeNull(this.p), function(res) {
+          this.dataList = res.data; // 数据
+          this.dataCount = res.dataCount; // 数据总数
+          sa.f5TableHeight();		// 刷新表格高度
+        }.bind(this));
+      },
+      // 查看
+      get: function(data) {
+        sa.showIframe('数据详情', 'tb-costomer-info.html?id=' + data.id, '800px', '80%');
+      },
+      // 查看 - 根据选中的
+      getBySelect: function(data) {
+        var selection = this.$refs['data-table'].selection;
+        if(selection.length == 0) {
+          return sa.msg('请选择一条数据')
+        }
+        this.get(selection[0]);
+      },
+      // 修改
+      update: function(data) {
+        sa.showIframe('修改数据', 'tb-costomer-add.html?id=' + data.id, '500px', '70%');
+      },
+      // 新增
+      add: function(data) {
+        sa.showIframe('新增数据', 'tb-costomer-add.html?id=-1', '550px', '80%');
+      },
+      // 删除
+      del: function(data) {
+        sa.confirm('是否删除,此操作不可撤销', function() {
+          sa.ajax('/TbCostomer/delete?id=' + data.id, function(res) {
+            sa.arrayDelete(this.dataList, data);
+            sa.ok('删除成功');
+            sa.f5TableHeight();		// 刷新表格高度
+          }.bind(this))
+        }.bind(this));
+      },
+      // 批量删除
+      deleteByIds: function() {
+        // 获取选中元素的id列表
+        let selection = this.$refs['data-table'].selection;
+        let ids = sa.getArrayField(selection, 'id');
+        if(selection.length == 0) {
+          return sa.msg('请至少选择一条数据')
+        }
+        // 提交删除
+        sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+          sa.ajax('/TbCostomer/deleteByIds', {ids: ids.join(',')}, function(res) {
+            sa.arrayDelete(this.dataList, selection);
+            sa.ok('删除成功');
+            sa.f5TableHeight();		// 刷新表格高度
+          }.bind(this))
+        }.bind(this));
+      },
+      // 改 - 状态(0=否,1=是)
+      updateStatus: function(data) {
+        // 声明变量记录是否成功
+        var isOk = false;
+        var oldValue = data.status;
+        var ajax = sa.ajax('/TbCostomer/updateStatus', {id: data.id, value: data.status}, function(res) {
+          isOk = true;
+          sa.msg('修改成功');
+        }.bind(this));
+        // 如果未能修改成功, 则回滚
+        $.when(ajax).done(function() {
+          if(isOk == false) {
+            data.status = oldValue;
+          }
+        })
+      },
+    },
+    created: function() {
+      this.f5();
+      this.getCustomer();
+      sa.onInputEnter();
+    }
+  })
+</script>
+</body>
+</html>

+ 145 - 0
sp-admin/sa-view/tb-partner/tb-partner-add.html

@@ -0,0 +1,145 @@
+<!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="../../static/kj/element-ui/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>
+		<style type="text/css">
+			.c-panel .el-form .c-label {
+				width: 7em !important;
+			}
+
+			.c-panel .el-form .el-input,
+			.c-panel .el-form .el-textarea__inner {
+				width: 250px;
+			}
+		</style>
+	</head>
+	<body>
+		<div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
+			<!-- ------- 内容部分 ------- -->
+			<div class="s-body">
+				<div class="c-panel">
+					<div class="c-title" v-if="id == 0">数据添加</div>
+					<div class="c-title" v-else>数据修改</div>
+					<el-form v-if="m">
+						<el-row>
+							<sa-item type="text" name="名称" v-model="m.name" placeholder="请输入名称" br></sa-item>
+							<sa-item type="text" name="联系人" v-model="m.dutyPeople" placeholder="请输入联系人" br></sa-item>
+							<sa-item type="text" name="联系电话" v-model="m.phone" placeholder="请输入联系号码" br></sa-item>
+							<div class="c-item">
+								<label class="c-label">类型:</label>
+								<el-select v-model="m.type" :disabled="currentCustomerId!=='1'">
+									<el-option label="消杀公司" :value="1"></el-option>
+										<el-option label="装卸公司" :value="2"></el-option>
+								</el-select>
+							</div>
+							<sa-item type="img" name="营业执照" v-model="m.businessLicence" br></sa-item>
+						</el-row>
+						<sa-item name="" class="s-ok" br>
+							<el-button type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
+						</sa-item>
+					</el-form>
+				</div>
+			</div>
+			<!-- ------- 底部按钮 ------- -->
+			<div class="s-foot">
+				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button @click="sa.closeCurrIframe()">取消</el-button>
+			</div>
+		</div>
+		<script>
+			var app = new Vue({
+				components: {
+					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
+				},
+				el: '.vue-box',
+				data: {
+					id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改) 
+					m: null, // 实体对象 
+					options: [],
+					currentCustomerId: '1',
+				},
+				methods: {
+					getCurrendCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							this.currentCustomerId = resp.data;
+						}.bind(this));
+					},
+					// 创建一个 默认Model 
+					createModel: function() {
+						return {
+							name: '', // 名称 
+							phone: '', // 联系号码 
+							dutyPeople: '', // 负责人 
+							addressIds: '', // 地址id 
+							addressStr: '', // 地址 
+							businessLicence: '', // 营业执照 
+							address_arry: [],
+							payType: 1,
+							type:1,
+							status: '1', // 状态(0=否,1=是) 
+							judgeStatus: '2', // 审核状态(1=未审核,2审核通过,3审核不通过) 
+						}
+					},
+					// 提交数据 
+					ok: function() {
+						// 表单校验 
+						let m = this.m;
+						sa.checkNull(m.name, '请输入 [名称]');
+						if (!sa.isPhone(m.phone)) {
+							sa.error('联系号码不正确')
+							return;
+						}
+						sa.checkNull(m.dutyPeople, '请输入 [联系人]');
+						if (this.id <= 0) { // 添加
+							sa.ajax('/TbCostomer/add', m, function(res) {
+								sa.alert('增加成功', this.clean);
+							}.bind(this));
+						} else { // 修改
+							sa.ajax('/TbCostomer/update/partner', m, function(res) {
+								sa.alert('修改成功', this.clean);
+							}.bind(this));
+						}
+					},
+					// 添加/修改 完成后的动作
+					clean: function() {
+						if (this.id == 0) {
+							this.m = this.createModel();
+						} else {
+							parent.app.f5(); // 刷新父页面列表
+							sa.closeCurrIframe(); // 关闭本页 
+						}
+					}
+				},
+				mounted: function() {
+					this.getCurrendCustomer()
+					// 初始化数据 
+					if (this.id <= 0) {
+						this.m = this.createModel();
+					} else {
+						sa.ajax('/TbCostomer/getById?id=' + this.id, function(res) {
+							this.m = res.data;
+							this.m.address_arry = res.data ? res.data.addressIds.split(",").map(id =>
+								parseInt(id)) : [];
+							if (res.data == null) {
+								sa.alert('未能查找到 id=' + this.id + " 详细数据");
+							}
+						}.bind(this))
+					}
+				}
+			})
+		</script>
+	</body>
+</html>

+ 226 - 0
sp-admin/sa-view/tb-partner/tb-partner-list.html

@@ -0,0 +1,226 @@
+<!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="../../static/kj/element-ui/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>
+	</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"></sa-item>
+					<sa-item type="text" name="联系电话" v-model="p.phone"></sa-item>
+					<sa-item type="text" name="联系人" v-model="p.dutyPeople"></sa-item>
+					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
+					<br />
+
+				</el-form>
+				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="currentCustomerId=='1'">新增
+				</el-button>
+ 				<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
+				<!-- ------------- 数据列表 ------------- -->
+				<el-table class="data-table" ref="data-table" :data="dataList">
+					<sa-td type="selection"></sa-td>
+					<sa-td name="名称" prop="name"></sa-td>
+					<sa-td name="类型" prop="type" type="enum" :jv="{1: '消杀公司', 2: '装卸公司'}"></sa-td>
+					<sa-td name="联系人" prop="dutyPeople"></sa-td>
+					<sa-td name="联系电话" prop="phone"></sa-td>
+					<sa-td name="营业执照" prop="businessLicence" type="img"></sa-td>
+					<sa-td name="添加时间" prop="creareTime" width="160px"></sa-td>
+					<el-table-column label="操作" fixed="right" width="320px">
+						<template slot-scope="s">
+							<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)">修改
+							</el-button>
+							<el-button class="c-btn" type="primary" icon="el-icon-user-solid" @click="userFn(s.row)">用户
+							</el-button>
+							<!-- <el-button class="c-btn" type="primary" icon="el-icon-user-solid" v-if="s.row.judgeStatus==2" @click="accountFn(s.row)">账户
+							</el-button> -->
+							<el-button v=if="currentCustomerId==1" class="c-btn" type="danger" icon="el-icon-delete"
+								@click="del(s.row)">删除</el-button>
+						</template>
+					</el-table-column>
+				</el-table>
+				<!-- ------------- 分页 ------------- -->
+				<sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
+				</sa-item>
+			</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: {
+					modal: {
+						visible: false,
+						form: {
+							id: '',
+							judgeContent: '审核通过'
+						}
+					},
+					p: { // 查询参数  
+						partner: 1, // 主键 
+						name: '', // 名称 
+						phone: '', // 联系号码 
+						dutyPeople: '', // 负责人 
+						addressIds: '', // 地址id 
+						addressStr: '', // 地址 
+						status: '', // 状态(0=否,1=是) 
+						creareTime: '', // 创建时间 
+						judgeStatus: '', // 审核状态(1=未审核,2审核通过,3审核不通过) 
+						judgeTime: '', // 审核时间 
+						judgeContent: '', // 审核意见 
+						pageNo: 1, // 当前页 
+						pageSize: 10, // 页大小 
+						sortType: 0 // 排序方式 
+					},
+					dataCount: 0,
+					dataList: [], // 数据集合 
+					currentCustomerId: '1',
+				},
+				methods: {
+					accountFn(data){
+						sa.showIframe('账户管理', 'tb-account-manager.html?customerId=' + data.id, '450px', '60%');
+					},
+					judgeFn(data) {
+						
+						Object.assign(this.modal, {
+							visible: true,
+							form: {
+								id: data.id,
+								judgeContent: data.judgeContent,
+								judgeStatus: data.judgeStatus
+							}
+						})
+					},
+					sureJudge(status) {
+						if (this.modal.form.judgeStatus == 2) {
+							sa.error('已审核通过,无需再审核')
+							return;
+						}
+						let content = "审核通过";
+						if (status == 3) {
+							if (!this.modal.form.judgeContent) {
+								sa.error('请输入审核意见');
+								return;
+							}
+						} else {
+							this.modal.form.judgeContent = content;
+						}
+						this.modal.form.judgeStatus = status;
+						sa.ajax('/TbCostomer/judge', this.modal.form, function(resp) {
+							this.modal.visible = false;
+							this.f5();
+						}.bind(this))
+					},
+					getCustomer() {
+						sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
+							this.currentCustomerId = resp.data;
+						}.bind(this));
+					},
+					userFn(data) {
+						sa.showIframe('企业用户', 'customer-admin-list.html?customerId=' + data.id, '1050px', '90%');
+					},
+					// 刷新
+					f5: function() {
+						sa.ajax('/TbCostomer/getList', sa.removeNull(this.p), function(res) {
+							this.dataList = res.data; // 数据
+							this.dataCount = res.dataCount; // 数据总数 
+							sa.f5TableHeight(); // 刷新表格高度 
+						}.bind(this));
+					},
+					// 查看
+					get: function(data) {
+						sa.showIframe('数据详情', 'tb-costomer-info.html?id=' + data.id, '800px', '80%');
+					},
+					// 查看 - 根据选中的
+					getBySelect: function(data) {
+						var selection = this.$refs['data-table'].selection;
+						if (selection.length == 0) {
+							return sa.msg('请选择一条数据')
+						}
+						this.get(selection[0]);
+					},
+					// 修改
+					update: function(data) {
+						sa.showIframe('修改数据', 'tb-partner-add.html?id=' + data.id, '500px', '70%');
+					},
+					// 新增
+					add: function(data) {
+						sa.showIframe('新增数据', 'tb-partner-add.html?id=-1', '550px', '80%');
+					},
+					// 删除
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/TbCostomer/delete?id=' + data.id, function(res) {
+								sa.arrayDelete(this.dataList, data);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 批量删除
+					deleteByIds: function() {
+						// 获取选中元素的id列表 
+						let selection = this.$refs['data-table'].selection;
+						let ids = sa.getArrayField(selection, 'id');
+						if (selection.length == 0) {
+							return sa.msg('请至少选择一条数据')
+						}
+						// 提交删除 
+						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
+							sa.ajax('/TbCostomer/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
+								sa.arrayDelete(this.dataList, selection);
+								sa.ok('删除成功');
+								sa.f5TableHeight(); // 刷新表格高度 
+							}.bind(this))
+						}.bind(this));
+					},
+					// 改 - 状态(0=否,1=是)
+					updateStatus: function(data) {
+						// 声明变量记录是否成功 
+						var isOk = false;
+						var oldValue = data.status;
+						var ajax = sa.ajax('/TbCostomer/updateStatus', {
+							id: data.id,
+							value: data.status
+						}, function(res) {
+							isOk = true;
+							sa.msg('修改成功');
+						}.bind(this));
+						// 如果未能修改成功, 则回滚 
+						$.when(ajax).done(function() {
+							if (isOk == false) {
+								data.status = oldValue;
+							}
+						})
+					},
+				},
+				created: function() {
+					this.f5();
+					this.getCustomer();
+					sa.onInputEnter();
+				}
+			})
+		</script>
+	</body>
+</html>