Commit 90c9f1c0 authored by WangRui's avatar WangRui

[feature]还款计划-接口变化后的相关调整

parent 492b3699
......@@ -42,7 +42,7 @@
import { goBack } from "@/utils/globalFun"
import { NavBar } from "vant";
const emit = defineEmits(['onClickRight', 'leftClick'])
const emit = defineEmits(['onClickRight', 'onLeftClick'])
defineProps({
navTitle: {
type: String,
......@@ -68,7 +68,7 @@ const onClickRight = () => {
}
const onLeftClick = () => {
emit('leftClick')
emit('onLeftClick')
}
</script>
......
......@@ -7,13 +7,17 @@ const api = {
getRepayPlantList(data = {}) {
return post(`${baseURL}/app/api/app/repayment/details`, data)
},
// 明细查询
getRepayPlanDetail(data ={}){
return post(`${baseURL}/app/api/app/project/repayment/details`, data)
},
//还款计划明细
getRepaymentDetails(data={}){
getRepayPlanDetail(data={}){
return post(`${baseURL}/app/api/app/project/repayment/details`, data)
},
//违约金明细
getLiquidatedDetail(data={}){
return post(`${baseURL}/app/api/app/liquidated/damages/details`, data)
},
//违约金每日明细
getDailyLiquidatedDetail(data={}){
return post(`${baseURL}/app/api/app/day/liquidated/damages/details`, data)
}
};
......
......@@ -2,13 +2,18 @@ import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, doubleCount, increment }
export const useMakeRepayment = defineStore('makeRepaymentStore', () => {
const makeRepayPlanData = ref({})
const contractId = ref('')
return { makeRepayPlanData, contractId }
})
// export const useCounterStore = defineStore('counter', () => {
// const count = ref(0)
// const doubleCount = computed(() => count.value * 2)
// function increment() {
// count.value++
// }
//
// return { count, doubleCount, increment }
// })
......@@ -10,7 +10,7 @@
<PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll">
<List :finished="finished" finished-text="没有更多了">
<ListItem v-for="item in listValue" :other_title="item.other_title" :title="item.title" :values="item.values"
@click="jump" />
@click="jump(item.contractId)" />
</List>
</PullRefresh>
</section>
......@@ -24,21 +24,13 @@ import Notice from '@/components/Notice.vue'
import ListItem from '@/components/ListItem.vue'
import api from "../api";
import { useRouter } from "vue-router";
import { useMakeRepayment } from '../store/index'
const makeRepaymentStore = useMakeRepayment()
const searchVal = $ref('');
let listValue = $ref([
{
title: '202204-DB001-001',
other_title: "2022-07-18",
values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
},
{
title: '202204-DB001-001',
other_title: "2022-07-18",
values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
},
])
let listValue = $ref([])
let refreshing = $ref(true);
const finished = $ref(true);
......@@ -46,8 +38,8 @@ const finished = $ref(true);
const getList = async () => {
// 下拉重置参数,重新加载
let list = await api.getRepayPlantList({userId: window.localStorage.getItem('userId')});
if(list.result === 'SUCCESS'){
list = list.data.map(item => ({
if(list.success){
list = list.rows.map(item => ({
...item,
title: item.contractNumber,
other_title: item.applyDate?.split(' ')[0],
......@@ -59,7 +51,7 @@ const getList = async () => {
listValue = list;
refreshing = false;
};
// getList();
getList();
const loadApproval = () => {
......@@ -67,35 +59,10 @@ const loadApproval = () => {
const router = useRouter();
const jump = () => {
router.push({ name: 'makeRepayment-views-plan', params: {
name: 'hh'
}})
const jump = (contractId) => {
makeRepaymentStore.contractId = contractId
router.push({ name: 'makeRepayment-views-plan'})
}
// export default ({
// setup(props, ctx) {
// //router是全局路由对象,route= userRoute()是当前路由对象
// let router = useRouter();
// const jump=()=>{
// router.push({
// //传递参数使用params的话,只能使用name指定(在route.js里面声明name)
// name:'makeRepayment-views-plan',
// params:{
// num:1
// }
// /* 使用query的话,指定path或者name都行
// path:'/home',
// query:{
// num:1
// } */
// })
// }
// return{
// jump,
// }
// }
// })
</script>
<style scoped lang="less">
......
......@@ -12,6 +12,7 @@
<script setup>
import { Collapse, CollapseItem, Cell, CellGroup, NavBar } from 'vant';
import {ref, reactive} from "vue";
import api from "../api";
const damageDetailInfo = ref([
......@@ -49,6 +50,8 @@ const damageDetailInfo = ref([
}
])
const activeNames = ref([]);
</script>
<style lang="less" scoped>
......
<template>
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" navText="违约金明细" @onClickRight="goDamagesDetail">
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" @onLeftClick="goBack" navText="违约金明细" @onClickRight="goDamagesDetail">
<template #list>
<div class="repay_list">
<div class="left">
......@@ -24,7 +24,7 @@
</p>
</div>
<div class="right-item">
<span>啊哈哈哈:{{route.params.name}}</span>
<span></span>
<span class="flag-button payment" @click="handleClick">
支付
</span>
......@@ -48,10 +48,13 @@
import RepayPlan from '@/components/RepayPlan.vue'
import Pay from '../components/Pay.vue'
import { Icon, Dialog } from 'vant'
import {goBack} from '../../../utils/globalFun';
import {ref} from "vue";
import { useRoute, useRouter } from "vue-router";
import api from "../api";
import { useMakeRepayment } from '../store/index'
const makeRepaymentStore = useMakeRepayment()
const showDialog = ref(false);
let currencyObj = $ref({
financingCurrency: '200,000.00',
......@@ -72,9 +75,7 @@ let showModal = ref(false);
const route = useRoute()
const handleClick = () => {
console.log('hahhha')
showModal.value = true
console.log('jaj', showModal.value);
}
const handleColse = (param) => {
......@@ -95,7 +96,7 @@ const goDamagesDetail = () => {
}
const getRepayPlanInfo = async () => {
const result = await api.getRepayPlanDetail({"contractId": "777"})
const result = await api.getRepayPlanDetail({"contractId": makeRepaymentStore.contractId})
if(result.message === '请求成功'){
const rows = result.rows[0];
currencyObj = {
......@@ -109,20 +110,14 @@ const getRepayPlanInfo = async () => {
console.log(cashflow);
}
}
// getRepayPlanInfo()
// export default ({
// setup(props, ctx) {
// //router是全局路由对象,route= userRoute()是当前路由对象
// let route = useRoute();
// const num = route.params.num;
// console.log(num);
// return {
// num,
// };
// },
// });
getRepayPlanInfo()
const getLiquidatedDamagesInfo = async () => {
const result = await api.getLiquidatedDetail({contractId: makeRepaymentStore.contractId})
}
getLiquidatedDamagesInfo()
</script>
<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