Explorar o código

个人中心页面

“yst %!s(int64=4) %!d(string=hai) anos
pai
achega
c443dcbd1c

+ 49 - 58
components/tm-tabbar/tm-tabbar.vue

@@ -1,14 +1,14 @@
 <template>
 	<view class="tm-tabbar">
 		<template v-for="item in rolToTabBars">
-			<view 
-			  :class="{'tab-item': true, active: item.pagePath === currentPagePath}" 
-			 :key="item.text"
-			 @click="navigateTo(item.pagePath)" >
-				<image 
-				  class="icon" 
-				  :src="item.pagePath === currentPagePath 
-					  ? item.selectedIconPath 
+			<view
+			  :class="{'tab-item': true, active: item.pagePath === currentPagePath}"
+			  :key="item.text"
+			  @click="navigateTo(item.pagePath)" >
+				<image
+				  class="icon"
+				  :src="item.pagePath === currentPagePath
+					  ? item.selectedIconPath
 						: item.iconPath"
 				></image>
 				<text>{{ item.text }}</text>
@@ -22,22 +22,12 @@
 	 * 底部tabBar
 	 * 芦荟
 	 * 2021.2.1
-	 * props: {
-		 * permission:对应的角色(权限)(1、管理员 2、查核组长 3、查核组员 4、单位负责人 5、改善者)
-		 * }
 	 */
 	export default {
-		props: {
-			// 对应的角色(权限)(1、管理员 2、查核组长 3、查核组员 4、单位负责人 5、改善者)
-			permission: {
-				type: Number,
-				default: () => 0
-			}
-		},
 		data() {
 			return {
 				// 当前路由地址
-				currentPagePath: '', 
+				currentPagePath: '',
 				// tabbar列表(这是最全的)
 				tabBarList: [
 					{
@@ -46,24 +36,24 @@
 						selectedIconPath: '/static/tabbar/creatingSituations-select.png', // 选中时的图片路径
 						pagePath: 'pages/creatingSituations/creatingSituations' // 页面路径
 					},{
-						text: '任务', 
-						iconPath: '/static/tabbar/mission-unselect.png', 
-						selectedIconPath: '/static/tabbar/mission-select.png', 
+						text: '任务',
+						iconPath: '/static/tabbar/mission-unselect.png',
+						selectedIconPath: '/static/tabbar/mission-select.png',
 						pagePath: 'pages/mission/mission'
 					},{
-						text: '配置', 
-						iconPath: '/static/tabbar/setting-unselect.png', 
-						selectedIconPath: '/static/tabbar/setting-select.png', 
+						text: '配置',
+						iconPath: '/static/tabbar/setting-unselect.png',
+						selectedIconPath: '/static/tabbar/setting-select.png',
 						pagePath: 'pages/configure/configure'
 					},{
-						text: '我的', 
-						iconPath: '/static/tabbar/my-unselect.png', 
-						selectedIconPath: '/static/tabbar/my-select.png', 
+						text: '我的',
+						iconPath: '/static/tabbar/my-unselect.png',
+						selectedIconPath: '/static/tabbar/my-select.png',
 						pagePath: 'pages/home/home'
 					},{
-						text: '日历', 
-						iconPath: '/static/tabbar/calendar-unselect.png', 
-						selectedIconPath: '/static/tabbar/calendar-select.png', 
+						text: '日历',
+						iconPath: '/static/tabbar/calendar-unselect.png',
+						selectedIconPath: '/static/tabbar/calendar-select.png',
 						pagePath: 'pages/index/index'
 					}
 				],
@@ -74,31 +64,12 @@
 					{permission: 3, name: '查核组员', tabBarIndexs: [0, 4, 3]},
 					{permission: 4, name: '单位负责人', tabBarIndexs: [0, 1, 3]},
 					{permission: 5, name: '改善者', tabBarIndexs: [1, 3]}
-				]
-			}
-		},
-		computed:{
-			rolToTabBars() {
-				if(this.permission == 0) {
-					return []
-				}else {
-					let current = this.rolList.find(item => item.permission == this.permission) || {};
-					if(current){
-						let tabBars = [];
-					  current.tabBarIndexs.map(index => {
-							tabBars.push(this.tabBarList[index]);
-						});
-						return tabBars;
-					}else {
-						return [];
-					}
-					return []
-				}
+        ],
+        rolToTabBars: [],
 			}
 		},
 		created(){
-			let routes = getCurrentPages()
-      this.currentPagePath = routes[routes.length - 1].route;
+      this.getRolToTabBars();
 		},
 		methods: {
 			// 路由跳转
@@ -107,6 +78,26 @@
 				uni.navigateTo({
 				  url: `/${pagePath}`
 				});
+      },
+      // 获取权限对应的地步导航
+    	getRolToTabBars() {
+        const permission = uni.getStorageSync('nowPermission');
+				if(!permission) {
+					this.rolToTabBars = [];
+				}else {
+          let current = this.rolList.find(item => item.permission == permission) || {};
+					if(current){
+						let tabBars = [];
+					  current.tabBarIndexs.map(index => {
+							tabBars.push(this.tabBarList[index]);
+            });
+            this.rolToTabBars = tabBars;
+					}else {
+						this.rolToTabBars = [];
+					}
+        }
+        let routes = getCurrentPages();
+        this.currentPagePath = routes[routes.length - 1].route;
 			}
 		}
 	}
@@ -118,30 +109,30 @@
 		left: 0;
 		bottom: 0;
 		display: flex;
-		width: 100%; 
+		width: 100%;
 		height: 87.5rpx;
 		border-top: 0.62rpx solid #DADEE6;
 		background-color: #fff;
-		
+
 		.tab-item {
 			display: flex;
 			flex-direction: column;
 			justify-content: center;
 			align-items: center;
 			flex: 1;
-			
+
 			.icon {
 				margin-bottom: 10rpx;
 				width: 27.5rpx;
 				height: 28.75rpx;
 			}
-			
+
 			>text {
 				font-size: 15rpx;
 				color: #3D424D;
 			}
 		}
