ソースを参照

调整了批量分配查核计划代码/修复查核项详情界面图片回显

xieyunhui 4 年 前
コミット
16268c74ef

+ 14 - 14
App.vue

@@ -26,20 +26,20 @@
 			/* 条件编译,仅在H5平台生效 */
 			// #ifdef H5
 			//在页面加载时读取Storage里的状态信息
-			const store = uni.getStorageSync('store');
-			console.log('this.$store.state',this.$store.state);
-			if (store) {
-				console.log('读取Storage里的状态信息');
-				this.$store.replaceState(
-					Object.assign({},
-						this.$store.state,
-						JSON.parse(store)
-					)
-				);
-			}else {
-				console.log('设置Storage里的状态信息');
-				uni.setStorageSync('store',JSON.stringify(this.$store.state));
-			}
+			// const store = uni.getStorageSync('store');
+			// console.log('this.$store.state',this.$store.state);
+			// if (store) {
+			// 	console.log('读取Storage里的状态信息');
+			// 	this.$store.replaceState(
+			// 		Object.assign({},
+			// 			this.$store.state,
+			// 			JSON.parse(store)
+			// 		)
+			// 	);
+			// }else {
+			// 	console.log('设置Storage里的状态信息');
+			// 	uni.setStorageSync('store',JSON.stringify(this.$store.state));
+			// }
 		
 			uni.getSystemInfo({
 				success(e) {

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "追踪方法学",
     "appid" : "__UNI__03C4C69",
     "description" : "",
-    "versionName" : "0.6.5",
+    "versionName" : "0.6.6",
     "versionCode" : 100,
     "transformPx" : false,
     "app-plus" : {

+ 45 - 51
pages/allocationPerson/allocationPerson.vue

@@ -2,11 +2,7 @@
 	<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 v-if="title === '指派查核人员'">
 				<view class="blockTitle">查核人</view>
 				<tm-checked-group :list="empList" :defaultValue='checkPresonList' :setting="{
 				  value: 'employeeId',
@@ -14,9 +10,9 @@
 				}" :openkeys="[0]" @change="onCheckPerosonChanged" />
 				<view class="blockTitle" v-if="details.situationType == 3">要点分类</view>
 				<tm-checked-group v-if="details.situationType == 3" :list="checkPointList" :defaultValue='checkedPointList' :setting="{
-				  value: 'employeeId',
-				  name: 'employeeName'
-				}" :openkeys="[0]" @change="checkChanged" />
+				  value: 'categoryId',
+				  name: 'categoryName'
+				}" :openkeys="[0]" @change="onCheckCategoryChanged" />
 			</template>
 			<template v-else>
 				<div class="date-view">
@@ -116,62 +112,51 @@
 			onCheckPerosonChanged(data){
 				const {checkedList} = data;
 				this.checkPresonList = checkedList;
-				const empId = (this.checkPresonList.map(item=>item.employeeId)).join(',');
-				const empName = (this.checkPresonList.map(item=>item.employeeName)).join(',');
+	            const empId = checkedList.map(item=>item.employeeId);
+				const empName = checkedList.map(item=>item.employeeName);
+				this.details = {
+					...this.details,
+					empId:empId.join(','),
+					empName:empName.join(','),
+				}
+			},
+			onCheckCategoryChanged(data){
+				const {checkedList} = data;
+				this.checkedPointList = checkedList;
+				const categoryIds = checkedList.map(item=>item.categoryId);
 				this.details = {
 					...this.details,
-					empId:empId,
-					empName:empName
+					categoryIds:categoryIds,
 				}
 			},
 			getComponentInfo(details) {
-				console.log({details});
-				const {checkGroupId,situationType,title,checkId} = details;
+				const {checkGroupId,situationType,title,checkId,deptId} = details;
 				this.setNavigationBarTitle(title);
 				this.details = details;
-				this.getEmpDeptTree(checkGroupId,situationType);
-				if(situationType == 3){
-					this.getCheckPointList(checkId,situationType);
-				}
+				this.getEmpDeptTree(checkGroupId,situationType,deptId);
+				// if(situationType == 3){
+				// 	this.getCheckPointList(checkId,situationType);
+				// }
 			},
 			// 查询部门人员树
-			getEmpDeptTree(checkGroupId, situationType) {
+			getEmpDeptTree(checkGroupId, situationType,deptId) {
 				this.$store.dispatch({
 					type: 'allocationPerson/commActions',
 					key: "getGroupEmpList",
 					data: {
 						checkGroupId,
-						situationType
+						situationType,
+						deptId
 					}
 				}).then(data => {
 					if (data) {
-						this.empList = data.sysCheckGroupEmployees || [];
+						this.empList = data.sysCheckGroupEmployees || [];
+						this.checkPointList = data.pointCategoryBOs ||[];
 					}
 				});
 			},
-			//获取查核要点列表
-			getCheckPointList(checkId,situationType){
-				this.$store.dispatch({
-					type: 'batchDistribution/commActions',
-					key: "getCheckPointList",
-					data: {
-						checkId,
-						situationType
-					}
-				}).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') { // 开始时间变化
@@ -193,15 +178,18 @@
 			// 点击确定
 			sure() {
 				const {
-					empId,
+					empId,
+					empName,
+					categoryIds,
 					startDate,
 					endDate
-				} = this.details;
+				} = this.details;
+				
 				if (this.isSubmit === true) {
 					return this.changeCheckList(this.checkList);
 				}
 				if (this.title === '指派查核人员') {
-					if (!empId) {
+					if (empName.length==0) {
 						return this.showModal('请选择查核人');
 					}
 					this.setNavigationBarTitle('设置查核时间');
@@ -212,7 +200,7 @@
 					if (!endDate) {
 						return this.showModal('请选择结束时间');
 					}
-					if (!empId) {
+					if (empName.length==0) {
 						this.setNavigationBarTitle('指派查核人员');
 						this.isSubmit = true;
 					} else {
@@ -224,9 +212,13 @@
 			changeCheckList(data) {
 				const {
 					situationId,
-					checkId,
+					checkId,
+					empId,
+					empName,
+					categoryIds,
 					checkGroupId
-				} = this.details;
+				} = this.details;
+				
 				let checkList = this.checkList.map((item, i) => {
 					if (this.details.index === i) {
 						return {
@@ -236,7 +228,9 @@
 					} else {
 						return item;
 					}
-				});
+				});
+				// console.log({checkList});
+				// return;
 				this.$store.commit({
 					type: 'editCheckList/comChangeState',
 					key: 'checkList',

+ 6 - 2
pages/checkMainPoints/checkMainPoints.vue

@@ -267,7 +267,8 @@
 				timingFunction: 'ease',
 			})
 
-			this.animation = animation;
+			this.animation = animation;
+		
 		},
 		beforeDestroy() {
 			this.ifFromChildPage = false;
@@ -492,7 +493,10 @@
 								checkPointId,
 								checkPointName
 							});
-						});
+						});
+						
+						//页面获取完数据时,保持筛选
+						this.filterCompleteFlag(this.active);
 					}
 				});
 			},

