马宇豪
2023-10-31 c7bd1a3fd46b5d5f887ce4f674387294ee1e8ccd
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;