Bladeren bron

feat:企业画像权限修改

wangxiaogang 3 jaren geleden
bovenliggende
commit
9418952187
3 gewijzigde bestanden met toevoegingen van 104 en 23 verwijderingen
  1. 16 16
      src/components/common/Popper.vue
  2. 2 2
      src/views/ent-intel/MyClient.vue
  3. 86 5
      src/views/portrayal/UnitPortrayal.vue

+ 16 - 16
src/components/common/Popper.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="tags-box">
+  <div class="tags-box-renling">
     <div class="tags-inputs">
       <div class="tag-input">
         <div class="tag-labels"></div>
@@ -39,12 +39,12 @@ export default {
         $('.custom-toast').fadeOut().remove()
       }, duration)
     },
-    tagsShow (data) {
+    tagsRenShow (data) {
       this.datas = data.data
       var top = data.liHeight * (data.i + 1) + 'px'
       if (data.show) {
         // baiduEvent('列表页认领') // 百度统计代码
-        $('.tags-box').slideToggle(function () {
+        $('.tags-box-renling').slideToggle(function () {
           window.activeTags = []
           $('.tag-labels').empty()
           $('.clear-input').val('')
@@ -63,7 +63,7 @@ export default {
       }
       // 自定义标签
       // 标签输入框事件
-      $('.tags-box').click(function (e) {
+      $('.tags-box-renling').click(function (e) {
         e.stopPropagation()
       })
 
@@ -76,7 +76,7 @@ export default {
       $('.tag-input .clear-input').keydown(function (event) {
         event.stopPropagation()
         if (event.keyCode === 13) {
-          if (!$('.tags-box').is(':hidden')) {
+          if (!$('.tags-box-renling').is(':hidden')) {
             $('.tags-inputs .add-tag-button').trigger('click')
           }
         }
@@ -97,7 +97,7 @@ export default {
       })
       // 点击确定按钮,绑定标签
       $('.tags-footer .button-confirm').on('click', function () {
-        if (!$('.tags-box').is(':hidden')) {
+        if (!$('.tags-box-renling').is(':hidden')) {
           var lids = ''
           var lname = ''
           $('.tags-item.tags-active').each(function () {
@@ -120,13 +120,13 @@ export default {
           }
           // 执行保存绑定标签操作
           saveChooseTags(params, function () {
-            $('.tags-footer .button-cancel').trigger('click')
+            $('.tags-box-renling').slideToggle()
           })
         }
       })
 
       $('.tags-footer .button-cancel').on('click', function () {
-        $('.tags-box').slideToggle(function () {
+        $('.tags-box-renling').slideToggle(function () {
           // 标签弹框消失时 清除上次选择的标签分类
           window.activeTags = []
           $('.tag-labels').empty()
@@ -289,7 +289,7 @@ export default {
 </script>
 
 <style>
-.tags-box {
+.tags-box-renling {
   display: none;
   position: absolute;
   top: 0;
@@ -304,7 +304,7 @@ export default {
   z-index: 99;
 }
 
-.tags-box .tags-inputs {
+.tags-box-renling .tags-inputs {
   position: relative;
   width: 100%;
   display: flex;
@@ -312,7 +312,7 @@ export default {
   justify-content: space-between;
 }
 
-.tags-box .tags-inputs .tag-input {
+.tags-box-renling .tags-inputs .tag-input {
   width: 100%;
   padding: 0;
   min-height: 34px;
@@ -389,22 +389,22 @@ export default {
   font-size: 14px;
 }
 
-.tags-box .tags-list {
+.tags-box-renling .tags-list {
   margin-top: 12px;
   overflow-y: auto;
   height: 220px;
 }
 
-.tags-box .tags-list::-webkit-scrollbar {
+.tags-box-renling .tags-list::-webkit-scrollbar {
   width: 8px;
 }
 
-.tags-box .tags-list::-webkit-scrollbar-thumb {
+.tags-box-renling .tags-list::-webkit-scrollbar-thumb {
   border-radius: 4px;
   background-color: #ECECEC;
 }
 
-.tags-box .tags-list .tags-item {
+.tags-box-renling .tags-list .tags-item {
   float: left;
   min-width: 44px;
   padding: 0 8px;
@@ -421,7 +421,7 @@ export default {
   cursor: pointer;
 }
 
-.tags-box .tags-list .tags-active {
+.tags-box-renling .tags-list .tags-active {
   padding: 0 8px 0 24px !important;
   background: #2CB7CA url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADPSURBVHgB7ZNREcIwDIYjYRImYRLmZHPAHAwHlUAdIAEJSKiESgjpEY7Qg7uFdXnKd5eXdMmfpX8BHMdxDEDEgSJQ9GANiU4UGZ9cwBISXPFNGWIAKyrxZLr+suq/xdkwV4oFlFBNR3ET4veS0zaJosGoqOtZ8EVUi4tGWbM+rklC/Ax7KH++dY18ZbmZuGi8iKbhxzdTJT5DSyo/LNXZSZxljV80A3T4aayR86vIJTzyjX8xZTATF0NIU24y5xFDSFNGU3ExxNzsmTmO4zAPYEiZdz83IV0AAAAASUVORK5CYII=) no-repeat 6px center !important;
   color: #fff !important;

+ 2 - 2
src/views/ent-intel/MyClient.vue

@@ -282,7 +282,7 @@ export default {
     clickRenButton (item, index) {
       if (item.claim1) {
         custAttention({
-          name: item.name,
+          name: item.customerId,
           mold: 1,
           D: true,
           label: ''
@@ -299,7 +299,7 @@ export default {
           }
         })
       } else {
-        this.$refs.popperRef.tagsShow({
+        this.$refs.popperRef.tagsRenShow({
           liHeight: 95,
           show: true,
           data: item.name,

+ 86 - 5
src/views/portrayal/UnitPortrayal.vue

@@ -8,6 +8,12 @@
             <span :class="{ icon_heart_red: follow.followed, icon_heart_gray: !follow.followed }"></span>
             <span class="follow-text">{{ follow.followed ? '已关注' : '关注' }}</span>
           </div>
+          <div style="margin-left:10px;" v-if="isNewEnt.isNew">
+            <div class="u-follow" @click="setClaimed">
+              <span :class="{ 'el-icon-jy-renling-active': claim.claimed, 'el-icon-jy-renling-01': !claim.claimed }"></span>
+              <span class="follow-text">{{ claim.claimed ? '取消认领' : '认领客户' }}</span>
+            </div>
+          </div>
         </div>
         <div class="u-type">
           <div class="u-t-item">
@@ -20,6 +26,8 @@
           </div>
         </div>
       </div>
+      <!-- 认领添加标签 -->
+      <v-popper ref="popperRef" @getClientList="getClaimStatus"></v-popper>
       <!-- 超级订阅用户、免费用户显示 -->
       <div>
         <div class="free-bg" v-if="userInfo.isFree && userInfo.freeBuyerPort === 0">
@@ -133,6 +141,7 @@ import ContactList from '@/components/contact-info/ContactInfo'
 import MaskCard from '@/components/mask-card/MaskCard.vue'
 import CollectInfo from '@/components/collect-info/CollectInfo.vue'
 import Empty from '@/components/common/Empty'
+import vPopper from '@/components/common/Popper.vue'
 import { Button, Dialog } from 'element-ui'
 import {
   getBuyerSelect,
@@ -140,7 +149,8 @@ import {
   getUsage,
   getVipBuyerSelect,
   setLogs,
-  setStatusCustomer
+  setStatusCustomer,
+  claimchecked
 } from '@/api/modules'
 import { mapState } from 'vuex'
 
@@ -163,13 +173,18 @@ export default {
     DynamicList,
     [Dialog.name]: Dialog,
     [Button.name]: Button,
-    Empty
+    Empty,
+    vPopper
   },
   data () {
     return {
       isDialogShow: false,
       loading: true,
       buyerTipDialog: false,
+      claim: {
+        claimed: false,
+        loading: false
+      },
       dynamicKey: new Date().getTime(),//筛选重新渲染动态数据
       info: {
         buyerName: '',
@@ -300,6 +315,7 @@ export default {
   },
   computed: {
     ...mapState({
+      isNewEnt: state => state.user.isNewEnt,
       userInfo: state => state.user.info
     }),
     conf7 () {
@@ -436,12 +452,12 @@ export default {
     }
   },
   created () {
+    this.info.buyerName = decodeURIComponent(this.$route.params.entName)
     this.$store.dispatch('user/getUserPower')
   },
   mounted () {
-    this.info.buyerName = decodeURIComponent(this.$route.params.entName)
-    // this.getBigUpgradeMap()
     this.getFollowState()
+    // this.getBigUpgradeMap()
     var _this = this
     $.ajax({
       url: '/publicapply/bidcoll/power',
@@ -486,6 +502,66 @@ export default {
     window.removeEventListener('scroll', this.watchScroll)
   },
   methods: {
+    // 认领状态、是否认领
+    getClaimStatus () {
+      claimchecked({
+        names: this.info.buyerName
+      }).then(res => {
+        if (res.error_code === 0 && res.data) {
+          this.claim.claimed = res.data.iscoll
+          this.info.id = res.data.names[0] ? res.data.names[0].split(',')[1] : ''
+        }
+      })
+    },
+    // 认领-取消认领
+    setClaimed (e) {
+      const top = e.target.offsetTop + 22
+      if (this.claim.claimed) {
+        this.ajaxForCollectChange(this.info.id, (res) => {
+          if (res.data) {
+            this.$toast('已取消认领!')
+            this.getClaimStatus()
+          } else {
+            if (res.error_msg) {
+              this.$toast(res.error_msg)
+            } else {
+              this.$toast('取消认领失败!')
+            }
+          }
+        })
+      } else {
+        this.$refs.popperRef.tagsRenShow({
+          liHeight: 80,
+          show: true,
+          data: this.info.buyerName,
+          i: 0
+        })
+      }
+    },
+    ajaxForCollectChange (ids, callback) {
+      function collBidAction (ids, callback) {
+        const _this = this
+        var params = {
+          name: ids,
+          mold: 1,
+          D: true,
+          label: ''
+        }
+        $.ajax({
+          type: 'post',
+          contentType: 'application/json',
+          url: '/entnicheNew/customer/attention',
+          data: JSON.stringify(params),
+          dataType: 'json',
+          success: function (r) {
+            if (r) {
+              callback && callback(r)
+            }
+          }
+        })
+      }
+      return collBidAction(ids, callback)
+    },
     // 页面滚动方法
     watchScroll () {
       const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
@@ -612,6 +688,7 @@ export default {
           this.follow.followed = res.data
         }
       })
+      this.getClaimStatus()
     },
     setFollow () {
       if (this.follow.loading) return
@@ -665,6 +742,8 @@ export default {
 /* eslint-enable */
 </script>
 <style lang="scss" scoped>
+@include diy-icon('renling-01', 20, 20);
+@include diy-icon('renling-active', 20, 20);
 ::v-deep {
   .release_main {
     position: relative;
@@ -695,7 +774,9 @@ export default {
   background: url('~@/assets/images/icon/icon-favorite.png') no-repeat;
   background-size: contain;
 }
-
+.unit-portrayal-content  {
+  position: relative;
+}
 .unit-portrayal {
   .empty-container.mtb60 {
     background: #fff;