financ-details.vue 6.37 KB
Newer Older
786817560's avatar
786817560 committed
1
<!--
786817560's avatar
786817560 committed
2
 * @Description: In User Settings Edit
786817560's avatar
786817560 committed
3
 * @Author: your name
786817560's avatar
786817560 committed
4
 * @Date: 2019-09-27 18:07:12
786817560's avatar
786817560 committed
5
 * @LastEditTime: 2019-10-10 11:55:05
786817560's avatar
786817560 committed
6 7 8
 * @LastEditors: Please set LastEditors
 -->
<template>
786817560's avatar
786817560 committed
9 10 11 12 13 14
  <h-view id="refund" class="public-style" title="还款计划">
    <div class="top">
      <h-header :proportion="[5,1,1]" class="header">
        <div slot="left" class="h-header-btn" @click="$routeGo()">
          <img src="@/assets/intoApproval/arrow.png" >
          <span>还款计划</span>
786817560's avatar
786817560 committed
15 16
        </div>
      </h-header>
786817560's avatar
786817560 committed
17
      <div class="top-content">
linxin's avatar
linxin committed
18 19
        <span class="top-tittle">总租金</span>
        <span class="num">{{ info.total_rental_sum|NumFormat }}</span>
786817560's avatar
786817560 committed
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
        <div class="top-detail">
          <div class="left">
            <span class="line">保证金</span>
            <span>{{ info.deposit|NumFormat }}</span>
          </div>
          <div class="right">
            <span class="line">首付款</span>
            <span>{{ info.down_payment|NumFormat }}</span>
          </div>
        </div>
        <div class="clear" />
        <div class="top-detail">
          <div class="left">
            <span class="line">手续费</span>
            <span>{{ info.lease_charge|NumFormat }}</span>
          </div>
          <div class="right">
            <span class="line">合同期数</span>
            <span>{{ info.lease_times }}</span>
          </div>
        </div>
      </div>
    </div>
    <h-content>
      <table>
        <tr>
          <th />
          <th class="table-top">日期</th>
          <th class="table-top">现金流项目</th>
          <th class="table-top">应还金额</th>
        </tr>
786817560's avatar
786817560 committed
51
        <tr v-for="(item,index) in lists" :key="index">
786817560's avatar
786817560 committed
52
          <td>{{ index+1 }}</td>
53
          <td>{{ dateConverse(item.due_date) }}</td>
786817560's avatar
786817560 committed
54 55 56 57 58 59 60
          <td>租金</td>
          <td>{{ item.rental|NumFormat }}</td>
        </tr>
      </table>
    </h-content>
  </h-view>
</template>
786817560's avatar
786817560 committed
61 62 63
<script>
export default {
  name: 'FinancDetails',
786817560's avatar
786817560 committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
  filters: {
    NumFormat: function (value) {
      if (!value) return '0.00'
      var intPart = Number(value) | 0 // 获取整数部分
      var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
      var floatPart = '.00' // 预定义小数部分
      var value2Array = value.split('.')
      // =2表示数据有小数位
      if (value2Array.length === 2) {
        floatPart = value2Array[1].toString() // 拿到小数部分

        if (floatPart.length === 1) { // 补0,实际上用不着
          return intPartFormat + '.' + floatPart + '0'
        } else {
          return intPartFormat + '.' + floatPart
        }
      } else {
        return intPartFormat + floatPart
      }
    },
  },
786817560's avatar
786817560 committed
85 86
  data () {
    return {
786817560's avatar
786817560 committed
87 88 89 90 91 92 93 94
      info: {
        finance_amount: '',
        lease_charge: '',
        down_payment: '',
        lease_times: '',
        deposit: '',
      },
      lists: [],
786817560's avatar
786817560 committed
95 96
    }
  },
786817560's avatar
786817560 committed
97 98 99 100 101 102 103 104
  created () {
    this.getInfo()
  },
  methods: {
    getInfo () {
      let vm = this
      let url = process.env.basePath + 'prj_cashflow_query'
      let param = {
105
        project_id: window.sessionStorage.getItem('project_id'),
786817560's avatar
786817560 committed
106 107 108 109 110 111 112 113 114 115
      }
      vm.hlsHttp.post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          console.log(res)
          vm.lists = res.lists
          Object.assign(vm.info, res.info)
        }
      })
    },
