index.vue
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<template>
<div class='container'>
<div class="row">
<span class="title">申请时间</span>
<span class="cont">{{createDate}}</span>
</div>
<div class="row">
<span class="title">申请人</span>
<span class="cont">{{userName}}</span>
</div>
<div class="row">
<span class="title">开始时间</span>
<span class="cont">{{startDate}}</span>
</div>
<div class="row">
<span class="title">结束时间</span>
<span class="cont">{{endDate}}</span>
</div>
<div class="row">
<span class="title">请假事由</span>
<span class="cont">{{cause}}</span>
</div>
<div class="row">
<span class="title">审批人</span>
<span class="cont">{{name}}</span>
</div>
<div class="row">
<span class="title">审批状态</span>
<span class="cont">
<span class="status ongoing" v-if="status==0">律所审核中</span>
<span class="status ongoing" v-if="status==1">司法审核中</span>
<span class="status finish" v-if="status==2">已审核</span>
</span>
</div>
</div>
</template>
<script>
export default {
data() {
return {
leave: null,
id: null,
sysNewsId: 1,
createDate: null,
userName: '',
startDate: '',
endDate: '',
name: '',
cause: '',
status: '',
loaded: false
}
},
methods: {
loadArticles () {
this.getList()
},
getList(){
wx.showLoading({ title: '正在加载' })
wx.request({
url: this.rootUrl + 'leave/getLeave',
method: 'get',
header: {'content-type': 'application/x-www-form-urlencoded'},
data:{
id: this.id,
sessionID: wx.getStorageSync('sessionID'),
sysNewsId: this.sysNewsId
},
success: res=> {
if(res.statusCode=='500'){
this.service.getUnionId(this.rootAvatar,this.rootUrl).then(res=>{
console.log(res)
this.loadArticles()
})
}else{
console.log(res.data)
this.createDate = this.service.correctTime(res.data.createDate, 'full')
this.leave = res.data
this.userName = res.data.user_name
this.startDate = res.data.start_Date
this.endDate = res.data.end_Date
this.name = res.data.name
this.cause = res.data.cause
this.status = res.data.status
// this.createDate = util.formatTime(res.data.createDate)
wx.hideLoading()
}
},
fail: res=> {
console.log(res)
}
})
},
},
onLoad(){
this.id = this.$root.$mp.query.id
this.sysNewsId = this.$root.$mp.query.sysNewsId
this.getList()
},
onShow() {
this.loadArticles()
},
onUnload(){
this.leave = null
this.id = null
this.sysNewsId = 1
this.loaded = false
}
}
</script>
<style lang="stylus" scoped>
.container
position absolute
Height_Width(100%)
Background()
.row
width 100%
box-sizing border-box
padding 25rpx
background-color #fff
border-bottom 1rpx solid #eee
line-height 40rpx
.title
color #888
.cont
float right
color #333
.status
display inline-block
padding 5rpx 10rpx
border-radius 6rpx
color #fff
font-size 26rpx
.ongoing
background-color #f6b35a
.finish
background-color #00D49D
</style>