+ 4 - 1
pages/creatingSituations/components/checkPlan.vue

@@ -92,7 +92,10 @@
 		computed: {
 			...mapState({
 				showCheckPlan1: state => state.creatingSituations.showCheckPlan1,
-				checkPlan: state => state.creatingSituations.checkPlan,
+				checkPlan: state =>{
+					console.log('state.creatingSituations.checkPlan',state.creatingSituations.checkPlan);
+					return state.creatingSituations.checkPlan;
+				},
 			}),
 			checkNumber: function() { // 查核频次
 				return this.checkPlan.checkList.length;

+ 3 - 1
pages/creatingSituations/model.js

@@ -1,5 +1,7 @@
 import { commServer } from './server.js';
 import {dateHandle} from "../../utils/dateHandle.js";
+
+console.log('dateHandle.todayDate()',dateHandle.todayDate());
 	
 const initState = {
 	showCheckMapDetail: false,
@@ -26,7 +28,7 @@ const initState = {
 	checkPlan: { // 查核计划
 		checkedItem: {id: 'month', value: 2, label: '每月', model: 30}, // 选中的取模方式对象
 		dateObj: { // 保存开始日期结束日期的对象
-			start: dateHandle.todayDate(),
+			start:dateHandle.todayDate(),
 			end: '',
 			dayNum: 0 // 两个日期间隔的天数
 		}, 

+ 131 - 100
pages/editCheckList/editCheckList.vue

@@ -27,7 +27,7 @@
 						<text class="label">查核人</text>
 						<view class="content">
 							<text :class="['base-text', item.empName ? 'black-color' : '']">
-								{{ item.empName ? item.empName : '选择查核成员'}}
+								{{ item.empName?item.empName : '选择查核成员'}}
 							</text>
 						</view>
 						<image class="arrow" src="/static/images/icon-more.png"></image>
@@ -228,106 +228,137 @@
 					this.checkedList = this.checkedList.concat([deptId]);
 				}
 			},
-			// 完成
-			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 && planStartTimestamp != -1) ? this
-									.dateToTimestamp(startDate) - planStartTimestamp : -1, // 开始时间差
-								endDifTimestamp: (endDate && planStartTimestamp != -1) ? this
-									.dateToTimestamp(endDate) - planStartTimestamp : -1 // 结束时间差
-							});
-						}
-					}
-				});
-				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') : -1;
-								// 计划结束时间戳
-								let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem
-									.endDate + ' 23:59') : -1;
-
-								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 > -1 &&
-													startDiffTimestamp > -1) ?
-												this.getDateStr(planStartTimestamp,
-													planEndTimestamp,
-													startDiffTimestamp, planItem
-													.endDate) : '',
-											endDate: (planStartTimestamp > -1 &&
-													endDifTimestamp > -1) ?
-												this.getDateStr(planStartTimestamp,
-													planEndTimestamp, endDifTimestamp,
-													planItem.endDate) : ''
-										});
-									}
-								})
-							}
-						}))
-						multipleEmpList = [...baseEmpList, ...multipleEmpList];
-						// console.log('批量',multipleEmpList )
-						this.batchDistribute(multipleEmpList);
-					})
-				} else { // 单个分配
-					this.batchDistribute(baseEmpList);
-				}
+			// 完成
+			submit(){
+				const hadDistributionList = this.checkList.filter((item,index)=>{
+					 return item.isDistribution||item.empId;
+				});
+				const commitData = hadDistributionList.map(item=>({
+					     "checkId": item.checkId, 
+					     "deptId": item.deptId,
+					     "empId":item.empId,
+					     "empName":item.empName,
+					     "startDate":item.startDate,
+					     "endDate": item.endDate,
+					     "categoryIds":item.categoryIds
+					   
+				}));
+				// console.log({commitData});
+				this.batchDistribute(commitData);
+				
 			},
