Commit 5019b542 by Jianli Ou

对接厂商实名认证提交资料接口

完善页面跳转逻辑
parent 07545102
...@@ -17,6 +17,10 @@ const saveMemberInfo = (params = {}) => { ...@@ -17,6 +17,10 @@ const saveMemberInfo = (params = {}) => {
const saveTycpdmFirmInfo = (params = {}) => { const saveTycpdmFirmInfo = (params = {}) => {
return POST(`${Prefix}/office/tycpdmfirm/api/save`, params) return POST(`${Prefix}/office/tycpdmfirm/api/save`, params)
} }
// 厂商实名资料提交(申请第二步)
const tycpdmfirmUpload = (params = {}) => {
return UPLOAD(`${Prefix}/office/tycpdmfirm/api/uploadFile`, params)
}
// 企业信息 // 企业信息
const tycpdmFirmInfo = (params = {}) => { const tycpdmFirmInfo = (params = {}) => {
return GET(`${Prefix}/office/tycpdmfirm/api/findUserName`, params) return GET(`${Prefix}/office/tycpdmfirm/api/findUserName`, params)
...@@ -30,6 +34,7 @@ export default { ...@@ -30,6 +34,7 @@ export default {
memberInfo, memberInfo,
saveMemberInfo, saveMemberInfo,
saveTycpdmFirmInfo, saveTycpdmFirmInfo,
tycpdmfirmUpload,
tycpdmFirmInfo, tycpdmFirmInfo,
saveUpdatePass saveUpdatePass
} }
<template> <template>
<div class="container2"> <div class="container2" v-loading="uploading">
<div class="content"> <div class="content">
<div class="title">厂商实名认证——提交书面材料 <a href="/MyManage/UnVerify/index">返回我的首页</a></div> <div class="title">厂商实名认证——提交书面材料 <a href="/MyManage/UnVerify/index">返回我的首页</a></div>
<div class="content-list"> <div class="content-list">
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
<div class="uploadcss"> <div class="uploadcss">
<span class="icon ">上传加盖公章的《实名认证注册登记表》影印件:</span> <span class="icon ">上传加盖公章的《实名认证注册登记表》影印件:</span>
<span class="btn " > <span class="btn " >
<el-button type="primary" style="width: 110px">上传</el-button>查看实名认证历史上传文件 <el-button type="primary" @click="uploadEvent" style="width: 110px">上传</el-button>查看实名认证历史上传文件
<p style="margin-top:10px;">支持png,bmp,jpg格式,大小不限</p> <p style="margin-top:10px;">支持png,bmp,jpg格式,大小不限</p>
</span> </span>
</div> </div>
...@@ -33,14 +32,61 @@ export default { ...@@ -33,14 +32,61 @@ export default {
name: "index", name: "index",
data() { data() {
return { return {
uploading: false,
loginInfo: {},
memberInfo: {},
tycpdmFirmInfo: {}
} }
}, },
methods: { methods: {
async upload(form) {
this.uploading = true
const result = await this.$api.myManage.tycpdmfirmUpload(form)
if (result.success) {
this.$message.success('上传成功')
await this.getTycpdmFirmInfo()
} else {
this.$message.error('上传失败')
}
this.uploading = false
},
uploadEvent() {
let inputObj = null
if (!document.getElementById('file')) {
inputObj = document.createElement('input')
inputObj.setAttribute('id', 'file')
inputObj.setAttribute('type', 'file')
inputObj.setAttribute('name', 'file')
inputObj.setAttribute('style', 'visibility:hidden')
document.body.appendChild(inputObj)
const that = this
document.querySelector('#file').addEventListener('change', () => {
const fileObj = document.getElementById('file').files[0]
let form = new FormData() // FormData 对象
form.append('file', fileObj) // 文件对象
form.append('id', that.tycpdmFirmInfo.fid)
this.upload(form)
})
} else {
inputObj = document.getElementById('file')
}
inputObj.click()
},
async getTycpdmFirmInfo() {
const result = await this.$api.myManage.tycpdmFirmInfo({userName: this.memberInfo.username})
this.tycpdmFirmInfo = result.data
if (this.tycpdmFirmInfo.logoutFlag === 0) {
await this.$router.replace({path: '/MyManage/UnVerify/vendorStatus'})
}
},
async getMemberInfo() {
this.memberInfo = (await this.$api.myManage.memberInfo({id: this.loginInfo.id})).data
await this.getTycpdmFirmInfo()
}
}, },
mounted() { mounted() {
this.loginInfo = JSON.parse(localStorage.getItem('loginInfo'))
this.getMemberInfo()
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment