瀏覽代碼

消息处理

qzyReal 3 年之前
父節點
當前提交
3cc39c4e84

+ 206 - 83
sp-admin/sa-frame/nav/nav-tool-bar.vue

@@ -9,9 +9,10 @@
 				<i class="el-icon-s-unfold"></i>
 			</span>
 			<span title="搜索-input" class="tool-fox search-fox" :class=" isSearch ? 'search-fox-show' : '' ">
-				<el-select v-model="searchText" size="mini" filterable placeholder="请输入菜单关键字" ref="search" 
+				<el-select v-model="searchText" size="mini" filterable placeholder="请输入菜单关键字" ref="search"
 					@change="findMenuBySearch" @blur="closeSearch" @keyup.esc.native="closeSearch">
-					<el-option v-for="item in searchList" :key="item.id" :label="item.text" :value="item.id"></el-option>
+					<el-option v-for="item in searchList" :key="item.id" :label="item.text" :value="item.id">
+					</el-option>
 				</el-select>
 			</span>
 			<span title="搜索菜单" class="tool-fox" @click="closeSearch()" v-if="!isShowSearchInput">
@@ -33,13 +34,16 @@
 			</span>
 			<span title="我的信息" class="tool-fox user-info" style="padding: 0;" v-if="$root.user != null">
 				<el-dropdown @command="handleCommand" trigger="click" size="medium">
-					<span class="el-dropdown-link user-name" style="height: 100%; padding: 0 1em; display: inline-block;">
+					<span class="el-dropdown-link user-name"
+						style="height: 100%; padding: 0 1em; display: inline-block;">
 						<img :src="$root.user.avatar" class="user-avatar">
 						<span>{{$root.user.username}}</span>
 						<i class="el-icon-arrow-down el-icon--right"></i>
 					</span>
 					<el-dropdown-menu slot="dropdown">
-						<el-dropdown-item v-for="drop in $root.dropList" :command="drop.name" :key="drop.name">{{drop.name}}</el-dropdown-item>
+						<el-dropdown-item v-for="drop in $root.dropList" :command="drop.name" :key="drop.name">
+							{{drop.name}}
+						</el-dropdown-item>
 					</el-dropdown-menu>
 				</el-dropdown>
 			</span>
@@ -55,7 +59,7 @@
 						</el-dropdown-item>
 					</el-dropdown-menu>
 				</el-dropdown>
-			</span> 
+			</span>
 			<span title="便签" class="tool-fox" @click="openNote()">
 				<i class="el-icon-edit" style="font-weight: bold; font-size: 0.9em;"></i>
 				<span style="font-size: 0.9em;">便签</span>
@@ -68,8 +72,7 @@
 			</span>
 		</div>
 		<!-- tab被拖拽时的遮罩(tab上拖拽:新窗口打开) -->
-		<div class="shade-fox" v-if="$root.isDrag" 
-			@dragover="$event.preventDefault();" 
+		<div class="shade-fox" v-if="$root.isDrag" @dragover="$event.preventDefault();"
 			@drop="$event.preventDefault(); $event.stopPropagation(); $root.newWinTab($root.dragTab);">
 			<span style="font-size: 16px;">新窗口打开</span>
 		</div>
