Jelajahi Sumber

Merge remote-tracking branch 'origin/release-201821-wangcz' into release-201821-wangcz

shenjj 8 tahun lalu
induk
melakukan
66c1a7072f

+ 1 - 10
components/home/KindCategory.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="kind-category" ref="kindCategory" @mouseleave="hideChildrenLayout()">
+  <div class="kind-category" @mouseleave="hideChildrenLayout()">
     <ul class="kind-main list-unstyled">
       <li v-for="kind in kindsToShow" class="kind-main-item" :class="{active: kind.id==activeKindId}"
         @mouseenter="showChildrenLayout(kind)">
@@ -66,15 +66,6 @@
         this.activeKindId = null
       }
     },
-    watch: {
-      '$route.path': {
-        handler: function (path) {
-          if (path !== '/') {
-            this.$refs.kindCategory.style.display = 'none'
-          }
-        }
-      }
-    },
 //    mounted () {
 //      this.$http.get(`/api/product/kind/0/children_all`)
 //        .then(response => {

+ 27 - 2
components/main/Nav.vue

@@ -3,7 +3,7 @@
     <div class="container">
       <nuxt-link to="/product/kind/home" class="item item-first" tag="div">
         <div>器件选型
-          <kind-category v-if="$route.path != '/'" @loadchild="loadProductKinds" id="kindCategory"></kind-category>
+          <kind-category v-if="$route.path != '/'" :class="{'change': isChange}" @loadchild="loadProductKinds" id="kindCategory"></kind-category>
         </div>
       </nuxt-link>
       <nuxt-link :to="'/'" class="item" exact>
@@ -56,12 +56,33 @@
     name: 'navView',
     data () {
       return {
-        pcbId: process.env.pcbId
+        pcbId: process.env.pcbId,
+        isChange: false
       }
     },
     components: {
       KindCategory
     },
+    watch: {
+      '$route.path': {
+        handler: function (path) {
+          if (path !== '/') {
+            this.isChange = true
+            // 直接设为false无作用,因此采用定时器
+            setTimeout(() => {
+              this.isChange = false
+            }, 100)
+          }
+        }
+      }
+    },
+//      '$route.params': {
+//        handler: function (path) {
+//          console.log(123)
+//          this.isChange = true
+//        }
+//      }
+//    },
     methods: {
       loadProductKinds (id) {
         this.$store.dispatch('loadAllProductKinds', {id})
@@ -182,6 +203,10 @@
           }
         }
       }
+
+      #kindCategory.change {
+        display: none !important;
+      }
     }
   }
 </style>

+ 20 - 8
components/mobile/staffManagement/StaffAdd.vue

@@ -26,6 +26,7 @@
             <li><span>手机号:</span><input type="text"
                                         v-model="newUserPhone"
                                         @change="checkPhone()"
+                                        maxlength="11"
                                         placeholder="请输入手机号"></li>
             <li><span>邮箱:</span><input type="text"
                                        v-model="newUserEmail"
@@ -177,14 +178,25 @@
       },
       // 绑定未注册用户
       addNewUser () {
-        if (this.newEmailCheck && this.newPhoneCheck) {
-          this.$http.post('/basic/user', {userEmail: this.newUserEmail, userName: this.newUserName, userSex: this.sex, userTel: this.newUserPhone})
-            .then(response => {
-              if (response) {
-                this.onRemind('增加用户成功' + this.newUserName)
-                this.$router.push('/mobile/user/staff')
-              }
-            })
+        if (!this.newUserPhone || this.newUserPhone === '') {
+          this.onRemind('请输入手机号码')
+          this.newPhoneCheck = false
+        } else if (!this.newUserEmail || this.newUserEmail === '') {
+          this.onRemind('请输入邮箱')
+          this.newEmailCheck = false
+        } else {
+          if (this.newEmailCheck && this.newPhoneCheck) {
+            this.$http.post('/basic/user', {userEmail: this.newUserEmail, userName: this.newUserName, userSex: this.sex, userTel: this.newUserPhone})
+              .then(response => {
+                if (response) {
+                  this.onRemind('增加用户成功' + this.newUserName)
+                  this.$router.push('/mobile/user/staff')
+                }
+              })
+          } else {
+            this.checkPhone()
+            this.checkEmail()
+          }
         }
       },
       // 取消绑定

+ 8 - 6
components/mobile/staffManagement/StaffList.vue

@@ -160,7 +160,7 @@
       'staffData': {
         handler: function (val) {
           if (this.isChange) {
-            this.staffDataList = val.content
+            this.staffDataList = []
             this.isChange = false
           }
           this.staffDataList = [...this.staffDataList, ...val.content]
@@ -268,7 +268,7 @@
       // 选择性搜索
       rolesEvent (type) {
         this.isChange = true
-        this.showRole = !this.showRole
+        this.showRole = false
         this.role = type ? type.desc : '全部角色'
         this.page = 1
         if (!type && !this.staffSearch) {
@@ -362,10 +362,12 @@
       // 申请绑定操作事件 (同意和拒绝)
       agreeEvent (type, flag) {
         this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
-        this.onRemind('操作成功!')
-        this.auditSearch = ''
-        this.page = 1
-        this.auditRecord()
+          .then(() => {
+            this.onRemind('操作成功!')
+            this.auditSearch = ''
+            this.page = 1
+            this.auditRecord()
+          })
       }
     }
   }

+ 3 - 3
pages/mobile/center/user/collect/component/_key.vue

@@ -12,7 +12,7 @@
           <i class="iconfont icon-sousuo"></i>
         </span>
         <ul class="similar brand-similar-list" v-show="showSimilarCodeList && keyword">
-          <li v-for="sBrand in similarBrand" :key="sBrand.code" @click.stop="setBrand(sBrand.code)">{{sBrand.code}}</li>
+          <li v-for="sBrand in similarBrand" @click.stop="setBrand(sBrand.code)" v-text="sBrand.code"></li>
         </ul>
       </div>
       <template v-if="compList && compList.length">
@@ -20,7 +20,7 @@
           <p>搜索“<span>{{keyword}}</span>”,为您找到{{compCollectList.data.total}}条信息</p>
         </div>
         <ul>
-          <li class="clearfix" :key="comp.componentid" v-for="comp in compList" @click="goUrl('/mobile/brand/componentDetail/' + comp.componentinfo.uuid)">
+          <li class="clearfix" v-for="comp in compList" @click="goUrl('/mobile/brand/componentDetail/' + comp.componentinfo.uuid)">
             <div class="fl">
               <p>品牌:<span v-text="comp.brand.nameEn || '-'"></span></p>
               <p>物料名称:<span v-text="comp.kind.nameCn || '-'"></span></p>
@@ -227,7 +227,7 @@
       z-index: 12;
       border: 1px solid #7e7e7e;
       border-radius: .05rem;
-      top: .7rem;
+      top: 100%;
       background: #fff;
       left: 0.1rem;
       right: 0;