初始化项目

This commit is contained in:
18500206848
2024-02-02 14:51:50 +08:00
parent dc7051417b
commit 12664d0204
681 changed files with 1 additions and 142886 deletions

View File

@@ -1,232 +0,0 @@
<template>
<div v-loading="loading">
<el-row>
<el-col :sm="24" :md="{ span: 12, offset: 6 }">
<el-form
:model="form"
ref="form"
class="content"
label-position="right"
label-width="140px"
:rules="rules"
>
<el-form-item label="企业名称" prop="companyName">
<el-input
maxlength="50"
placeholder="请输入"
v-model.trim="form.companyName"
></el-input>
</el-form-item>
<el-form-item label="统一社会信用代码" prop="companyTid">
<el-input
placeholder="请输入18位有效社会统一信用代码"
v-model.trim="form.companyTid"
></el-input>
</el-form-item>
<el-form-item label="所在地区" prop="cityId">
<jl-city-cascader
:disabled="disabled"
v-model="form.cityId"
></jl-city-cascader>
</el-form-item>
<el-form-item label="详细地址" prop="companyAddress">
<el-input
placeholder="请输入"
v-model.trim="form.companyAddress"
></el-input>
</el-form-item>
<el-form-item label="所属行业" prop="tradeId">
<el-select placeholder="请选择" v-model="form.tradeId">
<el-option
v-for="item in tradeDic"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="企业营业执照:" prop="authUrlId">
<el-upload
:action="putFile"
:show-file-list="false"
:on-progress="
() => {
uploading = true;
}
"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:http-request="httpRequest"
>
<div v-loading="uploading">
<img
class="companyInfo-upload-image"
:src="form.authUrlId || imageUrl"
/>
</div>
<!-- <div class="companyInfo-upload-tip" slot="tip">
请上传营业执照
</div> -->
</el-upload>
<p class="uploadImgP">上传图片大小限制2M以内</p>
</el-form-item>
<el-form-item>
<el-button @click="next" type="primary">下一步</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</template>
<script>
import { putFile } from "@/api/resource/oss";
import { getTradeDic } from "@/api/manage/trade";
import { checkIdentity } from "@/api/tenant/auth";
import lodash from "lodash";
import httpRequest from "./httpRequest";
const accept = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"];
export default {
props: {
value: Object,
},
data() {
const validateId = (rule, value, callback) => {
checkIdentity(value)
.then(() => {
callback();
})
.catch((err) => {
callback(err);
this.$message.closeAll();
});
};
return {
uploading: false,
putFile,
imageUrl: "/img/license.png",
rules: {
companyName: [
{ required: true, message: "请输入企业名称", trigger: "blur" },
],
companyTid: [
{
required: true,
message: "请输入统一社会信用代码",
trigger: "blur",
},
{
max: 18,
min: 18,
trigger: "blur",
message: "请输入18位有效社会统一信用代码",
},
{
trigger: "blur",
validator: validateId,
},
],
cityId: [
{
required: true,
message: "请选择所在地区",
trigger: "blur",
},
],
companyAddress: [
{
required: true,
message: "请输入详细地址",
trigger: "blur",
},
],
tradeId: [
{
required: true,
message: "请选择所属行业",
trigger: "blur",
},
],
authUrlId: [
{
required: true,
message: "请上传营业执照",
trigger: "change",
},
],
},
form: lodash.clone(this.value || {}),
tradeDic: [],
};
},
created() {
this.init();
},
methods: {
init() {
getTradeDic(true).then((res) => {
this.tradeDic = res.data.data;
});
},
next() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$emit("submit", this.form);
this.$emit("input", this.form);
}
});
},
/**上传图片**/
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
this.$set(this.form, "authUrlId", res.data.link);
this.uploading = false;
},
beforeAvatarUpload(file) {
const isJPG = accept.includes(file.type);
const is2M=file.size/1024/1024<2;
if (!isJPG) {
this.$message.error("图片格式不正确!");
}
if(!is2M){
this.$message.error("上传图片大小不能超过2M!");
}
return isJPG && is2M;
},
/**上传图片*/
httpRequest,
},
watch: {
value(val) {
this.form = val;
},
form: {
handler(val) {
this.$emit("input", val);
},
deep: true,
},
},
};
</script>
<style scoped>
.companyInfo-upload-image {
height: 100px;
width: 160px;
}
.companyInfo-upload-tip {
line-height: 12px;
font-size: 12px;
color: #999999;
}
.el-form-item__content{
line-height: normal;
}
.uploadImgP{
padding: 0;
margin: 0;
line-height: 18px;
}
</style>

