financ-details.vue 10.7 KB
Newer Older
786817560's avatar
786817560 committed
1 2
<!--
 * @Author: your name
3
 * @Date: 2019-10-30 19:29:24
786817560's avatar
786817560 committed
4
 * @LastEditTime : 2019-12-26 16:47:36
786817560's avatar
786817560 committed
5
 * @LastEditors  : Please set LastEditors
6
 * @Description: In User Settings Edit
786817560's avatar
786817560 committed
7 8
 -->
<template>
9 10 11 12 13 14 15 16 17 18 19
  <h-view id="repay-plan-agent" class="public-style">
    <h-header :proportion="[5,1,1]" class="bar-custom">
      <div slot="left" class="h-header-btn">
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()">
        <span>融资明细</span>
      </div>
    </h-header>
    <div class="center">

      <div class="total">
        <div class="sum">
786817560's avatar
786817560 committed
20
          <div>租金总额</div>
786817560's avatar
786817560 committed
21
          <p>{{ info.total_rental_sum | currency }}</p>
22 23
          <img src="@/assets/contractInquire/num.png" alt="">
          <h3><span>{{ info.lease_times }}</span></h3>
786817560's avatar
786817560 committed
24
        </div>
25
        <div class="single">
linxin's avatar
linxin committed
26 27 28
          <div><h4>保证金</h4><p>{{ parseFloat(info.deposit*product_num).toFixed(2) | currency }}</p></div>
          <div><h4>首付款</h4><p>{{ parseFloat(info.down_payment*product_num).toFixed(2) | currency }}</p></div>
          <div><h4>手续费</h4><p>{{ parseFloat(info.lease_charge*product_num).toFixed(2) | currency }}</p></div>
786817560's avatar
786817560 committed
29 30
        </div>
      </div>
31 32 33 34
      <div class="plan-name">
        <div class="header">还款计划</div>
        <img :class="{'rotate':show}" src="@/assets/contractInquire/top.png" alt="" @click="showDetails">
      </div>
786817560's avatar
786817560 committed
35
    </div>
36 37 38 39 40 41 42 43 44 45
    <h-content id="content" class="plan-content">
      <!-- 已结清 black , 逾期 orange , 还款中 blue , 未还款 green -->
      <div v-for="(item,index) in repayLists" :key="index" :class="{'plan-list':true,'or':statu==='orange','bl':statu==='blue','gr':statu==='green'}">
        <div :class="{'period':true,'orange':statu==='orange','blue':statu==='blue','green':statu==='green'}">{{ index + 1 }}</div>
        <img v-if="statu === 'black'" src="@/assets/contractInquire/black.png" alt="" class="left">
        <img v-if="statu === 'orange'" src="@/assets/contractInquire/orange.png" alt="" class="left">
        <img v-if="statu === 'blue'" src="@/assets/contractInquire/blue.png" alt="" class="left">
        <img v-if="statu === 'green'" src="@/assets/contractInquire/green.png" alt="" class="left">
        <div class="time">
          <p>{{ item.due_date.substr(0,4) }}</p>
786817560's avatar
786817560 committed
46
          <span>{{ dateConverse(item.due_date).substr(5,10) }}</span>
47 48
        </div>
        <div class="number">
786817560's avatar
786817560 committed
49 50 51 52 53 54 55 56 57 58 59 60
          <div>
            <span>本金</span>
            <span>{{ item.principal |currency }}</span>
          </div>
          <div>
            <span>租金</span>
            <span :class="{'orang':statu==='orange','blu':statu==='blue','gree':statu==='green'}">{{ item.rental |currency }}</span>
          </div>
        </div>
        <div class="name">
          <span>利息</span>
          <span>{{ item.interest | currency }}</span>
61 62 63 64
        </div>
        <img v-if="statu === 'black'" src="@/assets/contractInquire/done.png" alt="" class="status">
        <img v-if="statu === 'orange'" src="@/assets/contractInquire/prompt.png" alt="" class="status">
      </div>
786817560's avatar
786817560 committed
65
    </h-content>
66

786817560's avatar
786817560 committed
67 68
  </h-view>
</template>
69

786817560's avatar
786817560 committed
70
<script>
71

