Browse Source

处理供应商与客户资料接口

wangcz 6 years ago
parent
commit
777c33eb53

+ 2 - 0
components/main/Search.vue

@@ -359,6 +359,8 @@
     }
     .search-hot {
       margin-top:5px;
+      overflow: hidden;
+      height:25px;
       .item {
         display: inline-block;
         max-width:22%;

+ 15 - 10
pages/mobile/center/user/supplier/index.vue

@@ -37,7 +37,7 @@
           <div>
             <div class="customer-modal-wrapper">
               <div class="search-content mi-search-content">
-                <input type="text" v-model="modalObj.keyword" @input="modalObjonFilter" placeholder="输入用户UU">
+                <input type="text" v-model="modalObj.keyword" @input="modalObjonFilter" placeholder="手机号/用户名">
                 <span @click="modalObjonFilter"><i class="iconfont icon-sousuo"></i></span>
               </div>
               <div class="customer-modal-content">
@@ -49,7 +49,7 @@
                   <span class="item inline-block"  style="width: 28%;height:2px" v-else>
 
                   </span>
-                  <span class="item inline-block" style="width: 32%;">用户UU</span>
+                  <span class="item inline-block" style="width: 32%;">手机</span>
                   <span class="item inline-block" style="width: 40%;text-align: center">用户名称</span>
                 </div>
                 <div class="customer-modal-content-list" v-for="item in modalObj.showModalList">
@@ -58,7 +58,7 @@
                     <label class="mobile-cart-check" :class="{'active': item.transfer}" v-else></label>
                     <!--<label class="mobile-cart-check" :class="{'active': item.distribute}"></label>-->
                   </span>
-                  <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
+                  <span class="item inline-block" style="width: 32%;">{{item.userTel}}</span>
                   <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                 </div>
               </div>
@@ -91,6 +91,10 @@
           count: 10,
           page: 1
         },
+        modalParams: {
+          count: 100000000,
+          page: 1
+        },
         collectResult: '',
         timeoutCount: 0,
         resourceList: {
@@ -114,6 +118,7 @@
         this.enabled = res.data.count > 0 || this.thisUser.sys
       })
       this.setSelect()