-		
+
 		.active.tab-item {
 			>text {
 				color: #3377FF;

+ 4 - 3
components/tm-upload-img/tm-upload-img.vue

@@ -109,13 +109,13 @@
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
-			flex: 1;
+			// flex: 1;
 			padding-right: 25rpx;
 
 			.label-view {
 				width: 175rpx;
-				line-height: 37.5rpx;
-				padding: 25rpx 0;
+				line-height: 22.5rpx;
+				padding: 31.25rpx 0;
 
 				text {
 					font-size: 22.5rpx;
@@ -125,6 +125,7 @@
 
 			.placeholder {
 				position: absolute;
+				top: 31.25rpx;
 				left: 175rpx;
 				font-size: 22.5rpx;
 				color: #B8BECC;

+ 0 - 1
main.js

@@ -4,7 +4,6 @@ import { store } from './store/index.js';
 import dateTimePickGroup from './components/date-time-pick-group/date-time-pick-group.vue';
 import dateTimePick from './components/date-time-pick/date-time-pick.vue';
 import row from "./components/tm-trees/row.vue";
-
 Vue.config.productionTip = false;
 Vue.prototype.$store = store;
 Vue.component('com-date-pick-group', dateTimePickGroup);

+ 12 - 0
pages.json

@@ -52,6 +52,7 @@
                 "enablePullDownRefresh": false
             }
             
+<<<<<<< HEAD
         }
         ,{
             "path" : "pages/role-switching/role-switching",
@@ -62,6 +63,17 @@
             }
             
         }
+=======
+        },
+		{
+		    "path" : "pages/messages/messages",
+		    "style" : {
+		        "navigationBarTitleText": "消息中心",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+>>>>>>> 9ffbc6f6836be68303111dee85ddba6607d8ea09
     ],
 	"globalStyle": {
 		"navigationStyle": "custom",

+ 9 - 6
pages/configure/configure.vue

@@ -29,7 +29,7 @@
     <view class="sure-button">
       <button @click="sureList">保存</button>
     </view>
-    <tm-tabbar :permission="1" />
+    <tm-tabbar />
   </view>
 </template>
 
@@ -55,7 +55,7 @@ export default {
       showPopup: false,
       radioVal: null,
       index: null,
-	  timer:null,
+      timer: null,
     };
   },
   created() {
@@ -64,7 +64,8 @@ export default {
   methods: {
     //获取最新配置
     getResultConfig() {
-      this.$store.dispatch({
+      this.$store
+        .dispatch({
           type: "configure/commActions",
           payload: {
             key: "getResultConfig",
@@ -76,7 +77,8 @@ export default {
     },
     //恢复最初配置
     recoveryList() {
-      this.$store.dispatch({
+      this.$store
+        .dispatch({
           type: "configure/commActions",
           payload: {
             key: "getDefault",
@@ -88,7 +90,8 @@ export default {
     },
     //保存配置
     sureList() {
-      this.$store.dispatch({
+      this.$store
+        .dispatch({
           type: "configure/commActions",
           payload: {
             key: "postResultConfig",
@@ -99,7 +102,7 @@ export default {
         })
         .then(() => {
           this.getResultConfig();
-		  clearTimeout(this.timer)
+          clearTimeout(this.timer);
         });
     },
     showConfig() {

+ 3 - 3
pages/configure/server.js

@@ -4,17 +4,17 @@ const requestList = {
 	// 保存配置
 	postResultConfig: {
 		method: 'POST',
-		url: 'imed/pfm/resultConfig'
+		url: 'resultConfig'
 	},
 	//最新配置
 	getResultConfig:{
 		method: 'GET',
-		url: 'imed/pfm/resultConfig'
+		url: 'resultConfig'
 	},
 	//默认配置列表
 	getDefault:{
 		method: 'GET',
-		url: 'imed/pfm/resultConfig/default'
+		url: 'resultConfig/default'
 	}
 	
 };

+ 4 - 0
pages/home/home.vue

@@ -47,10 +47,14 @@
 				</view> -->
 			</view>
 		</view>
+<<<<<<< HEAD
 		<view class="logout-box" @click="logOut">
 			<text class="logout-text">退出登录</text>
 		</view>
 		<tm-tabbar :permission="nowPermission" />
+=======
+		<tm-tabbar />
+>>>>>>> 9ffbc6f6836be68303111dee85ddba6607d8ea09
 	</view>
 </template>
 

+ 177 - 0
pages/messages/messages.vue

@@ -0,0 +1,177 @@
+<template>
+	<view class="messages-page">
+		<view class="contBody" @touchend="touchend" :style="MessList.length <= 8 ? {height:'calc(100% - 30rpx)'} : {}">
+			<view v-for="(item,index) in MessList" :key="index" class="messages-content" @click="toDetail(item)">
+				<view class="imgView">
+					<image :src="item.businessType == 1 ? (item.readStatus ? '/static/橙色已读.png' : '/static/橙色未读.png') : (item.readStatus ? '/static/绿色已读.png' : '/static/绿色未读.png')"></image>
+				</view>
+				<view class="contView">
+					<view class="contView-title">
+						{{item.title}}
+					</view>
+					<view class="contView-content">
+						{{item.content}}
+					</view>
+					<view class="contView-time">
+						{{item.effectTime}}
+					</view>
+				</view>
+			</view>
+			<view class="bottomPanDuan"></view>
+		</view>
+		
+		<view class="bottomTishi">
+			<view v-if="loading">
+				向上滑动加载更多!
+			</view>
+			<view v-else>
+				已经到底了~
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import moment from 'moment';
+	export default {
+		data() {
+			return {
+				pageNum: 1,
+				pageSize: 10,
+				MessList: [],
+				loading: false,
+				currentPage: 0,
+				totalPage: 0,
+			}
+		},
+		mounted() {
+		  this.getMessList();
+		},
+		methods:{
+			getMessList(){
+				var currPage = this.currentPage + 1;
+				this.$store.dispatch({
+					type: "messages/commActions",
+					payload: {
+					  key: "messagesList",
+					  data: {
+						  pageNum: currPage,
+						  pageSize: this.pageSize,
+					  }
+					},
+				}).then(res=>{
+					this.totalPage = res.totalPage;
+					res.list.map((item)=>{
+						item.effectTime = moment(item.effectTime).format('MM-DD hh:mm')
+					})
+					//获取当前页码
+					this.currentPage = res.pageNum;
+					//当前页码与总页码进行比对
+					this.loading = this.currentPage < this.totalPage;
+					//将获得的数据拼接当前渲染数据中
+					this.MessList = this.MessList.concat(res.list);
+				})
+			},
+			touchend(){
+				if(this.currentPage < this.totalPage){
+					var box = document.getElementsByClassName('bottomPanDuan')[0];
+					var pos = box.getBoundingClientRect();
+					if(pos.bottom<=document.documentElement.clientHeight){
+						this.getMessList();
+					}
+				}
+				
+			},
+			toDetail(data){
+				this.$store.dispatch({
+					type: "messages/commActions",
+					payload: {
+					  key: "toRead",
+					  data: {
+						  id:data.id
+					  }
+					},
+				}).then(res=>{
+					uni.navigateTo({
+					  url: '/pages/mission-details/mission-details'
+					});
+					this.MessList = [];
+					for(let i = 0 ; i < this.currentPage; i++){
+						this.$store.dispatch({
+							type: "messages/commActions",
+							payload: {
+							  key: "messagesList",
+							  data: {
+								  pageNum: i,
+								  pageSize: this.pageSize,
+							  }
+							},
+						}).then(res=>{
+							this.MessList = this.MessList.concat(res.list);
+						})
+					}
+				})
+			}
+			
+		},
+		computed:{
+		}
+	}
+</script>
+
+<style lang="less">
+	.messages-page{
+		padding-top: 15rpx;
+		height: 100%;
+		overflow-y: auto;
+		.messages-content{
+			display: flex;
+			background-color: #fff;
+			.imgView{
+				margin-top: 25rpx;
+				margin-left: 25rpx;
+				margin-right: 25rpx;
+				margin-bottom: 63.75rpx;
+				width: 56.25rpx;
+				height: 56.25rpx;
+				vertical-align: top;
+				.image-circle{
+					background-color: ;
+				}
+				image{
+					width: 56.25rpx;
+					height: 90px;
+				}
+			}
+			.contView{
+				flex: 1;
+				border-bottom: 0.62rpx solid #DADEE6;
+				.contView-title{
+					margin-top:25rpx ;
+					font-size: 22.5rpx;
+					font-weight: 500;
+					color: #292C33;
+				}
+				.contView-content{
+					margin:15rpx 0 20rpx;
+					font-size: 20rpx;
+					color: #525866;
+				}
+				.contView-time{
+					margin-bottom: 25rpx;
+					font-size: 17.5rpx;
+					color: #666E80;
+				}
+			}
+		}
+		.bottomTishi{
+			padding: 6.25rpx 0px;
+			width: 100%;
+			// position: absolute;
+			// bottom: 0rpx;
+			text-align: center;
+			font-size: 17.5rpx;
+			color: #525866;
+		}
+	}
+</style>

+ 14 - 0
pages/messages/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);
+	},
+  }
+}

+ 18 - 0
pages/messages/server.js

@@ -0,0 +1,18 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+  //获取分页列表
+  messagesList: {
+    method: 'GET',
+    url: 'notice/page'
+  },
+  //已读
+  toRead: {
+    method: 'GET',
+    url: 'notice/read'
+  },
+};
+export const commServer = ({ key, data }) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 78 - 34
pages/mission-action/components/pdca-components/do-and-check.vue

@@ -3,28 +3,46 @@
 		<view class="title">
 			<text>{{ title }}</text>
 		</view>
-		<view class="item-view">
-			<view class="top-action">
-				<text>改善确认(1)</text>
-				<text class="close-text">删除</text>
-			</view>
-			<view class="main">
-				<view class="row">
-					<view class="label-view">
-						<text>{{ label }}</text>
+		<template v-for="(item, i) in list">
+			<view class="item-view">
+				<view class="top-action">
+					<text>改善确认(1)</text>
+					<text class="blue-text">删除</text>
+				</view>
+				<view class="main">
+					<view class="row">
+						<view class="label-view">
+							<text>过程记录</text>
+						</view>
+						<view class="content">
+							<textarea class="textarea"
+						    :key="title"
+							  placeholder="请输入"
+								placeholder-style="color: #B8BECC"
+								:maxlength="-1"
+								auto-height
+							/>
+						</view>
 					</view>
-					<view class="content">
-						<textarea class="textarea"
-					    :key="title"
-						  placeholder="请输入"
-							placeholder-style="color: #B8BECC"
-							:maxlength="-1"
-							auto-height
-					    
-						/>
+					<view class="row row-heigth">
+						<view class="label-view">
+							<text>计划日期</text>
+						</view>
+						<view class="content">
+							<text>选择计划日期</text>
+						</view>
 					</view>
+					<tm-upload-img
+						:filePaths="['/static/img-icon.png', '/static/img-icon.png']"
+					/>
 				</view>
 			</view>
+		</template>
+		<view class="add-btn" @click="addRecord">
+			<text class="blue-text"> 
+			  <text class="big">+</text>
+			  增加一条记录
+			</text>
 		</view>
 	</view>
 </template>
@@ -37,12 +55,7 @@
 			title: {
         type: String,
         default: '执行过程记录(Do)'
-			},
-      // 多行文本框子标题
-			label: {
-        type: String,
-        default: '执行过程记录'
-      }
+			}
     },
     data() {
       return {
@@ -60,7 +73,11 @@
         }else {
           this.actionvalue = e.target.value;
         }
-      }
+      },
+			// 新增一条记录
+			addRecord() {
+				this.list = [...this.list, {gcjl: '', date: '', imgPath: '' }]
+			}
 		},
 	}
 </script>
@@ -80,6 +97,15 @@
 			}
 		}
 		
+		.blue-text {
+			font-size: 23.75rpx;
+			color: #3377FF !important;
+			
+			.big {
+				font-size: 28.75rpx;
+			}
+		}
+		
 		.item-view {
 			
 			.top-action {
@@ -95,24 +121,20 @@
 					font-size: 22.5rpx;
 					color: #666F80;
 				}
-				
-				.close-text {
-					font-size: 20rpx;
-					color: #3377FF;
-				}
 			}
 			
 			.main {
-				padding-left: 25rpx;
 				background-color: #fff;
 				
 				.row {
 					display: flex;
+					border-bottom: 0.62rpx solid #DADEE6;
+					padding-left: 25rpx;
 					
 					.label-view {
 						width: 175rpx;
-						line-height: 37.5rpx;
-						padding: 25rpx 0;
+						line-height: 22.5rpx;
+						padding: 31.25rpx 0;
 					
 						>text {
 							font-size: 22.5rpx;
@@ -128,14 +150,36 @@
 							width: 100%;
 							min-height: 200rpx;
 							padding: 0 25rpx;
-							line-height: 38.5rpx;
+							line-height: 38rpx;
 							font-size: 22.5rpx;
 							color: #525866;
 							box-sizing: border-box;
 						}
+						
+						>text {
+							font-size: 22.5rpx;
+							color: #B8BECC;
+						}
+					}
+				}
+				
+				.row-heigth {
+					
+					.label-view {
+						line-height: 22.5rpx;
+						padding: 31.25rpx 0;
 					}
 				}
 			}
 		}
+		
+		.add-btn {
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			height: 75rpx;
+			background-color: #fff;
+			border-top: 0.62rpx solid #DADEE6;
+		}
 	}
 </style>

+ 7 - 1
pages/mission-action/mission-action.vue

@@ -8,6 +8,7 @@
 </template>
 
 <script>
+  import { mapState } from "vuex";
 	import assignMission from './components/assign-mission.vue';
 	import disagree from './components/disagree.vue'
 	import personnel from './components/personnel.vue'
@@ -15,10 +16,15 @@
 	import pdca from './components/pdca.vue'
 
 	export default {
+    computed: {
+      ...mapState({
+        missionDetails: state => state.mission.missionDetails
+      })
+    },
 		data() {
 			return {
 				// 当前显示的组件
-				currentComponet: 'pdca',
+				currentComponet: 'write-back',
 				compoentList: [
 					{type: 1, name: '指派改善任务', component: 'assign-mission'},
 					{type: 2, name: '原因', component: 'disagree'},

+ 53 - 29
pages/mission-details/mission-details.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="mission-details-page">
 		<scroll-view class="scroll-y" scroll-y="true">
-			<list-item :isClose="true" />
+			<list-item :isDetails="true" :task="missionDetails" />
 			<view class="mission-plan">
 				<view class="label">
 					<text>改善进度</text>
@@ -10,8 +10,8 @@
 					<template v-for="(item, i) in list">
 						<view class="row" :key="i">
 							<view class="col">
-								<image 
-								  class="plan-icon" 
+								<image
+								  class="plan-icon"
 									:src="`/static/${i === list.length - 1 ? 'check-radio' : 'check-no'}.png`">
 								</image>
 								<view class="line" v-show="i != list.length -1"></view>
@@ -23,18 +23,18 @@
 								<view class="sub-box">
 									<view class="sub-title">
 										<text>{{ item.subTitle }}</text>
-									</view>	
+									</view>
 									<view class="sub-title">
 										<text>{{ item.date }}</text>
 									</view>
 								</view>
 						  </view>
 						</view>
-						<view class="btn-group" v-if="i === list.length-1">
-							<tm-button type="pramary" btnText="不认可" @btnClick="clickRightBtn" />
-							<tm-button btnText="指派改善任务" @btnClick="clickRightBtn" />
-						</view>
 					</template>
+					<view class="btn-group">
+						<tm-button type="pramary" btnText="不认可" @btnClick="clickRightBtn" />
+						<tm-button btnText="指派改善任务" @btnClick="clickRightBtn" />
+					</view>
 				</view>
 			</view>
 		</scroll-view>
@@ -43,17 +43,41 @@
 
 <script>
 	// 改善任务
-	import listItem from '../mission/components/mission-list/list-item.vue';
+  import { mapState } from "vuex";
+  import listItem from '../mission/components/list-item.vue';
 	export default {
+    computed: {
+      ...mapState({
+        missionDetails: state => state.mission.missionDetails
+      })
+    },
 		data() {
 			return {
         list: [
 					{title: '查核人:王晓雪', subTitle: '发送改善通知,查核结果:主要缺失', date: '2020-11-22 15:30:22'},
 					{title: '单位负责人', subTitle: '发送改善通知,查核结果:主要缺失', date: '2020-11-22 15:30:22'}
-				]
+        ],
+        // 任务id
+        taskId: ''
 			}
-		},
+    },
+    onLoad({ taskId }){
+      this.taskId = taskId;
+    },
+    created() {
+      this.getMissionDetails();
+    },
 		methods: {
+      // 获取改善任务列表
+			getMissionDetails(data) {
+				this.$store.dispatch({
+					type: 'mission/commActions',
+					payload: {
+						key: "getMissionDetails",
+						data: {taskId: this.taskId}
+					}
+				});
+			},
 			// 点击右侧按钮
 			clickRightBtn() {
 				uni.navigateTo({
@@ -62,7 +86,7 @@
 			}
 		},
 		components: {
-			listItem, 
+			listItem
 		}
 	}
 </script>
@@ -71,80 +95,80 @@
 	.mission-details-page {
 		height: 100%;
 		padding-top: 15rpx;
-		
+
 		.scroll-y {
 			height: 100%;
-			
+
 			.mission-plan {
-				
+
 				.label {
 					margin-top: 25rpx;
 					margin-bottom: 15rpx;
 					height: 20rpx;
 					line-height: 20rpx;
 					padding-left: 25rpx;
-					
+
 					text {
 						font-size: 20rpx;
 						color: #666F80;
 					}
 				}
-				
+
 				.plan-box {
 					padding: 25rpx;
 					background-color: #fff;
-					
+
 					.row {
 						display: flex;
-						
+
 						.col {
-							
+
 							.title {
 								display: flex;
 								align-items: center;
 								margin-bottom: 15rpx;
 								height: 25rpx;
-							
+
 							  >text {
 									font-size: 22.5rpx;
 									color: #292C33;
 								}
 							}
-							
+
 							.sub-box {
 								display: flex;
 								flex-direction: column;
-								
+
 								.sub-title {
 									display: flex;
 									align-items: center;
 									margin-bottom: 15rpx;
 									height: 20rpx;
-									
+
 									&:last-child {
 										margin-bottom: 34.37rpx;
 									}
-									
+
 									>text {
 										font-size: 20rpx;
 										color: #666E80;
 									}
 								}
 							}
-							
+
 							&:first-child {
 								display: flex;
 								flex-direction: column;
 								align-items: center;
 								margin-right: 15rpx;
 								width: 25rpx;
-								
+
 								.plan-icon {
 									margin-bottom: 17.5rpx;
 									width: 25rpx;
 									height: 25rpx;
 								}
-								
+
 								.line {
 									width: 5rpx;
 									height: 75rpx;
@@ -153,7 +177,7 @@
 							}
 						}
 					}
-					
+
 					.btn-group {
 						display: flex;
 						justify-content: space-between;

+ 280 - 0
pages/mission-details/setting.js

@@ -0,0 +1,280 @@
+// 任务流程列表
+const taskTypeList = [
+  {
+    // 任务当前状态
+    taskType: 1,
+    currentPermission: 4, // 当前任务在哪
+    taskName: '创建任务',
+    // 《只针对第一步操作区分按钮是显示 指派改善任务还是改善回复》 1不用管 2 改善回复 3 制定改善方案
+    checkResult: 3,
+    //  底部按钮 (name: 按钮名字, componentName: 点击后跳转的页面, nextPermission:下一步指派给谁)
+    btnList: [
+      {name: '不认可', componentName: 'disagree', nextPermission: 1, nextPermissionName: '管理员'},
+      {name: '指派改善任务', componentName: 'assign-mission', nextPermission: 5, nextPermissionName: '改善者' }
+    ],
+    // 第一行
+    row1: { hasJoin: true, name: '查核人*', key: 'establishEmpName' },
+    // 第二行
+    row2: {hasJoin: true, name: '发送改善通知,查核结果:*', key: 'xx' },
+    // 查看xx详情 (name: 详情名字, componentName: 点击后跳转的页面, disabled: 底部按钮禁用)
+    selectDetails: { name: '查看查核结果详情', componentName: 'disagree', disabled: true }
+  },
+  {
+    taskType: 1,
+    currentPermission: 4,
+    taskName: '创建任务',
+    checkResult: 2,
+    btnList: [
+      {name: '不认可', componentName: 'disagree', nextPermission: 1, nextPermissionName: '管理员'},
+      {name: '改善回复', componentName: 'write-back', nextPermission: 1, nextPermissionName: '管理员' }
+    ],
+     row1: { hasJoin: true, name: '查核人*', key: 'establishEmpName' },
+     row2: {hasJoin: true, name: '发送改善通知,查核结果:*', key: 'xx' },
+    selectDetails: {name: '查看查核结果详情', componentName: 'disagree', disabled: true}
+  },
+  {
+    taskType: 2,
+    currentPermission: 1,
+    taskName: '不认可',
+    checkResult: 1,
+    btnList: [
+      {name: '重新发送', componentName: 'disagree', nextPermission: 4, nextPermissionName: '单位负责人'},
+      {name: '发送给其他人', componentName: 'personnel', nextPermission: 4, nextPermissionName: '单位负责人' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '不认可改善通知' },
+    selectDetails: {name: '查看不认可原因详情', componentName: 'disagree', disabled: true}
+  },
+  {
+    taskType: 3,
+    currentPermission: 4,
+    taskName: '重新发送',
+    checkResult: 1,
+    btnList: [
+      {name: '指派改善任务', componentName: 'assign-mission', nextPermission: 4, nextPermissionName: '单位负责人' }
+    ],
+    row1: { hasJoin: true, name: '管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '重新发送改善通知' },
+    selectDetails: {name: '查看原因详情', componentName: 'disagree', disabled: true}
+  },
+  {
+    taskType: 4,
+    checkResult: 1,
+    taskName: '指派改善任务',
+    currentPermission: 5,
+    btnList: [
+      {name: '申请更换改善人', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '制定改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: true, name: '指派*为改善人', key: 'receiveEmpName'},
+    selectDetails: null
+  },
+  {
+    taskType: 5,
+    checkResult: 1,
+    taskName: '改善回复',
+    currentPermission: 1,
+    btnList: [
+      {name: '不通过', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '通过', componentName: null, nextPermission: null, nextPermission: 4, nextPermissionName: '单位负责人' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '提交了改善回复'},
+    selectDetails: {name: '查看改善回复详情', componentName: 'write-back', disabled: true},
+  },
+  {
+    taskType: 6,
+    checkResult: 1,
+    taskName: '更换改善人',
+    currentPermission: 5,
+    btnList: [
+      {name: '申请更换改善人', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '制定改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: true, name: '指派*为改善人', key: 'receiveEmpName'},
+    selectDetails: null
+  },
+  {
+    taskType: 7,
+    checkResult: 1,
+    taskName: '更换改善人驳回',
+    currentPermission: 5,
+    btnList: [
+      {name: '制定改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '驳回更换改善人的申请'},
+    selectDetails: null
+  },
+  {
+    taskType: 8,
+    checkResult: 1,
+    taskName: '改善计划plan通过',
+    currentPermission: 5,
+    btnList: [
+      {name: '记录改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'pdca' }
+    ],
+    row1: { hasJoin: true, name: '单位管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '通过改善计划审核,开始执行改善计划'},
+    selectDetails: {name: '查看改善计划详情', componentName: 'pdca',  pdcaSetting: 'p', disabled: true}
+  },
+  {
+    taskType: 9,
+    checkResult: 1,
+    taskName: '改善计划plan不通过',
+    currentPermission: 5,
+    btnList: [
+      {name: '制定改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p' }
+    ],
+    row1: { hasJoin: true, name: '单位管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '建议重新完善改善计划'},
+    selectDetails: {name: '查看原因详情', componentName: 'disagree', disabled: true}
+  },
+  {
+    taskType: 10,
+    checkResult: 1,
+    taskName: '改善方案PDCA通过',
+    currentPermission: 1,
+    btnList: [
+      {name: '不通过', componentName: 'disagree', nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '通过', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' }
+    ],
+    row1: { hasJoin: true, name: '单位负责人*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '通过了改善方案(PDCA)'},
+    selectDetails: {name: '查看改善方案详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'pacd', disabled: true}
+  },
+  {
+    taskType: 11,
+    checkResult: 1,
+    taskName: '改善方案PDCA不通过',
+    currentPermission: 5,
+    btnList: [
+      {name: '制定改善方案', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p' },
+    ],
+    row1: { hasJoin: true, name: '单位管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '建议重新完善改善计划'},
+    selectDetails: {name: '查看原因详情', componentName: 'disagree', nextPermission: 4, nextPermissionName: '单位负责人', disabled: true}
+  },
+  {
+    taskType: 12,
+    checkResult: 1,
+    taskName: '申请更改改善人',
+    currentPermission: 4,
+    btnList: [
+      {name: '更改改善人', componentName: 'assign-mission', nextPermission: 5, nextPermissionName: '改善者' },
+      {name: '驳回请求', componentName: null, nextPermission: 5, nextPermissionName: '改善者' },
+    ],
+    row1: { hasJoin: true, name: '改善人*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '申请更换改善人'},
+    selectDetails: null
+  },
+  {
+    taskType: 13,
+    checkResult: 1,
+    taskName: '制定改善方案',
+    currentPermission: 4,
+    btnList: [
+      {name: '不通过', componentName: 'disagree', nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '通过', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' },
+    ],
+    row1: { hasJoin: true, name: '改善者*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '提交了改善计划(PLAN)'},
+    selectDetails: {name: '查看改善计划详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p', disabled: true}
+  },
+  {
+    taskType: 14,
+    checkResult: 1,
+    taskName: '制定改善方案plan',
+    currentPermission: 4,
+    btnList: [
+      {name: '不通过', componentName: 'disagree', nextPermission: 5, nextPermissionName: '改善者' },
+      {name: '通过', componentName: null, nextPermission: 5, nextPermissionName: '改善者' },
+    ],
+    row1: { hasJoin: true, name: '改善者*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '提交了改善计划(PLAN)'},
+    selectDetails: {name: '查看改善计划详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p', disabled: true}
+  },
+  {
+    taskType: 15,
+    checkResult: 1,
+    taskName: '改善方案暂停',
+    currentPermission: 4,
+    btnList: [
+      {name: '不通过', componentName: 'disagree', nextPermission: 4, nextPermissionName: '单位负责人' },
+      {name: '通过', componentName: null, nextPermission: 4, nextPermissionName: '单位负责人' },
+    ],
+    row1: { hasJoin: true, name: '改善者*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '提交了改善计划(PLAN)'},
+    selectDetails: {name: '查看改善计划详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'p', disabled: true}
+  },
+  {
+    taskType: 16,
+    checkResult: 1,
+    taskName: '记录改善方案plan',
+    currentPermission: 4,
+    btnList: [
+      {name: '不通过', componentName: 'disagree', nextPermission: 5, nextPermissionName: '改善者' },
+      {name: '通过', componentName: null, nextPermission: 1, nextPermissionName: '管理员' },
+    ],
+    row1: { hasJoin: true, name: '改善者*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '提交了改善计划(PLAN)'},
+    selectDetails: {name: '查看改善方案详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'pdca', disabled: true}
+  },
+  {
+    taskType: 17,
+    checkResult: 1,
+    taskName: '改善方案plan通过, 改善回复通过',
+    currentPermission: 4,
+    btnList: [],
+    row1: { hasJoin: true, name: '管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '完成改善,本次任务结束'},
+    selectDetails: {name: '查看改善方案详情', componentName: 'pdca', nextPermission: 5, nextPermissionName: '改善者', pdcaSetting: 'pdca', disabled: true}
+  },
+  {
+    taskType: 18,
+    checkResult: 1,
+    taskName: '改善方案plan通过, 改善回复通过',
+    currentPermission: 4,
+    btnList: [
+      {name: '指派改善任务', componentName: 'assign-mission', nextPermission: 4, nextPermissionName: '单位负责人' },
+    ],
+    row1: { hasJoin: true, name: '管理员*', key: 'establishEmpName' },
+    row2: {hasJoin: false, name: '改善方案不通过,重新执行改善流程'},
+    selectDetails: {name: '查看原因详情', componentName: 'disagree', disabled: true }
+  },
+];
+
+export default taskTypeList;
+
+/**
+ * 字段描述:
+ * taskType:          // 任务当前状态
+ * currentPermission:  // 当前任务位置在哪 (1、管理员 2、查核组长 3、查核组员 4、单位负责人 5、改善者)
+ * taskName:          // 任务名称
+ * checkResult:       // 《只针对第一步创建任务 区分按钮 显示指派改善任务还是改善回复》 1不用管 2 改善回复 3 制定改善方案
+ * btnList:{ // 底部按钮
+ *   name: // 按钮名字,
+ *   componentName: // 点击后跳转的页面,null直接刷新页面即可
+ *   nextPermission: // 下一步指派给谁id
+ *   nextPermissionName: // 下一步指派给谁
+ *   pdcaSetting: // 跳转pdca的配置: <p: 只能编辑plan, pdca: 都可以编辑>
+ * }
+ * row1: { // 第一行显示的内容
+ *    hasJoin:// 是否需要拼接,
+ *    name:   // 显示的内容 <注意 星号*指占位符, 后面需要被key字段替换的,
+ *    key:    //  要显示的的内容(后端返回的key, 用于替换星号*)
+ *  }
+ * row2: { // 第二行显示的内容
+ *    hasJoin: // 是否需要拼接,
+ *    name:    // 显示的内容 <注意 星号*指占位符, 后面需要被key字段替换的,
+ *    key:     // 要显示的的内容(后端返回的key, 用于替换星号*)
+ *  }
+ * selectDetails {
+ *   name: '查看改善计划详情', // 详情显示的名字
+ *   componentName: 'pdca', // 点击后跳转的页面
+ *   pdcaSetting: 'p', // 当componentName='pdca', 需要判断pdcaSetting='p', 还是‘pdca’
+ *   disabled: true // 底部按钮禁用
+ * }
+ */

+ 40 - 28
pages/mission/components/mission-list/list-item.vue → pages/mission/components/list-item.vue

@@ -1,28 +1,28 @@
 <template>
-	<view class="mission-list-item" @click="gooDetails">
-		<view v-if="!isClose" class="time">
-			<text class="com-text">2020-11-26 15:33:08</text>
+	<view class="mission-list-item" @click="gotoDetails(task.id)">
+		<view v-if="!isDetails && !isComplete" class="time">
+			<text class="com-text">{{ task.recordTime }}</text>
 		</view>
 		<view class="card">
 	    <view class="top-box">
-				<view :class="['bg-box', isClose ? 'disabled-bg' : 'hight-bg']">
-					<text>{{isClose ? '改善结案' : '改善中'}}</text>
+				<view v-show="!isDetails" :class="['bg-box', isComplete ? 'disabled-bg' : 'hight-bg']">
+					<text>{{isComplete ? '改善结案' : '改善中'}}</text>
 				</view>
-	    	<text class="title">柜子上方50cm不能遮住喷水器</text>
+	    	<text class="title">{{ task.checkPointName }}</text>
 	    	<view class="row">
 	    		<view class="col">
 	    			<image class="com-icon" src="/static/search-icon.png"></image>
-	    			<text class="com-text">第3/9次查核计划</text>
-	    		</view>	
+	    			<text class="com-text">{{ task.checkPlan }}</text>
+	    		</view>
 	    		<view class="col">
 	    			<image class="com-icon" src="/static/location-icon.png"></image>
-	    			<text class="com-text">分诊处(门诊)</text>
+	    			<text class="com-text">{{ task.deptName }}</text>
 	    		</view>
 	    	</view>
 	    </view>
 			<view class="bottom-box">
-				<text class="com-text">情境名称:环境设施安全</text>
-				<text class="com-text">改善人:张晴晴</text>
+				<text class="com-text">情境名称:{{ task.situationName }}</text>
+				<text class="com-text">改善人:{{ task.improveEmpName }}</text>
 			</view>
 		</view>
 	</view>
@@ -31,22 +31,34 @@
 <script>
 	export default {
 		props: {
-			isClose: { // 是否结案
+			// 当前遍历的任务
+			task: {
+				type: Object,
+				default: () => {
+					return {}
+				}
+			},
+			// 是否结案
+			isComplete: {
+				type: Boolean,
+				default: false
+			},
+			// 是否是详情页面
+			isDetails: {
 				type: Boolean,
 				default: false
 			}
 		},
 		computed: {
 			bgImage(){
-				console.log(`url(~@/static/${!this.isClose ? 'hight' : 'disabled'}-bg.png)`)
-				return `../../../../static/${!this.isClose ? 'hight' : 'disabled'}-bg.png`;
+				return `../../../static/${!this.isComplete ? 'hight' : 'disabled'}-bg.png`;
 			}
 		},
 		methods: {
 			// 跳转详情页面(改善任务)
-			gooDetails(){
+			gotoDetails(id){
 				uni.navigateTo({
-				  url: '/pages/mission-details/mission-details'
+				  url: `/pages/mission-details/mission-details?taskId=${id}`
 				});
 			}
 		}
@@ -57,13 +69,13 @@
 	.mission-list-item {
 		margin-bottom: 25rpx;
 		overflow: hidden;
-		
+
 		.time {
 			height: 47.5rpx;
 			line-height: 45rpx;
 			padding-left: 25rpx;
 		}
-		
+
 		.card {
 			position: relative;
 			display: flex;
@@ -71,7 +83,7 @@
 			height: 203.75rpx;
 			background-color: #fff;
 			padding: 0 25rpx;
-			
+
 			.top-box {
 				display: flex;
 				flex-direction: column;
@@ -80,23 +92,23 @@
 				margin-top: 35rpx;
 				margin-bottom: 28.12rpx;
 			}
-			
+
 			.title {
-				line-height: 45rpx;
+				line-height: 25rpx;
 				font-size: 25rpx;
 				font-weight: bold;
 				color: #292C33;
 			}
-			
+
 			.row {
 				display: flex;
 				align-items: center;
-				
+
 				.col {
 					display: flex;
 					align-items: center;
 					height: 20rpx;
-					
+
 					&:first-child {
 						margin-right: 50rpx;
 					}
@@ -114,7 +126,7 @@
 				height: 70rpx;
 				border-top: 0.62rpx solid #DADEE6;
 			}
-			
+
 			.bg-box {
 				position: absolute;
 				top: 0;
@@ -124,14 +136,14 @@
 				background-size: 100% 100%;
 				padding-left: 12.5rpx;
 				text-align: center;
-				
+
 				>text {
 					line-height: 35rpx;
 					font-size: 17.5rpx;
 					color: #fff;
 				}
 			}
-			
+
 			.hight-bg {
 				background-image: url('~@/static/hight-bg.png');
 			}
@@ -139,7 +151,7 @@
 				background-image: url('~@/static/disabled-bg.png');
 			}
 		}
-		
+
 		.com-text {
 			font-size: 22.5rpx;
 			color: #666F80;

+ 0 - 96
pages/mission/components/mission-list/mission-list.vue

@@ -1,96 +0,0 @@
-<template>
-	<view class="mission-list">
-		<scroll-view class="scroll-y" scroll-y="true">
-			<list-item />
-			<list-item />
-			<view class="completed-box">
-				<view class="btn-box">
-					<view class="btn" @click="toggleBtn">
-						<image class="icon" :src="`/static/${btnSetting.icon}.png`"></image>
-						<text class="text">
-						  {{ btnSetting.name }}
-						</text>
-					</view>
-				</view>
-				<list-item :isClose="true" v-if="showCloseList" />
-			</view>
-		</scroll-view>
-		<tm-tabbar :permission="1" />
-	</view>
-</template>
-
-<script>
-	// 任务列表
-	import listItem from './list-item.vue';
-	export default {
-		data(){
-			return {
-				// 是否展开历史任务
-				showCloseList: false,
-				btnSetting: {
-					icon: 'up-icon', // 图标名
-					name: '展示历史任务' // 按钮显示名字
-				},
-				closeList: [1, 2, 3]
-			}
-		},
-		watch: {
-			showCloseList(newVal, oldVal) {
-				if(newVal != oldVal){
-					this.btnSetting.icon = newVal ? 'up-icon' : 'down-ion';
-					this.btnSetting.name = newVal ? '收起历史任务' : '展示历史任务';
-				}
-			}
-		},
-		methods: {
-			toggleBtn() {
-				this.showCloseList = !this.showCloseList
-			}
-		},
-		components: {
-			listItem
-		}
-	}
-</script>
-
-<style lang="less">
-	.mission-list {
-		height: 100%;
-		padding-top: 15rpx;
-		
-		.scroll-y {
-			height: calc(100% - 87.5rpx);
-			
-			.completed-box {
-				
-				.btn-box {
-					display: flex;
-					justify-content: center;
-					margin-bottom: 25rpx;
-					height: 50rpx;
-					
-					.btn {
-						display: flex;
-						justify-content: center;
-						align-items: center;
-						width: 225rpx;
-						height: 50rpx;
-						border-radius: 37.5rpx;
-						border: 1.25rpx solid #98A1B3;
-						
-						.icon {
-							margin-right: 6.25rpx;
-							width: 21.25rpx;
-							height: 12.5rpx;
-						}
-						
-						.text {
-							font-size: 22.5rpx;
-							color: #98A1B3;
-						}
-					}
-				}
-			}
-		}
-	}
-</style>

+ 136 - 11
pages/mission/mission.vue

@@ -1,32 +1,157 @@
 <template>
 	<view class="mission-page">
-	  <!-- 任务列表 -->
-	  <mission-list />
-		
+	 	<scroll-view class="scroll-y" scroll-y="true">
+			<list-item
+				v-for="(item, i) in improvingTaskList"
+				:key="item.id"
+				:task="item"
+			/>
+			<view class="completed-box">
+				<view class="btn-box" >
+					<view class="btn" v-show="completeTaskList.length > 0" @click="toggleBtn">
+						<image class="icon" :src="`/static/${btnSetting.icon}.png`"></image>
+						<text class="text">
+						  {{ btnSetting.name }}
+						</text>
+					</view>
+				</view>
+				<template v-if="showCloseList">
+					<list-item
+						v-for="(item, i) in completeTaskList"
+						:key="item.id"
+						:task="item"
+						:isComplete="true"
+					/>
+				</template>
+			</view>
+		</scroll-view>
+		<tm-tabbar />
 	</view>
 </template>
 
 <script>
-	// 任务
-	import missionList from './components/mission-list/mission-list.vue'
+	// 任务列表
+	import listItem from './components/list-item.vue';
 	export default {
-		data() {
+		data(){
 			return {
-				
+				// 是否展开历史任务
+				showCloseList: false,
+				btnSetting: {
+					icon: 'up-icon', // 图标名
+					name: '展示历史任务' // 按钮显示名字
+				},
+				// 改善中任务
+				improvingTaskList: [
+					// {
+					// 	appointFlag: false, // 已指派标志, 0 未指派 1已指派
+					// 	checkGroupId: 1, // 查核组id
+					// 	checkGroupName: "测试群组", // 查核组名称
+					// 	checkId: 1,
+					// 	checkItemId: 1, // 查核项目id
+					// 	checkItemName: "测试点", // 查核项目名称
+					// 	checkPlan: "第1/3次查核计划", // 查核计划
+					// 	checkPointId: 1, // 查核要点id
+					// 	checkPointName: "测试", // 查核要点名称(查核项)
+					// 	createDate: "2021-02-03T01:44:09.000+0000", // 任务创建时间
+					// 	createEmpId: 1, //创建人
+					// 	createEmpName: "管理员", // 创建人姓名
+					// 	delFlag: false,
+					// 	deptId: 1, // 单位id
+					// 	deptName: "测试部门", // 单位名称
+					// 	desicion: "", // 改善工具:0,进行PDCA改善 1,暂不改善
+					// 	endFlag: false, // 完结标识
+					// 	id: 1, // 任务id
+					// 	needApproveFlag: false, // 需要审核标志
+					// 	recordTime: "2021-02-03 09:44:17", // 最终修改时间
+					// 	situationId: 1, // 情景id
+					// 	situationName: "测试情景", // 情景名称
+					// 	taskType: 0, // 任务当前状态
+          //   updateTime: "2021-02-03T01:44:17.000+0000", // 修改时间 (发送时间)
+          //   improveEmpName: '', //改善人
+          //   improveEmpId: '', //改善人id
+					// }
+				],
+				// 历史任务
+				completeTaskList: [],
 			}
 		},
+		created() {
+			this.getMissionList()
+		},
 		methods: {
-			
+			toggleBtn() {
+				let flag = !this.showCloseList;
+				this.showCloseList = flag;
+				this.btnSetting = {
+					icon: flag ? 'up-icon' : 'down-icon',
+					name: flag ? '收起历史任务' : '展示历史任务'
+				}
+			},
+			// 获取改善任务列表
+			getMissionList(data) {
+				this.$store.dispatch({
+					type: 'mission/commActions',
+					payload: {
+						key: "getMissionList",
+						data
+					}
+				}).then(data => {
+					if(data) {
+						this.improvingTaskList = data.improvingTaskResponses || [];
+						this.completeTaskList = data.improveCompleteResponses || [];
+					}
+				});
+				/** 请求参数 data
+				 * situationId: 情境id 当管路员或者查核者通过情境进入任务列表时 必传
+				 * checkItemId 单位负责人通过 查核要点进入改善任务列表时 必传
+				 */
+			}
 		},
 		components: {
-			missionList
+			listItem
 		}
 	}
 </script>
 
 <style lang="less">
  .mission-page {
-	 height: 100%;
-	 overflow: hidden;
+   height: 100%;
+   padding-top: 15rpx;
+
+   	.scroll-y {
+			height: calc(100% - 87.5rpx);
+
+			.completed-box {
+
+				.btn-box {
+					display: flex;
+					justify-content: center;
+					margin-bottom: 25rpx;
+					height: 50rpx;
+
+					.btn {
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						width: 225rpx;
+						height: 50rpx;
+						border-radius: 37.5rpx;
+						border: 1.25rpx solid #98A1B3;
+
+						.icon {
+							margin-right: 6.25rpx;
+							width: 21.25rpx;
+							height: 12.5rpx;
+						}
+
+						.text {
+							font-size: 22.5rpx;
+							color: #98A1B3;
+						}
+					}
+				}
+			}
+		}
  }
 </style>

+ 92 - 0
pages/mission/model.js

@@ -0,0 +1,92 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+    // 任务详情
+    missionDetails: {
+      appointFlag: false, // 已指派标志, 0 未指派 1已指派
+      checkGroupId: 1, // 查核组id
+      checkGroupName: "测试群组", // 查核组名称
+      checkId: 1,
+      checkItemId: 1, // 查核项目id
+      checkItemName: "测试点", // 查核项目名称
+      checkPlan: "第1/3次查核计划", // 查核计划
+      checkPointId: 1, // 查核要点id
+      checkPointName: "测试", // 查核要点名称(查核项)
+      createDate: "2021-02-03T01:44:09.000+0000", // 任务创建时间
+      createEmpId: 1, //创建人
+      createEmpName: "管理员", // 创建人姓名
+      delFlag: false,
+      deptId: 1, // 单位id
+      deptName: "测试部门", // 单位名称
+      desicion: "", // 改善工具:0,进行PDCA改善 1,暂不改善
+      endFlag: false, // 完结标识
+      id: 1, // 任务id
+      needApproveFlag: false, // 需要审核标志
+      recordTime: "2021-02-03 09:44:17", // 最终修改时间
+      situationId: 1, // 情景id
+      situationName: "测试情景", // 情景名称
+      taskType: 0, // 任务当前状态
+      updateTime: "2021-02-03T01:44:17.000+0000", // 修改时间 (发送时间)
+      improveEmpName: '', //改善人
+      improveEmpId: '', //改善人id
+      buttonDisplayFlag: 1,  // 0 不展示 1展示
+      checkResult: 1, // 《只针对第一步操作区分按钮是显示 指派改善任务还是改善回复》 1不用管 2 改善回复 3 制定改善方案
+      pfmTaskCirculationList: [
+        {
+          createTime: "2021-02-03T01:44:42.000+0000", // 创建时间
+          establishEmpId: 1, // 员工id
+          establishEmpName: "管理员",// 发送人员名称
+          id: 1, // 流转记录id
+          receiveEmpId: 1, // 接收人id
+          receiveEmpName: "管理员吧",// 接收人姓名
+          // action
+          taskAction: "", // 改善处置
+          taskId: 1, // 任务id
+          taskPlan: "",// plan整改计划
+          taskType: 0, // 流转状态
+          improveScheme: '', // 改善方案名称
+          approveReason: '审核意见', // 审核意见
+          // do
+          taskDoRequestList: [
+            {
+              taskDoId:"mock",  // 过程记录id
+              taskDoProcess:"mock", // 过程记录内容
+              taskDoPlan:"mock" // 计划日期
+            }
+          ],
+          // check
+          taskCheckRequestList: [
+            {
+              taskCheckId:"mock",  // 改善确认id
+              taskCheckProcess:"mock", // 改善确认记录过程
+              taskCheckPlan:"mock",  // 改善确认计划日期
+              taskCheckEffect:"mock" //改善确认改善效果
+            }
+          ]
+        }
+      ]
+    }
+  },
+  mutations: {
+    changeMissionDetails(state, { data }) {
+      state.missionDetails = data || {};
+    },
+  },
+  actions: {
+    commActions({ commit, state }, { payload }) {
+      // payload = {key,data} // data是请求数据,key是请求接口id
+      return commServer(payload).then(data => {
+        // 查看任务详情
+        if (payload.key === 'getMissionDetails') {
+          commit({
+            type: 'changeMissionDetails',
+            data
+          });
+        }
+        return data
+      });
+    },
+  }
+}

+ 29 - 0
pages/mission/server.js

@@ -0,0 +1,29 @@
+import {
+	creatRequest
+} from '../../utils/request.js';
+
+const requestList = {
+	// 改善任务列表
+	getMissionList: {
+		method: 'GET',
+		url: 'imed/pfm/improverTask/list'
+	},
+	// 改善任务详情
+	getMissionDetails: {
+		method: 'GET',
+		url: 'imed/pfm/improverTask/detail'
+	},
+	// 查询部门人员树 (通用接口)
+	getEmpDeptTree: {
+		method: 'GET',
+		url: 'imed/pfm/common/empDeptTree'
+	}
+};
+
+export const commServer = ({
+	key,
+	data
+}) => {
+	let obj = requestList[key];
+	return creatRequest(obj, data);
+}

+ 7 - 0
pages/model.js

@@ -2,9 +2,16 @@ import login from './login/model.js';
 import home from './home/model.js';
 import roleSwitching from './role-switching/model.js';
 import configure from './configure/model.js';
+import messages from './messages/model.js';
+import mission from './mission/model.js';
 export default module = {
   login,
   configure,
+<<<<<<< HEAD
 	home,
 	roleSwitching,
+=======
+  messages,
+  mission,
+>>>>>>> 9ffbc6f6836be68303111dee85ddba6607d8ea09
 }

+ 0 - 0
static/mission/上传图片.png → static/img-icon.png


BIN=BIN
static/橙色已读.png


BIN=BIN
static/橙色未读.png


BIN=BIN
static/绿色已读.png


BIN=BIN
static/绿色未读.png


+ 1 - 1
utils/request.js

@@ -47,7 +47,7 @@ function request(url, options, additional) {
   openCloseLoading(additional, true);
   // 模拟token,做登录的同学将这行代码移到登录成功函数中.
 
-  // uni.setStorageSync('token', 'MjU2OzE2MTE2MjIxODYwNjM7OGJjMTA2ZjNhMzMyNGUxOTRhMmFlMGExOThjMzA5OGE=');
+  uni.setStorageSync('token', 'gfkZlq36bBPefzvIoukl5exPJ5/jkil2gi9fNPTABSk=');
   const token = uni.getStorageSync('token');
   return uni.request({
     url: `${BASE_URL}${url}`,

+ 116 - 0
utils/ws.js

@@ -0,0 +1,116 @@
+//心跳检测
+const heartCheck = {
+  timeout: 10000, //10s发一次心跳
+  timeoutObj: null,
+  serverTimeoutObj: null,
+  start(ws) {
+    let self = this;
+    this.timeoutObj && clearTimeout(this.timeoutObj);
+    this.serverTimeoutObj && clearTimeout(this.serverTimeoutObj);
+    this.timeoutObj = setTimeout(() => {
+      // 表示连接已经关闭或者连接不能打开。
+      if (ws && ws.readyState === 3) return;
+      //发送一个心跳,后端收到后,返回一个心跳消息,onmessage拿到返回的心跳就说明连接正常
+      ws && ws.send({data: "ping"});
+      self.serverTimeoutObj = setTimeout(() => {
+        ws && ws.close();
+                websocket.reconnect();
+      }, self.timeout + 3000);
+    }, this.timeout);
+  }
+};
+ 
+const websocket = {
+  ws: null,
+  url: '',
+  connected: false,
+  connecting: false,
+  reconnectTimeId: null,
+    callback: null, // 存放回调函数
+    reconnetCount: 0, // 重连次数
+  lockReconnect: false, // 避免ws重复连接
+  createWebSocket(callback) {
+    if (this.connected || this.connecting) { // 正在连接或者已经连接,请勿重复连接
+      return false
+    }
+    try {
+            if (callback) websocket.callback = callback;
+      this.connecting = true;
+      // 创建
+      this.ws = uni.connectSocket({
+        url: this.url,
+        success(data) {
+          // console.log("websocket连接成功!");
+        }
+      });
+      // 监听 Ws 连接打开
+      this.ws.onOpen((res) => {
+        this.connecting = false;
+        this.connected = true;
+        // console.log("websocket连接打开正常!");
+        //心跳检测重置
+        heartCheck.start(this.ws);
+                this.reconnetCount && (this.reconnetCount = 0);
+      });
+      this.ws.onError((res) => {
+        this.connecting = false;
+        this.connected = false;
+        // console.log("ws连接错误!", res);
+        this.reconnect();
+      });
+      this.ws.onMessage((res) => {
+            if (res.data === 'ping') {
+              heartCheck.start(this.ws); //获取到消息,心跳检测重置
+              this.reconnetCount && (this.reconnetCount = 0);
+            } else {
+          const { type, data } = JSON.parse(res.data);
+          // console.log("ws 收到消息啦:" + type);
+          if (callback) {
+            callback(type, data);
+          } else if (websocket.callback) {
+            websocket.callback(type, data);
+          }
+        }
+      });
+      this.ws.onClose((res) => {
+        this.connected = false;
+        this.ws = null;
+        // console.log('WebSocket 已关闭!');
+        // this.reconnect();
+      });
+    } catch (e) {// 重连
+      this.connected = false;
+      this.ws = null;
+      this.reconnect();
+    }
+  },
+  reconnect() { // 重连
+    if (this.lockReconnect) return;
+        if (this.reconnetCount === 6) {
+          this.close();
+          return
+        }
+    this.lockReconnect = true;
+        this.reconnetCount++;
+    this.reconnectTimeId && clearTimeout(this.reconnectTimeId);
+    this.reconnectTimeId = setTimeout(() => {//没连接上会一直重连,设置延迟避免请求过多
+      this.createWebSocket(websocket.callback);
+      this.lockReconnect = false;
+    }, 3000);
+  },
+  close() { // 关闭
+    if (this.ws && this.ws.close) {
+      this.ws.close && this.ws.close();
+      this.ws = null;
+    }
+        this.connected = false;
+        this.connecting = false;
+        this.lockReconnect = false;
+        this.reconnetCount = 0;
+        this.reconnectTimeId && clearTimeout(this.reconnectTimeId);
+        heartCheck.timeoutObj && clearTimeout(heartCheck.timeoutObj);
+        heartCheck.serverTimeoutObj && clearTimeout(heartCheck.serverTimeoutObj);
+  }
+}
+ 
+export default websocket;

+ 1 - 0
utils/wsUrl.js

@@ -0,0 +1 @@
+export const wsURL = `ws://192.168.1.45:8088/websocket/${hiId}/${user}/${permission}`;