Commit a664c233 authored by Step_by_step's avatar Step_by_step

fix: 修改融资计算器接口,融资意向接口返回格式出错问题

parent c6dffefc
......@@ -32,7 +32,7 @@ npm run preview 本地预览打包完的文件
4. 合同签约 (E签宝, 预览签署文件, 由消息推送后做) (✋ 2) ✅
5. 还款计划 (支付, 只能从上到下支付)(✋ 2)
6. 还款计划查询 (发票预览下载) (✋ 2)
7. 自助服务 ( ✋.5)
7. 自助服务 ( ✋.5)✅
8. 客户信息变更 (✋ 1)
#### 首页
......
......@@ -89,8 +89,8 @@ const updateForm = async () => {
isComplete = planStore.planData?.isComplete;
if (testQuotationId) {
let res = await api.getFormInfo({ testQuotationId: '' + testQuotationId })
if (res.result === 'SUCCESS') {
let resData = res.data[0];
if (res.success) {
let resData = res.rows[0];
formConfig.replace(formConfigArr.map(item => {
item.value = resData[item.propName] || '';
if (item.propName === "firstGoldRatio") {
......
<template>
<div class="container">
<NavBar title="融资计算器" left-arrow @click-left="goBack" />
<NavBar title="融资计算器" left-arrow @click-left="goBack(true)" />
<section class="list">
<PullRefresh v-model="refreshing" @refresh="getList" class="scroll">
......@@ -33,8 +33,8 @@ const listValue = $ref([])
let getList = async () => {
let list = await api.financingCalculator({ userId: window.localStorage.getItem('userId') })
if (list.data && list.data.length) {
list = list.data.map(item =>
if (list.rows && list.rows.length) {
list = list.rows.map(item =>
({ ...item, title: item.creationDate.split(' ')[0], values: [["物件价格", "融资金额", "每期还款"], [`¥ ${item.priceOfItem}`, `¥ ${item.financeAmount}`, `¥ ${item.dueAmount}`]] })
)
} else {
......@@ -48,10 +48,11 @@ getList()
const router = useRouter();
const jump = async (testQuatationId) => {
if (testQuatationId) {
let res = await api.planInfo({ testQuatationId: testQuatationId + '' })
if (res.result === 'SUCCESS') {
res.data.cashflow = res.data.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item })
planStore.planData = { ...res.data, isComplete: true };
let res = await api.planInfo({ testQuotationId: testQuatationId + '' })
if (res.success && res.rows.length) {
let obj = res.rows[0]
obj.cashflow = obj.cashflow.map(item => { item.chargeDueDate = item.chargeDueDate.split(" ")[0]; return item })
planStore.planData = { ...obj, isComplete: true };
router.push({ name: 'calculator-views-plan' })
} else {
Toast.fail('获取不到计算数据');
......
......@@ -68,7 +68,7 @@ const save = async () => {
let res = await api.saveInfo(plan)
if (res.result == "SUCCESS") {
if (res.success) {
router.push({ name: 'calculator-views' })
Toast.success('保存成功');
} else {
......
......@@ -31,8 +31,8 @@ const listValue = $ref([])
const getList = async () => {
let res = await api.getlist()
if (res.result === 'SUCCESS' && res.data.length) {
listValue = res.data.map(item => {
if (res.success && res.rows.length) {
listValue = res.rows.map(item => {
return {
title: item.intentionNumber,
other_title: item.creationDate,
......@@ -54,8 +54,8 @@ const router = useRouter();
const jump = async (intentionId = '') => {
if (intentionId) {
let res = await api.getDetail({ intentionId: intentionId + '' })
if (res.result === 'SUCCESS' && res.data.length) {
formStore.intentionData = res.data[0];
if (res.success && res.rows.length) {
formStore.intentionData = res.rows[0];
router.push({ name: 'intention-views-intentionForm' })
}
} else {
......
......@@ -144,8 +144,8 @@ export async function HlpsUpload(source, target, headers, successCb) {
}
// 判断还有可返回的路由吗? 无则退出
export const goBack = () => {
if (window.history.state.position > 0) return window.history.back();
export const goBack = (isExit = false) => {
if (window.history.state.position > 0 && !isExit) return window.history.back();
// 海马汇退出子应用方法
let args = {
......
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