786817560's avatar
786817560 committed
116 117 118 119 120
    // goTrial () {
    //   this.$router.push({
    //     name: 'FinancingTrial',
    //   })
    // },
121 122 123
    dateConverse (date) {
      return date.replace(/\//g, '-')
    },
786817560's avatar
786817560 committed
124
  },
786817560's avatar
786817560 committed
125 126
}
</script>
786817560's avatar
786817560 committed
127 128 129 130 131 132 133 134
<style lang="less" scoped>
#refund {
  .clear {
    clear: both;
  }
  .header {
    background-color: rgba(0, 0, 0, 0);
    .h-header-btn {
786817560's avatar
786817560 committed
135 136 137 138 139 140
      img {
        width: 16px;
        height: 16px;
      }
      span {
        margin-left: 16px;
786817560's avatar
786817560 committed
141
        font-family: PingFangSC-Semibold;
786817560's avatar
786817560 committed
142
        font-size: 17px;
786817560's avatar
786817560 committed
143
        color: #ffffff;
786817560's avatar
786817560 committed
144 145
        letter-spacing: 0.61px;
      }
786817560's avatar
786817560 committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
    }
  }
  .top {
    width: 100%;
    height: 250px;
    background: url("../../assets/intoApproval/backtop.png") no-repeat;
    background-size: 100% 285px;
    .top-detail {
      margin-top: 12px;
      width: 260px;
      .line {
        font-family: PingFangSC-Regular;
        font-size: 12px;
        height: 12px;
        color: rgba(255, 255, 255, 0.6);
786817560's avatar
786817560 committed
161
        margin-right: 40px;
786817560's avatar
786817560 committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 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 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
      }
      .line::before {
        content: "";
        display:inline-block;
        width:2px;
        height:12px;
        background-color: #ffffff;
        position: relative;
        left: -5px;
        top:2px;
      }
      .left {
        float: left;
        span:last-child {
          display: block;
          font-family: PingFangSC-Semibold;
          font-size: 16px;
          color: #ffffff;
          letter-spacing: 0;
          margin-top: 8px;
        }
      }
      .right {
        float: right;
        span:last-child {
          display: block;
          font-family: PingFangSC-Semibold;
          font-size: 16px;
          color: #ffffff;
          letter-spacing: 0;
          margin-top: 8px;
        }
      }
    }
    .top-content {
      width: 300px;
      margin: 0 auto;
      .top-tittle {
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.6);
        letter-spacing: 0;
      }
      .num {
        display: block;
        font-family: PingFangSC-Semibold;
        font-size: 32px;
        color: #ffffff;
        line-height: 44px;
        height: 44px;
        margin-bottom: 24px;
        margin-top: 8px;
      }
    }
  }
  table {
    width: 100%;
    text-align: center;
    .table-top {
      font-weight: bold
    }
    th {
      height: 40px;
      line-height: 40px;
      border-bottom: 1px solid #d9dbdf;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #383f45;
      letter-spacing: 0;
    }
    th:first-child {
      width: 15%;
    }
    td:first-child {
      font-family: PingFangSC-Semibold;
      font-size: 20px;
      color: #326aaf;
    }
    td:not(:first-child) {
      border-bottom: 1px solid #d9dbdf;
    }
    td:last-child {
      font-family: PingFangSC-Semibold;
      font-size: 17px;
      color: #336bb0;
      letter-spacing: 0;
    }
    td {
      height: 40px;
      line-height: 40px;
      text-align: center;
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #383f45;
      letter-spacing: 0;
    }
  }
786817560's avatar
786817560 committed
259 260
}
</style>