View File

@@ -1,59 +0,0 @@
<template>
<basic-container>
<div class="waiting-check">
<div>
<i class="waiting-check-icon el-icon-success"></i>
</div>
<div class="waiting-check-title">认证审核成功</div>
<div class="waiting-check-tip">
<div>请重新登录</div>
</div>
</div>
</basic-container>
</template>
<script>
export default {
props: {
status: Number,
remarks: String,
},
data() {
return {
height: 100,
};
},
mounted() {},
methods: {},
};
</script>
<style scoped>
.waiting-check {
height: 207px;
margin: 0 auto;
text-align: center;
}
.waiting-check-icon {
font-size: 72px;
}
.waiting-check-icon.el-icon-success {
font-size: 72px;
color: #5aa0fa;
}
.waiting-check-title {
font-family: PingFangSC-Medium;
font-size: 24px;
color: #4f5e7b;
letter-spacing: 0;
text-align: center;
line-height: 24px;
margin: 36px auto 16px auto;
}
.waiting-check-tip {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #999999;
letter-spacing: 0;
text-align: center;
margin-bottom: 16px;
}
</style>

View File

@@ -1,22 +0,0 @@
/**上传图片*/
import {putFileFun} from '@/api/resource/oss';
import compress from '@/util/compress';
export default ({file, onProgress, onError, onSuccess}) => {
onProgress({percent: 0});
compress(file, 300)
.then(({compressedFile}) => {
putFileFun(
compressedFile,
(progressEvent) => {
let complete =
((progressEvent.loaded / progressEvent.total) * 100) | 0;
onProgress({percent: complete});
})
.then((res) => {
onSuccess(res.data, compressedFile);
})
.catch(onError);
})
.catch(onError);
}

View File

@@ -1,142 +0,0 @@
<template>
<basic-container>
<div class="registerSteps">
<!--
<el-steps :active="active" align-center process-status="finish">
<el-step title="企业信息"></el-step>
<el-step title="法人认证"></el-step>
<el-step title="等待审核"></el-step>
<el-step title="完成认证"></el-step>
</el-steps>-->
<div class="pageContainer">
<company-info
v-model="form"
v-show="active === 0"
@submit="setCompany"
></company-info>
<legal-person
v-model="form"
v-show="active === 1"
@submit="setMaster"
:go-back="goBack"
></legal-person>
<waiting-check
:status="form.status"
:remarks="form.remarks"
v-show="active === 2"
@submit="
() => {
active = 0;
}
"
></waiting-check>
<finish v-show="active === 3"></finish>
</div>
</div>
</basic-container>
</template>
<script>
import { getBaseDetail } from "@/api/tenant/company";
import { submit } from "@/api/tenant/auth";
import CompanyInfo from "./companyInfo";
import LegalPerson from "./legalPerson";
import WaitingCheck from "./waitingCheck";
import finish from "./finish";
export default {
components: {
CompanyInfo,
LegalPerson,
WaitingCheck,
finish,
},
data() {
return {
form: {
companyName: "",
companyTid: "",
cityId: "",
companyAddress: "",
tradeId: "",
authUrlId: "",
masterName: "",
masterIdentity: "",
identityUrl4Id: "",
identityUrl5Id: "",
status: -1,
},
company: {},
active: 0,
};
},
created() {
this.getInfo(() => {
if (this.form.status === 1) {
this.createTimer();
}
});
if (this.auth === "1") {
this.active = 2;
}
console.log('auth:'+this.active);
},
methods: {
/*获取基本信息*/
getInfo(cb) {
getBaseDetail().then((res) => {
console.log(res)
this.form = res.data.data;
cb && cb();
if (this.form.status === 0) {
this.active = 3;
}
});
},
goBack() {
this.active--;
},
setCompany(info) {
this.company = info;
this.active = 1;
},
setMaster(info, cb) {
this.master = info;
submit({ ...this.company, ...info })
.then(() => {
cb && cb();
this.$store.commit("SET_AUTH", "1");
this.active = 2;
this.form.status = 1;
this.createTimer();
})
.catch((err) => {
cb && cb(err);
});
},
createTimer() {
const timer = setInterval(() => {
this.getInfo(() => {
if (this.form.status !== 1) {
clearInterval(timer);
}
});
}, 60000);
},
},
watch: {},
computed: {
auth() {
return this.$store.state.user.auth;
},
},
};
</script>
<style>
.registerSteps,
.pageContainer {
margin-top: 15px;
}
</style>

