瀏覽代碼

提前开始查核计划和创建计划外查核修改

“yst 4 年之前
父節點
當前提交
90e0bb083f

+ 76 - 74
pages/situationDetail/components/bottom-popup.vue

@@ -31,87 +31,89 @@
 				currentType:this.type,//当前类型
 				selectedPlanID:'',//选择的计划id
 				showModalStatus:false,//查核计划选择弹框
-				flag:0,//是否为进行中计划,判断下一个未开始的查核计划
+				flag:-3,//是否为进行中计划,判断下一个未开始的查核计划
+				planList:[],//查核计划列表
+				arrUnstarted:[],//未开始计划数组
 				// 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
-					},
-				],//查核计划列表
+				// 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;
+			this.$store.dispatch({
+				type: 'situationDetail/commActions',
+				payload: {
+					key: 'planlList',
+					data:{
+						situationId:this.situationID
+					}
 				}
-				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',
+			}).then((data) => {
+				if (data) {
+					this.planList=data.map((item,index)=>{				
+						if(item.status==1){
+							this.arrUnstarted.push(item);
+							this.flag=this.arrUnstarted[0].id;
+						}
+						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:item.id==this.flag?'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(){
@@ -127,7 +129,7 @@
 				this.planList.map((item,index)=>{
 					item.isChecked=false;
 				});
-				if(index==this.flag+1){
+				if(item.id==this.flag){
 					this.planList[index].isChecked=true;
 					this.selectedPlanID=item.id;
 				}

+ 15 - 14
pages/situationDetail/situationDetail.vue

@@ -82,6 +82,7 @@
 				isUnplanned:false,//是否计划外查核
 				checkFlag:'',//计划查核标志,是新建还是提前开始
 				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
+				checkItemList:[],//时间区间包含当前时间的item
 				
 			}
 		},
@@ -212,28 +213,28 @@
 						}
 					}
 				}).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`
-									 });
-								});
+								this.checkItemList.push(item);
 							}
 							else{
 								return;
 							}
 						});
+						this.$store.dispatch({
+							type: 'situationDetail/commActions',
+							payload: {
+								key: 'createCheck',
+								data:{
+									checkId:this.checkItemList[0].id
+								}
+							}
+						}).then((data) => {
+							 uni.navigateTo({
+							 	 url: `/pages/creatingSituations/creatingSituations`
+							 });
+						});
 					}
 				});
 			}

+ 12 - 46
pages/situationsCenter/situationsCenter.vue

@@ -54,42 +54,8 @@
 				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() {
@@ -105,17 +71,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,
+						}
+					});
 				}
 			});
 		},