Commit a664c233 authored by Step_by_step's avatar Step_by_step

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

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