contract-record.vue 14.1 KB
Newer Older
李晓兵's avatar
李晓兵 committed
1 2 3 4 5
<template>
  <h-view id="payment-contract-record" 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()" >
李晓兵's avatar
李晓兵 committed
6
        <span>租金还款明细</span>
李晓兵's avatar
李晓兵 committed
7 8
      </div>
    </h-header>
9
    <div style="margin-top:-1px;">
李晓兵's avatar
李晓兵 committed
10 11 12 13 14
      <div class="top-head">
        <div class="center">
          <div class="now-pay">
            <div class="title">当前应付</div>
            <div class="data">
linxin's avatar
linxin committed
15
              <!-- <span></span> -->
李晓兵's avatar
李晓兵 committed
16 17 18 19 20 21
              {{ sumMoney |currency }}
            </div>
          </div>
        </div>
      </div>
      <div class="search">
linxin's avatar
linxin committed
22
        <input v-model="keyWords" type="text" placeholder="请输入合同号/承租人名称" >
李晓兵's avatar
李晓兵 committed
23 24
        <img src="@/assets/payment/search.png" alt >
      </div>
linxin's avatar
linxin committed
25
      <section class="pay-content">
26
        <section v-for="(item,index) in showList" :key="index" class="contract-item">
李晓兵's avatar
李晓兵 committed
27 28 29 30 31
          <div class="header">
            <img src="@/assets/payment/file.png" alt >
            <p>&nbsp; {{ item.project_number }}</p>
            <span>还款中</span>
          </div>
32
          <div class="my-content">
李晓兵's avatar
李晓兵 committed
33 34 35 36 37 38 39
            <div v-for="(detail,index) in item.con_lists" :key="index" class="item">
              <div class="list">
                <div>
                  <span>承租人</span>
                  <span class="bp-name">{{ item.bp_name }}</span>
                </div>
                <div>
linxin's avatar
linxin committed
40 41
                  <span>车辆型号</span>
                  <span>{{ detail.vehicle_model }}</span>
李晓兵's avatar
李晓兵 committed
42 43 44 45
                </div>
              </div>
              <div class="list">
                <div>
linxin's avatar
linxin committed
46
                  <span>设备识别号</span>
李晓兵's avatar
李晓兵 committed
47 48 49 50
                  <span>{{ detail.product_code }}</span>
                </div>
                <div>
                  <span>应还金额</span>
linxin's avatar
linxin committed
51
                  <span class="orange">{{ detail.due_amount|currency }}</span>
李晓兵's avatar
李晓兵 committed
52 53 54 55 56
                </div>
              </div>
              <div class="list">
                <div>
                  <span>发动机号</span>
linxin's avatar
linxin committed
57
                  <span>{{ detail.engine }}</span>
李晓兵's avatar
李晓兵 committed
58 59 60 61
                </div>

                <div>
                  <span>已还金额</span>
linxin's avatar
linxin committed
62
                  <span class="blue">{{ detail.received_amount|currency }}</span>
李晓兵's avatar
李晓兵 committed
63 64 65 66
                </div>
              </div>
              <div class="list">
                <div>
linxin's avatar
linxin committed
67 68
                  <span>合格证编号</span>
                  <span>{{ detail.certificate_number }}</span>
李晓兵's avatar
李晓兵 committed
69 70 71 72
                </div>
                <div>
                  <span>本次还款</span>
                  <section>
linxin's avatar
linxin committed
73
                    <CurrencyInput v-model="detail.amount" placeholder="请输入还款金额" />
李晓兵's avatar
李晓兵 committed
74 75 76 77
                  </section>
                </div>
              </div>
            </div>
linxin's avatar
linxin committed
78 79 80
            <list-item :item-height="44">
              <item>
                <div slot="name">逾期利息</div>
linxin's avatar
linxin committed
81
                <span slot="content">{{ money|currency }}</span>
linxin's avatar
linxin committed
82 83
              </item>
            </list-item>
李晓兵's avatar
李晓兵 committed
84
          </div>
linxin's avatar
linxin committed
85

李晓兵's avatar
李晓兵 committed
86
        </section>
linxin's avatar
linxin committed
87 88
      </section>

89
      <div class="prompt has-footer">
