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

upload

parent 97d0fd62
......@@ -49,6 +49,7 @@
"babel-register": "^6.22.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"clipboard": "^2.0.4",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^0.28.0",
......
......@@ -2,5 +2,6 @@ module.exports = {
getStatisticalDetails:{url:"/healthlog/",method:"post",host:"health"},
saveHealth:{url:"/healthlog/save/",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'
import echarts from 'echarts'
import Calendar from 'vue-mobile-calendar/lib/install.js'
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 Meta from 'vue-meta';
......@@ -34,6 +34,7 @@ Vue.use(Toast)
Vue.use(ConfirmPlugin);
Vue.use(ToastPlugin);
Vue.use(DatetimePlugin);
Vue.use(LoadingPlugin);
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>
<div class="healthCard">
<v-app>
<keep-alive>
<router-view></router-view>
</keep-alive>
</v-app>
<div class="vApp">
<div class="keepAlive">
<keep-alive>
<router-view></router-view>
</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>
</template>
<script>
import { Tabbar, TabbarItem } from 'vux'
export default {
name: 'healthCard',
data () {
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 @@
background: white;
overflow: auto;
-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{
display: flex;
height:60px;
......@@ -210,6 +238,10 @@
</div>
</div>
<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="avatar">
<img src="" alt="">
......@@ -259,7 +291,8 @@ export default {
list:[],
page:1,
per_page:20,
y:0
y:0,
searchvalue:''
}
},
components:{
......@@ -310,6 +343,19 @@ export default {
})
},
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){
this.activeTab = index;
if(this.activeTab == 0){
......@@ -592,25 +638,32 @@ export default {
this.set4 = this.set4.filter(x=>x.value > 0);
}
},
async getList(){
async getList(flag){
if(this.per_page < 20){
this.$vux.toast.text('已加载全部数据!', 'middle')
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',{
data:[
{key:'url',value:'HealthLog'},
{key:'dDate',value: this.hdr.dDate},
{key:'iCompanyId',value: this.hdr.iCompanyId},
{key:'iType',value:'1'}
],
data:postData,
params:{
page:this.page,
per_page:this.per_page
},
},'加载中',{});
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.per_page = res.length;
}
......
......@@ -6,74 +6,79 @@
display: flex;
flex-direction: column;
.items{
// flex-grow:1;
// height:1px;
margin:15px 15px 0 15px;
.HEAD{
border-top-left-radius: 6px;
border-top-right-radius: 6px;
background: #6b9bf7;
height:60px;
display: flex;
align-items: center;
padding:0 10px;
.left{
flex:1;
color:white;
font-size:18px;
font-weight: bold;
}
.right{
flex:1;
text-align: right;
display:flex;
flex-wrap: wrap;
div{
width:100%;
flex-grow:1;
height:1px;
overflow: auto;
-webkit-overflow-scrolling: touch;
.item{
margin:15px 15px 0 15px;
.HEAD{
border-top-left-radius: 6px;
border-top-right-radius: 6px;
background: #6b9bf7;
height:60px;
display: flex;
align-items: center;
padding:0 10px;
.left{
flex:1;
color:white;
}
.month{
font-size:14px;
}
.day{
font-size:18px;
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{
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border:2px solid #6b9bf7;
border-top:0;
padding:10px;
display: flex;
justify-content: center;
align-items: center;
.left,.right,.center{
.CONTENT{
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
border:2px solid #6b9bf7;
border-top:0;
padding:10px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
flex:1;
.n{
width:100%;
color:#527cd9;
font-weight: bold;
font-size:20px;
text-align: center;
}
.t{
width:100%;
font-size:14px;
text-align: center;
.left,.right,.center{
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
flex:1;
.n{
width:100%;
color:#527cd9;
font-weight: bold;
font-size:20px;
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{
width:100%;
display: flex;
......@@ -83,52 +88,77 @@
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>
<template>
<div id="healthCardStatisticsIndex">
<div class="items" v-for="(item,index) in list" :key="index" @click="routerToChart(item)">
<div class="HEAD" >
<div class="left">
<span>{{item.iAllJoin}}/{{item.iAll}}</span>
</div>
<div class="right">
<div class="day">{{item.iDay}}</div>
<div class="month">{{item.sMonth}}</div>
</div>
</div>
<div class="CONTENT">
<div class="left">
<div class="n">{{item.iAll}}</div>
<div class="t">应参与人员</div>
</div>
<div class="center">
<div class="n">{{item.iAllJoin}}</div>
<div class="t">已参与人员</div>
</div>
<div class="right">
<div class="n">{{item.iAllNotJoin}}</div>
<div class="t">未参与人员</div>
</div>
</div>
<div class="items">
<div class="item" v-for="(item,index) in list" :key="index" @click="routerToChart(item)">
<div class="HEAD" >
<div class="left">
<span>{{item.iAllJoin}}/{{item.iAll}}</span>
</div>
<div class="right">
<div class="day">{{item.iDay}}</div>
<div class="month">{{item.sMonth}}</div>
</div>
</div>
<div class="CONTENT">
<div class="left">
<div class="n">{{item.iAll}}</div>
<div class="t">应参与人员</div>
</div>
<div class="center">
<div class="n">{{item.iAllJoin}}</div>
<div class="t">已参与人员</div>
</div>
<div class="right">
<div class="n">{{item.iAllNotJoin}}</div>
<div class="t">未参与人员</div>
</div>
</div>
</div>
</div>
<div class="img" v-if="list.length <= 0">
<img src="@/assets/noData.jpg" class="_img" alt="">
</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>
</template>
<script>
import Util from '@/libs/util.js';
import {mapState} from 'vuex';
import axios from 'axios';
import ClipboardJS from 'clipboard'
import { setTimeout } from 'timers';
export default {
name: 'healthCardStatisticsIndex',
data () {
return {
list:[],
openId:''
openId:'',
copyUrl:''
}
},
components:{
......@@ -146,6 +176,22 @@ export default {
async activated(){
window.d = this;
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:{
async getData(){
......@@ -158,11 +204,24 @@ export default {
},'加载中',{});
if(res && res.length > 0) {
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){
this.$store.dispatch('saveHealthStatisticsHdr',item);
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