浏览代码

合并冲突

jiangniuniu 4 年之前
父节点
当前提交
9bfe288713

+ 1 - 12
App.vue

@@ -45,6 +45,7 @@
 		height: 100%;
 		height: 100%;
 		font-size: 20rpx;
 		font-size: 20rpx;
 		line-height: 30rpx;
 		line-height: 30rpx;
+		color: #292C33;
 		background-color: #F5F6FA;
 		background-color: #F5F6FA;
 	}
 	}
 
 
@@ -158,16 +159,4 @@
 		}
 		}
 	}
 	}
 	// 查核地图列表样式end
 	// 查核地图列表样式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>
 </style>

+ 2 - 0
README.md

@@ -9,6 +9,8 @@
 3. 底部tabBar:tm-tabbar。
 3. 底部tabBar:tm-tabbar。
 4. 单选列表组合/下拉式单选列表组合:tm-radio-group。使用步骤看tm-radio-group/README.md
 4. 单选列表组合/下拉式单选列表组合:tm-radio-group。使用步骤看tm-radio-group/README.md
 5. 底部简单双按钮:tm-simple-btn-group。
 5. 底部简单双按钮:tm-simple-btn-group。
+6. 顶部菜单容器:tm-top-menu。
+7. 弹出层:tm-modal。
 
 
 ### 公共组件的注册方式
 ### 公共组件的注册方式
 ---
 ---

+ 1 - 1
components/com-button/com-button.vue

@@ -95,7 +95,7 @@
 	}
 	}
 	
 	
 	.default {
 	.default {
-		background: #E6EAF2;
+		background: #E6EAF2!important;
 		color: #7A8599;
 		color: #7A8599;
 	}
 	}
 
 

+ 32 - 0
components/tm-modal/tm-modal.vue

@@ -0,0 +1,32 @@
+<template>
+	<view class="tm-modal" @click="$emit('click')">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	/**
+	 * modal弹出层
+	 * @click为点击元素的事件监听
+	 */
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="less">
+	.tm-modal {
+		overflow: hidden;
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
+		z-index: 1000;
+		background-color: rgba(18, 20, 26, 0.5);
+	}
+</style>

+ 25 - 0
components/tm-top-menu/tm-top-menu.vue

@@ -0,0 +1,25 @@
+<template>
+	<view class="tm-top-menu">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	export default {
+	}
+</script>
+
+<style lang="less">
+	// 顶部按钮、信息start
+	.tm-top-menu {
+		position: fixed;
+		top: 0;
+		left: 0;
+		z-index: 10000;
+		border-bottom: 1px solid #DADEE6;
+		width: 100%;
+		min-height: 50rpx;
+		background-color: #fff;
+	}
+	// 顶部按钮、信息end
+</style>

+ 1 - 1
components/tm-trees/row.vue

@@ -9,7 +9,7 @@
 				</view>
 				</view>
 				<text>{{ option.label }}</text>
 				<text>{{ option.label }}</text>
 			</view>
 			</view>
-			<view v-if="!hasChildren" class="right" @click="checkedHandle">
+			<view v-if="option.parentId !== 0" class="right" @click="checkedHandle">
 				<image :src="`../../static/${rightIcon}.png`"></image>
 				<image :src="`../../static/${rightIcon}.png`"></image>
 			</view>
 			</view>
 		</view>
 		</view>

+ 5 - 1
components/tm-upload-img/tm-upload-img.vue

