Commit 08bd22bb authored by 张锡奇's avatar 张锡奇

upload

parent 346587ea
module.exports = {
getStatisticalDetails:{url:"/healthlog/",method:"post",host:"health"},
saveHealth:{url:"/healthlog/save/",method:"post",host:"health"},
getHealthEmploee:{url:"/healthemploee",method:"post",host:"health"},
}
\ No newline at end of file
......@@ -46,12 +46,12 @@ module.exports = [
]
},
{//健康打卡
name:"main",
component:()=>import("@/view/main.vue"),
path:"/main",
name:"healthCard",
component:()=>import("@/view/healthCard/index.vue"),
path:"/healthCard",
children:[
{
path:"/healthCard/punchClock",
path:"healthCard/punchClock",
name:"punchClock",
component:()=>import("@/view/healthCard/punchClock.vue"),
meta:{
......@@ -59,21 +59,12 @@ module.exports = [
}
},
{
path:"/healthCard/punchClockDetail/:id/:openId/:address",
path:"punchClockDetail/:id/:openId/:address",
name:"punchClockDetail",
component:()=>import("@/view/healthCard/punchClockDetail.vue"),
meta:{
title:"打卡健康"
}
},
{
path:"/healthCard/punchClockDetail/:millisecond/:openId",
name:"punchClockDetail",
component:()=>import("@/view/healthCard/punchClockDetail.vue"),
meta:{
title:"打卡健康",
readOnly:true
}
}
]
}
......
......@@ -4,7 +4,8 @@ import Vue from 'vue';
const obj = {
state: {
hdr:{},
dtl:{}
dtl:{},
openId:''
},
mutations: {
saveHealthStatisticsHdr(state,data){
......@@ -13,6 +14,9 @@ const obj = {
saveHealthStatisticsDtl(state,data){
state.dtl = data;
},
saveHealthStatisticsOpen(state,data){
state.openId = data;
}
},
actions: {
saveHealthStatisticsHdr({commit},data){
......@@ -21,6 +25,9 @@ const obj = {
saveHealthStatisticsDtl({commit},data){
commit('saveHealthStatisticsDtl',data);
},
saveHealthStatisticsOpen({commit},data){
commit('saveHealthStatisticsOpen',data);
},
}
};
......
......@@ -65,8 +65,8 @@
<div><v-radio value="其他" label="其他"/></div>
</v-radio-group>
</div>
<div class="list">
<div class="tip"><span style="color:red;" v-if="!readOnly">*</span>2. 目前所在城市</div>
<div class="list" v-if="!readOnly">
<div class="tip"><span style="color:red;" >*</span>2. 目前所在城市</div>
<x-address
:disabled="readOnly"
@on-hide="logHide"
......@@ -80,8 +80,8 @@
value-text-align="left"
:show.sync="showAddress"/>
</div>
<div class="list">
<div class="tip"><span style="color:red;" v-if="!readOnly">*</span>2. 目前所在城市</div>
<div class="list" v-if="readOnly">
<div class="tip">2. 目前所在城市</div>
<span>{{value.sAddressFull}}</span>
</div>
<div class="list">
......@@ -146,6 +146,7 @@
<script>
import util from "@/libs/util.js"
import {mapState} from 'vuex';
import { XAddress,ChinaAddressV4Data,Datetime,XInput } from 'vux'
export default {
......@@ -179,12 +180,20 @@ export default {
millisecond:"",//毫秒数
}
},
created(){
this.readOnly=this.$route.meta.readOnly
computed:{
...mapState({
hdr:state => state.healthStatistics.hdr,
})
},
async activated(){
window.d = this;
this.readOnly=this.$route.query.readOnly
this.value.sCreateAppid=this.$route.params.openId
console.log(this.$route.params.openId)
console.log(this.readOnly)
if(this.readOnly){
this.millisecond=this.$route.params.millisecond
this.getHealthDate()
await this.getHealthDate();
}else{
this.value.iEmploeeId=this.$route.params.id
this.value.sAddressFull=this.$route.params.address
......@@ -194,13 +203,27 @@ export default {
},
methods:{
async getHealthDate(){
var data=[
{key:"url",value:"HealthLog"},
{key:"dDate",value:util.dateFormat(new Date(this.millisecond),"yyyy-MM-dd")},
{key:"openid",value:this.value.sCreateAppid}
]
var value=await this.request("getStatisticalDetails",data)
// if()
let res = await this.request('getStatisticalDetails',{
data:[
{key:'url',value:'HealthLog'},
{key:'dDate',value: this.hdr.dDate},
{key:"openid",value:this.value.sCreateAppid}
],
params:{},
},'加载中',{});
if(res && typeof(res) == 'object'){
this.value = res[0];
for(let x in this.value){
if(util.getType(this.value[x]) == 'boolean'){
if(this.value[x]){
this.value[x] = 1;
}else{
this.value[x] = 0;
}
}
}
this.address = this.value.sAddressFull;
}
},
logHide(e){
......
......@@ -192,7 +192,7 @@
</div>
</div>
<div v-show="activeTab == 1" class="activeTab2" ref="scrollDom" @scroll="scrollToBottom">
<div class="items" v-for="(item,index) in list" :key="index">
<div class="items" v-for="(item,index) in list" :key="index" @click="routerToPunchClockDetail(item)">
<div class="avatar">
<img src="" alt="">
<span>{{item.sEmploeeName[0]}}</span>
......@@ -243,7 +243,8 @@ export default {
},
computed:{
...mapState({
hdr:state => state.healthStatistics.hdr
hdr:state => state.healthStatistics.hdr,
openId:state => state.healthStatistics.openId
})
},
async mounted(){
......@@ -518,6 +519,9 @@ export default {
},
routerToList(type){
this.$router.push({name:'healthCardStatisticsList',params:{type:type}});
},
routerToPunchClockDetail(item){
this.$router.push({name:'punchClockDetail',params:{id:'1',address:'1',openId:this.openId},query:{readOnly:true}})
}
}
}
......
......@@ -141,6 +141,7 @@ export default {
},
async mounted(){
this.openId=this.$route.query.openId;
this.$store.dispatch('saveHealthStatisticsOpen',this.openId);
},
async activated(){
window.d = this;
......
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