Ver Fonte

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

yuwenfen há 4 anos atrás
pai
commit
6d0849d671

+ 42 - 37
pages/calendar/calendar.vue

@@ -93,19 +93,19 @@ export default {
       this.isInitWs = websocket.ws ? false : true;
       this.init(this.isInitWs);
     }, 3 * 60 * 1000);
-	this.messStatus();
+    this.messStatus();
   },
   beforeDestroy() {
     // 关闭ws连接
     websocket.close();
     clearInterval(this.refTimer);
   },
-  watch:{
-	  "$route":{
-		  handler(route){
-			  this.messStatus();
-		  }
-	  }
+  watch: {
+    $route: {
+      handler(route) {
+        this.messStatus();
+      },
+    },
   },
   methods: {
     getCanList() {
@@ -182,33 +182,35 @@ export default {
         });
       }
     },
-	messStatus(){
-		let num = 1;
-		let timer = setInterval(()=>{
-		  this.$store.dispatch({
-			  type: "calendar/commActions",
-			  payload: {
-				key: "messagesList",
-				data: {
-				  pageNum: num,
-				  pageSize: 100,
-				},
-			  },
-			}).then((res)=>{
-				if(res && res.list.length == 0){
-					clearInterval(timer)
-				}else if(res && res.list.length != 0){
-					res.list.map((item)=>{
-						if(!item.readStatus){
-							this.messageType = true;
-							return;
-						}
-					})
-				}
-			})
-		  num++;
-		},100)
-	}
+    messStatus() {
+      let num = 1;
+      let timer = setInterval(() => {
+        this.$store
+          .dispatch({
+            type: "calendar/commActions",
+            payload: {
+              key: "messagesList",
+              data: {
+                pageNum: num,
+                pageSize: 100,
+              },
+            },
+          })
+          .then((res) => {
+            if (res && res.list.length == 0) {
+              clearInterval(timer);
+            } else if (res && res.list.length != 0) {
+              res.list.map((item) => {
+                if (!item.readStatus) {
+                  this.messageType = true;
+                  return;
+                }
+              });
+            }
+          });
+        num++;
+      }, 100);
+    },
   },
 };
 </script>
