Commit 4667af6d authored by 张锡奇's avatar 张锡奇

upload

parent 97d0fd62
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
"babel-register": "^6.22.0", "babel-register": "^6.22.0",
"chalk": "^2.0.1", "chalk": "^2.0.1",
"chromedriver": "^2.27.2", "chromedriver": "^2.27.2",
"clipboard": "^2.0.4",
"copy-webpack-plugin": "^4.0.1", "copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1", "cross-spawn": "^5.0.1",
"css-loader": "^0.28.0", "css-loader": "^0.28.0",
......
...@@ -2,5 +2,6 @@ module.exports = { ...@@ -2,5 +2,6 @@ module.exports = {
getStatisticalDetails:{url:"/healthlog/",method:"post",host:"health"}, getStatisticalDetails:{url:"/healthlog/",method:"post",host:"health"},
saveHealth:{url:"/healthlog/save/",method:"post",host:"health"}, saveHealth:{url:"/healthlog/save/",method:"post",host:"health"},
getHealthEmploee:{url:"/healthemploee",method:"post",host:"health"}, getHealthEmploee:{url:"/healthemploee",method:"post",host:"health"},
getExcel:{url:"/sendmessage/excel/",method:"get",host:"health"},
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ import 'babel-polyfill' ...@@ -19,7 +19,7 @@ import 'babel-polyfill'
import echarts from 'echarts' import echarts from 'echarts'
import Calendar from 'vue-mobile-calendar/lib/install.js' import Calendar from 'vue-mobile-calendar/lib/install.js'
import F2 from '@antv/f2'; import F2 from '@antv/f2';
import { ConfirmPlugin,ToastPlugin,DatetimePlugin } from 'vux' import { ConfirmPlugin,ToastPlugin,DatetimePlugin,LoadingPlugin } from 'vux'
import urlFun from './libs/host.js' import urlFun from './libs/host.js'
import Meta from 'vue-meta'; import Meta from 'vue-meta';
...@@ -34,6 +34,7 @@ Vue.use(Toast) ...@@ -34,6 +34,7 @@ Vue.use(Toast)
Vue.use(ConfirmPlugin); Vue.use(ConfirmPlugin);
Vue.use(ToastPlugin); Vue.use(ToastPlugin);
Vue.use(DatetimePlugin); Vue.use(DatetimePlugin);
Vue.use(LoadingPlugin);
Vue.prototype.global = new Vue({}); Vue.prototype.global = new Vue({});
......
<style lang="less">
.healthCard{
height:100%;
.vApp{
height:100%;
display: flex;
flex-direction: column;
.keepAlive{
height:1px;
flex-grow: 1;
}
.TABBAR{
height: 53px;
}
p{
margin:0;
}
}
}
</style>
<template> <template>
<div class="healthCard"> <div class="healthCard">
<v-app> <div class="vApp">
<keep-alive> <div class="keepAlive">
<router-view></router-view> <keep-alive>
</keep-alive> <router-view></router-view>
</v-app> </keep-alive>
</div>
<div class="TABBAR">
<tabbar tabbar-text-active-color="#3e68f3" v-if="showTabbar">
<tabbar-item :selected='activeTab == 0' @on-item-click="clickTabbar(0)">
<img slot="icon" src="./image/home.png">
<img slot="icon-active" src="./image/home_active.png">
<span slot="label" :style="{'color':activeTab == 0 ? '#3e69f3' : '#999999'}">首页</span>
</tabbar-item>
<!-- <tabbar-item :selected='activeTab == 1' @on-item-click="clickTabbar(1)">
<img slot="icon" src="./image/home.png">
<img slot="icon-active" src="./image/home_active.png">
<span slot="label" :style="{'color':activeTab == 1 ? '#3e69f3' : '#999999'}">返程</span>
</tabbar-item> -->
<tabbar-item :selected='activeTab == 2' @on-item-click="clickTabbar(2)">
<img slot="icon" src="./image/statistics.png">
<img slot="icon-active" src="./image/statistics_active.png">
<span slot="label" :style="{'color':activeTab == 2 ? '#3e69f3' : '#999999'}">统计</span>
</tabbar-item>
<tabbar-item :selected='activeTab == 3' @on-item-click="clickTabbar(3)">
<img slot="icon" src="./image/my.png">
<img slot="icon-active" src="./image/my_active.png">
<span slot="label" :style="{'color':activeTab == 3 ? '#3e69f3' : '#999999'}">我的</span>
</tabbar-item>
</tabbar>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { Tabbar, TabbarItem } from 'vux'
export default { export default {
name: 'healthCard', name: 'healthCard',
data () { data () {
return { return {
activeTab:'2',
showTabbar:false
}
},
created(){
this.showTabbar = this.$route.path.indexOf('/healthCard/statistics') == -1 ? false : true;
},
components:{
Tabbar, TabbarItem
},
methods:{
clickTabbar(activeTab){
this.activeTab = activeTab;
switch(activeTab){
case 0:
wx.miniProgram.switchTab({
url:'/pages/home'
})
break;
case 1:
break;
case 3:
wx.miniProgram.switchTab({
url:'/pages/me'
})
break;
default:
break;
}
} }
} }
} }
......
...@@ -46,6 +46,34 @@ ...@@ -46,6 +46,34 @@
background: white; background: white;
overflow: auto; overflow: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
.SEARCH{
height:50px;
padding:0 8px;
display:flex;
align-items: center;
position: relative;
>input{
background: white;
height:35px;
line-height: 35px;
flex:1;
border-radius: 5px;
font-size: 12px;
padding:0 25px 0 8px;
border: 1px solid #2d8cf0;
box-sizing: border-box;
}
.iconfont{
width: 40px;
height:35px;
font-size:12px;
position: absolute;
color:#ed4014;
line-height: 35px;
text-align: center;
right:8px;
}
}
.items{ .items{
display: flex; display: flex;
height:60px; height:60px;
...@@ -210,6 +238,10 @@ ...@@ -210,6 +238,10 @@
</div> </div>
</div> </div>
<div v-show="activeTab == 1" class="activeTab2" ref="scrollDom" @scroll="scrollToBottom"> <div v-show="activeTab == 1" class="activeTab2" ref="scrollDom" @scroll="scrollToBottom">
<div class="SEARCH">
<input type="text" placeholder="输入姓名进行搜索" v-model="searchvalue" @input="changeInput"/>
<span class="iconfont icon-chacha" v-if="searchvalue" @click="delSearchValue"></span>
</div>
<div class="items" v-for="(item,index) in list" :key="index" @click="routerToPunchClockDetail(item)"> <div class="items" v-for="(item,index) in list" :key="index" @click="routerToPunchClockDetail(item)">
<div class="avatar"> <div class="avatar">
<img src="" alt=""> <img src="" alt="">
...@@ -259,7 +291,8 @@ export default { ...@@ -259,7 +291,8 @@ export default {
list:[], list:[],
page:1, page:1,
per_page:20, per_page:20,
y:0 y:0,
searchvalue:''
} }
}, },
components:{ components:{
...@@ -310,6 +343,19 @@ export default { ...@@ -310,6 +343,19 @@ export default {
}) })
}, },
methods:{ methods:{
async changeInput(){
this.page = 1;
this.per_page = 20;
this.list = [];
await this.getList(true);
},
async delSearchValue(){
this.searchvalue = '';
this.page = 1;
this.per_page = 20;
this.list = [];
await this.getList(true);
},
switchTabItem(index){ switchTabItem(index){
this.activeTab = index; this.activeTab = index;
if(this.activeTab == 0){ if(this.activeTab == 0){
...@@ -592,25 +638,32 @@ export default { ...@@ -592,25 +638,32 @@ export default {
this.set4 = this.set4.filter(x=>x.value > 0); this.set4 = this.set4.filter(x=>x.value > 0);
} }
}, },
async getList(){ async getList(flag){
if(this.per_page < 20){ if(this.per_page < 20){
this.$vux.toast.text('已加载全部数据!', 'middle') this.$vux.toast.text('已加载全部数据!', 'middle')
return false; return false;
} }
let postData = [
{key:'url',value:'HealthLog'},
{key:'dDate',value: this.hdr.dDate},
{key:'iCompanyId',value: this.hdr.iCompanyId},
{key:'iType',value:'1'}
];
this.searchvalue && (postData.push({key:'searchvalue',value:this.searchvalue}));
let res = await this.request('getStatisticalDetails',{ let res = await this.request('getStatisticalDetails',{
data:[ data:postData,
{key:'url',value:'HealthLog'},
{key:'dDate',value: this.hdr.dDate},
{key:'iCompanyId',value: this.hdr.iCompanyId},
{key:'iType',value:'1'}
],
params:{ params:{
page:this.page, page:this.page,
per_page:this.per_page per_page:this.per_page
}, },
},'加载中',{}); },'加载中',{});
if(res && res.length > 0){ if(res && res.length > 0){
this.list = this.list.concat(res); if(flag){
this.list = res;
}else{
this.list = this.list.concat(res);
}
this.page++; this.page++;
this.per_page = res.length; this.per_page = res.length;
} }
......
...@@ -6,74 +6,79 @@ ...@@ -6,74 +6,79 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.items{ .items{
// flex-grow:1; flex-grow:1;
// height:1px; height:1px;
margin:15px 15px 0 15px; overflow: auto;
.HEAD{ -webkit-overflow-scrolling: touch;
border-top-left-radius: 6px; .item{
border-top-right-radius: 6px; margin:15px 15px 0 15px;
background: #6b9bf7; .HEAD{
height:60px; border-top-left-radius: 6px;
display: flex; border-top-right-radius: 6px;
align-items: center; background: #6b9bf7;
padding:0 10px; height:60px;
.left{ display: flex;
flex:1; align-items: center;
color:white; padding:0 10px;
font-size:18px; .left{
font-weight: bold; flex:1;
}
.right{
flex:1;
text-align: right;
display:flex;
flex-wrap: wrap;
div{
width:100%;
color:white; color:white;
}
.month{
font-size:14px;
}
.day{
font-size:18px; font-size:18px;
font-weight: bold; font-weight: bold;
} }
.right{
flex:1;
text-align: right;
display:flex;
flex-wrap: wrap;
div{
width:100%;
color:white;
}
.month{
font-size:14px;
}
.day{
font-size:18px;
font-weight: bold;
}
}
} }
} .CONTENT{
.CONTENT{ border-bottom-left-radius: 6px;
border-bottom-left-radius: 6px; border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px; border:2px solid #6b9bf7;
border:2px solid #6b9bf7; border-top:0;
border-top:0; padding:10px;
padding:10px;
display: flex;
justify-content: center;
align-items: center;
.left,.right,.center{
display: flex; display: flex;
flex-wrap: wrap;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex:1; .left,.right,.center{
.n{ display: flex;
width:100%; flex-wrap: wrap;
color:#527cd9; justify-content: center;
font-weight: bold; align-items: center;
font-size:20px; flex:1;
text-align: center; .n{
} width:100%;
.t{ color:#527cd9;
width:100%; font-weight: bold;
font-size:14px; font-size:20px;
text-align: center; text-align: center;
}
.t{
width:100%;
font-size:14px;
text-align: center;
}
} }
} }
} }
.item:last-child{
margin-bottom:15px;
}
} }
.items:last-child{
margin-bottom:15px;
}
.img{ .img{
width:100%; width:100%;
display: flex; display: flex;
...@@ -83,52 +88,77 @@ ...@@ -83,52 +88,77 @@
height:300px; height:300px;
} }
} }
.btn{
height:40px;
margin:0 15px 10px 15px;
>button{
height:40px;
color:white;
width:100%;
line-height: 40px;
background: #2d8cf0;
border-radius: 5px;
font-size:14px;
}
}
} }
</style> </style>
<template> <template>
<div id="healthCardStatisticsIndex"> <div id="healthCardStatisticsIndex">
<div class="items" v-for="(item,index) in list" :key="index" @click="routerToChart(item)"> <div class="items">
<div class="HEAD" > <div class="item" v-for="(item,index) in list" :key="index" @click="routerToChart(item)">
<div class="left"> <div class="HEAD" >
<span>{{item.iAllJoin}}/{{item.iAll}}</span> <div class="left">
</div> <span>{{item.iAllJoin}}/{{item.iAll}}</span>
<div class="right"> </div>
<div class="day">{{item.iDay}}</div> <div class="right">
<div class="month">{{item.sMonth}}</div> <div class="day">{{item.iDay}}</div>
</div> <div class="month">{{item.sMonth}}</div>
</div> </div>
<div class="CONTENT"> </div>
<div class="left"> <div class="CONTENT">
<div class="n">{{item.iAll}}</div> <div class="left">
<div class="t">应参与人员</div> <div class="n">{{item.iAll}}</div>
</div> <div class="t">应参与人员</div>
<div class="center"> </div>
<div class="n">{{item.iAllJoin}}</div> <div class="center">
<div class="t">已参与人员</div> <div class="n">{{item.iAllJoin}}</div>
</div> <div class="t">已参与人员</div>
<div class="right"> </div>
<div class="n">{{item.iAllNotJoin}}</div> <div class="right">
<div class="t">未参与人员</div> <div class="n">{{item.iAllNotJoin}}</div>
</div> <div class="t">未参与人员</div>
</div> </div>
</div>
</div>
</div> </div>
<div class="img" v-if="list.length <= 0"> <div class="img" v-if="list.length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt=""> <img src="@/assets/noData.jpg" class="_img" alt="">
</div> </div>
<div class="btn" v-if="list.length > 0">
<!-- <span v-show="false" id="copyUrl">{{copyUrl}}</span> -->
<button @click="exportExcel" class="copy" :data-clipboard-text="copyUrl">导出excel</button>
</div>
</div> </div>
</template> </template>
<script> <script>
import Util from '@/libs/util.js'; import Util from '@/libs/util.js';
import {mapState} from 'vuex'; import {mapState} from 'vuex';
import axios from 'axios';
import ClipboardJS from 'clipboard'
import { setTimeout } from 'timers';
export default { export default {
name: 'healthCardStatisticsIndex', name: 'healthCardStatisticsIndex',
data () { data () {
return { return {
list:[], list:[],
openId:'' openId:'',
copyUrl:''
} }
}, },
components:{ components:{
...@@ -146,6 +176,22 @@ export default { ...@@ -146,6 +176,22 @@ export default {
async activated(){ async activated(){
window.d = this; window.d = this;
await this.getData(); await this.getData();
// axios({
// method: 'get',
// url:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/1227787695263191040/sendmessage/excel/?iCompanyID=1382&t=0.34324224',
// responseType: 'blob'
// })
// .then(data => {
// let url = window.URL.createObjectURL(data.data)
// let link = document.createElement('a')
// link.style.display = 'none'
// link.href = url
// console.log(url)
// link.setAttribute('download', 'product.xls')
// document.body.appendChild(link)
// link.click()
// })
}, },
methods:{ methods:{
async getData(){ async getData(){
...@@ -158,11 +204,24 @@ export default { ...@@ -158,11 +204,24 @@ export default {
},'加载中',{}); },'加载中',{});
if(res && res.length > 0) { if(res && res.length > 0) {
this.list = res; this.list = res;
this.copyUrl = `https://weixin.huansi.net/apiproxy/huansi/service/proxy/1227787695263191040/sendmessage/excel/?iCompanyID=${this.list[0].iCompanyId}&t=${Math.random()}`
} }
}, },
routerToChart(item){ routerToChart(item){
this.$store.dispatch('saveHealthStatisticsHdr',item); this.$store.dispatch('saveHealthStatisticsHdr',item);
this.$router.push({name:'healthCardStatisticsChart'}); this.$router.push({name:'healthCardStatisticsChart'});
},
async exportExcel(){
this.$vux.loading.show();
setTimeout(async ()=>{
var clipboard = await new ClipboardJS('.copy');
this.$vux.loading.hide();
this.$vux.confirm.show({
title:"提示",
content:'已复制导出链接,请手动打开浏览器粘贴并下载!',
showCancelButton:false,
})
},1000)
} }
} }
} }
......
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