浏览代码

Merge branch 'master' of ssh://1582597470426922.onaliyun.com@s1.nsloop.com:29418/web_TracerMethodology

yuwenfen 4 年之前
父节点
当前提交
ce9043d6a0

+ 62 - 0
App.vue

@@ -105,7 +105,69 @@
 			width: 100%;
 			background-color: #fff;
 			box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
+			
+			.title-wrap {
+				display: flex;
+				flex-direction: row;
+				align-items: center;
+				padding: 0 25rpx;
+				>text {
+					font-size: 35rpx;
+					line-height: 52.5rpx;
+					color: #292C33;
+				}
+				>view {
+					display: flex;
+					flex-direction: row;
+					align-items: center;
+					margin-left: 20rpx;
+					border-radius: 17.5rpx;
+					height: 35rpx;
+					font-size: 17.5rpx;
+					line-height: 35rpx;
+					color: #8F9BB3;
+					background-color: #EDF2FA;
+					image {
+						width: 35rpx;
+						height: 35rpx;
+					}
+					text {
+						padding-left: 10rpx;
+						padding-right: 20rpx;
+					}
+				}
+			}
+			.content {
+				display: flex;
+				flex-direction: column;
+				padding: 11.25rpx 25rpx 20rpx;
+				>text {
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+					font-size: 20rpx;
+					line-height: 30rpx;
+					color: #666F80;
+					&:first-child {
+						margin-bottom: 5rpx;
+						font-weight: bold;
+						color: #292C33;
+					}
+				}
+			}
 		}
 	}
 	// 查核地图列表样式end
+	// 弹出层样式start
+	.modal {
+		overflow: hidden;
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 1000;
+		background-color: rgba(18, 20, 26, 0.5);
+	}
+	// 弹出层样式end
 </style>

+ 0 - 54
components/tm-check-map-list/tm-check-map-list.vue

@@ -24,57 +24,3 @@
 		props: ['item']
 	}
 </script>
-
-<style lang="less">
-	.content-wrap {
-		.title-wrap {
-			display: flex;
-			flex-direction: row;
-			align-items: center;
-			padding: 0 25rpx;
-			>text {
-				font-size: 35rpx;
-				line-height: 52.5rpx;
-				color: #292C33;
-			}
-			>view {
-				display: flex;
-				flex-direction: row;
-				align-items: center;
-				margin-left: 20rpx;
-				border-radius: 17.5rpx;
-				height: 35rpx;
-				font-size: 17.5rpx;
-				line-height: 35rpx;
-				color: #8F9BB3;
-				background-color: #EDF2FA;
-				image {
-					width: 35rpx;
-					height: 35rpx;
-				}
-				text {
-					padding-left: 10rpx;
-					padding-right: 20rpx;
-				}
-			}
-		}
-		.content {
-			display: flex;
-			flex-direction: column;
-			padding: 11.25rpx 25rpx 20rpx;
-			>text {
-				overflow: hidden;
-				white-space: nowrap;
-				text-overflow: ellipsis;
-				font-size: 20rpx;
-				line-height: 30rpx;
-				color: #666F80;
-				&:first-child {
-					margin-bottom: 5rpx;
-					font-weight: bold;
-					color: #292C33;
-				}
-			}
-		}
-	}
-</style>

+ 19 - 7
pages.json

@@ -1,11 +1,5 @@
 {
 	"pages": [
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "追踪方法学"
-			}
-		},
 		{
 			"path": "pages/login/login"
 		},
@@ -107,7 +101,25 @@
 				"enablePullDownRefresh": false
 			}
 		}
