Commit 41740e43 authored by WangRui's avatar WangRui

Merge branch 'master' of https://hel.hand-china.com/komatsu/komatsu-lease-app

 Conflicts:
	src/modules/selfService/views/authorize.vue
parents d1ac4d2c 2aa3ce52
......@@ -148,6 +148,7 @@ function placeHolder(value, type, item = {}) {
function chooser(formItem) {
if (formItem.disabled) return
nowItem.value = formItem
console.log(Object.prototype.toString.call(formItem.select) === '[object Object]');
if (formItem.select === 'date') {
typeShowDate.value = true
......
......@@ -85,7 +85,7 @@ export default class AuFormClass {
fillValues(obj = {}) {
this.form.forEach(item => {
if (item.propName in obj) {
let outSideValue = obj[item.propName]
let outSideValue = obj[item.propName] || ""
if (item.select === 'date') {
item.value = outSideValue ? iosDateFormat(outSideValue).toLocaleDateString() : ''
......@@ -126,7 +126,7 @@ export default class AuFormClass {
}
// 清空表单的值
clearFrom() {
clearForm() {
this.form = this.form.map(item => {
let value = ''
if (item.type === 'checkGroup') value = []
......@@ -163,7 +163,7 @@ export default class AuFormClass {
}
// 用正则表达式检验
if (item.reg && !item.validateRes) {
if (item.reg && !item.validateRes && value ) {
let res = item.reg.test(value)
if (!res) item.validateRes = true
}
......
......@@ -106,14 +106,19 @@ const updateForm = async () => {
return item;
}))
}
} else if(planStore.planData?.isComputed) {
} else {
formConfig.replace(formConfigArr.map(item => {
if (item.propName !== "repayment") {
if (['firstGoldRatio', 'priceOfItem', 'term'].includes(item.propName)) {
item.value = 0;
} else if (['contractRate', 'firstRentDay'].includes(item.propName)) {
} else if (['firstRentDay'].includes(item.propName)) {
item.value = '';
} else if (item.propName === "repayment") {
} else if (item.propName === "contractRate") {
item.value = '6'
}
else if (item.propName === "repayment") {
item.value = '均等还款'
}
item.disabled = false;
......@@ -169,6 +174,7 @@ const getResult = (formValueObj) => {
}
planStore.planData = {
isComputed: true,
firstGold: firstGold.toFixed(2) + "",
financeAmount: financeAmount.toFixed(2) + "",
cashflow,
......
......@@ -11,14 +11,14 @@
<div class="item" v-for="item in plan.cashflow">
<div class="item-head">
<span>租金</span>
<span>{{ item.dueAmount }}</span>
<span>{{ currency(item.dueAmount) }}</span>
<span>{{ item.chargeDueDate }}</span>
</div>
<div class="item-foot">
<span>本金</span>
<span>{{ item.principal }}</span>
<span>{{ currency(item.principal) }}</span>
<span>利息</span>
<span>{{ item.interest }}</span>
<span>{{ currency(item.interest) }}</span>
</div>
</div>
</div>
......@@ -31,6 +31,7 @@
</template>
<script setup>
import { currency } from "@/utils/textFormat"
import RepayPlan from '@/components/RepayPlan.vue'
import { Button, Toast } from "vant";
import { onActivated } from 'vue';
......@@ -47,9 +48,9 @@ const getPlan = () => {
plan = planStore.planData;
isComplete = plan.isComplete;
currencyObj = {
financingCurrency: plan.financeAmount,
headerCurrency: plan.firstGold,
fristCurrency: plan.cashflow[0].dueAmount,
financingCurrency: currency(plan.financeAmount) ,
headerCurrency: currency(plan.firstGold),
fristCurrency: currency(plan.cashflow[0].dueAmount),
times: plan.cashflow.length
}
}
......@@ -183,9 +184,9 @@ const backToLast = () => {
</style>
<route>
{
meta: {
keepAlive: true
}
{
meta: {
keepAlive: true
}
</route>
\ No newline at end of file
}
</route>
\ No newline at end of file
......@@ -18,10 +18,12 @@
<section class="form-area">
<AuForm v-model="formConfig" :key="form" />
<Field class="message" v-model="suggestInformation" rows="2" :autosize="{ minHeight: 100 }" label="投诉与建议"
type="textarea" maxlength="300" placeholder="请输入你的宝贵意见(最多300字)" show-word-limit />
</section>
<section class="sub">
<Button @click="save" type="primary" block>确认</Button>
<Button @click="save" type="primary" block>提交</Button>
</section>
</div>
</div>
......@@ -38,31 +40,39 @@ const form = $ref();
const formConfig = $ref(new AuFormClass([
{
title: '您的姓名',
propName: 'paymentReqDate',
propName: 'bpName',
type: 'input',
value: '',
isRequired: true
},
{
title: '合同编号',
propName: 'paymentReqDat3e',
propName: 'contractNumber',
type: 'input',
value: '',
isRequired: false
},
{
title: '物件机号',
propName: 'machineNumber',
type: 'input',
value: '',
isRequired: false
},
{
title: '联系方式',
propName: 'paymentReqDat3e',
propName: 'userPhoneNumber',
type: 'input',
value: '',
isRequired: true
}
]))
const suggestInformation = $ref('')
const save = async () => {
if (formConfig.validate()) {
if (formConfig.validate() && suggestInformation.trim().length) {
let formObj = formConfig.getValues();
let res = await api.commit(formObj)
let res = await api.commit({suggestInformation, ...formObj})
if (res.success) {
Toast.success('提交成功!感谢您的反馈')
setTimeout(() => {
......@@ -104,6 +114,26 @@ const save = async () => {
text-indent: 2em;
}
}
.message {
flex-direction: column;
}
:deep(.message label) {
color: #323233;
}
:deep(.message textarea) {
border: 1px solid #f1f1f1;
}
:deep(.message .van-cell__value) {
margin-top: 7px;
}
:deep(.message .van-cell__title::before) {
content: '*';
color: red;
}
</style>
<route>
......
......@@ -3,7 +3,7 @@ import { post } from '@/utils/http'
const baseURL = import.meta.env.DEV ? '/api' : import.meta.env.VITE_HTTP_BASE_URL
const api = {
// 客户信息变更申请按钮
// 客户信息变更申请按钮
changeApprove(data = {}) {
return post(`${baseURL}/app/api/app/master/change/request/approve`, { ...data, userId: window.localStorage.getItem('userId') })
},
......@@ -15,6 +15,10 @@ const api = {
changeQuery() {
return post(`${baseURL}/app/api/app/master/change/query`, { userId: window.localStorage.getItem('userId') })
},
// 明细
requestDetail(data) {
return post(`${baseURL}/app/api/app/master/change/request/detail`, data)
},
};
export default api;
<template>
<div class="container">
<NavBar title="客户信息变更" left-arrow @click-left="goBack" />
<NavBar title="客户信息变更" left-arrow @click-left="goLastPage" />
<div class="content">
<section class="form-area" v-if="!isOpenConfig">
......@@ -22,14 +22,15 @@
</section>
<section class="sub">
<Button type="primary" v-if="!readonly" block @click="buttonClick">{{ isOpenConfig ? "下一步" : "申请" }}</Button>
<Button type="primary" v-if="!readonly" block @click="buttonClick">{{ isOpenConfig? "下一步": "申请" }}</Button>
</section>
</div>
</div>
</div>
</template>
<script setup>
import { goBack } from "@/utils/globalFun"
import nation from "@/utils/nation"
import { NavBar, Button, Field, Tab, Tabs, Toast } from "vant";
import AuForm from '@/components/AuForm.vue';
import AuFormClass from "@/components/useAuForm";
......@@ -46,17 +47,20 @@ console.log("目前维护的数据", infoChangeStore.data);
const route = useRoute()
const readonly = $ref(false)
const isOpenConfig = $ref(true);
const isNew = $ref(true)
const getMode = () => {
console.log(route.query);
if (route.query.isReturn === "false") {
isOpenConfig = false
readonly = true
isNew = false
} else if (route.query.isReturn === "true") {
isOpenConfig = false
readonly = false
isNew = false
} else {
isOpenConfig = true
isNew = true
}
}
getMode()
......@@ -72,7 +76,7 @@ const addressFormConfig = $ref(new AuFormClass([
propName: 'addressType',
type: 'cell',
value: '',
isRequired: true,
isRequired: false,
select: [
{
text: "通讯地址",
......@@ -101,7 +105,7 @@ const addressFormConfig = $ref(new AuFormClass([
propName: 'area',
type: 'cell',
value: '',
isRequired: true,
isRequired: false,
select: areaList
},
{
......@@ -132,6 +136,14 @@ const addressFormConfig = $ref(new AuFormClass([
value: '',
isRequired: false,
reg: phoneReg
},
{
title: '居住状况',
propName: 'refV02',
type: 'cell',
value: '',
isRequired: false,
select: ["自置", "按揭", "亲属楼宇", "集体宿舍", "租房", "共有住宅", "其他"].map((item, index) => { return { text: item, value: index + 1 + "" } })
}
], { disabled: readonly }))
const contactPersonConfig = $ref(new AuFormClass([
......@@ -140,7 +152,7 @@ const contactPersonConfig = $ref(new AuFormClass([
propName: 'contactType',
type: 'cell',
value: '',
isRequired: true,
isRequired: false,
select: [
{
text: "主联系人",
......@@ -157,14 +169,35 @@ const contactPersonConfig = $ref(new AuFormClass([
propName: 'contactPerson',
type: 'input',
value: '',
isRequired: true,
isRequired: false,
},
{
title: '联系人关系',
propName: 'contractRelationship',
type: 'cell',
value: '',
isRequired: false,
select: [
"本人",
"配偶",
"子",
"女",
"孙子",
"孙女(外孙子、外孙女)",
"父母",
"祖父母和外祖父母",
"兄、弟、姐、妹",
"其他",
"合同经办人 ",
"合伙人",
].map((e, i) => ({ text: e, value: i + 1 + "" }))
},
{
title: '职务',
propName: 'position',
type: 'cell',
value: '',
isRequired: true,
isRequired: false,
select: [
{
text: "高级领导",
......@@ -189,7 +222,7 @@ const contactPersonConfig = $ref(new AuFormClass([
propName: 'idType',
type: 'cell',
value: '',
isRequired: true,
isRequired: false,
select: [
{
text: "户口薄",
......@@ -242,14 +275,46 @@ const contactPersonConfig = $ref(new AuFormClass([
propName: 'idCardNo',
type: 'input',
value: '',
isRequired: true,
isRequired: false,
},
{
title: '性别',
propName: 'gender',
type: 'cell',
value: '',
isRequired: false,
select: [
{
value: 'FEMALE',
text: '男'
},
{
value: 'MALE',
text: '女'
},
]
},
{
title: '民族',
propName: 'nation',
type: 'cell',
value: '',
isRequired: false,
select: nation
},
{
title: '电话',
propName: 'phone',
type: 'input',
value: '',
isRequired: true,
isRequired: false,
},
{
title: '手机',
propName: 'cellPhone',
type: 'input',
value: '',
isRequired: false,
reg: phoneReg
},
{
......@@ -295,17 +360,21 @@ const middleConfig = $ref(new AuFormClass([
const bpObj = $ref({})
const fillForm = () => {
addressFormConfig.fillValues(infoChangeStore.data)
contactPersonConfig.fillValues(infoChangeStore.data)
contactPersonConfig.fillValues(infoChangeStore.data)
if (isNew) {
addressFormConfig.clearForm()
contactPersonConfig.clearForm()
} else {
addressFormConfig.fillValues(infoChangeStore.data.hlsBpMasterAddress)
contactPersonConfig.fillValues(infoChangeStore.data.hlsBpMasterContactInfo)
}
}
onMounted(() => {
fillForm()
})
const queryPrj = async () => {
if (!isNew) return
let res = await api.contractNumber()
if (res.success && res.rows.length) {
......@@ -325,7 +394,6 @@ const queryPrj = async () => {
middleConfig.watchForm("itemProjectNumber", (n, o) => {
let obj = select.find(item => item.value === n)
if (obj.value) {
console.log(obj);
bpObj.bpClass = obj.bpClass
bpObj.bpId = obj.bpId
bpObj.bpStatus = obj.bpStatus
......@@ -337,7 +405,6 @@ const queryPrj = async () => {
queryPrj()
const submit = async () => {
let obj1 = middleConfig.getValues()
let obj2 = addressFormConfig.getValues()
let obj3 = contactPersonConfig.getValues()
let provinceId = obj2.area
......@@ -346,20 +413,46 @@ const submit = async () => {
let params = { hlsBpMasterAddress: { ...obj2, refV01, provinceId, cityId, districtId }, hlsBpMasterContactInfo: { ...obj3, remark }, ...bpObj }
// 地址差个手机
let res = await api.changeApprove(params)
if (res.success) {
Toast.success('提交成功')
setTimeout(() => {
goBack()
}, 2000);
} else {
Toast.fail(res.message)
}
}
const NextStepWork = () => {
isOpenConfig = false
// 定义 必填选项
if (bpObj.bpClass === "ORG") {
addressFormConfig.setAll("isRequired", (item) => ["area", "address", "cellPhone", "refV02"].includes(item.propName))
contactPersonConfig.setAll("isRequired", (item) => ["contactType", "contactPerson", "idType",
"idCardNo", "cellPhone", "contractRelationship"].includes(item.propName))
} else {
addressFormConfig.setAll("isRequired", (item) => ["area", "address", "cellPhone"].includes(item.propName))
contactPersonConfig.setAll("isRequired", (item) => ["contactType", "contactPerson", "idType",
"idCardNo", "cellPhone", "position"].includes(item.propName))
}
}
const buttonClick = () => {
if (isOpenConfig && middleConfig.validate()) {
isOpenConfig = false
NextStepWork()
} else if (!isOpenConfig && !readonly && addressFormConfig.validate() && contactPersonConfig.validate()) {
submit()
} else {
Toast.fail('请将数据填写完整')
}
}
const goLastPage = () => {
if (!isNew || isOpenConfig) goBack()
isOpenConfig = true
}
</script>
......
......@@ -16,7 +16,7 @@
<script setup>
import { goBack } from "@/utils/globalFun"
import { NavBar, List, PullRefresh } from "vant";
import { NavBar, List, PullRefresh, Toast } from "vant";
import ChangeListItem from '../components/ChangeListItem.vue'
import Plus from '@/components/Plus.vue'
import api from "../api";
......@@ -37,7 +37,7 @@ let queryList = async () => {
res.rows.forEach(item => {
infos.push({
id: item.changeReqNumber,
applyDate: item.creationDate,
applyDate: item.creationDate?.split(' ')[0],
status: item.reqStatusN,
...item
})
......@@ -59,15 +59,31 @@ const loadApproval = () => {
const router = useRouter();
const jump = (item) => {
infoChangeStore.data = item
const getDetail = async (item) => {
let res = await api.requestDetail({ bpClass: item.bpClass, changeReqId: item.changeReqId })
if (res.success && res.rows.length && res.rows[0].hlsBpMasterAddress.length) {
let hlsBpMasterAddress = res.rows[0].hlsBpMasterAddress[0]
hlsBpMasterAddress.area = hlsBpMasterAddress.countryIdN + hlsBpMasterAddress.provinceIdN + hlsBpMasterAddress.cityIdN
let hlsBpMasterContactInfo = res.rows[0].hlsBpMasterContactInfo[0]
return { hlsBpMasterAddress, hlsBpMasterContactInfo }
} else {
Toast.fail('获取信息详情失败')
return {}
}
}
const jump = async (item) => {
// 申请中/审批通过时申请页面为只读
// 审批退回时可再次维护并重新提交
if (item.reqStatus && item.reqStatus === 'RETURN') {
router.push({ path: '/infochange/views/changeform', query: { isReturn: true } })
infoChangeStore.data = await getDetail(item)
if (infoChangeStore.data.hlsBpMasterAddress)
router.push({ path: '/infochange/views/changeform', query: { isReturn: true } })
} else if (item.reqStatus && item.reqStatus !== 'RETURN') {
router.push({ path: '/infochange/views/changeform', query: { isReturn: false } })
infoChangeStore.data = await getDetail(item)
if (infoChangeStore.data.hlsBpMasterAddress)
router.push({ path: '/infochange/views/changeform', query: { isReturn: false } })
} else {
router.push({ path: '/infochange/views/changeform', query: {} })
}
......
......@@ -45,7 +45,7 @@ const queryList = async () => {
if (res.total == 0) finished = true
res.rows.forEach(item => {
listValue.push({
title: item.contractId + '' || '',
title: item.contractNumber + '' || '',
other_title: item.acceptDate || '',
values: [["机型", "机号", "状态", "代理店"], [item.model, item.machineNumber, item.contractStatus, item.agencyName]],
...item
......
......@@ -69,11 +69,12 @@ let agencyColumns = $ref([]) ;
const agencyValue = $ref(null);
const areaPagination = {
page: 1,
size: 100,
size: 1000,
}
const agencyPagination = {
page: 1,
size: 100,
size: 1000,
pageSize: 1000
}
const projectNumber = {
page: 1,
......@@ -124,7 +125,8 @@ const confirm = async () => {
Toast.success('授权成功')
// router.push({ name: 'selfService-views-index' })
}else{
Toast.fail('授权失败')
Toast.fail("授权失败,原因如下:", res.message)
console.error("授权失败:", res.message)
}
}
const getContractList = async () => {
......
......@@ -73,9 +73,9 @@ async function loadWebUrl(url) {
var args = {
className: "WebViewBridge",
function: "loadWebView",
params: {
params: {
url,
encode:1
encode: 1
},
successCallBack,
failCallBack
......@@ -98,7 +98,7 @@ export async function Copy(value, message) {
// 使用相机拍摄 参数: 允许编辑, 图片形状 (1:矩形,2:正方形, 0,圆)
export async function toCamera(allowEdit = true, targetSharp = 1) {
let res = await captureImage({
allowEdit:false,
allowEdit: false,
})
return res
}
......@@ -145,7 +145,11 @@ export async function HlpsUpload(source, target, headers, successCb) {
// 判断还有可返回的路由吗? 无则退出
export const goBack = (isExit = false) => {
if (window.history.state.position > 0 && !isExit) return window.history.back();
if (Object.prototype.toString.call(isExit) === "[object PointerEvent]") isExit = false
if (window.history.state.position > 0 && !isExit) {
window.history.back();
return
}
// 海马汇退出子应用方法
let args = {
......
export default [
"汉族",
"蒙古族",
"回族",
"藏族",
"维吾尔族",
"苗族",
"彝族",
"壮族",
"布依族",
"朝鲜族",
"满族",
"侗族",
"瑶族",
"白族",
"土家族",
"哈尼族",
"哈萨克族",
"傣族",
"黎族",
"傈僳族",
"佤族",
"畲族",
"高山族",
"拉祜族",
"水族",
"东乡族",
"纳西族",
"景颇族",
"柯尔克孜族",
"土族",
"达斡尔族",
"仫佬族",
"羌族",
"布朗族",
"撒拉族",
"毛难族",
"仡佬族",
"锡伯族",
"阿昌族",
"普米族",
"塔吉克族",
"怒族",
"乌孜别克族",
"俄罗斯族",
"鄂温克族",
"崩龙族",
"保安族",
"裕固族",
"京族",
"塔塔尔族",
"独龙族",
"鄂伦春族",
"赫哲族",
"门巴族",
"珞巴族",
"基诺族",
].map((e, i) => ({
text: e,
value: (i+1) < 10 ? "0" + (i+1) : (i+1) + ""
}))
\ No newline at end of file
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