Commit 2ca0fa36 authored by xhx's avatar xhx

Merge branch 'dev' of https://gitlab.33.cn/CassiniatSaturn/fns_backend into sub

parents 183cf57f 8b04f323
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
<template #loan_type="text"> <template #loan_type="text">
{{ text | filterLoanType }} {{ text | filterLoanType }}
</template> </template>
<span slot="date" slot-scope="text"> <!-- <span slot="date" slot-scope="text">
{{ text.min_date }}-{{ text.max_date }} {{ text.min_date }}-{{ text.max_date }}
</span> </span> -->
<span slot="rate" slot-scope="text"> <!-- <span slot="rate" slot-scope="text">
{{ text.rate_lower }}-{{ text.rate_upper }} {{ text.rate }}
</span> </span> -->
<span slot="amount" slot-scope="text"> <span slot="amount" slot-scope="text">
{{ text.min_amount }}-{{ text.max_amount }} {{ text.min_amount }}~{{ text.max_amount }}
</span> </span>
<template #guarantee_type="text"> <template #guarantee_type="text">
{{ text | filterGuaranteeType }} {{ text | filterGuaranteeType }}
......
...@@ -22,14 +22,15 @@ export default [ ...@@ -22,14 +22,15 @@ export default [
scopedSlots: { customRender: 'loan_type' }, scopedSlots: { customRender: 'loan_type' },
}, },
{ {
title: '产品期限()', title: '产品期限()',
align: 'center', align: 'center',
scopedSlots: { customRender: 'date' }, dataIndex: 'date',
// scopedSlots: { customRender: 'date' },
}, },
{ {
title: '参考利率(%)', title: '最低参考利率(%)',
align: 'center', align: 'center',
scopedSlots: { customRender: 'rate' }, dataIndex: 'rate',
}, },
{ {
title: '产品额度(万元)', title: '产品额度(万元)',
......
...@@ -16,9 +16,37 @@ export default class AddressService { ...@@ -16,9 +16,37 @@ export default class AddressService {
this.max_len_gps = 10 this.max_len_gps = 10
} }
getGpses(data: { addrs: string[] }): Promise<string[]> { // getGpses(data: { addrs: string[] }): Promise<string[]> {
// return new Promise((resolve, reject) => {
// const resultList = [] as string[]
// if (data.addrs.length) {
// for (
// let i = 0;
// i < Math.ceil(data.addrs.length / this.max_len_gps);
// ++i
// ) {
// const reqList = data.addrs.slice(
// i * this.max_len_gps,
// i * this.max_len_gps + this.max_len_gps,
// )
// this.__getGpses(reqList).then((ret) => {
// if (ret.code === 200) {
// resultList.push(...ret.data.gps)
// if (resultList.length === data.addrs.length) {
// resolve(resultList)
// }
// } else {
// reject('解析错误')
// }
// })
// }
// }
// })
// }
getGpses2(data: { addrs: string[] }): Promise<{ [props: string]: string }> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const resultList = [] as string[] const theMap = {} as { [props: string]: string }
if (data.addrs.length) { if (data.addrs.length) {
for ( for (
let i = 0; let i = 0;
...@@ -31,9 +59,14 @@ export default class AddressService { ...@@ -31,9 +59,14 @@ export default class AddressService {
) )
this.__getGpses(reqList).then((ret) => { this.__getGpses(reqList).then((ret) => {
if (ret.code === 200) { if (ret.code === 200) {
resultList.push(...ret.data.gps) const locations = reqList
if (resultList.length === data.addrs.length) { const gpses = ret.data.gps
resolve(resultList)
locations.map((location, index) => {
theMap[location] = gpses[index]
})
if (Object.keys(theMap).length === data.addrs.length) {
resolve(theMap)
} }
} else { } else {
reject('解析错误') reject('解析错误')
...@@ -47,7 +80,7 @@ export default class AddressService { ...@@ -47,7 +80,7 @@ export default class AddressService {
if (addrs.length > 10) { if (addrs.length > 10) {
throw new Error('长度超过10') throw new Error('长度超过10')
} else { } else {
return baseAxios<{ gps: string[]}>({ return baseAxios<{ gps: string[] }>({
url: this.prefix + '/getGps', url: this.prefix + '/getGps',
method: 'post', method: 'post',
data: { data: {
...@@ -71,7 +104,7 @@ export default class AddressService { ...@@ -71,7 +104,7 @@ export default class AddressService {
// }) // })
// } // }
getOutlets(data: { level?: number; id?: number, branch_name?:string }) { getOutlets(data: { level?: number; id?: number; branch_name?: string }) {
return baseAxios<iOutLetDetail[]>({ return baseAxios<iOutLetDetail[]>({
url: '/address/getOutlets', url: '/address/getOutlets',
method: 'post', method: 'post',
...@@ -119,7 +152,7 @@ export default class AddressService { ...@@ -119,7 +152,7 @@ export default class AddressService {
url: '/address/add', url: '/address/add',
method: 'post', method: 'post',
data: { data: {
outlets_req: [data] outlets_req: [data],
}, },
}) })
} }
......
...@@ -21,13 +21,15 @@ export default class LoanProductService { ...@@ -21,13 +21,15 @@ export default class LoanProductService {
inst_name: string inst_name: string
loan_type: eProductType loan_type: eProductType
max_amount: number max_amount: number
max_date: number date:number
rate:number
// max_date: number
product_name: string product_name: string
products: string products: string
rate_lower: number // rate_lower: number
rate_upper: number // rate_upper: number
submit_cond: string submit_cond: string
min_date: number // min_date: number
min_amount: number min_amount: number
} }
) { ) {
...@@ -47,15 +49,17 @@ export default class LoanProductService { ...@@ -47,15 +49,17 @@ export default class LoanProductService {
inst_name: string inst_name: string
loan_type: eProductType loan_type: eProductType
max_amount: number max_amount: number
max_date: number // max_date: number
product_name: string product_name: string
products: string products: string
rate_lower: number // rate_lower: number
rate_upper: number // rate_upper: number
submit_cond: string submit_cond: string
min_amount: number min_amount: number
min_date: number // min_date: number
uuid:string uuid:string
date:number
rate:number
} }
) { ) {
return baseAxios({ return baseAxios({
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
product_status: number, product_status: number,
product_type: number, product_type: number,
products: string, products: string,
date:number,
lower:number,
rate_lower: string, rate_lower: string,
rate_upper: string, rate_upper: string,
submit_cond: string, submit_cond: string,
......
...@@ -11,6 +11,8 @@ export interface iListItem { ...@@ -11,6 +11,8 @@ export interface iListItem {
max_date: number, max_date: number,
min_amount: number, min_amount: number,
min_date: number, min_date: number,
date:number,
rate:number,
product_name: string, product_name: string,
product_status: number, product_status: number,
loan_type: number, loan_type: number,
......
...@@ -33,14 +33,14 @@ function getAddressList(dataList: any[]) { ...@@ -33,14 +33,14 @@ function getAddressList(dataList: any[]) {
} }
async function getAddressLalonObj(locationList: string[]) { async function getAddressLalonObj(locationList: string[]) {
const rets = await AddressService.getInstance().getGpses({ const rets = await AddressService.getInstance().getGpses2({
addrs: locationList, addrs: locationList,
}) })
let obj = {} as any // let obj = {} as any
locationList.forEach((item, index) => { // locationList.forEach((item, index) => {
obj[item] = rets[index] // obj[item] = rets[index]
}) // })
return obj return rets
} }
function formatPositionToNumber(str: string) { function formatPositionToNumber(str: string) {
...@@ -181,9 +181,11 @@ export const handle建设银行excelFileChange = (e: Event) => { ...@@ -181,9 +181,11 @@ export const handle建设银行excelFileChange = (e: Event) => {
const list = (parseJSYHSheet( const list = (parseJSYHSheet(
Sheets[SheetsKeys[0]], Sheets[SheetsKeys[0]],
) as unknown) as any[] ) as unknown) as any[]
console.log(list, 'show list');
const locationList = getAddressList((list as unknown) as any) const locationList = getAddressList((list as unknown) as any)
console.log(JSON.stringify(locationList)) console.log(JSON.stringify(locationList))
getAddressLalonObj(locationList).then((addressLalonObj) => { getAddressLalonObj(locationList).then((addressLalonObj) => {
console.log(addressLalonObj,' show addressLalonObj');
list.forEach((data) => { list.forEach((data) => {
data.la_lon = addressLalonObj[data.location] data.la_lon = addressLalonObj[data.location]
}) })
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="text-left"> <div class="text-left">
<a-button type="primary" @click="$router.go(-1)">返回</a-button> <a-button type="primary" @click="$router.go(-1)">返回</a-button>
</div> </div>
<p class="text-2xl font-bold mb-5">新增产品</p> <p class="text-2xl font-bold mb-5">{{title}}</p>
<div class="text-left"> <div class="text-left">
<a-form-model <a-form-model
:model="form" :model="form"
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="贷款期限(年)" required> <a-form-model-item label="贷款期限(年)" required>
<a-select <a-select
:value="form.period" :value="form.date"
@change="(v)=>form.period = v" @change="(v)=>form.date = v"
style="width: 20%" style="width: 20%"
> >
<a-select-option value="1"> 1 </a-select-option> <a-select-option value="1"> 1 </a-select-option>
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="参考利率(%)" required> <a-form-model-item label="参考利率(%)" required>
<a-input-number <a-input-number
:value="form.interstMin" :value="form.rate"
@change="(v) => (form.interstMin = Number.parseFloat(v).toFixed(4))" @change="(v) => (form.rate = Number.parseFloat(v).toFixed(4))"
placeholder="最多可输小数点后四位" placeholder="最多可输小数点后四位"
:step="0.0001" :step="0.0001"
:precision="4" :precision="4"
...@@ -175,13 +175,16 @@ export default Vue.extend({ ...@@ -175,13 +175,16 @@ export default Vue.extend({
}, },
mounted() { mounted() {
if (this.$route.query.record) { if (this.$route.query.record) {
this.title = "编辑产品"
const record: iListItem = JSON.parse(this.$route.query.record as string); const record: iListItem = JSON.parse(this.$route.query.record as string);
this.form.name = record.product_name; this.form.name = record.product_name;
this.form.orgnization = record.inst_name; this.form.orgnization = record.inst_name;
this.form.startTime = record.min_date; // this.form.startTime = record.min_date;
this.form.endTime = record.max_date; // this.form.endTime = record.max_date;
this.form.interstMin = record.rate_lower; // this.form.interstMin = record.rate_lower;
this.form.interstMax = record.rate_upper; // this.form.interstMax = record.rate_upper;
this.form.date = record.date,
this.form.rate = record.rate
this.form.limitMin = record.min_amount; this.form.limitMin = record.min_amount;
this.form.limitMax = record.max_amount; this.form.limitMax = record.max_amount;
this.form.guarantee = record.guarantee_type; this.form.guarantee = record.guarantee_type;
...@@ -220,14 +223,16 @@ export default Vue.extend({ ...@@ -220,14 +223,16 @@ export default Vue.extend({
}, },
data() { data() {
return { return {
title:"新增产品",
form: { form: {
name: "", name: "",
orgnization: "", orgnization: "",
startTime: 0, // startTime: 0,
endTime: 1, // endTime: 1,
period:1, date:1,
interstMax: 0.01, rate:0,
interstMin: 0, // interstMax: 0.01,
// interstMin: 0,
limitMax: 1, limitMax: 1,
limitMin: 0, limitMin: 0,
guarantee: eGuaranteeType.credit, guarantee: eGuaranteeType.credit,
...@@ -316,15 +321,17 @@ export default Vue.extend({ ...@@ -316,15 +321,17 @@ export default Vue.extend({
guarantee_type: this.form.guarantee as eGuaranteeType, guarantee_type: this.form.guarantee as eGuaranteeType,
inst_name: this.form.orgnization, inst_name: this.form.orgnization,
max_amount: this.form.limitMax, max_amount: this.form.limitMax,
max_date: this.form.endTime, // max_date: this.form.endTime,
product_name: this.form.name, product_name: this.form.name,
products: this.form.introduction, products: this.form.introduction,
loan_type: this.form.type, loan_type: this.form.type,
rate_lower: +this.form.interstMin, date:+this.form.date,
rate_upper: +this.form.interstMax, rate:+this.form.rate,
// rate_lower: +this.form.interstMin,
// rate_upper: +this.form.interstMax,
submit_cond: this.form.submissionCon, submit_cond: this.form.submissionCon,
min_amount: this.form.limitMin, min_amount: this.form.limitMin,
min_date: this.form.startTime, // min_date: this.form.startTime,
uuid: this.uuid, uuid: this.uuid,
}) })
.then((ret) => { .then((ret) => {
...@@ -345,14 +352,16 @@ export default Vue.extend({ ...@@ -345,14 +352,16 @@ export default Vue.extend({
guarantee_type: this.form.guarantee as eGuaranteeType, guarantee_type: this.form.guarantee as eGuaranteeType,
inst_name: this.form.orgnization, inst_name: this.form.orgnization,
max_amount: this.form.limitMax, max_amount: this.form.limitMax,
max_date: this.form.endTime, // max_date: this.form.endTime,
min_amount: this.form.limitMin, min_amount: this.form.limitMin,
min_date: this.form.startTime, // min_date: this.form.startTime,
loan_type: this.form.type as eProductType, loan_type: this.form.type as eProductType,
product_name: this.form.name, product_name: this.form.name,
products: this.form.introduction, products: this.form.introduction,
rate_lower: +this.form.interstMin, date:+this.form.date,
rate_upper: +this.form.interstMax, rate:+this.form.rate,
// rate_lower: +this.form.interstMin,
// rate_upper: +this.form.interstMax,
submit_cond: this.form.submissionCon, submit_cond: this.form.submissionCon,
}) })
.then((ret) => { .then((ret) => {
......
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