Browse Source

商户信息认证,身份证文件上传

main
daimenglei 1 month ago
parent
commit
d47d8243c7
  1. 70
      src/views/business/merchantVerification/index.vue
  2. 11
      src/views/business/userVerification/index.vue

70
src/views/business/merchantVerification/index.vue

@ -110,6 +110,45 @@
<el-form-item :label="$t('business.merchant.merchantVerification.legalPersonIdCard')" prop="legalPersonIdCard"> <el-form-item :label="$t('business.merchant.merchantVerification.legalPersonIdCard')" prop="legalPersonIdCard">
<el-input v-model="form.legalPersonIdCard" :placeholder="$t('business.merchant.merchantVerification.legalPersonIdCardPlaceholder')"/> <el-input v-model="form.legalPersonIdCard" :placeholder="$t('business.merchant.merchantVerification.legalPersonIdCardPlaceholder')"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('business.userManager.userVerification.idCardFront')" prop="idCardFrontImagePath">
<el-upload
class="upload-demo"
:action="uploadUrl"
:on-success="handleSuccess_idCardFrontImagePath"
:limit="1"
:accept="'image/jpg,image/png'"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传JPG/PNG文件且不超过5M</div>
</el-upload>
</el-form-item>
<el-form-item :label="$t('business.userManager.userVerification.idCardBack')" prop="idCardBackImagePath">
<el-upload
class="upload-demo"
:action="uploadUrl"
:on-success="handleSuccess_idCardBackImagePath"
:limit="1"
:accept="'image/jpg,image/png'"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传JPG/PNG文件且不超过5M</div>
</el-upload>
</el-form-item>
<el-form-item :label="$t('business.userManager.userVerification.idCardHolding')" prop="userWithIdCardImagePath">
<el-upload
class="upload-demo"
:action="uploadUrl"
:on-success="handleSuccess_userWithIdCardImagePath"
:limit="1"
:accept="'image/jpg,image/png'"
:file-list="fileList"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传JPG/PNG文件且不超过5M</div>
</el-upload>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">{{ $t('common.button.confirm') }}</el-button> <el-button :loading="buttonLoading" type="primary" @click="submitForm">{{ $t('common.button.confirm') }}</el-button>
@ -236,6 +275,7 @@ export default {
form: {}, form: {},
// //
auditForm: {}, auditForm: {},
fileList: [],
// //
rules: { rules: {
merchantName: [ merchantName: [
@ -244,6 +284,15 @@ export default {
legalPersonName: [ legalPersonName: [
{ required: true, message: this.$t('business.merchant.merchantVerification.legalPersonNameRequired'), trigger: "blur" } { required: true, message: this.$t('business.merchant.merchantVerification.legalPersonNameRequired'), trigger: "blur" }
], ],
idCardFrontImagePath: [
{ required: true, message: this.$t('business.userManager.userVerification.idCardFrontRequired'), trigger: "blur" }
],
idCardBackImagePath: [
{ required: true, message: this.$t('business.userManager.userVerification.idCardBackRequired'), trigger: "blur" }
],
userWithIdCardImagePath: [
{ required: true, message: this.$t('business.userManager.userVerification.idCardHoldingRequired'), trigger: "blur" }
],
legalPersonIdCard: [ legalPersonIdCard: [
{ required: true,pattern: /^\d+$/, message: this.$t('business.merchant.merchantVerification.legalPersonIdCardPattern'), trigger: "blur" } { required: true,pattern: /^\d+$/, message: this.$t('business.merchant.merchantVerification.legalPersonIdCardPattern'), trigger: "blur" }
], ],
@ -256,6 +305,12 @@ export default {
created() { created() {
this.getList(); this.getList();
}, },
computed: {
// URL
uploadUrl() {
return `${process.env.VUE_APP_BASE_API}/file/upload`;
}
},
methods: { methods: {
/** 查询商户认证信息列表 */ /** 查询商户认证信息列表 */
getList() { getList() {
@ -434,6 +489,21 @@ export default {
this.buttonLoading = false; this.buttonLoading = false;
}); });
}) })
},
handleSuccess_idCardFrontImagePath(response) {
if (response.code === 200) {
this.form.idCardFrontImagePath = response.data; // URL
}
},
handleSuccess_idCardBackImagePath(response) {
if (response.code === 200) {
this.form.idCardBackImagePath = response.data; // URL
}
},
handleSuccess_userWithIdCardImagePath(response) {
if (response.code === 200) {
this.form.userWithIdCardImagePath = response.data; // URL
}
} }
} }
}; };

11
src/views/business/userVerification/index.vue

@ -139,8 +139,6 @@
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="uploadUrl" :action="uploadUrl"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="handleSuccess_idCardBackImagePath" :on-success="handleSuccess_idCardBackImagePath"
:limit="1" :limit="1"
:accept="'image/jpg,image/png'" :accept="'image/jpg,image/png'"
@ -309,8 +307,7 @@ export default {
form: {}, form: {},
// //
auditForm: {}, auditForm: {},
fileList: [ fileList: [],
],
// //
rules: { rules: {
idCardNumber: [ idCardNumber: [
@ -527,12 +524,6 @@ export default {
}); });
}) })
}, },
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleSuccess_idCardFrontImagePath(response) { handleSuccess_idCardFrontImagePath(response) {
if (response.code === 200) { if (response.code === 200) {
this.form.idCardFrontImagePath = response.data; // URL this.form.idCardFrontImagePath = response.data; // URL

Loading…
Cancel
Save