Commit 47dabc07 authored by WangRui's avatar WangRui
parents 41740e43 9ed4a7ea
<template> <template>
<div class="container"> <div class="container">
<NavBar title="融资意向" left-arrow @click-left="goBack" /> <NavBar title="融资意向" left-arrow @click-left="goBack" />
<section class="list"> <section class="list">
<PullRefresh v-model="refreshing" @refresh="getList" class="scroll"> <PullRefresh v-model="refreshing" @refresh="getList" class="scroll">
<List :finished="finished" finished-text="没有更多了"> <List :finished="finished" finished-text="没有更多了">
<Empty v-if="!listValue.length" description="无记录" /> <Empty v-if="!listValue.length" description="无记录" />
<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(item.intentionId)" /> @click="jump(item.intentionId)" />
</List> </List>
</PullRefresh> </PullRefresh>
</section> </section>
<Plus @click="jump('')" /> <Plus @click="jump('')" />
</div> </div>
</template> </template>
<script setup> <script setup>
import { goBack } from "@/utils/globalFun" import { goBack } from "@/utils/globalFun"
import { NavBar, List, PullRefresh, Empty } from "vant"; import { NavBar, List, PullRefresh, Empty } from "vant";
import ListItem from '@/components/ListItem.vue' import ListItem from '@/components/ListItem.vue'
import Plus from '@/components/Plus.vue' import Plus from '@/components/Plus.vue'
import api from "../api"; import api from "../api";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useIntention } from '../store/index' import { useIntention } from '../store/index'
import {currency} from '@/utils/textFormat'
const formStore = useIntention()
const formStore = useIntention()
const listValue = $ref([])
const listValue = $ref([])
const getList = async () => {
let res = await api.getlist() const getList = async () => {
if (res.success && res.rows.length) { let res = await api.getlist()
listValue = res.rows.map(item => { if (res.success && res.rows.length) {
return { listValue = res.rows.map(item => {
title: item.intentionNumber, return {
other_title: item.creationDate, title: item.intentionNumber,
values: [["合同金额", "状态"], ["¥ " + (item.contractAmount || '0.00'), item.intentionStatusN]], other_title: item.creationDate.split(' ')[0],
intentionId: item.intentionId values: [["合同金额", "状态"], ["¥ " + (currency(item.contractAmount) || '0.00'), item.intentionStatusN]],
} intentionId: item.intentionId
}) }
} else { })
listValue = [] } else {
} listValue = []
refreshing = false; }
} refreshing = false;
getList() }
getList()
const refreshing = $ref(true);
const finished = $ref(true); const refreshing = $ref(true);
const finished = $ref(true);
const router = useRouter();
const jump = async (intentionId = '') => { const router = useRouter();
if (intentionId) { const jump = async (intentionId = '') => {
let res = await api.getDetail({ intentionId: intentionId + '' }) if (intentionId) {
if (res.success && res.rows.length) { let res = await api.getDetail({ intentionId: intentionId + '' })
formStore.intentionData = res.rows[0]; if (res.success && res.rows.length) {
router.push({ name: 'intention-views-intentionForm' }) formStore.intentionData = res.rows[0];
} router.push({ name: 'intention-views-intentionForm' })
} else { }
router.push({ name: 'intention-views-intentionForm' }) } else {
} router.push({ name: 'intention-views-intentionForm' })
} }
</script> }
</script>
<style scoped lang="less">
.list { <style scoped lang="less">
box-sizing: border-box; .list {
height: calc(100vh - var(--van-nav-bar-height)); box-sizing: border-box;
display: flex; height: calc(100vh - var(--van-nav-bar-height));
flex-direction: column; display: flex;
justify-content: space-between; flex-direction: column;
padding-top: 8px; justify-content: space-between;
padding-bottom: 10px; padding-top: 8px;
} padding-bottom: 10px;
}
.scroll {
box-sizing: border-box; .scroll {
height: 100%; box-sizing: border-box;
overflow-y: auto; height: 100%;
} overflow-y: auto;
</style> }
</style>
<route>
{ <route>
meta: { {
title: '融资意向' meta: {
} title: '融资意向'
} }
</route> }
</route>
...@@ -35,7 +35,7 @@ let location = useLocation() ...@@ -35,7 +35,7 @@ let location = useLocation()
const formRaw = [ const formRaw = [
{ {
title: '合同总额', title: '合同总额',
propName: 'contractAmount', propName: 'financeAmount',
type: 'currency', type: 'currency',
value: '', value: '',
isRequired: true isRequired: true
...@@ -123,7 +123,7 @@ const save = async () => { ...@@ -123,7 +123,7 @@ const save = async () => {
} }
console.log(formValueObj); console.log(formValueObj);
if (formConfig.validate()) { if (formConfig.validate()) {
let res = await api.saveInfo({ remark: message, ...formValueObj }) let res = await api.saveInfo({ remark: message, ...formValueObj, financeAmount: +formValueObj.financeAmount})
if (res.success) { if (res.success) {
Toast.success('保存成功'); Toast.success('保存成功');
} else { } else {
......
<template> <template>
<div class="container"> <div class="container">
<NavBar title="还款计划" left-arrow @click-left="goBack" /> <NavBar title="还款计划" left-arrow @click-left="goBack" />
<section class="list"> <section class="list">
<Search v-model="searchVal" placeholder="请输入项目编号/融资金额" /> <Search v-model="searchVal" placeholder="请输入项目编号/融资金额" />
<Notice detail="只可对已关联的项目还款" /> <Notice detail="只可对已关联的项目还款" />
<PullRefresh v-model="refreshing" @refresh="getList" class="scroll"> <PullRefresh v-model="refreshing" @refresh="getList" class="scroll">
<List :finished="finished" finished-text="没有更多了" @load="loadApproval"> <List :finished="finished" finished-text="没有更多了" @load="loadApproval">
<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>
</PullRefresh> </PullRefresh>
</section> </section>
</div> </div>
</template> </template>
<script setup> <script setup>
import { goBack } from "@/utils/globalFun" import { goBack } from "@/utils/globalFun"
import { NavBar, List, PullRefresh, Search} from "vant"; import { NavBar, List, PullRefresh, Search} from "vant";
import Notice from '@/components/Notice.vue' import Notice from '@/components/Notice.vue'
import ListItem from '@/components/ListItem.vue' import ListItem from '@/components/ListItem.vue'
import api from "../api"; import api from "../api";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import {currency} from '@/utils/textFormat'
const searchVal = $ref('');
const searchVal = $ref('');
let listValue = $ref([
// { let listValue = $ref([
// title: '202204-DB001-001', // {
// other_title: "2022-07-18", // title: '202204-DB001-001',
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]] // other_title: "2022-07-18",
// }, // values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
// { // },
// title: '202204-DB001-001', // {
// other_title: "2022-07-18", // title: '202204-DB001-001',
// values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]] // other_title: "2022-07-18",
// }, // values: [["剩余应还金额", "状态", "融资金额"], ["¥ 20,000.00", "正常", "¥ 20,000.00"]]
]) // },
])
let refreshing = $ref(true);
const finished = $ref(true); let refreshing = $ref(true);
const finished = $ref(true);
const getList = async () => {
// 下拉重置参数,重新加载 const getList = async () => {
let res = await api.getRepayPlantList({userId: window.localStorage.getItem('userId')}); // 下拉重置参数,重新加载
let list = [] let res = await api.getRepayPlantList({userId: window.localStorage.getItem('userId')});
if(res.success){ let list = []
list = res.rows.map(item => ({ if(res.success){
...item, list = res.rows.map(item => ({
title: item.contractNumber, ...item,
other_title: item.applyDate?.split(' ')[0], title: item.contractNumber,
values: [["剩余应还金额", "状态", "融资金额"], [item.residueAmount, item.contractStatusN, item.financeAmount]] other_title: item.applyDate?.split(' ')[0],
})) values: [["剩余应还金额", "状态", "融资金额"], [currency(item.residueAmount),item.contractStatusN, currency(item.financeAmount)]]
}else { }))
list = []; }else {
} list = [];
listValue = list; }
refreshing = false;
}; listValue = list;
getList(); refreshing = false;
};
const loadApproval = () => { getList();
} const loadApproval = () => {
const router = useRouter(); }
const jump = () => { const router = useRouter();
router.push({ name: 'repayPlan-views-plan' })
} const jump = () => {
</script> router.push({ name: 'repayPlan-views-plan' })
}
<style scoped lang="less"> </script>
.list {
box-sizing: border-box; <style scoped lang="less">
height: calc(100vh - var(--van-nav-bar-height)); .list {
display: flex; box-sizing: border-box;
flex-direction: column; height: calc(100vh - var(--van-nav-bar-height));
justify-content: space-between; display: flex;
padding-bottom: 10px; flex-direction: column;
} justify-content: space-between;
padding-bottom: 10px;
.scroll { }
box-sizing: border-box;
height: calc(100vh - 30vw); .scroll {
overflow-y: auto; box-sizing: border-box;
} height: calc(100vh - 30vw);
</style> overflow-y: auto;
}
<route> </style>
{
meta: { <route>
title: '还款计划查询' {
} meta: {
} title: '还款计划查询'
</route> }
}
</route>
<template> <template>
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj"> <RepayPlan navTitle="还款计划" :currencyObj="currencyObj">
<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 currencyObj.times"> <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="item in cashflow"> <div class="item" v-for="item in cashflow">
<div class="left-item"> <div class="left-item">
<span>租金</span> <span>租金</span>
<span>{{ item.chargeDueDate}}</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>¥9,000.00</span>
</p> </p>
<p> <p>
<span>待付金额</span> <span>待付</span>
<span>¥0.00</span> <span>¥0.00</span>
</p> </p>
</div> </div>
<div class="right-item"> <div class="right-item">
<span>明细</span> <span>明细</span>
<span class="flag-button overtime"> <span class="flag-button overtime">
<Icon style="margin-right: 1px;" name="info-o" />{{item.writeOffFlagN}} <Icon style="margin-right: 1px;" name="info-o" />{{item.writeOffFlagN}}
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<template #footer> <template #footer>
</template> </template>
</RepayPlan> </RepayPlan>
</template> </template>
<script setup> <script setup>
import RepayPlan from '@/components/RepayPlan.vue' import RepayPlan from '@/components/RepayPlan.vue'
import { Icon } from 'vant' import { Icon } from 'vant'
import {useRoute} from 'vue-router' import {useRoute} from 'vue-router'
import api from "../api"; import api from "../api";
let 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 = [] let cashflow = []
//writeOffFlag: "NOT" //writeOffFlag: "NOT"
// writeOffFlagN: "待付" // writeOffFlagN: "待付"
const getRepayPlanInfo = async () => { const getRepayPlanInfo = async () => {
const result = await api.getRepaymentDetails({"contractId": "777"}) const result = await api.getRepaymentDetails({"contractId": "777"})
if(result.message === '请求成功'){ if(result.message === '请求成功'){
const rows = result.rows[0]; const rows = result.rows[0];
currencyObj = { currencyObj = {
financingCurrency: rows.financeAmount, financingCurrency: rows.financeAmount,
headerCurrency: rows.firstGold, headerCurrency: rows.firstGold,
fristCurrency: rows.firstRentGold, fristCurrency: rows.firstRentGold,
times: rows.cashflow.length times: rows.cashflow.length
} }
// rows.cashflow = rows.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item }) // rows.cashflow = rows.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item })
cashflow = rows.cashflow cashflow = rows.cashflow
console.log(cashflow); console.log(cashflow);
} }
} }
getRepayPlanInfo() getRepayPlanInfo()
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@lineColr: #dcdddf; @lineColr: #dcdddf;
.repay_list { .repay_list {
display: flex; display: flex;
width: 100%; width: 100%;
height: 98%; height: 98%;
overflow-y: auto; overflow-y: auto;
scrollbar-width: none; scrollbar-width: none;
/* firefox */ /* firefox */
} }
.repay_list::-webkit-scrollbar { .repay_list::-webkit-scrollbar {
display: none; display: none;
/* Chrome Safari */ /* Chrome Safari */
} }
@leftW: 45px; @leftW: 45px;
.left { .left {
flex: 0 1 @leftW; flex: 0 1 @leftW;
} }
.times-box { .times-box {
display: flex; display: flex;
height: 100px; height: 100px;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
background-image: linear-gradient(@lineColr 0%, @lineColr 16%, transparent 16%, transparent 33%, @lineColr 33%, @lineColr 83%, transparent 83%, transparent 100%); background-image: linear-gradient(@lineColr 0%, @lineColr 16%, transparent 16%, transparent 33%, @lineColr 33%, @lineColr 83%, transparent 83%, transparent 100%);
/* 35%设置虚线点y轴上的长度 */ /* 35%设置虚线点y轴上的长度 */
background-position: 50% 50%; background-position: 50% 50%;
/* right配置右边框位置的虚线 */ /* right配置右边框位置的虚线 */
background-size: 1px 20px; background-size: 1px 20px;
/* 第一个参数设置虚线点x轴上的长度;第二个参数设置虚线点的间距 */ /* 第一个参数设置虚线点x轴上的长度;第二个参数设置虚线点的间距 */
background-repeat: repeat-y; background-repeat: repeat-y;
} }
.times-box:nth-child(1) { .times-box:nth-child(1) {
margin-top: 25px; margin-top: 25px;
height: 70px; height: 70px;
justify-content: flex-start; justify-content: flex-start;
} }
.times-box:nth-last-child(1) { .times-box:nth-last-child(1) {
// bottom: 80px; // bottom: 80px;
height: 70px; height: 70px;
justify-content: flex-end; justify-content: flex-end;
} }
.times { .times {
height: @leftW; height: @leftW;
width: @leftW; width: @leftW;
display: flex; display: flex;
justify-content: center; justify-content: center;
line-height: @leftW; line-height: @leftW;
color: #fff; color: #fff;
background-color: #019ae5; background-color: #019ae5;
border-radius: 5px; border-radius: 5px;
} }
.right { .right {
flex: 1 0 auto; flex: 1 0 auto;
padding-left: 20px; padding-left: 20px;
} }
.item { .item {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
box-sizing: border-box; box-sizing: border-box;
margin-top: 15px; margin-top: 15px;
margin-bottom: 30px; margin-bottom: 30px;
width: 98%; width: 98%;
height: 70px; height: 70px;
border: 1px solid #dedede; border: 1px solid #dedede;
background-color: #eef5fd; background-color: #eef5fd;
border-radius: 5px; border-radius: 5px;
padding: 10px 5px 3px 10px; padding: 10px 5px 3px 10px;
font-size: 13px; font-size: 13px;
&>div { &>div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
} }
} }
.left-item { .left-item {
flex: 1 0 30%; flex: 1 0 30%;
span:nth-child(1) { span:nth-child(1) {
font-weight: 600; font-weight: 600;
} }
span:nth-child(2) { span:nth-child(2) {
color: gray; color: gray;
} }
} }
.center-item { .center-item {
flex: 1 0 45%; flex: 1 0 45%;
p { p {
color: gray; color: gray;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
span:nth-child(2) { span:nth-child(2) {
font-weight: 600; font-weight: 600;
} }
} }
&>p:nth-child(1) span:nth-child(2) { &>p:nth-child(1) span:nth-child(2) {
color: #019ae5; color: #019ae5;
} }
} }
.right-item { .right-item {
flex: 1 0 25%; flex: 1 0 25%;
text-align: center; text-align: center;
span:nth-child(1) { span:nth-child(1) {
color: #019ae5; color: #019ae5;
} }
span:nth-child(2) { span:nth-child(2) {
color: gray; color: gray;
} }
} }
.flag-button { .flag-button {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 80%; width: 80%;
margin: 0 auto; margin: 0 auto;
height: 40%; height: 40%;
border-radius: 10px; border-radius: 10px;
font-size: 12px; font-size: 12px;
} }
.overtime { .overtime {
background-color: #eeeeee; background-color: #eeeeee;
color: orange !important; color: orange !important;
border: 1px solid #e2e3e4; border: 1px solid #e2e3e4;
} }
.nopay { .nopay {
background-color: #bec2c5; background-color: #bec2c5;
color: white !important; color: white !important;
border: 1px solid #bec2c5; border: 1px solid #bec2c5;
} }
.pay { .pay {
background-color: #f0f0f0; background-color: #f0f0f0;
color: gray !important; color: gray !important;
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
} }
</style> </style>
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