Browse Source

bug修改

lvxinghai 4 years ago
parent
commit
41e4520fc1

+ 1 - 1
components/tm-tabbar/tm-tabbar.vue

@@ -68,7 +68,7 @@
 					{permission: 1, name: '管理员', tabBarIndexs: [0, 1, 2, 3]}, // tabBarIndexs:tabBarList种对应的下标
 					{permission: 2, name: '查核组长', tabBarIndexs: [0, 4, 3]},
 					{permission: 3, name: '查核组员', tabBarIndexs: [0, 4, 3]},
-					{permission: 4, name: '单位负责人', tabBarIndexs: [0, 1, 3]},
+					{permission: 4, name: '单位负责人', tabBarIndexs: [1, 3]},
 					{permission: 5, name: '改善者', tabBarIndexs: [1, 3]}
         ],
         rolToTabBars: [],

+ 1 - 1
pages/auditItemDetails/auditItemDetails.vue

@@ -40,7 +40,7 @@
 			</view>
 			<view class="box-item">
 				<view>查核时间</view>
-				<view>{{item.completeTimeStr}}</view>
+				<view>{{detail.completeTimeStr}}</view>
 			</view>
 			<view class="box-item">
 				<view>图片展示</view>

+ 4 - 4
pages/checkMainPoints/checkMainPoints.vue

@@ -9,14 +9,14 @@
 					<image src="../../static/search.png"></image>
 				</view>
 				<view class="top-btn-wrap">
-					<view class="btn-list" v-if="permissions.includes(3)">
+					<view class="btn-list" v-if="nowPermission == 3">
 						<com-button v-for="(item, index) in btnArr" 
 							:btnText="item.label" 
 							:type="active === item.id ? 'pramary':'default'" 
 							v-on:btnClick="btnClick(item.id)"/>
 					</view>
 					<view class="select-wrap" 
-						v-else-if="permissions.includes(2) || permissions.includes(1)" 
+						v-else-if="nowPermission == 2 || nowPermission == 1" 
 						@click="toggleModal(!showModal)">
 						<text>{{getCheckPointName}}</text>
 						<image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
@@ -88,7 +88,7 @@
 				copyDetailList: [],
 				point: [{checkPointId: 'all', checkPointName: '全部要点'}],
 				checkPointId: 'all',
-				permissions: uni.getStorageSync('permissions'),
+				nowPermission: uni.getStorageSync('nowPermission'),
 				active: 0
 			};
 		},
