瀏覽代碼

Merge remote-tracking branch 'origin/master'

wgl 4 年之前
父節點
當前提交
4572abef9a
共有 1 個文件被更改,包括 356 次插入312 次删除
  1. 356 312
      src/projects/business/views/Master/Health/Worker.vue

+ 356 - 312
src/projects/business/views/Master/Health/Worker.vue

@@ -24,337 +24,381 @@
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>
 			</div>
-			<div id="slider" class="mui-slider mui-fullscreen">
-				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
-					<div class="mui-scroll">
-						<a class="mui-control-item " :class="selectedIndex==0?'mui-active':''" style="width:30%" @click="ckSelectedIndex(0)">
-							全部<span class="mui-badge" v-text="allCount">3</span>
-						</a>
-						<a class="mui-control-item" :class="selectedIndex==1?'mui-active':''" style="width:36%" @click="ckSelectedIndex(1)">
-							正常记录<span class="mui-badge" v-text="doneCount">2</span>
-						</a>
-						<a class="mui-control-item" :class="selectedIndex==2?'mui-active':''" style="width:34%" @click="ckSelectedIndex(2)">
-							异常记录<span class="mui-badge" v-text="undoCount">1</span>
-						</a>
-					</div>
+			<div class="mui-slider">
+				<div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
+					<a class="mui-control-item " :class="selectedIndex==0?'mui-active':''"  @click="selectedIndex=0">
+						全部<span class="mui-badge" v-html="allCount"></span>
+					</a>
+					<a class="mui-control-item" :class="selectedIndex==1?'mui-active':''"  @click="selectedIndex=1">
+						已上报<span class="mui-badge"  v-html="doneCount"></span>
+					</a>
+					<a class="mui-control-item" :class="selectedIndex==2?'mui-active':''"  @click="selectedIndex=2">
+						未上报<span class="mui-badge"  v-html="undoCount"></span>
+					</a>
 				</div>
 				</div>
 				<div class="mui-slider-group">
 				<div class="mui-slider-group">
-					<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
+					<div :class="allGroup" class="mui-slider-item mui-control-content" v-show="selectedIndex==0">
 						<div id="scroll1" class="mui-scroll-wrapper">
 						<div id="scroll1" class="mui-scroll-wrapper">
-							<div class="mui-scroll vongi-yctj-list">
-								<ul class="mui-table-view mui-table-view-chevron vongi-zgtz">
-									<li class="mui-table-view-cell mui-collapse vongi-archives" v-for="(item,index) in allList" :key="index">
-										<a class="mui-navigate-right">
-											{{item.name}}
-											<h4 class='mui-pull-right'><span class="color4fc5f7">{{item.num2}}</span>/<span class="color4fc5f7">{{item.num1}}</span></h4>
+							<div class="mui-scroll ">
+								<ul class="mui-table-view">
+										<li class="mui-table-view-cell vongi-wordcard vongi-meform-pho" style="    border-bottom: 1px solid #c8c7cc;" v-for="(item,index) in allList" :key="index" >
+													<a @click="viewDetail(item)"  :class="item.upLoad?'mui-navigate-right':''" >
+														<div class="mui-pull-left flew-items">
+															<div class="mui-media-object flew"><img v-if="item.faceImageUrl!=null" :src="item.faceImageUrl + '?x-oss-process=image/resize,m_fill,w_64'"
+																									width="50" /></div>
+															<h4 v-text="item.name"></h4>
+															<span class="mui-icon iconfont icon-erweima1  " :style="'color:'+getGreenCodeColor(item.healthyCode)"></span>
+														</div>
+														<div class="mui-pull-right color55f868" style="padding: inherit;" v-if="item.upLoad">已上报</div>
+														<div class="mui-pull-right colorfe616c" style="padding: inherit;" v-if="!item.upLoad">未上报</div>
 										</a>
 										</a>
-										<ul class="mui-table-view mui-table-view-chevron">
-											<li class="mui-table-view-cell" v-for="(mod,index2) in item.list" :key="index2">
-												<a   @click="viewDetail(mod)" :class="{'mui-navigate-right': mod.upLoad}">
-													<div class="mui-pull-left flew-items">
-														<div class="mui-media-object flew"><img v-if="mod.faceImageUrl!=null" :src="mod.faceImageUrl + '?x-oss-process=image/resize,m_fill,w_64'"
-															 width="50" /></div>
-														<h4 v-text="mod.name"></h4>
-														<span class="mui-icon iconfont icon-erweima1  " :style="'color:'+getGreenCodeColor(mod.healthyCode)"></span>
-													</div>
-													<div class="mui-pull-right color55f868" v-if="mod.upLoad">已上报</div>
-													<div class="mui-pull-right colorfe616c" v-if="!mod.upLoad">未上报</div>
-
-												</a>
-											</li>
-
-										</ul>
 									</li>
 									</li>
