zhengkaixin преди 4 години
родител
ревизия
c801c0d81a
променени са 1 файла, в които са добавени 103 реда и са изтрити 125 реда
  1. 103 125
      src/projects/business/views/Master/Health/Worker.vue

+ 103 - 125
src/projects/business/views/Master/Health/Worker.vue

@@ -5,9 +5,9 @@
 
 		<div class="mui-content vongi-archives vongi-dktz-c">
 			<div class="fyy-temper-date margin10">
-				<a href="" class="mui-col-xs-4">2020-03-19<span class="mui-icon mui-icon-arrowdown"></span></a>
-				<a href="" class="mui-col-xs-4">上报情况<span class="mui-icon mui-icon-arrowdown"></span></a>
-				<a href="" class="mui-col-xs-4">打卡区域<span class="mui-icon mui-icon-arrowdown"></span></a>
+				<a href="" class="mui-col-xs-4"  @click="selectDate" >{{curDate}}<span class="mui-icon mui-icon-arrowdown"></span></a>
+				<a href="" class="mui-col-xs-4"  @click="selectIndexOf">{{selectedIndex==0?'上报情况':selectedType[selectedIndex]}}<span class="mui-icon mui-icon-arrowdown" ></span></a>
+				<a href="" class="mui-col-xs-4"  @click="selectAddress">{{address==''?'打卡区域':addressType[address]}}<span class="mui-icon mui-icon-arrowdown" ></span></a>
 			</div>
 			<div class="vongi-clasadmin vongi-bagfff">
 				<h4>健康码统计</h4>
@@ -23,54 +23,27 @@
 				</div>
 			</div>
 			<ul class="mui-table-view">
-				<li class="mui-table-view-cell">
-					<a class="mui-navigate-right" href="#">
+				<li class="mui-table-view-cell"  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 src="~$project/assets/img/03.jpg" width="50" /></div>
+							<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>
 							<div class="vongi-dktz-t">
-								<h4 class='flew-items'>郭麒麟<span class="mui-icon iconfont icon-erweima1 color55f868"></span></h4>
-								<div class="mui-h6">已连续上报14天</div>
+								<h4 class='flew-items'>{{item.name}}<span class="mui-icon iconfont icon-erweima1  "  :style="'color:'+getGreenCodeColor(item.healthyCode)"></span></h4>
+								<div class="mui-h6" v-if="countNum(item.countNum)">已连续上报{{item.countNum}}天</div>
 							</div>
 						</div>
 						<div class="mui-pull-right flew-items">
-							<div class="mui-btn mui-btn-primary mui-btn-outlined vongi-dktz-bage">市内</div>
-							<span class="color55f868">已上报</span>
-						</div>
-					</a>
-				</li>
-				<li class="mui-table-view-cell">
-					<a class="mui-navigate-right" href="#">
-						<div class="mui-pull-left flew-items">
-							<div class="mui-media-object flew"><img src="~$project/assets/img/03.jpg" width="50" /></div>
-							<div class="vongi-dktz-t">
-								<h4 class='flew-items'>郭麒麟<span class="mui-icon iconfont icon-erweima1 colorf8b155"></span></h4>
-								<div class="mui-h6">已连续上报14天</div>
-							</div>
-						</div>
-						<div class="mui-pull-right flew-items">
-							<div class="mui-btn mui-btn-yellow mui-btn-outlined vongi-dktz-bage">市外</div>
-							<span class="colorfe616c">未上报</span>
+							<template  v-if="item.address">
+								<div class="mui-btn mui-btn-primary mui-btn-outlined vongi-dktz-bage " v-if="addressIf(item.address)" >市内</div>
+								<div class="mui-btn  mui-btn-outlined vongi-dktz-bage mui-btn-yellow"  v-else >{{addressIf2(item.address)}}</div>
+							</template>
+
+							<span :class="item.upLoad?'color55f868':'colorfe616c'">{{item.upLoad?'已上报':'未上报'}}</span>
 						</div>
 					</a>
 				</li>
+
 			</ul>
-				
-								<!-- <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>
-												<span class="iconfont color999" style =" font-size: 14px;" v-if="countNum(item.countNum)">已连续上报{{item.countNum}}天</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>
@@ -117,6 +90,7 @@
 				id: '',
 				detail: [],
 				curDate: '',
