Commit e02154fa by cwq0219

虚拟对公账号-缓存

1 parent dadafd07
......@@ -20,3 +20,9 @@ export function draftYseMerchantApi(data) {
data.method = `${djPath}yseMerchantOffline.saveDrafts`
return request(data, 'post')
}
// 获取商户虚拟对公账户详情
export function getDetailApi(data) {
data.method = `${djPath}yseMerchantOffline.getDetail`
return request(data, 'post')
}
......@@ -152,11 +152,13 @@ import _ from 'lodash'
import editForm from './editForm'
import glUploadImg from './glUploadImg'
import { uploadImg, imgRecognitionApi, getProvinceCityApi, getBankListApi, getYseBankListApi } from '@/api/sys.base'
import { registerYseMerchantApi, draftYseMerchantApi } from '@api/publicAccount'
import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount'
export default {
name: 'applyAccount',
data() {
return {
// 缓存当前merchantId
sessionName: 'applyAccMerchant',
targetAccount: {},
// O - 小微商户;C - 个体商户;B - 个体商户(三个表单数据隔离)
custType: 'O',
......@@ -169,21 +171,21 @@ export default {
custType: 'O',
bankCityId: '',
openAccBankType: '',
papers: [{}]
papers: {}
},
// 个体商户Obj
customerEditForm: {
custType: 'C',
bankCityId: '',
openAccBankType: '',
papers: [{}]
papers: {}
},
// 企业商户Obj
businessEditForm: {
custType: 'B',
bankCityId: '',
openAccBankType: '',
papers: [{}]
papers: {}
},
// 类型对应的对象form
typeToForm: {
......@@ -371,6 +373,12 @@ export default {
maxlength: '11',
rules: [{ required: true, message: '请输入提现人手机号', trigger: 'change' }]
}, {
label: '提现人地址',
name: 'contactsAddr',
type: 'input',
showAttrList: ['C', 'B'],
rules: [{ required: true, message: '请输入提现人地址', trigger: 'change' }]
}, {
label: '提现人邮箱',
name: 'contactsEmail',
type: 'input',
......@@ -415,7 +423,7 @@ export default {
label: '开户行所在的市',
name: 'bankCityId',
// showAttrList: ['O', 'C'],
rules: [{ required: true, message: '请选择开户行所在的市', trigger: 'change' }],
rules: [{ required: true, message: '请选择开户行所在的市', trigger: 'blur' }],
type: 'select',
optionId: 'confValue',
optionLabel: 'confName',
......@@ -456,7 +464,7 @@ export default {
type: 'filterSelect',
optionId: 'branchBankType',
optionLabel: 'branchBankName',
rules: [{ required: true, message: '请选择开户支行', trigger: 'change' }],
rules: [{ required: true, message: '请选择开户支行', trigger: 'blur' }],
optionList: [],
remoteMethod: (query, item) => {
if (this.editForm.bankType) {
......@@ -533,8 +541,14 @@ export default {
},
mounted() {
this.targetAccount = this.$route.params
console.log(this.targetAccount.merchantId)
if (this.$route.params.merchantId) {
this.targetAccount = this.$route.params
sessionStorage.setItem(this.sessionName, JSON.stringify(this.$route.params))
} else {
Object.assign(this.targetAccount, JSON.parse(sessionStorage.getItem(this.sessionName)))
}
// 编辑 - 恢复数据
this.getDetail()
this.editForm = this[this.typeToForm[this.custType]]
this.getProvinceList()
this.getBankList()
......@@ -544,6 +558,13 @@ export default {
...mapActions({
close: 'd2admin/page/close'
}),
// 获取详情,数据恢复
getDetail() {
getDetailApi({ merchantId: this.targetAccount.merchantId }).then(res => {
console.log(res)
console.log(this.formList)
})
},
// 开户行
getBankList() {
getBankListApi({}).then(res => {
......@@ -573,13 +594,13 @@ export default {
// 切换radio前,将图片的值写入Obj中;按确定/存草稿时,触发
beforeChangePic() {
return new Promise(resolve => {
this[this.typeToForm[this.markCustType]].papers = [{}]
this[this.typeToForm[this.markCustType]].papers = {}
var picKeys = Object.keys(this.picObj)
// console.log(picKeys)
picKeys.forEach((item, index) => {
var targetTem = this.picObj[item]
if (targetTem.url) {
this[this.typeToForm[this.markCustType]].papers[0][targetTem.attrName] = targetTem.url
this[this.typeToForm[this.markCustType]].papers[targetTem.attrName] = targetTem.url
}
if (index === picKeys.length - 1) {
resolve()
......@@ -593,8 +614,8 @@ export default {
var picKeys = Object.keys(this.picObj)
picKeys.forEach(item => {
var targetTem = this.picObj[item]
if (Object.keys(this[this.typeToForm[this.custType]].papers[0]).includes(targetTem.attrName)) {
this.picObj[item].url = this[this.typeToForm[this.custType]].papers[0][targetTem.attrName]
if (Object.keys(this[this.typeToForm[this.custType]].papers).includes(targetTem.attrName)) {
this.picObj[item].url = this[this.typeToForm[this.custType]].papers[targetTem.attrName]
} else {
this.$set(this.picObj[item], 'url', '')
}
......@@ -699,8 +720,13 @@ export default {
this.handleCancel()
})
},
// 删除session
deleteSession() {
sessionStorage.removeItem(this.sessionName)
},
// 取消
handleCancel() {
this.deleteSession()
this.close({ tagName: '/accountList' })
this.$router.push({ name: 'accountList' })
this.close({ tagName: '/applyAccount' })
......
......@@ -91,7 +91,7 @@
v-model="settleTimeObj.first"
controls-position="right"
size="small"
:min="1"
:min="0"
:max="30"
:disabled="form.settleTimeType === 2 || form.autoFlag === 'N'"
></el-input-number>
......@@ -478,7 +478,7 @@ export default {
name: 'merchantDetail',
data() {
return {
sessionName: 'merchatItem',
sessionName: 'merchatDetailItem',
isConfigAccount: false,
// 结算周期
settleTimeObj: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!