-	],
+	    ,{
+            "path" : "pages/planList/planList",
+            "style" :
+            {
+                "navigationBarTitleText": "计划列表",
+                "enablePullDownRefresh": false
+            }
+
+        }
+    ],
+		},
+		{
+			"path" : "pages/checkList/checkList",
+			"style" :	{
+				"navigationBarTitleText": "查核列表",
+				"enablePullDownRefresh": false
+			}
+    }
+  ],
 	"globalStyle": {
 		"navigationStyle": "custom",
 		"navigationBarTextStyle": "black",

+ 127 - 0
pages/checkList/checkList.vue

@@ -0,0 +1,127 @@
+<template>
+	<view class="check-map-list">
+		<view class="item"
+			v-for="(item, index) in depList" 
+			: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">
+				<text>查核人:{{item.empName}}</text>
+				<text>{{item.startDate}}~{{item.endDate}}</text>
+			</view>
+		</view>
+		<view class="null" v-if="depList.length === 0">暂无数据</view>
+		<view class="modal">
+			<view class="content-list">
+				<view class="list-item">
+					<text>第1次查核计划(2020-09-21 ~ 2020-09-22)</text>
+					<view class="item-icon">已完成</view>
+				</view>
+				<view class="list-item active">
+					<text>第1次查核计划(2020-09-21 ~ 2020-09-22)</text>
+					<view class="item-icon">进行中</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				depList: [
+					{
+						"checkId":30, //类型:Number  必有字段  备注:计划id
+						"deptId":1, //类型:Number  必有字段  备注:单位id
+						"deptName":"测试单位1", //类型:String  必有字段  备注:单位名称
+						"deptClassId":1, //类型:Number  必有字段  备注:单位分组id
+						"deptClassName":"单位分类1", //类型:String  必有字段  备注:单位分组名称
+						"checkPointNames":"要点1", //类型:String  必有字段  备注:要点名称拼接
+						"decs":"包含1个查核要点, 已完成0/2个查核项目", //类型:String  必有字段  备注:描述
+						"empId":6, //类型:Number  必有字段  备注:分配查核人id
+						"empName":"查核组员2", //类型:String  必有字段  备注:分配查核人名称
+						"startDate":"2021-02-20 08:00", //类型:String  必有字段  备注:分配开始时间
+						"endDate":"2021-02-21 05:00" //类型:String  必有字段  备注:分配结束时间
+					}
+				]
+			};
+		},
+		created: function(){
+			this.dispatch('depList', {checkId: ''}).then((data)=>{
+				console.log(data);
+				if(data) {
+					// this.depList = data;
+				}
+			});
+		},
+		methods: {
+			dispatch: function(key, data) {
+				return this.$store.dispatch({type: 'checkList/commActions', key, data});
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.check-map-list {
+		padding: 25rpx;
+		.footer {
+			display: flex;
+			flex-direction: row;
+			justify-content: space-between;
+			align-items: center;
+			margin: 0 25rpx 16.87rpx;
+			border-top: 1px solid #DADEE6;
+			padding-top: 16.25rpx;
+			font-size: 17.5rpx;
+			line-height: 26.25rpx;
+			color: #666E80;
+		}
+	}
+	.null {
+		text-align: center;
+		color: #999;
+	}
+	.content-list {
+		width: 100%;
+		background-color: #fff;
+		.list-item {
+			display: flex;
+			flex-direction: row;
+			align-items: center;
+			border-bottom: 1px solid #DADEE6;
+			padding: 0 25rpx;
+			width: 100%;
+			height: 87.5rpx;
+			font-size: 22.5rpx;
+			line-height: 33.75rpx;
+			color: #292C33;
+			.item-icon {
+				border-radius: 5rpx;
+				padding: 6.25rpx 11.25rpx;
+				line-height: 26.25rpx;
+				color: #29CC96;
+				background-color: #e9f9f4;
+			}
+			&.active {
+				color: #3377FF;
+				.item-icon {
+					color: #FFAA00;
+					background-color: #fff9ef;
+				}
+			}
+		}
+	}
+</style>

+ 18 - 0
pages/checkList/model.js

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

+ 16 - 0
pages/checkList/server.js

@@ -0,0 +1,16 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+  // 查核列表
+  depList: {
+    method: 'GET',
+    url: 'plan/depList',
+		// successMessage: '',
+		// needLoading: false // 还有这两个参数,但不是必传的,默认loading
+  }, 
+};
+
+export const commServer = (key, data) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 2 - 2
pages/checkMapList/checkMapList.vue

@@ -5,7 +5,7 @@
 			:key="index">
 			<tm-check-map-list :item="item"></tm-check-map-list>
 		</view>
-		<text class="null" v-if="checkMap.list.length === 0">暂无数据</text>
+		<view class="null" v-if="checkMap.list.length === 0">暂无数据</view>
 	</view>
 </template>
 
@@ -24,9 +24,9 @@
 <style lang="less">
 	.check-map-list {
 		padding: 25rpx;
-		text-align: center;
 	}
 	.null {
+		text-align: center;
 		color: #999;
 	}
 </style>

+ 21 - 6
pages/creatingSituations/components/checkMap.vue

@@ -71,12 +71,7 @@
 					this.dispatch('checkDeptList', { depType, checkPointIds })
 						.then((data)=> {
 							if(data) {
-								let _data = data.map((item)=>{
-									return {
-										...item,
-										status: 'normal'
-									}
-								})
+								let _data = this.checkDep(data);
 								this.myCommit('list', _data);
 							} 
 						});
@@ -86,6 +81,26 @@
 					});
 				}
 			},
