contract-record.vue 11.8 KB
Newer Older
24776's avatar
24776 committed
1 2 3 4
<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">
linxin's avatar
linxin committed
5
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()">
24776's avatar
24776 committed
6 7 8 9 10 11
        <span>合同记录</span>
      </div>
    </h-header>
    <div class="center">
      <div class="now-pay">
        <div>当前应付</div>
linxin's avatar
linxin committed
12
        <div><span></span>{{ sumMoney |currency }}</div>
24776's avatar
24776 committed
13 14
      </div>
    </div>
linxin's avatar
linxin committed
15
    <h-content class="pay-content">
24776's avatar
24776 committed
16 17 18 19
      <div class="search">
        <img src="@/assets/payment/search.png" alt="">
        <input type="text" placeholder="请输入合同号/车架号/承租人名称">
      </div>
linxin's avatar
linxin committed
20
      <section v-for="(item,index) in info" :key="index" class="contract-item">
24776's avatar
24776 committed
21 22
        <div class="header">
          <img src="@/assets/payment/contract.png" alt="">
linxin's avatar
linxin committed
23 24
          <p>合同号  &nbsp; {{ item.project_number }}</p>
          <span>{{ item.bp_name }}</span>
24776's avatar
24776 committed
25 26
        </div>
        <div class="content">
linxin's avatar
linxin committed
27
          <div v-for="(detail,index) in item.con_lists" :key="index" class="item">
24776's avatar
24776 committed
28
            <div class="list">
linxin's avatar
linxin committed
29
              <div><span>参数项</span> <span>{{ detail.product_code }}</span> </div>
24776's avatar
24776 committed
30 31 32
              <div class="ing"><p>还款中</p></div>
            </div>
            <div class="list">
linxin's avatar
linxin committed
33 34
              <div> <span>发动机号</span> <span>{{ detail.lease_item_engine_num }}</span> </div>
              <div> <span>应还金额</span> <span class="orange">{{ detail.due_amount|currency }}</span> </div>
24776's avatar
24776 committed
35 36
            </div>
            <div class="list">
linxin's avatar
linxin committed
37 38
              <div><span>厂商型号</span> <span>{{ detail.lease_item_factory_num }}</span> </div>
              <div><span>已还金额</span> <span class="blue">{{ detail.received_amount|currency }}</span> </div>
24776's avatar
24776 committed
39 40
            </div>
            <div class="list">
linxin's avatar
linxin committed
41
              <div><span>车牌号</span> <span>{{ detail.lease_item_car_num }}</span> </div>
linxin's avatar
linxin committed
42
              <div><span>本次还款</span><section><input v-model="detail.amount" type="text" placeholder="请输入还款金额"></section></div>
24776's avatar
24776 committed
43 44 45 46
            </div>
          </div>
        </div>
      </section>
linxin's avatar
linxin committed
47 48 49
      <list-item :item-height="44">
        <item>
          <div slot="name">应还违约金</div>
linxin's avatar
linxin committed
50
          <span slot="content">{{ money|currency }}</span>
linxin's avatar
linxin committed
51
        </item>
linxin's avatar
linxin committed
52
    </list-item></h-content>
linxin's avatar
linxin committed
53
    <div class="prompt">
linxin's avatar
linxin committed
54 55 56 57 58
      <div><img src="@/assets/payment/prompt.png" alt=""></div>
      <div>
        <p>温馨提示</p>
        <p> 推荐使用农行卡,农行卡支付免收手续费!</p>
        <p>由于存在款项到账时差性,“已还金额”字段可能XXX,给您造成的不便,请谅解,谢谢!</p>
24776's avatar
24776 committed
59
      </div>
linxin's avatar
linxin committed
60
    </div>
linxin's avatar
linxin committed
61
    <bottom-tab>
linxin's avatar
linxin committed
62
      <tab-button class="footer" @click.native="payDetail()">
24776's avatar
24776 committed
63 64 65 66 67 68 69 70 71 72 73
&nbsp;&nbsp;
      </tab-button>
    </bottom-tab>
  </h-view>
</template>
<script>

export default {
  name: 'PaymentContractRecord',
  components: {
  },
linxin's avatar
linxin committed
74 75
  beforeRouteEnter (to, from, next) {
    next(vm => {
76
      vm.getRentInfo()
linxin's avatar
linxin committed
77 78 79 80
      vm.money = vm.$route.params.money
      vm.sumMoney = vm.money
    })
  },
24776's avatar
24776 committed
81 82
  data () {
    return {
linxin's avatar
linxin committed
83
      sumMoney: '',
24776's avatar
24776 committed
84
      money: '',
linxin's avatar
linxin committed
85 86
      reFund1: '',
      reFund2: '',
linxin's avatar
linxin committed
87
      info: [],
24776's avatar
24776 committed
88 89 90
    }
  },
  computed: {},
linxin's avatar
linxin committed
91 92 93 94 95 96 97 98
  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 => {
linxin's avatar
linxin committed
99
            sumL.push(j.amount)
linxin's avatar
linxin committed
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
          })
          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 => {
              a = a + parseFloat(i)
              if (vm.money !== '') {
                vm.sumMoney = parseFloat(a + parseFloat(vm.money))
              } else {
                vm.sumMoney = a
              }
            })
          } else {
            if (vm.money !== '') {
              vm.sumMoney = vm.money
            } else {
              vm.sumMoney = 0
            }
          }
        }
      },
      deep: true,
    },

  },
