2
3
Quellcode durchsuchen

修改注册页

ljm vor 6 Jahren
Ursprung
Commit
b4e4d4b751

+ 4 - 3
src/dashoo.cn/backend/api/business/register/oilcorporateinfo.go

@@ -66,7 +66,8 @@ type OilCorporateInfo struct {
 }
 
 type SomeUserInfo struct {
-	UserName string //账号/Email
-	Realname string //用户名
-	UserPass string //密码
+	UserName  string //账号/Email
+	Realname  string //用户名
+	UserPass  string //密码
+	Telephone string //手机号
 }

+ 1 - 0
src/dashoo.cn/backend/api/controllers/register/oilcorporateinfo.go

@@ -86,6 +86,7 @@ func (this *OilCorporateInfoController) AddEntity() {
 	var userentity userRole.Base_User
 	userentity.Username = userInfo.UserName
 	userentity.Realname = userInfo.Realname
+	userentity.Telephone = userInfo.Telephone
 	userentity.Roleid = 10000120 //企业用户
 	userentity.Companyid = "0"
 	userentity.IsCompanyUser = 1

+ 76 - 43
src/dashoo.cn/frontend_web/src/pages/signup.vue

@@ -32,52 +32,52 @@
             <el-form label-width="135px" ref="formData" :model="formData" :rules="rules">
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="公司名称" style="width: 100%" prop="SupplierName">
+                  <el-form-item label="公司名称" label-width="150px" style="width: 100%" prop="SupplierName">
                     <el-input v-model="formData.SupplierName"  placeholder="请输入公司名称"></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col :span="24">
-                  <el-form-item label="组织机构代码" style="width: 100%" prop="OrganCode">
-                    <el-input v-model="formData.OrganCode"  placeholder="请输入组织机构代码"></el-input>           
+                  <el-form-item label="组织机构代码" label-width="150px" style="width: 100%" prop="OrganCode">
+                    <el-input v-model="formData.OrganCode"  placeholder="请输入组织机构代码"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="8">
-                  <el-form-item label="法定代表人姓名" style="width: 100%" prop="LegalPerson">
-                    <el-input v-model="formData.LegalPerson"  placeholder="法定代表人姓名"></el-input>           
+                <el-col :span="24">
+                  <el-form-item label="法定代表人姓名" label-width="150px" style="width: 100%" prop="LegalPerson">
+                    <el-input v-model="formData.LegalPerson"  placeholder="请输入法定代表人姓名"></el-input>           
                   </el-form-item>
                 </el-col>
-                <el-col :span="10">
+                <el-col :span="16">
                   <el-form-item label="法定代表人身份证号" label-width="150px" style="width: 100%" prop="LegalPersonId">
-                    <el-input v-model="formData.LegalPersonId"  placeholder="法定代表人身份证号"></el-input>           
+                    <el-input v-model="formData.LegalPersonId"  placeholder="请输入法定代表人身份证号"></el-input>           
                   </el-form-item>
                 </el-col>
-                <el-col :span="6">
+                <el-col :span="8">
                   <el-form-item label="" label-width="60px" prop="LegalPersonImg">
                     <el-upload action="" ref="LegalPersonUpload"
-                      :limit="1"
+                      :limit="2"
                       :http-request="uploadRequest"
-                      :show-file-list="true" 
+                      :show-file-list="true"
                       :before-upload="beforeUpload">
                       <el-button size="small" type="primary">上传身份证扫描件<i class="el-icon-upload el-icon--right"></i></el-button>
                     </el-upload>
                   </el-form-item>
                 </el-col>
-                <el-col :span="8">
-                  <el-form-item label="联系人姓名" style="width: 100%" prop="ContactName">
+                <el-col :span="24">
+                  <el-form-item label="联系人姓名" label-width="150px" style="width: 100%" prop="ContactName">
                     <el-input v-model="formData.ContactName"  placeholder="请输入联系人姓名"></el-input>           
                   </el-form-item>
                 </el-col>
-                <el-col :span="10">
+                <el-col :span="16">
                   <el-form-item label="联系人身份证号" label-width="150px" style="width: 100%" prop="ContactId">
                     <el-input v-model="formData.ContactId"  placeholder="请输入联系人身份证号"></el-input>           
                   </el-form-item>
                 </el-col>
-                <el-col :span="6">
+                <el-col :span="8">
                   <el-form-item label="" label-width="60px" prop="ContactImg">
                     <el-upload action="" ref="ContactUpload"
-                      :limit="1"
+                      :limit="2"
                       :http-request="uploadRequest"
-                      :show-file-list="true" 
+                      :show-file-list="true"
                       :before-upload="beforeUpload">
                       <el-button size="small" type="primary">上传身份证扫描件<i class="el-icon-upload el-icon--right"></i></el-button>
                     </el-upload>
@@ -85,22 +85,27 @@
                 </el-col>
               </el-row>
               <el-row>
-                <el-col :span="6">
-                  <el-form-item label="账号/Email"   style="width: 100%" prop="UserName">
+                <el-col :span="24">
+                  <el-form-item label="账号/Email" label-width="150px" style="width: 100%" prop="UserName">
                     <el-input v-model="formData.UserName" placeholder="请输入账号"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="6">
-                  <el-form-item label="用户名"   style="width: 100%" prop="Realname">
+                <el-col :span="12">
+                  <el-form-item label="用户名"  label-width="150px" style="width: 100%" prop="Realname">
                     <el-input v-model="formData.Realname" placeholder="请输入用户名"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="6">              
-                  <el-form-item label="密码"  style="width: 100%" prop="UserPass" >
+                <el-col :span="12">
+                  <el-form-item label="手机号"   style="width: 100%" prop="Telephone">
+                    <el-input v-model="formData.Telephone" placeholder="用于审核通知和密码找回"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="12">              
+                  <el-form-item label="密码" label-width="150px" style="width: 100%" prop="UserPass" >
                     <el-input type="password" v-model="formData.UserPass"  auto-complete="off" placeholder="请输入密码"></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col :span="6">
+                <el-col :span="12">
                   <el-form-item label="确认密码"  style="width: 100%" prop="UserPass2" >
                     <el-input type="password" v-model="formData.UserPass2" auto-complete="off" placeholder="请输入确认密码"></el-input>
                   </el-form-item>
@@ -112,7 +117,7 @@
                   <el-checkbox v-model="checked1" style="margin-left: 80px">阅读并同意</el-checkbox>
                 <router-link to="#">《麦吉轮用户注册协议》</router-link><router-link to="#">《隐私政策》</router-link> -->
               </el-row>
-              <el-row style="margin-left: 40%; margin-top: 10px; margin-bottom: 20px;">
+              <el-row style="margin-left: 50%; margin-top: 10px; margin-bottom: 20px;">
                 <el-button type="primary" @click="register" style="width: 30%">立即注册</el-button>
               </el-row>
             </el-form>
@@ -155,7 +160,6 @@
               this.$alert('该公司已注册!', '提示:', {
                 confirmButtonText: '确定',
               })
-              // callback(new Error('该公司已注册!'));
             } else {
               callback();
             }
