浏览代码

权限完善

qzyReal 3 年之前
父节点
当前提交
d5ba56aba2
共有 56 个文件被更改,包括 1520 次插入572 次删除
  1. 9 1
      app/App.vue
  2. 3 0
      app/apis/api.js
  3. 21 16
      app/common/js/common.js
  4. 20 16
      app/pages/business-entering/business-edit.vue
  5. 5 2
      app/pages/business-entering/business-entering.vue
  6. 27 3
      app/pages/business-item/item-detail.vue
  7. 50 5
      app/pages/business-order/business-item.vue
  8. 4 4
      app/pages/business-order/business-order.vue
  9. 7 3
      app/pages/declare/add.vue
  10. 5 2
      app/pages/disinfect/addDisinfect.vue
  11. 153 82
      app/pages/index/index.vue
  12. 11 3
      app/pages/login/login.vue
  13. 13 8
      app/pages/wx/pay.vue
  14. 二进制
      app/static/home-icon-charge.png
  15. 2 2
      app/utils/request.js
  16. 1 0
      sp-admin/sa-frame/index/index.js
  17. 1 13
      sp-admin/sa-frame/menu-list-sp.js
  18. 408 66
      sp-admin/sa-frame/menu-list.js
  19. 7 8
      sp-admin/sa-frame/nav/nav-menu-bar.vue
  20. 91 69
      sp-admin/sa-view-sp/sp-role/menu-setup.html
  21. 9 5
      sp-admin/sa-view/car/tb-business-car-list.html
  22. 2 3
      sp-admin/sa-view/tb-business/tb-business-add.html
  23. 1 1
      sp-admin/sa-view/tb-business/tb-business-edit.html
  24. 11 12
      sp-admin/sa-view/tb-business/tb-business-list.html
  25. 1 0
      sp-admin/sa-view/tb-charge-record/tb-charge-record-list.html
  26. 0 2
      sp-admin/sa-view/tb-costomer/customer-admin-add.html
  27. 138 100
      sp-admin/sa-view/tb-costomer/customer-admin-list.html
  28. 2 14
      sp-admin/sa-view/tb-costomer/tb-account-manager.html
  29. 7 8
      sp-admin/sa-view/tb-costomer/tb-costomer-list.html
  30. 2 6
      sp-admin/sa-view/tb-costomer/tb-costomer-maintain.html
  31. 3 3
      sp-admin/sa-view/tb-declare/tb-declare-list.html
  32. 12 3
      sp-admin/sa-view/tb-discount/tb-discount-list.html
  33. 3 3
      sp-admin/sa-view/tb-disinfect/tb-disinfect-list.html
  34. 10 10
      sp-admin/sa-view/tb-item/tb-item-list.html
  35. 3 3
      sp-admin/sa-view/tb-notices/tb-notices-list.html
  36. 9 8
      sp-admin/sa-view/tb-partner/customer-admin-list.html
  37. 7 9
      sp-admin/sa-view/tb-partner/tb-partner-add.html
  38. 5 7
      sp-admin/sa-view/tb-partner/tb-partner-list.html
  39. 1 1
      sp-server/app.pid
  40. 1 1
      sp-server/src/main/java/com/pj/api/h5/ApiController.java
  41. 16 5
      sp-server/src/main/java/com/pj/api/open/service/OpenService.java
  42. 11 21
      sp-server/src/main/java/com/pj/api/service/ApiService.java
  43. 2 2
      sp-server/src/main/java/com/pj/api/wx/service/WxService.java
  44. 1 0
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java
  45. 12 8
      sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java
  46. 2 1
      sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemService.java
  47. 4 2
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomer.java
  48. 6 0
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java
  49. 17 15
      sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java
  50. 60 0
      sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermission.java
  51. 105 0
      sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionController.java
  52. 56 0
      sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionMapper.java
  53. 76 0
      sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionMapper.xml
  54. 48 0
      sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionService.java
  55. 29 11
      sp-server/src/main/java/com/pj/project4sp/admin/SpAdminController.java
  56. 10 5
      sp-server/src/main/java/com/pj/project4sp/admin4login/SpAccAdminService.java

+ 9 - 1
app/App.vue

@@ -4,10 +4,18 @@
 			console.log('App Launch')
 		},
 		onShow: function() {
-			console.log('App Show')
+			console.log('show')
+			this.getAuth();
 		},
 		onHide: function() {
 			console.log('App Hide')
+		},
+		methods:{
+			getAuth(){
+				this.$api.getCurrentAuthCode().then(resp=>{
+					uni.setStorageSync('perList',resp.data);
+				})
+			}
 		}
 	}
 </script>

+ 3 - 0
app/apis/api.js

@@ -19,6 +19,9 @@ export default {
 			judgeStatus: 2
 		})
 	},