+
 				isLoading: false,
 				allList: [],
 				allCount: 0,
@@ -125,10 +99,12 @@
 				doneList: [],
 				doneCount: 0,
 				selectedIndex: 0,
-				pageIndexArr: [1, 1, 1],
-				totalPageArr: [1, 1, 1],
-				setinput: "",
+                selectedType: ['全部','已上报','未上报'],
+                addressType: ['市内','市外','省外'],
+                address:'',
+                pageIndex: 1,
 				totalPage: 1,
+				setinput: "",
 				sortType: '1',
 				statList: [],
 			}
@@ -147,6 +123,20 @@
 		},
 
 		methods: {
+            addressIf(val){
+                if(val.indexOf('湖北省荆州市')<0){
+                    return false;
+				}else{
+                    return true;
+				}
+			},
+            addressIf2(val){
+                if(val.indexOf('湖北省')<0){
+                    return '市外';
+                }else{
+                    return '省外';
+                }
+            },
             countNum(num){
               if(  this.curDate == parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')&&num ){
                   return true;
@@ -174,85 +164,87 @@
 				//created 传trye, 其他传null
 				if (isFirst) {
 
-					this.pageIndexArr[0] = 1;
-					this.pageIndexArr[1] = 1;
-					this.pageIndexArr[2] = 1;
+					this.pageIndex = 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]++;
-					});
-				}
+                this.pageList(this.selectedIndex, this.pageIndex).then(page => {
+                    this.allCount = page.recordsTotal;
 
+                    if (this.pageIndex  == 1) {
+                        this.allList = page.data;
+                        this.totalPage = page.totalPage;
+                    } else {
+                        this.allList = [
+                            ...this.allList,
+                            ...page.data
+                        ];
+                    }
 
-				if (isFirst || this.selectedIndex == '2') {
-					await this.pageList('2', this.pageIndexArr[2]).then(page => {
-						this.undoCount = page.recordsTotal;
+                    this.isLoading = false;
 
-						if (this.pageIndexArr[2] == 1) {
-							this.undoList = page.data;
-							this.totalPageArr[2] = page.totalPage;
+                    this.pageIndex++;
+                });
 
-						} else {
-							this.undoList = [
-								...this.undoList,
-								...page.data
-							];
-						}
-						if (this.selectedIndex == 2) {
-							this.isLoading = false;
-						}
 
-						this.pageIndexArr[2]++;
-					});
-				}
 				//this.pageIndex++;
 			},
+            selectIndexOf(){
+                var picker = new mui.PopPicker();
+
+                picker.setData([{
+                    text: "全部",
+                    value: 0
+                },
+                    {
+                        text: "已上报",
+                        value: 1
+                    },
+                    {
+                        text: "未上报",
+                        value: 2
+                    }
+                ]);
+
+                picker.show((selectItems) => {
+                    this.selectedIndex = selectItems[0].value;
+                    this.queryList(true);
+                });
+			},
+            selectAddress(){
+                var picker = new mui.PopPicker();
+
+                picker.setData([{
+                    text: "全部",
+                    value: ''
+                },
+                    {
+                        text: "市内",
+                        value: '0'
+                    },
+                    {
+                        text: "市外",
+                        value: '1'
+                    },
+                    {
+                        text: "省外",
+                        value: '2'
+                    }
+                ]);
+
+                picker.show((selectItems) => {
+                    this.address = selectItems[0].value;
+                    this.queryList(true);
+                });
+			},
 			selectDate() {
 				var _this = this;
 				var dtPicker = new mui.DtPicker({
@@ -279,6 +271,7 @@
 					companyId: this.person_data.companyId,
 					queryDate: this.curDate,
 					status: status,
+                    address: this.address,
 					pageIndex: pageIndex,
 					pageSize: 50
 					//sortType:this.sortType,
@@ -337,7 +330,7 @@
 				//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) {
+					if (this.pageIndex  <= this.totalPage  && this.isLoading == false) {
 						this.queryList(false);
 					} else {
 						return;
@@ -355,22 +348,7 @@
 				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;