Commit d2277854 by cwq0219

虚拟对公账号-验证码,新加字段

1 parent 7ebde322
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: limin * @Author: limin
* @Date: 2019-08-26 18:02:55 * @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq * @Last Modified by: chenwq
* @Last Modified time: 2021-04-21 16:36:34 * @Last Modified time: 2021-04-22 15:36:58
*/ */
import request from './request' import request from './request'
...@@ -47,3 +47,9 @@ export function getYseBankListApi(data) { ...@@ -47,3 +47,9 @@ export function getYseBankListApi(data) {
data.method = `${path}yseBankInfo.listWithPage` data.method = `${path}yseBankInfo.listWithPage`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 给指定号码发送验证码
export function sendToSmsCodeApi(data) {
data.method = `${path}smartcarlife.sms.sendSmsCode`
return request(data, RequestMethods.POST)
}
...@@ -81,6 +81,7 @@ export default { ...@@ -81,6 +81,7 @@ export default {
}, { }, {
label: '营业执照', label: '营业执照',
prop: 'businessLicense', prop: 'businessLicense',
imgList: ['businessLicense'],
type: 'image', type: 'image',
// 根据currentPage不同,展示/隐藏 // 根据currentPage不同,展示/隐藏
showAttrList: ['C', 'B'] showAttrList: ['C', 'B']
...@@ -123,6 +124,11 @@ export default { ...@@ -123,6 +124,11 @@ export default {
label: '法人手机号', label: '法人手机号',
prop: 'legalTel' prop: 'legalTel'
}, { }, {
label: '法人手持身份证照',
imgList: ['handIdCard'],
showAttrList: ['O'],
type: 'image'
}, {
label: '提现人姓名', label: '提现人姓名',
prop: 'contactsName' prop: 'contactsName'
}, { }, {
...@@ -237,11 +243,11 @@ export default { ...@@ -237,11 +243,11 @@ export default {
.account-detail .detail-img { .account-detail .detail-img {
width: 137px; width: 137px;
height: 90px; height: 90px;
transition: width 0.2s; transition: width 0.3s;
cursor: pointer; cursor: pointer;
} }
.account-detail .detail-img:hover { .account-detail .detail-img:hover {
width: 50%; width: 60%;
height: 50%; height: 60%;
} }
</style> </style>
...@@ -79,6 +79,19 @@ ...@@ -79,6 +79,19 @@
></gl-upload-img> ></gl-upload-img>
</div> </div>
<div <div
slot="handIdCard"
slot-scope="scope"
class="flex"
>
<gl-upload-img
:formObj="scope.scope"
:picObj="picObj"
txtDescript="手持身份证照"
@handleImgChange="handleImgChange"
@handleImgRemove="handleImgRemove"
></gl-upload-img>
</div>
<div
slot="bankCard" slot="bankCard"
slot-scope="scope" slot-scope="scope"
class="flex" class="flex"
...@@ -146,6 +159,23 @@ ...@@ -146,6 +159,23 @@
@handleImgRemove="handleImgRemove" @handleImgRemove="handleImgRemove"
></gl-upload-img> ></gl-upload-img>
</div> </div>
<!-- smsCode -->
<div
slot="smsCode"
slot-scope="scope"
>
<el-input
v-model="editForm[scope.scope.name]"
size="mini"
placeholder="请输入验证码"
style="width: 200px; margin-right: 10px;"
></el-input>
<el-button
size="mini"
@click="handleSend"
:disabled="isSend || editForm.operPhone.length !== 11"
>{{isSend ? sendMsg + '秒后,重试' : '获取验证码'}}</el-button>
</div>
</edit-form> </edit-form>
</div> </div>
</template> </template>
...@@ -155,7 +185,7 @@ import { mapActions } from 'vuex' ...@@ -155,7 +185,7 @@ import { mapActions } from 'vuex'
import _ from 'lodash' import _ from 'lodash'
import editForm from './editForm' import editForm from './editForm'
import glUploadImg from './glUploadImg' import glUploadImg from './glUploadImg'
import { uploadImg, imgRecognitionApi, getBankListApi, getYseBankListApi } from '@/api/sys.base' import { uploadImg, imgRecognitionApi, getBankListApi, getYseBankListApi, sendToSmsCodeApi } from '@/api/sys.base'
import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount' import { registerYseMerchantApi, draftYseMerchantApi, getDetailApi } from '@api/publicAccount'
export default { export default {
name: 'applyAccount', name: 'applyAccount',
...@@ -164,6 +194,11 @@ export default { ...@@ -164,6 +194,11 @@ export default {
// 缓存当前merchantId // 缓存当前merchantId
sessionName: 'applyAccMerchant', sessionName: 'applyAccMerchant',
targetAccount: {}, targetAccount: {},
// 验证码
showtips: false,
isSend: false,
sendMsg: '获取验证码',
time: '',
// 编辑-错误信息 // 编辑-错误信息
failMessage: '', failMessage: '',
// O - 小微商户;C - 个体商户;B - 个体商户(三个表单数据隔离) // O - 小微商户;C - 个体商户;B - 个体商户(三个表单数据隔离)
...@@ -173,6 +208,7 @@ export default { ...@@ -173,6 +208,7 @@ export default {
// 传给组件的obj // 传给组件的obj
editForm: { editForm: {
anotherName: '', anotherName: '',
companyAddr: '',
busAddress: '', busAddress: '',
legalName: '', legalName: '',
legalCertNo: '', legalCertNo: '',
...@@ -180,6 +216,7 @@ export default { ...@@ -180,6 +216,7 @@ export default {
legalTel: '', legalTel: '',
contactsName: '', contactsName: '',
contactsPhone: '', contactsPhone: '',
contactsAddr: '',
contactsEmail: '', contactsEmail: '',
bankAccountType: '', bankAccountType: '',
bankAccountNo: '', bankAccountNo: '',
...@@ -194,8 +231,7 @@ export default { ...@@ -194,8 +231,7 @@ export default {
BCeditForm: { BCeditForm: {
busLicenceName: '', busLicenceName: '',
busLicense: '', busLicense: '',
busLicenseDate: '', busLicenseDate: ''
contactsAddr: ''
}, },
// 固定参数 // 固定参数
defaultForm: {}, defaultForm: {},
...@@ -209,8 +245,7 @@ export default { ...@@ -209,8 +245,7 @@ export default {
}, },
// 企业商户Obj // 企业商户Obj
businessEditForm: { businessEditForm: {
custType: 'B', custType: 'B'
companyAddr: ''
}, },
// 类型对应的对象form // 类型对应的对象form
typeToForm: { typeToForm: {
...@@ -229,6 +264,11 @@ export default { ...@@ -229,6 +264,11 @@ export default {
attrName: '30', attrName: '30',
url: '' url: ''
}, },
// 手持身份证
handIdCard: {
attrName: 'A009',
url: ''
},
// 银行卡 // 银行卡
bankCard: { bankCard: {
attrName: '35', attrName: '35',
...@@ -288,11 +328,16 @@ export default { ...@@ -288,11 +328,16 @@ export default {
value: 'B', value: 'B',
label: '企业商户' label: '企业商户'
}], }],
rules: [{ required: true, message: '请选择商户类型', trigger: 'change' }],
handleRadioChange: () => { handleRadioChange: () => {
this.beforeChangePic().then(res => { this.beforeChangePic().then(res => {
// 验证码清空
this.isSend = false
this.time && clearTimeout(this.time)
// 写入切换后的Obj // 写入切换后的Obj
this.editForm = this[this.typeToForm[this.custType]] this.editForm = this[this.typeToForm[this.custType]]
this.afterChangePic() this.afterChangePic()
this.recoveryOpenAccBank()
this.markCustType = this.custType this.markCustType = this.custType
}) })
} }
...@@ -339,7 +384,7 @@ export default { ...@@ -339,7 +384,7 @@ export default {
label: '企业注册地址', label: '企业注册地址',
name: 'companyAddr', name: 'companyAddr',
// 根据currentPage不同,展示/隐藏 // 根据currentPage不同,展示/隐藏
showAttrList: ['B'], // showAttrList: ['B'],
type: 'input', type: 'input',
rules: [{ required: true, message: '请输入企业注册地址', trigger: 'change' }] rules: [{ required: true, message: '请输入企业注册地址', trigger: 'change' }]
}, { }, {
...@@ -354,6 +399,7 @@ export default { ...@@ -354,6 +399,7 @@ export default {
otherName: 'idCardBack', otherName: 'idCardBack',
type: 'image', type: 'image',
slotName: 'idCard', slotName: 'idCard',
// rules: [{ required: true, message: '请上传法人身份证', trigger: 'change' }],
autoRecognitionFn: (imgUrl) => this.handleAutoRecognition(1, imgUrl) autoRecognitionFn: (imgUrl) => this.handleAutoRecognition(1, imgUrl)
}, { }, {
label: '法人姓名', label: '法人姓名',
...@@ -379,6 +425,12 @@ export default { ...@@ -379,6 +425,12 @@ export default {
maxlength: '11', maxlength: '11',
rules: [{ required: true, message: '请输入法人手机号', trigger: 'change' }] rules: [{ required: true, message: '请输入法人手机号', trigger: 'change' }]
}, { }, {
label: '法人手持身份证照',
name: 'handIdCard',
slotName: 'handIdCard',
showAttrList: ['O'],
type: 'image'
}, {
label: '提现人姓名', label: '提现人姓名',
name: 'contactsName', name: 'contactsName',
type: 'input', type: 'input',
...@@ -393,7 +445,6 @@ export default { ...@@ -393,7 +445,6 @@ export default {
label: '提现人地址', label: '提现人地址',
name: 'contactsAddr', name: 'contactsAddr',
type: 'input', type: 'input',
showAttrList: ['C', 'B'],
rules: [{ required: true, message: '请输入提现人地址', trigger: 'change' }] rules: [{ required: true, message: '请输入提现人地址', trigger: 'change' }]
}, { }, {
label: '提现人邮箱', label: '提现人邮箱',
...@@ -508,7 +559,8 @@ export default { ...@@ -508,7 +559,8 @@ export default {
}, { }, {
label: '操作人手机号验证码', label: '操作人手机号验证码',
name: 'smsCode', name: 'smsCode',
type: 'input', type: '',
slotName: 'smsCode',
rules: [{ required: true, message: '请输入操作人手机号验证码', trigger: 'change' }] rules: [{ required: true, message: '请输入操作人手机号验证码', trigger: 'change' }]
}], }],
baseDate: { baseDate: {
...@@ -589,7 +641,7 @@ export default { ...@@ -589,7 +641,7 @@ export default {
// 身份证有效期 // 身份证有效期
if (res.yseMerchantInfo.legalCertStartDate && res.yseMerchantInfo.legalCertExpire) { if (res.yseMerchantInfo.legalCertStartDate && res.yseMerchantInfo.legalCertExpire) {
const startDate = res.yseMerchantInfo.legalCertStartDate const startDate = res.yseMerchantInfo.legalCertStartDate
const endDate = res.yseMerchantInfo.legalCertStartDate const endDate = res.yseMerchantInfo.legalCertExpire
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)]) 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)])
} }
// 营业有效期 // 营业有效期
...@@ -598,6 +650,8 @@ export default { ...@@ -598,6 +650,8 @@ export default {
const endDate = res.yseMerchantInfo.busLicenseExpire 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)]) 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.recoveryOpenAccBank()
// 图片恢复 // 图片恢复
var picKeys = Object.keys(this.picObj) var picKeys = Object.keys(this.picObj)
var keytoPic = {} var keytoPic = {}
...@@ -656,6 +710,10 @@ export default { ...@@ -656,6 +710,10 @@ export default {
}) })
console.log(this.picObj) console.log(this.picObj)
}, },
// 切换radio/编辑,开户行恢复opt数据
recoveryOpenAccBank() {
this.formList[this.findFormIdx('openAccBankType')].optionList = this.editForm.openAccBankType ? [{ branchBankType: this.editForm.openAccBankType, branchBankName: this.editForm.openAccBankName }] : []
},
handleImgChange({ file, attrName, targetItem }) { handleImgChange({ file, attrName, targetItem }) {
var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense'] var hasFnList = ['idCard', 'idCardBack', 'bankCard', 'businessLicense']
var reader = new FileReader() var reader = new FileReader()
...@@ -666,9 +724,6 @@ export default { ...@@ -666,9 +724,6 @@ export default {
const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
uploadImg({ file: base64 }).then(res => { uploadImg({ file: base64 }).then(res => {
this.picObj[attrName].url = res this.picObj[attrName].url = res
console.log(attrName)
console.log(this.picObj[attrName].attrName)
console.log(this.picObj[attrName].url)
if (hasFnList.includes(attrName)) { if (hasFnList.includes(attrName)) {
targetItem.autoRecognitionFn(res) targetItem.autoRecognitionFn(res)
} }
...@@ -682,20 +737,42 @@ export default { ...@@ -682,20 +737,42 @@ export default {
// console.log(file) // console.log(file)
// console.log(attrName) // console.log(attrName)
}, },
// 验证码
handleSend() {
sendToSmsCodeApi({ phone: this.editForm.operPhone }).then((res) => {
this.notice.okTips('已发送,5分钟内有效')
this.isSend = true
this.showtips = true
this.sendMsg = 60
this.msgDown()
})
},
msgDown() {
this.time = setTimeout(() => {
clearTimeout(this.time)
if (this.sendMsg > 1) {
--this.sendMsg
this.msgDown()
} else {
this.isSend = false
}
}, 1000)
},
// 自动识别type - 识别类型(1:身份证;2:银行卡;3:营业执照);imgUrl - 图片地址 // 自动识别type - 识别类型(1:身份证;2:银行卡;3:营业执照);imgUrl - 图片地址
handleAutoRecognition(type, imgUrl, needWriteList) { handleAutoRecognition(type, imgUrl, needWriteList) {
// console.log(type) // console.log(type)
// console.log(imgUrl) // console.log(imgUrl)
imgRecognitionApi({ type: type, imgUrl: imgUrl }).then(res => { imgRecognitionApi({ type: type, imgUrl: imgUrl }).then(res => {
// 身份证正面 // 身份证正面
if (type === 1 && (res.name || res.cardNo)) { if (type === 1 && (!res.issueDate)) {
this.$set(this.editForm, 'legalName', res.name) res.name && this.$set(this.editForm, 'legalName', res.name)
this.$set(this.editForm, 'legalCertNo', res.cardNo) res.cardNo && this.$set(this.editForm, 'legalCertNo', res.cardNo)
// legalCertDate // legalCertDate
} else if (type === 1 && (res.issueDate && res.expiryDate)) { } else if (type === 1 && (res.issueDate && res.expiryDate)) {
// 身份证反面 // 身份证反面
this.$set(this.editForm, 'legalCertDate', [res.issueDate.slice(0, 4) + '-' + res.issueDate.slice(4, 6) + '-' + res.issueDate.slice(6), res.expiryDate.slice(0, 4) + '-' + res.expiryDate.slice(4, 6) + '-' + res.expiryDate.slice(6)]) this.$set(this.editForm, 'legalCertDate', [res.issueDate.slice(0, 4) + '-' + res.issueDate.slice(4, 6) + '-' + res.issueDate.slice(6), res.expiryDate.slice(0, 4) + '-' + res.expiryDate.slice(4, 6) + '-' + res.expiryDate.slice(6)])
} else if (type === 2 && (res.cardNo)) { } else if (type === 2 && (res.cardNo)) {
// 银行卡
this.$set(this.editForm, 'bankAccountNo', res.cardNo) this.$set(this.editForm, 'bankAccountNo', res.cardNo)
} else if (type === 3) { } else if (type === 3) {
// 营业执照 // 营业执照
...@@ -731,8 +808,6 @@ export default { ...@@ -731,8 +808,6 @@ export default {
}, },
// 确认 // 确认
handleConfirm() { handleConfirm() {
console.log('确认---')
// console.log(this.editForm)
var params = this.getParams() var params = this.getParams()
console.log(params) console.log(params)
registerYseMerchantApi(params).then(res => { registerYseMerchantApi(params).then(res => {
...@@ -755,6 +830,8 @@ export default { ...@@ -755,6 +830,8 @@ export default {
}, },
// 取消 // 取消
handleCancel() { handleCancel() {
this.isSend = false
this.time && clearTimeout(this.time)
this.deleteSession() this.deleteSession()
this.close({ tagName: '/accountList' }) this.close({ tagName: '/accountList' })
this.$router.push({ name: 'accountList' }) this.$router.push({ name: 'accountList' })
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
></slot> ></slot>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item> <el-form-item style="margin-top: 20px;">
<el-button <el-button
type="primary" type="primary"
@click="handleConfirm" @click="handleConfirm"
...@@ -184,15 +184,15 @@ export default { ...@@ -184,15 +184,15 @@ export default {
}, },
// 确认 // 确认
handleConfirm() { handleConfirm() {
this.$emit('handleConfirm')
// this.$refs.editFrom.validate((valid, opt) => {
// var hasError = Object.keys(opt)
// if (!valid) {
// this.jumpScroll(hasError[0])
// return false
// }
// this.$emit('handleConfirm') // this.$emit('handleConfirm')
// }) this.$refs.editFrom.validate((valid, opt) => {
var hasError = Object.keys(opt)
if (!valid) {
this.jumpScroll(hasError[0])
return false
}
this.$emit('handleConfirm')
})
}, },
// 存草稿 // 存草稿
handleDraft() { handleDraft() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!