Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WX_h5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
godwithdh
WX_h5
Commits
035c5ad2
Commit
035c5ad2
authored
Feb 15, 2020
by
张锡奇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uploda
parent
45980e3b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
521 additions
and
19 deletions
+521
-19
healthApi.js
src/libs/healthApi.js
+4
-1
host.js
src/libs/host.js
+2
-2
health.js
src/router/health.js
+26
-3
statistics.js
src/store/modules/health/statistics.js
+8
-1
return.png
src/view/healthCard/image/return.png
+0
-0
return_active.png
src/view/healthCard/image/return_active.png
+0
-0
index.vue
src/view/healthCard/index.vue
+67
-10
index.vue
src/view/healthCard/returnTrack/index.vue
+412
-0
index.vue
src/view/healthCard/statistics/index.vue
+2
-2
No files found.
src/libs/healthApi.js
View file @
035c5ad2
...
...
@@ -3,5 +3,8 @@ module.exports = {
saveHealth
:{
url
:
"/healthlog/save/"
,
method
:
"post"
,
host
:
"health"
},
getHealthEmploee
:{
url
:
"/healthemploee"
,
method
:
"post"
,
host
:
"health"
},
getExcel
:{
url
:
"/sendmessage/excel/"
,
method
:
"get"
,
host
:
"health"
},
getHealthbacklog
:{
url
:
"/healthbacklog/"
,
method
:
"post"
,
host
:
"health"
},
saveHealthbacklog
:{
url
:
"/healthbacklog/save/"
,
method
:
"post"
,
host
:
"health"
},
getHealthcompany
:{
url
:
"/healthcompany/"
,
method
:
"post"
,
host
:
"health"
},
saveHealthemploee
:{
url
:
"/healthemploee/save/"
,
method
:
"post"
,
host
:
"health"
},
}
\ No newline at end of file
src/libs/host.js
View file @
035c5ad2
...
...
@@ -31,8 +31,8 @@ function urlFun(name){
/**
* 健康打卡统计
*/
health
:
`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1225621052093239296`
,
//
health:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1227787695263191040`, //测试地址
//
health:`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1225621052093239296`,
health
:
`https://weixin.huansi.net/apiproxy/huansi/service/proxy/1227787695263191040`
,
//测试地址
// health:`http://xuxiaoming.vaiwan.com`
}
return
url
[
name
]
...
...
src/router/health.js
View file @
035c5ad2
...
...
@@ -24,7 +24,9 @@ module.exports = [
name
:
'healthCardStatisticsIndex'
,
component
:()
=>
import
(
'@/view/healthCard/statistics/index.vue'
),
meta
:{
title
:
'健康打卡'
title
:
'健康打卡'
,
showTabbar
:
true
,
activeTab
:
2
}
},
{
...
...
@@ -32,7 +34,9 @@ module.exports = [
name
:
'healthCardStatisticsChart'
,
component
:()
=>
import
(
'@/view/healthCard/statistics/chart.vue'
),
meta
:{
title
:
'健康打卡'
title
:
'健康打卡'
,
showTabbar
:
true
,
activeTab
:
2
}
},
{
...
...
@@ -40,7 +44,9 @@ module.exports = [
name
:
'healthCardStatisticsList'
,
component
:()
=>
import
(
'@/view/healthCard/statistics/list.vue'
),
meta
:{
title
:
'健康打卡'
title
:
'健康打卡'
,
showTabbar
:
true
,
activeTab
:
2
}
}
]
...
...
@@ -67,5 +73,22 @@ module.exports = [
}
}
]
},
{
//返程
name
:
'healthCard'
,
component
:
()
=>
import
(
'@/view/healthCard/index.vue'
),
path
:
'/healthCard'
,
children
:[
{
path
:
'returnTrack/index/:iEmploeeId/:iCompanyId'
,
name
:
'healthCardReturnTrack'
,
component
:()
=>
import
(
'@/view/healthCard/returnTrack/index.vue'
),
meta
:{
title
:
'返程'
,
showTabbar
:
true
,
activeTab
:
1
}
},
]
}
]
\ No newline at end of file
src/store/modules/health/statistics.js
View file @
035c5ad2
...
...
@@ -5,7 +5,8 @@ const obj = {
state
:
{
hdr
:{},
dtl
:{},
openId
:
''
openId
:
''
,
baseData
:{}
},
mutations
:
{
saveHealthStatisticsHdr
(
state
,
data
){
...
...
@@ -16,6 +17,9 @@ const obj = {
},
saveHealthStatisticsOpen
(
state
,
data
){
state
.
openId
=
data
;
},
saveHealthBaseData
(
state
,
data
){
state
.
baseData
=
data
;
}
},
actions
:
{
...
...
@@ -28,6 +32,9 @@ const obj = {
saveHealthStatisticsOpen
({
commit
},
data
){
commit
(
'saveHealthStatisticsOpen'
,
data
);
},
saveHealthBaseData
({
commit
},
data
){
commit
(
'saveHealthBaseData'
,
data
)
}
}
};
...
...
src/view/healthCard/image/return.png
0 → 100644
View file @
035c5ad2
6.54 KB
src/view/healthCard/image/return_active.png
0 → 100644
View file @
035c5ad2
6.76 KB
src/view/healthCard/index.vue
View file @
035c5ad2
...
...
@@ -28,19 +28,19 @@
<router-view></router-view>
</keep-alive>
</div>
<div
class=
"TABBAR"
>
<tabbar
tabbar-text-active-color=
"#3e68f3"
v-if=
"showTabbar"
>
<div
class=
"TABBAR"
v-if=
"showTabbar"
>
<tabbar
tabbar-text-active-color=
"#3e68f3"
>
<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"
>
<tabbar-item
:selected=
'activeTab == 1'
@
on-item-click=
"clickTabbar(1)"
>
<img
slot=
"icon"
src=
"./image/
return
.png"
>
<img
slot=
"icon-active"
src=
"./image/
return
_active.png"
>
<span
slot=
"label"
:style=
"
{'color':activeTab == 1 ? '#3e69f3' : '#999999'}">返程
</span>
</tabbar-item>
-->
<tabbar-item
:selected=
'activeTab == 2'
@
on-item-click=
"clickTabbar(2)"
>
</tabbar-item>
<tabbar-item
:selected=
'activeTab == 2'
@
on-item-click=
"clickTabbar(2)"
v-if=
"baseData.bAdminUsers || baseData.bSystem == 1"
>
<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>
...
...
@@ -58,24 +58,47 @@
<
script
>
import
{
Tabbar
,
TabbarItem
}
from
'vux'
import
{
mapState
}
from
'vuex'
;
export
default
{
name
:
'healthCard'
,
data
()
{
return
{
activeTab
:
'2'
,
showTabbar
:
false
showTabbar
:
false
,
}
},
computed
:{
...
mapState
({
openId
:
state
=>
state
.
healthStatistics
.
openId
,
baseData
:
state
=>
state
.
healthStatistics
.
baseData
,
})
},
created
(){
this
.
showTabbar
=
this
.
$route
.
path
.
indexOf
(
'/healthCard/statistics'
)
==
-
1
?
false
:
true
;
window
.
d
=
this
;
this
.
showTabbar
=
this
.
$route
.
meta
.
showTabbar
;
this
.
activeTab
=
this
.
$route
.
meta
.
activeTab
;
},
components
:{
Tabbar
,
TabbarItem
},
watch
:{
$route
(
to
,
from
){
this
.
showTabbar
=
this
.
$route
.
meta
.
showTabbar
;
this
.
activeTab
=
this
.
$route
.
meta
.
activeTab
;
},
'openId'
:{
deep
:
true
,
handler
:
function
(
newV
,
oldV
){
if
(
newV
!=
oldV
){
this
.
getHealthcompany
();
}
}
}
},
methods
:{
clickTabbar
(
activeTab
){
this
.
activeTab
=
activeTab
;
if
(
this
.
activeTab
==
activeTab
)
return
false
;
switch
(
activeTab
){
case
0
:
wx
.
miniProgram
.
switchTab
({
...
...
@@ -83,6 +106,26 @@ export default {
})
break
;
case
1
:
this
.
$router
.
push
({
name
:
'healthCardReturnTrack'
,
params
:{
iEmploeeId
:
this
.
baseData
.
iEmploeeId
,
iCompanyId
:
this
.
baseData
.
iCompanyId
,
},
query
:{
openId
:
this
.
baseData
.
openId
}
})
break
;
case
2
:
this
.
$router
.
push
({
name
:
'healthCardStatisticsIndex'
,
query
:{
iEmploeeId
:
this
.
baseData
.
iEmploeeId
,
iCompanyId
:
this
.
baseData
.
iCompanyId
,
openId
:
this
.
baseData
.
openId
}
})
break
;
case
3
:
wx
.
miniProgram
.
switchTab
({
...
...
@@ -92,6 +135,20 @@ export default {
default
:
break
;
}
this
.
activeTab
=
activeTab
;
},
async
getHealthcompany
(){
let
result
=
await
this
.
request
(
'getHealthcompany'
,{
data
:[
{
key
:
"url"
,
value
:
"check_bhavecompany"
},
{
key
:
"openid"
,
value
:
this
.
openId
}
]
})
if
(
result
&&
result
.
length
>
0
){
result
[
0
].
iEmploeeId
=
result
[
0
].
iIden
;
result
[
0
].
openId
=
result
[
0
].
sCreateAppid
;
this
.
$store
.
dispatch
(
'saveHealthBaseData'
,
result
[
0
]);
}
}
}
}
...
...
src/view/healthCard/returnTrack/index.vue
0 → 100644
View file @
035c5ad2
<
style
lang=
"less"
>
@import url('../../../styles/common.less');
#healthCardReturnTrack{
overflow-x: hidden;
height:100%;
background: #f2f2f2;
display: flex;
flex-direction: column;
.iCard{
margin-top:0;
}
.iCard:last-child{
margin-bottom:10px;
}
.editArea{
margin: 0 8px;
height:40px;
line-height: 40px;
display:flex;
color:#3399ff;
font-weight: bold;
>i{
font-size:26px;
}
>span:nth-child(2){
flex:1;
padding: 0 10px;
}
>.editBtn{
>span{
border:1px solid #3399ff;
padding: 4px 6px;
border-radius: 4px;
background: white;
}
}
}
.deleteArea{
margin: 0 8px 0 8px;
height:40px;
line-height: 40px;
display:flex;
font-weight: bold;
justify-content:space-between;
align-items: center;
}
.tip{
color:#8a8a8a;
margin-bottom:10px;
}
.list{
background: #fff;
margin: 10px 0;
padding: 10px;
font-size: 15px;
.v-input--radio-group{
margin-top: 0;
margin-bottom: -15px;
.v-input__control{
width:100%;
.v-input__slot{
margin:0;
.v-input--radio-group__input{
>div{
label{
padding:4px 0;
flex-grow: 1;
font-size: 14px;
}
>.v-radio{
display:flex;
>div{
flex-shrink: 0;
}
}
}
}
}
}
}
>.item{
margin-top:6rpx;
p{
margin:0;
}
}
}
.noTr{
margin:0;
padding:0 10px;
.tip{
width:100%;
display: flex;
align-items: center;
margin:20px 0;
>span{
color:#3399ff;
font-weight: bold;
width:120px;
}
>div{
flex:1;
/deep/ .weui-cell{
padding: 0;
}
/deep/ .vux-datetime-value{
text-align: left;
}
>textarea{
width:100%;
min-height: 55px;
}
}
}
}
.CONTENT{
height:1px;
flex-grow: 1;
overflow: auto;
-webkit-overflow-scrolling: touch;
.addBtn{
margin: 0 8px;
height:60px;
line-height: 60px;
display:flex;
justify-content: center;
align-items: center;
border:2px dashed #3399ff;
>i{
font-size:30px;
color:#3399ff;
}
}
}
.btns{
display: flex;
height: 60px;
margin: 0 8px;
padding: 10px 0;
>button{
flex:1;
height: 50px;
border-radius: 6px;
}
}
}
</
style
>
<
template
>
<div
id=
"healthCardReturnTrack"
>
<div
class=
"editArea"
v-if=
"showEditArea"
>
<i
class=
'iconfont icon-banben'
></i>
<span>
表单已填写
</span>
<div
class=
"editBtn"
>
<span
@
click=
"edit"
>
我要修改
</span>
</div>
</div>
<div
class=
"iCard"
:style=
"
{'margin-bottom':'10px','margin-top':showEditArea ? '0' : '8px'}">
<div
class=
"list"
>
<div
class=
"tip"
>
1. 是否从其他城市返回
<span
style=
"color:red;"
>
*
</span></div>
<v-radio-group
v-model=
"baseData.bBackFromother"
:disabled=
"!!baseData.bBackFromother"
@
change=
"changeRadio"
>
<div
style=
"margin-bottom:10px;"
><v-radio
value=
"1"
label=
"从其他城市返回"
/></div>
<div><v-radio
value=
"0"
label=
"一直在工作地,无需返程"
/></div>
</v-radio-group>
</div>
</div>
<div
class=
"CONTENT"
v-if=
"baseData.bBackFromother"
>
<div
v-for=
"(item,index) in filterSubmitForm"
:key=
"index"
>
<div
class=
"deleteArea"
>
<span
style=
"color:#3399ff;"
>
返回统计(
{{
index
+
1
}}
)
</span>
<span
style=
"color:#ff6600;"
@
click=
"del(index)"
v-if=
"!showEditArea"
>
删除
</span>
</div>
<div
class=
"iCard"
>
<div
class=
"list noTr"
>
<div
class=
"tip"
>
<span>
返程出发地
</span>
<div>
<x-address
:disabled=
"isDisabled"
title=
""
v-model=
"submitForm[index].sBackaddress"
:list=
"addressData"
placeholder=
"请选择地址"
value-text-align=
"left"
/>
</div>
</div>
</div>
<div
class=
"list noTr"
>
<div
class=
"tip"
>
<span>
返程日期
</span>
<div>
<datetime
:readonly=
"isDisabled"
title=
""
format=
'YYYY-MM-DD'
placeholder=
"请选择返程日期"
v-model=
"submitForm[index].dBackDate"
/>
</div>
</div>
</div>
<div
class=
"list noTr"
>
<div
class=
"tip"
>
<span>
交通方式
</span>
<div>
<xInput
title=
""
:disabled=
"isDisabled"
placeholder=
"输入交通方式"
v-model=
"submitForm[index].sTransportation"
text-align=
"left"
placeholder-align=
"left"
/>
</div>
</div>
</div>
<div
class=
"list noTr"
>
<div
class=
"tip"
>
<span>
车次
</span>
<div>
<xInput
title=
""
:disabled=
"isDisabled"
placeholder=
"输入车次"
v-model=
"submitForm[index].sTrain"
text-align=
"left"
placeholder-align=
"left"
/>
</div>
</div>
</div>
<div
class=
"list noTr"
>
<div
class=
"tip"
>
<span
style=
"color:#8a8a8a;"
>
备注
</span>
<div>
<textarea
:placeholder=
"isDisabled ? '' : '请输入'"
:disabled=
"isDisabled"
autoHeight=
"true"
v-model=
"submitForm[index].sRemark"
/>
</div>
</div>
</div>
</div>
</div>
<div
class=
"addBtn"
@
click=
"add"
v-if=
"!showEditArea"
>
<i
class=
'iconfont icon-jia1'
></i>
</div>
</div>
<div
class=
"btns"
v-if=
"!showEditArea"
>
<button
style=
"background:#3399ff;color:white;margin-left:5px;"
@
click=
"save"
>
确定
</button>
</div>
</div>
</
template
>
<
script
>
import
util
from
"@/libs/util.js"
import
{
mapState
}
from
'vuex'
;
import
{
XAddress
,
ChinaAddressV4Data
,
Datetime
,
XInput
}
from
'vux'
function
list
(){
return
{
dBackDate
:
''
,
sBackaddress
:[],
sTransportation
:
''
,
sTrain
:
''
,
sRemark
:
''
,
iStatus
:
1
}
}
export
default
{
name
:
'healthCardReturnTrack'
,
components
:{
XAddress
,
Datetime
,
XInput
},
data
()
{
return
{
address
:[],
addressData
:
ChinaAddressV4Data
,
showEditArea
:
false
,
submitForm
:[],
isDisabled
:
false
,
isOtherCityReturn
:
''
,
list
:
list
()
}
},
computed
:{
...
mapState
({
baseData
:
state
=>
state
.
healthStatistics
.
baseData
,
}),
filterSubmitForm
(){
return
this
.
submitForm
.
filter
(
x
=>
x
.
iStatus
!=
3
);
}
},
async
activated
(){
window
.
d
=
this
;
this
.
$store
.
dispatch
(
'saveHealthStatisticsOpen'
,
this
.
$route
.
query
.
openId
);
await
this
.
getHealthData
();
},
methods
:{
changeRadio
(
e
){
let
data
=
util
.
deepClone
(
this
.
baseData
);
this
.
request
(
'saveHealthemploee'
,{
data
:{
iIden
:
data
.
iIden
,
iStatus
:
2
,
bBackFromother
:
e
==
'1'
?
true
:
false
}
}).
then
(
res
=>
{
data
.
bBackFromother
=
e
;
this
.
$store
.
dispatch
(
'saveHealthBaseData'
,
data
);
})
},
async
getHealthData
(){
let
res
=
await
this
.
request
(
'getHealthbacklog'
,{
data
:[
{
key
:
'url'
,
value
:
'HealthBackLog'
},
{
key
:
'iEmploeeId'
,
value
:
this
.
$route
.
params
.
iEmploeeId
},
],
params
:{},
},
'加载中'
,{});
if
(
res
&&
typeof
(
res
)
==
'object'
){
if
(
res
.
length
>
0
){
res
.
map
(
x
=>
{
x
.
iStatus
=
2
;
x
.
sBackaddress
=
x
.
sBackaddress
.
split
(
','
);
});
this
.
submitForm
=
res
;
this
.
isDisabled
=
true
;
this
.
showEditArea
=
true
;
}
else
{
let
data
=
list
();
data
.
iCompanyId
=
this
.
$route
.
params
.
iCompanyId
;
data
.
iEmploeeId
=
this
.
$route
.
params
.
iEmploeeId
;
this
.
submitForm
.
push
(
data
);
}
}
},
add
(){
let
data
=
list
();
data
.
iCompanyId
=
this
.
$route
.
params
.
iCompanyId
;
data
.
iEmploeeId
=
this
.
$route
.
params
.
iEmploeeId
;
this
.
submitForm
.
push
(
data
);
},
edit
(){
this
.
isDisabled
=
false
;
this
.
showEditArea
=
false
;
},
async
save
(){
if
(
!
this
.
checkData
()){
return
false
;
}
let
postData
=
util
.
deepClone
(
this
.
submitForm
);
let
i
=
0
;
postData
.
map
(
x
=>
{
if
(
x
.
iStatus
!=
3
){
x
.
iOrderNo
=
++
i
;
}
x
.
sBackaddress
=
x
.
sBackaddress
.
join
(
','
);
})
let
res
=
await
this
.
request
(
'saveHealthbacklog'
,{
data
:
postData
,
params
:{},
},
'加载中'
,{});
if
(
res
.
iStatus
==
1
){
this
.
$vux
.
toast
.
text
(
`保存成功!`
,
'middle'
);
this
.
getHealthData
();
}
},
del
(
index
){
this
.
$vux
.
confirm
.
show
({
title
:
"提示"
,
content
:
'是否删除?'
,
showCancelButton
:
true
,
onConfirm
:()
=>
{
if
(
this
.
submitForm
[
index
].
iStatus
==
1
){
this
.
submitForm
.
splice
(
index
,
1
);
}
else
if
(
this
.
submitForm
[
index
].
iStatus
==
2
){
this
.
submitForm
[
index
].
iStatus
=
3
;
}
},
onCancel
()
{}
})
},
checkData
(){
if
(
this
.
submitForm
.
length
==
0
){
this
.
$vux
.
toast
.
text
(
`请添加返程信息!`
,
'middle'
);
return
false
;
}
for
(
let
[
i
,
v
]
of
this
.
submitForm
.
entries
()){
for
(
let
x
in
v
){
if
(
x
==
'sBackaddress'
&&
v
[
x
].
length
==
0
){
this
.
$vux
.
toast
.
text
(
`第
${
i
+
1
}
项—返程出发地未选择!`
,
'middle'
);
return
false
;
break
;
}
else
if
(
x
==
'dBackDate'
&&
!
v
[
x
]){
this
.
$vux
.
toast
.
text
(
`第
${
i
+
1
}
项—返程日期未选择!`
,
'middle'
);
return
false
;
break
;
}
else
if
(
x
==
'sTransportation'
&&
!
v
[
x
]){
this
.
$vux
.
toast
.
text
(
`第
${
i
+
1
}
项—交通方式未填写!`
,
'middle'
);
return
false
;
break
;
}
else
if
(
x
==
'dBackDate'
&&
!
v
[
x
]){
this
.
$vux
.
toast
.
text
(
`第
${
i
+
1
}
项—车次未选择!`
,
'middle'
);
return
false
;
break
;
}
}
}
return
true
;
}
},
}
</
script
>
\ No newline at end of file
src/view/healthCard/statistics/index.vue
View file @
035c5ad2
...
...
@@ -106,8 +106,8 @@
<
template
>
<div
id=
"healthCardStatisticsIndex"
>
<div
class=
"items"
>
<div
class=
"item"
v-for=
"(item,index) in list"
:key=
"index"
@
click=
"routerToChart(item)"
>
<div
class=
"items"
v-if=
"list.length > 0"
>
<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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment