loanBill.vue
3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
<div class="bill_wrap">
<el-tabs v-model="state.activeName" @tab-click="getBill" class="con_bill">
<el-tab-pane label="待还账单" class="bill_dh" name="noFinish">
<el-empty v-if="state.billList && state.billList.length == 0" description="暂无数据" />
<div v-else class="back_wrap" v-for="item in state.billList">
<div class="back_title">
<div class="borrow_date">借款日期:{{item.createTime && item.createTime.substring(0, 10)}}</div>
<!--<div :class="item.borrowStatus == '0' ? 'borrow_status' : 'borrow_status later'">{{item.borrowStatus == '0' ? '待还款':'已逾期'}}</div>-->
<div class="borrow_status">{{item.loanStatus}}</div>
</div>
<div class="back_con">借款金额:{{item.capitalAmount}}</div>
<div class="back_con">账单编号:{{item.statementCode}}</div>
<div class="back_con">产品名称:{{item.productName}}</div>
<div class="detail_btn" @click="linkTo('/billDetail/'+item.id)">详情</div>
</div>
</el-tab-pane>
<el-tab-pane label="历史账单" class="bill_dh" name="finish">
<el-empty v-if="state.noBillList && state.noBillList.length == 0" description="暂无数据" />
<div v-else class="back_wrap" v-for="item in state.noBillList">
<div class="back_title">
<div class="borrow_date">借款日期:{{item.createTime && item.createTime.substring(0, 10)}}</div>
<div class="borrow_status finish">已还款</div>
</div>
<div class="back_con">借款金额:{{item.capitalAmount}}</div>
<div class="back_con">账单编号:{{item.statementCode}}</div>
<div class="back_con">产品名称:{{item.productName}}</div>
<div class="detail_btn" @click="linkTo('/billDetail/'+item.id)">详情</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
import getImage from './../../assets/getImage'
import './../../assets/css/loanBill.scss'
import router from "../../router/index";
import * as api from "./../../interface/api"
import { loginMain } from './../../store/index'
import { storeToRefs } from 'pinia';
let loginAct = loginMain()
let { getActiveName } = storeToRefs(loginAct)
let getBill = (tab: TabsPaneContext) => {
loginAct.setActiveName(tab.paneName)
}
let state = reactive({
activeName: getActiveName,
billList : [],
noBillList : [],
})
let linkTo = (url: string) => {
router.push(url)
}
api.getWaitStatementList().then(res=> {
state.billList = res.data
})
api.getHistoryStatementList().then(res=> {
state.noBillList = res.data
})
const arrowPath = ref("/mine")
defineExpose({arrowPath})
</script>
<style scoped lang="scss">
</style>