+			checkDep: function(list) {
+				return list.map((item, i)=>{
+					return {
+						...item,
+						status: 'normal',
+						pointList: (item.pointList || []).map((ptem)=>{
+							return {
+								...ptem,
+								selectFlag: true,
+								itemList: (ptem.itemList || []).map((ntem)=>{
+									return {
+										...ntem,
+										selectFlag: true
+									}
+								})
+							}
+						})
+					}
+				});
+			},
 			creatIcon: function(status) {
 				let obj = {id: 'jinyong', label: '禁用'};
 				switch(status) {

+ 0 - 7
pages/creatingSituations/components/checkMapAdd.vue

@@ -92,13 +92,6 @@
 
 <style lang="less">
 	.modal {
-		position: absolute;
-		bottom: 0;
-		width: 100%;
-		height: 100%;
-		z-index: 1000;
-		background-color: rgba(18, 20, 26, 0.5);
-		
 		.modal-body {
 			margin-top: 10%;
 			border-radius: 25rpx 25rpx 0 0;

+ 19 - 20
pages/creatingSituations/components/checkMapDetail.vue

@@ -10,8 +10,9 @@
 				<view class="children" v-if="openItems.includes(item.id)">
 					<view class="child" v-for="(child, n) in item.itemList" :key="n">
 						<text>{{child.name}}</text>
-						<view class="check-icon-wrap" @click="changeChecked(child.id)">
-							<image :src="`../../static/check-${checkedIds.includes(child.id)
+						<view class="check-icon-wrap" 
+							@click="changeChecked(index, n, child.selectFlag)">
+							<image :src="`../../static/check-${child.selectFlag
 								?'checkbox':'no'}.png`"></image>
 						</view>
 					</view>
@@ -31,48 +32,46 @@
 		data() {
 			return {
 				openItems: [],
-				checkedIds: [],
 			}
 		},
 		computed: {
 			botmBtnGroup: function() {
 				return [
 					{id: 'cancle', label: '取消'},
-					{id: 'ok', label: `已选${this.checkedIds.length}项,确定`}
+					{id: 'ok', label: `已选${this.selectedNum}项,确定`}
 				];
 			},
 			...mapState({
 				checkMap: state => state.creatingSituations.checkMap,
-			})
+			}),
+			selectedNum: function() {
+				let num = 0;
+				this.checkMap.actionItem.pointList.map((item)=>{
+					item.itemList.map((ntem)=>{
+						if(ntem.selectFlag) num++;
+					});
+				});
+				return num;
+			},
 		},
 		created:function(){
-			// 默认全选中
 			this.checkMap.actionItem.pointList.map((item)=>{
 				this.openItems.push(item.id);
-				item.itemList.map((ntem)=>{
-					if(ntem.selectFlag === undefined || ntem.selectFlag) {
-						this.checkedIds.push(ntem.id);
-					}
-				});
 			});
 		},
 		methods: {
 			openChildren: function(key) {
 				this.openItems = arrFilter(key, this.openItems);
 			},
-			changeChecked: function(id) {
-				this.checkedIds = arrFilter(id, this.checkedIds);
+			changeChecked: function(i, n, selectFlag) {
+				this.checkMap.actionItem.pointList[i].itemList[n].selectFlag = !selectFlag;
+				this.myCommit('actionItem', this.checkMap.actionItem);
 			},
 			btnClick: function(id) {
 				if(id === 'ok') {
-					let pointList = [...this.checkMap.actionItem.pointList];
-					pointList.map((item)=>{
-						item.itemList.map((ntem)=>{
-							ntem.selectFlag = this.checkedIds.includes(ntem.id) ? true : false;
-						});
-					});
+					const {id, pointList} = this.checkMap.actionItem;
 					let list = [...this.checkMap.list];
-					let index = list.findIndex(({id})=> id === this.checkMap.actionItem.id);
+					let index = list.findIndex((item)=> item.id === id);
 					list[index].pointList = pointList;
 					this.myCommit('list', list);
 				} 

+ 0 - 7
pages/creatingSituations/components/checkRent.vue

@@ -75,14 +75,7 @@
 			},
 			checkedHandle: function(e, item) {
 				_stopPropagation(e);
-				let _list = [...this.checkRent.list].map((ntem)=>{
-					return {
-						...ntem,
-						selectFlag: ntem.id === item.id ? true : false
-					}
-				});
 				this.myCommit('checkedItem', item);
-				this.myCommit('list', _list);
 			},
 			/**
 			 * 更新condition数据

+ 0 - 12
pages/creatingSituations/components/condition.vue

@@ -34,8 +34,6 @@
 		methods: {
 			checkedHandle: function(keys) {
 				this.myCommit('conditionIds', keys);
-				let _options = this.optionsHandle2([...this.condition.options], keys);
-				this.myCommit('options', _options);
 			},
 			selectBtnHandle: function(depType) {
 				this.myCommit('depType', depType);
@@ -83,16 +81,6 @@
 				});
 				return options;
 			},
-			optionsHandle2: function(data, keys) {
-				let options = data.map((item)=>{
-					return {
-						...item,
-						selectFlag: this.condition.conditionIds.includes(item.id),
-						child: this.optionsHandle2(item.child, keys)
-					}
-				});
-				return options;
-			},
 			/**
 			 * 更新condition数据
 			 * @param {Object} key 要更新的属性

+ 40 - 11
pages/creatingSituations/creatingSituations.vue

@@ -85,7 +85,6 @@
 				const {sitName,preDay,preH,startDay} = this.situationPreview;
 				const {dateObj,checkedItem,checkList} = this.checkPlan;
 				const {depType, options} = this.condition;
-				const {list} = this.checkMap;
 				if(!sitName) {
 					uni.showModal({
 						title: '温馨提示',
@@ -103,15 +102,9 @@
 					remindPlanHour: preH,
 					remindCheckDay: startDay,
 					depType,
-					filterCondition: options,
-					checkGroup: this.checkRent.list,
-					checkDep: [...list].map((item,i)=>{
-						return {
-							...item,
-							sort: i+1,
-							enableFlag: item.status === 'disable' ? false : true
-						}
-					}),
+					filterCondition: this.optionsHandle(options),
+					checkGroup: this.checkGroup(),
+					checkDep: this.checkDep(),
 					planConfig: {
 						frequency: checkedItem.value,
 						day: checkedItem.model,
@@ -126,8 +119,11 @@
 						}
 					})
 				}).then((data)=>{
+					console.log(data);
 					if(data) {
-						
+						uni.navigateTo({
+							url: '/pages/situationsCenter/situationsCenter'
+						});
 					}
 				});
 			},
@@ -197,6 +193,39 @@
 					return false;
 				}
 			},
+			/**
+			 * 构造条件提交结果
+			 */
+			optionsHandle: function(arr) {
+				let options = [...arr].map((item)=>{
+					return {
+						...item,
+						selectFlag: this.condition.conditionIds.includes(item.id),
+						child: this.optionsHandle(item.child)
+					}
+				});
+				return options;
+			},
+			checkDep: function() {
+				const {list} = this.checkMap;
+				return list.map((item, i)=>{
+					return {
+						...item,
+						sort: i+1,
+						enableFlag: item.status === 'disable' ? false : true,
+					}
+				});
+			},
+			checkGroup: function() {
+				const {list, checkedItem} = this.checkRent;
+				let _list = [...list].map((ntem)=>{
+					return {
+						...ntem,
+						selectFlag: ntem.id === checkedItem.id ? true : false
+					}
+				});
+				return _list;
+			},
 			myCommit: function(key, data) {
 				this.$store.commit({type: 'creatingSituations/comChangeState',key,data});
 			},

+ 1 - 1
pages/home/home.vue

@@ -107,7 +107,7 @@
 						key: 'logout',
 					}
 				}).then((data)=>{
-					if(data!==null){
+					if(data){
 						uni.navigateTo({
 							url: '/pages/login/login'
 						});

+ 0 - 51
pages/index/index.vue

@@ -1,51 +0,0 @@
-<template>
-	<view class="content">
-		<view class="text-area">
-			<text class="title">{{title}}</text>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				title: 'Hello'
-			}
-		},
-		onLoad() {
-
-		},
-		methods: {
-
-		}
-	}
-</script>
-
-<style>
-	.content {
-		display: flex;
-		flex-direction: column;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.logo {
-		height: 200rpx;
-		width: 200rpx;
-		margin-top: 200rpx;
-		margin-left: auto;
-		margin-right: auto;
-		margin-bottom: 50rpx;
-	}
-
-	.text-area {
-		display: flex;
-		justify-content: center;
-	}
-
-	.title {
-		font-size: 36rpx;
-		color: #8f8f94;
-	}
-</style>

+ 5 - 1
pages/model.js

@@ -9,6 +9,8 @@ import situationDetail from './situationDetail/model.js';
 import creatingSituations from "./creatingSituations/model.js";
 import calendar from './calendar/model.js';
 import todayCheck from './todayCheck/model.js';
+import planList from './planList/model.js';
+import checkList from "./checkList/model.js";
 
 export default module = {
   login,
@@ -22,5 +24,7 @@ export default module = {
   todayCheck,
   situationsCenter,
   situationDetail,
-  creatingSituations
+  creatingSituations,
+	planList,
+	checkList
 }

+ 14 - 0
pages/planList/model.js

@@ -0,0 +1,14 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+  },
+  mutations: {},
+  actions: {
+		commActions({ commit, state }, { payload }) {
+			// payload = {key,data} // data是请求数据,key是请求接口id
+      return commServer(payload);
+		},
+  }
+}

+ 193 - 0
pages/planList/planList.vue

@@ -0,0 +1,193 @@
+<template>
+	<view class="planList-page">
+		<scroll-view class="list-box" scroll-y="true" :style="{'height':listHeight+'rpx'}">
+			<view class="item-box" v-for="(item,index) in planList" @click="gotoCheckList">
+				<view class="row1">
+					<text class="title">{{item.name}}</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>
+				</view>
+				<view class="row2">
+					<text class="TobeDistributed">剩余1个单位待分配</text>
+					<text class="startEndTime">起止时间:2020-12-26 ~ 2020-12-18</text>
+				</view>
+			</view>
+		</scroll-view>
+		<view class="btn-distribution" @click="gotoCheckList" v-if="isShowDistribution">
+			<text class="btn-text">批量分配</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				situationID:'',//情境id
+				planList:[],//计划列表
+				firstFlag:1,//是否为第一次分配的标志,为1时表示是第一次,弹框提示
+				isShowDistribution:true,//是否显示批量分配按钮
+				listHeight:1125,//列表高度
+			}
+		},
+		onLoad({ situationId }){ // situationId:情景id
+		  this.situationID=situationId;
+		},
+		created: function() {
+			this.$store.dispatch({
+				type: 'planList/commActions',
+				payload: {
+					key: 'planList',
+					data:{
+						situationId:this.situationID
+					}
+				}
+			}).then((data) => {
+				if (data) {
+					this.planList=data.map((item,index)=>{	
+						if(item.empList.length!=item.toDistribute){
+							this.firstFlag=0;
+						}
+						if(!this.compareTime(item.startDate)){
+							this.isShowDistribution=false;
+							this.listHeight=1200;
+						}
+						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,
+							toDistribute:item.toDistribute,
+						}
+					});
+					if(this.firstFlag==1){
+						uni.showModal({
+							title:'提示',
+							content:'您的分配工作量较大,建议使用批量分配功能',
+						  showCancel:false
+						})
+					}
+				}
+			});
+		},
+		methods: {
+			compareTime(time){
+				let myDate=new Date();
+				let startDate=time.replace(/-/g,"/");
+				startDate=Date.parse(startDate);
+				if(myDate>startDate){
+					return false;
+				}else{
+					return true;
+				}
+			},
+			gotoCheckList(){
+				//跳转到查核列表
+				uni.navigateTo({
+					url: `/pages/creatingSituations/creatingSituations?situationId=${this.situationID}`
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.planList-page{
+		height: 100%;
+		.list-box{
+			// height: 1125rpx;
+			.item-box{
+				width: 100%;
+				height: 125rpx;
+				background: #FFFFFF;
+				border: 0.62rpx solid #DADEE6;
+				.row1{
+					margin-top: 30rpx;
+					margin-left: 25rpx;
+					margin-right: 25rpx;
+					.title{
+						font-size: 25rpx;
+						font-family: SourceHanSansCN-Bold, SourceHanSansCN;
+						font-weight: bold;
+						color: #292C33;
+						float: left;
+					}
+					.compeleted-box{
+						width: 75rpx;
+						height: 31.25rpx;
+						border-radius: 8px;
+						background: rgba(41, 204, 150, 0.1);
+						text-align: center;
+						float: right;
+						.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: right;
+						.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;
+						}
+					}
+				}
+				.row2{
+					margin-left: 25rpx;
+					margin-top: 75rpx;
+					margin-right: 25rpx;
+					.TobeDistributed{
+						font-size: 20rpx;
+						font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+						font-weight: 400;
+						color: #666E80;
+						float: left;
+					}
+					.startEndTime{
+						font-size: 20rpx;
+						font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+						font-weight: 400;
+						color: #666E80;
+						float: right;
+					}
+				}
+			}
+		}
+		.btn-distribution {
+			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>

+ 19 - 0
pages/planList/server.js

@@ -0,0 +1,19 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+	//计划列表
+	planList:{
+		method:'GET',
+		url: 'plan/list'
+	},
+	//分配单位查核人员
+	batchDistribute:{
+		method:'POST',
+		url: 'plan/batchDistribute'
+	},
+
+};
+export const commServer = ({ key, data }) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 5 - 3
pages/role-switching/role-switching.vue

@@ -66,9 +66,11 @@
 						}
 					}
 				}).then((data)=>{
-					uni.navigateTo({
-						url: '/pages/home/home'
-					});
+					if(data){
+						uni.navigateTo({
+							url: '/pages/home/home'
+						});
+					}
 				});
 			}
 		},

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

@@ -0,0 +1,223 @@
+<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:-3,//是否为进行中计划,判断下一个未开始的查核计划
+				planList:[],//查核计划列表
+				arrUnstarted:[],//未开始计划数组
+			}
+		},
+		created: function() {
+			this.$store.dispatch({
+				type: 'situationDetail/commActions',
+				payload: {
+					key: 'planList',
+					data:{
+						situationId:this.situationID
+					}
+				}
+			}).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',
+						}
+					});
+				}
+			});
+		},
+		methods: {
+			show(){
+				this.showModalStatus=true;
+			},	
+			hide(){
+				this.showModalStatus=false;
+			},
+			hidePopupBox(){
+				this.hide();
+			},
+			toggleSelect(item,index) {
+				this.planList.map((item,index)=>{
+					item.isChecked=false;
+				});
+				if(item.id==this.flag){
+					this.planList[index].isChecked=true;
+					this.selectedPlanID=item.id;
+				}
+				else{
+					return;
+				}
+				
+			},
+			saveChange(){
+				this.$store.dispatch({
+					type: 'situationDetail/commActions',
+					payload: {
+						key: 'planAdvance',
+						data:{
+							checkId:this.selectedPlanID
+						}
+					}
+				}).then((data)=>{
+					if(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'
 	},
+	//查核计划列表
+	planList:{
+		method:'GET',
+		url: 'plan/list'
+	},
+	//提前开始计划内查核
+	planAdvance:{
+		method:'GET',
+		url: 'plan/advance'
+	},
+	//创建计划外查核
+	createCheck:{
+		method:'GET',
+		url: 'plan/unplannedCheck'
+	},
 };
 export const commServer = ({ key, data }) => {
   let obj = requestList[key];

+ 64 - 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,15 @@
 				isCheckLeader:false,//是否为查核组长
 				isChecker:false,//是否为查核者
 				isUnplanned:false,//是否计划外查核
+				checkFlag:'',//计划查核标志,是新建还是提前开始
+				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
+				checkItemList:[],//时间区间包含当前时间的item
+				
 			}
 		},
+		onLoad({ situationId }){ // situationId:情景id
+		  this.situationID=situationId;
+		},
 		created: function() {
 			this.nowPermission=uni.getStorageSync('nowPermission');
 			console.log(this.nowPermission);
@@ -88,13 +97,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 +133,7 @@
 								payload: {
 									key: 'situationDelete',
 									data:{
-										id:this.situaionID
+										id:this.situationID
 									}
 								}
 							}).then((data) => {
@@ -146,7 +154,7 @@
 				
 			},
 			editSituation(){
-				let editEnable=this.compareTime();
+				let editEnable=this.compareTime(this.firstCheckTime);
 				if(editEnable){
 					uni.navigateTo({
 						url: '/pages/creatingSituations/creatingSituations'
@@ -160,9 +168,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 +181,69 @@
 			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/planList/planList?situationId=${this.situationID}`
 				});
 			},
 			startUnplanned(){
 				this.isUnplanned=true;
 				this.isChecker=false;
 			},
