Commit dadafd07 by cwq0219

虚拟对公账号

1 parent 68166d16
import request from './request' import request from './request'
const djPath = 'dj.api.'
const path = 'dj.api.serviceMerchant.' const path = 'dj.api.serviceMerchant.'
// 分页查询服务门店 // 分页查询服务门店
...@@ -7,3 +8,15 @@ export function getListApi(data) { ...@@ -7,3 +8,15 @@ export function getListApi(data) {
data.method = `${path}listWithPage` data.method = `${path}listWithPage`
return request(data, 'post') 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 @@ ...@@ -73,28 +73,6 @@
@handleImgChange="handleImgChange" @handleImgChange="handleImgChange"
@handleImgRemove="handleImgRemove" @handleImgRemove="handleImgRemove"
></gl-upload-img> ></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>
<div <div
slot="bankCard" slot="bankCard"
...@@ -170,9 +148,11 @@ ...@@ -170,9 +148,11 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import _ from 'lodash'
import editForm from './editForm' import editForm from './editForm'
import glUploadImg from './glUploadImg' import glUploadImg from './glUploadImg'
import { uploadImg, imgRecognitionApi, getProvinceCityApi, getBankListApi, getYseBankListApi } from '@/api/sys.base' import { uploadImg, imgRecognitionApi, getProvinceCityApi, getBankListApi, getYseBankListApi } from '@/api/sys.base'
import { registerYseMerchantApi, draftYseMerchantApi } from '@api/publicAccount'
export default { export default {
name: 'applyAccount', name: 'applyAccount',
data() { data() {
...@@ -238,7 +218,7 @@ export default { ...@@ -238,7 +218,7 @@ export default {
}, },
// 门头照 // 门头照
doorHead: { doorHead: {
attrName: '31', attrName: '34',
url: '' url: ''
}, },
// 经营场所 // 经营场所
...@@ -554,6 +534,7 @@ export default { ...@@ -554,6 +534,7 @@ export default {
mounted() { mounted() {
this.targetAccount = this.$route.params this.targetAccount = this.$route.params
console.log(this.targetAccount.merchantId)
this.editForm = this[this.typeToForm[this.custType]] this.editForm = this[this.typeToForm[this.custType]]
this.getProvinceList() this.getProvinceList()
this.getBankList() this.getBankList()
...@@ -663,7 +644,7 @@ export default { ...@@ -663,7 +644,7 @@ export default {
// legalCertDate // legalCertDate
} else if (type === 1 && (res.issueDate && res.expiryDate)) { } 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)) { } 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) {
...@@ -673,23 +654,50 @@ export default { ...@@ -673,23 +654,50 @@ export default {
if (res.establishDate && res.establishDate) { if (res.establishDate && res.establishDate) {
var startDate = res.establishDate.replace(/['年', '月', '日']/g, '-').slice(0, res.establishDate.length - 1) var startDate = res.establishDate.replace(/['年', '月', '日']/g, '-').slice(0, res.establishDate.length - 1)
var endDate = res.establishDate.replace(/['年', '月', '日']/g, '-').slice(0, res.validPeriod.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, 'companyAddr', res.address)
res.address && this.$set(this.editForm, 'busAddress', 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() { handleConfirm() {
console.log('确认---') 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() { handleDraft() {
this.beforeChangePic() var params = this.getParams()
console.log(this.editForm) console.log(params)
draftYseMerchantApi(params).then(res => {
this.notice.okTips()
this.handleCancel()
})
}, },
// 取消 // 取消
handleCancel() { handleCancel() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!