李晓兵's avatar
李晓兵 committed
90 91 92 93 94 95 96 97 98 99
        <div>
          <img src="@/assets/payment/prompt.png" alt >
        </div>
        <div>
          <p>温馨提示</p>
          <p>推荐使用农行卡,农行卡支付免收手续费!</p>
          <p>由于存在款项到账时差性,“已还金额”字段可能XXX,给您造成的不便,请谅解,谢谢!</p>
        </div>
      </div>
      <bottom-tab>
100
        <tab-button class="footer" @click.native="checkPay()">提交订单</tab-button>
李晓兵's avatar
李晓兵 committed
101
      </bottom-tab>
102
    </div>
李晓兵's avatar
李晓兵 committed
103 104 105
  </h-view>
</template>
<script>
linxin's avatar
linxin committed
106
import CurrencyInput from '../../../components/currencyInput'
李晓兵's avatar
李晓兵 committed
107 108
export default {
  name: 'PaymentContractRecord',
linxin's avatar
linxin committed
109 110 111
  components: {
    CurrencyInput,
  },
李晓兵's avatar
李晓兵 committed
112 113
  beforeRouteEnter (to, from, next) {
    next(vm => {
114 115
      vm.pagenum = 1
      vm.searchPagenum = 1
李晓兵's avatar
李晓兵 committed
116 117 118
      vm.getRentInfo()
      vm.money = vm.$route.params.money
      vm.sumMoney = vm.money
linxin's avatar
linxin committed
119
      vm.keyWords = ''
120 121 122
      vm.info = []
      vm.showList = []
      vm.searchList = []
李晓兵's avatar
李晓兵 committed
123 124 125 126 127 128 129 130
    })
  },
  data () {
    return {
      sumMoney: '',
      money: '',
      reFund1: '',
      reFund2: '',
131 132 133
      keyWords: '',
      pagenum: 1,
      searchPagenum: 1,
李晓兵's avatar
李晓兵 committed
134
      info: [],
135 136
      showList: [],
      searchList: [],
李晓兵's avatar
李晓兵 committed
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
    }
  },
  computed: {},
  watch: {
    info: {
      handler (newName, oldName) {
        let vm = this
        let sumL = []
        vm.sumMoney = vm.money
        for (let i of this.info) {
          i.con_lists.forEach(j => {
            sumL.push(j.amount)
          })
          let a = 0
          let newSum = sumL.filter(item => {
            return item !== ''
          })
          let notNaN = newSum.filter(item => {
            return !isNaN(item)
          })
          if (notNaN.length !== 0) {
            notNaN.forEach(i => {
159 160 161 162 163 164 165
              if (!isNaN(parseFloat(i))) {
                a = a + parseFloat(i)
                if (vm.money !== '') {
                  vm.sumMoney = parseFloat(a + parseFloat(vm.money))
                } else {
                  vm.sumMoney = a
                }
李晓兵's avatar
李晓兵 committed
166 167 168 169 170 171 172 173 174 175 176 177 178
              }
            })
          } else {
            if (vm.money !== '') {
              vm.sumMoney = vm.money
            } else {
              vm.sumMoney = 0
            }
          }
        }
      },
      deep: true,
    },
179
    keyWords (newVal, oldVal) {
linxin's avatar
linxin committed
180
      this.getRentInfo()
181
    },
linxin's avatar
linxin committed
182 183 184 185
    'sumMoney': {
      handler (newVal, oulVal) {
        if (newVal === null || isNaN(newVal) || newVal === '') {
          this.sumMoney = 0
186
        }
linxin's avatar
linxin committed
187
      },
188
    },
linxin's avatar
linxin committed
189 190 191 192 193 194 195 196 197
  },
  methods: {
    checkPay () {
      let money = parseFloat(this.sumMoney)
      // let theDefault = parseFloat(this.defaultMoney)
      if (money > 0) {
        this.payDetail()
      } else if (money === 0) {
        hlsPopup.showLongCenter('当前支付金额为0元,无需支付!')
198
      }
linxin's avatar
linxin committed
199 200 201
      // else if (money > theDefault) {
      //   hlsPopup.showLongCenter('当前支付金额超出应还金额!')
      // }
202
    },
李晓兵's avatar
李晓兵 committed
203 204
    getRentInfo () {
      let vm = this
linxin's avatar
linxin committed
205 206 207 208 209 210
      let randomString = Math.floor(Math.random() * 21)
      let url =
        process.env.basePath +
        'payment_con_list_query' +
        '&index' +
        `'${randomString}'`
李晓兵's avatar
李晓兵 committed
211
      let param = {
linxin's avatar
linxin committed
212
        bp_id: window.localStorage.getItem('bp_id'),
linxin's avatar
linxin committed
213
        searchInput: vm.keyWords,
李晓兵's avatar
李晓兵 committed
214 215 216 217 218
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
linxin's avatar
linxin committed
219
          vm.info = res.prj_lists
linxin's avatar
linxin committed
220
          /* vm.info.forEach(i => {
linxin's avatar
linxin committed
221 222 223 224 225
            i.con_lists.forEach(j => {
              // let num = (parseFloat(j.due_amount) - parseFloat(j.received_amount))
              let num = ''
              vm.$set(j, 'amount', num)
            })
linxin's avatar
linxin committed
226
          }) */
227
          vm.showList = vm.info
李晓兵's avatar
李晓兵 committed
228 229 230 231 232 233 234 235 236
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    createData () {
      let pushList = []
      this.info.forEach(i => {
        i.con_lists.forEach(j => {
李晓兵's avatar
李晓兵 committed
237 238
          if (!j.amount || j.amount === 0) {

linxin's avatar
linxin committed
239
          } else {
李晓兵's avatar
李晓兵 committed
240 241 242 243 244 245
            let obj = {}
            obj.bp_id = window.localStorage.getItem('bp_id')
            obj.amount = j.amount
            obj.contract_id = j.contract_id
            pushList.push(obj)
          }
李晓兵's avatar
李晓兵 committed
246 247 248 249 250 251 252 253 254
        })
      })
      return pushList
    },
    payDetail () {
      let vm = this
      let url = process.env.basePath + 'create_detail_1_part'
      let payLists = vm.createData()
      let param = {
linxin's avatar
linxin committed
255
        order_id: window.localStorage.getItem('order_id'),
李晓兵's avatar
李晓兵 committed
256 257 258 259 260 261
        pay_lists: payLists,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
linxin's avatar
linxin committed
262
          vm.toPayEntry(res.order_id)
李晓兵's avatar
李晓兵 committed
263 264 265 266 267
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
linxin's avatar
linxin committed
268
    toPayEntry (e) {
李晓兵's avatar
李晓兵 committed
269 270 271 272 273
      this.$router.push({
        name: 'PaymentPayEntry',
        params: {
          sumMoney: this.sumMoney,
          money: this.money,
linxin's avatar
linxin committed
274
          order_id: e,
李晓兵's avatar
李晓兵 committed
275 276 277 278 279 280 281 282
        },
      })
    },
  },
}
</script>
<style lang='less' >
#payment-contract-record {
linxin's avatar
linxin committed
283 284 285 286 287 288
  .list{
    span{
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
李晓兵's avatar
李晓兵 committed
289 290 291 292 293 294 295 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
  .none {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .top-head {
    position: relative;
    width: 100%;
    height: 92px;
    background: url("../../../assets/payment/back1.png");
    background-size: 100% 142px;
  }
  .now-pay {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-flow: column wrap;
  }
  .title {
    font-family: PingFangSC-Regular;
    font-size: 14px;
    color: #ffffff;
    margin-top: 1.8%;
  }
  .data {
    font-family: Verdana-Bold;
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 0;
    line-height: 18px;
    margin-top: 16px;
  }
  .search {
    width: 351px;
    margin: 0 auto;
    height: 44px;
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border-radius: 0.08rem;
linxin's avatar
linxin committed
333
    box-shadow: 0 0 10px #ccc;
李晓兵's avatar
李晓兵 committed
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
    top: -23px;
    img {
      //position: absolute;
      width: 16px;
      height: 16px;
     // bottom: 28px;
    //  right: 31px;
     // top: 83px;
     // z-index: 999;
    }
    input {
      //position: absolute;
      //top: 69px;
     // width: 351px;
      width: 84%;
      height: 94%;
     // height: 44px;
     // border-radius: 4px;
      padding-left: 12px;
     // box-shadow: 0 1px 3px 2px rgba(168, 168, 168, 0.14);
    }

    input::placeholder {
      opacity: 0.4;
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #b4b4b5;
    }
  }
  .pay-content {
364
    width: 95%;
李晓兵's avatar
李晓兵 committed
365 366
    position: absolute;
    bottom: 150px;
linxin's avatar
linxin committed
367 368
    left:0;
    right:0;
369
    margin:auto;
linxin's avatar
linxin committed
370
    height: 53%;
李晓兵's avatar
李晓兵 committed
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
    overflow: scroll;
    .contract-item {
      background-color: #fff;
      box-shadow: 0 1px 3px 2px rgba(168, 168, 168, 0.14);
      border-radius: 2px;
      width: 359px;
      margin: 0 auto;
      .header {
        height: 34px;
        background: #fff;
        display: flex;
        align-items: center;
        line-height: 37px;
        padding: 0 16px;
        img {
          height: 30px;
        }

        p {
          flex: 2;
          font-family: PingFangSC-Semibold;
          font-size: 15px;
          color: #383f45;
          letter-spacing: 0;
          font-weight: 700;
        }
        span {
          display: inline-block;
          width: 57px;
          height: 21px;
          text-align: center;
          line-height: 21px;
          border: 1px solid #1d3fff;
          border-radius: 2px;
          font-family: PingFangSC-Regular;
          font-size: 14px;
          color: #3957ff;
          letter-spacing: 0;
        }
      }
411
      .my-content {
李晓兵's avatar
李晓兵 committed
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
        margin-bottom: 8px;
        .item {
          padding: 4px 0;
          background-color: #fff;
          margin-bottom: 4px;
          .list {
            margin-bottom: 0;
            display: flex;
            .bp-name {
              width: 75px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
            }
            div {
              flex: 1;
              display: flex;
              height: 28px;
              line-height: 29px;
              margin-left: -0px;
              section {
                flex: 1;
              }
              input {
linxin's avatar
linxin committed
436
                text-align: left;
李晓兵's avatar
李晓兵 committed
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
                width: 96px;
                height: 28px;
                border-bottom: 1px solid #00469c;
                border-radius: 2px;
                font-family: PingFangSC-Regular;
                font-size: 12px;
              }

              input::placeholder {
                color: #b4b4b5;
              }

              &:first-child {
                flex: 2;
              }

              &:last-child {
                flex: 3;
                margin-left: -40px;
              }

              span:last-child {
                flex: 1;
                font-family: PingFangSC-Regular;
                font-size: 13px;
                color: #383f45;
              }

              span.orange {
                font-family: DIN-Bold;
                font-size: 13px;
                color: #1d3fff;
                font-weight: 700;
              }

              span.blue {
                font-family: DIN-Bold;
                font-size: 13px;
                font-weight: 700;
                color: #383f45;
              }

              span:first-child {
                flex: 1;
                text-align: right;
                margin-right: 10px;
                font-family: PingFangSC-Regular;
                font-size: 13px;
                color: rgba(56, 63, 69, 0.6);
              }
            }
          }
        }
      }
    }
  }
linxin's avatar
linxin committed
493 494 495 496 497 498
// .rate{
//    position: absolute;
//     width: 100%;
//     bottom: 134px;
//     box-shadow: -2px -2px 10px #ccc;
// }
李晓兵's avatar
李晓兵 committed
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544
  .prompt {
    position: absolute;
    width: 100%;
    bottom: 40px;
    background: rgba(142, 195, 30, 0.1);
    height: 111px;
    display: flex;
    div:first-child {
      flex: 1;
      padding: 16px 0 0 16px;

      img {
        width: 16px;
        height: 16px;
      }
    }

    div:last-child {
      flex: 12;

      p:first-child {
        padding-top: 16px;
        font-family: PingFangSC-Semibold;
        font-size: 14px;
        color: #8ec31e;
        letter-spacing: 0.5px;
        margin-bottom: 7px;
      }

      p:nth-child(n + 2) {
        text-indent: 2em;
        padding-right: 16px;
        line-height: 20px;
        font-family: PingFangSC-Regular;
        font-size: 12px;
        color: rgba(101, 100, 100, 0.8);
        letter-spacing: 0.37px;
        margin-left: -22px;
      }
    }
  }

  .footer {
    background: @headerColor;
    color: white;
  }
545 546 547
  .hls-list-item{

  }
李晓兵's avatar
李晓兵 committed
548
}
linxin's avatar
linxin committed
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
  .platform-ios {
    #payment-contract-record {
      .pay-content {
        height: 63%;
      }
    }
  }
}
// iPhoneXR适配
@media (device-width: 414px) and (device-height: 896px) {
  .platform-ios {
    #payment-contract-record {
      .pay-content {
        height: 63%;
      }
    }
  }
}
李晓兵's avatar
李晓兵 committed
568
</style>