+								</ul>
 
 
+							</div>
+						</div>
+					</div>
+					<div :class="doneGroup" class="mui-slider-item mui-control-content"  v-show="selectedIndex==1">
+						<div id="scroll2" class="mui-scroll-wrapper">
+
+							<div class="mui-scroll ">
+								<ul class="mui-table-view">
+									<li class="mui-table-view-cell vongi-wordcard vongi-meform-pho" style="    border-bottom: 1px solid #c8c7cc;" v-for="(item,index) in doneList" :key="index" >
+										<a @click="viewDetail(item)"  :class="item.upLoad?'mui-navigate-right':''" >
+											<div class="mui-pull-left flew-items">
+												<div class="mui-media-object flew"><img v-if="item.faceImageUrl!=null" :src="item.faceImageUrl + '?x-oss-process=image/resize,m_fill,w_64'"
+																						width="50" /></div>
+												<h4 v-text="item.name"></h4>
+												<span class="mui-icon iconfont icon-erweima1  " :style="'color:'+getGreenCodeColor(item.healthyCode)"></span>
+											</div>
+											<div class="mui-pull-right color55f868" style="padding: inherit;" v-if="item.upLoad">已上报</div>
+											<div class="mui-pull-right colorfe616c" style="padding: inherit;" v-if="!item.upLoad">未上报</div>
+										</a>
+									</li>
 								</ul>
 								</ul>
+
 							</div>
 							</div>
 						</div>
 						</div>
 					</div>
 					</div>
+					<div :class="undoGroup" class="mui-slider-item mui-control-content"  v-show="selectedIndex==2">
+						<div id="scroll3" class="mui-scroll-wrapper">
+
+							<div class="mui-scroll ">
+								<ul class="mui-table-view">
+									<li class="mui-table-view-cell vongi-wordcard vongi-meform-pho" style="    border-bottom: 1px solid #c8c7cc;" v-for="(item,index) in undoList" :key="index" >
+										<a @click="viewDetail(item)"  :class="item.upLoad?'mui-navigate-right':''" >
+											<div class="mui-pull-left flew-items">
+												<div class="mui-media-object flew"><img v-if="item.faceImageUrl!=null" :src="item.faceImageUrl + '?x-oss-process=image/resize,m_fill,w_64'"
+																						width="50" /></div>
+												<h4 v-text="item.name"></h4>
+												<span class="mui-icon iconfont icon-erweima1  " :style="'color:'+getGreenCodeColor(item.healthyCode)"></span>
+											</div>
+											<div class="mui-pull-right color55f868" style="padding: inherit;" v-if="item.upLoad">已上报</div>
+											<div class="mui-pull-right colorfe616c" style="padding: inherit;" v-if="!item.upLoad">未上报</div>
+										</a>
+									</li>
+								</ul>
 
 
+							</div>
+
+
+						</div>
 
 
+					</div>
 				</div>
 				</div>
 			</div>
 			</div>
 		</div>
 		</div>
-		<loading :visible="isLoading"></loading>
 
 
-	</div>
 
 
-</template>
 
 
+		<loading :visible="isLoading"></loading>
+	</div>
+</template>
 
 
 <script>
 <script>