@@ -180,6 +184,7 @@
           UserId: '', //int
           UserName: '', //账号/Email
           Realname: '', //用户名
+          Telephone: '', //用户手机号
           UserPass: '',
           UserPass2: '',
           SupplierName: '',
@@ -274,6 +279,9 @@
           Realname: [
             { required: true, message: '请输入用户名', trigger: 'blur' }
           ],
+          Telephone: [
+            { required: true, message: '请输入手机号', trigger: 'blur' }
+          ],
           UserPass: [
             { required: true, message: '请输入密码', trigger: 'blur' }
           ],
@@ -298,6 +306,16 @@
       register () {
         let _this = this
 
+        //判断公司是否注册
+        for (let i = 0; i < _this.supplierNameList.length; i++) {
+          if (_this.formData.SupplierName == _this.supplierNameList[i].SupplierName) {
+            this.$alert('该公司已注册!', '提示:', {
+              confirmButtonText: '确定',
+            })
+            return
+          }
+        }
+
         //身份证号验证
         let re1 = /(^\d{18}$)|(^\d{17}(\d|X|x)$)/
         if (!re1.test(_this.formData.LegalPersonId)) {
@@ -313,38 +331,47 @@
           return
         }
 
-        //密码验证 字母数字组成8-20位 正向断言
-        let re2 = /^(?=.*[0-9])[0-9A-Za-z]{8,20}$/g
-        if (!re2.test(_this.formData.UserPass)) {
-          this.$alert('请输入正确格式的密码(8——20位,包含英文字母、数字)!', '提示', {
+        // 判断法定代表人身份证文件上传是否完成
+        if (!_this.checkSuccess(_this.$refs.LegalPersonUpload.uploadFiles)) {
+          this.$alert('上传文件失败,请重新上传法定代表人身份证文件! ', '提示', {
             confirmButtonText: '确定',
           })
           return
         }
-        if (_this.formData.UserPass != _this.formData.UserPass2) {
-          this.$alert('两次输入的密码不一致,请重新输入!', '提示', {
+        _this.formData.LegalPersonURL = _this.getFileURL(_this.$refs.LegalPersonUpload.uploadFiles) //获取地址
+
+        // 判断联系人身份证文件上传是否完成
+        if (!_this.checkSuccess(_this.$refs.ContactUpload.uploadFiles)) {
+          this.$alert('上传文件失败,请重新上传联系人身份证文件! ', '提示', {
             confirmButtonText: '确定',
           })
           return
         }
+        _this.formData.ContactURL = _this.getFileURL(_this.$refs.ContactUpload.uploadFiles)
 
-        // 判断法定代表人身份证文件上传是否完成
-        if (!_this.checkSuccess(_this.$refs.LegalPersonUpload.uploadFiles)) {
-          this.$alert('上传文件失败,请重新上传法定代表人身份证文件! ', '提示', {
+        //手机号验证
+        let re3 = /^[1][3456789]\d{9}$/
+        if (!re3.test(_this.formData.Telephone)) {
+          this.$alert('请填写正确的手机号!', '提示', {
             confirmButtonText: '确定',
           })
           return
         }
-        _this.formData.LegalPersonURL = _this.getFileURL(_this.$refs.LegalPersonUpload.uploadFiles) //获取地址
 
-        // 判断联系人身份证文件上传是否完成
-        if (!_this.checkSuccess(_this.$refs.ContactUpload.uploadFiles)) {
-          this.$alert('上传文件失败,请重新上传联系人身份证文件! ', '提示', {
+        //密码验证 字母数字组成8-20位 正向断言
+        let re2 = /^(?=.*[0-9])[0-9A-Za-z]{8,20}$/g
+        if (!re2.test(_this.formData.UserPass)) {
+          this.$alert('请输入正确格式的密码(8——20位,包含英文字母、数字)!', '提示', {
+            confirmButtonText: '确定',
+          })
+          return
+        }
+        if (_this.formData.UserPass != _this.formData.UserPass2) {
+          this.$alert('两次输入的密码不一致,请重新输入!', '提示', {
             confirmButtonText: '确定',
           })
           return
         }
-        _this.formData.ContactURL = _this.getFileURL(_this.$refs.ContactUpload.uploadFiles)
 
         _this.$axios.post('/register/addentity', _this.formData)
           .then(function (response) {
@@ -377,14 +404,20 @@
           })
       },
 
-      //文件大小限制
+      //图片格式以及文件大小限制
       beforeUpload(file) {
         let isLt10m = file.size / 1024 / 1024 / 10 < 1
+        let isIMAGE1 = file.name.split('.')[1] === 'jpg'
+        let isIMAGE2 = file.name.split('.')[1] === 'jpeg'
+        let isIMAGE3 = file.name.split('.')[1] === 'png'
+
+        if (!isIMAGE1 && !isIMAGE2 && !isIMAGE3) {
+          this.$message.error('上传文件只能是图片格式(jpg/jpeg/png)!')
+        }
         if (!isLt10m) {
           this.$message.error('上传文件大小不能超过 10MB!')
-          return false
         }
-        return true
+        return isIMAGE1 || isIMAGE2 || isIMAGE3 && isLt10m
       },
 
       //判断是否上传成功