From c7bd1a3fd46b5d5f887ce4f674387294ee1e8ccd Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期二, 31 十月 2023 17:09:29 +0800
Subject: [PATCH] 添加手机校验

---
 src/views/Admin/components/userMod.vue |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/views/Admin/components/userMod.vue b/src/views/Admin/components/userMod.vue
index 499ef98..31c38b3 100644
--- a/src/views/Admin/components/userMod.vue
+++ b/src/views/Admin/components/userMod.vue
@@ -68,6 +68,9 @@
       <a-form-model-item label="角色" prop="roleId">
         <a-select v-model="form.roleId" placeholder="角色">
           <a-select-option :value="2">
+            审批领导
+          </a-select-option>
+          <a-select-option :value="4">
             领导
           </a-select-option>
           <a-select-option :value="3">
@@ -81,7 +84,7 @@
 
 <script>
 import {addUser, updateUser} from '@/api/user'
-import {verifyPasswordPowerful, verifyPhone} from "@/util/validate";
+import {verifyPasswordPowerful, verifyPhone, verifySimplePhone} from "@/util/validate";
 export default {
   name: 'userMod',
   props: ['unitType'],
@@ -101,7 +104,7 @@
       if(value === ''){
         callback(new Error('请输入手机号'))
       }else{
-        if(!verifyPhone(value)){
+        if(!verifySimplePhone(value)){
           callback(new Error('手机号格式有误'))
         }else{
           callback()
@@ -257,7 +260,7 @@
         // }
         // t.form.province = t.findNodeByCode(t.areaData,code.substr(0,2)).name
         // t.form.town = ''
-        t.form.company = label[0] + '自然灾害综合预警监测中心'
+        t.form.company = label[0] + '自然灾害综合监测预警中心'
       }
     },
 
@@ -279,6 +282,7 @@
               if(res.data.code == 100){
                 this.$message.success('新增用户成功')
                 this.$emit('refresh')
+                this.visible = false
               }else{
                 this.$message.error(res.data.msg)
               }
@@ -289,12 +293,12 @@
               if(res.data.code == 100){
                 this.$message.success('修改用户成功')
                 this.$emit('refresh')
+                this.visible = false
               }else{
                 this.$message.error(res.data.msg)
               }
             })
           }
-          this.visible = false
         } else {
           console.log('error submit!!');
           return false;

--
Gitblit v1.9.2