Browse Source

处理员工管理性别显示

wangcz 7 years ago
parent
commit
1e56f4c7de

+ 23 - 21
components/mobile/staffManagement/StaffAdd.vue

@@ -14,15 +14,15 @@
         <div class="list-content">
         <div class="list-content">
           <ul class="staff-adds">
           <ul class="staff-adds">
             <li><span>姓名:</span><input type="text" v-model="newUserName" maxlength="10" placeholder="请输入用户名"></li>
             <li><span>姓名:</span><input type="text" v-model="newUserName" maxlength="10" placeholder="请输入用户名"></li>
-            <li style="overflow: visible;"><span>性别:</span>
-              <div class="sex-filter">
-                <div class="select-wrap" @click.stop="openChoose">{{sex === 'M' ? '男' : '女'}}<i class="iconfont icon-arrow-down"></i></div>
-                <ul class="select-list" v-if="showChooseSex">
-                  <li v-show="sex != 'M'" @click="chooseSex('M')">男</li>
-                  <li v-show="sex != 'F'" @click="chooseSex('F')">女</li>
-                </ul>
-              </div>
-            </li>
+            <!--<li style="overflow: visible;"><span>性别:</span>-->
+              <!--<div class="sex-filter">-->
+                <!--<div class="select-wrap" @click.stop="openChoose">{{sex === 'M' ? '男' : '女'}}<i class="iconfont icon-arrow-down"></i></div>-->
+                <!--<ul class="select-list" v-if="showChooseSex">-->
+                  <!--<li v-show="sex != 'M'" @click="chooseSex('M')">男</li>-->
+                  <!--<li v-show="sex != 'F'" @click="chooseSex('F')">女</li>-->
+                <!--</ul>-->
+              <!--</div>-->
+            <!--</li>-->
             <li><span>手机:</span><input type="text"
             <li><span>手机:</span><input type="text"
                                         v-model="newUserPhone"
                                         v-model="newUserPhone"
                                         @change="checkPhone()"
                                         @change="checkPhone()"
@@ -59,7 +59,7 @@
             <div class="staff-list">
             <div class="staff-list">
               <div class="list-item"><span>UU账号:</span><span v-text="newUserInfo.userUU">100000721</span></div>
               <div class="list-item"><span>UU账号:</span><span v-text="newUserInfo.userUU">100000721</span></div>
               <div class="list-item"><span>姓名:</span><span v-text="newUserInfo.userName">张洪别</span></div>
               <div class="list-item"><span>姓名:</span><span v-text="newUserInfo.userName">张洪别</span></div>
-              <div class="list-item"><span>性别:</span><span v-text="newUserInfo.userSex === 'F' ? '女' : newUserInfo.userSex === 'M' ? '男' : '-'">男</span></div>
+              <!--<div class="list-item"><span>性别:</span><span v-text="newUserInfo.userSex === 'F' ? '女' : newUserInfo.userSex === 'M' ? '男' : '-'">男</span></div>-->
               <div class="list-item"><span>手机:</span><span v-text="newUserInfo.userTel">12345678901</span></div>
               <div class="list-item"><span>手机:</span><span v-text="newUserInfo.userTel">12345678901</span></div>
               <div class="list-item"><span>邮箱:</span><span v-text="newUserInfo.userEmail">12345678901</span></div>
               <div class="list-item"><span>邮箱:</span><span v-text="newUserInfo.userEmail">12345678901</span></div>
             </div>
             </div>
@@ -118,13 +118,13 @@
       setSwitchType (type) {
       setSwitchType (type) {
         this.switchType = type
         this.switchType = type
       },
       },
