From 29f79ffbde54016168714b02cd1c77b464bf229a Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期五, 29 四月 2022 16:53:21 +0800
Subject: [PATCH] 用户注册
---
src/api/login.js | 2
src/views/login/register.vue | 1139 +++++---------------------------------------------------
src/views/login/components/login-form.vue | 18
3 files changed, 137 insertions(+), 1,022 deletions(-)
diff --git a/src/api/login.js b/src/api/login.js
index ab903dc..54261e3 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -51,7 +51,7 @@
},
url: process.env.BASE_API+'/register/add',
method: 'post',
- data:data
+ data
})
}
diff --git a/src/views/login/components/login-form.vue b/src/views/login/components/login-form.vue
index 1d73ecd..c62ea37 100644
--- a/src/views/login/components/login-form.vue
+++ b/src/views/login/components/login-form.vue
@@ -44,6 +44,12 @@
</span>
</el-button>
</div>
+
+ <div style="padding-top: 20px" class="login-form-button">
+ <el-button class="register-btn" @click="handleRegister">
+ <span style="color: black">注册</span>
+ </el-button>
+ </div>
</div>
<!-- <el-form ref="loginForm" :model="loginForm" :rules="loginRules" :inline="false" class="loginForm" @keydown.enter.native="handleSubmit">-->
<!-- <div class="title-container">-->
@@ -133,6 +139,9 @@
created(){
},
methods: {
+ handleRegister(){
+ this.$router.push({path:'/register'})
+ },
showLoginPwd() {
if (this.loginPasswordType === 'password') {
this.loginPasswordType = ''
@@ -232,8 +241,15 @@
}
.login-form-login-button {
width: 364px;
- height: 48px;
+ height: 40px;
background: #4778FF;
border-radius: 4px;
}
+
+ .register-btn{
+ width: 364px;
+ height: 40px;
+ color: white;
+ border-radius: 4px;
+ }
</style>
diff --git a/src/views/login/register.vue b/src/views/login/register.vue
index ddf5bd9..c3c8547 100644
--- a/src/views/login/register.vue
+++ b/src/views/login/register.vue
@@ -4,25 +4,12 @@
<span class="register_main_body_span">用户注册</span>
</div>
<div class="register_main_form">
- <el-form :model="registerForm" :rules="rules" ref="ruleForm" label-width="200px">
+ <el-form :model="registerForm" :rules="rules" ref="ruleForm" label-width="150px">
<el-row>
<el-col :span="20">
- <el-form-item label="企业名称" prop="enterprisename">
- <el-input v-model="registerForm.enterprisename" @change="checkNameAndNumber('name')"></el-input>
+ <el-form-item label="姓名" prop="realname">
+ <el-input v-model="registerForm.realname"></el-input>
</el-form-item>
- </el-col>
- <el-col :span="4" style="margin-top:10px;" v-if="showName">
- <span style="margin-left:5px;color: red">企业名称已存在</span>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="20">
- <el-form-item label="企业编号" prop="enterprisenumber">
- <el-input v-model="registerForm.enterprisenumber" @change="checkNameAndNumber('number')"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="4" style="margin-top:10px;" v-if="showNumber">
- <span style="margin-left:5px;color: red">企业编号已存在</span>
</el-col>
</el-row>
<el-row>
@@ -33,943 +20,118 @@
</el-col>
</el-row>
<el-row>
- <el-form-item label="企业类型" prop="type">
- <el-select v-model="registerForm.type" @change="showMaterial">
- <el-option
- v-for="item in typeList"
- :key="item.id"
- :value="item.name"
- :label="item.name"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-row>
- <el-row>
<el-col :span="20">
- <el-form-item label="经营范围" prop="businessrange">
- <el-input v-model="registerForm.businessrange"></el-input>
+ <el-form-item label="手机号(账户)" prop="username">
+ <el-input v-model="registerForm.username" ref="tel"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="20">
- <el-form-item label="负责人" prop="legalperson">
- <el-input v-model="registerForm.legalperson"></el-input>
+ <el-form-item label="身份证" prop="idcard">
+ <el-input v-model="registerForm.idcard" ref="idcard"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
- <el-col :span="20">
- <el-form-item label="负责人手机号" prop="legalpersonphone">
- <el-input v-model="registerForm.legalpersonphone"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="许可证开始时间" prop="licensestart">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.licensestart"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="许可证结束时间" prop="licenseend">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.licenseend"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="省:" prop="province">
- <el-select v-model="registerForm.province" clearable filterable @change="changeArea('province')">
- <el-option
- v-for="item in provinceList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="市:" prop="city">
- <el-select v-model="registerForm.city" clearable filterable @change="changeArea('city')">
- <el-option
- v-for="item in cityList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="区/县:" prop="district">
- <el-select v-model="registerForm.district" clearable filterable @change="changeArea('district')">
- <el-option
- v-for="item in districtList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="街道:" prop="street">
- <el-select v-model="registerForm.street" clearable filterable @change="changeArea('street')">
- <el-option
- v-for="item in streetList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="居委会:" prop="committee">
- <el-select v-model="registerForm.committee" clearable filterable @change="changeArea('committee')">
- <el-option
- v-for="item in committeeList"
- :key="item.id"
- :label="item.name"
- :value="item.name"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="20">
- <el-form-item label="详细地址" prop="address">
- <el-input v-model="registerForm.address"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="longMaterial">
- <el-form-item label="企业营业执照、生产许可证:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="businessLicense"
- :on-change="handleChangeOne"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'one')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
- </el-form-item>
- </el-row>
- <el-row v-if="shortMaterial">
- <el-form-item label="法人身份证复印件加盖公章:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="idCard"
- :on-change="handleChangeTwo"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'two')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
- </el-form-item>
- </el-row>
- <div v-if="shortMaterial">
- <el-row>
- <el-col :span="10">
- <el-form-item label="有效期开始时间(主要负责人):" prop="legalpersonstart">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.legalpersonstart"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="结束时间" prop="legalpersonend">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.legalpersonend"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row >
- <el-form-item label="主要负责人、安全生产管理人员考核合格的证明材料:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="legalPerson"
- :on-change="handleChangeThree"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
+ <el-col :span="11">
+ <el-form-item label="单位:" prop="company">
+ <el-select v-model.trim="registerForm.company" value-key="item" auto-complete="on" style="width:100%;" @change="companyChange">
+ <el-option
+ v-for="item in companyList"
+ :key="item.id"
+ :value="item"
+ :label="item.company"
>
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'three')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
+ </el-option>
+ </el-select>
</el-form-item>
- </el-row>
- </div>
- <div v-if="produceMaterial">
- <el-row>
- <el-col :span="10">
- <el-form-item label="有效期开始时间(特种人员):" prop="qualificationstart">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.qualificationstart"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="结束时间" prop="qualificationend">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.qualificationend"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row >
- <el-form-item label="特种作业人员取得操作资格证书的证明材料,从业人员安全生产教育和培训合格的证明材料:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="operationQualification"
- :on-change="handleChangeFour"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
+ </el-col>
+ <el-col :span="9">
+ <el-form-item label="部门:" prop="department" v-if="isMain">
+ <el-select v-model.trim="registerForm.department" auto-complete="on" style="width:100%;">
+ <el-option
+ v-for="item in departmentList"
+ :key="item.id"
+ :value="item.department"
+ :label="item.department"
>
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'four')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
+ </el-option>
+ </el-select>
</el-form-item>
- </el-row>
- <el-row>
- <el-col :span="10">
- <el-form-item label="有效期开始时间(押运公司):" prop="escortstart">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.escortstart"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="10">
- <el-form-item label="结束时间" prop="escortend">
- <el-date-picker
- value-format="yyyy-MM-dd"
- type="date"
- v-model="registerForm.escortend"
- placeholder="选择日期时间">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-form-item label="押运公司营业执照、道路运输经营许可证、危险品准运证:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="escortCompany"
- :on-change="handleChangeFive"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'five')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
- </el-form-item>
- </el-row>
- </div>
- <el-row v-if="shortMaterial">
- <el-form-item label="安全责任险、意外险投保材料:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="insurance"
- :on-change="handleChangeSix"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'six')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
- </el-form-item>
+ </el-col>
</el-row>
- <el-row v-if="buyMaterial">
- <el-form-item label="安全生产标准化证书材料:" prop="imgs">
- <el-upload
- action="#"
- list-type="picture-card"
- :file-list="safetyProduction"
- :on-change="handleChangeSeven"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <div slot="file" slot-scope="{file}">
- <img
- class="el-upload-list__item-thumbnail"
- :src="file.url" alt=""
- >
- <span class="el-upload-list__item-actions">
- <span
- class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)"
- >
- <i class="el-icon-zoom-in"></i>
- </span>
- <span
- v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file,'seven')"
- >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
- </el-upload>
- </el-form-item>
+ <el-row>
+ </el-row>
+ <el-row>
+ <el-col :span="20">
+ <el-form-item label="职位" prop="job">
+ <el-input v-model="registerForm.job"></el-input>
+ </el-form-item>
+ </el-col>
</el-row>
</el-form>
<div align="center" style="padding-bottom: 30px">
- <el-button type="primary" @click="submit()">同意协议并注册</el-button>
+ <el-button type="primary" :disabled="submitting" @click="submit()">同意协议并注册</el-button>
</div>
- <el-dialog :visible.sync="dialogVisible">
- <img width="100%" :src="dialogImageUrl" alt="">
- </el-dialog>
</div>
</div>
</template>
<script>
import {isNameExist, isNumberExist, register} from "../../api/login";
-import {getCityListData, getProvinceListData} from "../../api/area";
import {parseError} from "../../utils/messageDialog";
+import { getAllCompany } from '@/api/unitManage'
+import { getAllDepartment } from '@/api/departmentManage'
export default {
name: "register",
data(){
return{
- showNumber:false,
- showName:false,
- shortMaterial:false,
- longMaterial:false,
- produceMaterial:false,
- buyMaterial:false,
+ companyList:[],
+ departmentList:[],
+ submitting: false,
+ isMain:false,
registerForm:{
- enterprisename:'',
- enterprisenumber:'',
+ username:'',
+ realname:'',
password:'',
- type:'',
- businessrange:'',
- licensestart:'',
- licenseend:'',
- legalpersonstart:'',
- legalpersonend:'',
- qualificationstart:'',
- qualificationend:'',
- escortstart:'',
- escortend:'',
- legalperson:'',
- legalpersonphone:'',
- province:'',
- city:'',
- district:'',
- street:'',
- committee:'',
- address:'',
+ idcard:'',
+ company:'',
+ department:'',
+ job:''
},
- businessLicense:[],
- idCard:[],
- legalPerson:[],
- operationQualification:[],
- escortCompany:[],
- insurance:[],
- safetyProduction:[],
rules:{
- enterprisename:[
- { required: true, message: '请填写企业名称', trigger: 'blur' },
+ realname:[
+ { required: true, message: '请填写姓名', trigger: 'blur' },
],
- enterprisenumber:[
- { required: true, message: '请填写企业编号', trigger: 'blur' },
+ username:[
+ { required: true, message: '请填写手机号', trigger: 'blur' },
],
password:[
- { required: true, message: '请填写密码', trigger: 'change' },
+ { required: true, message: '请填写密码', trigger: 'blur' },
],
- type:[
- { required: true, message: '请选择企业类型', trigger: 'blur' },
+ idcard:[
+ { required: true, message: '请填写身份证', trigger: 'blur' },
],
- businessrange:[
- { required: true, message: '请填写经营范围', trigger: 'blur' },
- ],
- legalperson:[
- { required: true, message: '请填写负责人', trigger: 'blur' },
- ],
- legalpersonphone:[
- { required: true, message: '请填写负责人电话', trigger: 'blur' },
- ],
- licensestart:[
- { required: true, message: '请填写许可证有效期开始日期', trigger: 'blur' },
- ],
- licenseend:[
- { required: true, message: '请填写许可证有效期结束日期', trigger: 'blur' },
- ],
- province:[
- { required: true, message: '请填写省', trigger: 'change' },
- ],
- city:[
- { required: true, message: '请填写市', trigger: 'change' },
- ],
- district:[
- { required: true, message: '请填写区', trigger: 'change' },
- ],
- address:[
- { required: true, message: '请填写区', trigger: 'blur' },
- ],
- legalpersonstart:[
- { required: true, message: '请填写', trigger: 'change' },
- ],
- legalpersonend:[
- { required: true, message: '请填写', trigger: 'change' },
- ],
- qualificationstart:[
- { required: true, message: '请填写', trigger: 'change' },
- ],
- qualificationend:[
- { required: true, message: '请填写', trigger: 'change' },
- ],
- escortstart:[
- { required: true, message: '请填写', trigger: 'change' },
- ],
- escortend:[
- { required: true, message: '请填写', trigger: 'change' },
+ company:[
+ { required: true, message: '请填写单位', trigger: 'blur' },
],
},
- typeList:[{id:1,name:'烟花爆竹生产'},{id:2,name:'烟花爆竹批发经营'},{id:3,name:'烟花爆竹零售经营(长期)'},{id:4,name:'烟花爆竹零售经营(短期)'}],
- provinceList:[],
- cityList:[],
- districtList: [],
- streetList:[],
- committeeList:[],
- dialogImageUrl: '',
- dialogVisible: false,
- disabled: false
}
},
watch:{
},
created(){
- this.getProvince()
+ //初始化 单位和 部门
+ this.getDepartmentData()
+ this.getCompanyData()
},
methods:{
- handleRemove(file,value) {
- return this.$confirm(`确定移除 ${ file.name }?`,'提示',{
- confirmButtonText:'确定',
- cancelButtonText:'取消',
- type:'warning',
- }).then(()=> {
- switch (value) {
- case 'one':this.businessLicense.splice(this.businessLicense.findIndex(item =>item.name === file.name),1);
- break;
- case 'two':this.idCard.splice(this.idCard.findIndex(item =>item.name === file.name),1);
- break;
- case 'three':this.legalPerson.splice(this.legalPerson.findIndex(item =>item.name === file.name),1);
- break;
- case 'four':this.operationQualification.splice(this.operationQualification.findIndex(item =>item.name === file.name),1);
- break;
- case 'five':this.escortCompany.splice(this.escortCompany.findIndex(item =>item.name === file.name),1);
- break;
- case 'six':this.insurance.splice(this.insurance.findIndex(item =>item.name === file.name),1);
- break;
- case 'seven':this.safetyProduction.splice(this.safetyProduction.findIndex(item =>item.name === file.name),1);
- break;
- }
- })
- },
- handlePictureCardPreview(file) {
- this.dialogImageUrl = file.url;
- this.dialogVisible = true;
- },
- handleChangeOne(file, fileList) {
- this.businessLicense = fileList.slice(0);
- },
- handleChangeTwo(file, fileList){
- this.idCard = fileList.slice(0);
- },
- handleChangeThree(file, fileList) {
- this.legalPerson = fileList.slice(0);
- },
- handleChangeFour(file, fileList){
- this.operationQualification = fileList.slice(0);
- },
- handleChangeFive(file, fileList) {
- this.escortCompany = fileList.slice(0);
- },
- handleChangeSix(file, fileList){
- this.insurance = fileList.slice(0);
- },
- handleChangeSeven(file,fileList){
- this.safetyProduction = fileList.slice(0)
- },
- async getProvince(){
- let res = await getProvinceListData()
- if(res.data.code === "200"){
- this.provinceList = res.data.result.provinceList
- }
- },//获取省
async submit(){
this.$refs["ruleForm"].validate((valid) =>{
if(valid){
- if(this.registerForm.type === '烟花爆竹生产' && this.businessLicense.length !== 0 && this.idCard.length !== 0 && this.legalPerson.length !== 0 && this.operationQualification.length !== 0 && this.escortCompany.length !== 0 && this.insurance.length !==0){
- this.businessLicense = this.businessLicense.map((item,index,arr) =>{
- return item.raw
- },this.businessLicense)
- this.idCard = this.idCard.map((item,index,arr) =>{
- return item.raw
- },this.idCard)
- this.legalPerson = this.legalPerson.map((item,index,arr) =>{
- return item.raw
- },this.legalPerson)
- this.operationQualification = this.operationQualification.map((item,index,arr) =>{
- return item.raw
- },this.operationQualification)
- this.escortCompany = this.escortCompany.map((item,index,arr) =>{
- return item.raw
- },this.escortCompany)
- this.insurance = this.insurance.map((item,index,arr) =>{
- return item.raw
- },this.insurance)
- this.safetyProduction = this.safetyProduction.map((item,index,arr) =>{
- return item.raw
- },this.safetyProduction)
- const formData = new FormData();
- for (const i in this.registerForm) {
- if (
- this.registerForm[i] != undefined &&
- this.registerForm[i].toString() != ""
- ) {
- formData.append(i, this.registerForm[i]);
- }
- }
- if (this.businessLicense && this.businessLicense.length > 0) {
- for (let i = 0; i < this.businessLicense.length; i++)
- formData.append("businessLicense", this.businessLicense[i]);
- }
- if (this.idCard && this.idCard.length > 0) {
- for (let i = 0; i < this.idCard.length; i++)
- formData.append("idCard", this.idCard[i]);
- }
- if (this.legalPerson && this.legalPerson.length > 0) {
- for (let i = 0; i < this.legalPerson.length; i++)
- formData.append("legalPersonFile", this.legalPerson[i]);
- }
- if (this.operationQualification && this.operationQualification.length > 0) {
- for (let i = 0; i < this.operationQualification.length; i++)
- formData.append("operationQualification", this.operationQualification[i]);
- }
- if (this.escortCompany && this.escortCompany.length > 0) {
- for (let i = 0; i < this.escortCompany.length; i++)
- formData.append("escortCompany", this.escortCompany[i]);
- }
- if (this.insurance && this.insurance.length > 0) {
- for (let i = 0; i < this.insurance.length; i++)
- formData.append("insurance", this.insurance[i]);
- }
- if (this.safetyProduction && this.safetyProduction.length > 0) {
- for (let i = 0; i < this.safetyProduction.length; i++)
- formData.append("safetyProduction", this.safetyProduction[i]);
- }
- register(formData).then(res =>{
- if(res.data.code === '200'){
- this.$message({
- type:'success',
- message:'注册成功',
- duration:2000,
- title:'成功'
- })
- this.$router.push('/login')
- }else{
- this.$message({
- type:'warning',
- message:res.data.message
- })
- }
- }).catch(error => {
- parseError({error: error, vm: this})
- })
- }else if(this.registerForm.type === '烟花爆竹批发经营'&& this.businessLicense.length !== 0 && this.idCard.length !== 0 && this.legalPerson.length !== 0 && this.operationQualification.length !== 0 && this.escortCompany.length !== 0 && this.insurance.length !== 0 && this.safetyProduction.length !== 0){
- this.businessLicense = this.businessLicense.map((item,index,arr) =>{
- return item.raw
- },this.businessLicense)
- this.idCard = this.idCard.map((item,index,arr) =>{
- return item.raw
- },this.idCard)
- this.legalPerson = this.legalPerson.map((item,index,arr) =>{
- return item.raw
- },this.legalPerson)
- this.operationQualification = this.operationQualification.map((item,index,arr) =>{
- return item.raw
- },this.operationQualification)
- this.escortCompany = this.escortCompany.map((item,index,arr) =>{
- return item.raw
- },this.escortCompany)
- this.insurance = this.insurance.map((item,index,arr) =>{
- return item.raw
- },this.insurance)
- this.safetyProduction = this.safetyProduction.map((item,index,arr) =>{
- return item.raw
- },this.safetyProduction)
- const formData = new FormData();
- for (const i in this.registerForm) {
- if (
- this.registerForm[i] != undefined &&
- this.registerForm[i].toString() != ""
- ) {
- formData.append(i, this.registerForm[i]);
- }
- }
- if (this.businessLicense && this.businessLicense.length > 0) {
- for (let i = 0; i < this.businessLicense.length; i++)
- formData.append("businessLicense", this.businessLicense[i]);
- }
- if (this.idCard && this.idCard.length > 0) {
- for (let i = 0; i < this.idCard.length; i++)
- formData.append("idCard", this.idCard[i]);
- }
- if (this.legalPerson && this.legalPerson.length > 0) {
- for (let i = 0; i < this.legalPerson.length; i++)
- formData.append("legalPersonFile", this.legalPerson[i]);
- }
- if (this.operationQualification && this.operationQualification.length > 0) {
- for (let i = 0; i < this.operationQualification.length; i++)
- formData.append("operationQualification", this.operationQualification[i]);
- }
- if (this.escortCompany && this.escortCompany.length > 0) {
- for (let i = 0; i < this.escortCompany.length; i++)
- formData.append("escortCompany", this.escortCompany[i]);
- }
- if (this.insurance && this.insurance.length > 0) {
- for (let i = 0; i < this.insurance.length; i++)
- formData.append("insurance", this.insurance[i]);
- }
- if (this.safetyProduction && this.safetyProduction.length > 0) {
- for (let i = 0; i < this.safetyProduction.length; i++)
- formData.append("safetyProduction", this.safetyProduction[i]);
- }
- register(formData).then(res =>{
- if(res.data.code === '200'){
- this.$message({
- type:'success',
- message:'注册成功',
- duration:2000,
- title:'成功'
- })
- this.$router.push('/login')
- }else{
- this.$message({
- type:'warning',
- message:res.data.message
- })
- }
- }).catch(error => {
- parseError({error: error, vm: this})
- })
- }else if(this.registerForm.type === '烟花爆竹零售经营(长期)' && this.businessLicense.length !== 0 && this.idCard.length !== 0 && this.legalPerson.length !== 0 && this.insurance.length !== 0){
- this.businessLicense = this.businessLicense.map((item,index,arr) =>{
- return item.raw
- },this.businessLicense)
- this.idCard = this.idCard.map((item,index,arr) =>{
- return item.raw
- },this.idCard)
- this.legalPerson = this.legalPerson.map((item,index,arr) =>{
- return item.raw
- },this.legalPerson)
- this.operationQualification = this.operationQualification.map((item,index,arr) =>{
- return item.raw
- },this.operationQualification)
- this.escortCompany = this.escortCompany.map((item,index,arr) =>{
- return item.raw
- },this.escortCompany)
- this.insurance = this.insurance.map((item,index,arr) =>{
- return item.raw
- },this.insurance)
- this.safetyProduction = this.safetyProduction.map((item,index,arr) =>{
- return item.raw
- },this.safetyProduction)
- const formData = new FormData();
- for (const i in this.registerForm) {
- if (
- this.registerForm[i] != undefined &&
- this.registerForm[i].toString() != ""
- ) {
- formData.append(i, this.registerForm[i]);
- }
- }
- if (this.businessLicense && this.businessLicense.length > 0) {
- for (let i = 0; i < this.businessLicense.length; i++)
- formData.append("businessLicense", this.businessLicense[i]);
- }
- if (this.idCard && this.idCard.length > 0) {
- for (let i = 0; i < this.idCard.length; i++)
- formData.append("idCard", this.idCard[i]);
- }
- if (this.legalPerson && this.legalPerson.length > 0) {
- for (let i = 0; i < this.legalPerson.length; i++)
- formData.append("legalPersonFile", this.legalPerson[i]);
- }
- if (this.operationQualification && this.operationQualification.length > 0) {
- for (let i = 0; i < this.operationQualification.length; i++)
- formData.append("operationQualification", this.operationQualification[i]);
- }
- if (this.escortCompany && this.escortCompany.length > 0) {
- for (let i = 0; i < this.escortCompany.length; i++)
- formData.append("escortCompany", this.escortCompany[i]);
- }
- if (this.insurance && this.insurance.length > 0) {
- for (let i = 0; i < this.insurance.length; i++)
- formData.append("insurance", this.insurance[i]);
- }
- if (this.safetyProduction && this.safetyProduction.length > 0) {
- for (let i = 0; i < this.safetyProduction.length; i++)
- formData.append("safetyProduction", this.safetyProduction[i]);
- }
- register(formData).then(res =>{
- if(res.data.code === '200'){
- this.$message({
- type:'success',
- message:'注册成功',
- duration:2000,
- title:'成功'
- })
- this.$router.push('/login')
- }else{
- this.$message({
- type:'warning',
- message:res.data.message
- })
- }
- }).catch(error => {
- parseError({error: error, vm: this})
- })
- }else if(this.registerForm.type==='烟花爆竹零售经营(短期)' && this.idCard.length !== 0 && this.legalPerson.length !== 0 && this.insurance.length !== 0){
- this.businessLicense = this.businessLicense.map((item,index,arr) =>{
- return item.raw
- },this.businessLicense)
- this.idCard = this.idCard.map((item,index,arr) =>{
- return item.raw
- },this.idCard)
- this.legalPerson = this.legalPerson.map((item,index,arr) =>{
- return item.raw
- },this.legalPerson)
- this.operationQualification = this.operationQualification.map((item,index,arr) =>{
- return item.raw
- },this.operationQualification)
- this.escortCompany = this.escortCompany.map((item,index,arr) =>{
- return item.raw
- },this.escortCompany)
- this.insurance = this.insurance.map((item,index,arr) =>{
- return item.raw
- },this.insurance)
- this.safetyProduction = this.safetyProduction.map((item,index,arr) =>{
- return item.raw
- },this.safetyProduction)
- const formData = new FormData();
- for (const i in this.registerForm) {
- if (
- this.registerForm[i] != undefined &&
- this.registerForm[i].toString() != ""
- ) {
- formData.append(i, this.registerForm[i]);
- }
- }
- if (this.businessLicense && this.businessLicense.length > 0) {
- for (let i = 0; i < this.businessLicense.length; i++)
- formData.append("businessLicense", this.businessLicense[i]);
- }
- if (this.idCard && this.idCard.length > 0) {
- for (let i = 0; i < this.idCard.length; i++)
- formData.append("idCard", this.idCard[i]);
- }
- if (this.legalPerson && this.legalPerson.length > 0) {
- for (let i = 0; i < this.legalPerson.length; i++)
- formData.append("legalPersonFile", this.legalPerson[i]);
- }
- if (this.operationQualification && this.operationQualification.length > 0) {
- for (let i = 0; i < this.operationQualification.length; i++)
- formData.append("operationQualification", this.operationQualification[i]);
- }
- if (this.escortCompany && this.escortCompany.length > 0) {
- for (let i = 0; i < this.escortCompany.length; i++)
- formData.append("escortCompany", this.escortCompany[i]);
- }
- if (this.insurance && this.insurance.length > 0) {
- for (let i = 0; i < this.insurance.length; i++)
- formData.append("insurance", this.insurance[i]);
- }
- if (this.safetyProduction && this.safetyProduction.length > 0) {
- for (let i = 0; i < this.safetyProduction.length; i++)
- formData.append("safetyProduction", this.safetyProduction[i]);
- }
- register(formData).then(res =>{
- if(res.data.code === '200'){
- this.$message({
- type:'success',
- message:'注册成功',
- duration:2000,
- title:'成功'
- })
- this.$router.push('/login')
- }else{
- this.$message({
- type:'warning',
- message:res.data.message
- })
- }
- }).catch(error => {
- parseError({error: error, vm: this})
- })
- }else{
- this.$message({
- type:'warning',
- message:'请提交相关材料'
- })
- }
+ this.register()
}else{
this.$message({
type:'warning',
@@ -979,136 +141,73 @@
})
},
- async changeArea(value){
- if(value === 'province'){
- this.registerForm.city = ''
- this.registerForm.district = ''
- this.registerForm.street = ''
- this.registerForm.committee = ''
- this.areaListQuery = {
- type: 2,
- parenttype: 1,
- parentname: this.registerForm.province,
+ getDepartmentData(){
+ getAllDepartment().then(res=>{
+ if(res.data.code === '200'){
+ this.departmentList = res.data.result
+ }else{
+ this.$message({
+ type:'warning',
+ message:res.data.message
+ })
}
- let res = await getCityListData(this.areaListQuery)
- if(res.data.code === "200"){
- this.cityList = res.data.result
+ }).catch(error =>{
+ parseError({error:error,vm:this})
+ })
+ },
+ getCompanyData(){
+ getAllCompany().then(res=>{
+ if(res.data.code === '200'){
+ this.companyList = res.data.result
+ }else{
+ this.$message({
+ type:'warning',
+ message:res.data.message
+ })
}
- }else if(value === 'city'){
- this.registerForm.district = ''
- this.registerForm.street = ''
- this.registerForm.committee = ''
- this.areaListQuery = {
- type: 3,
- parenttype: 2,
- parentname: this.registerForm.city,
- }
- let res = await getCityListData(this.areaListQuery)
- if(res.data.code === "200"){
- this.districtList = res.data.result
- }
- }else if(value === 'district'){
- this.registerForm.street = ''
- this.registerForm.committee = ''
- this.areaListQuery = {
- type: 4,
- parenttype: 3,
- parentname: this.registerForm.district,
- }
- let res = await getCityListData(this.areaListQuery)
- if(res.data.code === "200"){
- this.streetList = res.data.result
- }
- }else if(value === 'street'){
- this.registerForm.committee = ''
- this.areaListQuery = {
- type: 5,
- parenttype: 4,
- parentname: this.registerForm.street,
- }
- let res = await getCityListData(this.areaListQuery)
- if(res.data.code === "200"){
- this.committeeList = res.data.result
- }
- }
- },//市、镇、街道、委员会
- showMaterial(){
- if(this.registerForm.type === '烟花爆竹生产'){
- this.shortMaterial = true
- this.longMaterial = true
- this.produceMaterial = true
- this.buyMaterial = false
- }else if(this.registerForm.type === '烟花爆竹批发经营'){
- this.shortMaterial = true
- this.longMaterial = true
- this.produceMaterial = true
- this.buyMaterial = true
- }else if(this.registerForm.type === '烟花爆竹零售经营(长期)'){
- this.shortMaterial = true
- this.longMaterial = true
- this.produceMaterial = false
- this.buyMaterial = false
+ }).catch(error =>{
+ parseError({error:error,vm:this})
+ })
+ },
+ companyChange(val){
+ this.registerForm.company = val.company
+ if (val.ismain === 1) {
+ this.isMain = true;
}else{
- this.shortMaterial = true
- this.longMaterial = false
- this.produceMaterial = false
- this.buyMaterial = false
+ this.isMain = false;
+ this.registerForm.department = ''
}
},
- checkNameAndNumber(value){
- if(value === 'name'){
- isNameExist(this.registerForm.enterprisename).then(res =>{
- if(res.data.code === '200'){
- if(res.data.result === true) {
- this.showName = true
- this.$message({
- type: 'warning',
- message: '企业名称已存在',
- })
- }else{
- this.$message({
- type:'success',
- message:'企业名称可以使用'
- })
- this.showName = false
- }
+
+ register(){
+ this.submitting = true
+ register(this.registerForm)
+ .then(res=>{
+ if (res.data.code === '200') {
+ this.$message({
+ type:'success',
+ message:'注册成功'
+ })
+ setTimeout(()=>{
+ this.$router.push({path:'/login'})
+ },1000)
}else{
- this.showName = false
this.$message({
type:'warning',
- message:res.data.message,
+ message:res.data.message
})
}
- }).catch(error => {
- parseError({error: error, vm: this})
})
- }else if(value === 'number'){
- isNumberExist(this.registerForm.enterprisenumber).then(res =>{
- if(res.data.code === '200'){
- if(res.data.result === true) {
- this.showNumber = true
- this.$message({
- type: 'warning',
- message: '企业编号已存在',
- })
- }else{
- this.$message({
- type:'success',
- message:'企业编号可以使用'
- })
- this.showNumber = false
- }
- }else{
- this.showNumber = false
- this.$message({
- type:'warning',
- message:res.data.message,
- })
- }
- }).catch(error => {
- parseError({error: error, vm: this})
+ .catch(err=>{
+ console.log(err)
+ this.$message({
+ type:'warning',
+ message:'请求超时'
+ })
})
- }
+ .finally(()=>{
+ this.submitting = false
+ })
}
}
}
@@ -1129,7 +228,7 @@
.register_main_form{
padding-top: 70px;
margin: 30px auto;
- max-width: 900px;
+ max-width: 800px;
display: block;
width: 100%;
}
--
Gitblit v1.9.2