+      console.log(this.user)
     },
 
     methods: {
@@ -196,7 +201,7 @@
       modalObjonFilter() {
         let _arr = []
         this.modalObj.originList.forEach(item => {
-          if (item.userUU.toString().indexOf(this.modalObj.keyword) > -1) {
+          if ((item.userTel.toString().indexOf(this.modalObj.keyword) > -1) || (item.userName.toString().indexOf(this.modalObj.keyword) > -1)) {
             _arr.push(item)
           }
         })
@@ -242,11 +247,11 @@
       async addUserInfo(customer) {
         this.modalObj.type = 'add'
         this.modalObj.customer = customer
-        this.$http.post(`/vendorDistribute/${customer.id}`).then(res => {
+        this.$http.get(`/vendorDistribute/${customer.id}`, {params: this.modalParams}).then(res => {
           if (this.enabled || res.data) {
             this.modalObj.showModal = true
-            this.modalObj.showModalList = res.data
-            this.modalObj.originList = res.data
+            this.modalObj.showModalList = res.data.content
+            this.modalObj.originList = res.data.content
             this.init()
           } else {
             this.onMind('您没有当前客户分配用户的权限!')
@@ -259,14 +264,14 @@
       transferUserInfo(customer) {
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
-        this.$http.post(`/vendorDistribute/${customer.id}`).then(res => {
+        this.$http.get(`/vendorDistribute/${customer.id}`, {params: this.modalParams}).then(res => {
           if (this.enabled || res.data) {
             this.$http.get('/authentication').then(res => {
               this.thisUser = res.data
             })
             this.modalObj.showModal = true
-            this.modalObj.showModalList = res.data
-            this.modalObj.originList = res.data
+            this.modalObj.showModalList = res.data.content
+            this.modalObj.originList = res.data.content
             this.init()
           } else {
             this.onMind('您没有当前客户转移用户的权限!')

+ 19 - 14
pages/mobile/center/vendor/customer/index.vue

@@ -47,7 +47,7 @@
           <div>
             <div class="customer-modal-wrapper">
               <div class="search-content mi-search-content">
-                <input type="text" v-model="modalObj.keyword" @input="modalObjonFilter" placeholder="输入用户UU">
+                <input type="text" v-model="modalObj.keyword" @input="modalObjonFilter" placeholder="手机号/用户名">
                 <span @click="modalObjonFilter"><i class="iconfont icon-sousuo"></i></span>
               </div>
               <div class="customer-modal-content">
@@ -59,7 +59,7 @@
                   <span class="item inline-block"  style="width: 28%;height:2px" v-else>
 
                   </span>
-                  <span class="item inline-block" style="width: 32%;">用户UU</span>
+                  <span class="item inline-block" style="width: 32%;">手机</span>
                   <span class="item inline-block" style="width: 40%;text-align: center">用户名称</span>
                 </div>
                 <template v-if="modalObj.type === 'add'">
@@ -68,7 +68,7 @@
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                     <label class="mobile-cart-check" :class="{'active': item.distribute}"></label>
                   </span>
-                    <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
+                    <span class="item inline-block" style="width: 32%;">{{item.userTel}}</span>
                     <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                   </div>
                 </template>
@@ -79,7 +79,7 @@
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                     <label class="mobile-cart-check" :class="{'active': item.transfer}"></label>
                   </span>
-                    <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
+                    <span class="item inline-block" style="width: 32%;">{{item.userTel}}</span>
                     <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                   </div>
                   <!-- 客户转移 && 当前用户是被管理员转移权限时 -->
@@ -87,7 +87,7 @@
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                     <label class="mobile-cart-check" :class="{'active': item.transfer}"></label>
                   </span>
-                    <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
+                    <span class="item inline-block" style="width: 32%;">{{item.userTel}}</span>
                     <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                   </div>
                   <!-- 客户转移 && 当前用户是非管理员,但有查看权限时 -->
@@ -95,7 +95,7 @@
                   <span class="item inline-block" style="width: 28%;" @click="checkItem(item)">
                     <label class="mobile-cart-check" :class="{'active': item.transfer}"></label>
                   </span>
-                    <span class="item inline-block" style="width: 32%;">{{item.userUU}}</span>
+                    <span class="item inline-block" style="width: 32%;">{{item.userTel}}</span>
                     <span class="item inline-block" style="width: 40%;text-align: center;">{{item.userName}}</span>
                   </div>
                 </template>
@@ -129,6 +129,10 @@
           count: 10,
           page: 1
         },
+        modalParams: {
+          count: 100000000,
+          page: 1
+        },
         collectResult: '',
         timeoutCount: 0,
         resourceList: {
@@ -160,7 +164,7 @@
           if (this.modalObj.customer.myEnterprise.uu) {
             // 当前用户是管理员时
             if (this.thisUser.sys) {
-                this.$http.post(`/account/user/transferUserToVendor/${this.modalObj.customer.myEnterprise.uu}`, this.modalObj.originList).then(data => {
+                this.$http.post(`/account/user/transferUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(data => {
                   this.onMind('转移成功!')
                   this.closeModal()
                   this.setSelect(true)
@@ -198,9 +202,10 @@
             this.closeModal()
           }
         } else {
-          this.$http.post(`/account/user/bindUserToVendor/${this.modalObj.customer.myEnterprise.uu}`, this.modalObj.originList).then(res => {
+          this.$http.post(`/account/user/bindUserToVendor/${this.modalObj.customer.id}`, this.modalObj.originList).then(res => {
             this.onMind('分配成功!')
             this.closeModal()
+            this.setSelect(true)
           }).catch(err => {
             this.onMind('保存失败!')
             this.closeModal()
@@ -270,7 +275,7 @@
       modalObjonFilter() {
         let _arr = []
         this.modalObj.originList.forEach(item => {
-          if (item.userUU.toString().indexOf(this.modalObj.keyword) > -1) {
+          if ((item.userTel.toString().indexOf(this.modalObj.keyword) > -1) || (item.userName.toString().indexOf(this.modalObj.keyword) > -1)) {
             _arr.push(item)
           }
         })
@@ -283,8 +288,8 @@
         this.$http.get(`/account/user/getEnTransfer/${customer.myEnterprise.uu}`).then(res => {
           customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
-            this.$http.post(`/account/user/customer/${customer.myEnterprise.uu}`).then(data => {
-                customer.userinfos = data.data
+            this.$http.get(`/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
+                customer.userinfos = data.data.content
                 this.modalObj.showModal = true
                 this.modalObj.showModalList = customer.userinfos
                 this.modalObj.originList = customer.userinfos
@@ -299,14 +304,14 @@
       transferUserInfo(customer) {
         this.modalObj.type = 'chance'
         this.modalObj.customer = customer
-        this.$http.get(`/account/user/getDistribute/${customer.myEnterprise.uu}`).then(res => {
+        this.$http.get(`/account/user/getDistribute/${customer.id}`).then(res => {
           customer.enTransfer = res.data.result
           if (this.enabled || customer.enTransfer) {
             this.$http.get('/authentication').then(res => {
               this.thisUser = res.data
             })
-            this.$http.post(`/account/user/customer/${customer.myEnterprise.uu}`).then(data => {
-              customer.userinfos = data.data
+            this.$http.get(`/account/user/customer/${customer.id}`, {params: this.modalParams}).then(data => {
+              customer.userinfos = data.data.content
               customer.userinfos.forEach(user => {
                 if (this.$store.state.option.user.data.userUU === user.userUU && user.transfer) {
                   this.transfer = true