Commit f83c6cc9 authored by WangRui's avatar WangRui

[feature]还款计划页面接口联调

parent ffd616e4
import { get, put, post, File, deleteReq } from '@/utils/http' import { get, put, post, File, deleteReq } from '@/utils/http'
const baseURL = import.meta.env.VITE_HTTP_BASE_URL const baseURL = import.meta.env.DEV ? '/api' : import.meta.env.VITE_HTTP_BASE_URL
const api = { const api = {
// getMakingList (data) { // 查询合同制作列表 // 首页查询
// return get( getRepayPlantList(data = {}) {
// `${baseURL}/hlct/v1/0/contracts/toMake`, return post(`${baseURL}/app/api/app/repayment/details`, data)
// {...data} },
// ) // 明细查询
// }, getRepayPlanDetail(data ={}){
return post(`${baseURL}/app/api/app/project/repayment/details`, data)
},
//还款计划明细
getRepaymentDetails(data={}){
return post(`${baseURL}/app/api/app/project/repayment/details`, data)
}
}; };
export default api; export default api;
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<Notice detail="只可对已关联的项目还款" /> <Notice detail="只可对已关联的项目还款" />
<PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll"> <PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll">
<List :finished="finished" finished-text="没有更多了" @load="loadApproval"> <List :finished="finished" finished-text="没有更多了">
<ListItem v-for="item in listValue" :other_title="item.other_title" :title="item.title" :values="item.values" <ListItem v-for="item in listValue" :other_title="item.other_title" :title="item.title" :values="item.values"
@click="jump" /> @click="jump" />
</List> </List>
...@@ -27,7 +27,7 @@ import { useRouter } from "vue-router"; ...@@ -27,7 +27,7 @@ import { useRouter } from "vue-router";
const searchVal = $ref(''); const searchVal = $ref('');
const listValue = $ref([ let listValue = $ref([
{ {
title: '202204-DB001-001', title: '202204-DB001-001',
other_title: "2022-07-18", other_title: "2022-07-18",
...@@ -40,12 +40,26 @@ const listValue = $ref([ ...@@ -40,12 +40,26 @@ const listValue = $ref([
}, },
]) ])
const refreshing = $ref(true); let refreshing = $ref(true);
const finished = $ref(true); const finished = $ref(true);
const onRefresh = () => { const getList = async () => {
// 下拉重置参数,重新加载 // 下拉重置参数,重新加载
let list = await api.getRepayPlantList({userId: window.localStorage.getItem('userId')});
if(list.result === 'SUCCESS'){
list = list.data.map(item => ({
...item,
title: item.contractNumber,
other_title: item.applyDate?.split(' ')[0],
values: [["剩余应还金额", "状态", "融资金额"], [item.residueAmount, item.contractStatusN, item.financeAmount]]
}))
}else {
list = [];
}
listValue = list;
refreshing = false;
}; };
// getList();
const loadApproval = () => { const loadApproval = () => {
......
...@@ -3,24 +3,24 @@ ...@@ -3,24 +3,24 @@
<template #list> <template #list>
<div class="repay_list"> <div class="repay_list">
<div class="left"> <div class="left">
<div class="times-box" v-for="i in 30"> <div class="times-box" v-for="i in currencyObj.times">
<div class="times">{{ i }}</div> <div class="times">{{ i }}</div>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<div class="item" v-for="i in 30"> <div class="item" v-for="item in cashflow">
<div class="left-item"> <div class="left-item">
<span>租金</span> <span>租金</span>
<span>2022-06-20</span> <span>{{item.chargeDueDate}}</span>
</div> </div>
<div class="center-item"> <div class="center-item">
<p> <p>
<span>应付金额</span> <span>应付金额</span>
<span>¥9,000.00</span> <span>{{item.dueAmount}}</span>
</p> </p>
<p> <p>
<span>待付金额</span> <span>待付金额</span>
<span>¥0.00</span> <span>{{item.obligation}}</span>
</p> </p>
</div> </div>
<div class="right-item"> <div class="right-item">
...@@ -50,14 +50,16 @@ import Pay from '../components/Pay.vue' ...@@ -50,14 +50,16 @@ import Pay from '../components/Pay.vue'
import { Icon, Dialog } from 'vant' import { Icon, Dialog } from 'vant'
import {ref} from "vue"; import {ref} from "vue";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import api from "../api";
const showDialog = ref(false); const showDialog = ref(false);
const currencyObj = $ref({ let currencyObj = $ref({
financingCurrency: '200,000.00', // financingCurrency: '200,000.00',
headerCurrency: '5,000.00', // headerCurrency: '5,000.00',
fristCurrency: '10,000.00', // fristCurrency: '10,000.00',
times: '12' // times: '12'
}) })
let cashflow = []
const payInfo = ref({}); const payInfo = ref({});
let showModal = ref(false); let showModal = ref(false);
...@@ -83,6 +85,23 @@ const router = useRouter(); ...@@ -83,6 +85,23 @@ const router = useRouter();
const goDamagesDetail = () => { const goDamagesDetail = () => {
router.push({ name: 'makeRepayment-views-liquidatedDamagesDetails' }) router.push({ name: 'makeRepayment-views-liquidatedDamagesDetails' })
} }
const getRepayPlanInfo = async () => {
const result = await api.getRepayPlanDetail({"contractId": "777"})
if(result.message === '请求成功'){
const rows = result.rows[0];
currencyObj = {
financingCurrency: rows.financeAmount,
headerCurrency: rows.firstGold,
fristCurrency: rows.firstRentGold,
times: rows.cashflow.length
}
rows.cashflow = rows.cashflow.map(item => { item.calcDate = item.calcDate?.split(" ")[0]; return item })
cashflow = rows.cashflow
console.log(cashflow);
}
}
getRepayPlanInfo()
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment