Ver código fonte

提前开始计划内查核和计划外查核

“yst 4 anos atrás
pai
commit
9374935195

+ 268 - 0
pages/situationDetail/components/bottom-popup.vue

@@ -0,0 +1,268 @@
+<template>
+	<view class="popup-page" v-show="showModalStatus">
+		<view class="popup-box" v-show="showModalStatus">
+			<view class="item-box" v-for="(item,index) in planList">
+				<view class="radio-item" @click="toggleSelect(item,index)">
+					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
+				</view>
+				<text :class="item.nameClass">{{item.name}}({{item.startDate}} ~ {{item.endDate}})</text>
+				<view class="compeleted-box" v-if="item.isCompeleted">
+					<text class="compeleted-text" >已完成</text>
+				</view>
+				<view class="continued-box" v-if="item.isContinued">
+					<text class="continued-text" >进行中</text>
+				</view>
+				<image class="checked-pic" v-if="item.isContinued" src="../../../static/checkStatus.png"></image>
+			</view>
+		</view>
+		<view class="btn-confirm" @click="saveChange">
+			<text class="btn-text">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props:{
+			situationID:String,
+		},
+		data() {
+			return {
+				currentType:this.type,//当前类型
+				selectedPlanID:'',//选择的计划id
+				showModalStatus:false,//查核计划选择弹框
+				flag:0,//是否为进行中计划,判断下一个未开始的查核计划
+				// isCompeleted:false,//计划进行状态,是否已完成,状态的显示
+				// isContinued:true,//是否进行中
+				planList:[
+					{
+						id:'1',
+						name:'第1次查核',
+						startDate:'2021-02-05',
+						endDate:'2021-02-10',
+						status:3,
+				  },
+					{
+						id:'2',
+						name:'第2次查核',
+						startDate:'2021-02-05',
+						endDate:'2021-02-10',
+						status:2
+					},
+					{
+						id:'3',
+						name:'第3次查核',
+						startDate:'2021-02-05',
+						endDate:'2021-02-10',
+						status:1
+					},
+					{
+						id:'4',
+						name:'第4次查核',
+						startDate:'2021-02-05',
+						endDate:'2021-02-10',
+						status:1
+					},
+				],//查核计划列表
+			}
+		},
+		created: function() {
+			// this.$store.dispatch({
+			// 	type: 'situationDetail/commActions',
+			// 	payload: {
+			// 		key: 'planlList',
+			// 		data:{
+			// 			situationId:this.situationID
+			// 		}
+			// 	}
+			// }).then((data) => {
+			// 	console.log(data);
+			// 	if (data) {
+			// 		this.planList=data.map((item,index)=>{
+			// 			if(item.status==2){
+			// 				this.flag=index;
+			// 			}
+			// 			return {
+			// 				id:item.id,
+			// 				name:item.name,
+			// 				startDate:item.startDate,
+			// 				endDate:item.endDate,
+			// 				status:item.status,
+			// 				isCompeleted:item.status==3?true:false,
+			// 				isContinued:item.status==2?true:false,
+			// 				isChecked:false,
+			// 				nameClass:index==this.flag+1?'item-text':'disable-text',
+			// 			}
+			// 		});
+			// 	}
+			// });
+			this.planList=this.planList.map((item,index)=>{
+				if(item.status==2){
+					this.flag=index;
+				}
+				return {
+					id:item.id,
+					name:item.name,
+					startDate:item.startDate,
+					endDate:item.endDate,
+					status:item.status,
+					isCompeleted:item.status==3?true:false,
+					isContinued:item.status==2?true:false,
+					isChecked:false,
+					nameClass:index==this.flag+1?'item-text':'disable-text',
+				}
+			});
+		},
+		methods: {
+			show(){
+				this.showModalStatus=true;
+			},	
+			hide(){
+				this.showModalStatus=false;
+			},
+			hidePopupBox(){
+				this.hide();
+			},
+			toggleSelect(item,index) {
+				this.planList.map((item,index)=>{
+					item.isChecked=false;
+				});
+				if(index==this.flag+1){
+					this.planList[index].isChecked=true;
+					this.selectedPlanID=item.id;
+				}
+				else{
+					return;
+				}
+				
+			},
+			saveChange(){
+				this.$store.dispatch({
+					type: 'situationDetail/commActions',
+					payload: {
+						key: 'planlAdvance',
+						data:{
+							checkId:this.selectedPlanID
+						}
+					}
+				}).then((data)=>{
+					console.log(data);
+					this.hide();
+				});
+			},
+		},
+	}
+</script>
+
+<style lang="less">
+	.popup-page{
+		height: 100%;
+		width: 100%;
+		position: fixed;
+		top: 0rpx;
+		left: 0rpx;
+		// background: rgba(0,0,0,0.5);
+		background-color: #FFFFFF;
+		.popup-box{
+			width: 100%;
+			position: fixed;
+			top: 0rpx;
+			left: 0rpx;
+			z-index: 2000;
+			background-color: #FFFFFF;
+			display: flex;
+			flex-direction: column;
+			overflow: hidden;
+			.item-box{
+				width: 100%;
+				height: 87.5rpx;
+				border: 0.62rpx solid #DADEE6;
+				.radio-item {
+					float: left;
+					margin-left: 25rpx;
+					margin-top: 30rpx;
+				
+					.icon {
+						width: 25rpx;
+						height: 25rpx;
+					}
+				}
+				.item-text{
+					font-size: 22.5rpx;
+					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+					font-weight: 400;
+					color: #292C33;
+					line-height: 87.5rpx;
+					margin-left: 25rpx;
+					float: left;
+				}
+				.disable-text{
+					font-size: 22.5rpx;
+					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+					font-weight: 400;
+					color: #666E80;
+					line-height: 87.5rpx;
+					margin-left: 25rpx;
+					float: left;
+				}
+				.compeleted-box{
+					width: 75rpx;
+					height: 31.25rpx;
+					border-radius: 8px;
+					background: rgba(41, 204, 150, 0.1);
+					text-align: center;
+					float: left;
+					margin-top: 28.12rpx;
+					.compeleted-text{
+						font-size: 17.5rpx;
+						font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+						font-weight: 500;
+						color: #29CC96;
+						line-height: 31.25rpx;
+					}
+				}
+				.continued-box{
+					width: 75rpx;
+					height: 31.25rpx;
+					border-radius: 8px;
+					background: rgba(255, 204, 102, 0.1);
+					text-align: center;
+					float: left;
+					margin-top: 28.12rpx;
+					.continued-text{
+						width: 75rpx;
+						height: 31.25rpx;
+						font-size: 17.5rpx;
+						font-family: SourceHanSansCN-Medium, SourceHanSansCN;
+						font-weight: 500;
+						color: #FFAA00;
+						line-height: 31.25rpx;
+					}
+				}
+				.checked-pic{
+					width: 19.37rpx;
+					height: 14.37rpx;
+					float: right;
+					margin-top: 36.87rpx;
+					margin-right: 25rpx;
+				}
+			}
+		}
+		.btn-confirm {
+			width: 750rpx;
+			height: 75rpx;
+			background: #3377FF;
+			position: fixed;
+			bottom: 0rpx;
+
+			.btn-text {
+				font-size: 22.5rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #FFFFFF;
+				line-height: 75rpx;
+				margin-left: 352.5rpx;
+			}
+		}
+	}
+</style>

