浏览代码

bug修改

lvxinghai 4 年之前
父节点
当前提交
d3df2ca9dc

+ 3 - 2
pages/checkList/checkList.vue

@@ -37,7 +37,7 @@
 		</view>
 		</view>
 		<view class="null" v-if="depList.length === 0">暂无数据</view>
 		<view class="null" v-if="depList.length === 0">暂无数据</view>
 		<tm-modal v-show="showModal" v-on:click="showModalHandle(false)">
 		<tm-modal v-show="showModal" v-on:click="showModalHandle(false)">
-			<view class="content-list">
+			<scroll-view scroll-y="true" class="content-list">
 				<view class="list-item" 
 				<view class="list-item" 
 					v-for="(item, index) in planList"
 					v-for="(item, index) in planList"
 					:class="{active: checkId === item.id}" 
 					:class="{active: checkId === item.id}" 
@@ -55,7 +55,7 @@
 						v-if="checkId === item.id"
 						v-if="checkId === item.id"
 						src="../../static/checkStatus.png"></image>
 						src="../../static/checkStatus.png"></image>
 				</view>
 				</view>
-			</view>
+			</scroll-view>
 		</tm-modal>
 		</tm-modal>
 	</view>
 	</view>
 </template>
 </template>
@@ -182,6 +182,7 @@
 	.content-list {
 	.content-list {
 		padding-top: 50rpx;
 		padding-top: 50rpx;
 		width: 100%;
 		width: 100%;
+		height: 100%;
 		background-color: #fff;
 		background-color: #fff;
 		.list-item {
 		.list-item {
 			display: flex;
 			display: flex;

+ 8 - 1
pages/creatingSituations/components/checkMapDetail.vue

@@ -70,9 +70,16 @@
 			btnClick: function(id) {
 			btnClick: function(id) {
 				if(id === 'ok') {
 				if(id === 'ok') {
 					const {id, pointList} = this.checkMap.actionItem;
 					const {id, pointList} = this.checkMap.actionItem;
+					let _pointList = pointList.map((item)=>{
+						let obj = item.itemList.find(({selectFlag}) => selectFlag);
+						return {
+							...item,
+							selectFlag: obj ? true : false
+						}
+					});
 					let list = [...this.checkMap.list];
 					let list = [...this.checkMap.list];
 					let index = list.findIndex((item)=> item.id === id);
 					let index = list.findIndex((item)=> item.id === id);
-					list[index].pointList = pointList;
+					list[index].pointList = _pointList;
 					this.myCommit('list', list);
 					this.myCommit('list', list);
 				} 
 				} 
 				this.commit('showCheckMapDetail', false);
 				this.commit('showCheckMapDetail', false);

+ 1 - 1
pages/creatingSituations/components/checkPlan.vue

@@ -142,7 +142,7 @@
 				const { model } = this.checkPlan.checkedItem;
 				const { model } = this.checkPlan.checkedItem;
 				const {start, dayNum} = this.checkPlan.dateObj;
 				const {start, dayNum} = this.checkPlan.dateObj;
 				let checkList = [];
 				let checkList = [];
-				if(model && dayNum > 0) { // 确保前两步都做好了
+				if(model && dayNum > 0 && dayNum >= model) { // 确保前两步都做好了
 					let num = Math.floor(dayNum / model);
 					let num = Math.floor(dayNum / model);
 					checkList = [start];
 					checkList = [start];
 					for(let i = 0; i < num - 1; i++) {
 					for(let i = 0; i < num - 1; i++) {

+ 1 - 3
pages/creatingSituations/components/checkRent.vue

@@ -28,9 +28,7 @@
 						<view class="chid-item"> 
 						<view class="chid-item"> 
 							<view>负责要点</view>
 							<view>负责要点</view>
 							<view>
 							<view>
-								<text v-for="(point, c) in item.points" :key="c">
-									{{point.name}};
-								</text>
+								<text>{{item.allPoints}}</text>
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>

+ 13 - 1
pages/creatingSituations/creatingSituations.vue

@@ -164,6 +164,10 @@
 				}
 				}
 				this.dispatch(`save${this.saveType}`, data).then((data)=>{
 				this.dispatch(`save${this.saveType}`, data).then((data)=>{
 					if(data) {
 					if(data) {
+						// 保存成功先清空数据
+						this.myCommit('stepActive', 0);
+						this.myCommit('theme', {id: null, title: null, des: null});
+						this.myCommit('editConfig', null);
 						uni.navigateTo({
 						uni.navigateTo({
 							url: '/pages/situationsCenter/situationsCenter'
 							url: '/pages/situationsCenter/situationsCenter'
 						});
 						});
@@ -182,7 +186,15 @@
 							this.nextHandle(this.stepActive);
 							this.nextHandle(this.stepActive);
 						break;
 						break;
 					case 'checkPlanCreate': // 生成查核计划
 					case 'checkPlanCreate': // 生成查核计划
-						this.myCommit('showCheckPlan1', false);
+						if(this.checkPlan.checkList.length === 0) {
+							uni.showModal({
+							  title: '错误提示',
+							  content: '查核频次必须大于或等于1!',
+							  showCancel: false
+							});
+						} else {
+							this.myCommit('showCheckPlan1', false);
+						}
 						break;
 						break;
 					case 'checkPlanCallback': // 生成查核计划-返回
 					case 'checkPlanCallback': // 生成查核计划-返回
 						this.myCommit('showCheckPlan1', true);
 						this.myCommit('showCheckPlan1', true);

+ 4 - 3
pages/situationDetail/situationDetail.vue

@@ -60,7 +60,8 @@
 </template>
 </template>
 
 
 <script>
 <script>
-	import popup from './components/bottom-popup.vue'
+	import popup from './components/bottom-popup.vue';
+	import {dateHandle} from "../../utils/dateHandle.js";
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -99,7 +100,6 @@
 		},
 		},
 		created: function() {
 		created: function() {
 			this.nowPermission=uni.getStorageSync('nowPermission');
 			this.nowPermission=uni.getStorageSync('nowPermission');
-			console.log(this.nowPermission);
 			this.isAdmin=this.nowPermission==1?true:false;
 			this.isAdmin=this.nowPermission==1?true:false;
 			this.isCheckLeader=this.nowPermission==2?true:false;
 			this.isCheckLeader=this.nowPermission==2?true:false;
 			this.isChecker=this.nowPermission==3?true:false;
 			this.isChecker=this.nowPermission==3?true:false;
@@ -180,9 +180,10 @@
 				}
 				}
 			},
 			},
 			compareTime(time){
 			compareTime(time){
-				let myDate=new Date();
+				let myDate=dateHandle.todayDate().replace(/-/g,"/");
 				let firstCheckTime=time.replace(/-/g,"/");
 				let firstCheckTime=time.replace(/-/g,"/");
 				firstCheckTime=Date.parse(firstCheckTime);
 				firstCheckTime=Date.parse(firstCheckTime);
+				myDate=Date.parse(myDate);
 				if(myDate>firstCheckTime){
 				if(myDate>firstCheckTime){
 					return false;
 					return false;
 				}else{
 				}else{

+ 29 - 28
pages/situationsCenter/situationsCenter.vue

@@ -63,6 +63,8 @@
 				refTimer: null,
 				refTimer: null,
 				isInitWs: null,
 				isInitWs: null,
 				messageType: null,
 				messageType: null,
+				num: 1,
+				timer: null
 			}
 			}
 		},
 		},
 		created: function() {
 		created: function() {
@@ -73,17 +75,18 @@
 			  this.isInitWs = websocket.ws ? false : true;
 			  this.isInitWs = websocket.ws ? false : true;
 			  this.init(this.isInitWs);
 			  this.init(this.isInitWs);
 			}, 3 * 60 * 1000);
 			}, 3 * 60 * 1000);
-			this.messStatus();
+			this.messStatus(1);
 		},
 		},
 		beforeDestroy() {
 		beforeDestroy() {
 		  // 关闭ws连接
 		  // 关闭ws连接
 		  websocket.close();
 		  websocket.close();
 		  clearInterval(this.refTimer);
 		  clearInterval(this.refTimer);
+			clearTimeout(this.timer);
 		},
 		},
 		watch:{
 		watch:{
 			  "$route":{
 			  "$route":{
 				  handler(route){
 				  handler(route){
-					  this.messStatus();
+					  this.messStatus(1);
 				  }
 				  }
 			  }
 			  }
 		},
 		},
@@ -211,32 +214,30 @@
 					this.isInitWs && this.initWebsocket(hiId, user, permission);
 					this.isInitWs && this.initWebsocket(hiId, user, permission);
 				});
 				});
 			},
 			},
-			messStatus(){
-				let num = 1;
-				let timer = setInterval(()=>{
-				  this.$store.dispatch({
-					  type: "calendar/commActions",
-					  payload: {
-						key: "messagesList",
-						data: {
-						  pageNum: num,
-						  pageSize: 100,
-						},
-					  },
-					}).then((res)=>{
-						if(res && res.list.length == 0){
-							clearInterval(timer)
-						}else if(res && res.list.length != 0){
-							res.list.map((item)=>{
-								if(!item.readStatus){
-									this.messageType = true;
-									return;
-								}
-							})
-						}
-					})
-				  num++;
-				},200)
+			messStatus(num){
+				this.$store.dispatch({
+					type: "calendar/commActions",
+					payload: {
+					key: "messagesList",
+					data: {
+						pageNum: num,
+						pageSize: 100,
+					},
+					},
+				}).then((res)=>{
+					if(res && res.list.length != 0){
+						res.list.map((item)=>{
+							if(!item.readStatus){
+								this.messageType = true;
+								return;
+							}
+						})
+						this.num++;
+						this.timer = setTimeout(()=>{
+							this.messStatus(this.num);
+						}, 200);
+					}
+				})
 			}
 			}
 		}
 		}
 	}
 	}