Commit 0b79104d authored by 14699's avatar 14699

'fix-功能完善'

parent 168b8aa3
......@@ -70,7 +70,7 @@ const formConfigArr = [
title: '合同利率',
propName: 'contractRate',
type: 'rate',
value: '6.00',
value: '6',
isRequired: true,
},
]
......@@ -81,7 +81,7 @@ const router = useRouter();
const form = $ref();
const formConfig = $ref(new AuFormClass(formConfigArr))
const isComplete = $ref(false)
let isComplete = $ref(false)
const updateForm = async () => {
......@@ -136,10 +136,10 @@ const checkValues = (values) => {
if (+values.priceOfItem <= 0) {
Toast({ message: '请输入正确的物件价格', position: 'top' });
return false;
} else if (values.firstGoldRatio > 1 || isNaN(+values.firstGoldRatio)) {
} else if (values.firstGoldRatio > 1 || isNaN(+values.firstGoldRatio) || +values.firstGoldRatio < 0) {
Toast({ message: '请输入正确首付款比例', position: 'top' });
return false;
} else if (isNaN(+values.contractRate)) {
} else if (isNaN(+values.contractRate) || +values.contractRate < 0) {
Toast({ message: '请输入正确的合同利率', position: 'top' });
return false;
}
......@@ -148,7 +148,7 @@ const checkValues = (values) => {
const getResult = (formValueObj) => {
let { priceOfItem, term, firstGoldRatio, firstRentDay, contractRate } = formValueObj
let firstGold = priceOfItem * firstGoldRatio;
let firstGold = (priceOfItem * firstGoldRatio).toFixed(0);
let financeAmount = priceOfItem - firstGold;
let monthRate = contractRate / 12;
......@@ -175,7 +175,7 @@ const getResult = (formValueObj) => {
planStore.planData = {
isComputed: true,
firstGold: firstGold.toFixed(2) + "",
firstGold: firstGold,
financeAmount: financeAmount.toFixed(2) + "",
cashflow,
...formValueObjTemp
......
......@@ -29,9 +29,9 @@ import {currency} from '@/utils/textFormat'
const planStore = usePlan()
const refreshing = $ref(true);
let refreshing = $ref(true);
const finished = $ref(true);
const listValue = $ref([])
let listValue = $ref([])
let getList = async () => {
let list = await api.financingCalculator({ userId: window.localStorage.getItem('userId') })
......@@ -60,6 +60,7 @@ const jump = async (testQuatationId) => {
Toast.fail('获取不到计算数据');
}
} else {
planStore.planData = {isComplete: false };
router.push({ name: 'calculator-views-detail' })
}
}
......
<template>
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" @leftClick="backToLast">
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" @onLeftClick="backToLast">
<template #list>
<div class="repay_list" v-if="currencyObj.times && plan.financeAmount">
<div class="left">
......@@ -39,9 +39,9 @@ import api from "../api";
import { usePlan } from '../store/index'
import { useRouter } from "vue-router";
const currencyObj = $ref({})
const plan = $ref({})
const isComplete = $ref(false)
let currencyObj = $ref({})
let plan = $ref({})
let isComplete = $ref(false)
const getPlan = () => {
const planStore = usePlan()
......
......@@ -54,9 +54,9 @@ let queryList = async () => {
refreshing = true
let res = await api.contextQuery({
actionType: active,
agencyName: '',
agencyName: searchValue,
receivets: + new Date() + '',
projectNumber: '',
projectNumber: searchValue,
...pager
})
......@@ -114,7 +114,7 @@ const pdfPre = () => {
}
let eSign = (eUrl) => {
eUrl = 'http://www.baidu.com'
// eUrl = 'http://www.baidu.com'
router.push({ path: '/contractsign/views/esign', query: { url: eUrl } })
}
......
......@@ -14,10 +14,10 @@ import { NavBar, Toast } from "vant";
import VuePdfEmbed from 'vue-pdf-embed'
import { watchEffect } from 'vue'
const isLoading = $ref(true)
let isLoading = $ref(true)
const page = $ref(null)
const pdfRef = $ref('')
const pageCount = $ref(1)
let pageCount = $ref(1)
const pdfSource = $ref('https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf')
watchEffect(() => {
......
......@@ -28,7 +28,7 @@ import {currency} from '@/utils/textFormat'
const formStore = useIntention()
const listValue = $ref([])
let listValue = $ref([])
const getList = async () => {
let res = await api.getlist()
......@@ -37,7 +37,7 @@ const getList = async () => {
return {
title: item.intentionNumber,
other_title: item.creationDate.split(' ')[0],
values: [["合同金额", "状态"], ["¥ " + (currency(item.contractAmount) || '0.00'), item.intentionStatusN]],
values: [["合同金额", "状态"], ["¥ " + (currency(item.financeAmount) || '0.00'), item.intentionStatusN]],
intentionId: item.intentionId
}
})
......@@ -48,7 +48,7 @@ const getList = async () => {
}
getList()
const refreshing = $ref(true);
let refreshing = $ref(true);
const finished = $ref(true);
const router = useRouter();
......
......@@ -51,7 +51,7 @@ const formRaw = [
title: '首付款比例',
propName: 'firstGoldRatio',
type: 'rate',
value: '6',
value: '',
isRequired: true
},
{
......@@ -104,7 +104,7 @@ const formRaw = [
const form = $ref();
let message = $ref('')
const formConfig = $ref(new AuFormClass(formRaw))
let formConfig = $ref(new AuFormClass(formRaw))
let messageDisabled = $ref(false)
let agentList = []
......@@ -121,8 +121,8 @@ const save = async () => {
for (const key in formValueObj) {
formValueObj[key] = formValueObj[key] + '';
}
console.log(formValueObj);
if (formConfig.validate()) {
let validateValue = checkValues(formValueObj);
if(validateValue) {
let res = await api.saveInfo({ remark: message, ...formValueObj, financeAmount: +formValueObj.financeAmount})
if (res.success) {
Toast.success('保存成功');
......@@ -136,59 +136,32 @@ const save = async () => {
} else {
Toast({ message: '请将信息填写完整', position: 'top' });
}
}
const handleAgent = async () => {
if (formStore.agentList.length) {
agentList = formStore.agentList
} else {
let agentRes = await api.getAgent()
if (agentRes.success) {
agentList = agentRes.rows.map(item => ({
provinceIdN: item.provinceIdN || '',
cityIdN: item.cityIdN || '',
bpName: item.bpName,
bpCode: item.bpCode,
cellPhone: item.cellPhone,
})
).map(item => {
return { text: item.provinceIdN + item.cityIdN + item.bpName, value: item.bpName, ...item }
}).sort((a, b) => (a.text.localeCompare(b.text)))
formStore.agentList = agentList;
}
}
formConfig.setFormValue('agentBpName', 'select', agentList)
}
handleAgent()
};
const getLocation = () => {
location(function (info) {
location(function (res) {
let info = JSON.parse(res);
console.log(info);
let provineReg = new RegExp(info.address.province)
let cityReg = new RegExp(info.address.city)
let temp1 = agentList.filter(item => provineReg.test(item.text));
if (temp1.length) {
if (temp1.length > 0) {
let temp2 = temp1.filter(item => cityReg.test(item.text))
if (temp2.length) {
formConfig.setFormValue('agentBpName', 'value', temp2[0].text)
if (temp2.length > 0) {
formConfig.setFormValue('agentBpName', 'value', temp2[0].value)
formConfig.setFormValue('agentPhone', 'value', temp2[0].cellPhone)
} else {
formConfig.setFormValue('agentBpName', 'value', temp1[0].text)
formConfig.setFormValue('agentBpName', 'value', temp1[0].value)
formConfig.setFormValue('agentPhone', 'value', temp1[0].cellPhone)
}
}
}, function (error) {
console.error('定位error', error)
})
}
};
const getFormVal = () => {
if (formStore.intentionData?.intentionId) {
if (formStore.intentionData.intentionId) {
formConfig.fillValues(unref(formStore.intentionData));
message = formStore.intentionData.remark;
formConfig.setAll('disabled', () => true);
......@@ -196,15 +169,64 @@ const getFormVal = () => {
} else {
getLocation()
}
}
getFormVal()
};
const handleSelect = (value) => {
console.log('选择框选择后拿到的值:', value)
if(value.type === "picker"){
formConfig.setFormValue('agentPhone', 'value', value.cellPhone)
}
};
const handleAgent = async () => {
if (formStore.agentList.length) {
agentList = formStore.agentList
} else {
let agentRes = await api.getAgent()
if (agentRes.success) {
agentList = agentRes.rows.map(item => ({
provinceIdN: item.provinceIdN || '',
cityIdN: item.cityIdN || '',
bpName: item.bpName,
bpCode: item.bpCode,
cellPhone: item.cellPhone,
})
).map(item => {
return { text: item.provinceIdN + item.cityIdN + item.bpName, value: item.bpName, ...item }
}).sort((a, b) => (a.text.localeCompare(b.text)))
formStore.agentList = agentList;
}
}
formConfig.setFormValue('agentBpName', 'select', agentList);
formConfig.watchForm("firstGoldRatio", (n, o) => {
let formValueObj = formConfig.getValues()
let financeAmount = formValueObj.financeAmount;
let firstGoldRatio = formValueObj.firstGoldRatio;
if(+firstGoldRatio > 0 && +financeAmount > 0){
let firstGold = (financeAmount * firstGoldRatio).toFixed(2)
formConfig.setFormValue("firstGold", "value", +firstGold)
}
});
getFormVal();
};
handleAgent();
const checkValues = (values) => {
if (+values.financeAmount <= 0) {
Toast({ message: '请输入正确的合同总额', position: 'top' });
return false;
} else if (values.firstGoldRatio > 1 || isNaN(+values.firstGoldRatio) || +values.firstGoldRatio < 0) {
Toast({ message: '请输入正确首付款比例', position: 'top' });
return false;
} else if (+values.firstGold <= 0) {
Toast({ message: '请输入正确的首付款金额', position: 'top' });
return false;
}
return true;
}
</script>
<style lang="less" scoped>
......
......@@ -18,6 +18,10 @@ const api = {
//违约金每日明细
getDailyLiquidatedDetail(data={}){
return post(`${baseURL}/app/api/app/day/liquidated/damages/details`, data)
},
//支付
getPay(data={}){
return post(`${baseURL}/app/api/app/repayment/payment`, data)
}
};
......
......@@ -25,13 +25,13 @@
</div>
<div class="van-cell-mode van-cell--clickable" role="button" tabindex="0" data-v-8b47ba6a="">
<div class="van-cell__title"><span>支付方式</span><!----></div>
<div class="van-cell__value_mode"><span>{{checked}}</span></div>
<div class="van-cell__value_mode"><span>{{checkArray[checked]}}</span></div>
<i class="van-badge__wrapper van-icon van-icon-arrow van-cell__right-icon"></i>
</div>
<div class="pay-money-choose" v-show="showModeFlag">
<RadioGroup v-model="checked">
<CellGroup inset>
<Cell clickable @click="checked = '云闪付(银行卡)'">
<Cell clickable @click="checked = 'UNION_PAY'">
<template #title>
<div class="alipayTitle">
<span class="custom-title mr10">
......@@ -41,10 +41,10 @@
</div>
</template>
<template #right-icon>
<Radio name="云闪付(银行卡)" />
<Radio name="UNION_PAY" />
</template>
</Cell>
<Cell clickable @click="checked = '微信支付'">
<Cell clickable @click="checked = 'WECHAT_PAY'">
<template #title>
<div class="alipayTitle">
<span class="custom-title mr10">
......@@ -54,10 +54,10 @@
</div>
</template>
<template #right-icon>
<Radio name="微信支付" />
<Radio name="WECHAT_PAY" />
</template>
</Cell>
<Cell clickable @click="checked = '支付宝'">
<Cell clickable @click="checked = 'ALI_PAY'">
<template #title>
<div class="alipayTitle">
<span class="custom-title mr10">
......@@ -67,7 +67,7 @@
</div>
</template>
<template #right-icon>
<Radio name="支付宝" />
<Radio name="ALI_PAY" />
</template>
</Cell>
</CellGroup>
......@@ -114,9 +114,19 @@
import { Popup, NavBar, Field, Cell,RadioGroup, Radio,CellGroup, Button, NumberKeyboard, Dialog, PasswordInput } from 'vant';
import {ref, reactive} from "vue";
import { pay } from '@/utils/pay';
import api from "../api";
import { Base } from '@hips/plugin-vue-jssdk';
const { openWebLink } = Base;
const props = defineProps({
visible: { type: Boolean }, // 是否打开弹框
payInfoObj: {
type: Object,
default: {
cashflowId: '',
payAmount: '',
}
},
})
const emit = defineEmits(['payMoneyClick', 'closePage'])
......@@ -126,11 +136,11 @@ const emit = defineEmits(['payMoneyClick', 'closePage'])
const showDialog = ref(false);
const show = ref(false);
const checked = ref(null);
const orderAmount = ref(null);
const orderAmount = ref(props.payInfoObj.payAmount);
const showModeFlag = ref(true);
const password = ref([]);
const showKeyboard = ref(true);
const checkArray = {UNION_PAY:'云闪付(银行卡)',WECHAT_PAY:'微信支付',ALI_PAY:'支付宝'};
const cancel = () => {
console.log('canecel')
......@@ -146,7 +156,7 @@ const onDelete = () => {
}
const payMoney = () => {
showDialog.value = true;
// showDialog.value = true;
// Dialog.alert({
// // title: '标题',
// showConfirmButton: false,
......@@ -155,14 +165,33 @@ const payMoney = () => {
// }).then(() => {
// // on close
// });
emit('closePage', false);
// emit('closePage', false);
const info = {
orderAmount: orderAmount.value,
checked: checked.value,
// payAmount: orderAmount.value,
payAmount: '0.01',
payType: checked.value,
cashflowId: props.payInfoObj.cashflowId
}
emit('payMoneyClick', info);
console.log(info)
//emit('payMoneyClick', info);
goPayApp(info)
}
const goPayApp = async (param) => {
// 下拉重置参数,重新加载
let res = await api.getPay({...param,receivets: + new Date() + '',});
console.log(res)
if(res.rows[0].qrCode){
openWebLink(res.rows[0].qrCode)
.then((res) => {console.log(res)})
.catch((err) => {console.log(err)});
}else{
Toast.fail('当前支付方式暂不支持!')
}
};
const handleFinishAmount = () => {
showDialog.value = false;
pay();
......
......@@ -25,14 +25,14 @@
</div>
<div class="right-item">
<span></span>
<span class="flag-button payment" @click="handleClick">
<span class="flag-button payment" @click="handleClick(item)">
支付
</span>
</div>
</div>
</div>
</div>
<Pay :visible="showModal" @payMoneyClick="pay" @closePage="handleColse"/>
<Pay :visible="showModal" :payInfoObj="payInfo" @payMoneyClick="pay" @closePage="handleColse"/>
<!-- <Dialog v-model:show="showDialog" title="标题" show-cancel-button z-index="2022">-->
<!-- <div>jhahha</div>-->
<!-- &lt;!&ndash; <img src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg" />&ndash;&gt;-->
......@@ -70,12 +70,13 @@ let cashflow = [
}
]
const payInfo = ref({});
let payInfo = ref({});
let showModal = ref(false);
const route = useRoute()
const handleClick = () => {
const handleClick = (item) => {
showModal.value = true
payInfo = {cashflowId:item.cashflowId,payAmount:item.obligation}
}
const handleColse = (param) => {
......@@ -83,10 +84,10 @@ const handleColse = (param) => {
}
const pay = (value) => {
console.log(value, value.showDialog);
// console.log(value, value.showDialog);
// payInfo.value = value;
showDialog.value = true;
console.log(showDialog.value)
// showDialog.value = true;
// console.log(showDialog.value)
// console.log(payInfo.value)
}
const router = useRouter();
......
<template>
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" @click-left="goBack" >
<RepayPlan navTitle="还款计划" :currencyObj="currencyObj" @onLeftClick="goBack" >
<template #list>
<div class="repay_list">
<div class="left">
......
import { get, put, post, File, deleteReq } from '@/utils/http'
const baseURL = import.meta.env.DEV ? '/api' : import.meta.env.VITE_HTTP_BASE_URL
const api = {
//列表查询
getSelfServiceList(data={}) {
......
<template>
<div class="container">
<NavBar title="授权" left-arrow @click-left="goBack" />
<Notice detail="授权该代理店后,该代理店可查看您的信息。" />
<section class="form">
<CellGroup inset>
<Field required v-model="form.contractNumber" is-link readonly label="项目编号" @click="showProjectNumber = true"
......@@ -15,11 +13,9 @@
input-align="right" />
</CellGroup>
</section>
<section class="sub">
<Button type="primary" block @click="confirm">授权</Button>
</section>
<Popup v-model:show="showProjectNumber" position="bottom">
<Picker :columns="projectNumberColumns" :columns-field-names="{text:'contractNumber', value: 'contractId'}" @confirm="projectNumberConfirm" @cancel="showProjectNumber = false" >
</Picker>
......@@ -31,7 +27,6 @@
<Popup v-model:show="showPicker" position="bottom">
<Picker :columns="agencyColumns" :columns-field-names="{text:'agencyName', value: 'agencyId'}" @confirm="agencyConfrim" @cancel="showPicker = false" >
<template #columns-top>
<!-- <Icon name="search" />-->
<Search v-model="agencyValue" placeholder="请输入搜索关键词" @click-left-icon="searchAgency" />
</template>
</Picker>
......@@ -46,10 +41,8 @@ import {NavBar, Field, CellGroup, Popup, Picker, Button, Icon, Search, Toast, Di
import api from '../api'
import { useRouter } from "vue-router";
const router = useRouter();
let showArea = $ref(false)
const form = $ref({
code: '',
contractNumber: '',
......@@ -69,15 +62,15 @@ let agencyColumns = $ref([]) ;
const agencyValue = $ref(null);
const areaPagination = {
page: 1,
size: 1000,
pageSize: 1000,
}
const agencyPagination = {
page: 1,
size: 1000,
pageSize: 1000,
}
const projectNumber = {
page: 1,
size: 1000
pageSize: 1000
}
const projectNumberConfirm = (selectValues) => {
form.contractNumber = selectValues.contractNumber;
......@@ -129,7 +122,7 @@ const confirm = async () => {
goBack()
});
}else{
Toast.fail('授权失败')
Toast.fail(res.message?res.message:'授权失败')
}
}
const getContractList = async () => {
......
<template>
<div class="container">
<NavBar title="自助服务" left-arrow @click-left="goBack" />
<section class="list">
<PullRefresh v-model="refreshing" @refresh="onRefresh" class="scroll">
<List :finished="finished" finished-text="没有更多了" @load="loadApproval">
......@@ -9,7 +8,6 @@
</List>
</PullRefresh>
</section>
<Plus @click="jump" />
</div>
</template>
......@@ -23,10 +21,6 @@ import api from "../api";
import { useRouter } from "vue-router";
let listValue = $ref([
// {
// title: '2022-07-18',
// values: [["授权对象编码", "授权对象名称", "所属区域"], ["DB001", "新疆田园技术有限公司", "西北"]]
// }
])
let pagination = { page: 1, pageSize: 10 }
......@@ -37,9 +31,8 @@ const queryList = async () => {
refreshing = true
let res = await api.getSelfServiceList({ receivets: + new Date() + '', ...pagination })
if (res.success) {
pagination.page++
if (res.total == 0) finished = true
if (res.success && res.total > 0) {
if(res.total > 10){finished = false}
res.rows.forEach(item => {
listValue.push({
title: item.authDate.split(' ')[0] + '' || '',
......@@ -50,7 +43,6 @@ const queryList = async () => {
} else {
finished = true
}
refreshing = false
}
queryList()
......@@ -61,7 +53,7 @@ const onRefresh = () => {
listValue = [];
pagination.page = 1;
pagination.pageSize = 10;
finished = false
finished = true
queryList()
};
......
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