@@ -80,29 +83,60 @@
 	module.exports = {
 		data() {
 			return {
-				isSearch: false,	// 当前是否处于搜索模式 
-				isShowSearchInput: true,	// 是否显示打开搜索图标 
-				searchText: '',		// 搜索框已经输入的字符 
-				searchList: [],			// 搜索框 待选列表 
-				
-				isFullScreen: false,	// 是否处于全屏状态 
-				
-				nowTime: '加载中...'	,	// 当前时间 
-				currInterval: null,		// 刷新当前时间的定时器 
-				
-				themeList: [	// 主题数组
-					{name: '蓝色', value: '1'},
-					{name: '绿色', value: '2'},
-					{name: '白色', value: '3'},
-					{name: '灰色', value: '4'},
-					{name: '红色', value: '5'},
-					{name: '紫色', value: '9'},
-					{name: 'pro钛合金', value: '6'},
-					{name: '沉淀黑蓝', value: '7'},
-					{name: '简约灰色', value: '8'},
-					{name: '简约草绿', value: '10'},
+				msgTimmer: null,
+				isSearch: false, // 当前是否处于搜索模式 
+				isShowSearchInput: true, // 是否显示打开搜索图标 
+				searchText: '', // 搜索框已经输入的字符 
+				searchList: [], // 搜索框 待选列表 
+
+				isFullScreen: false, // 是否处于全屏状态 
+
+				nowTime: '加载中...', // 当前时间 
+				currInterval: null, // 刷新当前时间的定时器 
+
+				themeList: [ // 主题数组
+					{
+						name: '蓝色',
+						value: '1'
+					},
+					{
+						name: '绿色',
+						value: '2'
+					},
+					{
+						name: '白色',
+						value: '3'
+					},
+					{
+						name: '灰色',
+						value: '4'
+					},
+					{
+						name: '红色',
+						value: '5'
+					},
+					{
+						name: '紫色',
+						value: '9'
+					},
+					{
+						name: 'pro钛合金',
+						value: '6'
+					},
+					{
+						name: '沉淀黑蓝',
+						value: '7'
+					},
+					{
+						name: '简约灰色',
+						value: '8'
+					},
+					{
+						name: '简约草绿',
+						value: '10'
+					},
 				],
-				
+
 			}
 		},
 		methods: {
@@ -114,7 +148,7 @@
 				this.f5SearchList();
 				setTimeout(function() {
 					this.isShowSearchInput = false;
-					this.$refs['search'].focus();	//.$refs['nav-tool-bar'].
+					this.$refs['search'].focus(); //.$refs['nav-tool-bar'].
 				}.bind(this), 200);
 			},
 			// 关闭搜索
@@ -122,10 +156,13 @@
 				this.searchText = '';
 				this.isSearch = false;
 				setTimeout(function() {
-					try{
+					try {
 						this.isShowSearchInput = true;
-						document.querySelector('body>.el-select-dropdown.el-popper').style.display = 'none';
-					}catch(e){throw e}
+						document.querySelector('body>.el-select-dropdown.el-popper').style.display =
+							'none';
+					} catch (e) {
+						throw e
+					}
 				}.bind(this), 200);
 			},
 			// 查找菜单 
@@ -136,27 +173,33 @@
 			// 刷新待选列表 
 			f5SearchList: function() {
 				var searchList = [];
-				
+
 				let index = 1;
+
 				function push(id, str) {
-					searchList.push({id: id, text: (index++) + ". " + str});
+					searchList.push({
+						id: id,
+						text: (index++) + ". " + str
+					});
 				}
-				
+
 				// 遍历菜单 
 				let childList = this.$root.menuList;
 				let showList = this.$root.showList;
 				for (let menu1 of childList) {
-					if(menu1.isShow === false || showList.indexOf(menu1.id + '') == -1) continue;
-					if(menu1.childList) {
+					if (menu1.isShow === false || showList.indexOf(menu1.id + '') == -1) continue;
+					if (menu1.childList) {
 						for (let menu2 of menu1.childList) {
-							if(menu2.isShow === false || showList.indexOf(menu2.id + '') == -1) continue;
-							if(menu2.childList) {
+							if (menu2.isShow === false || showList.indexOf(menu2.id + '') == -1) continue;
+							if (menu2.childList) {
 								for (let menu3 of menu2.childList) {
-									if(menu3.isShow === false || showList.indexOf(menu3.id + '') == -1) continue;
-									if(menu3.childList) {
+									if (menu3.isShow === false || showList.indexOf(menu3.id + '') == -1) continue;
+									if (menu3.childList) {
 										for (let menu4 of menu3.childList) {
-											if(menu4.isShow === false || showList.indexOf(menu4.id + '') == -1) continue;
-											push(menu4.id, menu1.name + ' > ' + menu2.name + ' > ' + menu3.name + ' > ' + menu4.name);
+											if (menu4.isShow === false || showList.indexOf(menu4.id + '') == -1)
+												continue;
+											push(menu4.id, menu1.name + ' > ' + menu2.name + ' > ' + menu3.name +
+												' > ' + menu4.name);
 										}
 									} else {
 										push(menu3.id, menu1.name + ' > ' + menu2.name + ' > ' + menu3.name);
@@ -170,10 +213,10 @@
 						push(menu1.id, menu1.name);
 					}
 				}
-				
+
 				this.searchList = searchList;
 			},
-			
+
 			// ------------------------------ 主题 ------------------------------
 			// 切换主题
 			toggleTheme: function(command) {
@@ -181,57 +224,57 @@
 				this.$root.themeV = command + "";
 				localStorage.setItem('themeV', command);
 				for (var i = 0; i < this.themeList.length; i++) {
-					if(this.themeList[i].value + '' == command + '') {
+					if (this.themeList[i].value + '' == command + '') {
 						this.$message('切换成功,' + this.themeList[i].name);
 					}
 				}
 			},
-			
+
 			// ------------------------------ 全屏 ------------------------------
 			// 进入全屏 
 			fullScreen: function() {
 				this.isFullScreen = true;
-				if(document.documentElement.RequestFullScreen){
+				if (document.documentElement.RequestFullScreen) {
 					document.documentElement.RequestFullScreen();
 				}
 				//兼容火狐
-				if(document.documentElement.mozRequestFullScreen){
+				if (document.documentElement.mozRequestFullScreen) {
 					document.documentElement.mozRequestFullScreen();
 				}
 				//兼容谷歌等可以webkitRequestFullScreen也可以webkitRequestFullscreen
-				if(document.documentElement.webkitRequestFullScreen){
+				if (document.documentElement.webkitRequestFullScreen) {
 					document.documentElement.webkitRequestFullScreen();
 				}
 				//兼容IE,只能写msRequestFullscreen
-				if(document.documentElement.msRequestFullscreen){
+				if (document.documentElement.msRequestFullscreen) {
 					document.documentElement.msRequestFullscreen();
 				}
 			},
 			// 退出全屏
 			outFullScreen: function() {
 				this.isFullScreen = false;
-				if(document.exitFullScreen){
+				if (document.exitFullScreen) {
 					document.exitFullscreen()
 				}
 				//兼容火狐
-				if(document.mozCancelFullScreen){
+				if (document.mozCancelFullScreen) {
 					document.mozCancelFullScreen()
 				}
 				//兼容谷歌等
-				if(document.webkitExitFullscreen){
+				if (document.webkitExitFullscreen) {
 					document.webkitExitFullscreen()
 				}
 				//兼容IE
-				if(document.msExitFullscreen){
+				if (document.msExitFullscreen) {
 					document.msExitFullscreen()
 				}
 			},
-			
+
 			// ------------------------------ 其它 ------------------------------
 			// 处理userinfo的下拉点击
 			handleCommand: function(command) {
 				this.$root.dropList.forEach(function(drop) {
-					if(drop.name == command) {
+					if (drop.name == command) {
 						drop.click();
 					}
 				})
@@ -243,15 +286,15 @@
 				var default_content = '一个简单的小便签, 关闭浏览器后再次打开仍然可以加载到上一次的记录, 你可以用它来记录一些临时资料';
 				var value = localStorage.getItem('sa_admin_note') || default_content;
 				var index = layer.prompt({
-					title: '一个小便签', 
+					title: '一个小便签',
 					value: value,
 					formType: 2,
 					area: [w, h],
 					btn: ['保存'],
 					maxlength: 99999999,
-					skin: 'layer-note-class' 
-				}, function(pass, index){
-					layer.close(index)					
+					skin: 'layer-note-class'
+				}, function(pass, index) {
+					layer.close(index)
 				});
 				var se = '#layui-layer' + index + ' .layui-layer-input';
 				var d = document.querySelector(se);
@@ -259,10 +302,10 @@
 					localStorage.setItem('sa_admin_note', this.value);
 				}
 			},
-			
+
 			// 刷新时间
 			initInterval: function() {
-				if(this.currInterval) {
+				if (this.currInterval) {
 					clearInterval(this.currInterval);
 				}
 				// 一直更新时间
@@ -285,42 +328,122 @@
 					}
 					var m = da.getMinutes(); //分
 					var s = da.getSeconds(); //秒
-					var z = ['日', '一', '二', '三', '四', '五', '六'][da.getDay()] ; //周几
+					var z = ['日', '一', '二', '三', '四', '五', '六'][da.getDay()]; //周几
 					// z = z == 0 ? '日' : z;
 					var zong = "";
-				
+
 					zong += Y + "-" + M + "-" + D + " " + sx + " " + h + ":" + m + ":" + s + " 周" + z;
 					this.nowTime = zong;
 				}.bind(this), 1000);
+			},
+			getBusinessMsg() {
+				sa.ajaxNoLoading('/TbBusiness/getMsg', function(resp) {
+					let msgList = resp.data;
+					for (let i in msgList) {
+						setTimeout(()=>{
+							this.popMsg(msgList[i])
+						},1000)
+					}
+				}.bind(this))
+			},
+			popMsg(content){
+				this.$notify({
+					title: '消息提醒',
+					message: content,
+					duration: 0
+				});
 			}
 		
 		},
+
 		created() {
 			this.initInterval();
+			this.msgTimmer = setInterval(() => {
+				this.getBusinessMsg();
+			}, 20000)
+		},
+		beforeDestroy() {
+			if (this.msgTimmer != null) {
+				clearInterval(this.msgTimmer);
+			}
 		}
 	}
 </script>
 
 <style scoped>
-	
-	.tools-left{border: 0px #000 solid; float: left;}
-	.tools-right{float: right;}
-	.tool-fox{padding: 0 1em; display: inline-block; cursor: pointer;}
-	.tool-fox, .tool-fox i{transition: all 0.2s;}
-	
-	.user-info{position: relative; top: -2px;}
-	.user-avatar{width: 30px; height: 30px; border-radius: 50%; vertical-align: middle;}
-	.user-info .user-name{font-size: 0.9em;} 
-	
+	.tools-left {
+		border: 0px #000 solid;
+		float: left;
+	}
+
+	.tools-right {
+		float: right;
+	}
+
+	.tool-fox {
+		padding: 0 1em;
+		display: inline-block;
+		cursor: pointer;
+	}
+
+	.tool-fox,
+	.tool-fox i {
+		transition: all 0.2s;
+	}
+
+	.user-info {
+		position: relative;
+		top: -2px;
+	}
+
+	.user-avatar {
+		width: 30px;
+		height: 30px;
+		border-radius: 50%;
+		vertical-align: middle;
+	}
+
+	.user-info .user-name {
+		font-size: 0.9em;
+	}
+
 	/* 搜素框 */
-	.search-fox{display: inline-block; vertical-align: middle; overflow: hidden; max-width: 0px; padding: 0em 0em; margin-left: -5px; transition: all 0.2s;}
-	.search-fox-show{display: inline-block; max-width: 500px; margin-left: 0px; padding: 0 1em;}
-	.search-fox:hover{background-color: rgba(0,0,0,0) !important;}
-	.search-fox .el-input__inner{border-radius: 0px; border-width: 0px; border-bottom-width: 1px; background-color: rgba(0,0,0,0);}
-	.search-fox .el-input__icon{display: none;}
-	
+	.search-fox {
+		display: inline-block;
+		vertical-align: middle;
+		overflow: hidden;
+		max-width: 0px;
+		padding: 0em 0em;
+		margin-left: -5px;
+		transition: all 0.2s;
+	}
+
+	.search-fox-show {
+		display: inline-block;
+		max-width: 500px;
+		margin-left: 0px;
+		padding: 0 1em;
+	}
+
+	.search-fox:hover {
+		background-color: rgba(0, 0, 0, 0) !important;
+	}
+
+	.search-fox .el-input__inner {
+		border-radius: 0px;
+		border-width: 0px;
+		border-bottom-width: 1px;
+		background-color: rgba(0, 0, 0, 0);
+	}
+
+	.search-fox .el-input__icon {
+		display: none;
+	}
+
 	/*800之下*/
 	@media(max-width: 800px) {
-		.tools-right{display: none;}
+		.tools-right {
+			display: none;
+		}
 	}
 </style>

+ 72 - 47
sp-admin/sa-view/tb-business/tb-business-list.html

@@ -18,13 +18,24 @@
 	</head>
 	<style>
 		.complete-modal .c-label,
-		.confirm-in .c-label,.confirm-info .c-label {
+		.confirm-in .c-label,
+		.confirm-info .c-label {
 			width: 200px;
 		}
 	</style>
 	<body>
 		<div class="vue-box" style="display: none;" :style="'display: block;'">
 			<div class="c-panel">
+				<div style="float: right;right: 20px;margin-top: 10px;">
+					<label>刷新频率:</label>
+					<el-select v-model="fresh.value" placeholder="请选择" @change="restartTimmer">
+						<el-option label="10s" :value="10"></el-option>
+						<el-option label="20s" :value="20"></el-option>
+						<el-option label="30s" :value="30"></el-option>
+						<el-option label="50s" :value="50"></el-option>
+						<el-option label="60s" :value="60"></el-option>
+					</el-select>
+				</div>
 				<!-- ------------- 检索参数 ------------- -->
 				<div class="c-title">检索参数</div>
 				<el-form ref="form" :model='p' @submit.native.prevent>
@@ -57,9 +68,9 @@
 					<sa-td name="总用费(元)" prop="totalMoney"></sa-td>
 					<sa-td width="130" name="支付状态" prop="payStatus" type="enum"
 						:jv="{1: '未支付[#ff0000]', 2: '已支付(未确认)[#ffaa00]', 3: '已支付(已确认)[#005500]'}"></sa-td>
-						<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
+					<sa-td width="160" name="支付时间" prop="payTime"></sa-td>
 					<sa-td name="支付凭证" prop="payTicket" type="img-list"></sa-td>
-				<!-- 	<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
+					<!-- 	<sa-td  name="放行状态" prop="adminConfirmPay" type="enum"
 						:jv="{0: '不可放行[#ff0000]', 1: '可放行[#005500]'}"></sa-td> -->
 					<!-- <sa-td name="入场时间" width="140" prop="realInTime"></sa-td>
 					<sa-td name="离场时间" width="140" prop="outDayTime"></sa-td> -->
@@ -75,31 +86,26 @@
 								&&s.row.complete==1
 								&&perCode.indexOf('tb-business-confirm')!=-1
 								&&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="perCode.indexOf('tb-business-pay')!=-1
+								&&s.row.payStatus==1&&s.row.confirmInput==1&&currentCustomerId!='1'" @click="payFn(s.row)">
 								马上支付</el-button>
 							<el-button class="c-btn" type="primary"
 								v-if="currentCustomerId=='1'&&(s.row.realInTime==null||s.row.chinaCarInTime==null)"
 								@click="inFn(s.row)">确认入场
 							</el-button>
-							<el-button class="c-btn" type="primary"
-							 v-if="currentCustomerId=='1'&&s.row.complete==1
+							<el-button class="c-btn" type="primary" v-if="currentCustomerId=='1'&&s.row.complete==1
 							 &&s.row.payStatus>1
 							 &&s.row.adminConfirmPay==1
-							 &&s.row.adminConfirmOut==0"
-								@click="outFn(s.row)">确认离场
+							 &&s.row.adminConfirmOut==0" @click="outFn(s.row)">确认离场
 							</el-button>
-							<el-button class="c-btn" type="success"
-								v-if="perCode.indexOf('tb-business-pay')!=-1
+							<el-button class="c-btn" type="success" v-if="perCode.indexOf('tb-business-pay')!=-1
 								&&currentCustomerId=='1'
 								&&s.row.payStatus==2
 								&&s.row.outDayTime!=null
-								&&s.row.adminConfirmPay==0"
-								@click="adminSurePayFn(s.row)">确认支付</el-button>
+								&&s.row.adminConfirmPay==0" @click="adminSurePayFn(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>
+							<el-button class="c-btn" type="primary" v-if="s.row.confirmInput==0" @click="update(s.row)">
+								修改</el-button>
 							<el-button class="c-btn" type="danger" v-if="s.row.payStatus==1
 								&&s.row.confirmInput==0
 								&&s.row.realInTime==null
@@ -179,10 +185,8 @@
 			<el-dialog title="确认离场" :visible.sync="out.visible" width="30%">
 				<el-form label-position="left">
 					<div class="confirm-in">
-						<sa-item type="datetime"  name="境外车离场" v-model="out.form.outDayTime"
-							br></sa-item>
-						<sa-item type="datetime" name="中国车离场"
-							v-model="out.form.chinaCarOutTime" br></sa-item>
+						<sa-item type="datetime" name="境外车离场" v-model="out.form.outDayTime" br></sa-item>
+						<sa-item type="datetime" name="中国车离场" v-model="out.form.chinaCarOutTime" br></sa-item>
 					</div>
 				</el-form>
 				<span slot="footer" class="dialog-footer">
@@ -200,6 +204,7 @@
 				},
 				el: '.vue-box',
 				data: {
+					value:'',
 					currentCustomerId: '1',
 					confirm: {
 						visible: false,
@@ -273,9 +278,28 @@
 							id: '',
 							no: ''
 						}
+					},
+					timmer: null,
+					fresh: {
+						value: 10
 					}
 				},
 				methods: {
+					blurFn(){
+					console.log(123)	
+					},
+					stopTimmer() {
+						if (this.timmer != null) {
+							clearInterval(this.timmer);
+						}
+					},
+					restartTimmer() {
+						this.stopTimmer();
+						let val = this.fresh.value;
+						this.timmer = setInterval(() => {
+							this.f5();
+						}, val * 1000)
+					},
 					jwCaroTimeChange(oTime) {
 						if (oTime) {
 							let o = Object.assign(this.complete.form);
@@ -299,12 +323,14 @@
 							visible: true,
 							form: data
 						})
+						this.stopTimmer();
 					},
 					sureCompleteFn() {
-						this.complete.form.items=null;
+						this.complete.form.items = null;
 						sa.ajax('/TbBusiness/complete', sa.removeNull(this.complete.form), function(resp) {
 							this.complete.visible = false;
 							this.f5();
+							this.restartTimmer();
 						}.bind(this))
 					},
 					inFn(data) {
@@ -316,6 +342,7 @@
 								chinaCarInTime: data.chinaCarInTime
 							}
 						})
+						this.stopTimmer()
 					},
 					sureRcFn() {
 						if (!this.rc.form.realInTime) {
@@ -329,17 +356,19 @@
 						sa.ajax('/TbBusiness/adminSetIn', sa.removeNull(this.rc.form), function(resp) {
 							this.f5();
 							this.rc.visible = false;
+							this.restartTimmer();
 						}.bind(this))
 					},
 					outFn(data) {
 						Object.assign(this.out, {
 							visible: true,
 							form: {
-								id:data.id,
-								outDayTime:'',
-								chinaCarOutTime:''
+								id: data.id,
+								outDayTime: '',
+								chinaCarOutTime: ''
 							}
 						})
+						this.stopTimmer()
 					},
 					sureOutFn() {
 						if (!this.out.form.outDayTime) {
@@ -353,6 +382,7 @@
 						sa.ajax('/TbBusiness/adminOut', this.out.form, function(resp) {
 							this.f5();
 							this.out.visible = false;
+							this.restartTimmer();
 						}.bind(this))
 					},
 					getCurrendCustomer() {
@@ -366,11 +396,13 @@
 							form: data
 						})
 						this.pay.form.ids = data.id;
+						this.stopTimmer()
 					},
 					surePayirmFn() {
 						sa.ajax('/TbBusiness/adminConfirmPay', this.pay.form, function(resp) {
 							this.pay.visible = false;
 							this.f5();
+							this.restartTimmer();
 						}.bind(this))
 					},
 					confirmBatch() {
@@ -388,14 +420,16 @@
 						}.bind(this))
 					},
 					confirmFn(data) {
-						sa.ajax('/TbBusinessItem/getList',{businessId:data.id},function(resp){
-							data.items=resp.data;
+						sa.ajax('/TbBusinessItem/getList', {
+							businessId: data.id
+						}, function(resp) {
+							data.items = resp.data;
 							Object.assign(this.confirm, {
 								visible: true,
 								form: data,
 							})
-							console.log(data);
 							this.confirm.form.ids = data.id;
+							this.stopTimmer();
 						}.bind(this));
 					},
 					sureConfirmFn() {
@@ -404,6 +438,7 @@
 						}, function(resp) {
 							this.confirm.visible = false;
 							this.f5();
+							this.restartTimmer();
 						}.bind(this))
 					},
 					payFn(data) {
@@ -411,19 +446,22 @@
 							visible: true,
 							form: data
 						})
+						this.stopTimmer();
 					},
 					surePayFn() {
 						sa.ajax('/TbBusiness/pay', this.modal.form, function(resp) {
 							this.f5();
 							this.modal.visible = false;
+							this.restartTimmer();
 						}.bind(this))
 					},
 					// 刷新
 					f5: function() {
-						sa.ajax('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
+						sa.ajaxNoLoading('/TbBusiness/getList', sa.removeNull(this.p), function(res) {
 							this.dataList = res.data; // 数据
 							this.dataCount = res.dataCount; // 数据总数 
 							sa.f5TableHeight(); // 刷新表格高度 
+							this.restartTimmer();
 						}.bind(this));
 					},
 					// 查看
@@ -440,10 +478,12 @@
 					},
 					// 修改
 					update: function(data) {
+						this.stopTimmer();
 						sa.showIframe('修改数据', 'tb-business-edit.html?id=' + data.id, '1000px', '90%');
 					},
 					// 新增
 					add: function(data) {
+						this.stopTimmer();
 						sa.showIframe('新增数据', 'tb-business-add.html?id=-1', '1080px', '90%');
 					},
 					// 删除
@@ -456,31 +496,16 @@
 							}.bind(this))
 						}.bind(this));
 					},
-					// 批量删除
-					deleteByIds: function() {
-						// 获取选中元素的id列表 
-						let selection = this.$refs['data-table'].selection;
-						let ids = sa.getArrayField(selection, 'id');
-						if (selection.length == 0) {
-							return sa.msg('请至少选择一条数据')
-						}
-						// 提交删除 
-						sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
-							sa.ajax('/TbBusiness/deleteByIds', {
-								ids: ids.join(',')
-							}, function(res) {
-								sa.arrayDelete(this.dataList, selection);
-								sa.ok('删除成功');
-								sa.f5TableHeight(); // 刷新表格高度 
-							}.bind(this))
-						}.bind(this));
-					},
 				},
 				created: function() {
 					this.f5();
+					this.restartTimmer();
 					sa.onInputEnter();
 					this.getCurrendCustomer();
 					this.getPcodeByCurrRid();
+				},
+				beforeDestroy() {
+					this.stopTimmer();
 				}
 			})
 		</script>