+			startCheck(){
+				this.$refs.popup.show();
+			},
+			createCheck(){
+				this.$store.dispatch({
+					type: 'situationDetail/commActions',
+					payload: {
+						key: 'planList',
+						data:{
+							situationId:this.situationID
+						}
+					}
+				}).then((data) => {
+					if (data) {
+						data.map((item,index)=>{
+							if(this.compareTime(item.startDate)==false||this.compareTime(item.endDate)){
+								this.checkItemList.push(item);
+							}
+							else{
+								return;
+							}
+						});
+						this.$store.dispatch({
+							type: 'situationDetail/commActions',
+							payload: {
+								key: 'createCheck',
+								data:{
+									checkId:this.checkItemList[0].id
+								}
+							}
+						}).then((data) => {
+							if(data){
+								uni.navigateTo({
+									 url: `/pages/creatingSituations/creatingSituations`
+								});
+							}
+							
+						});
+					}
+				});
+			}
+		},
+		components: {
+			popup,
 		}
 	}
 </script>

+ 14 - 7
pages/situationsCenter/situationsCenter.vue

@@ -103,9 +103,8 @@
 				});
 			},
 			gotoDetail(id){
-				uni.setStorageSync('situaionID', id);
 				uni.navigateTo({
-					url: '/pages/situationDetail/situationDetail'
+					url: `/pages/situationDetail/situationDetail?situationId=${id}`
 				});
 			},
 			searchByKeywords(event){
@@ -279,9 +278,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 +293,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 +306,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;

二进制
static/checkStatus.png


+ 3 - 3
utils/request.js

@@ -107,7 +107,7 @@ function notifyException(resArr, additional) {
       showCancel: false
     });
     console.error(`请求错误: ${error.errMsg}`);
-    return null;
+    return false;
   } else if (res.data.code !== 'SUCCESS') {
     const { code, msg } = res.data;
     if (code === '410' || code === '401') {
@@ -132,7 +132,7 @@ function notifyException(resArr, additional) {
       });
     }
     console.error(`错误信息: ${msg}`);
-    return null;
+    return false;
   } else if (additional.successMessage) {
     let msg = additional.successMessage;
     uni.showModal({
@@ -141,7 +141,7 @@ function notifyException(resArr, additional) {
       showCancel: false
     });
   }
-  return res.data.data;
+  return res.data.data ? res.data.data : true;
 }
 
 export {

+ 2 - 2
utils/requestUrl.js

@@ -1,7 +1,7 @@
 // export const URL = 'http://192.168.38.140:8088'; // 李磊
 // export const URL = 'http://192.9.216.251:8088'; // 建德
 // export const URL = 'http://192.168.38.174:8088';
-export const URL = 'http://192.168.1.45:8088'; //内网
-// export const URL = 'http://s1.nsloop.com:5137';  // 外网
+// export const URL = 'http://192.168.1.45:8088'; //内网
+export const URL = 'http://s1.nsloop.com:5137';  // 外网