bibi 3 years ago
parent 488781f8b5
commit 02bc803f02

@ -1,20 +1,23 @@
<template> <template>
<div class="content"> <div class="content">
<span class="back-btn" @click='back'><a-icon type="left" style='margin-right:10px' />返回</span> <span class="back-btn" @click="back"
><a-icon type="left" style="margin-right: 10px" />返回</span
>
<a-divider></a-divider> <a-divider></a-divider>
<a-form-model <a-form-model
ref="ruleForm" ref="ruleForm"
:model="form" :model="form"
:rules="rules" :rules="rules"
:label-col="inline"
layout="vertical" layout="vertical"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol"
> >
<a-form-model-item><div class="cardTitle">关联账号</div></a-form-model-item> <a-form-model-item
><div class="cardTitle">关联账号</div></a-form-model-item
>
<a-form-model-item ref="tel" label="手机号" prop="tel"> <a-form-model-item ref="tel" label="手机号" prop="tel">
<a-input <a-input
v-model="form.tel" v-model="form.tel"
style="width:60%" style="width: 60%"
placeholder="请输入手机号" placeholder="请输入手机号"
@blur=" @blur="
() => { () => {
@ -23,181 +26,241 @@
" "
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item prop='code'> <a-form-model-item label="手机验证码" prop="code">
<a-row> <a-input
<a-col :span='8' style="margin-right:10px"> placeholder="请输入验证码"
<a-input placeholder="请输入验证码" v-model="form.code"/> v-model="form.code"
</a-col> style="width: 60%; margin-right: 10px"
<a-col :span='6'> />
<a-button type="primary" @click="getCode"></a-button> <a-button type="primary" @click="getCode"></a-button>
</a-col>
</a-row>
</a-form-model-item> </a-form-model-item>
<a-form-model-item><div class="cardTitle">基础信息</div></a-form-model-item> <a-form-model-item
><div class="cardTitle">基础信息</div></a-form-model-item
>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="企业名称" prop="companyName"> <a-form-model-item label="企业名称" prop="companyName">
<a-input v-model="form.companyName" <a-input
placeholder="请输入企业名称" v-model="form.companyName"
style="width:130%" placeholder="请输入企业名称"
style="width: 130%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="社会信用代码" prop="socialCreditCode"> <a-form-model-item label="社会信用代码" prop="socialCreditCode">
<a-input v-model="form.socialCreditCode" <a-input
placeholder="请输入社会信用代码" v-model="form.socialCreditCode"
style="width:130%" placeholder="请输入社会信用代码"
style="width: 130%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="企业地址" prop="companyAddress"> <a-form-model-item label="企业地址" prop="companyAddress">
<a-cascader v-model="form.companyAddress" <a-cascader
placeholder="请选择企业地址" :options="city"
style="width:100%" :field-names="cascaderConfig"
@change="companyChange"
placeholder="请选择"
style="width: 100%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="详细地址" prop="companyAddressDetail"> <a-form-model-item label="详细地址" prop="companyAddressDetail">
<a-input v-model="form.companyAddressDetail" <a-input
placeholder="请输入详细地址" v-model="form.companyAddressDetail"
style="width:130%" placeholder="请输入详细地址"
style="width: 130%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="法人姓名" prop="legalPersonName"> <a-form-model-item label="法人姓名" prop="legalPersonName">
<a-input v-model="form.legalPersonName" <a-input
placeholder="请输入法人姓名" v-model="form.legalPersonName"
style="width:130%" placeholder="请输入法人姓名"
style="width: 130%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='12'> <a-col :span="12">
<a-form-model-item label="法人身份证号" prop="legalPersonIdCard"> <a-form-model-item label="法人身份证号" prop="legalPersonIdCard">
<a-input v-model="form.legalPersonIdCard" <a-input
placeholder="请输入法人身份证号" v-model="form.legalPersonIdCard"
style="width:130%" placeholder="请输入法人身份证号"
style="width: 130%"
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<!-- licenseTimeStart licenseTimeEnd --> <!-- licenseTimeStart licenseTimeEnd -->
<a-form-model-item label="营业执照有效期限"> <a-row>
<a-range-picker @change="onChange" /> <a-col :span="12">
</a-form-model-item> <a-form-model-item
label="营业执照有效期限开始时间"
prop="licenseTimeStart"
>
<a-date-picker v-model="form.licenseTimeStart" value-format="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item
label="营业执照有效期限结束时间(如长期可不选)"
prop="licenseTimeEnd"
>
<a-date-picker v-model="form.licenseTimeEnd" value-format="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
</a-row>
<a-form-model-item label="法人身份证"> <a-form-model-item label="法人身份证">
<span><span style="color:#1F519B">请上传法人身份证正面照反面照</span>文件大小不超过5mb支持jpgpng格式</span> <span
><span style="color: #1f519b">请上传法人身份证正面照反面照</span
>文件大小不超过5mb支持jpgpng格式</span
>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
头像面 头像面
<!-- idCardFrontImgUrls --> <!-- idCardFrontImgUrls -->
<div class="uploadImg">+</div> <commonUpload @handleChange='handleChange($event,1)'/>
</a-col> </a-col>
<a-col :span='12'> <a-col :span="12">
国徽面 国徽面
<!-- idCardBackImgUrls --> <!-- idCardBackImgUrls -->
<div class="uploadImg">+</div> <commonUpload @handleChange='handleChange($event,2)'/>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="营业执照"> <a-form-model-item label="营业执照">
<!-- businessLicenseImgUrls --> <!-- businessLicenseImgUrls -->
<span><span style="color:#1F519B">请上传公司营业执照</span>文件大小不超过5mb支持jpgpng格式</span> <span
><span style="color: #1f519b">请上传公司营业执照</span
>文件大小不超过5mb支持jpgpng格式</span
>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
公司营业执照 公司营业执照
<div class="uploadImg">+</div> <commonUpload @handleChange='handleChange($event,3)'/>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model-item> </a-form-model-item>
<!-- othersImgUrls --> <!-- othersImgUrls -->
<a-form-model-item label="其他附件"> <a-form-model-item label="其他附件">
<span><span style="color:#1F519B">如从事某些特定行业需要上传对应的资质证书</span>文件大小不超过5mb支持jpgpng格式</span> <span
><span style="color: #1f519b"
>如从事某些特定行业需要上传对应的资质证书</span
>文件大小不超过5mb支持jpgpng格式</span
>
<a-row> <a-row>
<a-col :span='12'> <a-col :span="12">
<div class="uploadImg">+</div> <commonUpload @handleChange='handleChange($event,4)'/>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="联系人姓名" prop='contactsName'> <a-form-model-item label="联系人姓名" prop="contactsName">
<a-input style="width:60%" v-model="form.contactsName"></a-input> <a-input style="width: 60%" v-model="form.contactsName"></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="联系人邮箱" prop='contactsTel'> <a-form-model-item label="联系人电话" prop="contactsTel">
<a-input style="width:60%" v-model="form.contactsTel"></a-input> <a-input style="width: 60%" v-model="form.contactsTel"></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="联系人电话" prop='contactsEmail'> <a-form-model-item label="联系人邮箱" prop="contactsEmail">
<a-input style="width:60%" v-model="form.contactsEmail"></a-input> <a-input style="width: 60%" v-model="form.contactsEmail"></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="联系人地址" prop='contactsAddress'> <a-form-model-item label="联系人地址" prop="contactsAddress">
<a-cascader style="width:60%" v-model="form.contactsAddress"></a-cascader> <a-cascader
:options="city"
placeholder="请选择"
:field-names="cascaderConfig"
@change="contactChange"
style="width: 60%"
></a-cascader>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="联系人详细地址" prop='contactsAddressDetail'> <a-form-model-item label="联系人详细地址" prop="contactsAddressDetail">
<a-input style="width:60%" v-model="form.contactsAddressDetail"></a-input> <a-input
style="width: 60%"
v-model="form.contactsAddressDetail"
></a-input>
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div style="text-align:center"> <div style="text-align: center">
<a-button type="primary" @click="onSubmit"> </a-button> <a-button type="primary" @click="onSubmit"> </a-button>
<a-button style="margin-left: 10px" @click="resetForm"> <a-button style="margin-left: 10px" @click="resetForm"> </a-button>
重置
</a-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { settledInsert } from "@/api/basic/console" import { settledInsert } from "@/api/basic/console";
import { allCity } from "@/api/public";
import { form, rules, cascaderConfig } from "./depend/settledForm";
export default { export default {
data() { data() {
return { return {
// //
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 10 }, wrapperCol: { span: 10 },
other: "", cascaderConfig,
form: { form,
tel: "", rules,
code:'', city: [],
name: "",
address:""
},
rules: {
tel: [
{
required: true,
message: "请输入手机号",
trigger: "blur",
},
{
min: 11,
max: 11,
message: "手机号长度必须为 11 位",
trigger: "blur",
},
],
},
}; };
}, },
mounted() {
this.getCity();
},
methods: { methods: {
async getCity() {
let res = await allCity();
this.city = res.data;
},
// //
getCode(){}, getCode() {},
companyChange(data) {
this.form.companyAddress = data[2];
},
contactChange(data) {
this.form.contactsAddress = data[2];
},
handleChange(data,type) {
console.log(data);
switch (type) {
case 1:
this.form.idCardFrontImgUrls[0] = data[0].response.data
break;
case 2:
this.form.idCardBackImgUrls[0] = data[0].response.data
break;
case 3:
this.form.businessLicenseImgUrls[0] = data[0].response.data
break;
case 4:
this.form.othersImgUrls[0] = data[0].response.data
break;
default:
break;
}
},
onSubmit() { onSubmit() {
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
let res = await settledInsert(this.form) let res = await settledInsert(this.form);
if(res.code===200){ if (res.code === 200) {
this.$message.success(res.msg) this.$message.success(res.msg);
}else{ this.back()
this.$message.error(res.msg) } else {
this.$message.error(res.msg);
} }
} }
}); });
}, },
back() {
this.$router.go(-1)
},
// //
resetForm() { resetForm() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
@ -212,22 +275,16 @@ export default {
padding-left: 125px; padding-left: 125px;
padding-top: 48px; padding-top: 48px;
} }
.cardTitle{ .cardTitle {
margin-left: -10px; margin-left: -10px;
margin-bottom: -10px; margin-bottom: -10px;
} }
/deep/.ant-col .ant-form-item-label{ /deep/.ant-col .ant-form-item-label {
margin-top: -10px; margin-top: -10px;
} }
.uploadImg{ .com-name{
background: #0000000A; font-size: 20px;
border:2px solid #00000029; font-weight: 500;
color: #00000029; line-height: 26px;
width: 180px;
height: 120px;
text-align: center;
line-height: 110px;
font-size:60px;
cursor: pointer;
} }
</style> </style>
Loading…
Cancel
Save