+ 1 - 1
sp-server/app.pid

@@ -1 +1 @@
-9100
+9460

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

@@ -3,6 +3,7 @@ package com.pj.api.open.service;
 import cn.hutool.core.util.StrUtil;
 import com.pj.api.open.ResultJson;
 import com.pj.api.open.bo.CheckCarNumberBO;
+import com.pj.project.tb_business.BusinessMessageManager;
 import com.pj.project.tb_business.TbBusiness;
 import com.pj.project.tb_business.TbBusinessService;
 
@@ -49,6 +50,7 @@ public class OpenService {
                 tbBusiness.setAdminConfirmIn(1);
             }
             tbBusinessService.updateById(tbBusiness);
+            BusinessMessageManager.set(tbBusiness.getCustomerId(),"您的订单号【"+tbBusiness.getNo()+"】,车辆"+tbBusiness.getChinaCarNo()+"已入场");
             return ResultJson.success();
         }else {
             if (tbBusiness.getAdminConfirmPay() ==0&&tbBusiness.getCustomerType()==1) {
@@ -63,6 +65,7 @@ public class OpenService {
             }
             tbBusinessService.calculationPartMoney("越南车", tbBusiness);
             tbBusinessService.updateById(tbBusiness);
+            BusinessMessageManager.set(tbBusiness.getCustomerId(),"您的订单号【"+tbBusiness.getNo()+"】,车辆"+tbBusiness.getChinaCarNo()+"已完成业务离场");
             return ResultJson.success();
         }
     }
