@@ -37,4 +37,12 @@ export function userRegister(data) { | |||
data: data | |||
}) | |||
} | |||
//注册 | |||
export function base64Upload(data) { | |||
return request({ | |||
url: '/transaction/website/common/base64Upload', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
@@ -49,6 +49,11 @@ | |||
<van-field v-model="form.companyCode" label="社会信用代码" placeholder="请输入公司的社会信用代码" required :rules="[{ required:true }]"/> | |||
<van-field v-model="form.companyLicense" label="营业执照号" placeholder="请输入公司的营业执照号" required :rules="[{ required:true }]"/> | |||
<van-field v-model="form.address" label="联系地址" placeholder="请输入联系地址" /> | |||
<van-field name="uploader" label="开户证明" required> | |||
<template #input> | |||
<van-uploader :after-read="afterReadKHZM" :before-delete="deleteFileKHZM" v-model="fileListKHZM" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<div class="submit"> | |||
<!-- <p>我已阅读并同意<span>《农村产权交易信息服务平台会员注册协议》</span></p>--> | |||
<van-button round block type="info" color="#007E72" native-type="submit">立即注册</van-button> | |||
@@ -59,7 +64,7 @@ | |||
<script> | |||
import { getCodeImg } from "@/api/login"; | |||
import { userRegister } from "@/api/register/index"; | |||
import {base64Upload, userRegister} from "@/api/register/index"; | |||
export default { | |||
name: "companyRegister", | |||
data() { | |||
@@ -70,6 +75,7 @@ export default { | |||
confirmPassWord:'', | |||
showPicker: false, | |||
columns:[], | |||
fileListKHZM:[], | |||
form: { | |||
phone: "", //账号 | |||
code: "", //验证码 | |||
@@ -120,6 +126,16 @@ export default { | |||
}) | |||
return; | |||
} | |||
if (this.form.accountOpenCert == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传开户证明', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
}) | |||
return; | |||
} | |||
this.form.accountType = '1'; | |||
userRegister(this.form).then((res) => { | |||
this.$toast({ | |||
@@ -131,7 +147,23 @@ export default { | |||
} | |||
}) | |||
}); | |||
} | |||
}, | |||
afterReadKHZM(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.form.accountOpenCert = r1.fileName; | |||
}) | |||
}, | |||
deleteFileKHZM(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileListKHZM[elIndex].splice(fileIndex, 1) | |||
this.form.accountOpenCert = ''; | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
@@ -39,6 +39,16 @@ | |||
<van-field v-model="form.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||
<van-field v-model="form.idCardNum" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/> | |||
<van-field v-model="form.address" label="联系地址" placeholder="请输入联系地址" /> | |||
<van-field name="uploader" label="身份证(正)" required> | |||
<template #input> | |||
<van-uploader :after-read="afterReadSFZ" :before-delete="deleteFileSFZ" v-model="fileListSFZ" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<van-field name="uploader" label="银行卡" required> | |||
<template #input> | |||
<van-uploader :after-read="afterReadYHK" :before-delete="deleteFileYHK" v-model="fileListYHK" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<div class="submit"> | |||
<!-- <p>我已阅读并同意<span>《农村产权交易信息服务平台会员注册协议》</span></p>--> | |||
<van-button round block type="info" color="#007E72" native-type="submit">立即注册</van-button> | |||
@@ -49,7 +59,8 @@ | |||
<script> | |||
import { getCodeImg } from "@/api/login"; | |||
import { userRegister } from "@/api/register/index"; | |||
import { userRegister,base64Upload } from "@/api/register/index"; | |||
import {deleteUserImg} from "@/api/user"; | |||
export default { | |||
name: "userRegister", | |||
data() { | |||
@@ -66,9 +77,13 @@ export default { | |||
address: "", //地址 | |||
uuid:'',//图形验证码ID | |||
memberType:1, | |||
economicType:1 | |||
economicType:1, | |||
idCardPic :'', | |||
accountOpenCert:'', | |||
}, | |||
codeUrl:'' | |||
codeUrl:'', | |||
fileListSFZ:[], | |||
fileListYHK:[] | |||
}; | |||
}, | |||
created() { | |||
@@ -94,7 +109,28 @@ export default { | |||
}) | |||
return; | |||
} | |||
if (this.form.idCardPic == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传身份证', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
}) | |||
return; | |||
} | |||
if (this.form.accountOpenCert == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传银行卡', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
}) | |||
return; | |||
} | |||
this.form.accountType = '2'; | |||
console.log(this.form); | |||
userRegister(this.form).then((res) => { | |||
this.$toast({ | |||
icon: 'success', // 找到自己需要的图标 | |||
@@ -105,7 +141,37 @@ export default { | |||
} | |||
}) | |||
}); | |||
} | |||
}, | |||
afterReadSFZ(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.form.idCardPic = r1.fileName; | |||
}) | |||
}, | |||
afterReadYHK(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.form.accountOpenCert = r1.fileName; | |||
}) | |||
}, | |||
deleteFileSFZ(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileListSFZ[elIndex].splice(fileIndex, 1) | |||
this.form.idCardPic = ''; | |||
} | |||
}, | |||
deleteFileYHK(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileListYHK[elIndex].splice(fileIndex, 1) | |||
this.form.accountOpenCert = ''; | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
@@ -66,12 +66,11 @@ | |||
<van-field v-model="userForm.companyCapital" label="注册资金" placeholder="请输入注册资金" required :rules="[{ required:true }]" /> | |||
<van-field v-model="userForm.companyLicense" label="营业执照号" placeholder="请输入公司的营业执照号" required :rules="[{ required:true }]"/> | |||
<van-field v-model="userForm.address" label="联系地址" placeholder="请输入联系地址" required :rules="[{ required:true }]" /> | |||
<van-field name="uploader" label="上传相关附件"> | |||
<van-field name="uploader" label="开户证明" required> | |||
<template #input> | |||
<van-uploader :after-read="afterRead" :before-delete="deleteFile" v-model="fileList" multiple :max-count="5" /> | |||
<van-uploader :after-read="afterReadKHZM" :before-delete="deleteFileKHZM" v-model="fileListKHZM" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<p style="color: red; text-align: center;">*身份证照片、本人和身份证的合影</p> | |||
<div class="submit"> | |||
<van-button round block type="info" color="#007E72" native-type="submit" style="width: 90%;margin: 0 auto;">保存</van-button> | |||
</div> | |||
@@ -83,6 +82,7 @@ | |||
import { getInfo } from "@/api/login/index"; | |||
import { getMember , base64Attach , userUpdate , showUserImg , deleteUserImg} from "@/api/user/index"; | |||
import {Dialog} from "vant"; | |||
import {base64Upload} from "@/api/register"; | |||
export default { | |||
name: "companyInformation", | |||
data() { | |||
@@ -98,6 +98,7 @@ export default { | |||
companyNameValue:'', | |||
fileList:[], | |||
companyNameList:[], | |||
fileListKHZM:[], | |||
form: { | |||
files:[], | |||
fileType:'', | |||
@@ -110,7 +111,6 @@ export default { | |||
idCardNum:'', | |||
realname:'', | |||
companyCode:'', | |||
companyName:'', | |||
companyNature:'', | |||
companyScope:'', | |||
companyTimeLimit:'', | |||
@@ -118,6 +118,7 @@ export default { | |||
companyCapital:'', | |||
companyLicense:'', | |||
address:'', | |||
accountOpenCert:'', | |||
}, | |||
userInfo:[], | |||
upLoadList:[] | |||
@@ -165,6 +166,13 @@ export default { | |||
this.userForm.companyLicense = response.data.companyLicense; | |||
this.userForm.address = response.data.address; | |||
if (response.data.accountOpenCert!=''){ | |||
this.fileListKHZM = [{ | |||
url:'/api'+response.data.accountOpenCert, | |||
isImage: true | |||
}]; | |||
} | |||
this.tel = response.data.phone | |||
this.getDicts("company_nature").then(res => { | |||
@@ -184,50 +192,42 @@ export default { | |||
}); | |||
}); | |||
}, | |||
afterRead(file) { | |||
afterReadKHZM(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
console.log(this.fileList) | |||
for ( var i = 0 ; i < this.fileList.length ; i++){ | |||
console.log(this.fileList[i].url) | |||
if(this.fileList[i].url == undefined&&this.fileList!='') { | |||
this.fileList[i] = {url:this.fileList[i].content, id: '', isImage: true}; | |||
} | |||
} | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.userForm.accountOpenCert = r1.fileName; | |||
}) | |||
}, | |||
deleteFile(elIndex){ | |||
if(elIndex.id != ''){ | |||
deleteUserImg(elIndex.id).then(response => {}); | |||
} | |||
deleteFileKHZM(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileList[elIndex].splice(fileIndex, 1) | |||
this.upLoadList[elIndex].splice(fileIndex, 1) | |||
this.fileListKHZM[elIndex].splice(fileIndex, 1) | |||
this.userForm.accountOpenCert = ''; | |||
} | |||
}, | |||
submitForm(){ | |||
this.form.files = []; | |||
if (this.userForm.accountOpenCert == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传开户证明', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
}) | |||
return; | |||
} | |||
userUpdate(this.userForm).then(response => { | |||
if(response.code == 200) { | |||
var imgList = []; | |||
console.log(this.fileList) | |||
for (var i = 0; i < this.fileList.length; i++) { | |||
if (this.fileList[i].url.indexOf('http') == -1 && this.fileList != '') { | |||
this.form.files.push(this.fileList[i].url); | |||
} | |||
} | |||
console.log(this.form.files) | |||
base64Attach(this.form).then(responseSecond => { | |||
if (responseSecond.code == 200) { | |||
Dialog.confirm({ | |||
title: '系统提示', | |||
message: '修改成功', | |||
confirmButtonText: '确定', | |||
Dialog.confirm({ | |||
title: '系统提示', | |||
message: '修改成功', | |||
confirmButtonText: '确定', | |||
}) | |||
.then(() => { | |||
this.onClickLeft() | |||
}) | |||
.then(() => { | |||
this.onClickLeft() | |||
}) | |||
} | |||
}); | |||
} | |||
}); | |||
} | |||
@@ -16,9 +16,14 @@ | |||
<van-field v-model="userForm.realname" label="姓名" placeholder="请输入姓名" required :rules="[{ required:true }]"/> | |||
<van-field v-model="userForm.idCardNum" label="身份证号" placeholder="请输入身份证号" required :rules="[{ required:true }]"/> | |||
<van-field v-model="userForm.address" label="联系地址" placeholder="请输入联系地址" /> | |||
<van-field name="uploader" label="上传相关附件"> | |||
<van-field name="uploader" label="身份证(正)" required> | |||
<template #input> | |||
<van-uploader :after-read="afterRead" :before-delete="deleteFile" v-model="fileList" multiple :max-count="5" /> | |||
<van-uploader :after-read="afterReadSFZ" :before-delete="deleteFileSFZ" v-model="fileListSFZ" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<van-field name="uploader" label="银行卡" required> | |||
<template #input> | |||
<van-uploader :after-read="afterReadYHK" :before-delete="deleteFileYHK" v-model="fileListYHK" multiple :max-count="1" /> | |||
</template> | |||
</van-field> | |||
<div class="submit"> | |||
@@ -32,6 +37,7 @@ | |||
import { getInfo } from "@/api/login/index"; | |||
import { getMember , base64Attach , userUpdate , showUserImg , deleteUserImg} from "@/api/user/index"; | |||
import {Dialog} from "vant"; | |||
import {base64Upload} from "@/api/register"; | |||
export default { | |||
name: "userInformation", | |||
data() { | |||
@@ -44,15 +50,19 @@ export default { | |||
fileType:'', | |||
bizPath:'transaction', | |||
tableName:'t_transaction_member', | |||
tableId:'' | |||
tableId:'', | |||
}, | |||
userForm:{ | |||
idCardNum:'', | |||
realname:'', | |||
address:'', | |||
idCardPic :'', | |||
accountOpenCert:'', | |||
}, | |||
userInfo:[], | |||
upLoadList:[] | |||
upLoadList:[], | |||
fileListSFZ:[], | |||
fileListYHK:[] | |||
}; | |||
}, | |||
created() { | |||
@@ -69,55 +79,92 @@ export default { | |||
this.userForm.address = response.data.address; | |||
this.userForm.id = response.data.id; | |||
this.form.tableId = response.data.id; | |||
this.tel = response.data.phone | |||
showUserImg(response.data.id).then(responseSecond => { | |||
console.log(responseSecond) | |||
for (var i = 0 ; i < responseSecond.data.length ; i++){ | |||
this.fileList.push({url:this.global.severApi+responseSecond.data[i].fileUrl,id:responseSecond.data[i].id}) | |||
} | |||
}); | |||
this.tel = response.data.phone; | |||
if (response.data.idCardPic!=''){ | |||
this.fileListSFZ = [{ | |||
url:'/api'+response.data.idCardPic, | |||
isImage: true | |||
}]; | |||
} | |||
if (response.data.accountOpenCert!=''){ | |||
this.fileListYHK = [{ | |||
url:'/api'+response.data.accountOpenCert, | |||
isImage: true | |||
}]; | |||
} | |||
// showUserImg(response.data.id).then(responseSecond => { | |||
// console.log(responseSecond) | |||
// for (var i = 0 ; i < responseSecond.data.length ; i++){ | |||
// this.fileList.push({url:this.global.severApi+responseSecond.data[i].fileUrl,id:responseSecond.data[i].id}) | |||
// } | |||
// }); | |||
}); | |||
}); | |||
}, | |||
afterRead(file) { | |||
afterReadSFZ(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
for ( var i = 0 ; i < this.fileList.length ; i++){ | |||
console.log(this.fileList[i].url) | |||
if(this.fileList[i].url == undefined&&this.fileList!='') { | |||
this.fileList[i] = {url:this.fileList[i].content, id: '', isImage: true}; | |||
} | |||
} | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.userForm.idCardPic = r1.fileName; | |||
}) | |||
}, | |||
deleteFile(elIndex){ | |||
if(elIndex.id != ''){ | |||
deleteUserImg(elIndex.id).then(response => {}); | |||
afterReadYHK(file) { | |||
// 此时可以自行将文件上传至服务器 | |||
let params1 = new FormData(); | |||
params1.append("file", file.content); | |||
base64Upload(params1).then((r1) => { | |||
this.userForm.accountOpenCert = r1.fileName; | |||
}) | |||
}, | |||
deleteFileSFZ(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileListSFZ[elIndex].splice(fileIndex, 1) | |||
this.userForm.idCardPic = ''; | |||
} | |||
}, | |||
deleteFileYHK(elIndex){ | |||
return (file, name) => { | |||
let fileIndex = name.index | |||
this.fileList[elIndex].splice(fileIndex, 1) | |||
this.upLoadList[elIndex].splice(fileIndex, 1) | |||
this.fileListYHK[elIndex].splice(fileIndex, 1) | |||
this.userForm.accountOpenCert = ''; | |||
} | |||
}, | |||
submitForm(){ | |||
this.form.files = []; | |||
userUpdate(this.userForm).then(response => { | |||
var imgList = []; | |||
console.log(this.fileList) | |||
for (var i = 0 ; i < this.fileList.length ; i++){ | |||
if(this.fileList[i].url.indexOf('http') == -1&&this.fileList!=''){ | |||
this.form.files.push(this.fileList[i].url); | |||
if (this.userForm.idCardPic == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传身份证', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
} | |||
console.log(this.form.files) | |||
base64Attach(this.form).then(responseSecond => { | |||
if(response.code == 200 && responseSecond.code == 200){ | |||
Dialog.confirm({ | |||
title: '系统提示', | |||
message: '修改成功', | |||
confirmButtonText: '确定', | |||
}) | |||
}) | |||
return; | |||
} | |||
if (this.userForm.accountOpenCert == ''){ | |||
this.$toast({ | |||
icon: 'error', // 找到自己需要的图标 | |||
message: '请上传银行卡', | |||
duration:"2000", | |||
onClose:function(){ | |||
} | |||
}); | |||
}) | |||
return; | |||
} | |||
userUpdate(this.userForm).then(response => { | |||
if(response.code == 200){ | |||
Dialog.confirm({ | |||
title: '系统提示', | |||
message: '修改成功', | |||
confirmButtonText: '确定', | |||
}) | |||
} | |||
}); | |||
} | |||
}, | |||