Quellcode durchsuchen

修复查核返回列表无刷新

xieyunhui vor 4 Jahren
Ursprung
Commit
a76271a29b

+ 6 - 7
App.vue

@@ -9,12 +9,12 @@
 			// 		this.checkArguments(); // 检测启动参数
 			// 	});
 			// }
-			if (uni.getSystemInfoSync().platform === 'android'){
-				//pad下锁死竖屏适配布局
-				// #ifdef APP-PLUS
-				   plus.screen.lockOrientation('portrait-primary');
-				// #endif
-			}
+			// if (uni.getSystemInfoSync().platform === 'android'){
+			// 	//pad下锁死竖屏适配布局
+			// 	// #ifdef APP-PLUS
+			// 	   plus.screen.lockOrientation('portrait-primary');
+			// 	// #endif
+			// }
 			
 			
 			
@@ -69,7 +69,6 @@
 				} catch (e) {}
 			},
 			
-
 			update(){  //app更新
 				// // #ifdef APP-PLUS  
 				// plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {  

+ 6 - 2
components/tm-radio-group/radio-group.vue

@@ -5,7 +5,7 @@
 		</view>
 		<view class="radio-group">
 			<template v-for="(item, i) in list">
-				<view class="radio-item" :key="i" @click="toggleSelect(item, i)">
+				<view :class="{'radio-item':true}" :key="i" @click="toggleSelect(item, i)">
 					<text class="text">{{ item[setting.name] }}</text>
 					<image class="icon"
 					  :src="`/static/${item[setting.value] === defaultValue ? 'check-radio' : 'check-no'}.png`"></image>
@@ -65,7 +65,7 @@
 		.radio-group {
 			padding-left: 25rpx;
 			background-color: #fff;
-
+            border-bottom: 0.62rpx solid #DADEE6;
 			.radio-item {
 				display: flex;
 				align-items: center;
@@ -83,6 +83,10 @@
 					width: 25rpx;
 					height: 25rpx;
 				}
+				
+				&:last-child {
+					border-bottom: none;
+				}
 			}
 		}
 	}

+ 1 - 0
components/tm-radio-group/tm-radio-group.vue

@@ -148,6 +148,7 @@ import radioSelectGroup from './radio-select-group.vue'
 					width: 25rpx;
 					height: 25rpx;
 				}
+				
 			}
 		}
 	}

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "追踪方法学",
     "appid" : "__UNI__03C4C69",
     "description" : "",