@@ -81,6 +84,7 @@ public class OpenService {
             if (StrUtil.isNotEmpty(cb.getInChannel())||cb.getRealInTime()!=null){
                 cb.setAdminConfirmIn(1);
             }
+            BusinessMessageManager.set(cb.getCustomerId(),"您的订单号【"+cb.getNo()+"】,车辆"+cb.getChinaCarNo()+"已入场");
             tbBusinessService.updateById(cb);
             return ResultJson.success();
         }else  {
@@ -97,6 +101,7 @@ public class OpenService {
             }
             tbBusinessService.calculationPartMoney("中国车", cb);
             tbBusinessService.updateById(cb);
+            BusinessMessageManager.set(cb.getCustomerId(),"您的订单号【"+cb.getNo()+"】,车辆"+cb.getChinaCarNo()+"已完成业务离场");
             return ResultJson.success();
         }
     }

+ 24 - 0
sp-server/src/main/java/com/pj/project/tb_business/BusinessMessageManager.java

@@ -0,0 +1,24 @@
+package com.pj.project.tb_business;
+
+import com.pj.utils.cache.RedisUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Component
+public class BusinessMessageManager {
+    private static String MES_PREFIX = "b_m:";
+    private static long EXP_TIME_SECOND = 24 * 60;
+
+    public static void set(String customerId, String content) {
+        RedisUtil.forListAdd(MES_PREFIX + customerId, content);
+    }
+
+    public static List<String> get(String customerId) {
+        List<Object> list = RedisUtil.forListGet(MES_PREFIX + customerId);
+        RedisUtil.forListRemove(MES_PREFIX+customerId);
+        return list == null ? Collections.emptyList() : list.stream().map(Object::toString).collect(Collectors.toList());
+    }
+}

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