@@ -250,17 +252,20 @@ export default {
     font-size: 20rpx;
     color: #666e80;
     line-height: 55rpx;
+    border-bottom: 1.25rpx solid #f5f6fa;
   }
   .calendarCon {
-    margin-right: 1.25rpx;
-    margin-top: 1.25rpx;
+    // margin-right: 1.25rpx;
+    // margin-top: 1.25rpx;
     height: 168.75rpx;
     background-color: #fff;
     float: left;
-    width: 14.1%;
+    width: 14.2857%;
     text-align: center;
     font-size: 35rpx;
     color: #292c33;
+    border-right: 1.25rpx solid #f5f6fa;
+    border-bottom: 1.25rpx solid #f5f6fa;
     .date {
       margin: 16.25rpx auto 6.25rpx;
       height: 52.5rpx;

+ 10 - 5
pages/creatingSituations/components/checkMap.vue

@@ -56,6 +56,7 @@
 				checkRent: state => state.creatingSituations.checkRent,
 				condition: state => state.creatingSituations.condition,
 				needReload: state => state.creatingSituations.needReload,
+				editConfig: state => state.creatingSituations.editConfig
 			})
 		},
 		created:function(){
@@ -63,11 +64,15 @@
 		},
 		methods: {
 			init: function() {
-				if(this.needReload) { // 点击上一步不用获取数据
-					const {points} = this.checkRent.checkedItem;
-					const {depType} = this.condition;
-					if(!points) return;
-					let checkPointIds = points.map(({id})=> id);
+				const {checkedItem} = this.checkRent;
+				const {depType} = this.condition;
+				const {checkRent, condition, checkMap} = this.editConfig;
+				// 编辑的时候不用获取数据
+				if(this.editConfig && checkRent && depType === condition.depType && checkedItem.id === checkRent.checkedItem.id) {
+					this.commit('checkMap', checkMap);
+				} else if(this.needReload) { // 点击上一步不用获取数据
+					if(!checkedItem.points) return;
+					let checkPointIds = checkedItem.points.map(({id})=> id);
 					this.dispatch('checkDeptList', { depType, checkPointIds })
 						.then((data)=> {
 							if(data) {

+ 60 - 52
pages/creatingSituations/components/checkMapAdd.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="modal">
+	<tm-modal>
 		<scroll-view scroll-y="true" class="modal-body">
 			<view class="body-content">
 				<text class="top-title">选择要新增的单位</text>
@@ -23,7 +23,7 @@
 			<tm-simple-btn-group :options="botmBtnGroup"
 				v-on:callback="btnClick" ></tm-simple-btn-group>
 		</scroll-view>
-	</view>
+	</tm-modal>
 </template>
 
 <script>
@@ -44,8 +44,18 @@
 			},
 			...mapState({
 				checkMap: state => state.creatingSituations.checkMap,
+				condition: state => state.creatingSituations.condition,
 			})
 		},
+		created:function(){
+			if(this.checkMap.deptList.length === 0) {
+				// 获取新增单位
+				const {depType} =this.condition;
+				this.dispatch('deptList', { depType }).then((data)=>{
+					if(data) this.myCommit('deptList', data);
+				});
+			}
+		},
 		methods: {
 			changeChecked: function(id) {
 				this.checkedIds = arrFilter(id, this.checkedIds);
@@ -91,58 +101,56 @@
 </script>
 
 <style lang="less">
-	.modal {
-		.modal-body {
-			margin-top: 10%;
-			border-radius: 25rpx 25rpx 0 0;
-			padding: 35rpx 40rpx 75rpx;
-			width: 100%;
-			height: 90%;
-			font-size: 22.5rpx;
-			line-height: 33.75rpx;
-			color: #292C33;
-			background-color: #fff;
-			.top-title {
-				font-size: 30rpx;
-				line-height: 45rpx;
-			}
-			.list {
-				margin-top: 25rpx;
-				.item {
-					.item-title {
-						margin-bottom: 3.75rpx;
-						font-size: 25rpx;
-						line-height: 37.5rpx;
-						font-weight: bold;
-					}
-					.chidren {
+	.modal-body {
+		margin-top: 10%;
+		border-radius: 25rpx 25rpx 0 0;
+		padding: 35rpx 40rpx 75rpx;
+		width: 100%;
+		height: 90%;
+		font-size: 22.5rpx;
+		line-height: 33.75rpx;
+		color: #292C33;
+		background-color: #fff;
+		.top-title {
+			font-size: 30rpx;
+			line-height: 45rpx;
+		}
+		.list {
+			margin-top: 25rpx;
+			.item {
+				.item-title {
+					margin-bottom: 3.75rpx;
+					font-size: 25rpx;
+					line-height: 37.5rpx;
+					font-weight: bold;
+				}
+				.chidren {
+					display: flex;
+					flex-direction: row;
+					flex-wrap: wrap;
+					margin: 0 -17.5rpx;
+					.child {
+						position: relative;
 						display: flex;
 						flex-direction: row;
-						flex-wrap: wrap;
-						margin: 0 -17.5rpx;
-						.child {
-							position: relative;
-							display: flex;
-							flex-direction: row;
-							justify-content: center;
-							align-items: center;
-							margin: 10rpx 17.5rpx;
-							border-radius: 5rpx;
-							width: 200rpx;
-							height: 50rpx;
-							font-weight: 500;
-							background-color: #EBEDF2;
-							image {
-								position: absolute;
-								right: 0;
-								bottom: 0;
-								width: 25rpx;
-								height: 25rpx;
-							}
-							&.active {
-								color: #3377FF;
-								background-color: #E6EEFF;
-							}
+						justify-content: center;
+						align-items: center;
+						margin: 10rpx 17.5rpx;
+						border-radius: 5rpx;
+						width: 200rpx;
+						height: 50rpx;
+						font-weight: 500;
+						background-color: #EBEDF2;
+						image {
+							position: absolute;
+							right: 0;
+							bottom: 0;
+							width: 25rpx;
+							height: 25rpx;
+						}
+						&.active {
+							color: #3377FF;
+							background-color: #E6EEFF;
 						}
 					}
 				}

+ 3 - 9
pages/creatingSituations/components/checkPlan.vue

@@ -78,18 +78,12 @@
 	import { mapState } from "vuex";
 	import {dateHandle} from "../../../utils/dateHandle.js";
 	const {dateDiff, getNewData, todayDate, compare} = dateHandle;
-	const list = [
-		{id: 'week', value: 1, label: '每周', model: 7},
-		{id: 'month', value: 2, label: '每月', model: 30},
-		{id: 'twoMonth', value: 3, label: '每两月', model: 60},
-		{id: 'quarter', value: 4, label: '每季度', model: 90},
-		{id: 'halfAYear', value: 5, label: '每半年', model: 180},
-		{id: 'custom', value: 6, label: '天', model: null},
-	];
+	import {checkPlanList} from "./utils.js";
+	
 	export default {
 		data() {
 			return {
-				list
+				list: checkPlanList
 			}
 		},
 		computed: {

+ 10 - 1
pages/creatingSituations/components/checkRent.vue

@@ -44,6 +44,7 @@
 	import { mapState } from "vuex";
 	import {_stopPropagation} from "../../../utils/compatible.js";
 	import {arrFilter} from "../../../utils/arrFilter.js";
+	import {arrayEquality} from "./utils.js";
 	
 	export default {
 		data() {
@@ -56,10 +57,18 @@
 				checkRent: state => state.creatingSituations.checkRent,
 				condition: state => state.creatingSituations.condition,
 				needReload: state => state.creatingSituations.needReload,
+				editConfig: state => state.creatingSituations.editConfig
 			})
 		},
 		created:function(){
-			if(this.needReload) { // 点击上一步不用获取数据
+			// 编辑的时候不用获取数据
+			if(this.editConfig && arrayEquality(this.condition.conditionIds, this.editConfig.condition.conditionIds) && this.editConfig.checkRent) {
+				this.$store.commit({
+					type: 'creatingSituations/comChangeState', 
+					key: 'checkRent', 
+					data: this.editConfig.checkRent
+				});
+			} else if(this.needReload) { // 点击上一步不用获取数据
 				this.$store.dispatch({
 					type: 'creatingSituations/commActions',
 					key: 'checkGroupList',

+ 14 - 18
pages/creatingSituations/components/condition.vue

@@ -19,17 +19,28 @@
 
 <script>
 	import { mapState } from "vuex";
+	import {conditionOptions,editCondition} from "./utils.js";
+	
 	export default {
 		computed: {
 			...mapState({
 				condition: state => state.creatingSituations.condition,
 				needReload: state => state.creatingSituations.needReload,
-				theme: state => state.creatingSituations.theme
+				theme: state => state.creatingSituations.theme,
+				editConfig: state => state.creatingSituations.editConfig
 			})
 		},
 		created: function(){
-			if(this.needReload) // 点击上一步不用获取数据
+			// 编辑的时候不用获取数据
+			if(this.editConfig && this.editConfig.theme.id === this.theme.id) {
+				this.$store.commit({
+					type: 'creatingSituations/comChangeState', 
+					key: 'condition', 
+					data: this.editConfig.condition
+				});
+			} else if(this.needReload) {
 				this.getOptions(this.condition.depType);
+			}
 		},
 		methods: {
 			checkedHandle: function(keys) {
@@ -55,7 +66,7 @@
 							if(data.length > 0) {
 								this.myCommit('defaultOpen', [data[0].id]);
 							}
-							this.myCommit('options', this.optionsHandle(data));
+							this.myCommit('options', conditionOptions(data));
 						} 
 					});
 				} else {
@@ -66,21 +77,6 @@
 					});
 				}
 			},
-			/**
-			 * 增加树形数据字段,以适配公共组件
-			 * @param {Object} data
-			 */
-			optionsHandle: function(data) {
-				let options = data.map((item)=>{
-					return {
-						...item,
-						key: item.id,
-						label: item.name,
-						children: this.optionsHandle(item.child)
-					}
-				});
-				return options;
-			},
 			/**
 			 * 更新condition数据
 			 * @param {Object} key 要更新的属性

+ 2 - 9
pages/creatingSituations/components/theme.vue

@@ -21,15 +21,8 @@
 
 <script>
 	import { mapState } from "vuex";
-	const themeList = [{
-			id: 0, 
-			title: '个案追踪', 
-			des: '评价诊疗服务的内涵质量以及对各种诊疗规范、临床路径等的执行力',
-		},{
-			id: 1, 
-			title: '系统追踪', 
-			des: '评价对各种质量与安全管理制度与流程的执行力、医院服务的连贯性及多学科综合的服务能力',
-	}]
+	import {themeList} from "./utils.js";
+	
 	export default {
 		data() {
 			return {

+ 178 - 0
pages/creatingSituations/components/utils.js

@@ -0,0 +1,178 @@
+import {dateHandle} from "../../../utils/dateHandle.js";
+const {dateDiff} = dateHandle;
+/**
+ * 主题数据 
+ */
+export const themeList = [{
+		id: 0, 
+		title: '个案追踪', 
+		des: '评价诊疗服务的内涵质量以及对各种诊疗规范、临床路径等的执行力',
+	},{
+		id: 1, 
+		title: '系统追踪', 
+		des: '评价对各种质量与安全管理制度与流程的执行力、医院服务的连贯性及多学科综合的服务能力',
+}];
+// 查核计划里的数据
+export const checkPlanList = [
+		{id: 'week', value: 1, label: '每周', model: 7},
+		{id: 'month', value: 2, label: '每月', model: 30},
+		{id: 'twoMonth', value: 3, label: '每两月', model: 60},
+		{id: 'quarter', value: 4, label: '每季度', model: 90},
+		{id: 'halfAYear', value: 5, label: '每半年', model: 180},
+		{id: 'custom', value: 6, label: '天', model: null},
+	];
+/**
+ * 底部按钮数据
+ */
+export const normalBtnGroup = [
+	{id: 'pre', label: '上一步'},
+	{id: 'next', label: '下一步'}
+];
+export const btnGroupPlan1 = [
+	{id: 'pre', label: '上一步'},
+	{id: 'checkPlanCreate', label: '生成查核计划'}
+];
+export const btnGroupPlan2 = [
+	{id: 'checkPlanCallback', label: '返回'},
+	{id: 'next', label: '下一步'}
+];
+export const btnGroupSituationPreview = [
+	{id: 'pre', label: '上一步'},
+	{id: 'situationPreviewOK', label: '完成'}
+];
+/**
+ * 增加树形数据字段,以适配公共组件
+ * @param {Object} data
+ */
+export const conditionOptions = function(data) {
+	let options = data.map((item)=>{
+		return {
+			...item,
+			key: item.id,
+			label: item.name,
+			children: conditionOptions(item.child)
+		}
+	});
+	return options;
+}
+			
+/**
+ * 创建
+ * 构造条件提交结果
+ */
+export const optionsHandle = (arr, conditionIds) => {
+	let options = [...arr].map((item)=>{
+		return {
+			...item,
+			selectFlag: conditionIds.includes(item.id),
+			child: optionsHandle(item.child, conditionIds)
+		}
+	});
+	return options;
+}
+/**
+ * 构造查核组提交数据
+ */
+export const checkGroup = function({list, checkedItem}) {
+	let _list = [...list].map((ntem)=>{
+		return {
+			...ntem,
+			selectFlag: ntem.id === checkedItem.id ? true : false
+		}
+	});
+	return _list;
+}
+/**
+ * 构造查核地图提交数据
+ */
+export const checkDep = function(list) {
+	return list.map((item, i)=>{
+		return {
+			...item,
+			sort: i+1,
+			enableFlag: item.status === 'disable' ? false : true,
+		}
+	});
+}
+
+/**
+ * 编辑
+ * 条件树遍历,获取选中项的id
+ */
+export const initConditionIds = (arr, result) => {
+	arr.map((item)=>{
+		if(item.selectFlag || item.selectFlag === 'true') {
+			result.push(item.id);
+		}
+		if(item.child && item.child.length > 0) {
+			initConditionIds(item.child, result);
+		}
+	})
+}
+
+// 构造条件回显数据
+export const editCondition = ({depType, filterCondition})=>{
+	let conditionIds = [];
+	initConditionIds(filterCondition, conditionIds);
+	return {
+		depType, // 门急诊类型 1-门诊 2-急诊
+		conditionIds, // 选中的key
+		options: conditionOptions(filterCondition), // 树形节点数据
+		defaultOpen: filterCondition.length > 0 ? [filterCondition[0].id]:[], // 默认展开的项
+	}
+}
+// 构造查核组回显数据
+export const editCheckRent = ({checkGroup}) =>{
+	let obj = checkGroup.find((item)=>item.selectFlag || item.selectFlag === 'true');
+	return { // 查核组页面数据 
+		list: checkGroup,
+		checkedItem: obj ? obj : {id: null}
+	}
+}
+// 查核地图数据
+export const editCheckMap = ({checkDep}) =>{
+	return { // 查核地图数据
+		list: checkDep.map((item)=>{
+			return {
+				...item,
+				status: 'normal'
+			}
+		}), // 列表数据
+		actionItem: {id: '', pointList: []}, // 当前操作的列表项
+		deptList: [], // 新增单位数据
+	}
+}
+// 查核计划数据
+export const editCheckPlan = ({planConfig, planList}) =>{
+	let checkedItem = checkPlanList.find((item)=>item.value === planConfig.frequency);
+	return { // 查核计划
+		checkedItem: checkedItem?checkedItem: {id: 'month', value: 2, label: '每月', model: 30}, // 选中的取模方式对象
+		dateObj: { // 保存开始日期结束日期的对象
+			start: planConfig.startDate,
+			end: planConfig.endDate,
+			dayNum: dateDiff(planConfig.startDat, planConfig.endDate) // 两个日期间隔的天数
+		}, 
+		checkList: planList.map((item)=>{
+			return item.startDate
+		}), // 核查计划数组
+	}
+}
+// 预览数据
+export const editSituationPreview = ({name, remindPlanDay,remindPlanHour,remindCheckDay}) => {
+	return {
+		sitName: name,
+		preDay: remindPlanDay,
+		preH: remindPlanHour,
+		startDay: remindCheckDay
+	}
+} 
+// 判断两个数组全等
+export const arrayEquality = (arr1,arr2) =>{
+	let flage = true;
+	arr1.map((item, i)=>{
+		if(item !== arr2[i]){
+			flage = false;
+		}
+	});
+	return flage;
+}

+ 62 - 57
pages/creatingSituations/creatingSituations.vue

@@ -22,27 +22,26 @@
 	import checkMapAdd from "./components/checkMapAdd.vue";
 	import checkPlan from "./components/checkPlan.vue";
 	import situationPreview from "./components/situationPreview.vue";
-	
-	const normalBtnGroup = [
-		{id: 'pre', label: '上一步'},
-		{id: 'next', label: '下一步'}
-	];
-	const btnGroupPlan1 = [
-		{id: 'pre', label: '上一步'},
-		{id: 'checkPlanCreate', label: '生成查核计划'}
-	];
-	const btnGroupPlan2 = [
-		{id: 'checkPlanCallback', label: '返回'},
-		{id: 'next', label: '下一步'}
-	];
-	const btnGroupSituationPreview = [
-		{id: 'pre', label: '上一步'},
-		{id: 'situationPreviewOK', label: '完成'}
-	];
+	import {
+		themeList,
+		normalBtnGroup,
+		btnGroupPlan1,
+		btnGroupPlan2,
+		btnGroupSituationPreview,
+		optionsHandle,
+		checkDep,
+		checkGroup,
+		editCondition,
+		editCheckRent,
+		editCheckMap,
+		editCheckPlan,
+		editSituationPreview
+	} from "./components/utils.js";
 	
 	export default {
 		data() {
 			return {
+				saveType: 'POST',
 				options: [
 					{id: 'theme', title: '主题', component: theme},
 					{id: 'condition', title: '条件', component: condition, hint: '追踪条件'},
@@ -80,20 +79,59 @@
 				}
 			}
 		},
+		onLoad:function({id,type}){
+			this.saveType = type ? type : 'POST';
+			if(id) {
+				this.dispatch('detialConfig',{id}).then((data)=>{
+					if(data) {
+						const {topic} = data;
+						let theme = themeList[Number(topic)],
+							condition = editCondition(data),
+							editConfig = {};
+						this.myCommit('theme', theme); // 主题
+						if(type === 'PUT') { // 编辑
+							let checkRent = editCheckRent(data),
+							checkMap = editCheckMap(data),
+							checkPlan = editCheckPlan(data),
+							situationPreview = editSituationPreview(data);
+							this.myCommit('checkPlan', checkPlan); // 查核计划
+							this.myCommit('situationPreview', situationPreview); // 预览
+							editConfig = {
+								theme, 
+								condition, 
+								checkRent, 
+								checkMap,
+								checkPlan,
+								situationPreview
+							};
+						} else { // 复制创建
+							this.myCommit('condition', condition); // 条件
+							editConfig = {
+								theme, 
+								condition, 
+							};
+						}
+						this.myCommit('editConfig', editConfig); 
+						// 回到第一步或者第三步
+						this.myCommit('stepActive', type === 'PUT' ? 0 : 2); 
+					}
+				});
+			}
+		},
 		methods: {
 			save: function() {
 				const {sitName,preDay,preH,startDay} = this.situationPreview;
 				const {dateObj,checkedItem,checkList} = this.checkPlan;
-				const {depType, options} = this.condition;
-				if(!sitName) {
+				const {depType, options, conditionIds} = this.condition;
+				if(!sitName || sitName.length < 2) {
 					uni.showModal({
 						title: '温馨提示',
-						content: `情境名称不能为空!`,
+						content: `情境名称不能为空也不能少于2个字!`,
 						showCancel: false
 					});
 					return;
 				}
-				this.dispatch('save', {
+				this.dispatch(`save${this.saveType}`, {
 					name: sitName,
 					topic: this.theme.id,
 					checkPlanStartDate: dateObj.start,
@@ -102,9 +140,9 @@
 					remindPlanHour: preH,
 					remindCheckDay: startDay,
 					depType,
-					filterCondition: this.optionsHandle(options),
-					checkGroup: this.checkGroup(),
-					checkDep: this.checkDep(),
+					filterCondition: optionsHandle(options, conditionIds),
+					checkGroup: checkGroup(this.checkRent),
+					checkDep: checkDep(this.checkMap.list),
 					planConfig: {
 						frequency: checkedItem.value,
 						day: checkedItem.model,
@@ -193,39 +231,6 @@
 					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});
 			},

+ 3 - 2
pages/creatingSituations/model.js

@@ -1,5 +1,5 @@
 import { commServer } from './server.js';
-	import {dateHandle} from "../../utils/dateHandle.js";
+import {dateHandle} from "../../utils/dateHandle.js";
 	
 export default {
   namespaced: true,
@@ -39,7 +39,8 @@ export default {
 			preDay: null,
 			preH: null,
 			startDay: null
-		}
+		},
+		editConfig: null // 编辑时候的原始数据
   },
   mutations: {
 		comChangeState(state, {key, data}) {

+ 12 - 1
pages/creatingSituations/server.js

@@ -29,10 +29,21 @@ const requestList = {
     url: 'situation/addDeptList',
   },
 	// 情境新增保存
-  save: {
+  savePOST: {
     method: 'POST',
     url: 'situation',
 		successMessage: '保存成功!'
+  },
+	// 情境新增保存
+  savePUT: {
+    method: 'PUT',
+    url: 'situation',
+		successMessage: '编辑成功!'
+  },
+	// 情境配置的明细(出参同创建入参)
+  detialConfig: {
+    method: 'GET',
+    url: 'situation/config',
   },
 };
 

+ 1 - 1
pages/mainPointsDetail/mainPointsDetail.vue

@@ -205,7 +205,7 @@
         + 增加一条记录
       </button>
     </scroll-view>
-    <button type="primary" class="sureDetail" @click="sureDetail">完成</button>
+    <button type="primary" class="sureDetail" @click="sureDetail" v-if="data.display?data.display:false">完成</button>
   </view>
 </template>
 

+ 25 - 14
pages/messages/messages.vue

@@ -14,13 +14,13 @@
         <view class="imgView">
           <image
             :src="
-              item.businessType == 1
+              item.businessType == 1 || item.businessType == 3
                 ? item.readStatus
                   ? '/static/orange-read.png'
                   : '/static/orange-noRead.png'
                 : item.readStatus
-                  ? '/static/green-read.png'
-                  : '/static/green-noRead.png'
+                ? '/static/green-read.png'
+                : '/static/green-noRead.png'
             "
           ></image>
         </view>
@@ -65,7 +65,8 @@ export default {
   methods: {
     getMessList() {
       var currPage = this.currentPage + 1;
-      this.$store.dispatch({
+      this.$store
+        .dispatch({
           type: "messages/commActions",
           payload: {
             key: "messagesList",
@@ -98,7 +99,8 @@ export default {
       }
     },
     toDetail(data) {
-      this.$store.dispatch({
+      this.$store
+        .dispatch({
           type: "messages/commActions",
           payload: {
             key: "toRead",
@@ -108,19 +110,28 @@ export default {
           },
         })
         .then((res) => {
-          if (data.businessType == 1) {
+          if (data.businessType == 2) {
+            //改善任务
             uni.navigateTo({
               url: `/pages/mission-details/mission-details?taskId=${data.businessId}`,
             });
-          } else if (data.businessType == 2) {
-			  uni.setStorageSync('situaionID', data.businessId);
+          } else if (data.businessType == 1) {
+            //查核计划 跳情景详情
+            uni.setStorageSync("situaionID", data.businessId);
             uni.navigateTo({
-              url: `/pages/situationDetail/situationDetail`,
+              url: `/pages/situationDetail/situationDetail?situationId=${data.businessId}`,
+            });
+          } else {
+            //情景详情
+            uni.setStorageSync("situaionID", data.businessId);
+            uni.navigateTo({
+              url: `/pages/situationDetail/situationDetail?situationId=${data.businessId}`,
             });
           }
           this.MessList = [];
           for (let i = 1; i < this.currentPage + 1; i++) {
-            this.$store.dispatch({
+            this.$store
+              .dispatch({
                 type: "messages/commActions",
                 payload: {
                   key: "messagesList",
@@ -162,12 +173,12 @@ export default {
       width: 56.25rpx;
       height: 56.25rpx;
       vertical-align: top;
-      .image-circle {
-        background-color: ;
-      }
+      // .image-circle {
+      //   background-color: ;
+      // }
       image {
         width: 56.25rpx;
-        height: 90px;
+        height: 56.25rpx;
       }
     }
     .contView {

+ 29 - 17
pages/situationDetail/situationDetail.vue

@@ -1,5 +1,8 @@
 <template>
 	<view class="detail-page">
+		<tm-top-menu>
+			<button class="copy-btn" @click="editSituation('POST')">复制创建</button>
+		</tm-top-menu>
 		<view class="content-info">
 			<view class="top-box">
 				<view class="subscript">
@@ -39,7 +42,7 @@
 			<view class="btn-left" @click="delSituation" v-show="isAdmin">
 				<text class="left-text">作废</text>
 			</view>
-			<view class="btn-right" @click="editSituation" v-show="isAdmin">
+			<view class="btn-right" @click="editSituation('PUT')" v-show="isAdmin">
 				<text class="right-text">编辑</text>
 			</view>
 			<view class="btn-center" v-show="isChecker" @click="startUnplanned">
@@ -84,7 +87,6 @@
 				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
         checkItemList:[],//时间区间包含当前时间的item
         checkGroupId: 0 // 查核组id
-
 			}
 		},
 		onLoad({ situationId }){ // situationId:情景id
@@ -155,19 +157,21 @@
 				})
 
 			},
-			editSituation(){
-				let editEnable=this.compareTime(this.firstCheckTime);
-				if(editEnable){
-					uni.navigateTo({
-						url: '/pages/creatingSituations/creatingSituations'
-					});
-				}
-				else{
-					uni.showModal({
-						title:'提示',
-						content:'已进行过一次查核,不可编辑',
-					  showCancel:false
-					})
+			editSituation(type){
+				let url=`/pages/creatingSituations/creatingSituations?id=${this.situationID}&type=${type}`;
+				if(type === 'PUT') {
+					let editEnable=this.compareTime(this.firstCheckTime);
+					// if(editEnable){
+						uni.navigateTo({url});
+					// } else{
+					// 	uni.showModal({
+					// 		title:'提示',
+					// 		content:'已进行过一次查核,不可编辑',
+					// 	  showCancel:false
+					// 	})
+					// }
+				} else {
+					uni.navigateTo({url});
 				}
 			},
 			compareTime(time){
@@ -250,6 +254,14 @@
 
 <style lang="less">
 	.detail-page{
+		margin-top: 50rpx;
+		.copy-btn {
+			border: 0;
+			height: 50rpx;
+			&::after {
+				border: 0;
+			}
+		}
 		.content-info{
 			background-color: #FFFFFF;
 			.top-box{
@@ -437,8 +449,8 @@
 		.button-box{
 			width: 750rpx;
 			height: 75rpx;
-			position: absolute;
-			bottom: 0rpx;
+			position: fixed;
+			bottom: 0;
 			.btn-center{
 				background: #3377FF;
 				text-align: center;

+ 214 - 183
pages/todayCheck/todayCheck.vue

@@ -1,191 +1,222 @@
 <template>
-	<view class="todayCheckPage">
-		<view class="content" v-for="item in list">
-			<view class="contTitle">
-				<text class="contTitleLeft">{{item.situationName}}</text>
-				<text class="contTitleRight">{{item.checkPlan}}</text>
-			</view>
-			<view class="contCon">
-				<view v-for="items in item.planDepListReps" class="conEveryCon" @click="goToPonitDetails(items)">
-					<view class="title">
-						<view class="name">{{items.deptName}}</view>	
-						<view class="buMen">
-							<image src="../../static/icon-map-dis.png" mode="" class="img"></image>
-							<view class="keshi">{{items.deptClassName}}</view>
-						</view>
-					</view>
-					<view class="status" >
-						<image :src="items.completeDes == '完成'?'../../static/top-img.png':items.completeDes == '查核中'?'../../static/hight-bg.png':'../../static/disabled-bg.png'" mode="" class="bgImg"></image>
-						<text class="statusType">{{items.completeDes}}</text>
-					</view>
-					<view class="points">{{items.decs}}</view>
-					<view class="pointsGK">要点概括:{{items.checkPointNames}}</view>
-					<view>
-						<view class="checkName">{{items.empName}}</view>
-						<view class="checkTime">{{items.startDate}}~{{items.endDate}}</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+  <view class="todayCheckPage">
+    <view class="content" v-for="item in list">
+      <view class="contTitle">
+        <text class="contTitleLeft">{{ item.situationName }}</text>
+        <text class="contTitleRight">{{ item.checkPlan }}</text>
+      </view>
+      <view class="contCon">
+        <view
+          v-for="items in item.planDepListReps"
+          class="conEveryCon"
+          @click="goToPonitDetails(items)"
+        >
+          <view class="title">
+            <view class="name">{{ items.deptName }}</view>
+            <view class="buMen">
+              <image
+                src="../../static/icon-map-dis.png"
+                mode=""
+                class="img"
+              ></image>
+              <view class="keshi">{{ items.deptClassName }}</view>
+            </view>
+          </view>
+          <view class="status">
+            <image
+              :src="
+                items.completeDes == '已完成'
+                  ? '../../static/top-img.png'
+                  : items.completeDes == '查核中'
+                  ? '../../static/hight-bg.png'
+                  : '../../static/disabled-bg.png'
+              "
+              mode=""
+              class="bgImg"
+            ></image>
+            <text class="statusType">{{ items.completeDes }}</text>
+          </view>
+          <view class="points">{{ items.decs }}</view>
+          <view class="pointsGK">要点概括:{{ items.checkPointNames }}</view>
+          <view>
+            <view class="checkName">{{ items.empName }}</view>
+            <view class="checkTime"
+              >{{ items.startDate }}~{{ items.endDate }}</view
+            >
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-		  return {
-			  list:[],
-			  date:'',
-		  }
-		},
-		mounted() {
-			this.getList();
-			
-		},
-		methods:{
-			getList(){
-				this.$store.dispatch({
-					type: "todayCheck/commActions",
-					payload: {
-					  key: "specificCheckTaskList",
-					  data: {
-					    specificDate:this.date
-					  },
-					},
-				}).then((res)=>{
-					if(res){
-						this.list =res;
-					}
-				})
-			},
-			goToPonitDetails(data){
-				// console.log(data)
-				// uni.navigateTo({
-				//   url: `/pages/messages/messages?id=${data.checkId}`,
-				// });
-			}
-		},
-		onLoad({ date }){
-		  this.date = date;
-		},
-	}
+export default {
+  data() {
+    return {
+      list: [],
+      date: "",
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.$store
+        .dispatch({
+          type: "todayCheck/commActions",
+          payload: {
+            key: "specificCheckTaskList",
+            data: {
+              specificDate: this.date,
+            },
+          },
+        })
+        .then((res) => {
+          if (res) {
+            this.list = res;
+          }
+        });
+    },
+    goToPonitDetails(data) {
+      // console.log(data)
+      uni.navigateTo({
+        url: `/pages/checkMainPoints/checkMainPoints?checkId=${data.checkId}&deptId=${data.deptId}`,
+      });
+    },
+  },
+  onLoad({ date }) {
+    this.date = date;
+  },
+};
 </script>
 
 <style lang="less">
-	.todayCheckPage{
-		padding:0rpx 25rpx;
-		height: 100%;
-		width: 100%;
-		.content{
-			width: 100%;
-			.contTitle{
-				font-size: 22.5rpx;
-				color: #666F80;
-				height: 22.5rpx;
-				line-height: 22.5rpx;
-				margin: 25rpx 0rpx 15rpx;
-				.contTitleLeft{
-					display: inline-block;
-					width: 50%;
-					text-align: left;
-				}
-				.contTitleRight{
-					display: inline-block;
-					width: 50%;
-					text-align: right;
-				}
-			}
-			.contCon{
-				.conEveryCon{
-					margin-bottom: 25rpx;
-					padding:25rpx 25rpx 0rpx;
-					background-color: #fff;
-					height: 225rpx;
-					border-radius: 5rpx;
-					position: relative;
-					.title{
-						margin-bottom: 10rpx;
-						color: #292C33;
-						// vertical-align: top;
-						.name{
-							height: 35rpx;
-							display: inline-block;
-							font-size: 35rpx;
-							font-weight: 400;
-						}
-						.buMen{
-							margin-left: 20rpx;
-							display: inline-block;
-							// width: 117.5rpx;
-							height: 35rpx;
-							background-color: #EDF2FA;
-							border-radius: 17.5rpx;
-							line-height: 82.5rpx;
-							vertical-align: top;
-							.img{
-								vertical-align: top;
-								width: 35rpx;
-								height: 35rpx;
-							}
-							.keshi{
-								margin-left: 10rpx;
-								margin-right: 20rpx;
-								display: inline-block;
-								vertical-align: top;
-								font-size: 17.5rpx;
-								line-height: 35rpx;
-							}
-						}
-					}
-					.status{
-						width: 100rpx;
-						height: 35rpx;
-						position: absolute;
-						top: 0rpx;
-						right: 0rpx;
-						.bgImg{
-							width: 100rpx;
-							height: 35rpx;
-						}
-						.statusType{
-							position: absolute;
-							top:8.75rpx;
-							right:18.75rpx;
-							font-size: 17.5rpx;
-							line-height: 17.5rpx;
-							color: #fff;
-						}
-					}
-					.points{
-						font-size: 20rpx;
-						color: #292C33;
-						line-height: 50rpx;
-						font-weight: bold;
-					}
-					.pointsGK{
-						padding-bottom: 25rpx;
-						border-bottom: 0.62rpx solid #DADEE6;
-						font-size: 20rpx;
-						color: #666F80;
-					}
-					.checkName{
-						width: 50%;
-						display: inline-block;
-						color: #666E80;
-						text-align: left;
-						line-height: 57.5rpx;
-						font-size: 17.5rpx;
-					}
-					.checkTime{
-						width: 50%;
-						display: inline-block;
-						color: #666E80;
-						text-align: right;
-						line-height: 57.5rpx;
-						font-size: 17.5rpx;
-					}
-				}
-			}
-		}
-	}
+.todayCheckPage {
+  padding: 0rpx 25rpx;
+  height: 100%;
+  width: 100%;
+  .content {
+    width: 100%;
+    .contTitle {
+      font-size: 22.5rpx;
+      color: #666f80;
+      height: 22.5rpx;
+      line-height: 22.5rpx;
+      margin: 25rpx 0rpx 15rpx;
+      .contTitleLeft {
+        display: inline-block;
+        width: 60%;
+        text-align: left;
+      }
+      .contTitleRight {
+        display: inline-block;
+        width: 40%;
+        text-align: right;
+      }
+    }
+    .contCon {
+      .conEveryCon {
+        margin-bottom: 25rpx;
+        padding: 25rpx 25rpx 0rpx;
+        background-color: #fff;
+        height: 225rpx;
+        border-radius: 5rpx;
+        position: relative;
+        .title {
+          margin-bottom: 10rpx;
+          color: #292c33;
+          // vertical-align: top;
+          .name {
+            height: 35rpx;
+            display: inline-block;
+            font-size: 35rpx;
+            font-weight: 400;
+          }
+          .buMen {
+            margin-left: 20rpx;
+            display: inline-block;
+            // width: 117.5rpx;
+            height: 35rpx;
+            background-color: #edf2fa;
+            border-radius: 17.5rpx;
+            line-height: 82.5rpx;
+            vertical-align: top;
+            .img {
+              vertical-align: top;
+              width: 35rpx;
+              height: 35rpx;
+            }
+            .keshi {
+              margin-left: 10rpx;
+              margin-right: 20rpx;
+              display: inline-block;
+              vertical-align: top;
+              font-size: 17.5rpx;
+              line-height: 35rpx;
+            }
+          }
+        }
+        .status {
+          width: 100rpx;
+          height: 35rpx;
+          position: absolute;
+          top: 0rpx;
+          right: 0rpx;
+          .bgImg {
+            width: 100rpx;
+            height: 35rpx;
+          }
+          .statusType {
+            width: 100%;
+            position: absolute;
+            top: 8.75rpx;
+            right: 0rpx;
+            font-size: 17.5rpx;
+            line-height: 17.5rpx;
+            color: #fff;
+            text-align: center;
+          }
+        }
+        .points {
+          font-size: 20rpx;
+          color: #292c33;
+          line-height: 50rpx;
+          font-weight: bold;
+        }
+        .pointsGK {
+          padding-bottom: 25rpx;
+          border-bottom: 0.62rpx solid #dadee6;
+          font-size: 20rpx;
+          color: #666f80;
+        }
+        .checkName {
+          // padding-top: 20.62rpx;
+          // width: 22%;
+          display: inline-block;
+          color: #666e80;
+          text-align: left;
+          line-height: 17.5rpx;
+          font-size: 17.5rpx;
+          position: absolute;
+          left: 25rpx;
+          bottom: 21.25rpx;
+        }
+        .checkTime {
+          // padding-top: 20.62rpx;
+          // width: 78%;
+          display: inline-block;
+          color: #666e80;
+          text-align: right;
+          line-height: 17.5rpx;
+          font-size: 17.5rpx;
+          position: absolute;
+          right: 25rpx;
+          bottom: 21.25rpx;
+        }
+      }
+    }
+  }
+}
 </style>

+ 12 - 0
yarn.lock

@@ -12,11 +12,23 @@ moment@^2.29.1:
   resolved "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
   integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
 
+ometa@0.2.2:
+  version "0.2.2"
+  resolved "https://registry.npm.taobao.org/ometa/download/ometa-0.2.2.tgz#f53c4735ba6d56af5a46b04dfb7c4334c596d44e"
+  integrity sha1-9TxHNbptVq9aRrBN+3xDNMWW1E4=
+
 qs@^6.9.6:
   version "6.9.6"
   resolved "https://registry.npm.taobao.org/qs/download/qs-6.9.6.tgz?cache=0&sync_timestamp=1610598111557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee"
   integrity sha1-Ju08gkOkMbKSSsqEzJBHHzXVoO4=
 
+scss@^0.2.4:
+  version "0.2.4"
+  resolved "https://registry.npm.taobao.org/scss/download/scss-0.2.4.tgz#040d903ed37c5d4fa4ad33ae1fd389ac12a4e065"
+  integrity sha1-BA2QPtN8XU+krTOuH9OJrBKk4GU=
+  dependencies:
+    ometa "0.2.2"
+
 vuex@^3.6.0:
   version "3.6.2"
   resolved "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz?cache=0&sync_timestamp=1611672210051&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"