+ 15 - 0
pages/situationDetail/server.js

@@ -11,6 +11,21 @@ const requestList = {
 		method:'DELETE',
 		url: 'situation'
 	},
+	//查核计划列表
+	planlList:{
+		method:'GET',
+		url: 'plan/list'
+	},
+	//提前开始计划内查核
+	planlAdvance:{
+		method:'GET',
+		url: 'plan/advance'
+	},
+	//创建计划外查核
+	createCheck:{
+		method:'GET',
+		url: 'plan/unplannedCheck'
+	},
 };
 export const commServer = ({ key, data }) => {
   let obj = requestList[key];

+ 60 - 12
pages/situationDetail/situationDetail.vue

@@ -45,22 +45,24 @@
 			<view class="btn-center" v-show="isChecker" @click="startUnplanned">
 				<text class="center-text">开始一次计划外查核</text>
 			</view>
-			<view class="btn-left" v-show="isUnplanned">
+			<view class="btn-left" v-show="isUnplanned" @click="createCheck">
 				<text class="left-text">新建一个计划外查核</text>
 			</view>
-			<view class="btn-right" v-show="isUnplanned">
+			<view class="btn-right" v-show="isUnplanned" @click="startCheck">
 				<text class="right-text">提前开始一个计划内查核</text>
 			</view>
 		</view>
+		<popup ref="popup" :situationID="situationID"></popup>
 	</view>
 </template>
 
 <script>
+	import popup from './components/bottom-popup.vue'
 	export default {
 		data() {
 			return {
 				nowPermission:'',//用户当前权限
-				situaionID:'',//情境id
+				situationID:'',//情境id
 				checkGroupName:'',//查核组名
 				checkStatus:'',//查核状态
 				name:'',//查核名
@@ -78,8 +80,14 @@
 				isCheckLeader:false,//是否为查核组长
 				isChecker:false,//是否为查核者
 				isUnplanned:false,//是否计划外查核
+				checkFlag:'',//计划查核标志,是新建还是提前开始
+				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
+				
 			}
 		},
+		onLoad({ situationId }){ // situationId:情景id
+		  this.situationID=situationId;
+		},
 		created: function() {
 			this.nowPermission=uni.getStorageSync('nowPermission');
 			console.log(this.nowPermission);
@@ -88,13 +96,12 @@
 			this.isChecker=this.nowPermission==3?true:false;
 			this.isStartEndTimeShow=this.nowPermission==2||this.nowPermission==3?true:false;
 			this.isCheckImproveShow=this.nowPermission==1||this.nowPermission==4||this.nowPermission==3?true:false;
-			this.situaionID=uni.getStorageSync('situaionID');
 			this.$store.dispatch({
 				type: 'situationDetail/commActions',
 				payload: {
 					key: 'situationDetail',
 					data:{
-						id:this.situaionID
+						id:this.situationID
 					}
 				}
 			}).then((data) => {
@@ -125,7 +132,7 @@
 								payload: {
 									key: 'situationDelete',
 									data:{
-										id:this.situaionID
+										id:this.situationID
 									}
 								}
 							}).then((data) => {
@@ -146,7 +153,7 @@
 				
 			},
 			editSituation(){
-				let editEnable=this.compareTime();
+				let editEnable=this.compareTime(this.firstCheckTime);
 				if(editEnable){
 					uni.navigateTo({
 						url: '/pages/creatingSituations/creatingSituations'
@@ -160,9 +167,9 @@
 					})
 				}
 			},
-			compareTime(){
+			compareTime(time){
 				let myDate=new Date();
-				let firstCheckTime=this.firstCheckTime.replace(/-/g,"/");
+				let firstCheckTime=time.replace(/-/g,"/");
 				firstCheckTime=Date.parse(firstCheckTime);
 				if(myDate>firstCheckTime){
 					return false;
@@ -173,25 +180,66 @@
 			gotoCheckPage(){
 				//跳转到查核列表
 				uni.navigateTo({
-					url: '/pages/creatingSituations/creatingSituations'
+					url: `/pages/creatingSituations/creatingSituations?situationId=${this.situationID}`
 				});
 			},
 			gotoImprovePage(){
 				//跳转到改善列表
 				uni.navigateTo({
-					url: '/pages/creatingSituations/creatingSituations'
+					 url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.situationID}`
 				});
 			},
 			gotoPlanPage(){
 				//跳转到计划列表
 				uni.navigateTo({
-					url: '/pages/creatingSituations/creatingSituations'
+					url: `/pages/creatingSituations/creatingSituations?situationId=${this.situationID}`
 				});
 			},
 			startUnplanned(){
 				this.isUnplanned=true;
 				this.isChecker=false;
 			},
+			startCheck(){
+				this.$refs.popup.show();
+			},
+			createCheck(){
+				this.$store.dispatch({
+					type: 'situationDetail/commActions',
+					payload: {
+						key: 'planlList',
+						data:{
+							situationId:this.situationID
+						}
+					}
+				}).then((data) => {
+					console.log(data);
+					if (data) {
+						data.map((item,index)=>{
+							if(this.compareTime(item.startDate)==false||this.compareTime(item.endDate)){
+								this.$store.dispatch({
+									type: 'situationDetail/commActions',
+									payload: {
+										key: 'createCheck',
+										data:{
+											checkId:item.id
+										}
+									}
+								}).then((data) => {
+									 uni.navigateTo({
+									 	 url: `/pages/improve-mission-list/improve-mission-list`
+									 });
+								});
+							}
+							else{
+								return;
+							}
+						});
+					}
+				});
+			}
+		},
+		components: {
+			popup,
 		}
 	}
 </script>

+ 60 - 19
pages/situationsCenter/situationsCenter.vue

@@ -54,8 +54,42 @@
 				nowPermission:'',
 				isSearchBarShow:false,//搜索栏是否可见
 				isSearchBoxShow:true,//搜索图标是否可见
-				situationList:[],//情境卡片列表
+				// situationList:[],//情境卡片列表
 				totalCount:'',//返回数据的总条数
+				situationList:[
+									{
+										name:"药物管理系统追踪访查",
+										checkStatus:"第2/9次查核进行中",
+										nextCheckTime:"距离计划结束12天06小时",
+										checkGroupName:"查核二组",
+										topic:true,
+										situationID:16
+									},
+									{
+										name:"药物管理系统追踪访查",
+										checkStatus:"第2/9次查核进行中",
+										nextCheckTime:"距离计划结束12天06小时",
+										checkGroupName:"查核二组",
+										topic:false,
+										situationID:17
+									},
+									{
+										name:"药物管理系统追踪访查",
+										checkStatus:"第2/9次查核进行中",
+										nextCheckTime:"距离计划结束12天06小时",
+										checkGroupName:"查核二组",
+										topic:true,
+										situationID:26
+									},
+									{
+										name:"药物管理系统追踪访查",
+										checkStatus:"第2/9次查核进行中",
+										nextCheckTime:"距离计划结束12天06小时",
+										checkGroupName:"查核二组",
+										topic:true,
+										situationID:1
+									}
+								]
 			}
 		},
 		created: function() {
@@ -71,17 +105,17 @@
 				}
 			}).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,
-						}
-					});
+					// 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,
+					// 	}
+					// });
 				}
 			});
 		},
@@ -103,9 +137,8 @@
 				});
 			},
 			gotoDetail(id){
-				uni.setStorageSync('situaionID', id);
 				uni.navigateTo({
-					url: '/pages/situationDetail/situationDetail'
+					url: `/pages/situationDetail/situationDetail?situationId=${id}`
 				});
 			},
 			searchByKeywords(event){
@@ -279,9 +312,11 @@
 							float: right;
 						}
 						.title{
+							height: 22.5rpx;
 							margin-left: 20rpx;
-							// margin-top: 31.25rpx;
-							padding-top: 25rpx;
+							margin-top: 25rpx;
+							display: flex;
+							align-items: center;
 							.title-name{
 								font-size: 22.5rpx;
 								font-family: SourceHanSansCN-Bold, SourceHanSansCN;
@@ -292,8 +327,11 @@
 						.check-group{
 							margin-left: 20rpx;
 							margin-top: 15rpx;
-							margin-bottom: 7.5rpx;
-							.group.text{
+							margin-bottom: 25rpx;
+							height: 17.5rpx;
+							display: flex;
+							align-items: center;
+							.group-text{
 								font-size: 17.5rpx;
 								font-family: SourceHanSansCN-Normal, SourceHanSansCN;
 								font-weight: 400;
@@ -302,7 +340,10 @@
 						}
 						.row{
 							margin-left: 20rpx;
-							margin-top: 17.5rpx;
+							margin-bottom: 17.5rpx;
+							display: flex;
+							align-items: center;
+							height: 20rpx;
 							.situation-check{
 								width: 20rpx;
 								height: 20rpx;

BIN
static/checkStatus.png