Commit d2277854 by cwq0219

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

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