24776's avatar
24776 committed
130 131 132
  activated () {
  },
  methods: {
linxin's avatar
linxin committed
133 134 135 136
    getRentInfo () {
      let vm = this
      let url = process.env.basePath + 'payment_con_list_query'
      let param = {
linxin's avatar
linxin committed
137
        bp_id: window.sessionStorage.getItem('bp_id'),
linxin's avatar
linxin committed
138 139 140 141 142 143 144 145 146
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.info = res.prj_lists
        } else {
          hlsPopup.showLongCenter(res.message)
        }
linxin's avatar
linxin committed
147 148 149 150 151 152
      })
    },
    createData () {
      let pushList = []
      this.info.forEach(i => {
        i.con_lists.forEach(j => {
linxin's avatar
linxin committed
153
          let obj = {}
linxin's avatar
linxin committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
          obj.bp_id = window.sessionStorage.getItem('bp_id')
          obj.amount = j.amount
          obj.contract_id = j.contract_id
          pushList.push(obj)
        })
      })
      return pushList
    },
    payDetail () {
      let vm = this
      let url = process.env.basePath + 'create_detail_1_part'
      let payLists = vm.createData()
      let param = {
        order_id: window.sessionStorage.getItem('order_id'),
        pay_lists: payLists,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.toPayEntry(vm.sumMoney)
        } else {
          hlsPopup.showLongCenter(res.message)
        }
linxin's avatar
linxin committed
178 179
      })
    },
24776's avatar
24776 committed
180 181 182 183
    toPayEntry (money) {
      this.$router.push({
        name: 'PaymentPayEntry',
        params: {
linxin's avatar
linxin committed
184 185
          sumMoney: this.sumMoney,
          money: this.money,
24776's avatar
24776 committed
186 187 188 189 190 191 192 193
        },
      })
    },
  },
}
</script>
<style lang='less' >
#payment-contract-record {
linxin's avatar
linxin committed
194 195 196 197 198
    .none{
    display:flex;
    justify-content: center;
    align-items: center;
  }
24776's avatar
24776 committed
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 280 281 282 283 284 285 286 287 288 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 333 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 364 365 366 367 368 369 370 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 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 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
  .h-header {
    background-color: #00469C;
    .h-header-btn {
      img {
        width: 16px;
        height: 16px;
        margin-left: 4px;
      }

      span {
        font-family: PingFangSC-Semibold;
        margin-left: 16px;
        font-size: 17px;
        letter-spacing: 0.61px;
        line-height: 24px;
      }
    }
  }

  .center {
    position: relative;
    height: 50px;
    background-color: #00469C;

    .now-pay {
      background: url('../../../assets/payment/background.png');
      background-size: 365px;
      background-position: -5px;
      position: absolute;
      left: 10px;
      z-index: 2;
      text-align: center;
      width: 355px;
      height: 89px;
      border-radius: 4px;
      box-shadow: 0 1px 3px 2px rgba(168,168,168,0.14);

      :first-child {
        font-family: PingFangSC-Regular;
        font-size: 14px;
        color: #383F45;
        height: 35px;
        line-height: 42px;
      }

      :last-child {
        font-family: DIN-Bold;
        font-size: 24px;
        color: #FF8300;
        font-weight: 700;

        span {
          font-size: 16px;
          margin-right: 5px;
        }
      }
    }
  }

  .pay-content {
    .search {
      position: relative;
      height: 108px;
      background-color: #fff;
      padding-top: 53px;
      text-align: center;

      img {
          position: absolute;
          width: 16px;
          bottom: 28px;
          right: 25px;
      }

      input {
        width: 351px;
        height: 36px;
        border: 1px solid rgba(56,63,69,0.60);
        border-radius: 4px;
        padding-left: 12px;
      }

      input::placeholder {
        opacity: 0.4;
        font-family: PingFangSC-Regular;
        font-size: 14px;
        color: #B4B4B5;
      }
    }

    .contract-item {
      background-color: #fff;
      .header {
        height: 34px;
        background: rgba(0,70,156,.1);
        display: flex;
        font-family: PingFangSC-Semibold;
        font-size: 14px;
        color: #00469C;
        line-height: 37px;
        padding: 0 16px;

        img {
          height: 18px;
          margin-top: 10px;
          margin-right: 6px;
        }

        p {
          flex:2;
          font-weight: 700;
        }

        span {
          font-weight: 700;
        }
      }

      .content {
        margin-bottom: 8px;

        .item {
          padding: 4px 0;
          background-color: #fff;
          margin-bottom: 4px;

          .list {
            margin-bottom: 0;
            display: flex;

            .ing {
              position: relative;

              p {
                position: absolute;
                top: 5px;
                right: 22px;
                width: 48px;
                height: 18px;
                background: #FF8300;
                border-radius: 2px;
                font-family: PingFangSC-Semibold;
                font-size: 12px;
                color: #FFFFFF;
                text-align: center;
                line-height: 18px;
              }
            }

            div {
              flex:1;
              display: flex;
              height: 28px;
              line-height: 29px;
              margin-left: -0px;

              section{
                flex:1;
              }

              input {
                text-align: center;
                width: 96px;
                height: 28px;
                border: 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: #FF8300;
                font-weight: 700;
              }

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

              span:first-child {
                flex:1;
                text-align: right;
                margin-right: 10px;
                font-family: PingFangSC-Regular;
                font-size: 13px;
                color: rgba(56,63,69,0.60);
              }
            }
          }
        }
      }
    }

  }

  .prompt {
    background: rgba(142,195,30,0.10);
    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.80);
        letter-spacing: 0.37px;
        margin-left: -22px;
      }
    }
  }

  .bottom-tab-button{
    background: #00469C;
    border-radius: 4px;
    color:white;
    height: 40px;
    margin: 4px 2% 0 2%;
  }
}
</style>