View File

@@ -1,197 +0,0 @@
<template>
<div v-loading="loading">
<el-row>
<el-col :sm="24" :md="{ span: 12, offset: 6 }">
<el-form
:model="form"
ref="form"
class="content"
label-position="right"
label-width="140px"
:rules="rules"
>
<el-form-item label="法人名称:" prop="masterName">
<el-input
placeholder="请输入法人名称"
v-model.trim="form.masterName"
></el-input>
</el-form-item>
<el-form-item label="法人身份证号:" prop="masterIdentity">
<el-input
placeholder="请输入法人身份证号"
v-model.trim="form.masterIdentity"
></el-input>
</el-form-item>
<el-form-item label="上传身份证件:" prop="identityUrl4Id">
<el-upload
:action="putFile"
:show-file-list="false"
:on-progress="
() => {
uploading.identityUrl4Id = true;
}
"
:on-success="handleAvatarSuccess('identityUrl4Id')"
:before-upload="beforeAvatarUpload"
:http-request="httpRequest"
>
<div v-loading="uploading.identityUrl4Id">
<img
class="companyInfo-upload-image"
:src="form.identityUrl4Id || identityUrl4Id"
/>
</div>
<!-- <div class="companyInfo-upload-tip" slot="tip">
点击上传身份证(头像面)
</div> -->
</el-upload>
<p class="uploadImgP">上传图片大小限制2M以内</p>
</el-form-item>
<el-form-item prop="identityUrl5Id">
<el-upload
:action="putFile"
:show-file-list="false"
:on-progress="
() => {
uploading.identityUrl5Id = true;
}
"
:on-success="handleAvatarSuccess('identityUrl5Id')"
:before-upload="beforeAvatarUpload"
:http-request="httpRequest"
>
<div v-loading="uploading.identityUrl5Id">
<img
class="companyInfo-upload-image"
:src="form.identityUrl5Id || identityUrl5Id"
/>
</div>
<!-- <div class="companyInfo-upload-tip" slot="tip">
点击上传身份证(国徽面)
</div> -->
</el-upload>
<p class="uploadImgP">上传图片大小限制2M以内</p>
</el-form-item>
<el-form-item>
<el-button @click="next" type="primary">提交</el-button>
<el-button @click="goBack">上一步</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</template>
<script>
import { check18IdCardNo } from "@/util/validate";
import { putFile } from "@/api/resource/oss";
import lodash from "lodash";
import httpRequest from "./httpRequest";
const accept = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"];
export default {
props: {
goBack: Function,
value: Object,
},
data() {
const validateIdNumber = (rule, value, callback) => {
if (check18IdCardNo(value)) {
callback();
} else {
callback(new Error("身份证格式不正确"));
}
};
return {
loading: false,
putFile,
uploading: { identityUrl4Id: false, identityUrl5Id: false },
identityUrl4Id: "/img/idcard-h.png",
identityUrl5Id: "/img/idcard-e.png",
rules: {
masterName: [
{ required: true, message: "请输入法人姓名", trigger: "blur" },
],
masterIdentity: [
{ required: true, message: "请输入法人身份证号", trigger: "blur" },
{ trigger: "blur", validator: validateIdNumber },
],
identityUrl4Id: [
{
required: true,
message: "请上传身份证头像面",
trigger: "change",
},
],
identityUrl5Id: [
{
required: true,
message: "请上传身份证国徽面",
trigger: "change",
},
],
},
form: lodash.clone(this.value || {}),
};
},
methods: {
next() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
this.$emit("submit", this.form, () => {
this.loading = false;
});
}
});
},
/**上传图片**/
handleAvatarSuccess(type) {
return (res, file) => {
this[type] = URL.createObjectURL(file.raw);
this.$set(this.form, type, res.data.link);
this.$set(this.uploading, type, false);
};
},
beforeAvatarUpload(file) {
const isJPG = accept.includes(file.type);
const is2M=file.size/1024/1024<2;
if (!isJPG) {
this.$message.error("图片格式不正确!");
}
if(!is2M){
this.$message.error("上传图片大小不能超过2M!");
}
return isJPG && is2M;
},
/**上传图片*/
httpRequest,
},
watch: {
value(val) {
this.form = val;
},
form: {
handler(val) {
this.$emit("input", val);
},
deep: true,
},
},
computed: {},
};
</script>
<style scoped>
.el-form-item__content{
line-height: normal;
}
.uploadImgP{
padding: 0;
margin: 0;
line-height: 18px;
}
.companyInfo-upload-image {
height: 100px;
width: 160px;
}
</style>