+	getCurrentAuthCode(){
+		return ajax.get('/admin/getCurrentAuthCode')
+	},
 	getCarList() {
 		return ajax.get('/TbCar/getList', {
 			pageNo: 1,

+ 21 - 16
app/common/js/common.js

@@ -67,33 +67,34 @@ export default {
 		return reg.test(email)
 	},
 	// 正则验证是否为手机号
-	isPhone (str) {
+	isPhone(str) {
 		str = str + '';
-		if((/^1[345678]\d{9}$/.test(str))){ 
-			return true; 
-		} 
+		if ((/^1[345678]\d{9}$/.test(str))) {
+			return true;
+		}
 		return false;
 	},
-	isNum (str) {
+	isNum(str) {
 		str = str + '';
-		if((/^[0-9]*$/.test(str))||(/^[0-9]+(.[0-9]{1})?$/.test(str))){ 
-			return true; 
-		} 
+		if ((/^[0-9]*$/.test(str)) || (/^[0-9]+(.[0-9]{1})?$/.test(str))) {
+			return true;
+		}
 		return false;
 	},
-	isCarNo(str){
-		str=str+'';
-		let reg=/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
-		if(reg.test(str)){
+	isCarNo(str) {
+		str = str + '';
+		let reg =
+			/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/
+		if (reg.test(str)) {
 			return true;
 		}
 		return false;
 	},
-	removeNull(obj){
+	removeNull(obj) {
 		var newObj = {};
-		if(obj != undefined && obj != null) {
-			for(var key in obj) {
-				if(obj[key] === undefined || obj[key] === null || obj[key] === '') {
+		if (obj != undefined && obj != null) {
+			for (var key in obj) {
+				if (obj[key] === undefined || obj[key] === null || obj[key] === '') {
 					// 
 				} else {
 					newObj[key] = obj[key];
@@ -101,5 +102,9 @@ export default {
 			}
 		}
 		return newObj;
+	},
+	isAuth(code) {
+		let list = uni.getStorageSync('perList');
+		return list.indexOf(code) !== -1;
 	}
 }

+ 20 - 16
app/pages/business-entering/business-edit.vue

@@ -102,7 +102,7 @@
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>载重:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入载重"  v-model="form.netWeight">
+					<u-input type="number" placeholder="输入载重" v-model="form.netWeight">
 						<text slot="suffix">吨</text>
 					</u-input>
 				</view>
@@ -110,13 +110,13 @@
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>境外车牌:</view>
 				<view class="r">
-					<u-input placeholder="输入车牌号"  v-model="form.cardNo" />
+					<u-input placeholder="输入车牌号" v-model="form.cardNo" />
 				</view>
 			</view>
 			<view class="item">
 				<view class="l"><text style="color: red;">*</text>境外车规格:</view>
 				<view class="r">
-					<u-input type="number" placeholder="输入车辆规格"  v-model="form.cardSize">
+					<u-input type="number" placeholder="输入车辆规格" v-model="form.cardSize">
 						<text slot="suffix">米</text>
 					</u-input>
 				</view>
@@ -159,7 +159,7 @@
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible&&!china.visible"></u-button>
+		<u-button type="primary" text="确定" @click="saveFn" v-if="(!hs.visible&&!china.visible)&&perList.indexOf('tb-business-edit')!==-1"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
@@ -302,11 +302,13 @@
 					}
 				},
 				checkItem: '',
-				chinaCarPrefix:"浙粤京津冀晋蒙辽黑沪吉苏皖赣鲁豫鄂湘桂琼渝川贵云藏陕甘青宁"
+				chinaCarPrefix: "浙粤京津冀晋蒙辽黑沪吉苏皖赣鲁豫鄂湘桂琼渝川贵云藏陕甘青宁",
+				perList: []
 			}
 		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId');
+			this.perList = uni.getStorageSync('perList')
 		},
 		onLoad(options) {
 			this.form.id = options.id;
@@ -316,7 +318,7 @@
 			}
 			this.getGoodsList();
 			this.getUnit();
-			let that=this;
+			let that = this;
 			uni.$on('getSelectDeclare', declare => {
 				that.$nextTick(() => {
 					that.form.declareNo = declare.declareNo;
@@ -333,8 +335,8 @@
 							list.push(obj);
 							that.china.list = list;
 						})
-					}else{
-						that.china.list =[];
+					} else {
+						that.china.list = [];
 					}
 				})
 			})
@@ -414,9 +416,9 @@
 				}).then(resp => {
 					let data = resp.data;
 					this.form = data;
-					let list=this.chinaCarPrefix;
-					this.china.list=data.cars.filter(obj=>{
-						return list.indexOf(obj.carNo.substr(0,1))!==-1
+					let list = this.chinaCarPrefix;
+					this.china.list = data.cars.filter(obj => {
+						return list.indexOf(obj.carNo.substr(0, 1)) !== -1
 					});
 					console.log(this.china.list)
 					let goodsName = data.goodsName;
@@ -434,7 +436,7 @@
 							let item = items[j];
 							if (item.itemTypeId == type.id) {
 								type.itemName = item.itemName;
-								let typeName=type.name;
+								let typeName = type.name;
 								if (typeName == '干杂货人工装卸' || typeName == '特殊车辆') {
 									this.checkItem = typeName;
 								}
@@ -590,7 +592,9 @@
 
 			},
 			getCustomerList() {
-				this.$api.getCustomerList({type:0}).then(resp => {
+				this.$api.getCustomerList({
+					type: 0
+				}).then(resp => {
 					this.customer.customerList = resp.data;
 				})
 			},
@@ -675,9 +679,9 @@
 				}
 				this.form.itemJson = JSON.stringify(list);
 				this.form.peopleJson = JSON.stringify(peopleList);
-				this.form.carJson=JSON.stringify(this.china.list);
+				this.form.carJson = JSON.stringify(this.china.list);
 				this.form.items = null;
-				this.form.cars=null;
+				this.form.cars = null;
 				if (this.customerId == '1') {
 					this.form.customerId = this.customer.customerList[this.customer.index].id;
 				} else {
@@ -689,7 +693,7 @@
 			},
 			saveFn() {
 				if (this.check()) {
-					
+
 					let obj = this.$common.removeNull(this.form);
 					this.$api.saveBusiness(obj).then(resp => {
 						if (resp.code == 200) {

+ 5 - 2
app/pages/business-entering/business-entering.vue

@@ -156,7 +156,7 @@
 				合计:{{totalPrice}}元
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn" v-show="!hs.visible&&!china.visible"></u-button>
+		<u-button  type="primary" text="确定" @click="saveFn" v-show="(!hs.visible&&!china.visible)&&perList.indexOf('tb-business-add')!==-1"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
 		<u-popup :show="car.carInput" :overlay="false" @close="car.carInput=false" borderRadius="10">
@@ -299,11 +299,14 @@
 						driverPhone: ''
 					}
 				},
-				checkItem: ''
+				checkItem: '',
+				perList:[]
 			}
 		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId');
+			this.perList=uni.getStorageSync('perList')
+			console.log(this.perList)
 		},
 		computed: {
 			totalPrice() {

+ 27 - 3
app/pages/business-item/item-detail.vue

@@ -8,12 +8,36 @@
 		<view class="card-box">
 			<view class="card">
 				<view class="t">
-					<image class="icon" src="../../static/home-icon-01.png"></image>
-					<text class="title">{{businessItem.itemTypeName}}</text>
+					订单号:
+					<text class="title">{{businessItem.no}}</text>
 				</view>
 				<view class="c">
 					<view class="item car-num-item">
-						<text class="car-num">{{businessItem.itemName}}</text>
+						<text class="car-num">{{businessItem.goodsName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">类型:</text>
+						<text class="p2">{{businessItem.itemTypeName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">作业项:</text>
+						<text class="p2">{{businessItem.itemName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">越南车:</text>
+						<text class="p2">{{businessItem.cardNo}}</text>
+					</view>
+				</view>
+				<view class="c" v-if="businessItem.chinaCarNo">
+					<view class="item">
+						<text class="p1">中国车:</text>
+						<text class="p2">{{businessItem.chinaCarNo}}</text>
 					</view>
 				</view>
 				<view class="c">

+ 50 - 5
app/pages/business-order/business-item.vue

@@ -8,12 +8,36 @@
 		<view class="card-box">
 			<view class="card" v-for="(businessItem,index) in items" :key="businessItem.id">
 				<view class="t">
-					<image class="icon" src="../../static/home-icon-01.png"></image>
-					<text class="title">{{businessItem.itemTypeName}}</text>
+					订单号:
+					<text class="title">{{businessItem.no}}</text>
 				</view>
 				<view class="c">
 					<view class="item car-num-item">
-						<text class="car-num">{{businessItem.itemName}}</text>
+						<text class="car-num">{{businessItem.goodsName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">类型:</text>
+						<text class="p2">{{businessItem.itemTypeName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">作业项:</text>
+						<text class="p2">{{businessItem.itemName}}</text>
+					</view>
+				</view>
+				<view class="c">
+					<view class="item">
+						<text class="p1">越南车:</text>
+						<text class="p2">{{businessItem.cardNo}}</text>
+					</view>
+				</view>
+				<view class="c" v-if="businessItem.chinaCarNo">
+					<view class="item">
+						<text class="p1">中国车:</text>
+						<text class="p2">{{businessItem.chinaCarNo}}</text>
 					</view>
 				</view>
 				<view class="c">
@@ -64,7 +88,7 @@
 						</text>
 					</view>
 				</view>
-				<view class="b" v-if="customerId!='1'&&businessItem.pick==1&&businessItem.confirm!=1">
+				<view class="b" v-if="customerId=='1'&&businessItem.pick==1&&businessItem.confirm!=1">
 					<view class="btn b3" @click="pickFn(businessItem.id)">
 						确认</view>
 				</view>
@@ -82,22 +106,43 @@
 				openid: '',
 				form: {},
 				items: [],
+				itemId:'',
 			}
 		},
 		onLoad(options) {
 			this.form.id = options.id;
+			this.itemId=options.itemId;
 			this.openid = options.openid;
 			this.checkLogin();
 		},
 		onShow() {
 			this.customerId = uni.getStorageSync('customerId')
-			this.getBusinessById();
+			if(this.itemId){
+				this.getBusinessItem()
+			}else{
+				this.getBusinessById();
+			}
 		},
 		onBackPress() {
 			this.$common.to('/pages/index/index')
 			return true;
 		},
 		methods: {
+			getBusinessItem() {
+				this.$api.getBusinessItem({
+					id: this.itemId
+				}).then(resp => {
+					let data = resp.data;
+					if (!data) {
+						this.$common.toast('该业务已取消或删除');
+						setTimeout(() => {
+							this.$common.to('/pages/index/index')
+						}, 2000)
+						return;
+					}
+					this.items = [resp.data];
+				})
+			},
 			checkLogin() {
 				let token = uni.getStorageSync('token');
 				if (this.openid && !token) {

+ 4 - 4
app/pages/business-order/business-order.vue

@@ -50,7 +50,7 @@
 				</view>
 				<view class="b">
 					<view class="btn b3" v-if="customemrId=='1'" @click="businessFn(businessItem)">
-						业务项</view>
+						作业订单</view>
 					<view class="btn b3" v-if="businessItem.payStatus==1
 								&&perList.indexOf('tb-business-confirm')!=-1
 								&&customemrId!='1'" @click="sureZdFn(businessItem)">
@@ -58,10 +58,10 @@
 					<view class="btn b3" v-if="customemrId!=='1'" @click="fkFn(businessItem)">
 						证明</view>
 						<view class="btn b3" @click="toDetail(businessItem)">详情</view>
-					<view class="btn b1" v-if="businessItem.confirmInput==0" @click="editFn(businessItem)">修改</view>
+					<view class="btn b1" v-if="businessItem.confirmInput==0&&perList.indexOf('tb-business-edit')!==-1" @click="editFn(businessItem)">修改</view>
 					<view class="btn b4" v-if="businessItem.payStatus==1
 								&&businessItem.confirmInput==0
-								&&perList.indexOf('tb-business-add')!=-1" @click="deleteFn(businessItem)">删除</view>
+								&&perList.indexOf('tb-business-del')!==-1" @click="deleteFn(businessItem)">删除</view>
 				</view>
 			</view>
 		</view>
@@ -105,10 +105,10 @@
 		},
 		created() {
 			this.customemrId = uni.getStorageSync('customerId')
-			this.perList = uni.getStorageSync('perList')
 		},
 		onShow() {
 			this.getBusinessList();
+			this.perList = uni.getStorageSync('perList')
 		},
 		mounted() {
 		},

+ 7 - 3
app/pages/declare/add.vue

@@ -173,7 +173,7 @@
 			</view>
 
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn"></u-button>
+		<u-button v-if="perList.indexOf('tb-declare-add')!==-1" type="primary" text="确定" @click="saveFn"></u-button>
 		<u-button type="info" text="重置" @click="cleanFn" style="margin-top: 20rpx;"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
@@ -210,11 +210,14 @@
 					quarantineProof: '',
 					shop: '',
 					productionCode: '',
-					containerCode: ''
+					containerCode: '',
 				},
+				perList:[]
 			}
 		},
-		onShow() {},
+		onShow() {
+			this.perList=uni.getStorageSync('perList');
+		},
 
 		mounted() {
 			this.checkStore();
@@ -386,6 +389,7 @@
 				}
 				let noArray = chinaCarNo.replace(",", ",").split(",");
 				for (let i in noArray) {
+					let carNo=noArray[i].toUpperCase();
 					if (!this.$common.isCarNo(noArray[i])) {
 						this.$common.toast('运输车头牌不正确');
 						return;

+ 5 - 2
app/pages/disinfect/addDisinfect.vue

@@ -144,7 +144,7 @@
 				</view>
 			</view>
 		</view>
-		<u-button type="primary" text="确定" @click="saveFn"></u-button>
+		<u-button v-if="perList.indexOf('tb-disinfect-add')!==-1" type="primary" text="确定" @click="saveFn"></u-button>
 		<u-button type="info" text="重置" @click="cleanFn" style="margin-top: 20rpx;"></u-button>
 		<!-- ---------------------------------------------------------- -->
 		<view class="bottom-safety"></view>
@@ -175,9 +175,12 @@
 					chinaCarNo: '',
 					remark: ''
 				},
+				perList:[]
 			}
 		},
-		onShow() {},
+		onShow() {
+			this.perList=uni.getStorageSync('perList');
+		},
 
 		mounted() {
 			this.checkStore();

+ 153 - 82
app/pages/index/index.vue

@@ -25,7 +25,7 @@
 		</view>
 		<view class="item-box">
 			<view class="item" hover-class="hover-class" v-for="(indexItem,index) in indexItemList" :key="index"
-				@click="navTo(indexItem)" v-show="indexItem.show">
+				@click="navTo(indexItem)" v-if="checkPer(indexItem.id)||indexItem.customer">
 				<image class="icon" :src="indexItem.icon"></image>
 				<view class="text">
 					<text v-if="indexItem.text=='企业管理'&&customerId!='1'">信息管理</text>
@@ -52,10 +52,90 @@
 				companyName: '',
 				customerId: '',
 				qrcoderlc: '../../static/qrcode.png',
-				indexItemList: [],
+				indexItemList: [{
+					auth: false,
+					icon: '../../static/home-icon-01.png',
+					text: '企业注册',
+					url: '/pages/enterprise-reg/enterprise-reg',
+					customer:true
+				}],
 				code: '',
 				state: '',
-				userType: 1
+				userType: 1,
+				partnerList: [
+					{
+					id:'tb-business-item',
+					auth: true,
+					icon: '../../static/home-icon-03.png',
+					text: '我的业务',
+					url: '/pages/business-order/partner-business-item',
+				}],
+				customerList: [{
+						id: 'tb-costomer-account',
+						auth: true,
+						icon: '../../static/home-icon-charge.png',
+						text: '充值',
+						url: '/pages/account/account-redirect',
+					},
+					{
+						id: 'tb-declare',
+						auth: false,
+						icon: '../../static/home-icon-07.jpg',
+						text: '申报录入',
+						url: '/pages/declare/add',
+					},
+					{
+						id: 'tb-disinfect',
+						auth: false,
+						icon: '../../static/home-icon-06.jpg',
+						text: '消杀申报',
+						url: '/pages/disinfect/addDisinfect',
+					},
+					{
+						id: 'tb-business',
+						auth: true,
+						icon: '../../static/home-icon-02.png',
+						text: '业务录入',
+						url: '/pages/business-entering/business-entering',
+					},
+					{
+						id: 'tb-business',
+						auth: true,
+						icon: '../../static/home-icon-03.png',
+						text: '业务订单',
+						url: '/pages/business-order/business-order',
+					},
+					{
+						id: 'tb-business-car',
+						auth: true,
+						icon: '../../static/home-icon-05.png',
+						text: '出入记录',
+						url: '/pages/inout-record/inout-record',
+					}
+				],
+				adminList: [{
+						id: 'tb-business',
+						auth: true,
+						icon: '../../static/home-icon-02.png',
+						text: '业务录入',
+						url: '/pages/business-entering/business-entering',
+						
+					},
+					{
+						id: 'tb-business',
+						auth: true,
+						icon: '../../static/home-icon-03.png',
+						text: '业务订单',
+						url: '/pages/business-order/business-order',
+					},
+					{
+						id: 'tb-business-car',
+						auth: true,
+						icon: '../../static/home-icon-05.png',
+						text: '出入记录',
+						url: '/pages/inout-record/inout-record',
+					},
+				]
 			}
 		},
 		onLoad(options) {
@@ -65,14 +145,18 @@
 
 		},
 		onShow() {
-			this.getStoreInfo();
-			this.setList();
+			this.loginByOpenid();
 			this.checkUserType();
 		},
 		onBackPress() {
 			return true;
 		},
 		methods: {
+			checkPer(code) {
+				console.log(code);
+				console.log(this.$common.isAuth(code))
+				return this.$common.isAuth(code);
+			},
 			getOpenidByCode() {
 				if (!this.code) {
 					this.$common.to('/pages/home/home')
@@ -88,93 +172,68 @@
 					if (openid) {
 						uni.setStorageSync('openid', openid)
 					}
+					this.loginByOpenid(openid)
 
 				})
 			},
+			getStoreInfo() {
+				let info = uni.getStorageSync('userInfo');
+				if (info) {
+					this.isLogin = true;
+					this.userName = info.name;
+					this.customerId = info.customerId;
+				}
+			},
+			loginByOpenid() {
+				let storeOpenid = uni.getStorageSync('openid');
+				if (!storeOpenid) {
+					return;
+				}
+				this.$api.doLoginByOpenid({
+					openid: storeOpenid
+				}).then(resp => {
+					if (resp.code == 404) {
+						return;
+					}
+					this.isLogin = true;
+					let data = resp.data;
+					this.userName = data.admin.name;
+					this.customerId = data.admin.customerId;
+					if (data.tokenInfo) {
+						uni.setStorageSync('token', data.tokenInfo.tokenValue);
+						uni.setStorageSync('customerId', data.admin.customerId)
+						uni.setStorageSync('userInfo', data.admin)
+						uni.setStorageSync('perList', data.per_list)
+						this.checkUserType()
+					} else {
+						this.$common.toast(resp.msg);
+					}
+				})
+			},
 			checkUserType() {
 				let token = uni.getStorageSync('token');
 				if (token) {
-					this.$api.checkUserType().then(resp => {
-						let userType = resp.data;
-						if (userType == 3) {
-							this.indexItemList = [{
-								auth: true,
-								icon: '../../static/home-icon-03.png',
-								text: '我的业务',
-								url: '/pages/business-order/partner-business-item',
-								show: true
-							}]
-						}
+					this.$nextTick(function() {
+						this.$api.checkUserType().then(resp => {
+							let userType = resp.data;
+							if (userType == 3) {
+								this.indexItemList = this.partnerList;
+							} else if (userType == 2) { //客户
+								this.indexItemList = this.customerList
+							} else if (userType == 1) {
+								this.indexItemList = this.adminList
+							}
+						})
 					})
 				}
 			},
-			setList() {
-				this.indexItemList = [{
-						auth: false,
-						icon: '../../static/home-icon-01.png',
-						text: '企业注册',
-						url: '/pages/enterprise-reg/enterprise-reg',
-						show: uni.getStorageSync('info') ? false : true
-					},
-					{
-						auth: false,
-						icon: '../../static/home-icon-07.jpg',
-						text: '申报录入',
-						url: '/pages/declare/add',
-						show: true
-					},
-					{
-						auth: false,
-						icon: '../../static/home-icon-06.jpg',
-						text: '消杀申报',
-						url: '/pages/disinfect/addDisinfect',
-						show: true
-					},
-					{
-						auth: true,
-						icon: '../../static/home-icon-02.png',
-						text: '业务录入',
-						url: '/pages/business-entering/business-entering',
-						show: uni.getStorageSync('perList').indexOf('tb-business-add') !== -1
-					},
-					{
-						auth: true,
-						icon: '../../static/home-icon-03.png',
-						text: '业务订单',
-						url: '/pages/business-order/business-order',
-						show: true
-					},
-					{
-						auth: true,
-						icon: '../../static/home-icon-04.png',
-						text: '企业管理',
-						url: '/pages/customer-management/customer-list',
-						show: true
-					},
-					{
-						auth: true,
-						icon: '../../static/home-icon-05.png',
-						text: '出入记录',
-						url: '/pages/inout-record/inout-record',
-						show: true
-					},
-					// {
-					// 	auth: true,
-					// 	icon: '../../static/home-icon-06.jpg',
-					// 	text: '账户充值',
-					// 	url: '/pages/account/index',
-					// 	show:true
-					// },
-
-				]
-			},
 			toAccount() {
 				if (this.customerId !== '1') {
-					this.$common.to('/pages/account/account-redirect')
+					this.$common.to('/pages/customer-management/customer-list')
 				}
 			},
 			getStoreInfo() {
-				let info = uni.getStorageSync('info');
+				let info = uni.getStorageSync('userInfo');
 				if (info) {
 					this.isLogin = true;
 					this.userName = info.name;
@@ -186,10 +245,22 @@
 			},
 			exitFn() {
 				uni.removeStorageSync('token')
-				uni.removeStorageSync('info')
+				uni.removeStorageSync('userInfo')
+				uni.removeStorageSync('customerId')
+				uni.removeStorageSync('perList')
+				let storeOpenid = uni.getStorageSync('openid');
+				uni.setStorageSync('login_openid', storeOpenid);
+				uni.removeStorageSync('openid')
 				this.isLogin = false;
-				this.setList();
-				this.$common.to('/pages/login/login')
+				this.userName = '';
+				this.companyName = ''
+				this.indexItemList = [{
+					auth: false,
+					icon: '../../static/home-icon-01.png',
+					text: '企业注册',
+					url: '/pages/enterprise-reg/enterprise-reg',
+					customer:true
+				}]
 			},
 			navTo(item) {
 				let auth = item.auth;
@@ -316,7 +387,7 @@
 		box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.03);
 
 		.item {
-			width: 33.333%;
+			width: 25%;
 			display: flex;
 			flex-direction: column;
 			align-items: center;

+ 11 - 3
app/pages/login/login.vue

@@ -44,15 +44,23 @@
 					this.$common.toast('请输入密码');
 					return;
 				}
-				this.form.openid=uni.getStorageSync('openid');
+				let openid=uni.getStorageSync('openid');
+				if(!openid){
+					openid=uni.getStorageSync('login_openid');
+				}
+				this.form.openid=openid
 				this.$api.doLogin(this.form).then(resp=>{
 					let data=resp.data;
 					if(data.tokenInfo){
 						uni.setStorageSync('token',data.tokenInfo.tokenValue);
 						uni.setStorageSync('customerId',data.admin.customerId)
-						uni.setStorageSync('info',data.admin)
+						uni.setStorageSync('userInfo',data.admin)
 						uni.setStorageSync('perList',data.per_list)
-						this.$common.to('/pages/index/index')
+						uni.setStorageSync('openid',openid)
+						setTimeout(()=>{
+							this.$common.to('/pages/index/index')
+						},500)
+						
 					}else{
 						this.$common.toast('登录失败');
 					}

+ 13 - 8
app/pages/wx/pay.vue

@@ -24,7 +24,8 @@
 					<view v-for="(item,index) in cars" :key="index">
 						<label class="c-item">
 							<view class="l">
-								<u-checkbox :customStyle="{marginBottom: '8px'}" :name="item.id" :disabled="item.pay==1">
+								<u-checkbox :customStyle="{marginBottom: '8px'}" :name="item.id"
+									:disabled="item.pay==1">
 								</u-checkbox>
 							</view>
 							<view class="c">{{item.carNo}}</view>
@@ -37,7 +38,8 @@
 			<view class="card" v-if="item.itemsPrice">
 				<view class="title">
 					<u-checkbox-group placement="column" v-model="businessSelect" @change="businessChange">
-						<u-checkbox :customStyle="{color: 'black'}" :label="'业务费:'+item.itemsPrice+'元'" :name='1'>
+						<u-checkbox :disabled="businessAble" :customStyle="{color: 'black'}"
+							:label="'业务费:'+item.itemsPrice+'元'" :name='1'>
 						</u-checkbox>
 					</u-checkbox-group>
 				</view>
@@ -88,6 +90,7 @@
 				state: '',
 				list: [],
 				cars: [],
+				businessAble: true,
 				item: {
 					itemsPrice: 0,
 					businessId: '',
@@ -125,10 +128,10 @@
 						return pre + cur;
 					}, 0);
 				let itemIds = this.itemSelect;
-				let itemMoney =this.item.list? this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
+				let itemMoney = this.item.list ? this.item.list.filter(obj => itemIds.indexOf(obj.id) !== -1)
 					.map(obj => obj.price).reduce(function(pre, cur) {
 						return pre + cur;
-					}, 0):0;
+					}, 0) : 0;
 				return (carMoney + itemMoney).toFixed(2);
 			}
 		},
@@ -231,17 +234,19 @@
 				}).then(resp => {
 					let data = resp.data;
 					this.cars = data.carList;
-					this.carsSelect = this.cars.filter(obj=>obj.id==carId&&obj.pay==0).map(obj=>obj.id)
+					let list = data.itemList;
+					this.carsSelect = this.cars.filter(obj => obj.id == carId && obj.pay == 0).map(obj => obj.id)
 					Object.assign(this.item, {
 						itemsPrice: data.itemsPrice,
 						businessId: data.businessId,
-						list: data.itemList
+						list: list
 					})
+					this.businessAble = list.filter(obj => obj.pay == 1).length == list.length;
 					let selectCar = this.list.filter(obj => obj.id == carId).pop();
 					let carNo = selectCar.carNo;
 					if (!this.$common.isCarNo(carNo)) {
-						this.itemSelect = data.itemList.filter(obj=>obj.pay==0).map(obj => obj.id)
-						this.businessSelect =this.itemSelect.length==0?[]:[1]
+						this.itemSelect = data.itemList.filter(obj => obj.pay == 0).map(obj => obj.id)
+						this.businessSelect = this.itemSelect.length == 0 ? [] : [1]
 					}
 					this.list = [];
 				})

二进制
app/static/home-icon-charge.png


+ 2 - 2
app/utils/request.js

@@ -1,6 +1,6 @@
-// const server = 'http://127.0.0.1:8099/pro';
+const server = 'http://127.0.0.1:8099/pro';
 // const server = 'http://47.101.143.145/pro';
-const server = 'https://dxkaa1.bgigc.com/pro';
+// const server = 'https://dxkaa1.bgigc.com/pro';
 
 import common from '../common/js/common.js';
 

+ 1 - 0
sp-admin/sa-frame/index/index.js

@@ -112,6 +112,7 @@ var sa_admin = new Vue({
 		// 显示某个菜单,根据id 
 		showMenuById: function(id) {
 			var menu = this.getMenuById(id);
+			console.log(menu);
 			if(menu) {
 				this.showTab(menu); 
 			}

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

@@ -25,19 +25,7 @@ window.menuList.unshift(
 			{id: 'form-generator', name: '在线表单构建', url: 'https://mrhj.gitee.io/form-generator/#/'},
 		]
 	},
-	{	
-		id: 'auth',
-		name: '权限控制',
-		icon: 'el-icon-unlock',
-		info: '对系统角色权限的分配等设计,敏感度较高,请谨慎授权',
-		childList: [
-			{id: 'role-list', name: '角色列表', url: 'sa-view-sp/sp-role/role-list.html', info: '管理系统各种角色'},
-			// {id: 'menu-list', name: '菜单列表', url: 'sa-view-sp/sp-role/menu-list.html', info: '所有菜单项预览'},
-			{id: 'admin-list', name: '管理员列表', url: 'sa-view-sp/sp-admin/admin-list.html', info: '所有管理员账号'},
-			{id: 'admin-add', name: '管理员添加', url: 'sa-view-sp/sp-admin/admin-add.html', info: '添加一个管理员'},
-			// {id: 'apilog-list', name: '请求日志监控', url: 'sa-view-sp/sp-apilog/api-log-list.html', info: '记录本系统所有的api请求'},
-		]
-	},
+	
 	{
 		id: 'sp-cfg', 
 		name: '系统配置', 

+ 408 - 66
sp-admin/sa-frame/menu-list.js

@@ -15,140 +15,482 @@
 // }
 
 // 定义菜单列表 
-var menuList =	[
+var menuList = [{
+		id: 'auth',
+		parent: true,
+		name: '权限控制',
+		icon: 'el-icon-unlock',
+		childList: [{
+				id: 'role-list',
+				
+				name: '角色列表',
+				url: 'sa-view-sp/sp-role/role-list.html',
+			},
+			{
+				id: 'admin-list',
+				
+				name: '管理员列表',
+				url: 'sa-view-sp/sp-admin/admin-list.html',
+			},
+		]
+	},
 	{
 		id: 'tb-costomer',
 		name: '客户管理',
+		parent: true,
 		icon: 'el-icon-s-custom',
-		info: '客户管理表数据的维护',
-		childList: [
-			{id: 'tb-costomer-list', name: '客户列表', url: 'sa-view/tb-costomer/tb-costomer-list.html'},
-			// {id: 'tb-costomer-judge', name: '客户审核', url: 'sa-view/tb-costomer/tb-costomer-judge.html'},
-			{id: 'tb-costomer-maintain', name: '信息维护', url: 'sa-view/tb-costomer/tb-costomer-maintain.html'},
+		childList: [{
+				
+				id: 'tb-costomer-list',
+				name: '客户列表',
+				url: 'sa-view/tb-costomer/tb-costomer-list.html'
+			},
+			{
+				id: 'tb-costomer-add',
+				name: '添加',
+				
+				isShow: false
+			},
+			{
+				id: 'tb-costomer-judge',
+				name: '审核',
+				
+				isShow: false
+			},
+			{
+				id: 'tb-costomer-del',
+				name: '删除',
+				
+				isShow: false
+			},
+			{
+				id: 'tb-costomer-edit',
+				name: '修改',
+				
+				isShow: false
+			},
+			{
+				id: 'tb-costomer-account',
+				name: '账户',
+				
+				isShow: false,
+				childList: [{
+					id: 'tb-costomer-account-charge',
+					name: '充值',
+					isShow: false,
+					
+				}]
+			},
+			{
+				id: 'tb-costomer-user',
+				name: '用户管理',
+				isShow: false,
+				childList: [{
+						id: 'tb-costomer-user-add',
+						name: '添加',
+						isShow: false,
+						
+					},
+					{
+						id: 'tb-costomer-user-del',
+						name: '删除',
+						isShow: false,
+						
+					},
+					{
+						id: 'tb-costomer-user-edit',
+						name: '编辑',
+						isShow: false,
+						
+					},
+				]
+			},
 		]
 	},
 	{
+		id: 'tb-costomer-maintain',
+		name: '信息维护',
+		parent: true,
+		icon: 'el-icon-s-custom',
+		childList: [{
+			id: 'tb-costomer-maintain-list',
+			name: '企业信息',
+			
+			icon: 'el-icon-s-custom',
+			url: 'sa-view/tb-costomer/tb-costomer-maintain.html',
+			childList: [{
+					id: 'tb-costomer-maintain-edit',
+					name: '编辑信息',
+					icon: 'el-icon-s-custom',
+					isShow: false
+				},
+				{
+					id: 'tb-costomer-maintain-account',
+					name: '账户管理',
+					icon: 'el-icon-s-custom',
+					isShow: false
+				},
+				{
+					id: 'tb-costomer-maintain-user',
+					name: '用户管理',
+					parent: true,
+					isShow: false,
+					childList: [{
+							id: 'tb-costomer-maintain-user-add',
+							name: '添加',
+							isShow: false,
+							
+						},
+						{
+							id: 'tb-costomer-maintain-user-del',
+							name: '删除',
+							isShow: false,
+							
+						},
+						{
+							id: 'tb-costomer-maintain-user-edit',
+							name: '编辑',
+							isShow: false,
+							
+						},
+					]
+				},
+			]
+		}, ]
+	},
+	{
 		id: 'tb-partner',
 		name: '合作伙伴',
+		parent: true,
 		icon: 'el-icon-s-custom',
-		childList: [
-			{id: 'tb-costomer-partner', name: '合作伙伴', url: 'sa-view/tb-partner/tb-partner-list.html'},
-		]
+		childList: [{
+			id: 'tb-partner-list',
+			name: '信息管理',
+			url: 'sa-view/tb-partner/tb-partner-list.html',
+			childList: [{
+					id: 'tb-partner-add',
+					name: '添加伙伴',
+					isShow: false,
+					
+				},
+				{
+					id: 'tb-partner-del',
+					name: '删除伙伴',
+					isShow: false,
+					
+				},
+				{
+					id: 'tb-partner-edit',
+					name: '编辑伙伴',
+					isShow: false,
+					
+				},
+				{
+					id: 'tb-partner-user',
+					name: '伙伴用户',
+					isShow: false,
+					parent: true,
+					childList: [{
+							id: 'tb-partner-user-add',
+							name: '添加用户',
+							isShow: false,
+							
+						},
+						{
+							id: 'tb-partner-user-edit',
+							name: '编辑用户',
+							isShow: false,
+							
+						},
+						{
+							id: 'tb-partner-user-del',
+							name: '删除用户',
+							isShow: false,
+							
+						},
+					]
+				},
+			],
+		}, ]
 	},
 	{
 		id: 'tb-business-item',
 		name: '作业管理',
 		icon: 'el-icon-edit-outline',
-		info: '业务订单',
-		childList: [
-			{id: 'tb-business-item-list', name: '作业订单', url: 'sa-view/tb-partner/tb-business-item-list.html'},
+		parent: true,
+		childList: [{
+			id: 'tb-business-item-list',
+			name: '作业订单',
+			url: 'sa-view/tb-partner/tb-business-item-list.html',
+			childList:[
+				{
+					id: 'tb-business-item-confirm',
+					name: '接单确认',
+					isShow: false,
+				},
+			]
+		}, 
+		
 		]
 	},
 	{
 		id: 'tb-business',
 		name: '业务录入',
 		icon: 'el-icon-edit-outline',
-		info: '业务登记表数据的维护',
-		childList: [
-			{id: 'tb-business-list', name: '业务列表', url: 'sa-view/tb-business/tb-business-list.html'},
-			{id: 'tb-business-add', name: '录入业务', url: 'sa-view/tb-business/tb-business-add.html', isShow: false},
-			{id: 'tb-business-confirm', name: '业务确认', url: 'sa-view/tb-business/tb-business-list.html', isShow: false},
-			{id: 'tb-business-pay', name: '业务支付', url: 'sa-view/tb-business/tb-business-list.html', isShow: false},
+		parent: true,
+		childList: [{
+				
+				id: 'tb-business-list',
+				name: '业务列表',
+				url: 'sa-view/tb-business/tb-business-list.html',
+				childList: [{
+						
+						id: 'tb-business-add',
+						name: '添加业务',
+						isShow: false
+					},
+					{
+						
+						id: 'tb-business-del',
+						name: '删除业务',
+						isShow: false
+					},
+					{
+						id: 'tb-business-edit',
+						name: '修改业务',
+						isShow: false,
+						childList: [{
+							id: 'tb-business-car-change',
+							name: '确认出入场',
+							isShow: false,
+						}]
+					},
+					{
+						id: 'tb-business-confirm',
+						name: '确认账单',
+						isShow: false,
+					},
+					{
+						id: 'tb-business-pay',
+						name: '支付账单',
+						isShow: false,
+					},
+
+				]
+			},
+
 		]
 	},
 
-
 	{
 		id: 'tb-business-car',
 		name: '放行记录',
 		icon: 'el-icon-notebook-2',
-		info: '放行日志表数据的维护',
-		childList: [
-			{id: 'tb-business-car-list', name: '放行列表', url: 'sa-view/tb-business-car/tb-business-car-list.html'},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-business-car-list',
+			name: '放行列表',
+			
+			url: 'sa-view/tb-business-car/tb-business-car-list.html'
+		}, ]
 	},
 	{
 		id: 'info-setting',
 		name: '信息设置',
 		icon: 'el-icon-monitor',
-		info: '信息设置',
-		childList: [
-			{
-				id: 'tb-item',
-				name: '收费管理',
-				icon: 'el-icon-coin',
-				info: '收费标准表数据的维护',
-				childList: [
-					{id: 'tb-item-list', name: '收费标准', url: 'sa-view/tb-item/tb-item-list.html'},
-				]
-			},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-item',
+			name: '收费管理',
+			icon: 'el-icon-coin',
+			parent: true,
+			childList: [{
+					
+					id: 'tb-item-list',
+					name: '收费标准',
+					url: 'sa-view/tb-item/tb-item-list.html'
+				},
+				{
+					
+					id: 'tb-item-list-edit-type',
+					name: '修改类型',
+					isShow: false
+				},
+			]
+		}, ]
 	},
 	{
 		id: 'tb-notices',
 		name: '消息管理',
 		icon: 'el-icon-news',
-		info: '消息表表数据的维护',
-		childList: [
-			{id: 'tb-notices-list', name: '消息列表', url: 'sa-view/tb-notices/tb-notices-list.html'},
+		parent: true,
+		childList: [{
+				id: 'tb-notices-list',
+				name: '消息列表',
+				url: 'sa-view/tb-notices/tb-notices-list.html',
+				
+				childList: [{
+						
+						id: 'tb-notices-add',
+						name: '添加消息',
+						isShow: false
+					},
+					{
+						
+						id: 'tb-notices-del',
+						name: '删除消息',
+						isShow: false
+					},
+					{
+						
+						id: 'tb-notices-edit',
+						name: '修改消息',
+						isShow: false
+					},
+				]
+			},
+
 		]
 	},
 	{
 		id: 'tb-charge-record',
 		name: '充值记录',
 		icon: 'el-icon-folder-opened',
-		info: '充值记录表数据的维护',
-		childList: [
-			{id: 'tb-charge-record-list', name: '充值记录', url: 'sa-view/tb-charge-record/tb-charge-record-list.html'},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-charge-record-list',
+			name: '充值记录',
+			url: 'sa-view/tb-charge-record/tb-charge-record-list.html'
+		}, ]
 	},
 	{
 		id: 'tb-pay-record',
 		name: '支付记录',
 		icon: 'el-icon-folder-opened',
-		info: '支付记录表数据的维护',
-		childList: [
-			{id: 'tb-pay-record-list', name: '支付记录', url: 'sa-view/tb-pay-record/tb-pay-record-list.html'},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-pay-record-list',
+			name: '支付记录',
+			url: 'sa-view/tb-pay-record/tb-pay-record-list.html'
+		}, ]
 	},
 	{
 		id: 'tb-declare',
 		name: '申报信息',
 		icon: 'el-icon-folder-opened',
-		info: '申报表数据的维护',
-		childList: [
-			{id: 'tb-declare-list', name: '申报列表', url: 'sa-view/tb-declare/tb-declare-list.html'}
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-declare-list',
+			name: '申报列表',
+			url: 'sa-view/tb-declare/tb-declare-list.html',
+			
+			childList: [{
+					id: 'tb-declare-print',
+					name: '打印申报信息',
+					isShow: false
+				},
+				{
+					id: 'tb-declare-add',
+					name: '添加申报信息',
+					isShow: false
+				},
+				{
+					id: 'tb-declare-edit',
+					name: '修改申报信息',
+					isShow: false
+				},
+				{
+					id: 'tb-declare-del',
+					name: '删除申报信息',
+					isShow: false
+				},
+			]
+		}, ]
 	},
 	{
 		id: 'tb-disinfect',
 		name: '消毒信息',
 		icon: 'el-icon-folder-opened',
-		info: '消毒申请单表数据的维护',
-		childList: [
-			{id: 'tb-disinfect-list', name: '申请列表', url: 'sa-view/tb-disinfect/tb-disinfect-list.html'},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-disinfect-list',
+			name: '申请列表',
+			url: 'sa-view/tb-disinfect/tb-disinfect-list.html',
+			childList: [{
+					id: 'tb-disinfect-print',
+					name: '打印信息',
+					isShow: false
+				},
+				{
+					id: 'tb-disinfect-edit',
+					name: '修改信息',
+					isShow: false
+				},
+				{
+					id: 'tb-disinfect-del',
+					name: '删除信息',
+					isShow: false
+				},
+			]
+		}, ]
 	},
 	{
 		id: 'tb-discount',
 		name: '折扣管理',
 		icon: 'el-icon-folder-opened',
-		info: '折扣管理表数据的维护',
-		childList: [
-			{id: 'tb-discount-list', name: '折扣管理-列表', url: 'sa-view/tb-discount/tb-discount-list.html'},
-			{id: 'tb-discount-add', name: '折扣管理-添加', url: 'sa-view/tb-discount/tb-discount-add.html'},
-		]
+		parent: true,
+		childList: [{
+			id: 'tb-discount-list',
+			name: '折扣管理',
+			url: 'sa-view/tb-discount/tb-discount-list.html',
+			childList: [{
+					id: 'tb-discount-add',
+					name: '添加折扣',
+					isShow: false
+				},
+				{
+					id: 'tb-discount-del',
+					name: '删除',
+					isShow: false
+				},
+				{
+					id: 'tb-discount-edit',
+					name: '编辑',
+					isShow: false
+				},
+				{
+					id: 'tb-discount-change',
+					name: '启用/停用',
+					isShow: false
+				},
+			]
+		}, ]
 	},
 	{
 		id: 'tb-fee-statistics',
 		name: '收费统计',
 		icon: 'el-icon-folder-opened',
-		info: '收费统计表表数据的维护',
-		childList: [
-			{id: 'tb-fee-details-list', name: '收费明细', url: 'sa-view/tb-fee-statistics/tb-fee-details-list.html'},
-			{id: 'tb-fee-statistics-list', name: '日统计', url: 'sa-view/tb-fee-statistics/tb-fee-statistics-list.html'},
-			{id: 'month-statistcs-list', name: '月统计', url: 'sa-view/tb-fee-statistics/month-statistcs-list.html'},
-			{id: 'year-statistcs-list', name: '年统计', url: 'sa-view/tb-fee-statistics/year-statistcs-list.html'},
+		parent: true,
+		childList: [{
+				id: 'tb-fee-details-list',
+				name: '收费明细',
+				url: 'sa-view/tb-fee-statistics/tb-fee-details-list.html'
+			},
+			{
+				id: 'tb-fee-statistics-list',
+				name: '日统计',
+				url: 'sa-view/tb-fee-statistics/tb-fee-statistics-list.html'
+			},
+			{
+				id: 'month-statistcs-list',
+				name: '月统计',
+				url: 'sa-view/tb-fee-statistics/month-statistcs-list.html'
+			},
+			{
+				id: 'year-statistcs-list',
+				name: '年统计',
+				url: 'sa-view/tb-fee-statistics/year-statistcs-list.html'
+			},
 		]
 	},
-]
+]

+ 7 - 8
sp-admin/sa-frame/nav/nav-menu-bar.vue

@@ -11,19 +11,18 @@
 			-->
 			<el-menu 
 				class="el-menu-style-1" 
-				:unique-opened="true" 	
 				:default-active="$root.activeMenuId" 
 				:collapse="!$root.isOpen"
 				@select="selectMenu" 
 				>
-				<div v-for="(menu, index) in $root.menuList" :key="index">
+				<div v-for="(menu, index) in $root.menuList" v-if="!menu.show" :key="index">
 					<!-- 1 如果是子菜单 -->
-					<el-menu-item v-if="!menu.childList && menu.isShow !== false && $root.showList.indexOf(menu.id) > -1" :index="menu.id + '' ">
+					<el-menu-item v-if="!menu.parent && menu.isShow !== false && $root.showList.indexOf(menu.id) > -1" :index="menu.id + '' ">
 						<span class="menu-i"><i :class="menu.icon" :title="menu.name"></i></span>
 						<span class="menu-name">{{menu.name}}</span>
 					</el-menu-item>
 					<!-- 1 如果是父菜单 -->
-					<el-submenu v-if="menu.childList && menu.isShow !== false && $root.showList.indexOf(menu.id) > -1" :index="menu.id + '' ">
+					<el-submenu v-if="menu.parent && menu.isShow !== false && $root.showList.indexOf(menu.id) > -1" :index="menu.id + '' ">
 						<template slot="title">
 							<span class="menu-i"><i :class="menu.icon" :title="menu.name"></i></span>
 							<span class="menu-name">{{menu.name}}</span>
@@ -31,12 +30,12 @@
 						<!-- 遍历其子项 -->
 						<div v-for="(menu2, index) in menu.childList" :key="index">
 							<!-- 2 如果是子菜单 -->
-							<el-menu-item v-if="!menu2.childList && menu2.isShow !== false && $root.showList.indexOf(menu2.id) > -1" :index="menu2.id + '' ">
+							<el-menu-item v-if="!menu2.parent && menu2.isShow !== false && $root.showList.indexOf(menu2.id) > -1" :index="menu2.id + '' ">
 								<span class="menu-i"><i :class="menu2.icon" :title="menu2.name"></i></span>
 								<span class="menu-name">{{menu2.name}}</span>
 							</el-menu-item>
 							<!-- 2 如果是父菜单 -->
-							<el-submenu v-if="menu2.childList && menu2.isShow !== false && $root.showList.indexOf(menu2.id) > -1" :index="menu2.id + '' ">
+							<el-submenu v-if="menu2.parent && menu2.isShow !== false && $root.showList.indexOf(menu2.id) > -1" :index="menu2.id + '' ">
 								<template slot="title">
 									<span class="menu-i"><i :class="menu2.icon" :title="menu2.name"></i></span>
 									<span class="menu-name">{{menu2.name}}</span>
@@ -44,12 +43,12 @@
 								<!-- 遍历其子项 -->
 								<div v-for="(menu3, index) in menu2.childList" :key="index">
 									<!-- 3 如果是子菜单 -->
-									<el-menu-item v-if="!menu3.childList && menu3.isShow !== false && $root.showList.indexOf(menu3.id) > -1" :index="menu3.id + '' ">
+									<el-menu-item v-if="!menu3.parent && menu3.isShow !== false && $root.showList.indexOf(menu3.id) > -1" :index="menu3.id + '' ">
 										<span class="menu-i"><i :class="menu3.icon" :title="menu3.name"></i></span>
 										<span class="menu-name">{{menu3.name}}</span>
 									</el-menu-item>
 									<!-- 3 如果是父菜单 -->
-									<el-submenu v-if="menu3.childList && menu3.isShow !== false && $root.showList.indexOf(menu3.id) > -1" :index="menu3.id + '' ">
+									<el-submenu v-if="menu3.parent && menu3.isShow !== false && $root.showList.indexOf(menu3.id) > -1" :index="menu3.id + '' ">
 										<template slot="title">
 											<span class="menu-i"><i :class="menu3.icon" :title="menu3.name"></i></span>
 											<span class="menu-name">{{menu3.name}}</span>

+ 91 - 69
sp-admin/sa-view-sp/sp-role/menu-setup.html

@@ -1,24 +1,33 @@
-
 <!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" />
+		<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"> 
+		<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>
-        <style>
-			body,.el-tree{background-color: #eee;}
-			.el-tree-node{margin: 0.15em 0 !important;}
+		<style>
+			body,
+			.el-tree {
+				background-color: #eee;
+			}
+
+			.el-tree-node {
+				margin: 0.15em 0 !important;
+			}
+
 			/* 悬浮时颜色更深一点 */
-			.el-tree-node__content:hover{background-color: #CFE8FC !important;}
-        </style>
+			.el-tree-node__content:hover {
+				background-color: #CFE8FC !important;
+			}
+		</style>
 	</head>
 	<body>
 		<div class="vue-box sbot" style="display: none;" :style="'display: block;'">
@@ -29,22 +38,13 @@
 					<el-form>
 						<div class="c-title">所有权限</div>
 						<!-- 此扩展能递归渲染一个权限树,点击深层次节点,父级节点中没有被选中的节点会被自动选中,单独点击父节点,子节点会全部 选中/去选中 -->
-						<el-tree
-							ref="tree"
-							:data="dataList"
-							show-checkbox 
-							node-key="id"
-							:default-expand-all="true"
-							:default-checked-keys="selectList" 
-							:expand-on-click-node="false"
-							:check-on-click-node="true"
-							:check-strictly="true"
-							@node-click="node_click"
-							@check="node_click"
-							>
+						<el-tree ref="tree" :data="dataList" show-checkbox node-key="id" :default-expand-all="true"
+							:default-checked-keys="selectList" :expand-on-click-node="false" :check-on-click-node="true"
+							:check-strictly="true" @node-click="node_click" @check="node_click">
 							<span class="custom-tree-node" slot-scope="s">
-								<span style="color: #2D8CF0;" v-if="s.data.isShow == undefined || s.data.isShow == true">{{ s.data.name }}</span>
-								<span style="color: #999;" v-if="s.data.isShow == false">{{ s.data.name }} (隐藏)</span>
+								<span style="color: #2D8CF0;"
+									v-if="s.data.isShow == undefined || s.data.isShow == true">{{ s.data.name }}</span>
+								<span style="color: #999;" v-if="s.data.isShow == false">{{ s.data.name }} </span>
 								<span style="color: #999;" v-if="s.data.info">&emsp;———— {{s.data.info}} </span>
 							</span>
 						</el-tree>
@@ -58,43 +58,43 @@
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>
-		<script src="../../sa-frame/menu-list.js?v=32648732"></script> 
-		<script src="../../sa-frame/menu-list-sp.js"></script> 
+		<script src="../../sa-frame/menu-list.js?v=32648732"></script>
+		<script src="../../sa-frame/menu-list-sp.js"></script>
 		<script src="../../sa-frame/index/admin-util.js"></script>
-        <script>
+		<script>
 			var roleId = sa.p('roleId');
 			var app = new Vue({
 				el: '.vue-box',
 				data: {
 					p: [],
-					dataList: [],	// 数据集合 
-					selectList: [],	// 默认选中
-					ywList: [],		// 一维数组 
-					haveList: []		// 这个角色用的权限id,拷贝 
+					dataList: [], // 数据集合 
+					selectList: [], // 默认选中
+					ywList: [], // 一维数组 
+					haveList: [] // 这个角色用的权限id,拷贝 
 				},
 				methods: {
 					// 保存
-					ok: function(clickCount){
-						if(clickCount === undefined) {
+					ok: function(clickCount) {
+						if (clickCount === undefined) {
 							clickCount = 5;
 						}
 						// 判断是否改掉了关键权限 
-						var keys = this.$refs.tree.getCheckedKeys();		// 设置完拥有的id列表 
-						var rArr = ['1', '99', 'auth', 'role-list'];		// 敏感菜单id列表 
-						var isR = false;									// 是否给改掉了 
+						var keys = this.$refs.tree.getCheckedKeys(); // 设置完拥有的id列表 
+						var rArr = ['1', '99', 'auth', 'role-list']; // 敏感菜单id列表 
+						var isR = false; // 是否给改掉了 
 						rArr.forEach(function(item) {
 							// 只有原先有,现在没有,才会被这样判定 
-							if(this.haveList.indexOf(item) > -1 && keys.indexOf(item) == -1) {
+							if (this.haveList.indexOf(item) > -1 && keys.indexOf(item) == -1) {
 								isR = true;
 							}
 						}.bind(this))
 						// 提示 
-						if(isR) {
+						if (isR) {
 							var tipStr = '危险!系统检测到您取消了此角色的重要权限,这将导致与之关联的账号可能会无法正常使用后台,您无论如何都要这样设置吗?';
 							tipStr += '<br/>为保证您不是误操作,您还需要继续点击按钮: ' + clickCount + '次'
 							tipStr = '<b style="color: red;">' + tipStr + '</b>';
 							sa.confirm(tipStr, function(res) {
-								if(clickCount <= 1) {
+								if (clickCount <= 1) {
 									this.ok2();
 								} else {
 									clickCount--;
@@ -109,28 +109,28 @@
 					ok2: function() {
 						var str = '';
 						var keys = this.$refs.tree.getCheckedKeys();
-						keys.forEach(function(ts){
+						keys.forEach(function(ts) {
 							str += 'code=' + ts + '&';
 						})
 						var url = '/SpRolePermission/updatePcodeByRid?roleId=' + roleId;
-						sa.ajax(url, str,function (res) {
-							sa.alert('设置成功', function(){
+						sa.ajax(url, str, function(res) {
+							sa.alert('设置成功', function() {
 								sa.closeCurrIframe();
 							});
 							// 如果设置的角色与当前登录者的角色一致,则立即显示出来							
-							if(roleId == sa.$sys.getCurrUser().roleId) {
+							if (roleId == sa.$sys.getCurrUser().roleId) {
 								top.sa_admin.initMenu(keys);
 							}
 						}.bind(this))
 					},
 					// 点击回调, 处理其子节点跟随父节点的选中
 					node_click: function(node) {
-						var is_select = this.$refs.tree.getCheckedKeys().indexOf(node.id) != -1;	// 此节点现在是否被选中 
-						if(node.children){
+						var is_select = this.$refs.tree.getCheckedKeys().indexOf(node.id) != -1; // 此节点现在是否被选中 
+						if (node.children) {
 							node.children.forEach(function(item) {
 								this.$refs.tree.setChecked(item.id, is_select);
 								// 递归
-								if(item.children) {
+								if (item.children) {
 									this.node_click(item);
 								}
 							}.bind(this))
@@ -140,48 +140,70 @@
 					checkedAll: function() {
 						// console.log(this.$refs.tree.getCheckedKeys().length);
 						// console.log(this.ywList.length);
-						if(this.$refs.tree.getCheckedKeys().length != this.ywList.length) {
+						if (this.$refs.tree.getCheckedKeys().length != this.ywList.length) {
 							this.$refs['tree'].setCheckedNodes(this.ywList);
 						} else {
 							this.$refs['tree'].setCheckedNodes([]);
 						}
 					},
-					filterMenu(menu_list, menuCode){
-						return menu_list.filter(item => {
-						    return menuCode.indexOf(item.id) > -1
-						}).map(item => {
-						    item = Object.assign({}, item)
-						    if (item.children) {
-						        item.children = filterMenu(item.children, menuCode)
-						    }
-						    return item
-						})
+					filterMenu(menu_list, menuCode) {
+						let oneList = menu_list.filter(item => menuCode.indexOf(item.id) !== -1)
+						for (let i in oneList) {
+							let one = oneList[i];
+							let childrenList = one.childList.filter(item => menuCode.indexOf(item.id) !== -1);
+							for (let j in childrenList) {
+								let two = childrenList[j];
+								if (!two.childList) {
+									continue;
+								}
+								let cList = two.childList.filter(item => menuCode.indexOf(item.id) !== -1);
+								for (let k in cList) {
+									let three = cList[k];
+									if (!three.childList) {
+										continue;
+									}
+									let list = three.childList.filter(item => menuCode.indexOf(item.id) !== -1);
+									for (let l in list) {
+										let item = list[l];
+										if (!item.childList) {
+											continue;
+										}
+										let itemList = item.childList.filter(item => menuCode.indexOf(item.id) !== -1);
+										item.childList = itemList;
+									}
+									three.childList = list;
+								}
+								two.childList = cList;
+							}
+							one.childList = childrenList;
+						}
+						return oneList;
 					},
-					getCurrPer(){
-						sa.ajax('/SpRolePermission/getCustomerPcCode',function(resp){
-							let cuList=resp.data;
-							let menu_list=	this.filterMenu(menuList,cuList);
+					getCurrPer() {
+						sa.ajax('/SpRolePermission/getCustomerPcCode', function(resp) {
+							let cuList = resp.data;
+							let menu_list = this.filterMenu(menuList, cuList);
 							this.handler(menu_list);
 						}.bind(this))
 					},
-					handler(menu_list){
+					handler(menu_list) {
 						// 全部
-						menu_list = sa_admin_code_util.arrayToTree(menu_list);	// 一维转tree 
-						menu_list = sa_admin_code_util.refMenuList(menu_list);	// 属性处理 
-						this.dataList = menu_list;	// 数据  
+						menu_list = sa_admin_code_util.arrayToTree(menu_list); // 一维转tree 
+						menu_list = sa_admin_code_util.refMenuList(menu_list); // 属性处理 
+						this.dataList = menu_list; // 数据  
 						this.ywList = sa_admin_code_util.treeToArray(this.dataList);
-							
+
 						// 拉取此 roleId 的
 						sa.ajax('/SpRolePermission/getPcodeByRid?roleId=' + roleId, function(res) {
-							this.selectList = res.data;		// 选中的列表 
+							this.selectList = res.data; // 选中的列表 
 							this.haveList = [].concat(this.selectList);
 						}.bind(this))
 					}
 				},
-				created: function(){
-						this.getCurrPer();
+				created: function() {
+					this.getCurrPer();
 				}
 			})
 		</script>
 	</body>
-</html>
+</html>

+ 9 - 5
sp-admin/sa-view/car/tb-business-car-list.html

@@ -19,7 +19,7 @@
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
 			<div class="c-panel">
 				<div class="fast-btn">
-					<el-button size="mini" type="primary"  @click="add()" v-if="payStatus==1">
+					<el-button size="mini" type="primary"  @click="add()" v-if="payStatus==1&&sa.isAuth('tb-business-edit')">
 						新增</el-button>
 						<el-button size="mini" type="info" @click="sa.f5()">刷新</el-button>
 				</div>
@@ -48,15 +48,15 @@
 					<sa-td name="离场时间" prop="realOutTime" width=180></sa-td>
 					<el-table-column label="操作" fixed="right" width="200px">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary"  v-if="s.row.realInTime==null" @click="inFn(s.row)">确认入场
+							<el-button v-if="sa.isAuth('tb-business-car-change')" class="c-btn" type="primary"  v-if="s.row.realInTime==null" @click="inFn(s.row)">确认入场
 							</el-button>
-							<el-button class="c-btn" type="primary"  v-if="s.row.realInTime!=null&&s.row.realOutTime==null" @click="outFn(s.row)">确认离场
+							<el-button v-if="sa.isAuth('tb-business-car-change')" class="c-btn" type="primary"  v-if="s.row.realInTime!=null&&s.row.realOutTime==null" @click="outFn(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="s.row.pay==0" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							<el-button v-if="s.row.pay==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
 							</el-button>
-							<el-button v-if="s.row.pay==0" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
+							<el-button v-if="s.row.pay==0&&sa.isAuth('tb-business-edit')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
 							</el-button>
 						</template>
 					</el-table-column>
@@ -213,6 +213,10 @@
 					},
 					// 改 - 状态(0=否,1=是)
 					updateStatus: function(data) {
+						if(!sa.isAuth('tb-business-car-change')){
+							sa.error('无权限')
+							return false;
+						}
 						// 声明变量记录是否成功 
 						var isOk = false;
 						var oldValue = data.isLock;

+ 2 - 3
sp-admin/sa-view/tb-business/tb-business-add.html

@@ -89,8 +89,7 @@
 										</div>
 										<sa-item type="num" name="载重(吨)" placeholder="请输入车辆载重" v-model="m.netWeight" br>
 										</sa-item>
-										<!-- 	<sa-item type="text" name="境外车牌号" placeholder="请输入境外车牌号" v-model="m.cardNo" br>
-										</sa-item> -->
+										</sa-item>
 										<div class="c-item">
 											<label class="c-label"><span style="color: red;">*</span>境外车牌号:</label>
 											<el-autocomplete v-model="m.cardNo" placeholder="请输入境外车牌号"
@@ -163,7 +162,7 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-business-add')">确定</el-button>
 				<el-button @click="closeFn()">取消</el-button>
 			</div>
 			<el-dialog title="人员核酸检测" :visible.sync="modal.visible" width="80%">

+ 1 - 1
sp-admin/sa-view/tb-business/tb-business-edit.html

@@ -150,7 +150,7 @@
 			</div>
 			<!-- ------- 底部按钮 ------- -->
 			<div class="s-foot">
-				<el-button type="primary" @click="ok()">确定</el-button>
+				<el-button type="primary" @click="ok()" v-if="sa.isAuth('tb-business-edit')">确定</el-button>
 				<el-button @click="closeFn()">取消</el-button>
 			</div>
 			<el-dialog title="人员核酸检测" :visible.sync="modal.visible" width="80%">

+ 11 - 12
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -47,13 +47,9 @@
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
 				<div class="fast-btn">
-					<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-add')!=-1" @click="add()">
+					<el-button  v-if="sa.isAuth('tb-business-add')" size="mini" type="primary" @click="add()">
 						新增</el-button>
-					<!-- 	<el-button size="mini" type="primary" v-if="perCode.indexOf('tb-business-confirm')!=-1"
-						@click="confirmBatch()">确认</el-button> -->
 					<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
-					<!-- <el-button size="mini" type="danger" @click="deleteByIds()">删除</el-button> -->
-					<!-- <el-button size="mini" type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button> -->
 					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
 				</div>
 				<!-- ------------- 数据列表 ------------- -->
@@ -69,21 +65,24 @@
 					</sa-td>
 					<el-table-column label="操作" width="240px" fixed="right">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="primary" v-if="(s.row.confirmInput==0)
+							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0
 								&&s.row.payStatus==1
 								&&s.row.complete==1
-								&&perCode.indexOf('tb-business-confirm')!=-1
+								&&sa.isAuth('tb-business-confirm')
 								&&currentCustomerId!='1'" @click="confirmFn(s.row)">确认账单</el-button>
-							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
-								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
+							<el-button class="c-btn" type="success" 
+							v-if="sa.isAuth('tb-business-pay')
+								&&s.row.payStatus==1
+								&&s.row.confirmInput==1
+								&&currentCustomerId!='1'" @click="payFn(s.row)">
 								马上支付</el-button>
 							<el-button class="c-btn" type="primary" @click="itemFn(s.row)">业务项</el-button>
-							<el-button class="c-btn" type="primary" @click="carFn(s.row)">车辆管理
+							<el-button v-if="sa.isAuth('tb-business-add')" class="c-btn" type="primary" @click="carFn(s.row)">车辆管理
 							</el-button>
 							<el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
-							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0" @click="update(s.row)">
+							<el-button  class="c-btn" type="primary" v-if="s.row.confirmInput==0&&sa.isAuth('tb-business-edit')" @click="update(s.row)">
 								修改</el-button>
-							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1&&perCode.indexOf('tb-business-add')!=-1" @click="del(s.row)">删除
+							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1&&sa.isAuth('tb-business-del')" @click="del(s.row)">删除
 							</el-button>
 						</template>
 					</el-table-column>

+ 1 - 0
sp-admin/sa-view/tb-charge-record/tb-charge-record-list.html

@@ -35,6 +35,7 @@
 					<sa-td name="订单号" prop="no"></sa-td>
 					<sa-td name="客户名称" prop="customerName"></sa-td>
 					<sa-td name="充值金额" prop="money"></sa-td>
+					<sa-td name="支付金额" prop="payMoney"></sa-td>
 					<sa-td name="充值渠道" prop="chargeChannel"></sa-td>
 					<sa-td name="充值时间" prop="createTime"></sa-td>
 					<sa-td name="充值人" prop="chargePeople"></sa-td>

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

@@ -66,7 +66,6 @@
 				methods: {
 					// 修改
 					ok: function(){
-						console.log(this.m)
 						// 表单校验 
 						let m = this.m;
 						sa.checkNull(m.name, '请输入用户名');
@@ -93,7 +92,6 @@
 					}
 				},
 				mounted: function(){
-					console.log(this.m);
 					// 加载角色 
 					sa.ajax('/role/getCustomerRoleList',{customerId:this.m.customerId}, function(res){
 						this.roleList = res.data;	// 数据  

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

@@ -1,12 +1,13 @@
 <!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" />
+		<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"> 
+		<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>
@@ -15,7 +16,9 @@
 		<script src="../../static/sa.js"></script>
 		<script src="../../static/kj/upload-util.js"></script>
 		<style type="text/css">
-			.el-radio{margin-right: 10px;}
+			.el-radio {
+				margin-right: 10px;
+			}
 		</style>
 	</head>
 	<body>
@@ -30,7 +33,12 @@
 
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
-				<sa-item type="fast-btn" show="add,delete,reset"></sa-item>
+				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-costomer-maintain-user-add')">新增
+				</el-button>
+				<el-button type="danger" icon="el-icon-delete" @click="deleteByIds()"
+					v-if="sa.isAuth('tb-costomer-maintain-user-del')">删除
+				</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>
@@ -38,51 +46,51 @@
 					<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>
+					<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)">
+							<span @click="updateName(s.row)" v-if="sa.isAuth('tb-costomer-maintain-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改名称</el-button>
 							</span>
-							<span @click="updateAvatar(s.row)">
+							<span @click="updateAvatar(s.row)" v-if="sa.isAuth('tb-costomer-maintain-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改头像</el-button>
 							</span>
-							<span @click="updatePassword(s.row)">
+							<span @click="updatePassword(s.row)" v-if="sa.isAuth('tb-costomer-maintain-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改密码</el-button>
 							</span>
-							<span @click="roleFn(s.row)">
+							<span @click="roleFn(s.row)" v-if="sa.isAuth('tb-costomer-maintain-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">角色</el-button>
 							</span>
-							<span @click="del(s.row)">
+							<span @click="del(s.row)" v-if="sa.isAuth('tb-costomer-maintain-user-del')">
 								<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>
+				<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 :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>
+		<script>
 			var app = new Vue({
 				components: {
 					"sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
@@ -90,86 +98,93 @@
 				},
 				el: '.vue-box',
 				data: {
-					roleDialog:{
-						visible:false,
-						title:'',
-						form:{
-							id:'',
-							roleId:[],
+					roleDialog: {
+						visible: false,
+						title: '',
+						form: {
+							id: '',
+							roleId: [],
 						}
 					},
-					sa: sa, 	// 超级对象
-					p: {		// 查询参数
+					sa: sa, // 超级对象
+					p: { // 查询参数
 						name: '',
-						customerId:sa.p('customerId',''),
+						customerId: sa.p('customerId', ''),
 						sort_type: 0,
 						pageNo: 1,
 						pageSize: 10,
 					},
 					dataCount: 0,
-					dataList: [],	// 数据集合
-					roleList: [],	// 角色集合 
+					dataList: [], // 数据集合
+					roleList: [], // 角色集合 
 				},
 				methods: {
-					roleFn(data){
-						Object.assign(this.roleDialog,{
-							visible:true,
-							title:'设置['+data.name+']角色属性',
-							form:{
-								id:data.id,
-								roleId:data.roleId.split(',')
+					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:[];
+					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) {
+					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(',')
+						let o = {
+							id: this.roleDialog.form.id,
+							roleId: this.roleDialog.form.roleId.join(',')
 						}
-						sa.ajax('/admin/setRole',o,function(resp){
+						sa.ajax('/admin/setRole', o, function(resp) {
 							this.f5();
-							this.roleDialog.visible=false;
+							this.roleDialog.visible = false;
 						}.bind(this))
 					},
 					// 刷新
-					f5: function(isPage){
-						sa.ajax('/admin/getCustomerAdminList', this.p, function(res){
-							this.dataList = res.data;	// 数据
+					f5: function(isPage) {
+						sa.ajax('/admin/getCustomerAdminList', this.p, function(res) {
+							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount;
-							sa.f5TableHeight();		// 刷新表格高度 
+							sa.f5TableHeight(); // 刷新表格高度 
 						}.bind(this));
 					},
 					// 新增
 					add: function() {
-						sa.showIframe('新增用户', 'customer-admin-add.html?customerId=' + this.p.customerId, '550px', '75%');
+						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.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) {
+						if (selection.length == 0) {
 							return sa.msg('请选择一条数据')
 						}
 						this.getInfo(selection[0]);
 					},
 					// 修改名称 
 					updateName: function(data) {
-						layer.prompt({title: '修改账号名称'}, function(pass, index){
+						layer.prompt({
+							title: '修改账号名称'
+						}, function(pass, index) {
 							layer.close(index);
-							sa.ajax('/admin/update', {id: data.id, name: pass}, function(res){
+							sa.ajax('/admin/update', {
+								id: data.id,
+								name: pass
+							}, function(res) {
 								data.name = pass;
 								layer.msg('修改成功');
 							})
@@ -178,36 +193,49 @@
 					// 修改头像 
 					updateAvatar: function(data) {
 						sa.uploadImage(function(src) {
-							var p = {id: data.id, avatar: src};
+							var p = {
+								id: data.id,
+								avatar: src
+							};
 							sa.ajax('/admin/updateAvatar', p, function(res) {
 								sa.msg('上传成功');
-								data.avatar = src;  
+								data.avatar = src;
 							}.bind(this));
 						})
 					},
 					// 修改密码
 					updatePassword: function(data) {
-						layer.prompt({title: '修改密码'}, function(pass, index){
+						layer.prompt({
+							title: '修改密码'
+						}, function(pass, index) {
 							layer.close(index);
-							if(pass.length < 4) {
+							if (pass.length < 4) {
 								return layer.msg('新密码长度请不要低于4位');
 							}
-							sa.ajax('/admin/updatePassword', {id: data.id, password: pass}, function(res){
+							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.id == sa.$sys.getCurrUser().id) {
+							return sa.alert('不能自己修改自己的角色');
 						}
-						if(data.roleId == roleId) {
-							return sa.alert('该用户已经是' + roleName + '了');	
+						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) {
+						layer.confirm(str, {
+							title: '请确认'
+						}, function() {
+							sa.ajax('/admin/updateRole', {
+								id: data.id,
+								roleId: roleId
+							}, function(res) {
 								sa.msg('修改成功');
 								data.roleId = roleId;
 								data.roleName = roleName;
@@ -216,29 +244,34 @@
 					},
 					// 修改用户的状态
 					updateStatus: function(data) {
-						if(data.id == sa.$sys.getCurrUser().id) {
-							data.status = 3 - data.status;  
-							return sa.alert('不能自己封禁自己');  
+						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) {
+						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; 
+							if (is_ok == false) {
+								data.status = 3 - data.status;
 							}
 						})
 					},
 					// 删除 
-					del: function (data) {
-						sa.confirm('是否删除,此操作不可撤销', function(){
-							sa.ajax('/admin/delete', {id: data.id},function(res){
+					del: function(data) {
+						sa.confirm('是否删除,此操作不可撤销', function() {
+							sa.ajax('/admin/delete', {
+								id: data.id
+							}, function(res) {
 								sa.arrayDelete(app.dataList, data);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							})
 						});
 					},
@@ -247,32 +280,37 @@
 						// 获取选中元素的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('/admin/deleteByIds', {ids: ids.join(',')}, function(res) {
+							sa.ajax('/admin/deleteByIds', {
+								ids: ids.join(',')
+							}, function(res) {
 								sa.arrayDelete(this.dataList, selection);
 								sa.ok('删除成功');
-								sa.f5TableHeight();		// 刷新表格高度 
+								sa.f5TableHeight(); // 刷新表格高度 
 							}.bind(this))
 						}.bind(this));
 					},
-					getRoleList(){
+					getRoleList() {
 						// 加载角色
-						sa.ajax('/role/getCustomerRoleList',{customerId:this.p.customerId}, function(res){
-							this.roleList = res.data;	// 数据  
-						}.bind(this), {msg: null});
+						sa.ajax('/role/getCustomerRoleList', {
+							customerId: this.p.customerId
+						}, function(res) {
+							this.roleList = res.data; // 数据  
+						}.bind(this), {
+							msg: null
+						});
 					}
 				},
-				created: function(){
+				created: function() {
 					this.f5();
-					sa.onInputEnter();	// 监听回车执行查询 
+					sa.onInputEnter(); // 监听回车执行查询 
 					this.getRoleList();
 				}
 			})
-			
 		</script>
 	</body>
 </html>

+ 2 - 14
sp-admin/sa-view/tb-costomer/tb-account-manager.html

@@ -28,25 +28,13 @@
 							{{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-col :span="24" v-if="sa.isAuth('tb-costomer-account-charge')">
 						<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-col :span="12" v-if="sa.isAuth('tb-costomer-account-charge')">
 						<el-form-item label="" prop="field108">
 							<el-button type="primary" icon="el-icon-check" size="medium" @click="submitForm"> 确认充值
 							</el-button>

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

@@ -37,10 +37,10 @@
 					<br />
 
 				</el-form>
-				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="currentCustomerId=='1'">新增
+				<el-button type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-costomer-add')">新增
 				</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 type="danger" icon="el-icon-delete" @click="deleteByIds()" v-if="sa.isAuth('tb-costomer-del')">删除
 				</el-button>
 				<el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
 				<!-- ------------- 数据列表 ------------- -->
@@ -54,24 +54,23 @@
 					<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="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="success" icon="el-icon-view" v-if="s.row.judgeStatus==1||s.row.judgeStatus==3"
+							<el-button class="c-btn" type="success" icon="el-icon-view" v-if="(s.row.judgeStatus==1||s.row.judgeStatus==3)&&sa.isAuth('tb-costomer-judge')"
 								@click="judgeFn(s.row)">
 								审核
 							</el-button>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
+							<el-button v-if="sa.isAuth('tb-costomer-edit')" 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 v-if="sa.isAuth('tb-costomer-user')" 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  class="c-btn" type="primary" icon="el-icon-user-solid" v-if="s.row.judgeStatus==2&&sa.isAuth('tb-costomer-account')" @click="accountFn(s.row)">账户
 							</el-button>
-							<el-button v=if="currentCustomerId==1" class="c-btn" type="danger" icon="el-icon-delete"
+							<el-button v-if="sa.isAuth('tb-costomer-del')" class="c-btn" type="danger" icon="el-icon-delete"
 								@click="del(s.row)">删除</el-button>
 						</template>
 					</el-table-column>

+ 2 - 6
sp-admin/sa-view/tb-costomer/tb-costomer-maintain.html

@@ -26,9 +26,6 @@
       <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" >
@@ -47,9 +44,8 @@
       <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>
+          <el-button v-if="sa.isAuth('tb-costomer-maintain-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+          <el-button v-if="sa.isAuth('tb-costomer-maintain-user')" class="c-btn" type="primary" icon="el-icon-user-solid" @click="userFn(s.row)">用户</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 3 - 3
sp-admin/sa-view/tb-declare/tb-declare-list.html

@@ -59,10 +59,10 @@
 					<sa-td name="申报时间" prop="createTime" ></sa-td>
 					<el-table-column label="操作" fixed="right"  width="240px">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon" @click="print(s.row)">打印</el-button>
+							<el-button v-if="sa.isAuth('tb-declare-print')" class="c-btn" type="success" icon="el-icon" @click="print(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)">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+							<el-button v-if="sa.isAuth('tb-declare-edit')"  class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+							<el-button v-if="sa.isAuth('tb-declare-del')"  class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>

+ 12 - 3
sp-admin/sa-view/tb-discount/tb-discount-list.html

@@ -25,7 +25,12 @@
 					<el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
 				</el-form>
 				<!-- ------------- 快捷按钮 ------------- -->
-				<sa-item style="display: inline;" type="fast-btn" show="add,get,delete,reset"></sa-item>
+				<div class="fast-btn">
+					<el-button  v-if="sa.isAuth('tb-discount-add')" size="mini" type="primary" @click="add()">
+						新增</el-button>
+					<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
+					<el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
+				</div>
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList" style="margin-top: 10px;">
 					<sa-td type="selection"></sa-td>
@@ -41,9 +46,9 @@
 						<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  v-if="sa.isAuth('tb-discount-ediit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
 							</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
+							<el-button  v-if="sa.isAuth('tb-discount-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除
 							</el-button>
 						</template>
 					</el-table-column>
@@ -79,6 +84,10 @@
 				methods: {
 					// 改 - 状态(0=否,1=是)
 					updateStatus: function(data) {
+						if(!sa.isAuth('tb-discount-change')){
+							sa.error('无权限修改')
+							return;
+						}
 						// 声明变量记录是否成功 
 						var isOk = false;
 						var oldValue = data.status;

+ 3 - 3
sp-admin/sa-view/tb-disinfect/tb-disinfect-list.html

@@ -58,10 +58,10 @@
 					<sa-td name="计费(分)" prop="money" ></sa-td>
 					<el-table-column label="操作" fixed="right"  width="240px">
 						<template slot-scope="s">
-							<el-button class="c-btn" type="success" icon="el-icon" @click="print(s.row)">打印</el-button>
+							<el-button v-if="sa.isAuth('tb-disinfect-print')" class="c-btn" type="success" icon="el-icon" @click="print(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)">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
+							<el-button v-if="sa.isAuth('tb-disinfect-edit')"  class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
+							<el-button v-if="sa.isAuth('tb-disinfect-del')"  class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>

+ 10 - 10
sp-admin/sa-view/tb-item/tb-item-list.html

@@ -31,7 +31,7 @@
 					<sa-td name="项目名称" prop="name" width="300px"></sa-td>
                     <sa-td name="业务类型" prop="businessType">
 						<template slot-scope="s">
-							<el-select multiple v-model="s.row.type" placeholder="收费项" @change="businessChange(s.row)">
+							<el-select :disabled="!sa.isAuth('tb-item-list-edit-type')" multiple v-model="s.row.type" placeholder="收费项" @change="businessChange(s.row)">
 								<el-option v-for="item in businessTypeList" :key="item.value" :value="item.value"
 									:label="item.name">
 								</el-option>
@@ -39,19 +39,15 @@
 						</template>
 					</sa-td>
                     <sa-td name="税率" prop="taxRate"></sa-td>
-
 					<!-- <sa-td name="项目编号" prop="code"></sa-td> -->
 					<sa-td name="收费项" prop="code">
                         <template slot-scope="s">
-                            <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">详细
-                            </el-button>
+                          <el-select v-model="s.row.items[0].id" placeholder="收费项">
+                          	<el-option v-for="item in s.row.items" :key="item.id" :value="item.id"
+                          		:label="item.itemName+' '+item.price+item.unit">
+                          	</el-option>
+                          </el-select>
                         </template>
-                    </el-table-column> -->
-							<el-select v-model="s.row.items[0].id" placeholder="收费项">
-								<el-option v-for="item in s.row.items" :key="item.id" :value="item.id"
-									:label="item.itemName+' '+item.price+item.unit">
-								</el-option>
-							</el-select>
 					</sa-td>
 				</el-table>
 				<!-- ------------- 分页 ------------- -->
@@ -89,6 +85,10 @@
 							value: '2',
 							name: '装卸'
 						},
+						{
+							value: '3',
+							name: '核酸'
+						},
 					]
 				},
 				methods: {

+ 3 - 3
sp-admin/sa-view/tb-notices/tb-notices-list.html

@@ -28,7 +28,7 @@
 					<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="primary" icon="el-icon-plus" @click="add()" v-if="currentCustomerId=='1'&&sa.isAuth('tb-notices-add')">新增</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>
 
@@ -45,8 +45,8 @@
 					<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>
-							<el-button class="c-btn" type="primary" icon="el-icon-edit"  @click="update(s.row)" v-if="currentCustomerId=='1'&&s.row.type==0">修改</el-button>
-							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)" v-if="currentCustomerId=='1'&&s.row.type==0">删除</el-button>
+							<el-button class="c-btn" type="primary" icon="el-icon-edit"  @click="update(s.row)" v-if="currentCustomerId=='1'&&s.row.type==0&&sa.isAuth('tb-notices-edit')">修改</el-button>
+							<el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)" v-if="currentCustomerId=='1'&&s.row.type==0&&sa.isAuth('tb-notices-del')">删除</el-button>
 						</template>
 					</el-table-column>
 				</el-table>

+ 9 - 8
sp-admin/sa-view/tb-partner/customer-admin-list.html

@@ -26,11 +26,12 @@
 				<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-button style="display: inline;" type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-partner-user-add')">新增
+				</el-button>
+				<el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
+				</el-form>
+	
 				<!-- ------------- 数据列表 ------------- -->
 				<el-table class="data-table" ref="data-table" :data="dataList">
 					<sa-td type="selection"></sa-td>
@@ -41,16 +42,16 @@
 					<sa-td type="switch" name="账号状态" prop="status" :jv="{1: '正常', 2: '禁用[#ff4949]'}" @change="s => updateStatus(s.row)" width="120px"></sa-td>
 					<el-table-column label="操作"  width="450px">
 						<template slot-scope="s">
-							<span @click="updateName(s.row)">
+							<span @click="updateName(s.row)" v-if="sa.isAuth('tb-partner-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改名称</el-button>
 							</span>
-							<span @click="updateAvatar(s.row)">
+							<span @click="updateAvatar(s.row)" v-if="sa.isAuth('tb-partner-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改头像</el-button>
 							</span>
-							<span @click="updatePassword(s.row)">
+							<span @click="updatePassword(s.row)" v-if="sa.isAuth('tb-partner-user-edit')">
 								<el-button type="primary" class="c-btn" icon="el-icon-edit">改密码</el-button>
 							</span>
-							<span @click="del(s.row)">
+							<span @click="del(s.row)" v-if="sa.isAuth('tb-partner-user-del')"> 
 								<el-button type="danger" class="c-btn" icon="el-icon-delete">删除</el-button>
 							</span>
 						</template>

+ 7 - 9
sp-admin/sa-view/tb-partner/tb-partner-add.html

@@ -42,20 +42,18 @@
 								<label class="c-label">类型:</label>
 								<el-select v-model="type" multiple :disabled="currentCustomerId!=='1'">
 									<el-option label="消杀公司" value="1"></el-option>
-										<el-option label="装卸公司" value="2"></el-option>
+									<el-option label="装卸公司" value="2"></el-option>
+									<el-option label="核酸检测单位" value="3"></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 v-if="sa.isAuth('tb-partner-add')" type="primary" @click="ok()">确定</el-button>
 				<el-button @click="sa.closeCurrIframe()">取消</el-button>
 			</div>
 		</div>
@@ -70,7 +68,7 @@
 					m: null, // 实体对象 
 					options: [],
 					currentCustomerId: '1',
-					type:[]
+					type: []
 				},
 				methods: {
 					getCurrendCustomer() {
@@ -89,7 +87,7 @@
 							businessLicence: '', // 营业执照 
 							address_arry: [],
 							payType: 1,
-							type:1,
+							type: 1,
 							status: '1', // 状态(0=否,1=是) 
 							judgeStatus: '2', // 审核状态(1=未审核,2审核通过,3审核不通过) 
 						}
@@ -104,7 +102,7 @@
 							return;
 						}
 						sa.checkNull(m.dutyPeople, '请输入 [联系人]');
-						m.type=this.type.join(",")
+						m.type = this.type.join(",")
 						if (this.id <= 0) { // 添加
 							sa.ajax('/TbCostomer/add', m, function(res) {
 								sa.alert('增加成功', this.clean);
@@ -133,7 +131,7 @@
 					} else {
 						sa.ajax('/TbCostomer/getById?id=' + this.id, function(res) {
 							this.m = res.data;
-							this.type=this.m.type.split(',')
+							this.type = this.m.type.split(',')
 							if (res.data == null) {
 								sa.alert('未能查找到 id=' + this.id + " 详细数据");
 							}

+ 5 - 7
sp-admin/sa-view/tb-partner/tb-partner-list.html

@@ -25,7 +25,7 @@
 					<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>
-					<el-button style="display: inline;" type="primary" icon="el-icon-plus" @click="add()" v-if="currentCustomerId=='1'">新增
+					<el-button style="display: inline;" type="primary" icon="el-icon-plus" @click="add()" v-if="sa.isAuth('tb-partner-add')">新增
 					</el-button>
 					<el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
 				</el-form>
@@ -43,13 +43,11 @@
 						<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 v-if="sa.isAuth('tb-partner-edit')" 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 v-if="sa.isAuth('tb-partner-user')" 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"
+							<el-button v-if="sa.isAuth('tb-partner-del')" class="c-btn" type="danger" icon="el-icon-delete"
 								@click="del(s.row)">删除</el-button>
 						</template>
 					</el-table-column>
@@ -75,7 +73,7 @@
 						}
 					},
 					p: { // 查询参数  
-						partner: 1, // 主键 
+						partner: 1, 
 						name: '', // 名称 
 						phone: '', // 联系号码 
 						dutyPeople: '', // 负责人 

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-45152
+15424

+ 1 - 1
sp-server/src/main/java/com/pj/api/h5/ApiController.java

@@ -184,7 +184,7 @@ public class ApiController {
         int type = 1;
         if (!StrUtil.equals(customerId, UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
             TbCostomer tbCostomer = tbCostomerService.getById(customerId);
-            if (TbCostomer.CustomerEnum.BUSINESS_TYPE.getType() == tbCostomer.getType()) {
+            if (TbCostomer.CustomerEnum.BUSINESS_TYPE.getType() .equals(tbCostomer.getType())) {
                 type = 2;
             } else {
                 type = 3;

+ 16 - 5
sp-server/src/main/java/com/pj/api/open/service/OpenService.java

@@ -13,6 +13,8 @@ import com.pj.project.tb_business.TbBusinessService;
 
 import com.pj.project.tb_business_car.TbBusinessCar;
 import com.pj.project.tb_business_car.TbBusinessCarService;
+import com.pj.project.tb_business_item.TbBusinessItem;
+import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.utils.cache.RedisUtil;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
@@ -23,6 +25,7 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 @Transactional
@@ -33,6 +36,9 @@ public class OpenService {
     @Resource
     @Lazy
     private TbBusinessCarService tbBusinessCarService;
+    @Resource
+    @Lazy
+    private TbBusinessItemService tbBusinessItemService;
 
     private final List<String> CAR_LIST = StrUtil.splitTrim("浙,粤,京,津,冀,晋,蒙,辽,黑,沪,吉,苏,皖,赣,鲁,豫,鄂,湘,桂,琼,渝,川,贵,云,藏, 陕, 甘, 青, 宁", ",");
 
@@ -68,7 +74,7 @@ public class OpenService {
     }
 
     private ResultJson handlerOut(String carNo, String channel) {
-        carNo=carNo.toUpperCase();
+        carNo = carNo.toUpperCase();
         TbBusinessCar tbBusinessCar = tbBusinessCarService.findNotOutCar(carNo);
         if (tbBusinessCar == null) {
             return ResultJson.error("未查询到入场记录");
@@ -81,9 +87,15 @@ public class OpenService {
         if (StrUtil.isEmpty(businessId)) {
             return ResultJson.success();
         }
-        if (!CAR_LIST.contains(StrUtil.sub(carNo,0,1))){
+        if (!CAR_LIST.contains(StrUtil.sub(carNo, 0, 1))) {
             TbBusiness business = tbBusinessService.getById(businessId);
-            if (business.getPayStatus() != 3 && business.getCustomerType() != 2) {
+            List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(businessId)
+                    .stream().filter(tbBusinessItem -> tbBusinessItem.getPayStatus() == 1).collect(Collectors.toList());
+            BigDecimal itemPayPrice = new BigDecimal("0");
+            for (TbBusinessItem tbBusinessItem : items) {
+                itemPayPrice = itemPayPrice.add(tbBusinessItem.getItemPrice());
+            }
+            if (!business.getItemPrice().equals(itemPayPrice) && business.getCustomerType() != 2) {
                 return ResultJson.error("请缴纳业务费用");
             }
         }
@@ -92,7 +104,7 @@ public class OpenService {
         if (dif > 0) {
             tbBusinessCar.setPay(0);
             tbBusinessCarService.updateById(tbBusinessCar);
-            RedisUtil.set(channel,carNo);
+            RedisUtil.set(channel, carNo);
             return ResultJson.error("请缴停车费" + dif + "元");
         }
         tbBusinessCar.setRealOutTime(now).setOutChannel(channel);
@@ -101,5 +113,4 @@ public class OpenService {
     }
 
 
-
 }

+ 11 - 21
sp-server/src/main/java/com/pj/api/service/ApiService.java

@@ -154,21 +154,7 @@ public class ApiService {
             carNo = carNo.toUpperCase();
             tbDeclare.setCarNo(carNo);
         }
-//        SpAdmin admin=StpUserUtil.getAdmin();
-//        if (admin!=null) {
-//            tbDeclare.setCustomerId(admin.getCustomerId());
-//        }
-        String productionCode = tbDeclare.getProductionCode();
-        Date now = new Date();
-        if (StrUtil.isNotEmpty(productionCode)) {
-            TbDeclare db = tbDeclareService.findByProductionCode(productionCode);
-            if (db != null) {
-                BeanUtil.copyProperties(tbDeclare, db, "id");
-                db.setCreateTime(now);
-                tbDeclareService.updateById(db);
-                return;
-            }
-        }
+
         String nowStr = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
         tbDeclare.setCreateTime(new Date()).setDeclareNo(nowStr + RandomUtil.randomNumbers(6));
         tbDeclareService.save(tbDeclare);
@@ -193,7 +179,10 @@ public class ApiService {
     }
 
     public TbBusinessItem getBusinessItem(String id) {
-        return tbBusinessItemService.getById(id);
+        TbBusinessItem item = tbBusinessItemService.getById(id);
+        TbBusiness business = tbBusinessService.getById(item.getBusinessId());
+        item.setCardNo(business.getCardNo()).setChinaCarNo(business.getChinaCarNo()).setGoodsName(business.getGoodsName());
+        return item;
     }
 
     public AjaxJson pickBusinessItem(String openid, long id) {
@@ -205,7 +194,7 @@ public class ApiService {
         if (spAdmin == null) {
             return AjaxJson.getError("用户已被删除或解绑");
         }
-        if (tbBusinessItem.getPick()==1){
+        if (tbBusinessItem.getPick() == 1) {
             return AjaxJson.getError("您慢了一步,其他用户已接单");
         }
         String customerId = spAdmin.getCustomerId();
@@ -214,11 +203,12 @@ public class ApiService {
         tbBusinessItemService.updateById(tbBusinessItem);
         //todo 通知录入人员 已接单
         List<SpAdmin> spAdminList = spAdminService.findByCustomerId(UserTypeEnum.PLATFORM_ADMIN.getCustomerId());
-        MsgDataBO msgDataBO=new MsgDataBO("您有一条新的接单通知",tbCostomer.getName(), DateUtil.now(),tbBusinessItem.getItemTypeName()+"("+tbBusinessItem.getItemName()+")");
+        TbBusiness tbBusiness = tbBusinessService.getById(tbBusinessItem.getBusinessId());
+        MsgDataBO msgDataBO = new MsgDataBO("订单号:" + tbBusinessItem.getNo(), tbCostomer.getName(), DateUtil.now(), tbBusiness.getGoodsName() + "(" + tbBusinessItem.getItemTypeName() + tbBusinessItem.getItemName() + ")");
         spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
-            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusinessItem.getId()+"&openid="+openid;
-            log.info("admin confirm business:[{}]",detailUrl);
-            wxService.sendTemplateMsg(wxConfig.getBusinessPickTemplate(),admin.getOpenid(),msgDataBO,detailUrl);
+            String detailUrl = myConfig.getWebDomain() + "/pages/business-order/business-item?id=" + tbBusiness.getId() +"&itemId="+tbBusinessItem.getId()+ "&openid=" + openid;
+            log.info("admin confirm business:[{}]", detailUrl);
+            wxService.sendTemplateMsg(wxConfig.getBusinessPickTemplate(), admin.getOpenid(), msgDataBO, detailUrl);
         });
         return AjaxJson.getSuccess();
     }

+ 2 - 2
sp-server/src/main/java/com/pj/api/wx/service/WxService.java

@@ -98,8 +98,8 @@ public class WxService {
         String total_free = NumberUtil.mul(money, 100 + "").intValue() + "";
 //        String total_free = "1";
         log.info("pay free:{}", total_free);
-        params.put("total_fee", total_free);
-        // params.put("total_fee", "1");
+//        params.put("total_fee", total_free);
+         params.put("total_fee", "1");
         params.put("spbill_create_ip", getIpAddress(request));
         params.put("notify_url", myConfig.getDomain() + "/wx/notify");
         params.put("trade_type", tradeType);

+ 1 - 0
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessController.java

@@ -151,6 +151,7 @@ public class TbBusinessController {
     public AjaxJson getById(String id) {
         TbBusiness t = tbBusinessService.getById(id);
         List<TbBusinessItem> items = tbBusinessItemService.findByBusinessId(id);
+        items.forEach(tbBusinessItem -> tbBusinessItem.setGoodsName(t.getGoodsName()).setCardNo(t.getCardNo()).setChinaCarNo(t.getChinaCarNo()));
         t.setItems(items);
         List<TbBusinessCar> cars = tbBusinessCarService.findByBusinessId(id);
         t.setCars(cars);

+ 12 - 8
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -175,7 +175,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         tbBusinessItemService.removeByBusinessId(t.getId());
         BigDecimal price = new BigDecimal(0);
         List<TbBusinessItem> items = JSONUtil.toList(t.getItemJson(), TbBusinessItem.class);
-        int index=1;
+        int index = 1;
         for (TbBusinessItem item : items) {
             Double num = NumberUtil.parseDouble(item.getNum());
             TbItem tbItem = tbItemService.getById(item.getItemId());
@@ -186,16 +186,20 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setItemName(tbItem.getItemName()).setItemPrice(tbItem.getPrice())
                     .setItemTypeId(typeId).setItemTypeName(tbItemType.getName()).setBusinessType(tbItemType.getBusinessType())
                     .setUnit(tbItem.getUnit()).setTotal(NumberUtil.mul(num, tbItem.getPrice())).setCreateTime(new Date())
-                    .setNo(t.getNo()+"0"+index);
+                    .setNo(t.getNo() + "0" + index);
             tbBusinessItemService.save(item);
             String businessType = tbItemType.getBusinessType();
-            if (!StrUtil.equals(businessType,TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
-                MsgDataBO msgDataBO=new MsgDataBO("您收到一条新的作业提醒",tbItemType.getName(),tbItem.getItemName(),t.getGoodsName(),DateUtil.today(),"点击进入详情进行接单");
-                StrUtil.splitTrim(businessType,",").forEach(type->{
+            if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
+                String remark = "车牌:" + t.getCardNo();
+                if (StrUtil.isNotEmpty(t.getChinaCarNo())) {
+                    remark += "、" + t.getChinaCarNo();
+                }
+                MsgDataBO msgDataBO = new MsgDataBO("订单号:"+item.getNo(), tbItemType.getName(), tbItem.getItemName(), t.getGoodsName(), DateUtil.now(), remark);
+                StrUtil.splitTrim(businessType, ",").forEach(type -> {
                     List<String> openidList = tbCostomerService.findByBusinessTypeOpenid(type);
-                    openidList.forEach(openid-> {
-                        String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + item.getId()+"&openid="+openid;
-                        wxService.sendTemplateMsg(wxConfig.getBusinessNoticeTemplate(),openid,msgDataBO,detailUrl);
+                    openidList.forEach(openid -> {
+                        String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + item.getId() + "&openid=" + openid;
+                        wxService.sendTemplateMsg(wxConfig.getBusinessNoticeTemplate(), openid, msgDataBO, detailUrl);
                     });
                 });
             }

+ 2 - 1
sp-server/src/main/java/com/pj/project/tb_business_item/TbBusinessItemService.java

@@ -106,7 +106,8 @@ public class TbBusinessItemService extends ServiceImpl<TbBusinessItemMapper, TbB
         this.updateById(tbBusinessItem);
         //todo 通知作业方
         List<SpAdmin> spAdminList = spAdminService.findByCustomerId(tbBusinessItem.getPickCustomerId());
-        MsgDataBO msgDataBO = new MsgDataBO("业务确认提醒", "系统管理人员", DateUtil.now(), tbBusinessItem.getItemTypeName() + "(" + tbBusinessItem.getItemName() + ")");
+        TbBusiness tbBusiness=tbBusinessService.getById(tbBusinessItem.getBusinessId());
+        MsgDataBO msgDataBO = new MsgDataBO("订单号:"+tbBusinessItem.getNo(), "系统管理人员", DateUtil.now(), tbBusiness.getGoodsName()+"("+tbBusinessItem.getItemTypeName()+tbBusinessItem.getItemName()+")");
         spAdminList.stream().filter(admin -> StrUtil.isNotEmpty(admin.getOpenid())).forEach(admin -> {
             String detailUrl = myConfig.getWebDomain() + "/pages/business-item/item-detail?itemId=" + id+"&openid="+admin.getOpenid();
             wxService.sendTemplateMsg(wxConfig.getBusinessConfirmTemplate(), admin.getOpenid(), msgDataBO, detailUrl);

+ 4 - 2
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomer.java

@@ -105,14 +105,16 @@ public class TbCostomer extends Model<TbCostomer> implements Serializable {
 	/**
 	 * 类型0、理货员;1、消杀;2、装卸
 	 */
-	private String type;
+	private String type="0";
 
 	@Getter
 	@AllArgsConstructor
 	public static enum CustomerEnum{
 		BUSINESS_TYPE("0","理货员"),
 		DISINFECT_TYPE("1","消杀"),
-		TAKE_TYPE("2","装卸");
+		TAKE_TYPE("2","装卸"),
+		HESUAN_TYPE("3","核酸"),
+		;
 		private String type;
 		private String desc;
 	}

+ 6 - 0
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerController.java

@@ -2,6 +2,8 @@ package com.pj.project.tb_costomer;
 
 import java.util.List;
 
+import cn.hutool.core.util.StrUtil;
+import com.pj.constants.UserTypeEnum;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -78,6 +80,10 @@ public class TbCostomerController {
 	@RequestMapping("getList")
 	public AjaxJson getList() { 
 		SoMap so = SoMap.getRequestSoMap();
+		String cusotmerId=StpUserUtil.getCustomerId();
+		if(StrUtil.isNotEmpty(so.getString("partner"))&& !StrUtil.equals(UserTypeEnum.PLATFORM_ADMIN.getCustomerId(),cusotmerId)){
+			so.put("id",cusotmerId);
+		}
 		List<TbCostomer> list = tbCostomerService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}

+ 17 - 15
sp-server/src/main/java/com/pj/project/tb_costomer/TbCostomerService.java

@@ -1,8 +1,6 @@
 package com.pj.project.tb_costomer;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.date.DateUnit;
@@ -14,6 +12,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.constants.RoleEnum;
 import com.pj.project.tb_district.TbDistrict;
 import com.pj.project.tb_district.TbDistrictService;
+import com.pj.project.tb_init_permission.TbInitPermission;
+import com.pj.project.tb_init_permission.TbInitPermissionService;
 import com.pj.project4sp.SP;
 import com.pj.project4sp.admin.SpAdmin;
 import com.pj.project4sp.admin.SpAdminMapper;
@@ -49,7 +49,7 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
     @Resource
     private SpRolePermissionMapper spRolePermissionMapper;
     @Resource
-    private TbDistrictService tbDistrictService;
+    private TbInitPermissionService tbInitPermissionService;
     @Resource
     private SpAdminMapper spAdminMapper;
     @Resource
@@ -64,17 +64,19 @@ public class TbCostomerService extends ServiceImpl<TbCostomerMapper, TbCostomer>
         }
         t.setCreareTime(new Date()).setJudgeContent("平台创建,直接通过").setJudgeTime(new Date());
         this.save(t);
-        List<RoleEnum> roleEnums = RoleEnum.getCustomerInitRoleList();
-        List<String>commonPer=RoleEnum.COMMON_ROLE_PER.getPerCode();
-        roleEnums.forEach(roleEnum -> {
-            SpRole spRole = new SpRole();
-            spRole.setCustomerId(t.getId()).setInfo(roleEnum.getName())
-                    .setName(roleEnum.getName()).setType(roleEnum.getType());
-            spRoleMapper.add(spRole);
-            long roleId = SP.publicMapper.getPrimarykey();
-            spRolePermissionMapper.saveRolePer(roleId, roleEnum.getPerCode());
-            spRolePermissionMapper.saveRolePer(roleId,commonPer);
-        });
+        SpRole spRole = new SpRole();
+        spRole.setCustomerId(t.getId()).setInfo("企业/客户管理员")
+                .setName("管理员").setType("customerAdmin");
+        spRoleMapper.add(spRole);
+        long roleId = SP.publicMapper.getPrimarykey();
+        List<String>codeList=new ArrayList<>();
+        for (String type : StrUtil.splitTrim(t.getType(), ",")) {
+           SoMap perSoMap = SoMap.getRequestSoMap();
+            perSoMap.put("type", type);
+           List<TbInitPermission>permissions= tbInitPermissionService.getList(perSoMap);
+           codeList.addAll(permissions.stream().map(TbInitPermission::getCode).distinct().collect(Collectors.toList()));
+        }
+        spRolePermissionMapper.saveRolePer(roleId, codeList);
         return 1;
     }
 

+ 60 - 0
sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermission.java

@@ -0,0 +1,60 @@
+package com.pj.project.tb_init_permission;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_init_permission -- 初始化权限
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbInitPermission.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbInitPermission extends Model<TbInitPermission> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_init_permission";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-init-permission";	
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 类型 
+	 */
+	private String type;	
+
+	/**
+	 * 权限码 
+	 */
+	private String code;	
+
+
+
+
+
+	
+
+
+}

+ 105 - 0
sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionController.java

@@ -0,0 +1,105 @@
+package com.pj.project.tb_init_permission;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_init_permission -- 初始化权限
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/TbInitPermission/")
+public class TbInitPermissionController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbInitPermissionService tbInitPermissionService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbInitPermission.PERMISSION_CODE)
+	@Transactional(rollbackFor = Exception.class)
+	public AjaxJson add(TbInitPermission t){
+		tbInitPermissionService.add(t);
+		t = tbInitPermissionService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbInitPermission.PERMISSION_CODE)
+	public AjaxJson delete(Long id){
+		int line = tbInitPermissionService.delete(id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbInitPermission.PERMISSION_CODE)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbInitPermission.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbInitPermission.PERMISSION_CODE)
+	public AjaxJson update(TbInitPermission t){
+		int line = tbInitPermissionService.update(t);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbInitPermission t = tbInitPermissionService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbInitPermission> list = tbInitPermissionService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+	// ------------------------- 前端接口 -------------------------
+	
+	
+	/** 改 - 不传不改 [G] */
+	@RequestMapping("updateByNotNull")
+	public AjaxJson updateByNotNull(Long id){
+		AjaxError.throwBy(true, "如需正常调用此接口,请删除此行代码");
+		// 鉴别身份,是否为数据创建者 
+		long userId = SP.publicMapper.getColumnByIdToLong(TbInitPermission.TABLE_NAME, "user_id", id);
+		AjaxError.throwBy(userId != StpUserUtil.getLoginIdAsLong(), "此数据您无权限修改");
+		// 开始修改 (请只保留需要修改的字段)
+		SoMap so = SoMap.getRequestSoMap();
+		so.clearNotIn("id", "type", "code").clearNull().humpToLineCase();	
+		int line = SP.publicMapper.updateBySoMapById(TbInitPermission.TABLE_NAME, so, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+	
+	
+	
+	
+
+}

+ 56 - 0
sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionMapper.java

@@ -0,0 +1,56 @@
+package com.pj.project.tb_init_permission;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_init_permission -- 初始化权限
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbInitPermissionMapper extends BaseMapper <TbInitPermission> {
+
+	/**
+	 * 增  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int add(TbInitPermission t);
+
+	/**
+	 * 删  
+	 * @param id 要删除的数据id  
+	 * @return 受影响行数 
+	 */
+	int delete(Long id);	 
+
+	/** 
+	 * 改  
+	 * @param t 实体对象 
+	 * @return 受影响行数 
+	 */
+	int update(TbInitPermission t);
+
+	/** 
+	 * 查 - 根据id  
+	 * @param id 要查询的数据id 
+	 * @return 实体对象 
+	 */
+	TbInitPermission getById(Long id);	 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbInitPermission> getList(SoMap so);
+
+
+}

+ 76 - 0
sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionMapper.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.project.tb_init_permission.TbInitPermissionMapper">
+
+	<!-- 增 [G] -->
+	<insert id="add">
+		insert into 
+		tb_init_permission (id, type, code) 
+		values (#{id}, #{type}, #{code}) 
+	</insert>
+
+	<!-- 删 -->
+	<delete id="delete">
+		delete from tb_init_permission 
+		where id = #{id}
+	</delete>
+
+	<!-- 改 [G] -->
+	<update id="update">
+		update tb_init_permission set
+		id = #{id}, 
+		type = #{type}, 
+		code = #{code}
+		where id = #{id}
+	</update>
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, type, code from tb_init_permission  -->
+	
+	<!-- 通用映射:手动模式 -->
+	<resultMap id="model" type="com.pj.project.tb_init_permission.TbInitPermission">
+		<result property="id" column="id" />
+		<result property="type" column="type" />
+		<result property="code" column="code" />
+	</resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_init_permission 
+	</sql>
+	
+	<!-- 查 - 根据id -->
+	<select id="getById" resultMap="model">
+		<include refid="select_sql"></include>
+		where id = #{id}
+	</select>
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("type") '> and type like concat('%',#{type},'%') </if>
+			<if test=' this.has("code") '> and code = #{code} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> type desc </when>
+			<when test='sortType == 3'> code desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 48 - 0
sp-server/src/main/java/com/pj/project/tb_init_permission/TbInitPermissionService.java

@@ -0,0 +1,48 @@
+package com.pj.project.tb_init_permission;
+
+import java.util.List;
+
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.pj.utils.sg.*;
+
+/**
+ * Service: tb_init_permission -- 初始化权限
+ * @author qzy 
+ */
+@Service
+public class TbInitPermissionService {
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbInitPermissionMapper tbInitPermissionMapper;
+
+	/** 增 */
+	int add(TbInitPermission t){
+		return tbInitPermissionMapper.add(t);
+	}
+
+	/** 删 */
+	int delete(Long id){
+		return tbInitPermissionMapper.delete(id);
+	}
+
+	/** 改 */
+	int update(TbInitPermission t){
+		return tbInitPermissionMapper.update(t);
+	}
+
+	/** 查 */
+	TbInitPermission getById(Long id){
+		return tbInitPermissionMapper.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+ public 	List<TbInitPermission> getList(SoMap so) {
+		return tbInitPermissionMapper.getList(so);	
+	}
+	
+
+}

+ 29 - 11
sp-server/src/main/java/com/pj/project4sp/admin/SpAdminController.java

@@ -1,8 +1,10 @@
 package com.pj.project4sp.admin;
 
+import java.util.Collections;
 import java.util.List;
 
 import com.pj.current.satoken.StpUserUtil;
+import com.pj.project4sp.role4permission.SpRolePermissionService;
 import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -35,6 +37,8 @@ public class SpAdminController {
 
     @Autowired
     SpAdminPasswordService spAdminPasswordService;
+    @Resource
+    SpRolePermissionService spRolePermissionService;
 
     /**
      * 增
@@ -110,6 +114,19 @@ public class SpAdminController {
         List<SpAdmin> list = spAdminMapper.getList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), list);
     }
+
+    /**
+     * 查 - 集合
+     */
+    @RequestMapping("getCurrentAuthCode")
+    AjaxJson getCurrentAuthCode() {
+        if (StpUserUtil.isLogin()) {
+            return AjaxJson.getSuccessData(Collections.emptyList());
+        }
+        String roleId = StpUserUtil.getAdmin().getRoleId();
+        return AjaxJson.getSuccessData(spRolePermissionService.getPcodeByRid(roleId));
+    }
+
     /**
      * 查 - 集合
      */
@@ -119,22 +136,23 @@ public class SpAdminController {
         List<SpAdmin> list = spAdminMapper.getList(so.startPage());
         return AjaxJson.getPageData(so.getDataCount(), list);
     }
+
     @RequestMapping("addCustomerAdmin")
-    AjaxJson addCustomerAdmin(SpAdmin spAdmin){
-      SpAdmin db=  spAdminMapper.getByName(spAdmin.getName());
-      if(db!=null){
-          return AjaxJson.getError("登录名已被占用");
-      }
+    AjaxJson addCustomerAdmin(SpAdmin spAdmin) {
+        SpAdmin db = spAdminMapper.getByName(spAdmin.getName());
+        if (db != null) {
+            return AjaxJson.getError("登录名已被占用");
+        }
         spAdminService.add(spAdmin);
         return AjaxJson.getSuccess();
     }
 
     @RequestMapping("addPartnerAdmin")
-    AjaxJson addPartnerAdmin(SpAdmin spAdmin){
-      SpAdmin db=  spAdminMapper.getByName(spAdmin.getName());
-      if(db!=null){
-          return AjaxJson.getError("登录名已被占用");
-      }
+    AjaxJson addPartnerAdmin(SpAdmin spAdmin) {
+        SpAdmin db = spAdminMapper.getByName(spAdmin.getName());
+        if (db != null) {
+            return AjaxJson.getError("登录名已被占用");
+        }
         spAdminService.add(spAdmin);
         return AjaxJson.getSuccess();
     }
@@ -145,7 +163,7 @@ public class SpAdminController {
         SoMap so = SoMap.getRequestSoMap();
         Long id = so.getLong("id");
         String roleId = so.getString("roleId");
-        spAdminMapper.setRole(id,roleId);
+        spAdminMapper.setRole(id, roleId);
         return AjaxJson.getSuccess();
     }
 

+ 10 - 5
sp-server/src/main/java/com/pj/project4sp/admin4login/SpAccAdminService.java

@@ -23,6 +23,8 @@ import com.pj.utils.so.SoMap;
 import cn.dev33.satoken.spring.SpringMVCUtil;
 import cn.dev33.satoken.stp.StpUtil;
 
+import javax.annotation.Resource;
+
 /**
  * service:admin账号相关
  *
@@ -32,13 +34,13 @@ import cn.dev33.satoken.stp.StpUtil;
 public class SpAccAdminService {
 
 
-    @Autowired
+    @Resource
     SpAccAdminMapper spAccAdminMapper;
 
-    @Autowired
+    @Resource
     SpAdminMapper spAdminMapper;
 
-    @Autowired
+    @Resource
     SpRolePermissionService spRolePermissionService;
 
 
@@ -101,7 +103,7 @@ public class SpAccAdminService {
         map.put("tokenInfo", StpUtil.getTokenInfo());
         if (StrUtil.isNotEmpty(openid)) {
             SpAdmin db = spAdminMapper.findByOpenid(openid);
-            if (db!=null&& !db.getId().equals(admin.getId())){
+            if (db != null && !db.getId().equals(admin.getId())) {
                 db.setOpenid("");
                 spAdminMapper.updateOpenid(db);
             }
@@ -144,7 +146,10 @@ public class SpAccAdminService {
 
 
     public AjaxJson doLoginByOpenid(String openid) {
-      SpAdmin admin=  spAdminMapper.findByOpenid(openid);
+        SpAdmin admin = spAdminMapper.findByOpenid(openid);
+        if (admin == null) {
+            return AjaxJson.getError("用户未登录", 404);
+        }
         // 4、是否禁用
         if (admin.getStatus() == 2) {
             return AjaxJson.getError("此账号已被禁用,如有疑问,请联系管理员");