-	require('$project/assets/js/mui.picker.min.js');
-	import * as API_Health from '@/apis/Master/health'
-	import Common from '$project/components/Common.vue'
-	import Loading from '$project/components/Loading.vue'
-	import TopHeader from '$project/components/TopHeader.vue'
-	import {
-		mapGetters,
-		mapMutations
-	} from 'vuex'
-	import {
-		currentTimeStamp,
-		parseUnixTime
-	} from '$project/utils'
-	export default {
-		name: 'MasterHealthWorker',
-		components: {
-			Common,
-			Loading,
-			TopHeader
-		},
-		data() {
-			return {
-				pageTitle: '职工台账列表',
-
-				rightLink: {
-					show: true,
-					icon: 'icon-tongji',
-					style: 'font-size:12px',
-					title: '健康统计'
-				},
-				id: '',
-				detail: [],
-				curDate: '',
-				isLoading: false,
-				jsonList: [],
-				allList: [],
-				allCount: 0,
-
-				undoCount: 0,
-
-				doneCount: 0,
-				selectedIndex: 0,
-				setinput: "",
-				listForm: {
-					pageSize: 500,
-					pageIndex: 1,
-					totalPage: 1,
-					pageIndex1: 1,
-					totalPage1: 1,
-					pageIndex2: 1,
-					totalPage2: 1,
-				},
-
-				statList: [],
-			}
-		},
-		created() {
-			this.curDate = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
-		},
-		methods: {
-			ckSelectedIndex(num) {
-				this.selectedIndex = num;
-				var allList = [];
-
-
-				var map = new Map();
-				for (var i in this.jsonList) {
-					var mod = this.jsonList[i];
-
-					if (num == 0) {
-
-					} else if (num == 1 && !mod.upLoad) {
-						continue;
-					} else if (num == 2 && mod.upLoad) {
-						continue;
-					}
-
-					var key = "(未分组)";
-					if (mod.teacherInfo == null) {
-
-					} else {
-						key = mod.teacherInfo.jobType;
-					}
-
-					if (map.get(key) == null) {
-						var arr = [];
-						map.set(key, arr);
-					}
-					map.get(key).push(mod);
-				}
-
-				map.forEach(function(value, key) {
-					var num1 = value.length;
-					var num2 = 0;
-					for (var i in value) {
-						var le = value[i];
-						if (le.upLoad) {
-							num2++;
-
-						} else {
-
-						}
-					}
-					var mod = {
-						name: key,
-						list: value,
-						num1: num1,
-						num2: num2
-					};
-					allList.push(mod);
-				});
-				this.allList = allList;
-			},
-			searchK() {
-				var inp = this.setinput;
-				this.allList = [];
-				this.queryList();
-			},
-			async queryList() {
-				this.isLoading = true;
-				await this.pageList('', this.listForm.pageIndex).then(page => {
-
-
-					var map = new Map();
-					for (var i in page.data) {
-						var mod = page.data[i];
-						var key = "(未分组)";
-						if (mod.groupKey == null) {
-
-						} else {
-							key = mod.groupKey;
-						}
-
-						if (map.get(key) == null) {
-							var arr = [];
-							map.set(key, arr);
-						}
-						map.get(key).push(mod);
-					}
-					var self = this;
-					this.jsonList = page.data;
-					var allList = self.allList = [];
-					self.allCount = page.data.length;
-					var doneCount = 0;
-					var undoCount = 0;
-					map.forEach(function(value, key) {
-						var num1 = value.length;
-						var num2 = 0;
-						for (var i in value) {
-							var le = value[i];
-							if (le.upLoad) {
-								num2++;
-								doneCount++;
-							} else {
-								undoCount++;
-							}
-						}
-						var mod = {
-							name: key,
-							list: value,
-							num1: num1,
-							num2: num2
-						};
-						allList.push(mod);
-					});
-					self.doneCount = doneCount;
-					self.undoCount = undoCount;
-
-					//this.allCount = page.recordsTotal;
-					this.listForm.pageIndex = page.pageNumber;
-					this.listForm.totalPage = page.totalPage;
-				});
-
-
-				this.isLoading = false;
-			},
-			selectDate() {
-				var dtPicker = new mui.DtPicker({
-					type: 'date'
-				});
-
-				dtPicker.show((selectItems) => {
-					var year = selectItems.y.value;
-					var month = selectItems.m.value;
-					var day = selectItems.d.value;
-
-					this.curDate = year + "-" + month + "-" + day;
-
-					this.queryList();
-				});
-			},
-			pageList(status, index) {
-				return API_Health.workerPageList({
-					setinput: this.setinput,
-					companyId: this.person_data.companyId,
-					queryDate: this.curDate,
-					status: status,
-					pageIndex: index,
-					pageSize: 500
-				});
-			},
-			viewDetail(item) {
-				if (item.upLoad) {
-					this.$router.push({
-						name: 'MasterHealthWorkerInfo',
-						query: {
-							id: item.personHealthLedgerId
-						}
-					})
-				}
-			},
-			//获取健康码颜色值
-			getGreenCodeColor(healthyCode) {
-				var healthyCode = healthyCode || '11';
-				var color = {
-					"00": '#09ae47',
-					"01": '#e5aa37',
-					"10": '#fe616c',
-					"11": '#C0C0C0'
-				}
-				return color[healthyCode];
-			},
-
-			//判断状态
-			getCodeStatusName(code) {
-				if (code == '00') {
-					return '绿码';
-				} else if (code == '01') {
-					return '黄码';
-				} else if (code == '10') {
-					return '红码';
-				} else if (code == '11') {
-					return '灰码';
-				} else {
-					return '无码';
-				}
-			},
-			//获取绿码统计数据
-			getHealthyCodeStat() {
-				this.isLoading = true;
-				API_Health.getHealthyCodeStat(this.person_data.companyId, '3').then(response => {
-					this.isLoading = false;
-					this.statList = response;
-				}).catch(error => {
-					this.isLoading = false;
-					mui.toast(error);
-				})
-			},
-			asynCallBack() {},
-		},
-		mounted() {
-			//获取列表
-			this.queryList();
-			//获取绿码统计数据
-			this.getHealthyCodeStat();
-			//document.getElementById('app').style.height = '100%';
-
-		},
-
-
-		destroyed() {
-
-		},
-		computed: {
-			...mapGetters({
-				openId: 'wx_openid',
-				token: 'token',
-				person_data: 'person_data',
-				person_popedom: 'person_popedom',
-			})
-		}
-	}
+    require('$project/assets/js/mui.picker.min.js');
+    import Common from '$project/components/Common.vue'
+    import Loading from '$project/components/Loading.vue'
+    import TopHeader from '$project/components/TopHeader.vue'
+
+    import {mapGetters,mapMutations} from 'vuex'
+
+    import * as API_Health from '@/apis/Master/health'
+    import isReachBottom from '$project/utils/isReachBottom'
+    import {
+        currentTimeStamp,
+        parseUnixTime
+    } from '$project/utils'
+    export default {
+        name: 'HealthTemperatureInfo',
+        components: {
+            Common,
+            Loading,
+            TopHeader
+        },
+        data() {
+            return {
+                pageTitle: '职工台账列表',
+                rightLink: {
+                    show: true,
+                    icon: 'icon-tongji',
+                    style: 'font-size:12px',
+                    title: '健康统计'
+                },
+                id: '',
+                detail: [],
+                curDate: '',
+                isLoading: false,
+                allList:[],
+                allCount:0,
+                undoList:[],
+                undoCount:0,
+                doneList:[],
+                doneCount:0,
+                selectedIndex: 0,
+                pageIndexArr:[1,1,1],
+                totalPageArr:[1,1,1],
+                setinput: "",
+                totalPage:1,
+                sortType:'1',
+                statList: [],
+            }
+        },
+        created() {
+            this.id = this.$route.query.id;
+            if(this.$route.query.time){
+                this.curDate = this.$route.query.time;
+            }else{
+                this.curDate = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
+            }
+            if(this.$route.query.index){
+                this.selectedIndex=this.$route.query.index;
+            }
+
+        },
+        methods: {
+            asynCallBack(){},
+            searchK() {
+
+                this.queryList(true);
+            },
+
+            async queryList(isFirst){
+                //created 传trye, 其他传null
+                if(isFirst){
+
+                    this.pageIndexArr[0] = 1;
+                    this.pageIndexArr[1] = 1;
+                    this.pageIndexArr[2] = 1;
+                    //  this.totalPageArr=[1,1,1]
+                    this.allList=[];
+                    this.doneList=[];
+                    this.undoList=[];
+
+                }
+
+
+                this.isLoading = true;
+                if(isFirst||this.selectedIndex=='0'){
+                    await this.pageList('',this.pageIndexArr[0]).then(page=>{
+                        this.allCount = page.recordsTotal;
+
+                        if (this.pageIndexArr[0]==1) {
+                            this.allList = page.data;
+                            this.totalPageArr[0]=page.totalPage;
+                        }else{
+                            this.allList = [
+                                ...this.allList,
+                                ...page.data
+                            ];
+                        }
+
+                        if(this.selectedIndex==0){
+                            this.isLoading = false;
+                        }
+
+                        this.pageIndexArr[0]++;
+                    });
+                }
+                if(isFirst||this.selectedIndex=='1'){
+                    await this.pageList('1',this.pageIndexArr[1]).then(page=>{
+                        this.doneCount = page.recordsTotal;
+
+                        if (this.pageIndexArr[1]==1) {
+                            this.doneList = page.data;
+                            this.totalPageArr[1]=page.totalPage;
+
+                        }else{
+                            this.doneList = [
+                                ...this.doneList,
+                                ...page.data
+                            ];
+                        }
+                        if(this.selectedIndex==1){
+                            this.isLoading = false;
+                        }
+
+                        this.pageIndexArr[1]++;
+                    });
+                }
+
+
+                if(isFirst||this.selectedIndex=='2') {
+                    await this.pageList('2', this.pageIndexArr[2]).then(page => {
+                        this.undoCount = page.recordsTotal;
+
+                        if (this.pageIndexArr[2] == 1) {
+                            this.undoList = page.data;
+                            this.totalPageArr[2]=page.totalPage;
+
+                        } else {
+                            this.undoList = [
+                                ...this.undoList,
+                                ...page.data
+                            ];
+                        }
+                        if (this.selectedIndex == 2) {
+                            this.isLoading = false;
+                        }
+
+                        this.pageIndexArr[2]++;
+                    });
+                }
+                //this.pageIndex++;
+            },
+            selectDate() {
+                var _this=this;
+                var dtPicker = new mui.DtPicker({
+                    type: 'date',
+                    "endDate": new Date(),
+                    "value":_this.curDate
+                });
+                // dtPicker.setSelectedValue(_this.curDate)
+
+                dtPicker.show((selectItems)=>{
+                    var year = selectItems.y.value;
+                    var month = selectItems.m.value;
+                    var day = selectItems.d.value;
+
+                    this.curDate = year + "-" + month + "-" + day;
+
+                    this.queryList(true);
+                });
+            },
+
+            pageList(status,pageIndex) {
+                return API_Health.workerPageList({
+                    setinput: this.setinput,
+                    companyId: this.person_data.companyId,
+                    queryDate: this.curDate,
+                    status: status,
+                    pageIndex: pageIndex,
+                    pageSize: 50
+                    //sortType:this.sortType,
+                });
+            },
+            //获取绿码统计数据
+            getHealthyCodeStat() {
+                this.isLoading = true;
+                API_Health.getHealthyCodeStat(this.person_data.companyId, '3').then(response => {
+                    this.isLoading = false;
+                    this.statList = response;
+                }).catch(error => {
+                    this.isLoading = false;
+                    mui.toast(error);
+                })
+            },
+            viewDetail(item) {
+                if (item.upLoad) {
+                    this.$router.push({
+                        name: 'MasterHealthWorkerInfo',
+                        query: {
+                            id: item.personHealthLedgerId
+                        }
+                    })
+                }
+            },
+            //获取健康码颜色值
+            getGreenCodeColor(healthyCode) {
+                var healthyCode = healthyCode || '11';
+                var color = {
+                    "00": '#09ae47',
+                    "01": '#e5aa37',
+                    "10": '#fe616c',
+                    "11": '#C0C0C0'
+                }
+                return color[healthyCode];
+            },
+
+            //判断状态
+            getCodeStatusName(code) {
+                if (code == '00') {
+                    return '绿码';
+                } else if (code == '01') {
+                    return '黄码';
+                } else if (code == '10') {
+                    return '红码';
+                } else if (code == '11') {
+                    return '灰码';
+                } else {
+                    return '无码';
+                }
+            },
+            //下拉事件
+            handleScrool() {
+                //console.log(window.screen.height + '-' + document.body.scrollTop + '-' + document.body.clientHeight)
+                //if ((window.screen.height + document.body.scrollTop) > (document.body.clientHeight)) {
+                if (isReachBottom()) {
+                    console.log('到达底部')
+                    if (this.pageIndexArr[this.selectedIndex] <= this.totalPageArr[this.selectedIndex] && this.isLoading == false) {
+                        this.queryList(false);
+                    } else {
+                        return;
+                    }
+                } else {
+                    this.loadAll = true;
+                    return;
+                }
+            },
+
+        },
+        computed: {
+            ...mapGetters({
+                openId: 'wx_openid',
+                token: 'token',
+                person_data: 'person_data',
+                person_popedom: 'person_popedom',
+            }),
+            allGroup(){
+                return {
+                    "mui-active" : this.selectedIndex==0
+                };
+            },
+            doneGroup(){
+                return {
+                    "mui-active" : this.selectedIndex==1
+                };
+            },
+            undoGroup(){
+                return {
+                    "mui-active" : this.selectedIndex==2
+                };
+            }
+        },
+        mounted() {
+              var _this = this;
+            this.queryList(true);
+            //获取绿码统计数据
+            this.getHealthyCodeStat();
+            window.addEventListener('scroll', _this.handleScrool);
+        },
+        destroyed() {
+            //销毁监听事件
+            var _this = this;
+            window.removeEventListener('scroll', _this.handleScrool);
+        }
+
+    }
 </script>
 </script>
 
 
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>
@@ -364,4 +408,4 @@
 <style src="$project/assets/css/mui.picker.min.css"></style>
 <style src="$project/assets/css/mui.picker.min.css"></style>
 
 
 <style>
 <style>
-</style>
+</style>