chenying 4 gadi atpakaļ
vecāks
revīzija
32988b23c7
1 mainītis faili ar 11 papildinājumiem un 3 dzēšanām
  1. 11 3
      src/views/modules/sys/user-add-or-update.vue

+ 11 - 3
src/views/modules/sys/user-add-or-update.vue

@@ -5,7 +5,10 @@
     :visible.sync="visible">
     <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
       <el-form-item label="用户名" prop="userName">
-        <el-input v-model="dataForm.userName" placeholder="登录帐号"></el-input>
+        <el-input v-model="dataForm.userName" :disabled="dataForm.id" placeholder="登录帐号"></el-input>
+      </el-form-item>
+      <el-form-item label="姓名" prop="name">
+        <el-input v-model="dataForm.name" :disabled="dataForm.id" placeholder="姓名"></el-input>
       </el-form-item>
       <el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
         <el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
@@ -78,6 +81,7 @@
         dataForm: {
           id: 0,
           userName: '',
+          name: '',
           password: '',
           comfirmPassword: '',
           salt: '',
@@ -97,9 +101,11 @@
             { validator: validateComfirmPassword, trigger: 'blur' }
           ],
           email: [
-            { required: true, message: '邮箱不能为空', trigger: 'blur' },
             { validator: validateEmail, trigger: 'blur' }
           ],
+          name: [
+            { required: true, message: '手机号不能为空', trigger: 'blur' }
+          ],
           mobile: [
             { required: true, message: '手机号不能为空', trigger: 'blur' },
             { validator: validateMobile, trigger: 'blur' }
@@ -139,6 +145,7 @@
                 this.dataForm.mobile = data.data.mobile
                 this.dataForm.roleIdList = data.data.roleIdList
                 this.dataForm.status = Number(data.data.status)
+                this.dataForm.name = data.data.name
               }
             })
           }
@@ -159,7 +166,8 @@
                 'email': this.dataForm.email,
                 'mobile': this.dataForm.mobile,
                 'status': this.dataForm.status,
-                'roleIdList': this.dataForm.roleIdList
+                'roleIdList': this.dataForm.roleIdList,
+                'name': this.dataForm.name
               })
             }).then(({data}) => {
               if (data && data.code === '200') {