@@ -69,7 +69,11 @@
 					sourceType: ['album'], //从相册选择
 					sourceType: ['album'], //从相册选择
 					success: res1 => {
 					success: res1 => {
             uploadImage(res1).then(fileList => {
             uploadImage(res1).then(fileList => {
-              this.$emit('changeFilePaths', fileList, this.pickIndex);
+              if(this.isMultiple){
+                this.$emit('changeFilePaths', [...this.filePaths, ...fileList], this.pickIndex);
+              }else {
+                this.$emit('changeFilePaths', fileList, this.pickIndex);
+              }
 				  	})
 				  	})
 					},
 					},
 					error: e => {
 					error: e => {

+ 26 - 5
pages.json

@@ -102,16 +102,30 @@
 			}
 			}
 		},
 		},
 		{
 		{
-			"path": "pages/planList/planList",
+			"path": "pages/checkList/checkList",
 			"style": {
 			"style": {
-				"navigationBarTitleText": "计划列表",
+				"navigationBarTitleText": "查核列表",
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
 		},
 		},
 		{
 		{
-			"path": "pages/checkList/checkList",
+			"path": "pages/checkMainPoints/checkMainPoints",
 			"style": {
 			"style": {
-				"navigationBarTitleText": "查核列表",
+				"navigationBarTitleText": "查核要点",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
+			"path": "pages/auditItemDetails/auditItemDetails",
+			"style": {
+				"navigationBarTitleText": "查核项详情",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
+			"path": "pages/legendDetails/legendDetails",
+			"style": {
+				"navigationBarTitleText": "图例详情",
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
 		},
 		},
@@ -123,12 +137,19 @@
 			}
 			}
 		},
 		},
 		{
 		{
-			"path": "pages/checkList/checkList",
+			"path": "pages/editCheckList/editCheckList",
 			"style": {
 			"style": {
 				"navigationBarTitleText": "查核列表",
 				"navigationBarTitleText": "查核列表",
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
 		},
 		},
+		{
+			"path": "pages/allocationPerson/allocationPerson",
+			"style": {
+				"navigationBarTitleText": "指派查核人员",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 		{
 			"path": "pages/mainPointsDetail/mainPointsDetail",
 			"path": "pages/mainPointsDetail/mainPointsDetail",
 			"style": {
 			"style": {

+ 263 - 0
pages/allocationPerson/allocationPerson.vue

@@ -0,0 +1,263 @@
+<template>
+	<view class="allocationPerson-page">
+		<scroll-view class="scroll-y" scroll-y="true">
+      <template v-if="title === '指派查核人员'">
+       	<tm-radio-group
+			    :list="empList"
+			   	:defaultValue='details.empId'
+			   	:setting="{
+			   	  value: 'employeeId',
+			   	  name: 'employeeName'
+			    }"
+          :openkeys="[0]"
+          @change="changeDetails"
+			  />
+      </template>
+      <template v-else>
+        <div class="date-view">
+          <view class="row">
+           	<text class="label">开始时间</text>
+						<view class="date-box">
+							<date-time-picker
+							  :height="100"
+                :start="details.planStartDate"
+                :end="details.planEndDate"
+								:defaultValue="details.startDate"
+								placeholder="请选择起始时间"
+                pickType="startDate"
+								@change="changeDateTime"
+							/>
+						</view>
+          </view>
+					<view class="row">
+           	<text class="label">结束时间</text>
+						<view class="date-box">
+							<date-time-picker
+							  :height="100"
+                :start="details.planStartDate"
+                :end="details.planEndDate"
+								:defaultValue="details.endDate"
+                placeholder="请选择结束时间"
+                pickType="endDate"
+								@change="changeDateTime"
+							/>
+						</view>
+          </view>
+        </div>
+      </template>
+		</scroll-view>
+		<view class="fixed-buttom-btn" @click="sure">
+			<text class="btn-text">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+  // 查核列表编辑 查核人和计划时间
+  import { mapState } from "vuex";
+  import moment from 'moment';
+	export default {
+    computed: {
+      ...mapState({
+        checkList: state => state.editCheckList.checkList
+      })
+    },
+		data(){
+			return {
+        title: '', // 导航标题
+        // 查核组员列表
+        empList: [],
+        // 组件信息
+        details: {},
+        // 服务器时间
+        dateStr: '',
+        timer: null,
+        // 点击确定按钮是否直接保存
+        isSubmit: false
+			}
+    },
+    onLoad({ details }){
+      const _details = details ? JSON.parse(details) : {};
+      // 强制刷新返回查核列表页面
+      if(getCurrentPages().length === 1){
+        const {situationId, checkId, checkGroupId, planStartDate, planEndDate} = _details;
+        uni.redirectTo({
+          url: `/pages/editCheckList/editCheckList?situationId=${situationId}&checkId=${checkId}&checkGroupId=${checkGroupId}&startDate=${planStartDate}&endDate=${planEndDate}`
+        });
+      }
+      this.getComponentInfo(_details);
+    },
+    watch: {
+      title(newVal, oldVal){
+        if(newVal === '设置查核时间'){
+          this.getDateStr();
+          !this.timer && (this.timer = setInterval(() => {
+            this.getDateStr();
+          }, 10000));
+        }else {
+          this.clearTimer();
+        }
+      }
+    },
+    destroyed() {
+      this.clearTimer();
+    },
+    methods: {
+      getComponentInfo(details) {
+        this.setNavigationBarTitle(details.title);
+        this.details = details;
+        this.getEmpDeptTree(details.checkGroupId);
+      },
+      // 查询部门人员树
+			getEmpDeptTree(checkGroupId) {
+				this.$store.dispatch({
+					type: 'allocationPerson/commActions',
+          key: "getGroupEmpList",
+          data: {checkGroupId}
+				}).then(data => {
+					if(data) {
+            this.empList = data || [];
+          }
+				});
+      },
+      // 指派查核人员改变
+      changeDetails(selectVal, selectData, index) {
+        this.details = {
+          ...this.details,
+          empId: selectData.employeeId,
+          empName: selectData.employeeName
+        }
+      },
+			// 时间变化
+			changeDateTime(dateObj, pickType) {
+        if(pickType === 'startDate'){ // 开始时间变化
+          this.diffDateTime(dateObj.f3, this.details.endDate);
+        }else {
+          this.diffDateTime(this.details.startDate, dateObj.f3);
+        }
+        this.details = {
+          ...this.details,
+          [pickType]: dateObj.f3
+        };
+      },
+      // 开始时间和结束时间对比
+      diffDateTime(startTime, endTime){
+        if (moment(startTime).valueOf() > moment(endTime).valueOf()) {
+          this.showModal('开始时间不能大于结束时间');
+        }
+      },
+      // 点击确定
+      sure() {
+        const { empId, startDate, endDate} = this.details;
+        if(this.isSubmit === true) {
+         return this.changeCheckList(this.checkList);
+        }
+        if(this.title === '指派查核人员'){
+          if(!empId){
+            return this.showModal('请选择查核人');
+          }
+          this.setNavigationBarTitle('设置查核时间');
+        }else {
+          if(!startDate){
+            return this.showModal('请选择开始时间');
+          }
+          if(!endDate){
+            return this.showModal('请选择结束时间');
+          }
+          if(!empId){
+            this.setNavigationBarTitle('指派查核人员');
+            this.isSubmit = true;
+          }else {
+            this.changeCheckList(this.checkList);
+          }
+        }
+      },
+      // 更改查核列表数据
+      changeCheckList(data) {
+        const { situationId, checkId, checkGroupId } = this.details;
+        let checkList = this.checkList.map((item, i) => {
+          if(this.details.index === i) {
+            return {
+              ...item,
+              ...this.details
+            }
+          }else {
+            return item;
+          }
+        });
+        this.$store.commit({
+          type: 'editCheckList/comChangeState',
+          key: 'checkList',
+          data: checkList
+        });
+        // 关闭当前页面,返回上一页面
+        uni.navigateBack({delta: 1});
+      },
+      // 修改导航名称
+      setNavigationBarTitle(title) {
+        this.title = title;
+        uni.setNavigationBarTitle({
+			  	title
+        });
+      },
+     // 获取当前时间
+      getDateStr() {
+        this.$store.dispatch({
+          type: "commActions",
+           key: "getDateStr" ,
+        }).then((data) => {
+          if (data) {
+            this.dateStr = data;
+          }
+        });
+      },
+      showModal(content) {
+        uni.showModal({
+          content,
+          showCancel: false
+        });
+      },
+      // 清除定时器
+      clearTimer(){
+        if(this.timer){
+          clearInterval(this.timer);
+          this.timer = null;
+        }
+      }
+    },
+	}
+</script>
+
+<style lang="less">
+	.allocationPerson-page {
+		height: 100%;
+
+		.scroll-y {
+			height: calc(100% - 87.5rpx);
+      padding-top: 15rpx;
+
+       .date-view {
+         padding: 0 25rpx;
+         background: #fff;
+
+				 .row {
+					 display: flex;
+					 align-items: center;
+					 height: 62.5rpx;
+					 border-top: 0.62rpx solid #DADEE6;
+
+					 	.label {
+							width: 112.5rpx;
+							font-size: 22.5rpx;
+							color: #292C33;
+						}
+
+						.date-box {
+							padding-left: 25rpx;
+							flex: 1;
+						}
+				 }
+			 }
+		}
+	}
+</style>

+ 17 - 0
pages/allocationPerson/model.js

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

+ 14 - 0
pages/allocationPerson/server.js

@@ -0,0 +1,14 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+  // 查核组员列表
+  getGroupEmpList: {
+    method: 'GET',
+    url: 'common/groupEmpList'
+  }
+};
+
+export const commServer = (key, data) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 211 - 0
pages/auditItemDetails/auditItemDetails.vue

@@ -0,0 +1,211 @@
+<template>
+	<view class="auditItemDetails">
+		<view class="top-box">
+			<view class="icon-wrap">
+				<image src="../../static/chahexiang-bg.png"></image>
+				<text>查核项</text>
+			</view>
+			<image class="img-tuli" 
+				@click="goLegendDetails(detail.checkItemId)"
+				src="../../static/tuli.png"></image>
+			<view class="title-wrap">
+				<text>{{detail.checkItemName}}</text>
+				<text>{{detail.checkPointName}}</text>
+			</view>
+			<view class="children">
+				<view class="child">
+					<text>{{detail.deptName || '--'}}</text>
+					<text>查核单位</text>
+				</view>
+				<view class="child">
+					<text>{{detail.checkModelName || '--'}}</text>
+					<text>查核方式</text>
+				</view>
+				<view class="child">
+					<text>{{detail.lastResult || '--'}}</text>
+					<text>上次结果</text>
+				</view>
+				<view class="child">
+					<text>{{detail.checkResult || '--'}}</text>
+					<text>本次结果</text>
+				</view>
+			</view>
+		</view>
+		<view class="bottom-box" 
+			v-for="(item, index) in detail.checkResultRequestList"
+			:key="index">
+			<view class="box-item">
+				<view>查核结果</view>
+				<view>{{item.checkResultDescribe}}</view>
+			</view>
+			<view class="box-item">
+				<view>查核时间</view>
+				<view>{{item.completeTimeStr}}</view>
+			</view>
+			<view class="box-item">
+				<view>图片展示</view>
+				<view class="img-wrap">
+					<image mode="widthFix" 
+						v-for="(img, i) in getArr(item.checkResultUrl)"
+						:key="i"
+						:src="img"></image>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * 查核项详情
+	 */
+	export default {
+		data() {
+			return {
+				detail: {
+					checkPointName: '',
+					deptName: '',
+					checkModelName: '',
+					lastResult: '',
+					checkResult: '',
+					checkItemName: '',
+					checkResultRequestList: []
+				}
+			};
+		},
+		onLoad: function ({id}) {
+			this.dispatch('checkTaskDetail', {id}).then((data)=>{
+				if(data) {
+					this.detail = data;
+				}
+			});
+		},
+		methods: {
+			getArr(value) {
+				return value ? value.split(',') : [];
+			},
+			goLegendDetails(checkItemId) {
+				//跳转到图例详情
+				uni.navigateTo({
+					url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}`
+				});
+			},
+			dispatch(key, data) {
+				return this.$store.dispatch({type: 'checkList/commActions', key, data});
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.auditItemDetails {
+		.top-box {
+			position: relative;
+			margin-top: 15rpx;
+			padding-bottom: 37.5rpx;
+			background-color: #fff;
+			.icon-wrap {
+				position: relative;
+				overflow: hidden;
+				width: 125rpx;
+				height: 37.5rpx;
+				image {
+					width: 100%;
+					height: 100%;
+				}
+				text {
+					position: absolute;
+					top: 0;
+					left: 25rpx;
+					font-size: 20rpx;
+					line-height: 37.5rpx;
+					color: #fff;
+				}
+			}
+			.img-tuli {
+				position: absolute;
+				top: 25rpx;
+				right: 25rpx;
+				width: 40rpx;
+				height: 40rpx;
+			}
+			.title-wrap {
+				display: flex;
+				flex-direction: column;
+				padding: 25rpx 31.25rpx;
+				text {
+					font-size: 25rpx;
+					line-height: 37.5rpx;
+					&:last-child {
+						padding-top: 4.37rpx;
+						font-size: 17.5rpx;
+						line-height: 26.25rpx;
+						color: #7A8599;
+					}
+				}
+			}
+			.children {
+				display: flex;
+				flex-direction: row;
+				align-items: center;
+				margin-top: 10.62rpx;
+				.child {
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					align-items: center;
+					flex: 1;
+					border-right: 1px solid #DADEE6;
+					text {
+						font-weight: 500;
+						&:last-child {
+							font-size: 17.5rpx;
+							line-height: 26.25rpx;
+							color: #7A8599;
+							font-weight: 400;
+						}
+					}
+					&:last-child {
+						border-right: 0;
+					}
+				}
+			}
+		}
+		.bottom-box {
+			margin-top: 15rpx;
+			padding: 0 25rpx;
+			background-color: #fff;
+			
+			.box-item {
+				display: flex;
+				flex-direction: row;
+				border-bottom: 0.62rpx solid #DADEE6;
+				padding: 26.25rpx 0;
+				&:last-child {
+					border-bottom: 0;
+				}
+				>view {
+					width: 100%;
+					&:first-child {
+						width: 175rpx;
+						white-space: nowrap;
+						color: #525866;
+					}
+					&.img-wrap {
+						display: flex;
+						flex-direction: row;
+						flex-wrap: wrap;
+						
+						image {
+							margin-bottom: 12.5rpx;
+							width: calc(50% - 12.5rpx);
+							&:nth-child(2n) {
+								margin-left: 12.5rpx;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 135 - 39
pages/checkList/checkList.vue

@@ -1,7 +1,14 @@
 <template>
 <template>
 	<view class="check-map-list">
 	<view class="check-map-list">
+		<tm-top-menu>
+			<view class="top-menu"  @click="showModalHandle(!showModal)">
+				<text>第{{checkIndex}}/{{planList.length}}次查核</text>
+				<image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
+			</view>
+		</tm-top-menu>
 		<view class="item"
 		<view class="item"
 			v-for="(item, index) in depList" 
 			v-for="(item, index) in depList" 
+			@click="gotoCheckMainPointsPage(item)"
 			:key="index">
 			:key="index">
 			<view class="title-wrap">
 			<view class="title-wrap">
 				<text>{{item.deptName}}</text>
 				<text>{{item.deptName}}</text>
@@ -18,55 +25,98 @@
 			</view>
 			</view>
 			<view class="footer">
 			<view class="footer">
 				<text>查核人:{{item.empName}}</text>
 				<text>查核人:{{item.empName}}</text>
-				<text>{{item.startDate}}~{{item.endDate}}</text>
+				<text>
+					{{item.startDate}}~{{item.endDate}}
+				</text>
+			</view>
+			<view class="icon-wrap" 
+				v-if="Number(item.completeStatus) === 2 || Number(item.completeStatus) === 3">
+				<image :src="`../../static/${Number(item.completeStatus) === 2 ?'hight-bg':'top-img'}.png`"></image>
+				<text>{{item.completeDes}}</text>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="null" v-if="depList.length === 0">暂无数据</view>
 		<view class="null" v-if="depList.length === 0">暂无数据</view>
-		<view class="modal">
+		<tm-modal v-show="showModal" v-on:click="showModalHandle(false)">
 			<view class="content-list">
 			<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 class="list-item" 
+					v-for="(item, index) in planList"
+					:class="{active: checkId === item.id}" 
+					@click="checkItem($event, item.id)"
+					:key="index">
+					<view>
+						<text>{{item.name}}({{item.startDate}} ~ {{item.endDate}})</text>
+						<view class="item-icon" 
+							:class="{icon2: Number(item.status) === 2}" 
+							v-if="Number(item.status) !== 1">
+							{{Number(item.status) === 2 ? '进行中' : '已完成'}}
+						</view>
+					</view>
+					<image class="check-img" 
+						v-if="checkId === item.id"
+						src="../../static/checkStatus.png"></image>
 				</view>
 				</view>
 			</view>
 			</view>
-		</view>
+		</tm-modal>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import {_stopPropagation} from "../../utils/compatible.js";
+	
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			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  必有字段  备注:分配结束时间
-					}
-				]
+				showModal: false,
+				planList: [],
+				checkId: '',
+				depList: []
 			};
 			};
 		},
 		},
-		created: function(){
-			this.dispatch('depList', {checkId: ''}).then((data)=>{
-				console.log(data);
+		computed: {
+			checkIndex: function() {
+				let index = this.planList.findIndex((item)=> item.id === this.checkId);
+				if(index !== -1) {
+					return index + 1;
+				} else {
+					return 0;
+				}
+			}
+		},
+		onLoad: function ({situationId}) {
+			this.dispatch('planList', {situationId}).then((data)=>{
 				if(data) {
 				if(data) {
-					// this.depList = data;
+					this.planList = data;
+					let check = data.find((item)=> Number(item.status)=== 2);
+					this.checkId = check ? check.id 
+						: data.length > 0 ? data[0].id : '';
+					this.getDepList();
 				}
 				}
 			});
 			});
 		},
 		},
 		methods: {
 		methods: {
+			checkItem: function(e, id) {
+				_stopPropagation(e);
+				if(this.checkId === id) return;
+				this.checkId = id;
+				this.getDepList();
+			},
+			getDepList: function() {
+				this.dispatch('depList', {checkId: this.checkId}).then((data)=>{
+					if(data) {
+						this.depList = data;
+						this.showModalHandle(false);
+					}
+				});
+			},
+			showModalHandle: function(showModal) {
+				this.showModal = showModal;
+			},
+			gotoCheckMainPointsPage({checkId, deptId}) {
+				//跳转到查核要点
+				uni.navigateTo({
+					url: `/pages/checkMainPoints/checkMainPoints?checkId=${checkId}&deptId=${deptId}`
+				});
+			},
 			dispatch: function(key, data) {
 			dispatch: function(key, data) {
 				return this.$store.dispatch({type: 'checkList/commActions', key, data});
 				return this.$store.dispatch({type: 'checkList/commActions', key, data});
 			},
 			},
@@ -77,6 +127,41 @@
 <style lang="less">
 <style lang="less">
 	.check-map-list {
 	.check-map-list {
 		padding: 25rpx;
 		padding: 25rpx;
+		padding-top: 75rpx;
+		.top-menu {
+			overflow: hidden;
+			display: flex;
+			flex-direction: row;
+			justify-content: center;
+			align-items: center;
+			height: 50rpx;
+			image {
+				margin-left: 9.37rpx;
+				width: 12.5rpx;
+				height: 12.5rpx;
+			}
+		}
+		.item {
+			position: relative;
+		}
+		.icon-wrap {
+			position: absolute;
+			top: 0;
+			right: 0;
+			width: 100rpx;
+			height: 35rpx;
+			image {
+				width: 100%;
+				height: 100%;
+			}
+			text {
+				position: absolute;
+				left: 28.75rpx;
+				line-height: 35rpx;
+				font-size: 17.5rpx;
+				color: #fff;
+			}
+		}
 		.footer {
 		.footer {
 			display: flex;
 			display: flex;
 			flex-direction: row;
 			flex-direction: row;
@@ -95,11 +180,13 @@
 		color: #999;
 		color: #999;
 	}
 	}
 	.content-list {
 	.content-list {
+		padding-top: 50rpx;
 		width: 100%;
 		width: 100%;
 		background-color: #fff;
 		background-color: #fff;
 		.list-item {
 		.list-item {
 			display: flex;
 			display: flex;
 			flex-direction: row;
 			flex-direction: row;
+			justify-content: space-between;
 			align-items: center;
 			align-items: center;
 			border-bottom: 1px solid #DADEE6;
 			border-bottom: 1px solid #DADEE6;
 			padding: 0 25rpx;
 			padding: 0 25rpx;
@@ -108,20 +195,29 @@
 			font-size: 22.5rpx;
 			font-size: 22.5rpx;
 			line-height: 33.75rpx;
 			line-height: 33.75rpx;
 			color: #292C33;
 			color: #292C33;
-			.item-icon {
-				border-radius: 5rpx;
-				padding: 6.25rpx 11.25rpx;
-				line-height: 26.25rpx;
-				color: #29CC96;
-				background-color: #e9f9f4;
+			.check-img {
+				float: right;
+				width: 19.37rpx;
+				height: 14.37rpx;
 			}
 			}
-			&.active {
-				color: #3377FF;
+			>view {
+				display: flex;
+				flex-direction: row;
 				.item-icon {
 				.item-icon {
-					color: #FFAA00;
-					background-color: #fff9ef;
+					border-radius: 5rpx;
+					padding: 6.25rpx 11.25rpx;
+					line-height: 26.25rpx;
+					color: #29CC96;
+					background-color: #e9f9f4;
+					&.icon2 {
+						color: #FFAA00;
+						background-color: #fff9ef;
+					}
 				}
 				}
 			}
 			}
+			&.active {
+				color: #3377FF;
+			}
 		}
 		}
 	}
 	}
 </style>
 </style>

+ 0 - 1
pages/checkList/model.js

@@ -1,5 +1,4 @@
 import { commServer } from './server.js';
 import { commServer } from './server.js';
-	import {dateHandle} from "../../utils/dateHandle.js";
 	
 	
 export default {
 export default {
   namespaced: true,
   namespaced: true,

+ 20 - 2
pages/checkList/server.js

@@ -5,9 +5,27 @@ const requestList = {
   depList: {
   depList: {
     method: 'GET',
     method: 'GET',
     url: 'plan/depList',
     url: 'plan/depList',
-		// successMessage: '',
-		// needLoading: false // 还有这两个参数,但不是必传的,默认loading
   }, 
   }, 
+	// 计划列表
+  planList: {
+    method: 'GET',
+    url: 'plan/list',
+  }, 
+	// 查核任务列表2
+	checkTaskDetailList: {
+	  method: 'GET',
+	  url: 'checkTask/checkTaskDetailList',
+	}, 
+	// 查核项明细
+	checkTaskDetail: {
+	  method: 'GET',
+	  url: 'checkTask/checkTaskDetail',
+	}, 
+	// 获取查核任务正确答案(小灯泡)
+	rightAnswer: {
+	  method: 'GET',
+	  url: 'checkTask/rightAnswer',
+	}, 
 };
 };
 
 
 export const commServer = (key, data) => {
 export const commServer = (key, data) => {

+ 345 - 0
pages/checkMainPoints/checkMainPoints.vue

@@ -0,0 +1,345 @@
+<template>
+	<view class="checkMainPoints">
+		<tm-top-menu>
+			<view class="top-search">
+				<view class="search">
+					<input confirm-type="search" 
+						@input="filterFromName" 
+						placeholder="搜索查核要点或查核项" />
+					<image src="../../static/search.png"></image>
+				</view>
+				<view class="top-btn-wrap">
+					<view class="btn-list" v-if="permissions.includes(3)">
+						<com-button v-for="(item, index) in btnArr" 
+							:btnText="item.label" 
+							:type="active === item.id ? 'pramary':'default'" 
+							v-on:btnClick="btnClick(item.id)"/>
+					</view>
+					<view class="select-wrap" 
+						v-else-if="permissions.includes(2) || permissions.includes(1)" 
+						@click="toggleModal(!showModal)">
+						<text>{{getCheckPointName}}</text>
+						<image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
+					</view>
+				</view>
+			</view>
+		</tm-top-menu>
+		<tm-modal v-show="showModal" v-on:click="toggleModal(false)">
+			<view class="content-list">
+				<view class="list-item"
+					v-for="(item, index) in point"
+					:class="{active: checkPointId === item.checkPointId}"
+					@click="checkPointHandle(item.checkPointId)">
+					<text>{{item.checkPointName}}</text>
+					<image class="check-img"
+						v-if="checkPointId === item.checkPointId"
+						src="../../static/checkStatus.png"></image>
+				</view>
+			</view>
+		</tm-modal>
+		<view class="list" v-for="(item, index) in detailList" :key="index">
+			<view class="title">查核要点一:{{item.checkPointName}}</view>
+			<view class="item" 
+				v-for="(child, n) in item.responseList" 
+				@click="childClick(child)"
+				:key="n">
+				<view class="top-box">
+					<view class="top-box-left">
+						<view class="index-icon">{{n + 1}}</view>
+						<text>{{child.checkItemName}}</text>
+					</view>
+					<image src="../../static/tuli.png" 
+						@click="goLegendDetails(child.checkItemId)"></image>
+				</view>
+				<view class="children">
+					<view class="child">
+						<text>{{child.deptName || '--'}}</text>
+						<text>查核单位</text>
+					</view>
+					<view class="child">
+						<text>{{child.checkModelName || '--'}}</text>
+						<text>查核方式</text>
+					</view>
+					<view class="child">
+						<text>{{child.lastResult || '--'}}</text>
+						<text>上次结果</text>
+					</view>
+					<view class="child">
+						<text>{{child.checkResult || '--'}}</text>
+						<text>本次结果</text>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				btnArr: [
+					{id: 0, label: '全部'},
+					{id: 1, label: '未查核'},
+					{id: 2, label: '已查核'},
+				],
+				showModal: false,
+				detailList: [],
+				copyDetailList: [],
+				point: [{checkPointId: 'all', checkPointName: '全部要点'}],
+				checkPointId: 'all',
+				permissions: uni.getStorageSync('permissions'),
+				active: 0
+			};
+		},
+		computed: {
+			getCheckPointName() {
+				let item=this.point.find((item)=> item.checkPointId === this.checkPointId);
+				return item ? item.checkPointName : '';
+			},
+		},
+		onLoad: function ({checkId,deptId}) {
+			this.dispatch('checkTaskDetailList', {checkId,deptId}).then((data)=>{
+				if(data) {
+					this.detailList = data;
+					this.copyDetailList = data;
+					data.map(({checkPointId,checkPointName})=>{
+						this.point.push({checkPointId, checkPointName});
+					});
+				}
+			});
+		},
+		methods: {
+			btnClick(id) {
+				this.active = id;
+				this.filterCompleteFlag(id);
+			},
+			childClick(child) {
+				// 查核者,管理员
+				if(this.permissions.includes(1) || this.permissions.includes(3)) { 
+					let str = '';
+					if(child.checkResult) {
+						// 跳转到查核项详情
+						str = 'auditItemDetails/auditItemDetails';
+					} else {
+						// 跳转到查核结果提交
+						str = 'mainPointsDetail/mainPointsDetail';
+					}
+					uni.navigateTo({
+						url: `/pages/${str}?id=${child.id}`
+					});
+				}
+			},
+			toggleModal(flage) {
+				this.showModal = flage;
+			},
+			checkPointHandle(id) {
+				this.checkPointId = id;
+				if(id === 'all') {
+					this.detailList = [...this.copyDetailList];
+				} else {
+					this.detailList = this.copyDetailList
+						.filter((item)=> item.checkPointId === id);
+				}
+			},
+			filterCompleteFlag(btnId) {
+				if(btnId === 0) {
+					this.detailList = [...this.copyDetailList];
+				} else {
+					let completeFlag = btnId === 1 ? false : true;
+					this.detailList = this.copyDetailList.map((item)=>{
+						return {
+							...item,
+							responseList: item.responseList
+								.filter((child)=> child.completeFlag === completeFlag)
+						}
+					});
+				}
+			},
+			filterFromName(e) {
+				const {value} = e.detail; 
+				if(value === '') {
+					this.detailList = [...this.copyDetailList];
+				} else {
+					this.detailList = [];
+					this.copyDetailList.map((item)=>{
+						let responseList = item.responseList
+							.filter((child)=> child.checkItemName.indexOf(value) >= 0);
+						if(item.checkPointName.indexOf(value) >= 0) {
+							this.detailList.push({...item});
+						} else if(responseList.length > 0) {
+							this.detailList.push({...item, responseList});
+						}
+					});
+				}
+			},
+			goLegendDetails(checkItemId) {
+				//跳转到图例详情
+				uni.navigateTo({
+					url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}`
+				});
+			},
+			dispatch(key, data) {
+				return this.$store.dispatch({type: 'checkList/commActions', key, data});
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.checkMainPoints {
+		padding-top: 105rpx;
+		font-size: 22.5rpx;
+		line-height: 33.75rpx;
+		background-color: #F5F6FA;
+		
+		.top-search {
+			display: flex;
+			flex-direction: row;
+			align-items: center;
+			padding: 25rpx;
+			background-color: #fff;
+			box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
+			.search {
+				position: relative;
+				width: 100%;
+				height: 55rpx;
+				line-height: 55rpx;
+				background-color: #F0F2F7;
+				input {
+					padding: 0 45rpx 0 15rpx;
+					height: 55rpx;
+					line-height: 55rpx;
+					font-size: 22.5rpx;
+				}
+				image {
+					position: absolute;
+					top: 16.87rpx;
+					right: 15rpx;
+					width: 21.25rpx;
+					height: 21.25rpx;
+				}
+			}
+			.top-btn-wrap {
+				padding-left: 25rpx;
+				.btn-list {
+					display: flex;
+					flex-direction: row;
+					.com-button {
+						margin-left: 5rpx;
+						&:first-child {
+							margin-left: 0;
+						}
+					}
+				}
+				.select-wrap {
+					display: flex;
+					flex-direction: row;
+					align-items: center;
+					white-space: nowrap;
+					image {
+						margin-left: 9.37rpx;
+						width: 12.5rpx;
+						height: 12.5rpx;
+					}
+				}
+			}
+		}
+		.content-list {
+			padding-top: 105rpx;
+			width: 100%;
+			background-color: #fff;
+			.list-item {
+				display: flex;
+				flex-direction: row;
+				justify-content: space-between;
+				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;
+				.check-img {
+					float: right;
+					width: 19.37rpx;
+					height: 14.37rpx;
+				}
+				&.active {
+					color: #3377FF;
+				}
+			}
+		}
+		.list {
+			.title {
+				padding-left: 25rpx;
+				width: 100%;
+				height: 62.5rpx;
+				line-height: 62.5rpx;
+				color: #666F80;
+			}
+			.item {
+				margin-top: 15rpx;
+				padding: 25rpx 0;
+				height: 167.5rpx;
+				background-color: #fff;
+				&:nth-child(2) {
+					margin-top: 0;
+				}
+				.top-box {
+					display: flex;
+					flex-direction: row;
+					justify-content: space-between;
+					align-items: center;
+					
+					.top-box-left {
+						display: flex;
+						flex-direction: row;
+						.index-icon {
+							margin-right: 15rpx;
+							border-radius: 0 62.5rpx 62.5rpx 0;
+							width: 50rpx;
+							height: 35rpx;
+							line-height: 35rpx;
+							text-align: center;
+							color: #fff;
+							background-color: #66B2FE;
+						}
+					}
+					image {
+						margin-right: 15rpx;
+						width: 40rpx;
+						height: 40rpx;
+					}
+				}
+				.children {
+					display: flex;
+					flex-direction: row;
+					align-items: center;
+					margin-top: 18.75rpx;
+					.child {
+						display: flex;
+						flex-direction: column;
+						justify-content: center;
+						align-items: center;
+						flex: 1;
+						border-right: 1px solid #DADEE6;
+						text {
+							font-weight: 500;
+							&:last-child {
+								font-size: 17.5rpx;
+								line-height: 26.25rpx;
+								color: #7A8599;
+								font-weight: 400;
+							}
+						}
+						&:last-child {
+							border-right: 0;
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 338 - 0
pages/editCheckList/editCheckList.vue

@@ -0,0 +1,338 @@
+<template>
+	<view class="check-map-list">
+    <scroll-view class="scroll-y" scroll-y="true" v-if="checkList.length > 0">
+      <view class="item"
+	    	v-for="(item, index) in checkList"
+	    	: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">
+	    	 <view class="row" @click="checkEdit(item, index, '指派查核人员')">
+	    	 	 <text class="label">查核人</text>
+	    		 <view class="content">
+	    		 	 <text :class="['base-text', item.empName ? 'black-color' : '']">
+	    				 {{ item.empName ? item.empName : '选择查核成员'}}
+	    			 </text>
+	    		 </view>
+	    		 <image class="arrow" src="/static/images/icon-more.png"></image>
+	    	 </view>
+	    	 <view class="row" @click="checkEdit(item, index, '设置查核时间')">
+	    	 	 <text class="label">计划时间</text>
+	    		 <view class="content">
+	    		 	 <text :class="['base-text', item.startDate ? 'black-color' : '']">
+	    			   {{ item.startDate ? item.startDate : '选择起始时间' }}
+	    			 </text>
+	    		 	 <text class="center-text">至</text>
+	    			 <text :class="['base-text', item.endDate ? 'black-color' : '']">
+	    			   {{ item.endDate ? item.endDate : '选择结束时间' }}
+	    			 </text>
+	    		 </view>
+	    		 <image class="arrow" src="/static/images/icon-more.png"></image>
+	    	 </view>
+	    	</view>
+	    </view>
+    </scroll-view>
+		<view class="null" v-else>暂无数据</view>
+    <view class="fixed-buttom-btn" @click="submit" v-if="checkList.length > 0">
+			<text class="btn-text">完成</text>
+		</view>
+	</view>
+</template>
+
+<script>
+  // 查核列表(查核人和计划时间可编辑)
+  import { mapState } from "vuex";
+  import moment from 'moment';
+	export default {
+    computed: {
+      ...mapState({
+        checkList: state => state.editCheckList.checkList
+      })
+    },
+		data() {
+			return {
+        // 查核组id
+        checkGroupId: 0,
+        // 情境id (批量修改有,不然为0)
+        situationId: 0,
+        // 查核id
+        checkId: 0,
+        // 计划开始时间
+        startDate: '',
+        // 计划结束时间
+        endDate: '',
+        multiple: 'false',
+        planList: []
+			};
+		},
+    onLoad({ situationId, checkId, checkGroupId, startDate, endDate, multiple }){
+      this.getCheckList(checkId);
+      this.checkGroupId = checkGroupId ? +checkGroupId : 0;
+      this.situationId = situationId ? +situationId : 0;
+      this.checkId = checkId ? +checkId : 0;
+      this.startDate = startDate;
+      this.endDate = endDate;
+      this.multiple = multiple;
+    },
+		methods: {
+      // 完成
+      submit() {
+        // baseEmpList: 第一次计划修改的数据; changePlanList: 批量分配,记录第一次计划修改数据的信息;  multipleEmpList: 批量修改的数据
+        let baseEmpList = [], changePlanList = [], multipleEmpList = [];
+        // planStartTimestamp: 开始计划时间戳;
+        let planStartTimestamp = this.dateToTimestamp(this.startDate);
+        this.checkList.map((item, i) => {
+          const {checkId, deptId, empId, empName, startDate, endDate} = item;
+          if(empId && startDate && endDate){
+            baseEmpList.push({
+              checkId,
+              deptId,
+              empId,
+              empName,
+              startDate: startDate || '',
+              endDate: endDate || ''
+            });
+            if(this.multiple === 'true'){ // 批量分配
+              changePlanList.push({
+                index: i, // 第一次计划修改的下标
+                baseEmpListIndex: baseEmpList.length -1,
+                startDiffTimestamp: startDate ? this.dateToTimestamp(startDate) - planStartTimestamp : 0, // 开始时间差
+                endDifTimestamp: endDate ? this.dateToTimestamp(endDate) - planStartTimestamp : 0 // 结束时间差
+              });
+            }
+          }
+        });
+        if(this.multiple === 'true') { // 批量分配
+          this.$store.dispatch({
+		      	type: 'planList/commActions',
+		      	payload: {
+		      		key: 'planList',
+		      		data:{situationId: this.situationId}
+		      	}
+		      }).then((planList) => {
+            (planList || []).map(((planItem, planI) => {
+               if(planI != 0){ // 过滤掉第一条
+                 // 计划开始时间戳
+                 let planStartTimestamp = planItem.startDate ? this.dateToTimestamp(planItem.startDate + ' 00:00') : 0;
+                 // 计划结束时间戳
+                 let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem.endDate + ' 23:59') : 0;
+
+                 planItem.empList && planItem.empList.map((empItem, empI) => {
+                   // 当前分配明细
+                   let currentEmp = changePlanList.find(item => item.index === empI);
+                   if(currentEmp){
+                     const { baseEmpListIndex, startDiffTimestamp, endDifTimestamp } = currentEmp;
+                     const { empId, empName } = baseEmpList[baseEmpListIndex] || {};
+                     multipleEmpList.push({
+                       empId,
+                       empName,
+                       checkId: empItem.checkId,
+                       deptId: empItem.deptId,
+                       startDate: (planStartTimestamp && startDiffTimestamp)
+                         ? this.getDateStr(planStartTimestamp, planEndTimestamp, startDiffTimestamp, planItem.endDate)
+                         : '',
+                       endDate: (planStartTimestamp && endDifTimestamp)
+                         ? this.getDateStr(planStartTimestamp, planEndTimestamp, endDifTimestamp, planItem.endDate)
+                         : ''
+                     });
+                   }
+                })
+               }
+            }))
+            multipleEmpList = [...baseEmpList, ...multipleEmpList];
+            // console.log('批量',multipleEmpList )
+            this.batchDistribute(multipleEmpList);
+          })
+        }else { // 单个分配
+          this.batchDistribute(baseEmpList);
+        }
+      },
+      /**
+       * 获取时间字符串
+       * @param {Number} startTimestamp 计划开始时间戳
+			 * @param {Number} endTimestamp 计划结束时间戳
+			 * @param {Number} diffTimestamp 第一次计划中的时间差
+			 * @param {String} endDateStr 计划结束时间字符串
+       */
+      getDateStr(startTimestamp, endTimestamp, diffTimestamp, endDateStr) {
+        if((startTimestamp + diffTimestamp) > endTimestamp){ // 超出计划结束时间, 则取计划结束时间
+          return endDateStr;
+        }else {
+          return moment(startTimestamp + diffTimestamp).format('YYYY-MM-DD HH:mm');
+        }
+      },
+      // 分配单位查核人员
+      batchDistribute(empList) {
+        if(empList.length === 0) { // 未作修改直接跳转页面
+          return this.redirectToPlanList();
+        }
+        this.$store.dispatch({
+          type: 'editCheckList/commActions',
+          key: "batchDistribute",
+          data: { empList }
+        }).then(data => {
+          if(data){
+            this.redirectToPlanList();
+          }
+        });
+      },
+      // 跳转页面
+      redirectToPlanList() {
+        uni.redirectTo({
+          url: `/pages/planList/planList?situationId=${this.situationId}&checkGroupId=${this.checkGroupId}`
+        });
+      },
+      // 日期时间转换为时间戳
+      dateToTimestamp(dataStr) {
+        return dataStr ? moment(dataStr).valueOf() : 0
+      },
+      checkEdit(data, index, title) {
+        if(data.completeState){ // 计划已开始, 不能编辑查核人和计划时间
+          uni.showModal({
+            content: '因查核计划已开始,故不可修改',
+            showCancel: false
+          });
+        }else {// 跳转编辑页面
+          const { empId, empName, startDate, endDate } = data;
+          let details = {
+            index, // 修改的下标
+            title, // 标题
+            empId,
+            empName,
+            startDate,
+            endDate,
+            situationId: this.situationId, //  情境id (批量修改有,不然为0)
+            checkId: this.checkId, // 查核id
+            checkGroupId: this.checkGroupId, //查核组id
+            planStartDate: this.startDate, // 计划开始时间
+            planEndDate: this.endDate // 计划结束时间
+          }
+          uni.navigateTo({
+			  	  url: `/pages/allocationPerson/allocationPerson?details=${encodeURIComponent(JSON.stringify(details))}`
+			  	});
+        }
+      },
+      // 获取查核列表
+      getCheckList(checkId) {
+        this.$store.dispatch({
+          type: 'editCheckList/commActions',
+          key: "getCheckList",
+          data: { checkId }
+        }).then(data => {
+          this.$store.dispatch({
+            type: "commActions",
+            key: "getDateStr",
+          }).then((dateStr) => {
+            if (dateStr) {
+              this.$store.commit({
+                type: 'editCheckList/comChangeState',
+                key: 'checkList',
+                data: (data || []).map(item => {
+                  if (item.startDate && moment(item.startDate).valueOf() < moment(dateStr).valueOf()) {
+                    return {
+                      ...item,
+                      completeState: true // true:说明计划已开始, 不能编辑查核人和计划时间
+                    }
+                  }else {
+                    return item
+                  }
+                })
+              });
+            }
+          });
+        });
+      },
+      // 获取计划列表
+      getPlanList() {
+        this.$store.dispatch({
+		    	type: 'planList/commActions',
+		    	payload: {
+		    		key: 'planList',
+		    		data:{
+		    			situationId: this.situationId
+		    		}
+		    	}
+		    }).then((data) => {
+          this.planList = data || [];
+        })
+      }
+		}
+	}
+</script>
+
+<style lang="less">
+	.check-map-list {
+    height: 100%;
+
+    .scroll-y {
+			height: calc(100% - 87.5rpx);
+      padding-top: 25rpx;
+
+      .footer {
+
+	    	.row {
+	    		display: flex;
+	    		align-items: center;
+	    		justify-content: space-between;
+	    		border-top: 1px solid #DADEE6;
+	    		height: 62.5rpx;
+	    		padding: 0 25rpx;
+	    		font-size: 22.5rpx;
+
+	    		.label {
+	    			color: #525866;
+	    			width: 93.75rpx;
+	    		}
+
+	    		.content {
+	    			display: flex;
+	    			flex-direction: row;
+	    			align-items: center;
+	    			flex: 1;
+	    			height: 100%;
+	    			padding: 0 25rpx;
+
+	    			.base-text {
+	    				flex: 1;
+	    				line-height: 62.5rpx;
+	    				color: #B8BECC;
+              font-weight: normal;
+              margin-bottom: 0;
+	    			}
+
+	    			.center-text {
+	    				padding: 0 25rpx;
+	    				color: #292C33;
+	    			}
+
+	    			.black-color {
+	    				color: #292C33;
+	    			}
+	    		}
+
+	    		.arrow {
+	    			width: 12.5rpx;
+	    			height: 21.25rpx;
+	    		}
+	    	}
+	    }
+    }
+
+		.null {
+			margin-top: 375rpx;
+			text-align: center;
+      color: #999;
+		}
+	}
+</style>

+ 19 - 0
pages/editCheckList/model.js

@@ -0,0 +1,19 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+     // 查核列表
+     checkList: []
+  },
+  mutations: {
+		comChangeState(state, {key, data}) {
+			state[key] = data;
+		},
+  },
+  actions: {
+		commActions({ commit, state }, { key, data }) {
+      return commServer(key, data);
+		},
+  }
+}

+ 24 - 0
pages/editCheckList/server.js

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

+ 84 - 0
pages/legendDetails/legendDetails.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="legendDetails">
+		<view class="box-item">
+			<view>图例介绍</view>
+			<view>{{rightAnswer.rightAnswerText}}</view>
+		</view>
+		<view class="box-item">
+			<view>图例图片</view>
+			<view class="img-wrap">
+				<image mode="widthFix"
+					v-for="(img, i) in getArr" 
+					:key="i"
+					:src="img"></image>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	/**
+	 * 图例详情
+	 */
+	export default {
+		data() {
+			return {
+				rightAnswer: {
+					rightAnswerText: '',
+					rightAnswerImage: ''
+				}
+			};
+		},
+		computed: {
+			getArr() {
+				const {rightAnswerImage} = this.rightAnswer;
+				return rightAnswerImage ? rightAnswerImage.split(',') : [];
+			}
+		},
+		onLoad: function ({checkItemId}) {
+			this.dispatch('rightAnswer', {checkItemId}).then((data)=>{
+				if(data) {
+					this.rightAnswer = data;
+				}
+			});
+		},
+		methods: {
+			dispatch(key, data) {
+				return this.$store.dispatch({type: 'checkList/commActions', key, data});
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.legendDetails {
+		padding: 0 25rpx;
+		background-color: #fff;
+		.box-item {
+			display: flex;
+			flex-direction: row;
+			border-bottom: 0.62rpx solid #DADEE6;
+			padding: 26.25rpx 0;
+			&:last-child {
+				border-bottom: 0;
+			}
+			>view {
+				width: 100%;
+				&:first-child {
+					width: 175rpx;
+					white-space: nowrap;
+					color: #525866;
+				}
+				&.img-wrap {
+					display: flex;
+					flex-direction: column;
+					
+					image {
+						margin-bottom: 12.5rpx;
+						width: 100%;
+					}
+				}
+			}
+		}
+	}
+</style>

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

@@ -31,6 +31,7 @@
 			return {
 			return {
 				// 当前显示的组件
 				// 当前显示的组件
         currentComponet: '',
         currentComponet: '',
+        disabled: false,
         // 查看详情回显的数据
         // 查看详情回显的数据
         values: {},
         values: {},
         // 按钮信息
         // 按钮信息

+ 10 - 3
pages/mission-details/mission-details.vue

@@ -154,9 +154,16 @@
       },
       },
       // 查看详情
       // 查看详情
       goToDetails(currentInfo, detailInfo) {
       goToDetails(currentInfo, detailInfo) {
-        uni.navigateTo({
-          url: `/pages/mission-action/mission-action?details=${encodeURIComponent(JSON.stringify({...currentInfo, ...detailInfo}))}`
-				});
+        if(detailInfo.navigateUrl){ // 跳转其他页面(如查核项详情) 目前hasAnyData都为false
+          const {navigateUrl, key, isOutvalueKey, hasAnyData} = detailInfo;
+          uni.navigateTo({
+            url: `${detailInfo.navigateUrl}?id=${(isOutvalueKey ? this.missionDetails : currentInfo)[detailInfo.key]}`
+				  });
+        }else {
+          uni.navigateTo({
+            url: `/pages/mission-action/mission-action?details=${encodeURIComponent(JSON.stringify({...currentInfo, ...detailInfo}))}`
+				  });
+        }
       },
       },
       /***
       /***
        *  解析显示对应的内容
        *  解析显示对应的内容

+ 14 - 10
pages/mission-details/setting.js

@@ -49,12 +49,13 @@ const taskTypeList = [
     selectDetails: {
     selectDetails: {
       name: '查看查核结果详情', // 详情显示的名字
       name: '查看查核结果详情', // 详情显示的名字
       hasAnyData: false, // 是否有多个数据需要回显 为true则使用dateKey, 否则使用key <key和datakey互斥)
       hasAnyData: false, // 是否有多个数据需要回显 为true则使用dateKey, 否则使用key <key和datakey互斥)
-      key: 'checkDetailResult', //使用详情接口key
+      key: 'checkItemId', //使用详情接口key
+      navigateUrl: '/pages/auditItemDetails/auditItemDetails', // 跳转页面的url
       dataKey: [],
       dataKey: [],
       isOutvalueKey: true,  // 是否详情接口一级key, 不是则在当前任务状态中找key(如pfmTaskCirculationList下面)
       isOutvalueKey: true,  // 是否详情接口一级key, 不是则在当前任务状态中找key(如pfmTaskCirculationList下面)
-      componentName: 'disagree', //点击后跳转的组件名
-      disabled: true, // 调整后是否编辑和禁用
-      labelKey: 'textarea' // 回显时使用的key
+      componentName: null, //点击后跳转的组件名
+      disabled: true, // 跳转后是否编辑和禁用
+      labelKey: '' // 回显时使用的key
     }
     }
   },
   },
   {
   {
@@ -89,12 +90,15 @@ const taskTypeList = [
     row1: { hasJoin: true, name: '查核人x', key: 'establishEmpName' },
     row1: { hasJoin: true, name: '查核人x', key: 'establishEmpName' },
     row2: {hasJoin: true, name: '发送改善通知,查核结果:x', key: 'checkDetailResult', isOutvalueKey: true },
     row2: {hasJoin: true, name: '发送改善通知,查核结果:x', key: 'checkDetailResult', isOutvalueKey: true },
     selectDetails: {
     selectDetails: {
-      name: '查看查核结果详情',
-      key: 'checkDetailResult',
-      isOutvalueKey: true,
-      componentName: 'disagree',
-      disabled: true,
-      labelKey: 'textarea'
+      name: '查看查核结果详情', // 详情显示的名字
+      hasAnyData: false, // 是否有多个数据需要回显 为true则使用dateKey, 否则使用key <key和datakey互斥)
+      key: 'checkItemId', //使用详情接口key
+      navigateUrl: '/pages/auditItemDetails/auditItemDetails', // 跳转页面的url
+      dataKey: [],
+      isOutvalueKey: true,  // 是否详情接口一级key, 不是则在当前任务状态中找key(如pfmTaskCirculationList下面)
+      componentName: null, //点击后跳转的组件名
+      disabled: true, // 跳转后是否编辑和禁用
+      labelKey: '' // 回显时使用的key
     }
     }
   },
   },
   {
   {

+ 6 - 0
pages/model.js

@@ -12,6 +12,8 @@ import todayCheck from './todayCheck/model.js';
 import planList from './planList/model.js';
 import planList from './planList/model.js';
 import checkList from "./checkList/model.js";
 import checkList from "./checkList/model.js";
 import mainPointsDetail from './mainPointsDetail/model.js';
 import mainPointsDetail from './mainPointsDetail/model.js';
+import editCheckList from './editCheckList/model.js';
+import allocationPerson from './allocationPerson/model.js'
 
 
 export default module = {
 export default module = {
   login,
   login,
@@ -29,4 +31,8 @@ export default module = {
   planList,
   planList,
   checkList,
   checkList,
   mainPointsDetail,
   mainPointsDetail,
+  planList,
+  checkList,
+  editCheckList,
+  allocationPerson
 }
 }

+ 83 - 0
pages/planList/components/modal.vue

@@ -0,0 +1,83 @@
+<template>
+	<view class="modal-page" v-show="showModal">
+		<view class="modal-box">
+			<image class="pic" src="../../../static/hint.png"></image>
+			<text class="text">您的分配工作量较大,建议使用批量分配功能</text>
+			<view class="btn" @click="hide">
+				<text class="btn-text">确定</text>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	//提示弹框
+	export default {
+		data() {
+			return {
+				showModal:false,//是否显示弹框
+			}
+		},
+		methods: {
+			show(){
+				this.showModal=true;
+			},
+			hide(){
+				this.showModal=false;
+			}
+		},
+	}
+</script>
+
+<style lang="less">
+	.modal-page{
+		height: 100%;
+		width: 100%;
+		position: fixed;
+		top: 0rpx;
+		left: 0rpx;
+		background: rgba(0,0,0,0.5);
+		.modal-box{
+			height: 317.5rpx;
+			width: 562.5rpx;
+			background: #FFFFFF;
+      border-radius: 24px;
+      overflow: hidden;
+			position: fixed;
+			top: 441.25rpx;
+			left: 93.75rpx;
+
+			.pic{
+				height: 80rpx;
+				width: 80rpx;
+				position: absolute;
+				top: 50rpx;
+				left: 241.25rpx;
+			}
+			.text{
+				font-size: 22.5rpx;
+				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+				font-weight: 400;
+				color: #292C33;
+				position: absolute;
+				top: 170rpx;
+				left: 56.25rpx;
+			}
+			.btn{
+				height: 75rpx;
+				width: 562.5rpx;
+				background: #3377FF;
+				position: absolute;
+				bottom: 0rpx;
+				text-align: center;
+				.btn-text{
+					font-size: 22.5rpx;
+					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
+					font-weight: 400;
+					color: #FFFFFF;
+					line-height: 75rpx;
+				}
+			}
+		}
+	}
+</style>

+ 46 - 31
pages/planList/planList.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view class="planList-page">
 	<view class="planList-page">
 		<scroll-view class="list-box" scroll-y="true" :style="{'height':listHeight+'rpx'}">
 		<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="item-box" v-for="(item,index) in planList" @click="gotoCheckList(false,item)" :key="index">
 				<view class="row1">
 				<view class="row1">
 					<text class="title">{{item.name}}</text>
 					<text class="title">{{item.name}}</text>
 					<view class="compeleted-box" v-if="item.isCompeleted">
 					<view class="compeleted-box" v-if="item.isCompeleted">
@@ -13,29 +13,34 @@
 				</view>
 				</view>
 				<view class="row2">
 				<view class="row2">
 					<text class="TobeDistributed">剩余1个单位待分配</text>
 					<text class="TobeDistributed">剩余1个单位待分配</text>
-					<text class="startEndTime">起止时间:2020-12-26 ~ 2020-12-18</text>
+					<text class="startEndTime">起止时间:{{item.startDate}} ~ {{item.endDate}}</text>
 				</view>
 				</view>
 			</view>
 			</view>
 		</scroll-view>
 		</scroll-view>
-		<view class="btn-distribution" @click="gotoCheckList" v-if="isShowDistribution">
+		<view class="btn-distribution" @click="gotoCheckList(true, planList[0])" v-if="isShowDistribution">
 			<text class="btn-text">批量分配</text>
 			<text class="btn-text">批量分配</text>
 		</view>
 		</view>
+		<modal ref="modal" ></modal>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import modal from './components/modal.vue'
+	import moment from 'moment';
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
 				situationID:'',//情境id
 				situationID:'',//情境id
 				planList:[],//计划列表
 				planList:[],//计划列表
 				firstFlag:1,//是否为第一次分配的标志,为1时表示是第一次,弹框提示
 				firstFlag:1,//是否为第一次分配的标志,为1时表示是第一次,弹框提示
-				isShowDistribution:true,//是否显示批量分配按钮
-				listHeight:1125,//列表高度
+				isShowDistribution:false,//是否显示批量分配按钮
+        listHeight:1125,//列表高度
+        checkGroupId: 0 // 查核组id
 			}
 			}
 		},
 		},
-		onLoad({ situationId }){ // situationId:情景id
-		  this.situationID=situationId;
+		onLoad({ situationId, checkGroupId }){ // situationId:情景id checkGroupId: 查核组id
+      this.situationID=situationId;
+      this.checkGroupId = checkGroupId;
 		},
 		},
 		created: function() {
 		created: function() {
 			this.$store.dispatch({
 			this.$store.dispatch({
@@ -48,14 +53,11 @@
 				}
 				}
 			}).then((data) => {
 			}).then((data) => {
 				if (data) {
 				if (data) {
-					this.planList=data.map((item,index)=>{	
+          this.compareTime(data);
+					this.planList=data.map((item,index)=>{
 						if(item.empList.length!=item.toDistribute){
 						if(item.empList.length!=item.toDistribute){
 							this.firstFlag=0;
 							this.firstFlag=0;
-						}
-						if(!this.compareTime(item.startDate)){
-							this.isShowDistribution=false;
-							this.listHeight=1200;
-						}
+            }
 						return {
 						return {
 							id:item.id,
 							id:item.id,
 							name:item.name,
 							name:item.name,
@@ -67,33 +69,46 @@
 							toDistribute:item.toDistribute,
 							toDistribute:item.toDistribute,
 						}
 						}
 					});
 					});
+					console.log(this.firstFlag,'1111111')
 					if(this.firstFlag==1){
 					if(this.firstFlag==1){
-						uni.showModal({
-							title:'提示',
-							content:'您的分配工作量较大,建议使用批量分配功能',
-						  showCancel:false
-						})
+						this.$refs.modal.show();
 					}
 					}
 				}
 				}
 			});
 			});
 		},
 		},
 		methods: {
 		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(){
+			compareTime(planList){
+				this.$store.dispatch({
+				  type: "commActions",
+				   key: "getDateStr" ,
+				}).then((dateStr) => {
+				  if (dateStr) {
+						if(planList.some((item)=>moment(item.startDate).valueOf()<moment(dateStr).valueOf())){
+							 this.listHeight=1200;
+						}
+						else{
+							this.isShowDistribution=true;
+						}
+				  }
+				});
+      },
+    	/**
+			* 跳转页面-查核列表
+			* @param {Boolean} multiple 是否批量编辑
+			* @param {Number} checkId 查核id
+			*/
+			gotoCheckList(multiple, currentObj){
+        const { id, startDate, endDate } = currentObj;
+        let _startDate = startDate ? startDate + ' 00:00' : ''; // 计划开始时间
+        let _endDate = endDate ? endDate + ' 23:59' : ''; // 计划结束时间
 				//跳转到查核列表
 				//跳转到查核列表
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pages/checkList/checkList?situationId=${this.situationID}`
+					url: `/pages/editCheckList/editCheckList?situationId=${this.situationID}&checkId=${id}&checkGroupId=${this.checkGroupId}&startDate=${_startDate}&endDate=${_endDate}&multiple=${multiple}`
 				});
 				});
 			}
 			}
+		},
+		components: {
+			modal,
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -179,7 +194,7 @@
 			background: #3377FF;
 			background: #3377FF;
 			position: fixed;
 			position: fixed;
 			bottom: 0rpx;
 			bottom: 0rpx;
-		
+
 			.btn-text {
 			.btn-text {
 				font-size: 22.5rpx;
 				font-size: 22.5rpx;
 				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
 				font-family: SourceHanSansCN-Normal, SourceHanSansCN;

+ 1 - 1
pages/role-switching/role-switching.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view class="role-page">
 	<view class="role-page">
 		<view class="row-box">
 		<view class="row-box">
-			<view class="role-list" v-for="(item,index) in permissionList">
+			<view class="role-list" v-for="(item,index) in permissionList" :key="index">
 				<text class="role-name">{{item.label}}</text>
 				<text class="role-name">{{item.label}}</text>
 				<view class="radio-item" @click="toggleSelect(item,index)">
 				<view class="radio-item" @click="toggleSelect(item,index)">
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>

+ 1 - 1
pages/situationDetail/components/bottom-popup.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
 	<view class="popup-page" v-show="showModalStatus">
 	<view class="popup-page" v-show="showModalStatus">
 		<view class="popup-box" v-show="showModalStatus">
 		<view class="popup-box" v-show="showModalStatus">
-			<view class="item-box" v-for="(item,index) in planList">
+			<view class="item-box" v-for="(item,index) in planList" :key="index">
 				<view class="radio-item" @click="toggleSelect(item,index)">
 				<view class="radio-item" @click="toggleSelect(item,index)">
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
 				</view>
 				</view>

+ 9 - 7
pages/situationDetail/situationDetail.vue

@@ -82,8 +82,9 @@
 				isUnplanned:false,//是否计划外查核
 				isUnplanned:false,//是否计划外查核
 				checkFlag:'',//计划查核标志,是新建还是提前开始
 				checkFlag:'',//计划查核标志,是新建还是提前开始
 				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
 				checkID:'',//新建查核计划时,计划列表中的前一个计划 id
-				checkItemList:[],//时间区间包含当前时间的item
-				
+        checkItemList:[],//时间区间包含当前时间的item
+        checkGroupId: 0 // 查核组id
+
 			}
 			}
 		},
 		},
 		onLoad({ situationId }){ // situationId:情景id
 		onLoad({ situationId }){ // situationId:情景id
@@ -117,7 +118,8 @@
 					this.startEndTime=data.startEndTime;
 					this.startEndTime=data.startEndTime;
 					this.planCount=data.planCount;
 					this.planCount=data.planCount;
 					this.toDistribute=data.toDistribute;
 					this.toDistribute=data.toDistribute;
-					this.firstCheckTime=data.firstCheckTime;
+          this.firstCheckTime=data.firstCheckTime;
+          this.checkGroupId = data.checkGroupId;
 				}
 				}
 			});
 			});
 		},
 		},
@@ -151,7 +153,7 @@
 						}
 						}
 					}
 					}
 				})
 				})
-				
+
 			},
 			},
 			editSituation(){
 			editSituation(){
 				let editEnable=this.compareTime(this.firstCheckTime);
 				let editEnable=this.compareTime(this.firstCheckTime);
@@ -193,7 +195,7 @@
 			gotoPlanPage(){
 			gotoPlanPage(){
 				//跳转到计划列表
 				//跳转到计划列表
 				uni.navigateTo({
 				uni.navigateTo({
-					url: `/pages/planList/planList?situationId=${this.situationID}`
+					url: `/pages/planList/planList?situationId=${this.situationID}&checkGroupId=${this.checkGroupId}`
 				});
 				});
 			},
 			},
 			startUnplanned(){
 			startUnplanned(){
@@ -234,7 +236,7 @@
 							if(data){
 							if(data){
 								this.gotoCheckPage();
 								this.gotoCheckPage();
 							}
 							}
-							
+
 						});
 						});
 					}
 					}
 				});
 				});
@@ -269,7 +271,7 @@
 						line-height: 35rpx;
 						line-height: 35rpx;
 					}
 					}
 				}
 				}
-				
+
 				.name-text{
 				.name-text{
 					font-size: 40rpx;
 					font-size: 40rpx;
 					font-family: SourceHanSansCN-Normal, SourceHanSansCN;
 					font-family: SourceHanSansCN-Normal, SourceHanSansCN;

二进制
static/close-icon.png


二进制
static/hint.png


二进制
static/open-icon.png


+ 4 - 1
store/actions.js

@@ -1,3 +1,6 @@
+import { commServer } from './server.js';
 export const actions = {
 export const actions = {
-	
+  commActions({ commit, state }, { key, data }) {
+    return commServer(key, data);
+  },
 }
 }

+ 14 - 0
store/server.js

@@ -0,0 +1,14 @@
+import { creatRequest } from '../utils/request.js';
+
+const requestList = {
+  // 获取服务器时间
+  getDateStr: {
+    method: 'GET',
+    url: 'common/time'
+  }
+};
+
+export const commServer = (key, data) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}