@@ -11,6 +11,7 @@ import com.pj.project.tb_business_item.TbBusinessItemService;
 import com.pj.project.tb_pass_record.TbPassRecord;
 import com.pj.project.tb_pass_record.TbPassRecordService;
 import com.pj.utils.so.SoMap;
+import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
@@ -43,6 +44,12 @@ public class TbBusinessController {
     @Resource
     private TbPassRecordService tbPassRecordService;
 
+
+    @RequestMapping(value = "getMsg")
+    public AjaxJson getMsg(){
+        return AjaxJson.getSuccessData(BusinessMessageManager.get(StpUserUtil.getCustomerId()));
+    }
+
     /**
      * 增
      */
@@ -60,6 +67,10 @@ public class TbBusinessController {
     @SaCheckPermission(TbBusiness.PERMISSION_INPUT)
     @Transactional(rollbackFor = Exception.class)
     public AjaxJson delete(String id) {
+      TbBusiness db=  tbBusinessService.getById(id);
+      if (db!=null){
+          BusinessMessageManager.set(db.getCustomerId(),"您的业务订单【"+db.getNo()+"】已删除");
+      }
         tbBusinessService.removeById(id);
         tbBusinessItemService.removeByBusinessId(id);
         tbPassRecordService.removeByBusinessId(id);
@@ -124,10 +135,11 @@ public class TbBusinessController {
     }
 
     /**
-     * 手动入场确认
+     * 手动入场确认 see adminSetIn
      */
     @RequestMapping("adminConfirmIn")
     @Transactional(rollbackFor = Exception.class)
+    @Deprecated
     public AjaxJson adminConfirmIn() {
         if (!StrUtil.equals(StpUserUtil.getCustomerId(), UserTypeEnum.PLATFORM_ADMIN.getCustomerId())) {
             return AjaxJson.getError("无确认入场权限");
@@ -235,6 +247,7 @@ public class TbBusinessController {
         tbPassRecordService.addOrUpdate(business.getId(), business.getCustomerId(), business.getCustomerName(),
                 business.getChinaCarNo(), 3,
                 business.getChinaCarInTime(), business.getChinaCarOutTime(), "中国车");
+        BusinessMessageManager.set(business.getCustomerId(),"您的订单【"+business.getNo()+"】完成业务离场");
         return AjaxJson.getSuccess();
     }
 
@@ -262,6 +275,7 @@ public class TbBusinessController {
         }
         business.setComplete(1);
         tbBusinessService.updateById(business);
+        BusinessMessageManager.set(business.getCustomerId(),"你的业务订单【"+business.getNo()+"】账单已生成!");
         return AjaxJson.getSuccessData(business);
     }
 

+ 9 - 5
sp-server/src/main/java/com/pj/project/tb_business/TbBusinessService.java

@@ -117,13 +117,14 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setConfirmInput(1)
                     .setConfirmInputTime(new Date());
         }
-        if (StrUtil.isEmpty(t.getNo())) {
-            t.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
-        }
-        List<TbBusinessItem> items = JSONUtil.toList(t.getItemJson(), TbBusinessItem.class);
         if (StrUtil.isEmpty(t.getId())) {
             t.setCreateTime(new Date());
+            t.setNo(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmm")) + RandomUtil.randomNumbers(4));
+            BusinessMessageManager.set(t.getCustomerId(),"您有一条新的业务数据:【"+t.getNo()+"】");
+        }else {
+            BusinessMessageManager.set(t.getCustomerId(),"您的业务数据:【"+t.getNo()+"】发生更改");
         }
+        List<TbBusinessItem> items = JSONUtil.toList(t.getItemJson(), TbBusinessItem.class);
         saveOrUpdate(t);
         createBusinessPeople(t);
         tbBusinessItemService.removeByBusinessId(t.getId());
@@ -218,6 +219,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
                     .setAdminConfirmPayBy(admin.getName()).setAdminConfirmPayTime(new Date());
         }
         this.updateById(tbBusiness);
+        BusinessMessageManager.set(tbBusiness.getCustomerId(),"您的业务订单【"+tbBusiness.getNo()+"】已支付");
     }
 
     public void confirm(List<String> ids) {
@@ -225,6 +227,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             TbBusiness business = this.getById(id);
             business.setConfirmInput(1).setConfirmInputTime(new Date()).setConfirmInputBy(StpUserUtil.getAdmin().getName());
             this.updateById(business);
+            BusinessMessageManager.set(business.getCustomerId(),"您的业务订单【"+business.getNo()+"】已确认");
         });
     }
 
@@ -234,6 +237,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
             business.setAdminConfirmPayTime(new Date()).setAdminConfirmPay(1).setAdminConfirmPayBy(StpUserUtil.getAdmin().getName())
                     .setPayStatus(3).setPayTicket(ticket);
             this.updateById(business);
+            BusinessMessageManager.set(business.getCustomerId(),"您的业务订单【"+business.getNo()+"】已确认支付");
         });
     }
 
@@ -247,7 +251,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
         }
         return getOne(ew);
     }
-
+    @Deprecated
     public void adminConfirmIn(String id, String inChannel) {
         TbBusiness tbBusiness = this.getById(id);
         tbBusiness.setRealInTime(new Date()).setInChannel(inChannel);