Commit dadafd07 by cwq0219

虚拟对公账号

1 parent 68166d16
import request from './request'
const djPath = 'dj.api.'
const path = 'dj.api.serviceMerchant.'
// 分页查询服务门店
......@@ -7,3 +8,15 @@ export function getListApi(data) {
data.method = `${path}listWithPage`
return request(data, 'post')
}
// 注册线下商户
export function registerYseMerchantApi(data) {
data.method = `${djPath}yseMerchantOffline.register`
return request(data, 'post')
}
// 注册线下商户-存草稿
export function draftYseMerchantApi(data) {
data.method = `${djPath}yseMerchantOffline.saveDrafts`
return request(data, 'post')
}
......@@ -73,28 +73,6 @@
@handleImgChange="handleImgChange"
@handleImgRemove="handleImgRemove"
></gl-upload-img>
<!-- <p>
<el-upload
action=""
list-type="picture-card"
:auto-upload="false"
:on-change="e => handleImgChange(e, scope.scope.otherName)"
:on-preview="e => handlePreview(e, scope.scope.otherName)"
:on-remove="handleRemove"
>
<img
v-if="picObj[scope.scope.otherName].url"
:src="picObj[scope.scope.otherName].url"
class="avatar"
>
<img
v-else
src='./image/idCardBack.png'
class="rectImg"
>
</el-upload>
<span>法人身份证反面照</span>
</p> -->
</div>
<div
slot="bankCard"
......@@ -170,9 +148,11 @@
<script>
import { mapActions } from 'vuex'
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'
export default {
name: 'applyAccount',
data() {
......@@ -238,7 +218,7 @@ export default {
},
// 门头照
doorHead: {
attrName: '31',
attrName: '34',
url: ''
},
// 经营场所
......@@ -554,6 +534,7 @@ export default {
mounted() {
this.targetAccount = this.$route.params
console.log(this.targetAccount.merchantId)
this.editForm = this[this.typeToForm[this.custType]]
this.getProvinceList()
this.getBankList()
......@@ -663,7 +644,7 @@ export default {
// legalCertDate
} else if (type === 1 && (res.issueDate && res.expiryDate)) {
// 身份证反面
this.$set(this.editForm, 'legalCertDate', [new Date(res.issueDate.slice(0, 4) + '-' + res.issueDate.slice(4, 6) + '-' + res.issueDate.slice(6)), new Date(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)) {
this.$set(this.editForm, 'bankAccountNo', res.cardNo)
} else if (type === 3) {
......@@ -673,23 +654,50 @@ export default {
if (res.establishDate && res.establishDate) {
var startDate = res.establishDate.replace(/['年', '月', '日']/g, '-').slice(0, res.establishDate.length - 1)
var endDate = res.establishDate.replace(/['年', '月', '日']/g, '-').slice(0, res.validPeriod.length - 1)
res.establishDate && this.$set(this.editForm, 'busLicenseDate', [startDate, endDate])
this.$set(this.editForm, 'busLicenseDate', [startDate, endDate])
}
res.address && this.$set(this.editForm, 'companyAddr', res.address)
res.address && this.$set(this.editForm, 'busAddress', res.address)
}
})
},
getParams() {
this.beforeChangePic()
var params = _.cloneDeep(this.editForm)
params.merchantId = this.targetAccount.merchantId
// 身份证日期
if (params.legalCertDate) {
params.legalCertStartDate = params.legalCertDate[0].replaceAll('-', '')
params.legalCertExpire = params.legalCertDate[1].replaceAll('-', '')
delete params.legalCertDate
}
// 营业时间
if (this.custType !== 'O' && params.busLicenseDate) {
params.busLicenseStartDate = params.busLicenseDate[0].replace(/-/g, '')
params.busLicenseExpire = params.busLicenseDate[1].replace(/-/g, '')
delete params.busLicenseDate
}
return params
},
// 确认
handleConfirm() {
console.log('确认---')
this.beforeChangePic()
console.log(this.editForm)
// console.log(this.editForm)
var params = this.getParams()
console.log(params)
registerYseMerchantApi(params).then(res => {
this.notice.okTips()
this.handleCancel()
})
},
// 存草稿
handleDraft() {
this.beforeChangePic()
console.log(this.editForm)
var params = this.getParams()
console.log(params)
draftYseMerchantApi(params).then(res => {
this.notice.okTips()
this.handleCancel()
})
},
// 取消
handleCancel() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!