+			// submit1() {
+			// 	// baseEmpList: 第一次计划修改的数据; changePlanList: 批量分配,记录第一次计划修改数据的信息;  multipleEmpList: 批量修改的数据
+			// 	let baseEmpList = [],
+			// 		changePlanList = [],
+			// 		multipleEmpList = [];
+			// 	// planStartTimestamp: 开始计划时间戳;
+			// 	let planStartTimestamp = this.dateToTimestamp(this.startDate);
+				
+			// 	this.checkList.map((item, i) => {
+			// 		const {
+			// 			checkId,
+			// 			deptId,
+			// 			empId,
+			// 			empName,
+			// 			categoryIds,
+			// 			startDate,
+			// 			endDate
+			// 		} = item;
+					
+			// 		if (empId && startDate && endDate) {
+			// 			baseEmpList.push({
+			// 				checkId,
+			// 				deptId,
+			// 				empId,
+			// 				empName,
+			// 				categoryIds,
+			// 				startDate: startDate || '',
+			// 				endDate: endDate || ''
+			// 			});
+			// 			if (this.multiple === 'true') { // 批量分配
+			// 				changePlanList.push({
+			// 					index: i, // 第一次计划修改的下标
+			// 					empId,
+			// 					empName,
+			// 					categoryIds,
+			// 					baseEmpListIndex: baseEmpList.length - 1,
+			// 					startDiffTimestamp: (startDate && planStartTimestamp != -1) ? this
+			// 						.dateToTimestamp(startDate) - planStartTimestamp : -1, // 开始时间差
+			// 					endDifTimestamp: (endDate && planStartTimestamp != -1) ? this
+			// 						.dateToTimestamp(endDate) - planStartTimestamp : -1 // 结束时间差
+			// 				});
+			// 			}
+			// 		}
+			// 	});
+			// 	console.log({changePlanList,baseEmpList});
+			// 	return;
+			// 	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') : -1;
+			// 					// 计划结束时间戳
+			// 					let planEndTimestamp = planItem.endDate ? this.dateToTimestamp(planItem
+			// 						.endDate + ' 23:59') : -1;
+
+			// 					planItem.empList && planItem.empList.map((empItem, empI) => {
+			// 						// 当前分配明细
+			// 						let currentEmp = changePlanList.find(item => item.index ===
+			// 							empI);
+			// 						if (currentEmp) {
+			// 							const {
+			// 								baseEmpListIndex,
+			// 								startDiffTimestamp,
+			// 								endDifTimestamp
+			// 							} = currentEmp;
+			// 							const {
+			// 								categoryIds,
+			// 								empId,
+			// 								empName,
+			// 							} = baseEmpList[baseEmpListIndex] || {};
+										
+			// 							multipleEmpList.push({
+			// 								categoryIds,
+			// 								empId,
+			// 								empName,
+			// 								checkId: empItem.checkId,
+			// 								deptId: empItem.deptId,
+			// 								startDate: (planStartTimestamp > -1 &&
+			// 										startDiffTimestamp > -1) ?
+			// 									this.getDateStr(planStartTimestamp,
+			// 										planEndTimestamp,
+			// 										startDiffTimestamp, planItem
+			// 										.endDate) : '',
+			// 								endDate: (planStartTimestamp > -1 &&
+			// 										endDifTimestamp > -1) ?
+			// 									this.getDateStr(planStartTimestamp,
+			// 										planEndTimestamp, endDifTimestamp,
+			// 										planItem.endDate) : ''
+			// 							});
+			// 						}
+			// 					})
+			// 				}
+			// 			}))
+			// 			multipleEmpList = [...baseEmpList, ...multipleEmpList];
+			// 			// console.log('批量',multipleEmpList,baseEmpList);
+			// 			// return;
+			// 			this.batchDistribute(multipleEmpList);
+			// 		})
+			// 	} else { // 单个分配
+			// 		this.batchDistribute(baseEmpList);
+			// 	}
+			// },
 			/**
 			 * 获取时间字符串
 			 * @param {Number} startTimestamp 计划开始时间戳

+ 1 - 1
pages/home/home.vue

@@ -99,7 +99,7 @@
 			return {
 				ifshowVersionInfo:false,
 				showJournal: false,
-				version: '0.6.5',
+				version: '0.6.6',
 				versionData: {
 					versionNo: '',
 					versionId: '',

+ 2 - 0
pages/mainPointsDetail/mainPointsDetail.vue

@@ -420,6 +420,8 @@ export default {
 		  this.id = id;
 		  this.deptId = res.deptId;
 		  //再次编辑回显
+		  const filePath = res.checkResultTxt?JSON.parse(res.checkResultTxt):[];
+		  this.filePath = filePath[0]&&filePath[0].checkResultUrl.split(',');
 		  this.Index = res.checkResult;
 		  this.totalScore = res.totalScore;
 		  this.deductPointFromRes = res.deductPoint;

+ 1 - 0
utils/dateHandle.js

@@ -12,6 +12,7 @@ export const dateHandle = {
 		var year = date.getFullYear();
 		var month = date.getMonth() + 1;
 		var day = date.getDate();
+		console.log(dateHandle.add0(day))
 		return year + "-" + dateHandle.add0(month) + "-" + dateHandle.add0(day);
 	},
 	/**