Commit 661b6456 authored by 张锡奇's avatar 张锡奇

upload

parent a5dcb94c
...@@ -31,7 +31,7 @@ function urlFun(name){ ...@@ -31,7 +31,7 @@ function urlFun(name){
/** /**
* 健康打卡统计 * 健康打卡统计
*/ */
health:`http://47.97.206.38:23253` health:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1225621052093239296`
} }
return url[name] return url[name]
} }
......
...@@ -7,6 +7,7 @@ var nowMonth = now.getMonth(); //当前月 ...@@ -7,6 +7,7 @@ var nowMonth = now.getMonth(); //当前月
var nowYear = now.getYear(); //当前年 var nowYear = now.getYear(); //当前年
nowYear += (nowYear < 2000) ? 1900 : 0; // nowYear += (nowYear < 2000) ? 1900 : 0; //
var y = 0;
let util = { let util = {
...@@ -489,6 +490,22 @@ util.Colors.prototype.getHslArray= function() { ...@@ -489,6 +490,22 @@ util.Colors.prototype.getHslArray= function() {
} }
return HSL; return HSL;
}; };
util.scrollToBottom = function(scrollDom){
if(scrollDom.scrollTop > y){
// console.log('向下')
let offsetHeight = scrollDom.offsetHeight;
let scrollHeight = scrollDom.scrollHeight;
let scrollTop = scrollDom.scrollTop;
if(scrollHeight - offsetHeight - scrollTop <= 0){
y = 0;
return true;
}
}else if(scrollDom.scrollTop < y){
// console.log('向上')
}
y = scrollDom.scrollTop;
}
// util.pageReturn = function(){ // util.pageReturn = function(){
// /*微信自带返回按钮,不刷新,刷新页面start*/ // /*微信自带返回按钮,不刷新,刷新页面start*/
// if (util.isIos()) { // if (util.isIos()) {
......
...@@ -36,7 +36,7 @@ module.exports = [ ...@@ -36,7 +36,7 @@ module.exports = [
} }
}, },
{ {
path:'statistics/list', path:'statistics/list:type',
name:'healthCardStatisticsList', name:'healthCardStatisticsList',
component:()=> import('@/view/healthCard/statistics/list.vue'), component:()=> import('@/view/healthCard/statistics/list.vue'),
meta:{ meta:{
......
...@@ -6,6 +6,7 @@ import searchOrder from './modules/tiip/searchOrder'; ...@@ -6,6 +6,7 @@ import searchOrder from './modules/tiip/searchOrder';
import profitAnalysis from './modules/tiip/profitAnalysis'; import profitAnalysis from './modules/tiip/profitAnalysis';
import kanban from './modules/tiip/kanban'; import kanban from './modules/tiip/kanban';
import checkProgress from './modules/tiip/checkProgress'; import checkProgress from './modules/tiip/checkProgress';
import healthStatistics from './modules/health/statistics';
Vue.use(Vuex); Vue.use(Vuex);
...@@ -22,7 +23,8 @@ const store = new Vuex.Store({ ...@@ -22,7 +23,8 @@ const store = new Vuex.Store({
searchOrder, searchOrder,
profitAnalysis, profitAnalysis,
kanban, kanban,
checkProgress checkProgress,
healthStatistics
} }
}); });
......
import Util from '@/libs/util';
import Vue from 'vue';
const obj = {
state: {
hdr:{},
dtl:{}
},
mutations: {
saveHealthStatisticsHdr(state,data){
state.hdr = data;
},
saveHealthStatisticsDtl(state,data){
state.dtl = data;
},
},
actions: {
saveHealthStatisticsHdr({commit},data){
commit('saveHealthStatisticsHdr',data);
},
saveHealthStatisticsDtl({commit},data){
commit('saveHealthStatisticsDtl',data);
},
}
};
export default obj;
This diff is collapsed.
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<template> <template>
<div id="healthCardStatisticsIndex"> <div id="healthCardStatisticsIndex">
<div class="items" v-for="(item,index) in list" :key="index"> <div class="items" v-for="(item,index) in list" :key="index">
<div class="HEAD"> <div class="HEAD" @click="routerToChart(item)">
<div class="left"> <div class="left">
<span>{{item.iAllJoin}}/{{item.iAll}}</span> <span>{{item.iAllJoin}}/{{item.iAll}}</span>
</div> </div>
...@@ -145,6 +145,10 @@ export default { ...@@ -145,6 +145,10 @@ export default {
if(res && res.length > 0) { if(res && res.length > 0) {
this.list = res; this.list = res;
} }
},
routerToChart(item){
this.$store.dispatch('saveHealthStatisticsHdr',item);
this.$router.push({name:'healthCardStatisticsChart'});
} }
} }
} }
......
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
} }
} }
.img{
width:100%;
display: flex;
justify-content: center;
img{
width:100%;
height:300px;
}
}
} }
</style> </style>
...@@ -58,19 +67,22 @@ ...@@ -58,19 +67,22 @@
<div id="healthCardStatisticsList"> <div id="healthCardStatisticsList">
<div class="CONTENT"> <div class="CONTENT">
<tab v-model="activeTab" prevent-default @on-before-index-change="switchTabItem" bar-active-color="#4572d7" active-color="#4572d7" default-color="#8a8a8a"> <tab v-model="activeTab" prevent-default @on-before-index-change="switchTabItem" bar-active-color="#4572d7" active-color="#4572d7" default-color="#8a8a8a">
<tab-item :selected="activeTab == 0">已填写(229</tab-item> <tab-item :selected="activeTab == 0">已填写({{list1.length}}</tab-item>
<tab-item :selected="activeTab == 1">未填写(53</tab-item> <tab-item :selected="activeTab == 1">未填写({{list2.length}}</tab-item>
</tab> </tab>
<div class="activeTab2"> <div class="activeTab2">
<div class="items" v-for="(item,index) in [1,2,3,4,5,5,5,5,5,5,5,5,5]" :key="index"> <div class="items" v-for="(item,index) in (activeTab == 0 ? list1 : list2)" :key="index">
<div class="avatar"> <div class="avatar">
<img src="" alt=""> <img src="" alt="">
<span></span> <span>{{item.sEmploeeName[0]}}</span>
</div> </div>
<div class="item"> <div class="item">
<div class="name">张锡奇</div> <div class="name">{{item.sEmploeeName}}</div>
</div> </div>
</div> </div>
<div class="img" v-if="(activeTab == 0 ? list1 : list2).length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt="">
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -86,6 +98,12 @@ export default { ...@@ -86,6 +98,12 @@ export default {
data () { data () {
return { return {
activeTab:0, activeTab:0,
page1:1,
per_page1:20,
page2:1,
per_page2:20,
list1:[],
list2:[]
} }
}, },
components:{ components:{
...@@ -93,19 +111,91 @@ export default { ...@@ -93,19 +111,91 @@ export default {
}, },
computed:{ computed:{
...mapState({ ...mapState({
hdr:state => state.healthStatistics.hdr
}) })
}, },
async mounted(){ async mounted(){
}, },
async activated(){ async activated(){
window.d = this; window.d = this;
this.activeTab = this.$route.params.type;
this.clean();
await this.getList1();
await this.getList2();
}, },
methods:{ methods:{
clean(){
this.page1 = 1;
this.per_page1 = 20;
this.list1 = [];
this.page2 = 1;
this.per_page2 = 20;
this.list2 = [];
},
switchTabItem(index){ switchTabItem(index){
this.activeTab = index; this.activeTab = index;
if(this.activeTab == 0){
this.getList1();
}else{this.activeTab == 1}{
this.getList2();
}
},
async getList1(){
if(this.per_page1 < 20){
this.$vux.toast.text('已加载全部数据!', 'middle')
return false;
}
let res = await this.request('getStatisticalDetails',{
data:[
{key:'url',value:'HealthLog'},
{key:'dDate',value: this.hdr.dDate},
{key:'iCompanyId',value:'1'},
{key:'iType',value:'1'}
],
params:{
page:this.page1,
per_page:this.per_page1
},
},'加载中',{});
if(res && res.length > 0){
this.list1 = this.list1.concat(res);
this.page1++;
this.per_page1 = res.length;
}
},
async getList2(){
if(this.per_page2 < 20){
this.$vux.toast.text('已加载全部数据!', 'middle')
return false;
}
let res = await this.request('getStatisticalDetails',{
data:[
{key:'url',value:'HealthLog'},
{key:'dDate',value:this.hdr.dDate},
{key:'iCompanyId',value:'1'},
{key:'iType',value:'0'}
],
params:{
page:this.page2,
per_page:this.per_page2
},
},'加载中',{});
if(res && res.length > 0){
this.list2 = this.list2.concat(res);
this.page2++;
this.per_page2 = res.length;
}
},
scrollToBottom(){
let scrollDom = this.$refs['scrollDom'];
if(Util.scrollToBottom(scrollDom)){
if(this.activeTab == 0){
this.getList1();
}else{this.activeTab == 1}{
this.getList2();
}
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment