Files
jjx-web/pages/user/components/personal.vue
T
2023-11-29 16:38:19 +08:00

460 lines
22 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view>
<el-card>
<div slot="header" class="clearfix">
<div class="flex justify-between items-center text-main">
<div class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square" style="height: 24px"/>
<span class="text-40" v-if="vk.getVuex('$user.userInfo.accountType') === 1">个人认证</span>
<span class="text-40" v-if="vk.getVuex('$user.userInfo.accountType') === 2">企业认证</span>
<div class="ml-20 flex justify-start items-center" v-if="!form1.data.fadadaConfirm">
<info theme="outline" size="18" fill="#a92924" strokeLinecap="square" style="height: 18px"/>
<span v-if="vk.getVuex('$user.userInfo.accountType') === 1">您还未提交您的个人资料</span>
<span v-if="vk.getVuex('$user.userInfo.accountType') === 2">您还未提交您的企业资料</span>
</div>
</div>
<el-button type="primary" plain class="empty-bg-plain-btn" size="small">制作我的名片</el-button>
</div>
</div>
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:footer-show="false"
:before-action="form1.props.beforeAction" :rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading" :auto-close="true" label-width="140px"
@success="onFormSuccess1">
<template v-slot:toFadada="{form, keyName}">
<el-button @click="getCertUrl" type="primary" size="small">去认证</el-button>
</template>
<template v-slot:accountAuth="{form, keyName}">
<div>
<p>请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。</p>
<div>
<span>户名:金久信</span>
<span class="ml-35">开户行:中国广发银行南宁支行</span>
<span class="ml-35">账号:6222XXXXX</span>
</div>
</div>
</template>
<template v-slot:manageList="{form, keyName}">
<div class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square" style="height: 24px"/>
<span class="text-40 mr-35">企业授权人信息</span>
<el-button type="primary" size="small" @click.native="addManage" v-if="manageList.length === 0">
添加授权人
</el-button>
</div>
</template>
</vk-data-form>
<view v-for="(item, index) in manageList" :key="index">
<manage-list v-model="manageList[index]"/>
</view>
<el-button type="primary" @click.native="allSubmit" v-if="form1.data.authType === 2">{{
vk.getVuex('$user.userInfo.accountType') === 2 ? '提交企业认证' : '提交个人认证'
}}
</el-button>
</el-card>
</view>
</template>
<script>
import {IdCard, Info} from '@icon-park/vue'
import ManageList from "./manageList.vue";
var _ = require('lodash');
export default {
components: {ManageList, IdCard, Info},
data() {
// 页面数据变量
return {
manageList: [],
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
person: {},
company: {},
manager: {},
fadadaConfirm: false,
authType: 1,
},
// 表单属性
props: {
// 表单请求地址
action: "user/kh/setCertification",
// 表单字段显示规则
columns: [
{
key: "authType", title: "认证方式", type: "radio",
data: [
{value: 1, label: "法大大接口认证"},
{value: 2, label: "后台审核认证"},
],
showRule: ({fadadaConfirm}) => {
return fadadaConfirm
},
},
{
key: "toFadada", title: "认证方式", type: "html",
showLabel: false,
showRule: (formData) => {
return formData.authType === 1 && (!formData.hasOwnProperty('fadadaConfirm') || !formData.fadadaConfirm)
},
},
{
key: "person",
title: "个人",
type: "object",
showLabel: false,
showRule: (formData) => {
return vk.getVuex('$user.userInfo.accountType') === 1
},
columns: [{
key: "personName",
title: "姓名",
type: "text",
readonly: true,
disabled: true
},
{
key: "idCard",
title: "身份证号",
type: "text",
readonly: true,
disabled: true
},
{
key: "bankCardNo",
title: "银行卡号",
type: "text",
readonly: true,
disabled: true
},
{
key: "mobile",
title: "手机号",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "company",
title: "企业信息",
type: "object",
showLabel: false,
showRule: (formData) => {
return vk.getVuex('$user.userInfo.accountType') === 2
&& (formData.authType === 2 || (formData.hasOwnProperty('fadadaConfirm') && formData.fadadaConfirm))
},
columns: [
{
key: "", title: "", type: "group", justify: "start",
columns: [
{
key: "companyName",
title: "企业名称",
type: "text",
readonly: true,
disabled: true
},
{
key: "organization",
title: "统一社会信用代码",
type: "text",
},
]
},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{key: "addressRegion", title: "公司所在地", type: "address",},
{
key: "addressDetail",
title: "详细地址",
type: "text",
showLabel: false,
placeholder: "详细地址",
},
]
},
{
key: "mailAddress",
title: "有效通信地址",
type: "text",
placeholder: "请输入您的通信地址",
},
{
key: "contactEmail",
title: "有效邮箱地址",
type: "text",
placeholder: "请输入您的邮箱地址",
},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{
key: "companyAccount",
title: "对公账号",
type: "text",
placeholder: "请输入对公账号",
},
{
key: "companyBankName",
title: "开户行",
type: "text",
placeholder: "请输入开户行",
},
]
},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{
key: "personAccount",
title: "个人账号",
type: "text",
placeholder: "请输入个人账号",
},
{
key: "personBankName",
title: "个人开户行",
type: "text",
placeholder: "请输入个人开户行",
},
]
},
{key: "accountName", title: "户名", type: "text", placeholder: "请输入户名",},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{key: "organizationPath", title: "上传营业执照", type: "image", limit: 1},
{key: "businessType", title: "经营类目", type: "text"},
]
},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{key: "invoiceInfo", title: "上传开票资料", type: "image", limit: 1},
{
key: "taxType", title: "", type: "radio", showLabel: false,
data: [
{value: "一般纳税人", label: "一般纳税人"},
{value: "小规模纳税人", label: "小规模纳税人"},
{value: "其他", label: "其他"},
],
},
]
},
{key: "taxImage", title: "纳税人资格", type: "image", limit: 1},
],
},
{
key: "accountAuth", title: "平台交易账号认证", type: "html", showRule: (formData) => {
return vk.getVuex('$user.userInfo.accountType') === 2
&& (formData.authType === 2 || (formData.hasOwnProperty('fadadaConfirm') && formData.fadadaConfirm))
},
},
{
key: "manageList", title: "", type: "html", showLabel: false, showRule: (formData) => {
return vk.getVuex('$user.userInfo.accountType') === 2
&& (formData.authType === 2 || (formData.hasOwnProperty('fadadaConfirm') && formData.fadadaConfirm))
},
},
{
key: "manager",
title: "代理人",
type: "object",
showLabel: false,
showRule: (formData) => {
return formData.manager.personName != null
},
columns: [{
key: "personName",
title: "代理人",
type: "text",
readonly: true,
disabled: true
},
{
key: "idCard",
title: "代理人身份证号",
type: "text",
readonly: true,
disabled: true
},
{
key: "mobile",
title: "代理人电话",
type: "text",
readonly: true,
disabled: true
},
]
},
// {
// key: "bankCardNo",
// title: "银行卡号",
// type: "text",
// disabled: true,
// // tips: `请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。\r\n,
// // 户名:金久信开户行:中国广发银行南宁支行账号:622252 20151145678XX'`
// },
// {
// key: "mailAddress",
// title: "有效通讯地址",
// type: "text"
// },
// {
// key: "contactQq",
// title: "QQ号码",
// type: "text",
// },
// {
// key: "contactEmail",
// title: "邮箱",
// type: "text",
// },
// {
// key: "",
// title: "",
// type: "group",
// justify: "start",
// columns: [{
// key: "contactWechatImage",
// title: "微信二维码",
// type: "image",
// limit: 1
// },
// {
// key: "contactWechat",
// title: "微信号",
// type: "text",
// },
// ]
// },
// {
// key: "bank_name",
// title: "开户行",
// type: "text",
// },
// {
// key: "bank_account_name",
// title: "户名",
// type: "text",
// },
],
// 表单验证规则
rules: {
mailAddress: [{
required: true,
message: "通讯地址不能为空",
trigger: ['blur', 'change']
}],
contactQq: [{
required: true,
message: "QQ号码不能为空",
trigger: ['blur', 'change']
}],
contactWechat: [{
required: true,
message: "微信不能为空",
trigger: ['blur', 'change']
}],
contactWechatImage: [{
required: true,
message: "微信二维码不能为空",
trigger: ['blur', 'change']
}],
contactEmail: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}, {
validator: vk.pubfn.validator("email"),
message: '邮箱格式错误',
trigger: 'blur'
}],
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
// const newFormData = _.pick(formData, ['contactWechat', 'contactEmail',
// 'contactWechatImage', 'contactQq', 'mailAddress'
// ])
vk.userCenter.updateUser({
data: {...formData, ...{manager: this.manageList[0]}},
success: (data) => {
// 成功后的逻辑
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
};
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.form1.data = _.pick(data.userInfo, [
'fadadaConfirm', 'person', 'company', 'manager', 'contactWechat',
'contactEmail', 'contactWechatImage', 'contactQq', 'mailAddress'
])
// if (!this.form1.data.hasOwnProperty('fadadaConfirm') || !this.form1.data.fadadaConfirm) this.form1.data.authType = 1
// this.form1.data.authType = 2
if (data.userInfo.fadadaConfirm && data.userInfo.businessCard == null) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
}
}
});
},
onFormSuccess1() {
console.log(123);
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
addManage() {
this.manageList.push({})
},
allSubmit() {
// this.form1.data.manager = this.manageList[0]
this.$refs.form1.submitForm()
}
}
}
</script>
<style scoped>
</style>