Browse Source

企业注册页

liuxiangqi 1 year ago
parent
commit
ef47b13941

+ 15 - 0
src/utils/validate.js

@@ -187,7 +187,14 @@ export function isZhcn(s, m, n) {
   var re = new RegExp('^[\u2E80-\u9FFF]{' + m + ',' + n + '}$', 'gim')
   var re = new RegExp('^[\u2E80-\u9FFF]{' + m + ',' + n + '}$', 'gim')
   return re.test(s)
   return re.test(s)
 }
 }
+/**
+ * 汉字、小括号
+ * @param {Object} cb
+ */
 
 
+export function isZh(s) {
+  return /^[\u4e00-\u9fa5()]+$/.test(s)
+}
 /**********以下为公共验证方法***********/
 /**********以下为公共验证方法***********/
 export function validEmail(rule, value, cb) {
 export function validEmail(rule, value, cb) {
   if (value) {
   if (value) {
@@ -227,3 +234,11 @@ export function validZhcn(rule, value, cb) {
     cb()
     cb()
   }
   }
 }
 }
+
+export function validZh(rule, value, cb) {
+  if(!isZh(value)) {
+    cb(new Error('仅可以输入汉字和小括号'))
+  }else {
+    cb()
+  }
+}

+ 2 - 2
src/views/common/registerFirst.vue

@@ -371,7 +371,7 @@ import { regTypeOptions,mainProductsOptions,yesOrNoOptions } from "@/utils/dataF
 import FileUpload from '@/components/FileUpload'
 import FileUpload from '@/components/FileUpload'
 import ImageUpload from '@/components/ImageUpload'
 import ImageUpload from '@/components/ImageUpload'
 import { validIDcard,validAmount} from '@/utils/validate'
 import { validIDcard,validAmount} from '@/utils/validate'
-import { validNumber } from '@/utils/validate'
+import { validNumber,validZh } from '@/utils/validate'
 
 
 export default {
 export default {
   name: "First",
   name: "First",
@@ -429,7 +429,7 @@ export default {
         ],
         ],
         entName: [
         entName: [
           { required: true, trigger: "blur", message: "请输入企业名称" },
           { required: true, trigger: "blur", message: "请输入企业名称" },
-          {max: 30, message: '最多输入30个字符', trigger: 'blur' }
+          { validator: validZh, trigger: 'blur' }
         ],
         ],
         license: [
         license: [
           { required: true, trigger: "blur", message: "请输入统一社会信用代码" },
           { required: true, trigger: "blur", message: "请输入统一社会信用代码" },

+ 2 - 2
src/views/enterprise/ent/edit.vue

@@ -347,7 +347,7 @@ import ImageUpload from '@/components/ImageUpload'
 import {getEnclosureApi,entUserAudit} from "@/api/enterprise/project/project"
 import {getEnclosureApi,entUserAudit} from "@/api/enterprise/project/project"
 import UploadEnclosure from "./components/UploadEnclosure"
 import UploadEnclosure from "./components/UploadEnclosure"
 import {deleteEnclosureApi} from '@/api/enterprise/project/project'
 import {deleteEnclosureApi} from '@/api/enterprise/project/project'
-import { validIDcard,validAmount,validNumber,validAdress,validPhone,validZhcn,validEmail } from '@/utils/validate'
+import { validIDcard,validAmount,validNumber,validAdress,validPhone,validZhcn,validEmail,validZh } from '@/utils/validate'
 
 
 export default {
 export default {
   name: "First",
   name: "First",
@@ -465,7 +465,7 @@ export default {
         ],
         ],
         entName: [
         entName: [
           { required: true, trigger: "blur", message: "请输入企业名称" },
           { required: true, trigger: "blur", message: "请输入企业名称" },
-          { validator: validZhcn, trigger: 'blur' }
+          { validator: validZh, trigger: 'blur' }
         ],
         ],
         license: [
         license: [
           { required: true, trigger: "blur", message: "请输入统一社会信用代码" },
           { required: true, trigger: "blur", message: "请输入统一社会信用代码" },

+ 2 - 2
src/views/login.vue

@@ -23,7 +23,7 @@
           <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
           <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
         </el-input>
         </el-input>
       </el-form-item>
       </el-form-item>
-      <el-form-item prop="code" v-if="captchaOnOff">
+     <!-- <el-form-item prop="code" v-if="captchaOnOff">
         <el-input
         <el-input
           v-model="loginForm.code"
           v-model="loginForm.code"
           auto-complete="off"
           auto-complete="off"
@@ -36,7 +36,7 @@
         <div class="login-code">
         <div class="login-code">
           <img :src="codeUrl" @click="getCode" class="login-code-img"/>
           <img :src="codeUrl" @click="getCode" class="login-code-img"/>
         </div>
         </div>
-      </el-form-item>
+      </el-form-item> -->
       <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
       <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
       <el-form-item style="width:100%;">
       <el-form-item style="width:100%;">
         <el-button
         <el-button