@@ -116,7 +116,7 @@
 			},
 			childClick(child) {
 				// 查核者,管理员
-				if(this.permissions.includes(1) || this.permissions.includes(3)) { 
+				if(this.nowPermission == 1 || this.nowPermission == 3) { 
 					let str = '';
 					if(child.checkResult) {
 						// 跳转到查核项详情

+ 7 - 4
pages/creatingSituations/components/checkMapDetail.vue

@@ -122,9 +122,11 @@
 			.content {
 				width: 100%;
 				color: #292C33;
-				line-height: 87.5rpx;
 				.content-title {
-					height: 87.5rpx;
+					display: flex;
+					flex-direction: row;
+					align-items: center;
+					min-height: 87.5rpx;
 					font-size: 22.5rpx;
 					font-weight: 500;
 				}
@@ -134,15 +136,16 @@
 						display: flex;
 						flex-direction: row;
 						justify-content: space-between;
+						align-items: center;
 						border-top: 1px solid #DADEE6;
-						height: 87.5rpx;
+						min-height: 87.5rpx;
 						.check-icon-wrap {
 							display: flex;
 							flex-direction: row;
 							justify-content: center;
 							align-items: center;
 							width: 75rpx;
-							height: 100%;
+							height: 87.5rpx;
 							image {
 								width: 25rpx;
 								height: 25rpx;

+ 0 - 1
pages/creatingSituations/creatingSituations.vue

@@ -157,7 +157,6 @@
 						}
 					})
 				}).then((data)=>{
-					console.log(data);
 					if(data) {
 						uni.navigateTo({
 							url: '/pages/situationsCenter/situationsCenter'

+ 1 - 1
pages/editCheckList/model.js

@@ -4,7 +4,7 @@ export default {
   namespaced: true,
   state: {
      // 查核列表
-     checkList: []
+     checkList: [],
   },
   mutations: {
 		comChangeState(state, {key, data}) {

+ 43 - 27
pages/planList/components/modal.vue

@@ -1,10 +1,15 @@
 <template>
-	<view class="modal-page" v-show="showModal">
+	<view class="modal-page">
 		<view class="modal-box">
 			<image class="pic" src="../../../static/hint.png"></image>
 			<text class="text">您的分配工作量较大,建议使用批量分配功能</text>
-			<view class="btn" @click="hide">
-				<text class="btn-text">确定</text>
+			<view class="btn-wrap">
+				<view class="btn" @click="isBatchHandle(false)">
+					<text class="btn-text">取消</text>
+				</view>
+				<view class="btn" @click="isBatchHandle(true)">
+					<text class="btn-text">确定</text>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -15,15 +20,11 @@
 	export default {
 		data() {
 			return {
-				showModal:false,//是否显示弹框
 			}
 		},
 		methods: {
-			show(){
-				this.showModal=true;
-			},
-			hide(){
-				this.showModal=false;
+			isBatchHandle(flage) {
+				this.$emit('callback', flage);
 			}
 		},
 	}
@@ -31,21 +32,23 @@
 
 <style lang="less">
 	.modal-page{
-		height: 100%;
-		width: 100%;
+		display: flex;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
 		position: fixed;
 		top: 0rpx;
 		left: 0rpx;
+		height: 100%;
+		width: 100%;
 		background: rgba(0,0,0,0.5);
 		.modal-box{
-			height: 317.5rpx;
-			width: 562.5rpx;
 			background: #FFFFFF;
       border-radius: 24px;
       overflow: hidden;
-			position: fixed;
-			top: 441.25rpx;
-			left: 93.75rpx;
+			position: relative;
+			height: 317.5rpx;
+			width: 562.5rpx;
 
 			.pic{
 				height: 80rpx;
@@ -63,19 +66,32 @@
 				top: 170rpx;
 				left: 56.25rpx;
 			}
-			.btn{
-				height: 75rpx;
-				width: 562.5rpx;
-				background: #3377FF;
+			.btn-wrap {
+				display: flex;
+				flex-direction: row;
+				justify-content: space-between;
 				position: absolute;
 				bottom: 0rpx;
-				text-align: center;
-				.btn-text{
-					font-size: 22.5rpx;
-					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-					font-weight: 400;
-					color: #FFFFFF;
-					line-height: 75rpx;
+				border-top: 1px solid #DADEE6;
+				width: 100%;
+				.btn{
+					height: 75rpx;
+					width: 50%;
+					background: #3377FF;
+					text-align: center;
+					.btn-text{
+						font-size: 22.5rpx;
+						font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+						font-weight: 400;
+						color: #FFFFFF;
+						line-height: 75rpx;
+					}
+					&:first-child {
+						background-color: #fff;
+						.btn-text {
+							color: #292C33;
+						}
+					}
 				}
 			}
 		}

+ 1 - 2
pages/planList/model.js

@@ -2,8 +2,7 @@ import { commServer } from './server.js';
 
 export default {
   namespaced: true,
-  state: {
-  },
+  state: {},
   mutations: {},
   actions: {
 		commActions({ commit, state }, { payload }) {

+ 13 - 8
pages/planList/planList.vue

@@ -12,7 +12,7 @@
 					</view>
 				</view>
 				<view class="row2">
-					<text class="TobeDistributed">剩余1个单位待分配</text>
+					<text class="TobeDistributed">剩余{{item.toDistribute}}个单位待分配</text>
 					<text class="startEndTime">起止时间:{{item.startDate}} ~ {{item.endDate}}</text>
 				</view>
 			</view>
@@ -20,7 +20,7 @@
 		<view class="btn-distribution" @click="gotoCheckList(true, planList[0])" v-if="isShowDistribution">
 			<text class="btn-text">批量分配</text>
 		</view>
-		<modal ref="modal" ></modal>
+		<modal v-if="showModal" v-on:callback="callback"></modal>
 	</view>
 </template>
 
@@ -33,9 +33,10 @@
 				situationID:'',//情境id
 				planList:[],//计划列表
 				firstFlag:1,//是否为第一次分配的标志,为1时表示是第一次,弹框提示
-				isShowDistribution:false,//是否显示批量分配按钮
+				isShowDistribution: false,//是否显示批量分配按钮
         listHeight:1125,//列表高度
-        checkGroupId: 0 // 查核组id
+        checkGroupId: 0, // 查核组id
+				showModal: false
 			}
 		},
 		onLoad({ situationId, checkGroupId }){ // situationId:情景id checkGroupId: 查核组id
@@ -69,14 +70,19 @@
 							toDistribute:item.toDistribute,
 						}
 					});
-					console.log(this.firstFlag,'1111111')
 					if(this.firstFlag==1){
-						this.$refs.modal.show();
+						this.showModal = true;
 					}
 				}
 			});
 		},
 		methods: {
+			callback(flage) {
+				this.showModal = false;
+				if(flage && this.planList.length > 0) {
+					this.gotoCheckList(true, this.planList[0]);
+				}
+			}, 
 			compareTime(planList){
 				this.$store.dispatch({
 				  type: "commActions",
@@ -85,8 +91,7 @@
 				  if (dateStr) {
 						if(planList.some((item)=>moment(item.startDate).valueOf()<moment(dateStr).valueOf())){
 							 this.listHeight=1200;
-						}
-						else{
+						} else {
 							this.isShowDistribution=true;
 						}
 				  }

+ 22 - 16
pages/role-switching/role-switching.vue

@@ -24,7 +24,7 @@
 			return {
 				permissionList:[],//权限列表
 				nowPermission:'',//当前权限
-				selectedPermission:'',//当前选中的权限
+				oldPermission:'',//初始化选中的权限
 				roleList:[
 					{permission: 1, name: '管理员'}, 
 					{permission: 2, name: '查核组长'},
@@ -47,6 +47,8 @@
 					isChecked:this.nowPermission==match.permission?true:false,
 				}
 			});
+			let obj = this.permissionList.find((item)=>item.isChecked);
+			this.oldPermission = obj ? obj.value : '';
 		},
 		methods: {
 			toggleSelect(item,index) {
@@ -54,24 +56,28 @@
 					item.isChecked=false;
 				});
 				this.permissionList[item.value-1].isChecked=true;
-				this.selectedPermission=item.value;
 			},
 			saveChange(){
-				this.$store.dispatch({
-					type: 'roleSwitching/commActions',
-					payload: {
-						key: 'updatePermission',
-						data: {
-							permission: this.selectedPermission,
+				let obj = this.permissionList.find((item)=>item.isChecked);
+				if(obj) {
+					if(obj.value === this.oldPermission) {
+						uni.navigateTo({url: '/pages/home/home'});
+						return;
+					};
+					this.$store.dispatch({
+						type: 'roleSwitching/commActions',
+						payload: {
+							key: 'updatePermission',
+							data: {
+								permission: obj.value,
+							}
 						}
-					}
-				}).then((data)=>{
-					if(data){
-						uni.navigateTo({
-							url: '/pages/home/home'
-						});
-					}
-				});
+					}).then((data)=>{
+						if(data){
+							uni.navigateTo({url: '/pages/home/home'});
+						}
+					});
+				}
 			}
 		},
 	}

+ 16 - 12
pages/situationDetail/situationDetail.vue

@@ -130,7 +130,7 @@
 				uni.showModal({
 					title:'提示',
 					content:'请确认是否作废此情境,作废的情境无法被还原',
-					success:function(res){
+					success: (res) => {
 						if(res.confirm){
 							this.$store.dispatch({
 								type: 'situationDetail/commActions',
@@ -142,17 +142,17 @@
 								}
 							}).then((data) => {
 								if (data) {
-									uni.showToast({
-										title:'作废成功',
-										icon:'none',
-										duration:1000
+									uni.showModal({
+										title:'提示',
+										content:'作废成功',
+										showCancel: false,
+										success: (res) => {
+											uni.navigateTo({url: `/pages/situationsCenter/situationsCenter`});
+										}
 									});
 								}
 							});
 						}
-						else if(res.cancel){
-							return;
-						}
 					}
 				})
 
@@ -295,13 +295,17 @@
 					margin-bottom: 31.25rpx;
 				}
 				.time-text{
-					font-size: 20rpx;
-					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
-					font-weight: 400;
-					color: #FFFFFF;
+					overflow: hidden;
 					position: absolute;
 					top: 115rpx;
 					left: 55rpx;
+					width: 70%;
+					white-space: nowrap;
+					font-size: 20rpx;
+					font-weight: 400;
+					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+					text-overflow: ellipsis;
+					color: #FFFFFF;
 				}
 				.nextTime-text{
 					font-size: 20rpx;

+ 60 - 95
pages/situationsCenter/situationsCenter.vue

@@ -1,14 +1,7 @@
 <template>
 	<view class="situationsCenter-page">
 		<view class="calender-remind" @click="toMessagePage">
-		  <image
-		    :src="
-		      messageType
-		        ? '/static/message-unread.png'
-		        : '/static/message-read.png'
-		    "
-		    mode=""
-		  ></image>
+		  <image :src="`/static/message-${messageType? 'unread':'read'}.png`"></image>
 		</view>
 		<view class="situation-list">
 			<view class="search-box">
@@ -46,7 +39,7 @@
 				</view>
 		  </scroll-view>
 		</view>
-		<view class="situaions-add" @click="gotoCreate">
+		<view v-if="nowPermission == 1" class="situaions-add" @click="gotoCreate">
 			<image class="add-pic" src="/static/situation-add.png"></image>
 		</view>
 		<tm-tabbar :permission="nowPermission" />
@@ -116,30 +109,38 @@
 					url: `/pages/situationDetail/situationDetail?situationId=${id}`
 				});
 			},
-			searchByKeywords(event){
-				console.log(event);
+			getSituationList(data, callback) {
 				this.$store.dispatch({
 					type: 'situationsCenter/commActions',
 					payload: {
-						key: 'situationList',
-						data:{
-							pageNum:1,
-							pageSize:10,
-							keyword:event.target.value,
-						}
-					}
-				}).then((data)=>{
-					if (data) {
-						this.situationList=data.list.map((item,index)=>{
-							return{
-								name:item.name,
-								checkStatus:item.checkStatus,
-								nextCheckTime:item.nextCheckTime,
-								checkGroupName:item.checkGroupName,
-								topic:item.topic==0?true:false,
-							}
-						});
+						data,
+						key: 'situationList'
 					}
+				}).then((data)=> {
+					if(data) callback(data);
+				});
+			},
+			searchByKeywords(event){
+				let data = {
+					pageNum:1,
+					pageSize:10,
+					keyword:event.target.value,
+				};
+				this.getSituationList(data,(data)=>{
+					this.situationList = [];
+					this.createSituationList(data.list);
+				});
+			},
+			createSituationList(list=[]) {
+				list.map((item,index)=>{
+					this.situationList.push({
+						name:item.name,
+						checkStatus:item.checkStatus,
+						nextCheckTime:item.nextCheckTime,
+						checkGroupName:item.checkGroupName,
+						topic:item.topic==0?true:false,
+						situationID:item.id,
+					});
 				});
 			},
 			toLower(){
@@ -151,35 +152,18 @@
 				let count=this.situationList.length;
 				if(this.totalCount!=count){
 					this.page++;
-					this.$store.dispatch({
-						type: 'situationsCenter/commActions',
-						payload: {
-							key: 'situationList',
-							data:{
-								pageNum:this.page,
-								pageSize:10
-							}
-						}
-					}).then((data) => {
-						if (data) {
-							this.situationList=data.list.map((item,index)=>{
-								return{
-									name:item.name,
-									checkStatus:item.checkStatus,
-									nextCheckTime:item.nextCheckTime,
-									checkGroupName:item.checkGroupName,
-									topic:item.topic==0?true:false,
-									situationID:item.id,
-								}
-							});
-							let hiId = uni.getStorageSync("hiId");
-							let user = uni.getStorageSync("id");
-							let permission = uni.getStorageSync("nowPermission");
-							this.isInitWs && this.initWebsocket(hiId, user, permission);
-						}
+					let data = {
+						pageNum:this.page,
+						pageSize:10
+					};
+					this.getSituationList(data,(data)=>{
+						this.createSituationList(data.list);
+						let hiId = uni.getStorageSync("hiId");
+						let user = uni.getStorageSync("id");
+						let permission = uni.getStorageSync("nowPermission");
+						this.isInitWs && this.initWebsocket(hiId, user, permission);
 					});
-				}
-				else{
+				} else {
 					uni.showToast({
 						title:'没有更多数据了',
 						icon:'none',
@@ -193,10 +177,9 @@
 			    url: `/pages/messages/messages`,
 			  });
 			},
-			
 			init(isInitWs) {
 			  this.isInitWs = isInitWs;
-			  this.getSituationList();
+			  this.initSituationList();
 			},
 			initWebsocket(hiId, user, permission) {
 			  websocket.url = `ws://192.168.1.45:8088/imed/pfm/websocket/${hiId}/${user}/${permission}`;
@@ -214,34 +197,18 @@
 			      break;
 			  }
 			},
-			getSituationList(){
-				this.$store.dispatch({
-					type: 'situationsCenter/commActions',
-					payload: {
-						key: 'situationList',
-						data:{
-							pageNum:1,
-							pageSize:10
-						}
-					}
-				}).then((data) => {
-					if (data) {
-						this.totalCount=data.totalCount;
-						this.situationList=data.list.map((item,index)=>{
-							return{
-								name:item.name,
-								checkStatus:item.checkStatus,
-								nextCheckTime:item.nextCheckTime,
-								checkGroupName:item.checkGroupName,
-								topic:item.topic==0?true:false,
-								situationID:item.id,
-							}
-						});
-						let hiId = uni.getStorageSync("hiId");
-						let user = uni.getStorageSync("id");
-						let permission = uni.getStorageSync("nowPermission");
-						this.isInitWs && this.initWebsocket(hiId, user, permission);
-					}
+			initSituationList(){
+				let data = {
+					pageNum:1,
+					pageSize:10
+				};
+				this.getSituationList(data, (data)=>{
+					this.totalCount=data.totalCount;
+					this.createSituationList(data.list);
+					let hiId = uni.getStorageSync("hiId");
+					let user = uni.getStorageSync("id");
+					let permission = uni.getStorageSync("nowPermission");
+					this.isInitWs && this.initWebsocket(hiId, user, permission);
 				});
 			},
 			messStatus(){
@@ -294,12 +261,10 @@
 		  }
 		}
 		.situation-list{
-			// display: flex;
-			// flex-flow: row wrap;
-			// margin-top: 12.5rpx;
 			position: relative;
+			height: 100%;
 			.search-box{
-				position: absolute;
+				position: fixed;
 				left: 25rpx;
 				top: 0rpx;
 				z-index: 2;
@@ -369,12 +334,12 @@
 			}
 			
 			.scroll-box{
-				height: 1072.5rpx;
-				width: 750rpx;
-				// margin-top: 25rpx;
+				width: 100%;
+				height: calc(100% - 87.5rpx);
 				.content{
 					display: flex;
 					flex-flow: row wrap;
+					padding-bottom: 25rpx;
 					.situation{
 						height: 187.5rpx;
 						width: 337.5rpx;
@@ -447,7 +412,7 @@
 			
 		}
 		.situaions-add{
-			position: absolute;
+			position: fixed;
 			right: 25rpx;
 			bottom: 130rpx;
 			.add-pic{

+ 4 - 4
utils/request.js

@@ -135,10 +135,10 @@ function notifyException(resArr, additional) {
     return false;
   } else if (additional.successMessage) {
     let msg = additional.successMessage;
-    uni.showModal({
-      title: '提示',
-      content: msg === 'msg' ? res.data.msg : msg,
-      showCancel: false
+    uni.showToast({
+      title: msg === 'msg' ? res.data.msg : msg,
+			icon:'none',
+			duration:1000
     });
   }
   return res.data.data ? res.data.data : true;