-    "versionName" : "0.6.1",
+    "versionName" : "0.6.3",
     "versionCode" : 100,
     "transformPx" : false,
     "app-plus" : {

+ 9 - 0
pages.json

@@ -178,6 +178,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/batchDistribution/batchDistribution",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "查核批量分配",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationStyle": "custom",

+ 3 - 24
pages/auditItemDetails/auditItemDetails.vue

@@ -68,6 +68,7 @@
 	/**
 	 * 查核项详情
 	 */
+	import {_goBackFresh} from '../../utils/compatible.js';
 	export default {
 		data() {
 			return {
@@ -138,30 +139,8 @@
 				return this.$store.dispatch({type: 'checkList/commActions', key, data});
 			},
 			goToPrevPage(){
-				console.log('goback');
-				//获取所有页面栈,找出需要的回到的页面栈,返回。
-				const pages = getCurrentPages();
-				const reversed = pages.reverse();
-				const currentPageIndex = 0;
-				console.log({reversed});
-				uni.navigateBack({
-				    delta: 1
-				});
-				if(false){
-					pages.some((item,index)=>{
-						  // console.log('循环');
-						  if(item.route == "pages/checkMainPoints/checkMainPoints"){
-							  let needdelta =index-currentPageIndex;
-							  console.log({needdelta,index,currentPageIndex});
-							  //通知返回目标页面刷新数据
-							  item.ifFromChildPage=true;
-							  uni.navigateBack({
-							      delta: needdelta
-							  });
-							  return true;
-						  }
-					});
-				}
+				_goBackFresh('pages/checkMainPoints/checkMainPoints');
+				
 			},
 			loadItemDetail(id){
 				this.dispatch('checkTaskDetail', {id}).then((data)=>{

+ 278 - 0
pages/batchDistribution/batchDistribution.vue

@@ -0,0 +1,278 @@
+<template>
+	<view class="allocationPerson-page">
+		<scroll-view class="scroll-y" scroll-y="true">
+			<template>
+				<view class="blockTitle">计划时间</view>
+				<div class="date-view">
+					<view class="row">
+						<text class="label">开始时间</text>
+						<view class="date-box">
+							<date-time-picker :height="100" :start="details.planStartDate" :end="details.planEndDate"
+								:defaultValue="details.startDate" placeholder="请选择起始时间" pickType="startDate"
+								@change="changeDateTime" />
+						</view>
+					</view>
+					<view class="row">
+						<text class="label">结束时间</text>
+						<view class="date-box">
+							<date-time-picker :height="100" :start="details.planStartDate" :end="details.planEndDate"
+								:defaultValue="details.endDate" placeholder="请选择结束时间" pickType="endDate"
+								@change="changeDateTime" />
+						</view>
+					</view>
+				</div>
+				<view class="blockTitle">查核人</view>
+				<tm-radio-group :list="empList" :defaultValue='details.empId' :setting="{
+				  value: 'employeeId',
+				  name: 'employeeName'
+				}" :openkeys="[0]" @change="changeDetails" />
+
+			</template>
+		</scroll-view>
+		<view class="fixed-buttom-btn" @click="sure">
+			<text class="btn-text">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	// 查核列表编辑 查核人和计划时间
+	import {
+		mapState
+	} from "vuex";
+	import moment from 'moment';
+	export default {
+		computed: {
+			...mapState({
+				checkList: state => state.editCheckList.checkList
+			})
+		},
+		data() {
+			return {
+				title: '', // 导航标题
+				// 查核组员列表
+				empList: [],
+				// 组件信息
+				details: {},
+				// 服务器时间
+				dateStr: '',
+				timer: null,
+				// 点击确定按钮是否直接保存
+				isSubmit: false
+			}
+		},
+		onLoad({
+			details
+		}) {
+		
+			const _details = details ? JSON.parse(details) : {};
+			// 强制刷新返回查核列表页面
+			if (getCurrentPages().length === 1) {
+				const {
+					situationId,
+					checkId,
+					checkGroupId,
+					planStartDate,
+					planEndDate
+				} = _details;
+				uni.redirectTo({
+					url: `/pages/editCheckList/editCheckList?situationId=${situationId}&checkId=${checkId}&checkGroupId=${checkGroupId}&startDate=${planStartDate}&endDate=${planEndDate}`
+				});
+			}
+			this.getComponentInfo(_details);
+		},
+		destroyed() {
+			this.clearTimer();
+		},
+		methods: {
+			getComponentInfo(details) {
+				// this.setNavigationBarTitle(details.title);
+				this.details = details;
+				this.getEmpDeptTree(details.checkGroupId);
+			},
+			// 查询部门人员树
+			getEmpDeptTree(checkGroupId) {
+				this.$store.dispatch({
+					type: 'allocationPerson/commActions',
+					key: "getGroupEmpList",
+					data: {
+						checkGroupId
+					}
+				}).then(data => {
+					if (data) {
+						this.empList = data || [];
+					}
+				});
+			},
+			// 指派查核人员改变
+			changeDetails(selectVal, selectData, index) {
+				this.details = {
+					...this.details,
+					empId: selectData.employeeId,
+					empName: selectData.employeeName
+				}
+			},
+			// 时间变化
+			changeDateTime(dateObj, pickType) {
+				if (pickType === 'startDate') { // 开始时间变化
+					this.diffDateTime(dateObj.f3, this.details.endDate);
+				} else {
+					this.diffDateTime(this.details.startDate, dateObj.f3);
+				}
+				this.details = {
+					...this.details,
+					[pickType]: dateObj.f3
+				};
+			},
+			// 开始时间和结束时间对比
+			diffDateTime(startTime, endTime) {
+				if (moment(startTime).valueOf() > moment(endTime).valueOf()) {
+					this.showModal('开始时间不能大于结束时间');
+				}
+			},
+			// 点击确定
+			sure() {
+				const {
+					empId,
+					startDate,
+					endDate
+				} = this.details;
+				if (this.isSubmit === true) {
+					return this.changeCheckList(this.checkList);
+				}
+				if (this.title === '指派查核人员') {
+					if (!empId) {
+						return this.showModal('请选择查核人');
+					}
+					// this.setNavigationBarTitle('设置查核时间');
+				} else {
+					if (!startDate) {
+						return this.showModal('请选择开始时间');
+					}
+					if (!endDate) {
+						return this.showModal('请选择结束时间');
+					}
+					if (!empId) {
+						// this.setNavigationBarTitle('指派查核人员');
+						this.isSubmit = true;
+					} else {
+						const data = {
+							"checkId": this.details.checkId, //  计划id
+							"deptIds": JSON.parse(JSON.stringify(this.details.checkedList)), // 多个单位id列表
+							"empId": this.details.empId, // 查核者id
+							"empName": this.details.empName, // 查核者名字
+							"startDate": this.details.startDate, // 开始时间
+							"endDate": this.details.endDate // 结束时间
+						}
+						// console.log({data});
+						this.$store.dispatch({
+							type: 'batchDistribution/commActions',
+							key: 'batchCheckEmp',
+							data: {
+								...data
+							}
+						}).then(data => {
+							if (data) {
+								uni.showModal({
+									title: '分配成功!',
+									content: '',
+									showCancel: false,
+									success: function(res) {
+										if (res.confirm) {
+											// console.log('用户点击确定');
+											
+											let pages = getCurrentPages();	// 获取当前页面栈
+											let prePage = pages[pages.length - 2];	// 上一个页面
+											// console.log({prePage});
+											prePage.ifInit = true;   
+											uni.navigateBack({
+												delta: 1
+											});
+											
+										}
+									}
+								});
+							}
+						});
+					}
+				}
+			},
+
+
+			// 获取当前时间
+			getDateStr() {
+				this.$store.dispatch({
+					type: "commActions",
+					key: "getDateStr",
+				}).then((data) => {
+					if (data) {
+						this.dateStr = data;
+					}
+				});
+			},
+			showModal(content) {
+				uni.showModal({
+					content,
+					showCancel: false
+				});
+			},
+			// 清除定时器
+			clearTimer() {
+				if (this.timer) {
+					clearInterval(this.timer);
+					this.timer = null;
+				}
+			}
+		},
+	}
+</script>
+
+<style lang="less">
+	.allocationPerson-page {
+		height: 100%;
+
+		.scroll-y {
+			height: calc(100% - 87.5rpx);
+			padding-top: 15rpx;
+
+			.blockTitle {
+				font-size: 22.5rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #666F80;
+				padding: 15rpx 0;
+				padding-left: 25rpx;
+				border-bottom: 0.62rpx solid #DADEE6;
+			}
+
+			.date-view {
+				padding: 0 25rpx;
+				background: #fff;
+				margin-bottom: 12.5rpx;
+				border-bottom: 0.62rpx solid #DADEE6;
+
+				.row {
+					display: flex;
+					align-items: center;
+					height: 62.5rpx;
+					border-bottom: 0.62rpx solid #DADEE6;
+
+					.label {
+						width: 112.5rpx;
+						font-size: 22.5rpx;
+						color: #292C33;
+					}
+
+					.date-box {
+						padding-left: 25rpx;
+						flex: 1;
+					}
+
+					&:last-child {
+						border-bottom: 0;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 17 - 0
pages/batchDistribution/model.js

@@ -0,0 +1,17 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+  },
+  mutations: {
+    comChangeState(state, { key, data }) {
+			state[key] = data;
+		},
+  },
+  actions: {
+		commActions({ commit, state }, { key, data }) {
+      return commServer(key, data);
+		},
+  }
+}

+ 19 - 0
pages/batchDistribution/server.js

@@ -0,0 +1,19 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+  // 查核组员列表
+  getGroupEmpList: {
+    method: 'GET',
+    url: 'common/groupEmpList'
+  },
+  batchCheckEmp: {
+    method: 'POST',
+    url: 'plan/batchCheckEmp'
+  }
+};
+
+export const commServer = (key, data) => {
+  let obj = requestList[key];
+  console.log({key});
+  return creatRequest(obj, data);
+}

+ 3 - 3
pages/checkList/checkList.vue

@@ -89,7 +89,7 @@
 		},
 		onLoad: function ({situationId}) {
 			this.dispatch('planList', {situationId}).then((data)=>{
-				if(data) {
+				if(data&&data.length>0) {
 					this.planList = data;
 					let checkArr = data.filter((item)=> Number(item.status)=== 2).sort((a,b)=>a.createTime - b.createTime);
 					this.checkId = checkArr ? checkArr[checkArr.length - 1].id 
@@ -118,10 +118,10 @@
 			showModalHandle: function(showModal) {
 				this.showModal = showModal;
 			},
-			gotoCheckMainPointsPage({checkId, deptId}) {
+			gotoCheckMainPointsPage({checkId, deptId,finishedStatus}) {
 				//跳转到查核要点
 				uni.navigateTo({
-					url: `/pages/checkMainPoints/checkMainPoints?checkId=${checkId}&deptId=${deptId}`
+					url: `/pages/checkMainPoints/checkMainPoints?checkId=${checkId}&deptId=${deptId}&finishedStatus=${finishedStatus}`
 				});
 			},
 			dispatch: function(key, data) {

+ 75 - 10
pages/checkMainPoints/checkMainPoints.vue

@@ -28,7 +28,8 @@
 						src="../../static/checkStatus.png"></image>
 				</view>
 			</view>
-		</tm-modal>
+		</tm-modal>
+		<scroll-view  scroll-y="true" class="scroll-Y" >
 		<view class="list" v-for="(item, index) in detailList" :key="index">
 			<view class="title" v-if="item.responseList.length > 0">查核要点:{{item.checkPointName}}</view>
 			<view class="item" v-for="(child, n) in item.responseList" @click="childClick(child,item.checkPointId)"
@@ -61,8 +62,10 @@
 					</view>
 				</view>
 			</view>
-		</view>
-		<tm-callback-listpage />
+		</view>
+		</scroll-view>
+		<tm-callback-listpage />
+		<view v-if="detailList.length>0&&active != 2&&finishedStatus != 1" @click="onkeyCheckHandle" class="botOneKeyCheck">完成</view>
 	</view>
 </template>
 
@@ -98,7 +101,8 @@
 				nowPermission: uni.getStorageSync('nowPermission'),
 				active: 0,
 				checkId: '',
-				deptId: ''
+				deptId: '',
+				finishedStatus:0,//所有计划里的查核项是否都以完成
 			};
 		},
 		computed: {
@@ -109,10 +113,12 @@
 		},
 		onLoad: function({
 			checkId,
-			deptId
+			deptId,
+			finishedStatus
 		}) {
 			this.deptId = deptId;
-			this.checkId = checkId;
+			this.checkId = checkId;
+			this.finishedStatus = finishedStatus;
 			this.checkTaskDetailList({
 				deptId,
 				checkId
@@ -130,8 +136,56 @@
 		beforeDestroy(){
 			this.ifFromChildPage=false;
 		},
-		methods: {
-			btnClick(id) {
+		methods: {
+			//一键查核
+			onkeyCheckHandle(){
+				uni.showModal({
+				    title: '注意',
+				    content: '确定所有未填写查核结果项默认无缺失结果吗?',
+				    success:(res)=>{
+				        if (res.confirm) {
+				            console.log('用户点击确定');
+							this.oneKeyCheckCommit();
+				        } else if (res.cancel) {
+				            console.log('用户点击取消');
+				        }
+				    }
+				});
+			},
+			oneKeyCheckCommit(){
+				let ids=[];
+				console.log('this.detailList',this.detailList);
+				this.detailList.forEach(item=>{
+					   // console.log(item.responseList);
+					   //筛选掉已查核项
+					   const temp = item.responseList.filter(v=>!v.checkResult);
+					   const arr = temp.map(v=>v.id);
+					   ids = ids.concat(arr);
+				});
+				this.$store.dispatch({
+					type: 'checkMainPoints/commActions',
+					key: 'oneKeyCheck',						
+					data: ids
+				}).then(data=>{
+					   if(data){
+				           uni.showModal({
+				               title: '查核完成!',
+				               content: '',
+							   showCancel:false,
+				               success: function (res) {
+				                   if (res.confirm) {
+				                       console.log('用户点击确定');
+									   uni.navigateBack({
+									       delta: 1
+									   });
+				                   }
+				               }
+				           });
+					   }
+				});
+			},
+			btnClick(id) {
+				// console.log({id});
 				this.active = id;
 				this.filterCompleteFlag(id);
 			},
@@ -269,7 +323,16 @@
 		font-size: 22.5rpx;
 		line-height: 33.75rpx;
 		background-color: #F5F6FA;
-
+        .botOneKeyCheck {
+			text-align: center;
+			height: 75rpx;
+			line-height: 75rpx;
+			font-size: 22.5rpx;
+			font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+			font-weight: 400;
+			color: #FFFFFF;
+			background: #3377FF;
+		}
 		.top-search {
 			display: flex;
 			flex-direction: row;
@@ -361,7 +424,9 @@
 				}
 			}
 		}
-
+        .scroll-Y {
+			height: calc(100% - 75rpx);
+		}
 		.list {
 			.title {
 				padding-left: 25rpx;

+ 19 - 0
pages/checkMainPoints/model.js

@@ -0,0 +1,19 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+     // 查核列表
+     checkList: [],
+  },
+  mutations: {
+		comChangeState(state, {key, data}) {
+			state[key] = data;
+		},
+  },
+  actions: {
+		commActions({ commit, state }, { key, data }) {
+      return commServer(key, data);
+		},
+  }
+}

+ 14 - 0
pages/checkMainPoints/server.js

@@ -0,0 +1,14 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+  // 一键查核
+  oneKeyCheck: {
+    method: 'POST',
+    url: 'checkTask/saveBatchCheckTaskDetail'
+  },
+};
+
+export const commServer = (key, data) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 28 - 10
pages/creatingSituations/components/checkMapAdd.vue

@@ -67,17 +67,35 @@
 				this.checkedIds = arrFilter(id, this.checkedIds);
 			},
 			btnClick: function(id) {
+				// console.log({id});
 				if(id === 'ok') {
-					this.dispatch('addDeptList', {depIds: this.checkedIds}).then((data)=>{
-						if(data) {
-							const {list, actionItem} = this.checkMap;
-							let arr = [...this.checkMap.list];
-							let _data = this.checkDep(data);
-							let index = list.findIndex(({id})=> id === actionItem.id);
-							arr.splice(index + 1, 0, ..._data);
-							this.myCommit('list', arr);
-						}
-					});
+					if(this.checkedIds.length>0){
+						  this.dispatch('addDeptList', {depIds: this.checkedIds}).then((data)=>{
+						  	if(data) {
+						  		const {list, actionItem} = this.checkMap;
+						  		let arr = [...this.checkMap.list];
+						  		let _data = this.checkDep(data);
+						  		let index = list.findIndex(({id})=> id === actionItem.id);
+						  		arr.splice(index + 1, 0, ..._data);
+						  		this.myCommit('list', arr);
+								
+						  	}
+						  });
+					}else {
+						uni.showModal({
+						    title: '提示',
+						    content: '新增单位不能为空!',
+							showCancel:false,
+						    success: function (res) {
+						        if (res.confirm) {
+						            // console.log('用户点击确定');
+						        }
+						    }
+						});
+					}
+				}
+				if(id=='cancle'){
+					//点击取消
 				}
 				this.commit('showCheckMapAdd', false);
 			},

+ 559 - 334
pages/editCheckList/editCheckList.vue

@@ -1,338 +1,563 @@
-<template>
-	<view class="check-map-list">
-    <scroll-view class="scroll-y" scroll-y="true" v-if="checkList.length > 0">
-      <view class="item"
-	    	v-for="(item, index) in checkList"
-	    	:key="index">
-	    	<view class="title-wrap">
-	    		<text>{{item.deptName}}</text>
-	    		<view>
-	    			<image src="../../static/icon-map.png"></image>
-	    			<text>{{item.deptClassName}}</text>
-	    		</view>
-	    	</view>
-	    	<view class="content">
-	    		<text>{{item.decs}}</text>
-	    		<text>
-	    			要点概览:{{item.checkPointNames}}
-	    		</text>
-	    	</view>
-	    	<view class="footer">
-	    	 <view class="row" @click="checkEdit(item, index, '指派查核人员')">
-	    	 	 <text class="label">查核人</text>
-	    		 <view class="content">
-	    		 	 <text :class="['base-text', item.empName ? 'black-color' : '']">
-	    				 {{ item.empName ? item.empName : '选择查核成员'}}
-	    			 </text>
-	    		 </view>
-	    		 <image class="arrow" src="/static/images/icon-more.png"></image>
-	    	 </view>
-	    	 <view class="row" @click="checkEdit(item, index, '设置查核时间')">
-	    	 	 <text class="label">计划时间</text>
-	    		 <view class="content">
-	    		 	 <text :class="['base-text', item.startDate ? 'black-color' : '']">
-	    			   {{ item.startDate ? item.startDate : '选择起始时间' }}
-	    			 </text>
-	    		 	 <text class="center-text">至</text>
-	    			 <text :class="['base-text', item.endDate ? 'black-color' : '']">
-	    			   {{ item.endDate ? item.endDate : '选择结束时间' }}
-	    			 </text>
-	    		 </view>
-	    		 <image class="arrow" src="/static/images/icon-more.png"></image>
-	    	 </view>
-	    	</view>
-	    </view>
-    </scroll-view>
-		<view class="null" v-else>暂无数据</view>
-    <view class="fixed-buttom-btn" @click="submit" v-if="checkList.length > 0">
-			<text class="btn-text">完成</text>
+<template>
+	<view class="check-map-list">
+		<scroll-view class="scroll-y" scroll-y="true" v-if="checkList.length > 0">
+			<view class="item" v-for="(item, index) in checkList" :key="index">
+				<view v-if="multiple != 'true'&&ifStartCheck(item.startDate)"  :class="{'checkPoint':true,checked:checkedList.includes(item.deptId)}" @click="checkedHandle(item.deptId)">
+					<image class="innerImg" v-if="checkedList.includes(item.deptId)" src="../../static/check-checkbox.png" mode=""></image>
+				</view>
+				<view class="title-wrap">
+					<text>{{item.deptName}}</text>
+					<view>
+						<image src="../../static/icon-map.png"></image>
+						<text>{{item.deptClassName}}</text>
+					</view>
+				</view>
+				<view class="content">
+					<text>{{item.decs}}</text>
+					<text>
+						要点概览:{{item.checkPointNames}}
+					</text>
+				</view>
+				<view class="footer">
+					<view class="row" @click="checkEdit(item, index, '指派查核人员')">
+						<text class="label">查核人</text>
+						<view class="content">
+							<text :class="['base-text', item.empName ? 'black-color' : '']">
+								{{ item.empName ? item.empName : '选择查核成员'}}
+							</text>
+						</view>
+						<image class="arrow" src="/static/images/icon-more.png"></image>
+					</view>
+					<view class="row" @click="checkEdit(item, index, '设置查核时间')">
+						<text class="label">计划时间</text>
+						<view class="content">
+							<text :class="['base-text', item.startDate ? 'black-color' : '']">
+								{{ item.startDate ? item.startDate : '选择起始时间' }}
+							</text>
+							<text class="center-text">至</text>
+							<text :class="['base-text', item.endDate ? 'black-color' : '']">
+								{{ item.endDate ? item.endDate : '选择结束时间' }}
+							</text>
+						</view>
+						<image class="arrow" src="/static/images/icon-more.png"></image>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+		<view class="null" v-else>暂无数据</view>
+		<view class="fixed-buttom-btn" @click="submit" v-if="multiple == 'true'">
+			<text class="btn-text">完成</text>
 		</view>
-	</view>
-</template>
-
-<script>
-  // 查核列表(查核人和计划时间可编辑)
-  import { mapState } from "vuex";
-  import moment from 'moment';
-	export default {
-    computed: {
-      ...mapState({
-        checkList: state => state.editCheckList.checkList
-      })
-    },
-		data() {
-			return {
-        // 查核组id
-        checkGroupId: 0,
-        // 情境id (批量修改有,不然为0)
-        situationId: 0,
-        // 查核id
-        checkId: 0,
-        // 计划开始时间
-        startDate: '',
-        // 计划结束时间
-        endDate: '',
-        multiple: 'false',
-        planList: []
-			};
+		<view class="bottomBtnGroup"  v-if="multiple != 'true'">
+			<view class="leftBtn" @click="bottomBtnClickHandle('left')">{{`(全部${checkList.length}项)全选分配`}}</view>
+			<view class="rightBtn" @click="bottomBtnClickHandle('right')">{{`(已选${checkedList.length}项)批量分配`}}</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	// 查核列表(查核人和计划时间可编辑)
+	import {
+		mapState
+	} from "vuex";
+	import moment from 'moment';
+	export default {
+		computed: {
+			...mapState({
+				checkList: state => state.editCheckList.checkList
+			})
+		},
+		data() {
+			return {
+				// 查核组id
+				checkGroupId: 0,
+				// 情境id (批量修改有,不然为0)
+				situationId: 0,
+				// 查核id
+				checkId: 0,
+				// 计划开始时间
+				startDate: '',
+				// 计划结束时间
+				endDate: '',
+				multiple:false,
+				planList: [],
+				hasStartedCheck:[],//查核已经开始的集合
+				ifInit:null,
+				ifshowBottom:false,
+				checkedList:[],//批量选中的集合
+			};
+		},
+		onLoad({
+			situationId,
+			checkId,
+			checkGroupId,
+			startDate,
+			endDate,
+			multiple
+		}) {
+			this.init(situationId,
+			checkId,
+			checkGroupId,
+			startDate,
+			endDate,
+			multiple);
 		},
-    onLoad({ situationId, checkId, checkGroupId, startDate, endDate, multiple }){
-      this.getCheckList(checkId);
-      this.checkGroupId = checkGroupId ? +checkGroupId : 0;
-      this.situationId = situationId ? +situationId : 0;
-      this.checkId = checkId ? +checkId : 0;
-      this.startDate = startDate;
-      this.endDate = endDate;
-      this.multiple = multiple;
-    },
+		onShow() {
+			    let pages = getCurrentPages();	// 获取当前页面栈
+				let curPage = pages[pages.length - 1];	// 当前页面
+				if(curPage.ifInit){
+					curPage.ifInit = false;
+					this.init(
+					   this.situationId,
+					   this.checkId,
+					   this.checkGroupId,
+					   this.startDate,
+					   this.endDate,
+					   this.multiple
+					)    // A页面 method中的方法,用来刷新页面A
+				}
+			
+		},
+		mounted(){
+		},
 		methods: {
-      // 完成
-      submit() {
-        // baseEmpList: 第一次计划修改的数据; changePlanList: 批量分配,记录第一次计划修改数据的信息;  multipleEmpList: 批量修改的数据
-        let baseEmpList = [], changePlanList = [], multipleEmpList = [];
-        // planStartTimestamp: 开始计划时间戳;
-        let planStartTimestamp = this.dateToTimestamp(this.startDate);
-        this.checkList.map((item, i) => {
-          const {checkId, deptId, empId, empName, startDate, endDate} = item;
-          if(empId && startDate && endDate){
-            baseEmpList.push({
-              checkId,
-              deptId,
-              empId,
-              empName,
-              startDate: startDate || '',
-              endDate: endDate || ''
-            });
-            if(this.multiple === 'true'){ // 批量分配
-              changePlanList.push({
-                index: i, // 第一次计划修改的下标
-                baseEmpListIndex: baseEmpList.length -1,
-                startDiffTimestamp: (startDate && planStartTimestamp != -1) ? this.dateToTimestamp(startDate) - planStartTimestamp : -1, // 开始时间差
-                endDifTimestamp: (endDate && planStartTimestamp != -1) ? this.dateToTimestamp(endDate) - planStartTimestamp : -1 // 结束时间差
-              });
-            }
-          }
-        });
-        if(this.multiple === 'true') { // 批量分配
-          this.$store.dispatch({
-		      	type: 'planList/commActions',
-		      	payload: {
-		      		key: 'planList',
-		      		data:{situationId: this.situationId}
-		      	}
-		      }).then((planList) => {
-            (planList || []).map(((planItem, planI) => {
-               if(planI != 0){ // 过滤掉第一条
-                 // 计划开始时间戳
-                 let planStartTimestamp = planItem.startDate ? this.dateToTimestamp(planItem.startDate + ' 00:00') : -1;
-                 // 计划结束时间戳
-                 let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem.endDate + ' 23:59') : -1;
-
-                 planItem.empList && planItem.empList.map((empItem, empI) => {
-                   // 当前分配明细
-                   let currentEmp = changePlanList.find(item => item.index === empI);
-                   if(currentEmp){
-                     const { baseEmpListIndex, startDiffTimestamp, endDifTimestamp } = currentEmp;
-                     const { empId, empName } = baseEmpList[baseEmpListIndex] || {};
-                     multipleEmpList.push({
-                       empId,
-                       empName,
-                       checkId: empItem.checkId,
-                       deptId: empItem.deptId,
-                       startDate: (planStartTimestamp > -1 && startDiffTimestamp > -1)
-                         ? this.getDateStr(planStartTimestamp, planEndTimestamp, startDiffTimestamp, planItem.endDate)
-                         : '',
-                       endDate: (planStartTimestamp > -1 && endDifTimestamp > -1)
-                         ? this.getDateStr(planStartTimestamp, planEndTimestamp, endDifTimestamp, planItem.endDate)
-                         : ''
-                     });
-                   }
-                })
-               }
-            }))
-            multipleEmpList = [...baseEmpList, ...multipleEmpList];
-            // console.log('批量',multipleEmpList )
-            this.batchDistribute(multipleEmpList);
-          })
-        }else { // 单个分配
-          this.batchDistribute(baseEmpList);
-        }
-      },
-      /**
-       * 获取时间字符串
-       * @param {Number} startTimestamp 计划开始时间戳
-			 * @param {Number} endTimestamp 计划结束时间戳
-			 * @param {Number} diffTimestamp 第一次计划中的时间差
-			 * @param {String} endDateStr 计划结束时间字符串
-       */
-      getDateStr(startTimestamp, endTimestamp, diffTimestamp, endDateStr) {
-        if((startTimestamp + diffTimestamp) > endTimestamp){ // 超出计划结束时间, 则取计划结束时间
-          return endDateStr;
-        }else {
-          return moment(startTimestamp + diffTimestamp).format('YYYY-MM-DD HH:mm');
-        }
-      },
-      // 分配单位查核人员
-      batchDistribute(empList) {
-        if(empList.length === 0) { // 未作修改直接跳转页面
-          return this.redirectToPlanList();
-        }
-        this.$store.dispatch({
-          type: 'editCheckList/commActions',
-          key: "batchDistribute",
-          data: { empList }
-        }).then(data => {
-          if(data){
-            this.redirectToPlanList();
-          }
-        });
-      },
-      // 跳转页面
-      redirectToPlanList() {
-        uni.redirectTo({
-          url: `/pages/planList/planList?situationId=${this.situationId}&checkGroupId=${this.checkGroupId}`
-        });
-      },
-      // 日期时间转换为时间戳
-      dateToTimestamp(dataStr) {
-        return dataStr ? moment(dataStr).valueOf() : -1
-      },
-      checkEdit(data, index, title) {
-        if(data.completeState){ // 计划已开始, 不能编辑查核人和计划时间
-          uni.showModal({
-            content: '因查核计划已开始,故不可修改',
-            showCancel: false
-          });
-        }else {// 跳转编辑页面
-          const { empId, empName, startDate, endDate } = data;
-          let details = {
-            index, // 修改的下标
-            title, // 标题
-            empId,
-            empName,
-            startDate,
-            endDate,
-            situationId: this.situationId, //  情境id (批量修改有,不然为0)
-            checkId: this.checkId, // 查核id
-            checkGroupId: this.checkGroupId, //查核组id
-            planStartDate: this.startDate, // 计划开始时间
-            planEndDate: this.endDate // 计划结束时间
-          }
-          uni.navigateTo({
-			  	  url: `/pages/allocationPerson/allocationPerson?details=${encodeURIComponent(JSON.stringify(details))}`
-			  	});
-        }
-      },
-      // 获取查核列表
-      getCheckList(checkId) {
-        this.$store.dispatch({
-          type: 'editCheckList/commActions',
-          key: "getCheckList",
-          data: { checkId }
-        }).then(data => {
-          this.$store.dispatch({
-            type: "commActions",
-            key: "getDateStr",
-          }).then((dateStr) => {
-            if (dateStr) {
-              this.$store.commit({
-                type: 'editCheckList/comChangeState',
-                key: 'checkList',
-                data: (data || []).map(item => {
-                  if (item.startDate && moment(item.startDate).valueOf() < moment(dateStr).valueOf()) {
-                    return {
-                      ...item,
-                      completeState: true // true:说明计划已开始, 不能编辑查核人和计划时间
-                    }
-                  }else {
-                    return item
-                  }
-                })
-              });
-            }
-          });
-        });
-      },
-      // 获取计划列表
-      getPlanList() {
-        this.$store.dispatch({
-		    	type: 'planList/commActions',
-		    	payload: {
-		    		key: 'planList',
-		    		data:{
-		    			situationId: this.situationId
-		    		}
-		    	}
-		    }).then((data) => {
-          this.planList = data || [];
-        })
-      }
-		}
-	}
-</script>
-
-<style lang="less">
-	.check-map-list {
-    height: 100%;
-
-    .scroll-y {
-			height: calc(100% - 87.5rpx);
-      padding-top: 25rpx;
-
-      .footer {
-
-	    	.row {
-	    		display: flex;
-	    		align-items: center;
-	    		justify-content: space-between;
-	    		border-top: 1px solid #DADEE6;
-	    		height: 62.5rpx;
-	    		padding: 0 25rpx;
-	    		font-size: 22.5rpx;
-
-	    		.label {
-	    			color: #525866;
-	    			width: 93.75rpx;
-	    		}
-
-	    		.content {
-	    			display: flex;
-	    			flex-direction: row;
-	    			align-items: center;
-	    			flex: 1;
-	    			height: 100%;
-	    			padding: 0 25rpx;
-
-	    			.base-text {
-	    				flex: 1;
-	    				line-height: 62.5rpx;
-	    				color: #B8BECC;
-              font-weight: normal;
-              margin-bottom: 0;
-	    			}
-
-	    			.center-text {
-	    				padding: 0 25rpx;
-	    				color: #292C33;
-	    			}
-
-	    			.black-color {
-	    				color: #292C33;
-	    			}
-	    		}
-
-	    		.arrow {
-	    			width: 12.5rpx;
-	    			height: 21.25rpx;
-	    		}
-	    	}
-	    }
-    }
-
-		.null {
-			margin-top: 375rpx;
-			text-align: center;
-      color: #999;
-		}
-	}
+			init(situationId,
+			checkId,
+			checkGroupId,
+			startDate,
+			endDate,
+			multiple){
+				this.getCheckList(checkId);
+				this.checkGroupId = checkGroupId ? +checkGroupId : 0;
+				this.situationId = situationId ? +situationId : 0;
+				this.checkId = checkId ? +checkId : 0;
+				this.startDate = startDate;
+				this.endDate = endDate;
+				this.multiple = multiple;
+				this.checkedList = [];
+			},
+			ifStartCheck(timeStr){
+				if(timeStr){
+					 const currentTime = new Date().getTime();
+					 const startTime = Date.parse(timeStr.replace(/-/g,'/'));
+	
+					 if(currentTime<startTime){
+						 this.ifshowBottom = true;
+					 }
+					 return currentTime<startTime;
+				}
+				this.ifshowBottom = true;
+				return true;
+				
+			},
+			bottomBtnClickHandle(key){
+				// const {
+				// 	empId,
+				// 	empName,
+				// 	startDate,
+				// 	endDate
+				// } = data;
+				let details = {
+					index:'', // 修改的下标
+					title:'', // 标题
+					empId:'',
+					empName:'',
+					startDate:'',
+					endDate:'',
+					checkedList:this.checkedList,
+					situationId: this.situationId, //  情境id (批量修改有,不然为0)
+					checkId: this.checkId, // 查核id
+					checkGroupId: this.checkGroupId, //查核组id
+					planStartDate: this.startDate, // 计划开始时间
+					planEndDate: this.endDate // 计划结束时间
+				}
+				
+				if(key=='left'){
+					// console.log({key});
+					const tempArr = this.checkList.filter(item=>this.ifStartCheck(item.startDate));
+					this.checkedList = tempArr.map(v=>v.deptId);
+		
+					let _details = {...details,checkedList:this.checkedList}
+	                setTimeout(()=>{
+						 uni.navigateTo({
+							 url: `/pages/batchDistribution/batchDistribution?details=${encodeURIComponent(JSON.stringify(_details))}`
+						 });
+	                },1000)
+				}
+				if(key=='right'){
+					if(this.checkedList.length>0){
+						 uni.navigateTo({
+						     url: `/pages/batchDistribution/batchDistribution?details=${encodeURIComponent(JSON.stringify(details))}`
+						 });
+					}else {
+						 uni.showModal({
+						   title: '提示',
+						   content: '请先选择分配项!',
+						   showCancel: false
+						 });
+					}
+				}
+			},
+			checkedHandle(deptId){
+				 // console.log({checkId});
+				 let temp = JSON.parse(JSON.stringify(this.checkedList)); //去除_observer_
+				 if(temp.includes(deptId)){
+					   temp.splice(temp.findIndex(v => v === deptId),1);
+					   this.checkedList = temp;
+				 }else {
+					   this.checkedList = this.checkedList.concat([deptId]);
+				 }	
+			},
+			// 完成
+			submit() {
+				// baseEmpList: 第一次计划修改的数据; changePlanList: 批量分配,记录第一次计划修改数据的信息;  multipleEmpList: 批量修改的数据
+				let baseEmpList = [],
+					changePlanList = [],
+					multipleEmpList = [];
+				// planStartTimestamp: 开始计划时间戳;
+				let planStartTimestamp = this.dateToTimestamp(this.startDate);
+				this.checkList.map((item, i) => {
+					const {
+						checkId,
+						deptId,
+						empId,
+						empName,
+						startDate,
+						endDate
+					} = item;
+					if (empId && startDate && endDate) {
+						baseEmpList.push({
+							checkId,
+							deptId,
+							empId,
+							empName,
+							startDate: startDate || '',
+							endDate: endDate || ''
+						});
+						if (this.multiple === 'true') { // 批量分配
+							changePlanList.push({
+								index: i, // 第一次计划修改的下标
+								baseEmpListIndex: baseEmpList.length - 1,
+								startDiffTimestamp: (startDate && planStartTimestamp != -1) ? this
+									.dateToTimestamp(startDate) - planStartTimestamp : -1, // 开始时间差
+								endDifTimestamp: (endDate && planStartTimestamp != -1) ? this
+									.dateToTimestamp(endDate) - planStartTimestamp : -1 // 结束时间差
+							});
+						}
+					}
+				});
+				if (this.multiple === 'true') { // 批量分配
+					this.$store.dispatch({
+						type: 'planList/commActions',
+						payload: {
+							key: 'planList',
+							data: {
+								situationId: this.situationId
+							}
+						}
+					}).then((planList) => {
+						(planList || []).map(((planItem, planI) => {
+							if (planI != 0) { // 过滤掉第一条
+								// 计划开始时间戳
+								let planStartTimestamp = planItem.startDate ? this.dateToTimestamp(
+									planItem.startDate + ' 00:00') : -1;
+								// 计划结束时间戳
+								let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem
+									.endDate + ' 23:59') : -1;
+
+								planItem.empList && planItem.empList.map((empItem, empI) => {
+									// 当前分配明细
+									let currentEmp = changePlanList.find(item => item.index ===
+										empI);
+									if (currentEmp) {
+										const {
+											baseEmpListIndex,
+											startDiffTimestamp,
+											endDifTimestamp
+										} = currentEmp;
+										const {
+											empId,
+											empName
+										} = baseEmpList[baseEmpListIndex] || {};
+										multipleEmpList.push({
+											empId,
+											empName,
+											checkId: empItem.checkId,
+											deptId: empItem.deptId,
+											startDate: (planStartTimestamp > -1 &&
+													startDiffTimestamp > -1) ?
+												this.getDateStr(planStartTimestamp,
+													planEndTimestamp,
+													startDiffTimestamp, planItem
+													.endDate) :
+												'',
+											endDate: (planStartTimestamp > -1 &&
+													endDifTimestamp > -1) ?
+												this.getDateStr(planStartTimestamp,
+													planEndTimestamp, endDifTimestamp,
+													planItem.endDate) :
+												''
+										});
+									}
+								})
+							}
+						}))
+						multipleEmpList = [...baseEmpList, ...multipleEmpList];
+						// console.log('批量',multipleEmpList )
+						this.batchDistribute(multipleEmpList);
+					})
+				} else { // 单个分配
+					this.batchDistribute(baseEmpList);
+				}
+			},
+			/**
+			 * 获取时间字符串
+			 * @param {Number} startTimestamp 计划开始时间戳
+			 * @param {Number} endTimestamp 计划结束时间戳
+			 * @param {Number} diffTimestamp 第一次计划中的时间差
+			 * @param {String} endDateStr 计划结束时间字符串
+			 */
+			getDateStr(startTimestamp, endTimestamp, diffTimestamp, endDateStr) {
+				if ((startTimestamp + diffTimestamp) > endTimestamp) { // 超出计划结束时间, 则取计划结束时间
+					return endDateStr;
+				} else {
+					return moment(startTimestamp + diffTimestamp).format('YYYY-MM-DD HH:mm');
+				}
+			},
+			// 分配单位查核人员
+			batchDistribute(empList) {
+				if (empList.length === 0) { // 未作修改直接跳转页面
+					return this.redirectToPlanList();
+				}
+				this.$store.dispatch({
+					type: 'editCheckList/commActions',
+					key: "batchDistribute",
+					data: {
+						empList
+					}
+				}).then(data => {
+					if (data) {
+						this.redirectToPlanList();
+					}
+				});
+			},
+			// 跳转页面
+			redirectToPlanList() {
+				uni.redirectTo({
+					url: `/pages/planList/planList?situationId=${this.situationId}&checkGroupId=${this.checkGroupId}`
+				});
+			},
+			// 日期时间转换为时间戳
+			dateToTimestamp(dataStr) {
+				return dataStr ? moment(dataStr).valueOf() : -1
+			},
+			checkEdit(data, index, title) {
+				console.log({data});
+				if (data.completeState) { // 计划已开始, 不能编辑查核人和计划时间
+					uni.showModal({
+						content: '因查核计划已开始,故不可修改',
+						showCancel: false
+					});
+				} else { // 跳转编辑页面
+					const {
+						empId,
+						empName,
+						startDate,
+						endDate,
+						deptId
+					} = data;
+					let details = {
+						index, // 修改的下标
+						title, // 标题
+						empId,
+						empName,
+						startDate,
+						endDate,
+						situationId: this.situationId, //  情境id (批量修改有,不然为0)
+						checkId: this.checkId, // 查核id
+						checkGroupId: this.checkGroupId, //查核组id
+						planStartDate: this.startDate, // 计划开始时间
+						planEndDate: this.endDate // 计划结束时间
+					}
+					
+					const _detailsTwo = {
+						...details,
+						checkedList:[deptId]
+					}
+					if(this.multiple=='true'){
+						  uni.navigateTo({
+						  		url: `/pages/allocationPerson/allocationPerson?details=${encodeURIComponent(JSON.stringify(details))}`
+						  });
+					}
+					if(this.multiple=='false'){
+						    const _detailsTwo = {
+						  		...details,
+						  		checkedList:[deptId]
+						  	}
+						  	uni.navigateTo({
+						  	    url: `/pages/batchDistribution/batchDistribution?details=${encodeURIComponent(JSON.stringify(_detailsTwo))}`
+						  	});
+					}
+					
+					
+				}
+			},
+			// 获取查核列表
+			getCheckList(checkId) {
+				this.$store.dispatch({
+					type: 'editCheckList/commActions',
+					key: "getCheckList",
+					data: {
+						checkId
+					}
+				}).then(data => {
+					this.$store.dispatch({
+						type: "commActions",
+						key: "getDateStr",
+					}).then((dateStr) => {
+						if (dateStr) {
+							this.$store.commit({
+								type: 'editCheckList/comChangeState',
+								key: 'checkList',
+								data: (data || []).map(item => {
+									if (item.startDate && moment(item.startDate)
+									.valueOf() < moment(dateStr).valueOf()) {
+										return {
+											...item,
+											completeState: true // true:说明计划已开始, 不能编辑查核人和计划时间
+										}
+									} else {
+										return item
+									}
+								})
+							});
+						}
+					});
+				});
+			},
+			// 获取计划列表
+			getPlanList() {
+				this.$store.dispatch({
+					type: 'planList/commActions',
+					payload: {
+						key: 'planList',
+						data: {
+							situationId: this.situationId
+						}
+					}
+				}).then((data) => {
+					this.planList = data || [];
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.check-map-list {
+		height: 100%;
+     
+		.scroll-y {
+			height: calc(100% - 87.5rpx);
+			padding-top: 25rpx;
+			.item {
+				position:relative;
+			}
+            .checkPoint {
+					position:absolute;
+					top:30rpx;
+					right: 25rpx;
+					width: 25rpx;
+					height: 25rpx;
+					border-radius: 50%;
+					border:2.5rpx solid #C3CAD9;
+					.innerImg {
+						width: 100%;
+						height: 100%;
+					}
+					&.checked {
+						border: none;
+					}
+			} 
+			.footer {
+
+				.row {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					border-top: 1px solid #DADEE6;
+					height: 62.5rpx;
+					padding: 0 25rpx;
+					font-size: 22.5rpx;
+
+					.label {
+						color: #525866;
+						width: 93.75rpx;
+					}
+
+					.content {
+						display: flex;
+						flex-direction: row;
+						align-items: center;
+						flex: 1;
+						height: 100%;
+						padding: 0 25rpx;
+
+						.base-text {
+							flex: 1;
+							line-height: 62.5rpx;
+							color: #B8BECC;
+							font-weight: normal;
+							margin-bottom: 0;
+						}
+
+						.center-text {
+							padding: 0 25rpx;
+							color: #292C33;
+						}
+
+						.black-color {
+							color: #292C33;
+						}
+					}
+
+					.arrow {
+						width: 12.5rpx;
+						height: 21.25rpx;
+					}
+				}
+			}
+		}
+        .bottomBtnGroup {
+			position: fixed;
+			width: 100%;
+			height: 87.5rpx;
+			bottom: 0;
+			left: 0;
+			display: flex;
+			flex-direction: row;
+			background-color: #FFFFFF;
+			.leftBtn,.rightBtn {
+				display: flex;
+				width: 50%;
+				height: 100%;
+				justify-content:center;
+				align-items: center;
+				font-size: 22.5rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #3377FF;
+				
+			}
+			.rightBtn {
+				color: #FFFFFF;
+				background-color:#3377FF;
+			}
+		}
+		.null {
+			margin-top: 375rpx;
+			text-align: center;
+			color: #999;
+		}
+	}
 </style>

+ 2 - 2
pages/home/home.vue

@@ -99,7 +99,7 @@
 			return {
 				ifshowVersionInfo:false,
 				showJournal: false,
-				version: '0.6.1',
+				version: '0.6.3',
 				versionData: {
 					versionNo: '',
 					versionId: '',
@@ -239,7 +239,7 @@
 						uni.removeStorageSync('permissions');
 						uni.removeStorageSync('token');
 						uni.removeStorageSync('code');
-						uni.removeStorageSync('nowPermission');
+						// uni.removeStorageSync('nowPermission');
 						uni.removeStorageSync('id');
 						uni.removeStorageSync('name');
 						// uni.setStorageSync('hospSign', this.hospSign);

+ 13 - 16
pages/login/login.vue

@@ -60,22 +60,16 @@
 			
 		},
 		mounted(){
-			  // uni.getSystemInfo({
-				 //  success: function (res) {
-					// 	  // console.log('res.model',res.model);
-					// 	  // console.log('res.pixelRatio',res.pixelRatio);
-					// 	  // console.log('res.windowWidth',res.windowWidth);
-					// 	  // console.log('res.windowHeight',res.windowHeight);
-					// 	  // console.log('res.language',res.language);
-					// 	  // console.log('res.version',res.version);
-					// 	  // console.log('res.platform',res.platform);
-					// 	 //  uni.showModal({
-					// 		// title: '测试',
-					// 		// content:res.windowWidth,
-					// 		// showCancel: true
-					// 	 //  });
-				 //  }
-			  // });
+              // console.log('login mounted');
+			  // try {
+			  //     const value = uni.getStorageSync('hospSign');
+			  //     if (value) {
+			          
+			  //     }
+			  // } catch (e) {
+			  //     // error
+			  // }
+			  
 		},
 		methods: {
 			setHospSign(e){
@@ -96,6 +90,8 @@
 			},
 			login() {
 				if(this.isLogin) return
+				const nowPermission = uni.getStorageSync('nowPermission');
+				console.log({nowPermission});
 				this.$store.dispatch({
 					type: 'login/commActions',
 					payload: {
@@ -109,6 +105,7 @@
 							// #ifdef H5
 							hospSign: this.hospSign,
 							// #endif
+							nowPermission:nowPermission
 							// hospSign:'tYAoFaa20yCAgaiy'
 						}
 					}

+ 10 - 10
pages/mainPointsDetail/mainPointsDetail.vue

@@ -164,6 +164,7 @@
 </template>
 
 <script>
+import {_goBackFresh} from '../../utils/compatible.js';
 export default {
   data() {
     return {
@@ -193,7 +194,7 @@ export default {
   mounted() {
     this.checkTaskDetail(this.id);
     this.getPeizhiList();
-	// this.$refs.pop.open();
+	
   },
   methods: {
 	clickModalhandle(){
@@ -428,9 +429,13 @@ export default {
 					});
                 }
               }
-			  uni.navigateTo({
-			    url: `/pages/auditItemDetails/auditItemDetails?id=${this.data.id}&checkPointId=${this.checkPointId}`,
-			  });
+			  //返回
+			  _goBackFresh('pages/checkMainPoints/checkMainPoints');
+			  
+			  //去查核详情页
+			  // uni.navigateTo({
+			  //   url: `/pages/auditItemDetails/auditItemDetails?id=${this.data.id}&checkPointId=${this.checkPointId}`,
+			  // });
             }
           });
       } else {
@@ -484,12 +489,7 @@ export default {
 		 }
 	},
 	goToPrevPage(){
-		// window.history.back();
-		// const pages = getCurrentPages();
-		// console.log({pages});
-		uni.navigateBack({
-		    delta: 1
-		});
+		_goBackFresh('pages/checkMainPoints/checkMainPoints');
 	},
 	switchItem(num){
 		let current = this.itemBelongGroup.filter(item=>{

+ 5 - 1
pages/model.js

@@ -16,6 +16,8 @@ import editCheckList from './editCheckList/model.js';
 import allocationPerson from './allocationPerson/model.js';
 import suggestionsFeedback from './suggestionsFeedback/model.js';
 import resetInfo from './resetInfo/model.js';
+import batchDistribution from './batchDistribution/model.js';
+import checkMainPoints from './checkMainPoints/model.js';
 
 
 export default module = {
@@ -39,5 +41,7 @@ export default module = {
   editCheckList,
   allocationPerson,
   suggestionsFeedback,
-  resetInfo
+  resetInfo,
+  batchDistribution,
+  checkMainPoints
 }

+ 1 - 1
pages/planList/planList.vue

@@ -33,7 +33,7 @@
 				situationID:'',//情境id
 				planList:[],//计划列表
 				firstFlag:1,//是否为第一次分配的标志,为1时表示是第一次,弹框提示
-				isShowDistribution: false,//是否显示批量分配按钮
+				isShowDistribution: true,//是否显示批量分配按钮
         listHeight:1125,//列表高度
         checkGroupId: 0, // 查核组id
 				showModal: false

+ 1 - 0
pages/situationDetail/situationDetail.vue

@@ -183,6 +183,7 @@
 				}
 			},
 			compareTime(time){
+				if(!time)return false;
 				let myDate=dateHandle.todayDate().replace(/-/g,"/");
 				let firstCheckTime=time.replace(/-/g,"/");
 				firstCheckTime=Date.parse(firstCheckTime);

+ 4 - 12
pages/situationsCenter/situationsCenter.vue

@@ -136,16 +136,8 @@ export default {
     clearInterval(this.refTimer);
     clearTimeout(this.timer);
   },
-  // watch:{
-  // 	  "$route":{
-  // 		  handler(route){
-  // 			  this.messStatus();
-  // 		  }
-  // 	  }
-  // },
   mounted() {
-	      // console.log(this.$refs);
-       //    this.$refs.app_update.update();  //调用子组件 检查更新
+
   },
   methods: {
     openSearchBar() {
@@ -185,7 +177,7 @@ export default {
     searchByKeywords(event) {
       let data = {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 15,
         keyword: event.target.value,
       };
       this.getSituationList(data, (data) => {
@@ -217,7 +209,7 @@ export default {
         this.page++;
         let data = {
           pageNum: this.page,
-          pageSize: 10,
+          pageSize: 15,
         };
         this.getSituationList(data, (data) => {
           this.createSituationList(data.list);
@@ -268,7 +260,7 @@ export default {
     initSituationList() {
       let data = {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 15,
       };
       this.getSituationList(data, (data) => {
         this.totalCount = data.totalCount;

BIN
static/gou_white.png


+ 27 - 0
utils/compatible.js

@@ -13,3 +13,30 @@ export const _stopPropagation = (e) => {
 		e.stopPropagation();
 	}
 }
+
+/* 
+   在需要回退刷新的页面配置ifFromChildPage
+ */
+export const _goBackFresh = (pathName)=>{
+	const pages = getCurrentPages();
+	const reversed = pages.reverse();
+	const currentPageIndex = 0;
+	// console.log({reversed});
+
+	if(true){
+		pages.some((item,index)=>{
+			  // console.log('循环');
+			  if(item.route == pathName){
+				  let needdelta =index-currentPageIndex;
+				  // console.log({needdelta,index,currentPageIndex});
+				  //通知返回目标页面刷新数据
+				  item.ifFromChildPage=true;
+				  uni.navigateBack({
+				      delta: needdelta
+				  });
+				  return true;
+			  }
+		});
+	}
+
+}

+ 14 - 5
utils/request.js

@@ -26,7 +26,7 @@ function creatRequest(obj, data) {
       url = data ? `${url}?${stringify(data)}` : url;
       data = null;
     }
-	console.log({data});
+	console.log({data,url});
     return request(url, { method: obj.method, data }, additional);
   } else {
     uni.showModal({
@@ -91,10 +91,19 @@ function openCloseLoading(additional, isOpen) {
 }
 
 // 登录过期,重置请求计数,强制关闭loading
-function LoginExpired() {
+function LoginExpired(msg) {
   AllRequestNum = 0;
-  uni.navigateTo({
-    url: '/pages/login/login'
+  uni.showModal({
+    title: '提示',
+    content:msg,
+	showCancel:false,
+    success: function (_res) {
+      if (_res.confirm) {
+          uni.navigateTo({
+            url: '/pages/login/login'
+          });
+      }
+    }
   });
 }
 
@@ -113,7 +122,7 @@ function notifyException(resArr, additional) {
     const { code, msg } = res.data;
 	console.log('res.data',res.data);
     if (code === '410' || code === '401') {
-      LoginExpired();
+      LoginExpired(msg);
     } else if (code === '403') {
       uni.showModal({
         title: '提示',

+ 2 - 2
utils/requestUrl.js

@@ -7,11 +7,11 @@
  * @FilePath: /web_TracerMethodology/utils/requestUrl.js
  */
 // const base = '192.168.51.80:8801/imed/pfm/';
-// export const URL = '192.168.51.80:8801/imed/pfm/'; // 本地
+export const URL = '192.168.51.80:8801/imed/pfm/'; // 本地
 // export const URL = '192.168.38.174:8088/imed/pfm/';
 // export const URL = '192.168.1.45:8088/imed/pfm/'; //内网
 // export const URL = 's1.nsloop.com:5137/imed/pfm/';  // 外网
-export const URL = '121.43.139.179:8801/imed/pfm/';  // 云端服务1
+// export const URL = '121.43.139.179:8801/imed/pfm/';  // 云端服务1
 // export const URL = '172.18.116.20:8801/imed/pfm/';  // 云端服务2
 
 // export const URL = '172.18.116.20:9002/imed/pfm/';  // 云端服务2

+ 2 - 2
utils/ws.js

@@ -62,12 +62,12 @@ const websocket = {
       this.ws.onMessage((res) => {
         if (res.data === 'ping') {
           heartCheck.start(this.ws); //获取到消息,心跳检测重置
-          console.log("ws 没有收到消息");
+          // console.log("ws 没有收到消息");
           this.reconnetCount && (this.reconnetCount = 0);
         } else {
           // const { type, data } = JSON.parse(res.data);
           const { data } = res;
-          console.log("ws 收到消息啦:" + data);
+          // console.log("ws 收到消息啦:" + data);
           if (callback) {
             callback(data);
           } else if (websocket.callback) {