Commit 64315cf4 by cwq0219

虚拟对公账号-详情;菜单图标

1 parent 986aaa82
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-09-01 19:06:01 * @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2021-04-17 14:47:03 * @Last Modified time: 2021-04-22 09:44:44
*/ */
export const TYPE_NAME = 'confType' export const TYPE_NAME = 'confType'
...@@ -184,7 +184,7 @@ export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minVal ...@@ -184,7 +184,7 @@ export function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minVal
numReg: /^[1-9]\d*$/ numReg: /^[1-9]\d*$/
} }
regRule = regRule || 'priceReg' regRule = regRule || 'priceReg'
if (newValue && (minValue && (newValue < minValue)) || (maxValue && (newValue > maxValue))) { if (newValue && ((minValue && (newValue < minValue)) || (maxValue && (newValue > maxValue)))) {
return oldValue || '' return oldValue || ''
} }
if (newValue && reg[regRule].test(newValue + '')) { if (newValue && reg[regRule].test(newValue + '')) {
......
...@@ -5,7 +5,7 @@ export function elMenuItem(createElement, menu) { ...@@ -5,7 +5,7 @@ export function elMenuItem(createElement, menu) {
createElement('i', { attrs: { class: `el-icon-${menu.icon}` } }) createElement('i', { attrs: { class: `el-icon-${menu.icon}` } })
] : [], ] : [],
...menu.icon === undefined & !menu.iconSvg ? [ ...menu.icon === undefined & !menu.iconSvg ? [
createElement('img', { attrs: { src: '../menuIcon/' + menu.path.slice(1) + '.png' } }) createElement('img', { attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } })
] : [], ] : [],
...menu.iconSvg ? [ ...menu.iconSvg ? [
createElement('d2-icon-svg', { props: { name: menu.iconSvg } }) createElement('d2-icon-svg', { props: { name: menu.iconSvg } })
...@@ -21,7 +21,7 @@ export function elSubmenu(createElement, menu) { ...@@ -21,7 +21,7 @@ export function elSubmenu(createElement, menu) {
createElement('i', { slot: 'title', attrs: { class: `el-icon-${menu.icon}` } }) createElement('i', { slot: 'title', attrs: { class: `el-icon-${menu.icon}` } })
] : [], ] : [],
...menu.icon === undefined & !menu.iconSvg ? [ ...menu.icon === undefined & !menu.iconSvg ? [
createElement('img', { slot: 'title', attrs: { src: '../menuIcon/' + menu.path.slice(1) + '.png' } }) createElement('img', { slot: 'title', attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } })
] : [], ] : [],
...menu.iconSvg ? [ ...menu.iconSvg ? [
createElement('d2-icon-svg', { slot: 'title', props: { name: menu.iconSvg } }) createElement('d2-icon-svg', { slot: 'title', props: { name: menu.iconSvg } })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<template> <template>
<div class="account-detail"> <div class="account-detail">
<el-form <el-form
:model="detailForm" :model="merchantRow"
label-width="190px" label-width="190px"
> >
<p class="edit-sub-title">账户信息</p> <p class="edit-sub-title">账户信息</p>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
label="客户名称:" label="客户名称:"
prop="name" prop="name"
> >
<span>{{detailForm.merchantName}}</span> <span>{{merchantRow.merchantName}}</span>
</el-form-item> </el-form-item>
<p class="edit-sub-title">申请资料</p> <p class="edit-sub-title">申请资料</p>
<block <block
...@@ -18,17 +18,20 @@ ...@@ -18,17 +18,20 @@
:key="index" :key="index"
> >
<el-form-item <el-form-item
v-if="item.showAttrList ? item.showAttrList.includes(detailForm.custType) : true"
:label="item.label + ':'" :label="item.label + ':'"
:prop="item.prop" :prop="item.prop"
> >
<span v-if="item.type === 'img'"> <span v-if="item.type === 'image'">
<img <img
v-for="(subItem, subIdx) in item.imgList"
:key="subIdx"
class="detail-img" class="detail-img"
src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=270411355,4161548721&fm=26&gp=0.jpg" :src="detailForm.papersList[imgToAttr[subItem]]"
> >
</span> </span>
<span v-else-if="item.formatter">{{item.formatter(item)}}</span> <span v-else-if="item.formatter">{{item.formatter(item)}}</span>
<span v-else>{{applyForm[item.prop]}}</span> <span v-else>{{detailForm[item.prop]}}</span>
</el-form-item> </el-form-item>
</block> </block>
</el-form> </el-form>
...@@ -41,64 +44,69 @@ export default { ...@@ -41,64 +44,69 @@ export default {
name: 'accountDetail', name: 'accountDetail',
data() { data() {
return { return {
applyForm: {}, detailForm: {},
// formNameList: [ // 图片对于字段
// 'custType', imgToAttr: {
// 'anotherName', idCard: '00',
// 'busAddress', idCardBack: '30',
// 'legalName', bankCard: '35',
// 'legalCertNo', bankCardBack: '36',
// 'legalCertDate', clientAgreement: '31',
// 'legalTel', doorHead: '34',
// 'contactsName', businessPremiese: '50',
// 'contactsPhone', businessPremieseTwo: '51',
// 'contactsEmail', businessLicense: '19',
// 'bankAccountType', accountLicenese: '37'
// 'bankAccountNo', },
// 'bankAccountName',
// 'bankTelephoneNo',
// 'bankName',
// 'branchBankName',
// 'operPhone',
// 'busLicenceName',
// 'busLicense',
// 'busLicenseDate',
// 'contactsAddr',
// 'busLicenseStartDate',
// 'busLicenseExpire'
// ],
formList: [{ formList: [{
label: '商户类型', label: '商户类型',
prop: 'custType' prop: 'custType',
formatter: () => {
return {
'O': '小微商户',
'C': '个体商户',
'B': '企业商户'
}[this.detailForm.custType]
}
}, { }, {
label: '营业执照全称', label: '营业执照全称',
prop: 'busLicenceName' prop: 'busLicenceName',
// 根据currentPage不同,展示/隐藏
showAttrList: ['C', 'B']
}, { }, {
label: '营业执照号码', label: '营业执照号码',
prop: 'busLicense' prop: 'busLicense',
// 根据currentPage不同,展示/隐藏
showAttrList: ['C', 'B']
}, { }, {
label: '营业执照', label: '营业执照',
prop: 'businessLicense', prop: 'businessLicense',
type: 'img' type: 'image',
// 根据currentPage不同,展示/隐藏
showAttrList: ['C', 'B']
}, { }, {
label: '营业执照有效期', label: '营业执照有效期',
prop: 'busLicenseDate', prop: 'busLicenseDate',
// 根据currentPage不同,展示/隐藏
showAttrList: ['C', 'B'],
formatter: () => { formatter: () => {
return this.applyForm.busLicenseStartDate + '~' + this.applyForm.busLicenseExpire return this.detailForm.busLicenseStartDate + '~' + this.detailForm.busLicenseExpire
} }
}, { }, {
label: '商户名称', label: '商户名称',
prop: 'anotherName' prop: 'anotherName'
}, { }, {
label: '企业注册地址', label: '企业注册地址',
prop: 'companyAddr' prop: 'companyAddr',
// 根据currentPage不同,展示/隐藏
showAttrList: ['B']
}, { }, {
label: '企业营业地址', label: '企业营业地址',
prop: 'busAddress' prop: 'busAddress'
}, { }, {
label: '法人身份证正反面', label: '法人身份证正反面',
prop: '', imgList: ['idCard', 'idCardBack'],
type: 'img' type: 'image'
}, { }, {
label: '法人姓名', label: '法人姓名',
prop: 'legalName' prop: 'legalName'
...@@ -109,7 +117,7 @@ export default { ...@@ -109,7 +117,7 @@ export default {
label: '身份证有效期', label: '身份证有效期',
prop: '', prop: '',
formatter: () => { formatter: () => {
return this.applyForm.legalCertStartDate + '~' + this.applyForm.legalCertExpire return this.detailForm.legalCertStartDate + '~' + this.detailForm.legalCertExpire
} }
}, { }, {
label: '法人手机号', label: '法人手机号',
...@@ -122,27 +130,36 @@ export default { ...@@ -122,27 +130,36 @@ export default {
prop: 'contactsPhone' prop: 'contactsPhone'
}, { }, {
label: '提现人地址', label: '提现人地址',
prop: 'contactsAddr' prop: 'contactsAddr',
showAttrList: ['C', 'B']
}, { }, {
label: '提现人邮箱', label: '提现人邮箱',
prop: 'contactsEmail' prop: 'contactsEmail'
}, { }, {
label: '银行卡账户类型', label: '银行卡账户类型',
prop: 'bankAccountType' prop: 'bankAccountType',
formatter: () => {
return {
'corporate': '对公账户',
'personal': '对私账户'
}[this.detailForm.bankAccountType]
}
}, { }, {
label: '开户许可证/印鉴卡', label: '开户许可证/印鉴卡',
prop: '', imgList: ['accountLicenese'],
type: 'img' type: 'image',
// 根据currentPage不同,展示/隐藏
showAttrList: ['B']
}, { }, {
label: '结算银行卡正反面照', label: '结算银行卡正反面照',
prop: '', imgList: ['bankCard', 'bankCardBack'],
type: 'img' type: 'image'
}, { }, {
label: '结算银行卡开户行', label: '结算银行卡开户行',
prop: 'bankName' prop: 'bankName'
}, { }, {
label: '开户支行', label: '开户支行',
prop: 'branchBankName' prop: 'openAccBankName'
}, { }, {
label: '结算银行卡号', label: '结算银行卡号',
prop: 'bankAccountNo' prop: 'bankAccountNo'
...@@ -154,16 +171,16 @@ export default { ...@@ -154,16 +171,16 @@ export default {
prop: 'bankTelephoneNo' prop: 'bankTelephoneNo'
}, { }, {
label: '客户协议书', label: '客户协议书',
prop: '', imgList: ['clientAgreement'],
type: 'img' type: 'image'
}, { }, {
label: '门头照', label: '门头照',
prop: '', imgList: ['doorHead'],
type: 'img' type: 'image'
}, { }, {
label: '经营场所图', label: '经营场所图',
prop: '', imgList: ['businessPremiese', 'businessPremieseTwo'],
type: 'img' type: 'image'
}, { }, {
label: '操作人手机号', label: '操作人手机号',
prop: 'operPhone' prop: 'operPhone'
...@@ -176,7 +193,7 @@ export default { ...@@ -176,7 +193,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
detailForm: { merchantRow: {
type: Object, type: Object,
default: () => { } default: () => { }
} }
...@@ -185,14 +202,14 @@ export default { ...@@ -185,14 +202,14 @@ export default {
watch: { watch: {
accountDetailVisible(newVal) { accountDetailVisible(newVal) {
if (newVal) { if (newVal) {
this.merchantId = this.detailForm.merchantId this.merchantId = this.merchantRow.merchantId
this.getDetail() this.getDetail()
} }
} }
}, },
mounted() { mounted() {
this.merchantId = this.detailForm.merchantId this.merchantId = this.merchantRow.merchantId
this.getDetail() this.getDetail()
}, },
...@@ -200,28 +217,15 @@ export default { ...@@ -200,28 +217,15 @@ export default {
getDetail() { getDetail() {
getDetailApi({ merchantId: this.merchantId }).then(res => { getDetailApi({ merchantId: this.merchantId }).then(res => {
console.log(res) console.log(res)
this.applyForm = _.cloneDeep({ this.detailForm = _.cloneDeep({
...res.bankInfo, ...res.bankInfo,
...res.serviceMerchant, ...res.serviceMerchant,
...res.yseMerchantInfo ...res.yseMerchantInfo,
papersList: {}
})
res.papersList.forEach(item => {
this.detailForm.papersList[item.papersType] = item.imgUrl
}) })
// 身份证有效期
// if (res.yseMerchantInfo.legalCertStartDate && res.yseMerchantInfo.legalCertExpire) {
// const startDate = res.yseMerchantInfo.legalCertStartDate
// const endDate = res.yseMerchantInfo.legalCertStartDate
// this.$set(this.applyForm, 'legalCertDate', [startDate.slice(0, 4) + '-' + startDate.slice(4, 6) + '-' + startDate.slice(6), endDate.slice(0, 4) + '-' + endDate.slice(4, 6) + '-' + endDate.slice(6)])
// }
// 图片恢复
// var picKeys = Object.keys(this.picObj)
// var keytoPic = {}
// picKeys.forEach(item => {
// keytoPic[this.picObj[item].attrName] = item
// })
// res.papersList.forEach(item => {
// this.applyForm.papers[item.papersType] = item.imgUrl
// this.picObj[keytoPic[item.papersType]].url = item.imgUrl
// })
console.log(this.applyForm)
}) })
} }
} }
...@@ -230,11 +234,13 @@ export default { ...@@ -230,11 +234,13 @@ export default {
</script> </script>
<style scoped> <style scoped>
.account-detail .detail-img { .account-detail .detail-img {
width: 140px; width: 137px;
transition: width 0.5s; height: 90px;
transition: width 0.2s;
cursor: pointer; cursor: pointer;
} }
.account-detail .detail-img:hover { .account-detail .detail-img:hover {
width: 100%; width: 50%;
height: 50%;
} }
</style> </style>
...@@ -46,7 +46,10 @@ ...@@ -46,7 +46,10 @@
@confirmDialog="handleDetailClose" @confirmDialog="handleDetailClose"
@closeDialog="handleDetailClose" @closeDialog="handleDetailClose"
> >
<account-detail :accountDetailVisible="accountDetailVisible" :detailForm="detailForm"></account-detail> <account-detail
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"
></account-detail>
</d2-dialog> </d2-dialog>
</d2-container> </d2-container>
</template> </template>
...@@ -63,7 +66,7 @@ export default { ...@@ -63,7 +66,7 @@ export default {
return { return {
// 账户详情 // 账户详情
accountDetailVisible: false, accountDetailVisible: false,
detailForm: {}, merchantRow: {},
// 搜索 // 搜索
searchForm: { searchForm: {
merchantType: '', merchantType: '',
...@@ -191,7 +194,7 @@ export default { ...@@ -191,7 +194,7 @@ export default {
handleApply(cellValue) { handleApply(cellValue) {
// 查看详情 // 查看详情
if (cellValue.accountStatus === 3) { if (cellValue.accountStatus === 3) {
this.detailForm = cellValue this.merchantRow = cellValue
this.handleDetailClose() this.handleDetailClose()
return true return true
} }
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
@handleDraft="handleDraft" @handleDraft="handleDraft"
@handleCancel="handleCancel" @handleCancel="handleCancel"
> >
<span style="display: inline-block;color: red; margin: 10px 54px;" slot="failMessage">{{failMessage}}</span> <span
style="display: inline-block;color: red; margin: 10px 54px;"
slot="failMessage"
>{{failMessage}}</span>
<span <span
slot="custType" slot="custType"
slot-scope="scope" slot-scope="scope"
...@@ -338,8 +341,6 @@ export default { ...@@ -338,8 +341,6 @@ export default {
}, { }, {
label: '企业营业地址', label: '企业营业地址',
name: 'busAddress', name: 'busAddress',
// 根据currentPage不同,展示/隐藏
// showAttrList: ['B'],
type: 'input', type: 'input',
rules: [{ required: true, message: '请输入企业营业地址', trigger: 'change' }] rules: [{ required: true, message: '请输入企业营业地址', trigger: 'change' }]
}, },
...@@ -419,7 +420,6 @@ export default { ...@@ -419,7 +420,6 @@ export default {
}, { }, {
label: '结算银行卡正反面照', label: '结算银行卡正反面照',
name: 'bankCard', name: 'bankCard',
// showAttrList: ['O', 'C'],
otherName: 'bankCardBack', otherName: 'bankCardBack',
type: 'image', type: 'image',
slotName: 'bankCard', slotName: 'bankCard',
...@@ -427,7 +427,6 @@ export default { ...@@ -427,7 +427,6 @@ export default {
}, { }, {
label: '结算银行卡开户行', label: '结算银行卡开户行',
name: 'bankType', name: 'bankType',
// showAttrList: ['O', 'C'],
rules: [{ required: true, message: '请选择结算银行卡', trigger: 'change' }], rules: [{ required: true, message: '请选择结算银行卡', trigger: 'change' }],
type: 'select', type: 'select',
optionId: 'bankType', optionId: 'bankType',
...@@ -465,20 +464,17 @@ export default { ...@@ -465,20 +464,17 @@ export default {
label: '结算银行卡号', label: '结算银行卡号',
name: 'bankAccountNo', name: 'bankAccountNo',
type: 'input', type: 'input',
// showAttrList: ['O', 'C'],
rules: [{ required: true, message: '请输入结算银行卡号', trigger: 'change' }] rules: [{ required: true, message: '请输入结算银行卡号', trigger: 'change' }]
}, { }, {
label: '结算银行卡用户名', label: '结算银行卡用户名',
name: 'bankAccountName', name: 'bankAccountName',
type: 'input', type: 'input',
// showAttrList: ['O', 'C'],
rules: [{ required: true, message: '请输入结算银行卡用户名', trigger: 'change' }] rules: [{ required: true, message: '请输入结算银行卡用户名', trigger: 'change' }]
}, { }, {
label: '银行预留手机号', label: '银行预留手机号',
name: 'bankTelephoneNo', name: 'bankTelephoneNo',
type: 'input', type: 'input',
maxlength: '11', maxlength: '11',
// showAttrList: ['O', 'C'],
rules: [{ required: true, message: '请输入银行预留手机号', trigger: 'change' }] rules: [{ required: true, message: '请输入银行预留手机号', trigger: 'change' }]
}, { }, {
label: '客户协议书', label: '客户协议书',
...@@ -560,55 +556,57 @@ export default { ...@@ -560,55 +556,57 @@ export default {
getDetail() { getDetail() {
getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => { getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => {
console.log(res) console.log(res)
this.custType = res.yseMerchantInfo.custType if (res.yseMerchantInfo) {
this.markCustType = res.yseMerchantInfo.custType this.custType = res.yseMerchantInfo.custType
this.editForm = this[this.typeToForm[this.custType]] this.markCustType = res.yseMerchantInfo.custType
// 需要写入editForm的属性 this.editForm = this[this.typeToForm[this.custType]]
var needAttrList = [] // 需要写入editForm的属性
// 返回res的对象属性 var needAttrList = []
var resObj = _.cloneDeep({ // 返回res的对象属性
...res.bankInfo, var resObj = _.cloneDeep({
...res.serviceMerchant, ...res.bankInfo,
...res.yseMerchantInfo ...res.serviceMerchant,
}) ...res.yseMerchantInfo
// console.log(this.formList.map(item => item.name)) })
this.formList.forEach((item, index) => { // console.log(this.formList.map(item => item.name))
if (item.hasOwnProperty('type') && item.type !== 'image') { this.formList.forEach((item, index) => {
if (item.hasOwnProperty('showAttrList')) { if (item.hasOwnProperty('type') && item.type !== 'image') {
item.showAttrList.includes(this.custType) && needAttrList.push(item.name) if (item.hasOwnProperty('showAttrList')) {
} else { item.showAttrList.includes(this.custType) && needAttrList.push(item.name)
needAttrList.push(item.name) } else {
needAttrList.push(item.name)
}
} }
})
// 文字恢复
needAttrList.forEach(item => {
this.editForm[item] = resObj[item]
})
// 身份证有效期
if (res.yseMerchantInfo.legalCertStartDate && res.yseMerchantInfo.legalCertExpire) {
const startDate = res.yseMerchantInfo.legalCertStartDate
const endDate = res.yseMerchantInfo.legalCertStartDate
this.$set(this.editForm, 'legalCertDate', [startDate.slice(0, 4) + '-' + startDate.slice(4, 6) + '-' + startDate.slice(6), endDate.slice(0, 4) + '-' + endDate.slice(4, 6) + '-' + endDate.slice(6)])
} }
}) // 营业有效期
// 文字恢复 if (res.yseMerchantInfo.busLicenseStartDate && res.yseMerchantInfo.busLicenseExpire) {
needAttrList.forEach(item => { const startDate = res.yseMerchantInfo.busLicenseStartDate
this.editForm[item] = resObj[item] const endDate = res.yseMerchantInfo.busLicenseExpire
}) this.$set(this.editForm, 'busLicenseDate', [startDate.slice(0, 4) + '-' + startDate.slice(4, 6) + '-' + startDate.slice(6), endDate.slice(0, 4) + '-' + endDate.slice(4, 6) + '-' + endDate.slice(6)])
// 身份证有效期 }
if (res.yseMerchantInfo.legalCertStartDate && res.yseMerchantInfo.legalCertExpire) { // 图片恢复
const startDate = res.yseMerchantInfo.legalCertStartDate var picKeys = Object.keys(this.picObj)
const endDate = res.yseMerchantInfo.legalCertStartDate var keytoPic = {}
this.$set(this.editForm, 'legalCertDate', [startDate.slice(0, 4) + '-' + startDate.slice(4, 6) + '-' + startDate.slice(6), endDate.slice(0, 4) + '-' + endDate.slice(4, 6) + '-' + endDate.slice(6)]) picKeys.forEach(item => {
} keytoPic[this.picObj[item].attrName] = item
// 营业有效期 })
if (res.yseMerchantInfo.busLicenseStartDate && res.yseMerchantInfo.busLicenseExpire) { res.papersList.forEach(item => {
const startDate = res.yseMerchantInfo.busLicenseStartDate this.editForm.papers[item.papersType] = item.imgUrl
const endDate = res.yseMerchantInfo.busLicenseExpire this.picObj[keytoPic[item.papersType]].url = item.imgUrl
this.$set(this.editForm, 'busLicenseDate', [startDate.slice(0, 4) + '-' + startDate.slice(4, 6) + '-' + startDate.slice(6), endDate.slice(0, 4) + '-' + endDate.slice(4, 6) + '-' + endDate.slice(6)]) })
this.failMessage = res.yseMerchantInfo.failMessage
// console.log(this.editForm)
} }
// 图片恢复
var picKeys = Object.keys(this.picObj)
var keytoPic = {}
picKeys.forEach(item => {
keytoPic[this.picObj[item].attrName] = item
})
res.papersList.forEach(item => {
this.editForm.papers[item.papersType] = item.imgUrl
this.picObj[keytoPic[item.papersType]].url = item.imgUrl
})
this.failMessage = res.yseMerchantInfo.failMessage
// console.log(this.editForm)
}) })
}, },
// 开户行 // 开户行
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!