-      openChoose () {
-        this.showChooseSex = !this.showChooseSex
-      },
-      chooseSex (info) {
-        this.sex = info
-        this.showChooseSex = false
-      },
+      // openChoose () {
+      //   this.showChooseSex = !this.showChooseSex
+      // },
+      // chooseSex (info) {
+      //   this.sex = info
+      //   this.showChooseSex = false
+      // },
       onRemind: function (str) {
       onRemind: function (str) {
         this.remindText = str
         this.remindText = str
         this.timeoutCount ++
         this.timeoutCount ++
@@ -175,7 +175,7 @@
       },
       },
       // 绑定未注册用户
       // 绑定未注册用户
       addNewUser () {
       addNewUser () {
-        if (!this.newUserName ||this.newUserName === '') {
+        if (!this.newUserName || this.newUserName === '') {
           this.onRemind('请输入用户名')
           this.onRemind('请输入用户名')
         } else if (!this.newUserPhone || this.newUserPhone === '') {
         } else if (!this.newUserPhone || this.newUserPhone === '') {
           this.onRemind('请输入手机号码')
           this.onRemind('请输入手机号码')
@@ -191,7 +191,9 @@
                   this.onRemind('增加用户成功' + this.newUserName)
                   this.onRemind('增加用户成功' + this.newUserName)
                   this.$router.push('/mobile/user/staff')
                   this.$router.push('/mobile/user/staff')
                 }
                 }
-              })
+              }).catch(() => {
+                this.onRemind('增加用户失败!')
+            })
           } else {
           } else {
             this.checkPhone()
             this.checkPhone()
             this.checkEmail()
             this.checkEmail()
@@ -209,7 +211,7 @@
             if (response.data) {
             if (response.data) {
               this.searchNoData = false
               this.searchNoData = false
               if (response.data.userUU === this.userInfo.userUU) {
               if (response.data.userUU === this.userInfo.userUU) {
-                //不可自己绑定自己
+                // 不可自己绑定自己
                 this.bindSelf = true
                 this.bindSelf = true
                 this.showSearchUser = false
                 this.showSearchUser = false
               } else {
               } else {
@@ -223,7 +225,7 @@
               this.showSearchUser = false
               this.showSearchUser = false
               this.bindSelf = false
               this.bindSelf = false
             }
             }
-          }).catch (err =>{
+          }).catch(err => {
             if (err) {
             if (err) {
               this.searchNoData = true
               this.searchNoData = true
               this.showSearchUser = false
               this.showSearchUser = false

+ 1 - 1
components/mobile/staffManagement/StaffList.vue

@@ -32,7 +32,7 @@
               <div class="staff-list">
               <div class="staff-list">
                 <!--<div class="list-item"><span>UU账号:</span><span v-text="item.userUU">100000721</span></div>-->
                 <!--<div class="list-item"><span>UU账号:</span><span v-text="item.userUU">100000721</span></div>-->
                 <div class="list-item"><span>姓名:</span><span v-text="item.userName">张洪别</span></div>
                 <div class="list-item"><span>姓名:</span><span v-text="item.userName">张洪别</span></div>
-                <div class="list-item"><span>性别:</span><span v-text="(item.userSex === 'F' || item.userSex === '女') ? '女' : (item.userSex === 'M' || item.userSex === '男') ? '男' : '-'">男</span></div>
+                <!--<div class="list-item"><span>性别:</span><span v-text="(item.userSex === 'F' || item.userSex === '女') ? '女' : (item.userSex === 'M' || item.userSex === '男') ? '男' : '-'">男</span></div>-->
                 <div class="list-item"><span>手机:</span><span v-text="item.userTel">12345678901</span></div>
                 <div class="list-item"><span>手机:</span><span v-text="item.userTel">12345678901</span></div>
                 <div class="list-item"><span>邮箱:</span><span v-text="item.userEmail">12345678901</span></div>
                 <div class="list-item"><span>邮箱:</span><span v-text="item.userEmail">12345678901</span></div>
                 <div class="list-item"><span>角色:</span><span class="role" v-for="role in item.roles" v-text="role.desc ? role.desc.slice(0,2) : ''" v-bind:class="'bg' + role.color">普通</span></div>
                 <div class="list-item"><span>角色:</span><span class="role" v-for="role in item.roles" v-text="role.desc ? role.desc.slice(0,2) : ''" v-bind:class="'bg' + role.color">普通</span></div>