View File

@@ -1,82 +0,0 @@
<template>
<basic-container>
<div class="waiting-check" v-if="status != 0">
<div>
<i class="waiting-check-icon el-icon-success"></i>
</div>
<div class="waiting-check-title">信息提交成功</div>
<div class="waiting-check-tip">我们将在3-5天内完成审核请保持电话畅通有问题请联系业务人员或者客服185-0020-6848</div>
</div>
<div class="waiting-check" v-else-if="status === 2">
<div>
<i class="waiting-check-icon el-icon-error"></i>
</div>
<div class="waiting-check-title">信息审核失败</div>
<div class="waiting-check-tip">
<p>请联系业务人员或者客服提交材料重新审核</p>
<p>客服电话185-0020-6848</p>
</div>
<!--<div class="waiting-check-tip">{{remarks}}</div>-->
<!--
<el-button type="primary" @click="$emit('submit')">重新编辑</el-button>
-->
</div>
</basic-container>
</template>
<script>
export default {
props: {
status: Number,
remarks: String,
},
data() {
return {
height: 100,
};
},
mounted() {},
methods: {},
};
</script>
<style scoped>
.waiting-check {
height: 207px;
margin: 0 auto;
text-align: center;
}
.waiting-check-icon {
font-size: 72px;
}
.waiting-check-icon.el-icon-success {
font-size: 72px;
color: #64c83c;
}
.waiting-check-icon.el-icon-error {
font-size: 72px;
color: #fa6e6e;
}
.waiting-check-title {
font-family: PingFangSC-Medium;
font-size: 24px;
color: #4f5e7b;
letter-spacing: 0;
text-align: center;
line-height: 24px;
margin: 36px auto 16px auto;
}
/*.waiting-check-tip {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #999999;
letter-spacing: 0;
text-align: center;
margin-bottom: 16px;
}*/
.waiting-check-tip {
font-size: 20px;
color: #333333;
letter-spacing: 0;
text-align: center;
margin-bottom: 16px;
}
</style>