786817560's avatar
786817560 committed
72 73
export default {
  name: 'FinancDetails',
74 75
  components: {
  },
786817560's avatar
786817560 committed
76 77
  data () {
    return {
78 79 80 81 82 83 84 85
      //  已结清 black , 逾期 orange , 还款中 blue , 未还款 green
      statu: 'orange',
      info: {},
      show: false,
      height: 0,
      oldHeight: 0,
      newHeight: 0,
      repayLists: [], // 每期还款
786817560's avatar
786817560 committed
86
      product_num: this.$route.params.product_num,
786817560's avatar
786817560 committed
87 88
    }
  },
89 90 91 92 93 94 95 96 97
  computed: {},
  watch: {},
  beforeRouteEnter (to, from, next) {
    next(vm => {
      if (from.name === 'ContractDetails') {
        vm.repayQuery()
      }
    })
    next()
786817560's avatar
786817560 committed
98 99
  },
  methods: {
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
    dateConverse (date) {
      return date.replace(/\//g, '-')
    },
    // 根据还款期排序
    arrSort (property) {
      return function (a, b) {
        var value1 = a[property]
        var value2 = b[property]
        return value1 - value2
      }
    },
    showDetails () {
      if (!this.flag) {
        this.flag = true
        this.height = document.getElementsByClassName('total')[0].clientHeight
        this.oldHeight = document.getElementById('content').clientHeight
        this.newHeight = this.height + this.oldHeight
      }
      if (!this.show) {
        this.show = !this.show
        document.getElementById('content').style.height = this.newHeight + 'px'
        document.getElementsByClassName('center')[0].style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementsByClassName('center')[0].style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
        document.getElementById('content').style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementById('content').style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
      } else {
        this.show = !this.show
        document.getElementById('content').style.height = this.oldHeight + 'px'
        document.getElementsByClassName('center')[0].style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementsByClassName('center')[0].style.transform = 'translate(0px, -' + 0 + 'px) scale(1) translateZ(0px)'
        document.getElementById('content').style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementById('content').style.transform = 'translate(0px, -' + 0 + 'px) scale(1) translateZ(0px)'
      }
    },
    // 还款计划查询
    repayQuery () {
786817560's avatar
786817560 committed
136
      let vm = this
137
      let url = $config.basePath + 'prj_cashflow_query'
786817560's avatar
786817560 committed
138
      let param = {
139
        project_id: vm.$route.params.project_id,
786817560's avatar
786817560 committed
140
      }
786817560's avatar
786817560 committed
141
      vm.hlsPopup.showLoading('数据加载中')
786817560's avatar
786817560 committed
142 143 144
      vm.hlsHttp.post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
145 146 147 148
          vm.info = res.info
          vm.repayLists = res.lists.sort(vm.arrSort('times')) // 根据还款期排序
        } else {
          hlsPopup.showLongCenter(res.message)
786817560's avatar
786817560 committed
149 150
        }
      })
786817560's avatar
786817560 committed
151
    },
786817560's avatar
786817560 committed
152
  },
153

