Эх сурвалжийг харах

查核列表添加更多层次的筛选

xieyunhui 3 жил өмнө
parent
commit
c08e7db4e2

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

@@ -1,7 +1,7 @@
 <template>
 	<view 
 	  :class="{'com-button': true, 'default': defaultClass }" 
-		:style="{width: btnWidth, height: btnHeight, borderRadius: btnRadius,background:background}"
+		:style="{width: btnWidth, height: btnHeight, borderRadius: btnRadius,background:background,marginBottom:btnMarginBottom}"
 		 @click="btnClick">
 		<text class="btn-text" :style="{fontSize: fSize}">{{ btnText }}</text>
 	</view>
@@ -10,6 +10,7 @@
 <script>
 	export default {
 		props:{
+	
 			width: { // 按钮宽度(直接写设计稿量取大小即可
 				type: Number,
 				default: () => {
@@ -34,6 +35,12 @@
 					return  28 
 				}
 			},
+			marginBottom:{
+				type: Number,
+				default: () => {
+					return  0 
+				}
+			},
 			type: {
 				type: String,
 				default: () => {
@@ -60,6 +67,9 @@
 			fSize() {
 				return this.fontSize * 750 / 1200 + 'rpx';
 			},
+			btnMarginBottom() {
+				return this.marginBottom * 750 / 1200 + 'rpx';
+			},
 			defaultClass() {
 				return this.type === 'default' ? true : false
 			},

+ 45 - 23
components/tm-upload-img/tm-upload-img.vue

@@ -10,7 +10,7 @@
 		<!-- 预览图片 -->
 		<view class="img-preview">
 			<view class="img-item" v-for="(src, i) in filePaths" :key="i">
-				<image class="imgItem" :src="src"></image>
+				<image class="imgItem" :src="src" @click="previewHandle(i)"></image>
 				<image class="del-close" src="/static/del-close.png" v-if="!disabled" @click="delImg(i)" />
 			</view>
 		</view>
@@ -26,6 +26,8 @@
 	 */
 
 	import uploadImage from "../../utils/uploadImg.js";
+	const pictureModule = uni.requireNativePlugin("Wlake-PictureView")
+	const modal = uni.requireNativePlugin('modal');
 	export default {
 		props: {
 			// 上传的图片路径列表
@@ -54,11 +56,25 @@
 				type: Number,
 				default: 0
 			}
-		},
-		mounted() {
-			
+		},
+		mounted() {
+
 		},
 		methods: {
+			previewHandle(index) {
+				console.log(this.filePaths[0],index);
+				const picList = this.filePaths;
+				pictureModule.PictureViewerMain({
+						'listPic': picList,
+						'position':index, // 0 开始算  最大值为   listPic 数组数量 减一 
+					},
+					(ret) => {
+						modal.toast({
+							message: ret,
+							duration: 1.5
+						});
+					});
+			},
 			// 上传图片
 			uploadPicture() {
 				if (this.disabled) return;
@@ -68,15 +84,15 @@
 					// sourceType: ['camera'], //从相册选择,默认时可以选择从相机和相册中选取
 					success: res1 => {
 						uploadImage(res1).then(fileList => {
-							if (this.isMultiple) {
-									this.$emit('changeFilePaths',{
-										  files:[...this.filePaths, ...fileList],
-										  index:this.pickIndex
-									});
-							} else {
-								this.$emit('changeFilePaths',{
-									  files:fileList,
-									  index:this.pickIndex
+							if (this.isMultiple) {
+								this.$emit('changeFilePaths', {
+									files: [...this.filePaths, ...fileList],
+									index: this.pickIndex
+								});
+							} else {
+								this.$emit('changeFilePaths', {
+									files: fileList,
+									index: this.pickIndex
 								});
 							}
 						})
@@ -87,11 +103,11 @@
 				});
 			},
 			// 删除图片
-			delImg(i) {
+			delImg(i) {
 				const currentIndex = this.pickIndex;
-				this.$emit('changeFilePaths',{
-					  files:this.filePaths.filter((item, index) => index != i),
-					  index:currentIndex
+				this.$emit('changeFilePaths', {
+					files: this.filePaths.filter((item, index) => index != i),
+					index: currentIndex
 				});
 			}
 		}
@@ -110,7 +126,7 @@
 			align-items: center;
 			// flex: 1;
 			padding-right: 25rpx;
-
+            margin-bottom: 30rpx;
 			.label-view {
 				width: 175rpx;
 				line-height: 22.5rpx;
@@ -139,6 +155,8 @@
 		.img-preview {
 			display: flex;
 			flex-wrap: wrap;
+			flex-direction: row;
+			justify-content: flex-start;
 
 			img {
 				opacity: 1 !important;
@@ -146,14 +164,14 @@
 
 			.img-item {
 				position: relative;
-				margin-right: 25rpx;
 				margin-bottom: 25rpx;
-				width: 300rpx;
-				height: 225rpx;
+				width: 150rpx;
+				height: 150rpx;
+				margin-right:35rpx;
 
 				>image {
-					width: 300rpx;
-					height: 225rpx;
+					width:100%;
+					height:100%;
 					opacity: 1;
 				}
 
@@ -168,6 +186,10 @@
 					width: 37.5rpx;
 					height: 37.5rpx;
 				}
+
+				&:nth-child(4n) {
+					margin-right: 0;
+				}
 			}
 		}
 	}

+ 4 - 1
pages/checkList/checkList.vue

@@ -71,7 +71,10 @@
 				showModal: false,
 				planList: [],
 				checkId: '',
-				depList: []
+				depList: [],
+				searchKey:'',
+				ifSearchMod:false
+				
 			};
 		},
 		computed: {

+ 104 - 58
pages/checkMainPoints/checkMainPoints.vue

@@ -58,11 +58,11 @@
 				</view>
 			</template>
 			<!-- 只有当查核者进入才展示 -->
-			<view class="rowTwo" v-if="nowPermission == 3||nowPermission == 1" :animation="animationData">
-				<text class="rowTwoName">查核状态</text>
+			<view class="rowTwo" v-if="nowPermission == 3||nowPermission == 1" :animation="animationData" v-for="(v,i) in btnArr">
+				<text class="rowTwoName">{{v.key}}</text>
 				<view class="filterBtnWrap">
-					<com-button v-for="(item, index) in btnArr" :btnText="item.label" :width="350" :height="80"
-						:type="active === item.id ? 'pramary':'default'" v-on:btnClick="btnClick(item.id)" />
+					<com-button v-for="(item, index) in v.list" :btnText="item.label" :width="350" :height="80" :marginBottom="20"
+						:type="setFilterBtnType(item.value,v.key)" v-on:btnClick="btnClick(item.value,v.key)" />
 				</view>
 			</view>
 
@@ -164,7 +164,8 @@
 						<text class="currentScore">{{totalSubtotalScore}}</text>
 					</view>
 				</view>
-			</view>
+			</view>
+			<!--查核列表为空&&dang q -->
 			<view v-if="detailList.length>0&&active != 2&&finishedStatus != 1" @click="onkeyCheckHandle"
 				:class="[subtotalScore != null&&subtotalScore>=0?'botOneKeyCheck typeTwo':'botOneKeyCheck']">完成</view>
 		</view>
@@ -185,19 +186,7 @@
 		data() {
 			return {
 
-				btnArr: [{
-						id: 0,
-						label: '全部'
-					},
-					{
-						id: 1,
-						label: '未查核'
-					},
-					{
-						id: 2,
-						label: '已查核'
-					},
-				],
+				btnArr: [],
 				showModal: false,
 				detailList: [],
 				copyDetailList: [],
@@ -207,7 +196,11 @@
 				}],
 				checkPointId: 'all',
 				nowPermission: uni.getStorageSync('nowPermission'),
-				active: 0,  //筛选tab下标
+				active:{
+					result:['全部'],
+					checkStatus:'全部',
+					other:'全部'
+				},  //筛选tab下标
 				checkId: '',
 				deptId: '',
 				currentScrollHeight: 0,
@@ -282,14 +275,22 @@
 			this.checkId = checkId;
 			this.finishedStatus = finishedStatus;
 			this.situationType = situationType;
-            this.pageTemplateId = pageTemplateId;
+            this.pageTemplateId = pageTemplateId;
+			
+			
 			if (situationType == 2) {
 				this.getInvestigationUsers();
 			}
 			//非分页情况下
 			if (situationType != 2) {
 				this.loadItemData();
-			}
+			}
+			if(this.currentSelectedInvestigationUser){
+				this.getFilterList(checkId,deptId,this.currentSelectedInvestigationUser.investigationId);
+			}else{
+				this.getFilterList(checkId,deptId);
+			}
+			
 		},
 		onShow: function() {
 			if (this.ifReloadPageData) {
@@ -316,7 +317,35 @@
 				data: true
 			});
 		},
-		methods: {
+		methods: {
+			/**
+			 * @param {number} checkId  查核id 
+			 * @param {number} deptId  部门id 
+			 * @param {number} responsibleUserId  责任对象id 非必传
+			 */
+			getFilterList(checkId,deptId,responsibleUserId){
+				
+				this.$store.dispatch({
+					type: 'checkMainPoints/commActions',
+					key: 'getPointConditions',
+					data: {
+						checkId:checkId,
+						responsibleUserId,
+						deptId:deptId
+					}
+				}).then(data=>{
+				    
+					const {checkResults=[],checkStatuses=[],others=[]} = data;
+					const _checkResults = checkResults.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
+					const _checkStatuses = checkStatuses.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
+					const _others = others.map(t=>({label:`${t.value}(${t.num})`,id:Math.random(),value:t.value}));
+					this.btnArr  = [
+						{key:'查核结果',list:_checkResults},
+						{key:'查核状态',list:_checkStatuses},
+						{key:'其他',list:_others},
+					];
+				})
+			},
 			//绑定当事人
 			/**
 			 * @param {Boolean} bool true直接执行设置当事人,忽略本地以缓存的deptTd 
@@ -458,7 +487,7 @@
 				if (!status) {
 					this.$refs.popup.open();
 					this.ifOpenFilter = true;
-					this.animation.height('11vh').step();
+					this.animation.height('15vh').step();
 				} else {
 					this.$refs.popup.close();
 					this.ifOpenFilter = false;
@@ -523,11 +552,42 @@
 						});
 					}
 				});
+			},
+			setFilterBtnType(val,key){
+				if(key == '查核结果'){
+				    const index = this.active.result.findIndex(t=>val==t);
+					return index>=0?'pramary':'default'
+				}
+				if(key == '查核状态'){
+					return this.active.checkStatus == val?'pramary':'default'
+				}
+				if(key == '其他'){
+					return this.active.other == val?'pramary':'default'
+				}
+				
 			},
-			btnClick(id) {
-				// console.log({id});
-				this.active = id;
-				this.filterCompleteFlag(id);
+			btnClick(val,key) {
+				const _active = this.active;
+				if(key == '查核结果'){
+					 const index = _active.result.findIndex(t=>t == val);
+					 if(index >= 0){
+						   //当前已存在该id
+						   _active.result.splice(index,1);
+					 }else{
+						   _active.result.push(val);
+						   console.log({_active});
+					 }
+				}
+				if(key == '查核状态'){
+					_active.checkStatus = val
+				}
+				if(key == '其他'){
+					_active.other = val
+				}
+				
+				this.active = _active;
+				//更新列表
+				this.loadItemData();
 			},
 			//获取访查对象列表
 			getInvestigationUsers() {
@@ -563,37 +623,39 @@
 				checkId,
 				deptId,
 				situationType,
-				investigationId
+				investigationId,
 			}) {
 				const params = {
 					checkId,
 					deptId,
-					situationType,
-				}
-
+					situationType,
+					checkStatus:this.active.checkStatus,
+					checkResult:this.active.result.join(','),
+					other:this.active.other
+				}
+				
 				//增加受访人
 				if (situationType == 2) params['investigationId'] = investigationId;
-
 				this.dispatch('checkTaskDetailList', {
 					...params
 				}).then((data) => {
-					if (data) {
-						if (!data.checkDetailMapResponses) return;
-
+					if (data) {
+						const renderList = data.checkDetailMapResponses?data.checkDetailMapResponses:[];
+					
 						this.$store.commit('checkMainPoints/comChangeState', {
 							key: 'detailList',
-							data: data.checkDetailMapResponses
+							data: renderList
 						});
 						
 						this.isBindResponsible = data.isBindResponsible;
-						this.detailList = data.checkDetailMapResponses;
-						this.copyDetailList = data.checkDetailMapResponses;
+						this.detailList = renderList;
+						this.copyDetailList = renderList;
 						this.currentScore = data.getScore;
 						this.totalScore = data.totalScore;
 						this.subtotalScore = data.subtotalScore;
 						this.totalSubtotalScore = data.totalSubtotalScore;
-						this.checkDetailMapResponses = data.checkDetailMapResponses;
-						data.checkDetailMapResponses.map(({
+						this.checkDetailMapResponses = renderList;
+						renderList.map(({
 							checkPointId,
 							checkPointName
 						}) => {
@@ -604,9 +666,6 @@
 						});
 						//检查是否需要弹绑定当事人弹窗
 						this.toBindPeople();
-
-						//页面获取完数据时,保持筛选
-						this.filterCompleteFlag(this.active);
 					}
 				});
 			},
@@ -657,20 +716,6 @@
 						.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)
-						}
-					});
-				}
-			},
 			clearSearch() {
 				this.searchKey = '';
 				this.detailList = [...this.copyDetailList];
@@ -901,7 +946,8 @@
 
 				.filterBtnWrap {
 					display: flex;
-					flex-direction: row;
+					flex-direction: row;
+					flex-wrap: wrap;
 					justify-content: space-between;
 				}
 			}

+ 4 - 0
pages/checkMainPoints/server.js

@@ -16,6 +16,10 @@ const requestList = {
     method: 'GET',
     url: 'checkTask/getInvestigationUsers'
   },
+  getPointConditions:{   //获取筛选条件
+	method: 'GET',
+	url: 'plan/getPointConditions'  
+  }
 };
 
 export const commServer = (key, data) => {

+ 1 - 1
pages/login/login.vue

@@ -34,7 +34,7 @@
 		data() {
 			return {
 				index:0,
-				appHospSign:'8CJYqxlGIdLEIwaG',//app端更新hospSign
+				appHospSign:'IGlcn5nc4xBWc08C',//app端更新hospSign
 				showInputModal:false,
 				hospSign: '', // 医院标识
 				username: '', // 用户名

+ 12 - 17
pages/mainPointsDetail/mainPointsDetail.vue

@@ -484,8 +484,11 @@
 							this.recordList[0].seeResult = res.checkResultRequestList[0].checkResultDescribe;
 							this.checkedSelectResultListIds = tempIds;
 							this.checkedSelectResultList = res.checkResultRequestList[0].checkResultDescribe.split(
-								',');
-							this.checkedSelectResultListData = tempResult;
+								',');
+								
+							this.checkedSelectResultListData = tempResult;
+							
+							console.log({tempResult});
 							// this.selectedScore = tempScore;
 
 						}
@@ -620,7 +623,7 @@
 								   	let params = {
 								   		id: this.data.id,
 								   		checkResult: this.data.checkResult,
-								   		checkResultRequestList: [],
+								   		checkResultRequestList:[],
 								   		checkItemScore: this.checkItemScore,
 								   		value: this.checkItemValue,
 								   		situationType: this.situationType,
@@ -628,8 +631,9 @@
 								   		score: this.currentScore,
 								   		deductPoint: this.deductPoint,
 								   	};
-								   					     
-								   					     
+									
+									console.log({params});
+										   					     				     
 								   	if (this.data.checkModelName == "访谈") {
 								   		let list = [];
 								   		for (let i = 0; i < this.talkList.length; i++) {
@@ -651,23 +655,14 @@
 								   		}
 								   		params.checkResultRequestList = list;
 								   	} else {
-								   		let list = [];
-								   		let path = "";
-								   		for (let j = 0; j < this.recordList[0].filePath.length; j++) {
-								   			if (j == 0) {
-								   				path += `${this.recordList[0].filePath[j]}`;
-								   			} else {
-								   				path += `,${this.recordList[0].filePath[j]}`;
-								   			}
-								   		}
+								   		
 								   		let item = {
 								   			checkResultId: 1,
 								   			checkResultDescribe: this.recordList[0].seeResult,
-								   			checkResultUrl: path,
+								   			checkResultUrl: this.filePath.join(','),
 								   		};
 								   					     
-								   		list.push(item);
-								   		params.checkResultRequestList = list;
+								   		params.checkResultRequestList = [item];
 								   	}
 								   	const checkConfiglist = JSON.parse(JSON.stringify(this.checkConfiglist));
 								

+ 1 - 1
utils/requestUrl.js

@@ -11,7 +11,7 @@
 // export const URL = '192.168.51.80:8801/imed/pfm/'; // 本地
 export const URL = '112.124.59.133:8802/imed/pfm/'; //线上测试
 // export const URL = '118.31.245.65:8802/imed/pfm/';
-//export const URL = '118.31.245.65:8111/imed/pfm/'; //横店
+// export const URL = '192.168.200.56:8801/imed/pfm/'; //横店
 // export const URL = '192.168.1.253:8111/imed/pfm/';
 // export const URL = '192.168.1.45:8088/imed/pfm/'; //内网
 // export const URL = 's1.nsloop.com:5137/imed/pfm/';  // 外网