Browse Source

处理供应商和客户资料搜索问题

wangcz 7 years ago
parent
commit
fb9d585036

+ 4 - 2
pages/mobile/center/user/supplier/index.vue

@@ -118,7 +118,6 @@
         this.enabled = res.data.count > 0 || this.thisUser.sys
       })
       this.setSelect()
-      console.log(this.user)
     },
 
     methods: {
@@ -200,8 +199,9 @@
       },
       modalObjonFilter() {
         let _arr = []
+        let keys = this.modalObj.keyword
         this.modalObj.originList.forEach(item => {
-          if ((item.userTel.toString().indexOf(this.modalObj.keyword) > -1) || (item.userName.toString().indexOf(this.modalObj.keyword) > -1)) {
+          if ((String(item.userTel).indexOf(keys) > -1) || (String(item.userName).indexOf(keys) > -1)) {
             _arr.push(item)
           }
         })
@@ -245,6 +245,7 @@
       },
       // 分配
       async addUserInfo(customer) {
+        this.modalObj.keyword = ''
         this.modalObj.type = 'add'
         this.modalObj.customer = customer
         this.$http.get(`/vendorDistribute/${customer.id}`, {params: this.modalParams}).then(res => {
@@ -262,6 +263,7 @@
       },
       // 转移
       transferUserInfo(customer) {
+        this.modalObj.keyword = ''
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
         this.$http.get(`/vendorDistribute/${customer.id}`, {params: this.modalParams}).then(res => {

+ 4 - 1
pages/mobile/center/vendor/customer/index.vue

@@ -274,8 +274,9 @@
       },
       modalObjonFilter() {
         let _arr = []
+        let keys = this.modalObj.keyword
         this.modalObj.originList.forEach(item => {
-          if ((item.userTel.toString().indexOf(this.modalObj.keyword) > -1) || (item.userName.toString().indexOf(this.modalObj.keyword) > -1)) {
+          if ((String(item.userTel).indexOf(keys) > -1) || (String(item.userName).indexOf(keys) > -1)) {
             _arr.push(item)
           }
         })
@@ -283,6 +284,7 @@
       },
       // 分配
       async addUserInfo(customer) {
+        this.modalObj.keyword = ''
         this.modalObj.type = 'add'
         this.modalObj.customer = customer
         this.$http.get(`/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
@@ -302,6 +304,7 @@
       },
       // 转移
       transferUserInfo(customer) {
+        this.modalObj.keyword = ''
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
         this.$http.get(`/account/user/getDistribute/${customer.id}`).then(res => {