Commit 9ed4a7ea authored by 胡's avatar

fix: 对金钱进行格式化

parent d1a5bbc0
<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>
<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>
This diff is collapsed.
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