Browse Source

fix: 物业收录区别营销收录

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 year ago
parent
commit
9ed5f0965b

+ 10 - 3
src/web/staticres/css/dev2/biddingSearch.css

@@ -1720,13 +1720,17 @@ position: absolute;
 }
 .liLuceneList .bid-list-tags .icon-shoulu::after {
   content: '收录';
+  left: 24px;
+  color: #1D1D1D;
+}
+.liLuceneList .bid-list-tags .icon-shoulu.wuye::after {
   left: -29px;
   color: #2ABED1;
 }
-.liLuceneList .bid-list-tags .icon-shoulu.icon-a-Property1shoulu::before{
+.liLuceneList .bid-list-tags .icon-shoulu.wuye.icon-a-Property1shoulu::before{
   display: none;
 }
-.liLuceneList .bid-list-tags .icon-shoulu.icon-a-Property1yishoulu::before{
+.liLuceneList .bid-list-tags .icon-shoulu.wuye.icon-a-Property1yishoulu::before{
   display: none;
 }
 .liLuceneList .bid-list-tags .icon-collect.checked{
@@ -1753,9 +1757,12 @@ position: absolute;
 }
 .liLuceneList .bid-list-tags .icon-shoulu.icon-a-Property1yishoulu::after{
   content: '已收录';
-  left: -45px;
+  left: 24px;
   color: #2ABED1;
 }
+.liLuceneList .bid-list-tags .icon-shoulu.wuye.icon-a-Property1yishoulu::after{
+  left: -45px;
+}
 .liLuceneList  .luce-field{
   margin-top: 16px;
 }

+ 54 - 24
src/web/staticres/js/superSearch.js

@@ -9,6 +9,7 @@ var employList = [] // 收录情况列表
 var tParams = goTemplateData.params
 // 是否在bi环境下(p364-crm营销功能)
 var inResourceBIiframe = getParam('resource') === 'BI'
+var inBIPropertyiframe = getParam('property') === 'BIProperty'
 
 if (!(tParams.isEntniche || tParams.isVip || tParams.isMember)) {
   localStorage.setItem('login-clear-bidsearch-list-model', 'S')
@@ -450,7 +451,11 @@ function appendDatas(datas,flag,isNew,onlyUpdateTable){
                   $('.line-common').show()
                 } else {
                   // // 是否收录
-                  listHtml += '<i class="icon-shoulu icon-a-Property1shoulu" dataid="'+datas[i]._id+'"></i>'
+                  if (inBIPropertyiframe) {
+                    listHtml += '<i class="icon-shoulu icon-a-Property1shoulu wuye" dataid="'+datas[i]._id+'"></i>'
+                  } else {
+                    listHtml += '<i class="icon-shoulu iconfont icon-a-Property1shoulu" dataid="'+datas[i]._id+'"></i>'
+                  }
                   $('#right-export').hide()
                   $('#bid-collect').hide()
                   $('.line-common').hide()
@@ -1793,11 +1798,20 @@ $('#right-employ').off('click').bind('click', function(e) {
         return
       }
     }
-    const url = '/jyNewApi/property/information/batch/create'
+    let url = '/jyapi/crmApplication/employ/operate'
     console.info(checkedId)
-    const result = checkedId.map(obj => obj.bid)
-    const params = {
-      ids: result.join(',')
+    let result = checkedId.map(obj => obj.bid)
+    let params = {
+      idArr: result.join(','),
+      isEmploy: true,
+      employType: 1
+    }
+    if(searchInnerVue.inBIPropertyiframe) {
+      url = '/jyNewApi/property/information/batch/create'
+      result = checkedId.map(obj => obj.bid)
+      params = {
+        ids: result.join(',')
+      }
     }
     $.ajax({
       type: "POST",
@@ -1805,31 +1819,43 @@ $('#right-employ').off('click').bind('click', function(e) {
       contentType: 'application/json',
       data: JSON.stringify(params),
       success: function (res) {
-        if (res.code === 1) {
-          checkedId.forEach((v, i) => {
-            $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
-          })
-        } else if(res.code === 2) {
-          if(res.data) {
-            if(res.data.indexOf(',') !== -1) {
-              const resArr = res.data.split(',')
-              resArr.forEach(r => {
+        if(searchInnerVue.inBIPropertyiframe) {
+          // 物业专版批量收录
+          if (res.code === 1) {
+            checkedId.forEach((v, i) => {
+              $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
+            })
+          } else if(res.code === 2) {
+            if(res.data) {
+              if(res.data.indexOf(',') !== -1) {
+                const resArr = res.data.split(',')
+                resArr.forEach(r => {
+                  checkedId.forEach((v, i) => {
+                    if(r === v.bid) {
+                      $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
+                    }
+                  })
+                })
+              } else {
                 checkedId.forEach((v, i) => {
-                  if(r === v.bid) {
+                  if(res.data === v.bid) {
                     $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
                   }
                 })
-              })
-            } else {
+              }
+            }
+          }
+          toastFn(res.msg, 1000)
+        } else {
+          // 营销批量收录
+          if (res.error_code === 0) {
+            if (res.data.status) {
               checkedId.forEach((v, i) => {
-                if(res.data === v.bid) {
-                  $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
-                }
+                $('.icon-shoulu[dataid="' + result[i] + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
               })
             }
           }
         }
-        toastFn(res.msg, 1000)
       },
       error: function (err) {
         reject(err)
@@ -1951,7 +1977,7 @@ $(document).on('click', '.icon-shoulu', function() {
     isEmploy: !isChecked,
     employType: 1
   }
-  if(!isChecked) {
+  if(!isChecked && searchInnerVue.inBIPropertyiframe) {
     params = {
       id: id
     }
@@ -1964,7 +1990,7 @@ $(document).on('click', '.icon-shoulu', function() {
     data: JSON.stringify(params),
     success: function (res) {
       // 收录操作
-      if(!isChecked) {
+      if(!isChecked && searchInnerVue.inBIPropertyiframe) {
         if (res.code === 2) {
           // 已经创建情报信息,直接收录
           $('.icon-shoulu[dataid="' + id + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
@@ -1978,7 +2004,11 @@ $(document).on('click', '.icon-shoulu', function() {
         // 取消收录操作
         if (res.error_code === 0) {
           if (res.data.status) {
-            $('.icon-shoulu[dataid="' + id + '"]').removeClass('icon-a-Property1yishoulu').addClass('icon-a-Property1shoulu')
+            if(!isChecked) {
+              $('.icon-shoulu[dataid="' + id + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')
+            } else {
+              $('.icon-shoulu[dataid="' + id + '"]').removeClass('icon-a-Property1yishoulu').addClass('icon-a-Property1shoulu')
+            }
           } else {
             toastFn(res.data.msg, 800)
           }

+ 1 - 1
src/web/templates/pc/supsearch.html

@@ -3510,7 +3510,7 @@ function checkTagDisabled () {
           }
           if(!_this.showPropertyDialog){
             if(event.storageArea.return_status == '1') {
-              const propertyData = localStorage.getItem('property-data')
+              let propertyData = localStorage.getItem('property-data')
               if(propertyData) {
                 propertyData = JSON.parse(propertyData)
                 $('.icon-shoulu[dataid="' + propertyData._id + '"]').removeClass('icon-a-Property1shoulu').addClass('icon-a-Property1yishoulu')