Blame view

src/pages/substituteInfo/index.vue 3.14 KB
ce4c83ff   wxy   初始提交
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
  <template>
    <div class='container'>
      <div class="row">
        <span class="title">代班人</span>
        <span class="cont">{{name}}</span>
      </div>
      <div class="row">
        <span class="title">代班社区</span>
        <span class="cont">{{commName}}</span>
      </div>
      <div class="row">
        <span class="title">代班时间</span>
        <span class="cont">{{createDate}}</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">{{substitute.name}}</span>
      </div>
      <div class="row">
        <span class="title">审批状态</span>
        <span class="cont">
          <span class="status ongoing" v-if="substitute.status ==0">申请中</span>
          <span class="status finish" v-else>已审批</span>
        </span>
      </div>-->
    </div>
  </template>
  
  <script>
    export default {
      data() {
        return {
          substitute: null,
          id: null,
          sysNewsId: '',
          createDate: null,
          loaded: false,
          name: '',
          commName: '',
          cause: ''
        }
      },
      methods: {
        loadArticles () {
          this.getList()
        },
        getList(){
          wx.showLoading({ title: '正在加载' })
          wx.request({
            url: this.rootUrl + 'lawSubstitute/getSubstitute',
            method: 'get',
            header: {'content-type': 'application/x-www-form-urlencoded'},
            data:{
              id: this.id,
              sysNewsId: this.sysNewsId,
              sessionID: wx.getStorageSync('sessionID')
            },
            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.schedule_Date , 'full')
                this.substitute = res.data
                this.cause = res.data.cause
                this.name = res.data.name
                this.commName = res.data.comm_Name
                // 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.substitute = null
        this.id = null
        this.sysNewsId = ''
        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>