786817560's avatar
786817560 committed
154 155
}
</script>
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
<style lang='less'>
#repay-plan-agent {

  .total {
    position: relative;
    background-color: #1D3FFF;
    height: 138px;
    color: #fff;
    background-image: url(../../assets/contractInquire/background.png);
    background-size: cover;

    .sum {
    padding: 0 20px;
      div {
        font-family: PingFangSC-Semibold;
        font-size: 14px;
        padding-top: 12px;
        padding-bottom: 10px;
      }

      p {
        font-family: Verdana-BoldItalic;
        font-size: 20px;
        font-weight: 700;
        font-style: italic;
        margin-left: -4px;
      }

786817560's avatar
786817560 committed
184
      img {
185 186 187 188
        width: 75px;
        position: absolute;
        right: 20px;
        top: 25px;
786817560's avatar
786817560 committed
189
      }
190 191 192 193 194 195 196 197

      h3 {
        position: absolute;
        font-weight: 700;
        margin: 0;
        right: 42px;
        top: 32px;
        color: #1D3FFF;
786817560's avatar
786817560 committed
198
        font-family: PingFangSC-Semibold;
199 200 201 202 203 204
        font-size: 14px;

        span {
          font-style: italic;
          margin-right: 5px;
        }
786817560's avatar
786817560 committed
205
      }
786817560's avatar
786817560 committed
206
    }
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230

    .single {
      display: flex;
      margin-top: 28px;

      div {
        flex: auto;
        text-align: center;

        h4 {
          opacity: 0.8;
          margin: 0;
          font-family: PingFangSC-Regular;
          font-size: 12px;
          color: #FFFFFF;
          margin-bottom: 8px;
        }

        p {
          font-family: Verdana;
          font-size: 14px;
          color: #FFFFFF;
          font-weight: 700;
        }
786817560's avatar
786817560 committed
231
      }
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
    }

  }

  .plan-name {
    position: relative;
    background-color: #1D3FFF;
    margin-top: -2px;

    img {
      position: absolute;
      right: 30px;
      top: 12px;
      height: 20px;
      transition: 0s;
    }

    .rotate {
      transform: rotate(180deg);
    }

    .header {
      position: relative;
      height: 48px;
      line-height: 48px;
      background-color: #fff;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #21254C;
      font-weight: 700;
      text-indent: 2em;
      border-radius: 24px 0 0 0 ;

      &:before {
786817560's avatar
786817560 committed
266
        content: "";
267 268 269 270 271 272
        position: absolute;
        top: 16px;
        left: 15px;
        width: 4px;
        height: 16px;
        background: #1D3FFF;
786817560's avatar
786817560 committed
273
      }
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
    }
  }

  .plan-content {
    background-color: #fff;
    padding: 0px 11px;

    .plan-list {
      position:relative;
      background-color: #f7f7f7;
      height: 78px;
      display: flex;
      padding-right: 20px;
      padding-left: 10px;
      padding-top: 20px;
      margin-bottom: 10px;

786817560's avatar
786817560 committed
291
      .left {
292 293 294 295
        height: 30px;
        position: absolute;
        left: -8px;
        top: 24px;
786817560's avatar
786817560 committed
296
      }
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340

      .status {
        position: absolute;
        width:18px;
        right: -3px;
        top: -5px;
      }

      .period {
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(75,74,75,.5);
        border-radius: 4px 0 4px 0;
        // width: 30px;
        padding: 1px 2px;
        height: 20px;
        color: #fff;
        font-family: PingFangSC-Semibold;
        font-size: 12px;
        letter-spacing: 1.09px;
        line-height: 20px;
        text-align: center;
      }

      .orange {
        background: rgba(253, 182, 47,.5);
      }

      .blue {
        background-color: rgba(29, 63, 255,.5);
      }

      .green {
        background-color: rgba(27, 162, 97,.5);
      }

      .time {

        p {
          font-family: DIN-Regular;
          font-size: 12px;
          color: rgba(56,63,69,0.60);
          margin-bottom: 4px;
786817560's avatar
786817560 committed
341 342
          margin-top: 8px;
        }
343 344 345 346 347 348 349

        span {
          font-family: DIN-Bold;
          font-weight: 700;
          font-size: 14px;
          color: #21254C;
        }
786817560's avatar
786817560 committed
350
      }
351 352

      .name {
786817560's avatar
786817560 committed
353
        // flex: 9;
786817560's avatar
786817560 committed
354
        font-family: PingFangSC-Regular;
355 356
        font-size: 13px;
        color: #4B4A4B;
786817560's avatar
786817560 committed
357
        //padding-top: 20px;
786817560's avatar
786817560 committed
358 359 360 361 362 363
        margin-left: 22px;
        span:nth-of-type(2) {
          margin-left: 8px;
        }
        span:nth-of-type(1) {
          opacity: 0.6;
364
        }
786817560's avatar
786817560 committed
365
      }
366 367

      .number {
786817560's avatar
786817560 committed
368
        // flex: 9;
786817560's avatar
786817560 committed
369 370
        display: flex;
        flex-direction: column;
371 372 373
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: #4B4A4B;
786817560's avatar
786817560 committed
374 375 376 377
        margin-left: 20px;
        div:nth-of-type(2) {
          margin-top: 12px;
        }
786817560's avatar
786817560 committed
378 379
        span:nth-of-type(2) {
          margin-left: 8px;
380 381 382 383 384 385 386 387 388 389 390 391 392 393
        }
        span.orang {
          color: rgb(253, 182, 47);
          font-weight: 700;
          font-family: PingFangSC-Semibold;
        }
        span.blu {
          color: #1D3FFF;
          font-weight: 700;
          font-family: PingFangSC-Semibold;
        }
        span.gree {
          color: #1BA261;
        }
786817560's avatar
786817560 committed
394 395
      }
    }
396 397 398

    .or {
        background-color:rgba(253, 182, 47,.05);
786817560's avatar
786817560 committed
399
    }
400 401 402 403

    .bl,.gr {
      background: #FFFFFF;
      box-shadow: 0 1px 5px 0 rgba(219,219,219,0.69);
786817560's avatar
786817560 committed
404
    }
405

786817560's avatar
786817560 committed
406
  }
407

786817560's avatar
786817560 committed
408 409
}
</style>