financ-details.vue 7.05 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-22 13:38:33
786817560's avatar
786817560 committed
6 7 8
 * @LastEditors: Please set LastEditors
 -->
<template>
786817560's avatar
786817560 committed
9 10 11
  <h-view id="refund" class="public-style" title="还款计划">
    <div class="top">
      <h-header :proportion="[5,1,1]" class="header">
李晓兵's avatar
李晓兵 committed
12
        <div slot="left" class="h-header-btn" @click="goBase">
786817560's avatar
786817560 committed
13 14
          <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
        <div class="top-detail">
          <div class="left">
            <span class="line">保证金</span>
李晓兵's avatar
李晓兵 committed
23
            <span>{{ info.deposit * product_num |NumFormat }}</span>
786817560's avatar
786817560 committed
24 25 26
          </div>
          <div class="right">
            <span class="line">首付款</span>
李晓兵's avatar
李晓兵 committed
27
            <span>{{ info.down_payment * product_num |NumFormat }}</span>
786817560's avatar
786817560 committed
28 29 30 31 32 33
          </div>
        </div>
        <div class="clear" />
        <div class="top-detail">
          <div class="left">
            <span class="line">手续费</span>
李晓兵's avatar
李晓兵 committed
34
            <span>{{ info.lease_charge * product_num |NumFormat }}</span>
786817560's avatar
786817560 committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
          </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
          <td>租金</td>
李晓兵's avatar
李晓兵 committed
55
          <td>{{ item.rental * product_num |NumFormat }}</td>
786817560's avatar
786817560 committed
56 57 58 59 60
        </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
  filters: {
linxin's avatar
linxin committed
65 66
    NumFormat: function (valueOrig) {
      var value = parseFloat(valueOrig).toFixed(2)
786817560's avatar
786817560 committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
      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
86 87
  data () {
    return {
李晓兵's avatar
李晓兵 committed
88
      confirm_status: this.$route.params.confirm_status,
李晓兵's avatar
李晓兵 committed
89
      product_num: this.$route.params.product_num,
786817560's avatar
786817560 committed
90 91 92 93 94 95 96 97
      info: {
        finance_amount: '',
        lease_charge: '',
        down_payment: '',
        lease_times: '',
        deposit: '',
      },
      lists: [],
786817560's avatar
786817560 committed
98 99
    }
  },
786817560's avatar
786817560 committed
100 101 102 103 104 105 106 107
  created () {
    this.getInfo()
  },
  methods: {
    getInfo () {
      let vm = this
      let url = process.env.basePath + 'prj_cashflow_query'
      let param = {
108
        project_id: window.sessionStorage.getItem('project_id'),
786817560's avatar
786817560 committed
109 110 111 112 113 114 115 116 117 118
      }
      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
119 120 121 122 123
    // goTrial () {
    //   this.$router.push({
    //     name: 'FinancingTrial',
    //   })
    // },
124 125 126
    dateConverse (date) {
      return date.replace(/\//g, '-')
    },
李晓兵's avatar
李晓兵 committed
127 128 129 130 131 132 133
    goBase () {
      let confirmStatus
      if (this.confirm_status !== 'APPROVED') {
        confirmStatus = true
      } else {
        confirmStatus = false
      }
李晓兵's avatar
李晓兵 committed
134
      window.localStorage.setItem('hasButtom', confirmStatus)
李晓兵's avatar
李晓兵 committed
135 136 137 138 139
      this.$router.replace({
        name: 'ContractDetails',
        params: {
          isConfirm: true,
          hasButtom: confirmStatus,
786817560's avatar
786817560 committed
140
          confirm_status: this.confirm_status,
李晓兵's avatar
李晓兵 committed
141 142 143 144
        },
      })
      this.$router.go(-1)
    },
786817560's avatar
786817560 committed
145
  },
786817560's avatar
786817560 committed
146 147
}
</script>
786817560's avatar
786817560 committed
148 149 150 151 152 153 154 155
<style lang="less" scoped>
#refund {
  .clear {
    clear: both;
  }
  .header {
    background-color: rgba(0, 0, 0, 0);
    .h-header-btn {
786817560's avatar
786817560 committed
156 157 158 159 160 161
      img {
        width: 16px;
        height: 16px;
      }
      span {
        margin-left: 16px;
786817560's avatar
786817560 committed
162
        font-family: PingFangSC-Semibold;
786817560's avatar
786817560 committed
163
        font-size: 17px;
786817560's avatar
786817560 committed
164
        color: #ffffff;
786817560's avatar
786817560 committed
165 166
        letter-spacing: 0.61px;
      }
786817560's avatar
786817560 committed
167 168 169 170
    }
  }
  .top {
    width: 100%;
786817560's avatar
786817560 committed
171
    height: 260px;
786817560's avatar
786817560 committed
172 173 174 175 176 177 178 179 180 181
    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
182
        margin-right: 40px;
786817560's avatar
786817560 committed
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 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
      }
      .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
280 281
}
</style>