|
@@ -12,10 +12,10 @@ function getRandomString (len) {
|
|
|
return randomString
|
|
|
}
|
|
|
// toast上限提示
|
|
|
-function toastFn (text, duration = 1000) {
|
|
|
- // if (duration) {
|
|
|
- // duration = 1000
|
|
|
- // }
|
|
|
+function toastFn (text, duration) {
|
|
|
+ if (!duration) {
|
|
|
+ duration = 1000
|
|
|
+ }
|
|
|
var _html = ""
|
|
|
_html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
|
|
|
_html+='<span>' + text + '</span></div></div>'
|
|
@@ -28,9 +28,9 @@ function formatKeywordsList (res) {
|
|
|
// if (!res || !res.a_items) return
|
|
|
// const data = res.a_items
|
|
|
var newArr = []
|
|
|
- res.forEach((v) => {
|
|
|
+ res.forEach(function(v) {
|
|
|
if (v.a_key) {
|
|
|
- v.a_key.forEach((s) => {
|
|
|
+ v.a_key.forEach(function(s) {
|
|
|
newArr.push(s)
|
|
|
})
|
|
|
}
|
|
@@ -216,7 +216,7 @@ var vm = new Vue({
|
|
|
this.initCollectEvent()
|
|
|
this.initDOMEvents()
|
|
|
ewmMoveHover()
|
|
|
- this.$on('updatescope', (data) => {
|
|
|
+ this.$on('updatescope', function(data) {
|
|
|
this.setData.keyList = data
|
|
|
})
|
|
|
/**
|
|
@@ -228,7 +228,7 @@ var vm = new Vue({
|
|
|
type: 'buyer',
|
|
|
el: '.search-header-top .input-container',
|
|
|
submitSelector: '.search-button',
|
|
|
- change: (val) => {
|
|
|
+ change: function(val) {
|
|
|
this.searchContent = val
|
|
|
}
|
|
|
})
|
|
@@ -280,10 +280,10 @@ var vm = new Vue({
|
|
|
otherFilterChange: function () {
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- updatescope(data) {
|
|
|
+ updatescope: function(data) {
|
|
|
// console.log(data)
|
|
|
},
|
|
|
- initPageData () {
|
|
|
+ initPageData: function () {
|
|
|
if (pageInfo.searchContent) {
|
|
|
this.searchContent = pageInfo.searchContent
|
|
|
console.info(this.searchContent)
|
|
@@ -333,7 +333,7 @@ var vm = new Vue({
|
|
|
}.bind(this)
|
|
|
})
|
|
|
}, 200),
|
|
|
- goSearch(name) {
|
|
|
+ goSearch: function(name) {
|
|
|
this.searchContent = name
|
|
|
this.preSearch.hover = false
|
|
|
this.listState.pageNum = 1
|
|
@@ -351,7 +351,7 @@ var vm = new Vue({
|
|
|
$("#bidLogin").modal("show");
|
|
|
}
|
|
|
},
|
|
|
- yeFan() {
|
|
|
+ yeFan: function() {
|
|
|
if (goTemplateData.inIframe) {
|
|
|
window.$BRACE.methods.open({
|
|
|
route: {
|
|
@@ -363,25 +363,25 @@ var vm = new Vue({
|
|
|
}
|
|
|
},
|
|
|
// 整理数据列表
|
|
|
- initIndustryMap () {
|
|
|
+ initIndustryMap: function () {
|
|
|
var industryListMap = []
|
|
|
// 全部
|
|
|
var all = JSON.parse(JSON.stringify(this.industryExp))
|
|
|
all.selected = true
|
|
|
- all.id = `lv0-${getRandomString(8).toLowerCase()}`
|
|
|
+ all.id = 'lv0-' + getRandomString(8).toLowerCase()
|
|
|
industryListMap.push(all)
|
|
|
for (var key in this.industryListMapExp) {
|
|
|
var level1 = JSON.parse(JSON.stringify(this.industryExp))
|
|
|
level1.name = key
|
|
|
level1.level = 1
|
|
|
- level1.id = `lv1-${getRandomString(8).toLowerCase()}`
|
|
|
+ level1.id = 'lv1-' + getRandomString(8).toLowerCase()
|
|
|
|
|
|
var level2Arr = []
|
|
|
- this.industryListMapExp[key].forEach(item => {
|
|
|
+ this.industryListMapExp[key].forEach(function(item) {
|
|
|
var level2 = JSON.parse(JSON.stringify(this.industryExp))
|
|
|
level2.name = item
|
|
|
level2.level = 2
|
|
|
- level2.id = `lv2-${getRandomString(8).toLowerCase()}`
|
|
|
+ level2.id = 'lv2-' + getRandomString(8).toLowerCase()
|
|
|
level2Arr.push(level2)
|
|
|
})
|
|
|
|
|
@@ -391,20 +391,22 @@ var vm = new Vue({
|
|
|
|
|
|
this.industryListMap = industryListMap
|
|
|
var tempArr = []
|
|
|
- this.industryListMap.forEach(v => {
|
|
|
+ this.industryListMap.forEach(function(v) {
|
|
|
var tempNode = v
|
|
|
tempNode.zindex = 1
|
|
|
tempArr.push(tempNode)
|
|
|
- tempNode?.children.forEach(s => {
|
|
|
- var tempS = s
|
|
|
- tempS.zindex = 2
|
|
|
- tempArr.push(tempS)
|
|
|
- })
|
|
|
+ if (tempNode.children) {
|
|
|
+ tempNode.children.forEach(function(s) {
|
|
|
+ var tempS = s
|
|
|
+ tempS.zindex = 2
|
|
|
+ tempArr.push(tempS)
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
this.getIndustryListMap = tempArr
|
|
|
},
|
|
|
// 按钮点击事件
|
|
|
- changeIndustryState (item) {
|
|
|
+ changeIndustryState: function (item) {
|
|
|
// 循环所有数据,判断并改变状态
|
|
|
switch (item.level) {
|
|
|
case 0: {
|
|
@@ -416,7 +418,7 @@ var vm = new Vue({
|
|
|
|
|
|
this.industryListMap[0].selected = false
|
|
|
// 二级子按钮状态跟随一级按钮
|
|
|
- item.children.forEach(level2 => {
|
|
|
+ item.children.forEach(function(level2) {
|
|
|
level2.selected = item.selected
|
|
|
})
|
|
|
break
|
|
@@ -425,10 +427,10 @@ var vm = new Vue({
|
|
|
item.selected = !item.selected
|
|
|
|
|
|
// 找到当前点击的父级元素
|
|
|
- this.industryListMap.forEach(level1 => {
|
|
|
+ this.industryListMap.forEach(function(level1) {
|
|
|
var selectedStateArr = []
|
|
|
if (item.level !== 0) {
|
|
|
- level1.children.forEach(level2 => {
|
|
|
+ level1.children.forEach(function(level2) {
|
|
|
selectedStateArr.push(level2.selected)
|
|
|
})
|
|
|
if (selectedStateArr.indexOf(false) === -1) {
|
|
@@ -461,17 +463,17 @@ var vm = new Vue({
|
|
|
this.doSearch()
|
|
|
},
|
|
|
// 检查是否全部选中了/全部不选中
|
|
|
- checkAllSelectedState () {
|
|
|
+ checkAllSelectedState: function () {
|
|
|
// 一级标签选中状态(如果一级标签全部被选中,则说明,全部按钮被选中)
|
|
|
var level1StateArr = []
|
|
|
// 所有标签选中状态
|
|
|
var allSelectedArr = []
|
|
|
|
|
|
- this.industryListMap.forEach(level1 => {
|
|
|
+ this.industryListMap.forEach(function(level1) {
|
|
|
if (level1.level !== 0) {
|
|
|
level1StateArr.push(level1.selected)
|
|
|
allSelectedArr.push(level1.selected)
|
|
|
- level1.children.forEach(level2 => {
|
|
|
+ level1.children.forEach(function(level2) {
|
|
|
allSelectedArr.push(level2.selected)
|
|
|
})
|
|
|
}
|
|
@@ -488,13 +490,13 @@ var vm = new Vue({
|
|
|
* 初始化页面选中状态
|
|
|
* @param { Array | undefined } data 要恢复的数据
|
|
|
*/
|
|
|
- setIndustryState (data) {
|
|
|
+ setIndustryState: function (data) {
|
|
|
// 设置全部按钮
|
|
|
if (!data || Object.keys(data).length === 0) {
|
|
|
// 其他全部设置不选中,全部按钮设置选中
|
|
|
- this.industryListMap.forEach(item => {
|
|
|
+ this.industryListMap.forEach(function(item) {
|
|
|
item.selected = false
|
|
|
- item.children.forEach(iitem => {
|
|
|
+ item.children.forEach(function(iitem) {
|
|
|
iitem.selected = false
|
|
|
})
|
|
|
})
|
|
@@ -504,7 +506,7 @@ var vm = new Vue({
|
|
|
this.setIndustryState()
|
|
|
this.industryListMap[0].selected = false
|
|
|
|
|
|
- this.industryListMap.forEach(item => {
|
|
|
+ this.industryListMap.forEach(function(item) {
|
|
|
if (data[item.name]) {
|
|
|
// 如果恢复数组长度等于页面二级标签长度,则一级标签点亮
|
|
|
if (data[item.name].length === item.children.length) {
|
|
@@ -520,12 +522,12 @@ var vm = new Vue({
|
|
|
}
|
|
|
},
|
|
|
// 获取选中的数据
|
|
|
- getSelected () {
|
|
|
+ getSelected: function () {
|
|
|
var map = {}
|
|
|
- this.industryListMap.forEach(item => {
|
|
|
+ this.industryListMap.forEach(function(item) {
|
|
|
var mapArr = []
|
|
|
if (item.level !== 0) {
|
|
|
- item.children.forEach(iitem => {
|
|
|
+ item.children.forEach(function(iitem) {
|
|
|
if (iitem.selected) {
|
|
|
mapArr.push(iitem.name)
|
|
|
}
|
|
@@ -536,17 +538,17 @@ var vm = new Vue({
|
|
|
}
|
|
|
})
|
|
|
var tempArr = []
|
|
|
- Object.keys(map).forEach(v => {
|
|
|
+ Object.keys(map).forEach(function(v) {
|
|
|
var tempItem = map[v]
|
|
|
if (Array.isArray(tempItem)) {
|
|
|
- tempItem.forEach(vv => {
|
|
|
- tempArr.push(`${v}_${vv}`)
|
|
|
+ tempItem.forEach(function(vv) {
|
|
|
+ tempArr.push(v + '_' + vv)
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
return tempArr
|
|
|
},
|
|
|
- dataChange(val) {
|
|
|
+ dataChange: function(val) {
|
|
|
this.tempData = val
|
|
|
this.doSearch()
|
|
|
},
|
|
@@ -669,7 +671,7 @@ var vm = new Vue({
|
|
|
document.body.scrollTop = oTop
|
|
|
this.getList()
|
|
|
},
|
|
|
- goTitle(name) {
|
|
|
+ goTitle: function(name) {
|
|
|
if (this.isNewEntNiche) {
|
|
|
window.open('/entpc/unit_portrayal/' + name)
|
|
|
} else {
|
|
@@ -677,14 +679,14 @@ var vm = new Vue({
|
|
|
}
|
|
|
},
|
|
|
// 全选
|
|
|
- allChange() {
|
|
|
+ allChange: function() {
|
|
|
var str1 = $('.check-all').prop('checked')
|
|
|
var str2 = $('.custom-checkbox:not(".check-all")')
|
|
|
var arr = $('.custom-checkbox:not(".check-all"):checked')
|
|
|
let arrs1 = [], arrs2 = [], arrs3= []
|
|
|
if (str1) {
|
|
|
str2.prop('checked', true)
|
|
|
- this.listState.list.forEach(v => {
|
|
|
+ this.listState.list.forEach(function(v) {
|
|
|
arrs1.push(v.Buyer)
|
|
|
arrs2.push(v.Buyerclass)
|
|
|
arrs3.push(v.customerId)
|
|
@@ -707,7 +709,7 @@ var vm = new Vue({
|
|
|
this.selectId = arrs3
|
|
|
},
|
|
|
// 单选
|
|
|
- singleChange () {
|
|
|
+ singleChange: function () {
|
|
|
let arr1 = [], arr2 = [], arr3 = []
|
|
|
$('.custom-checkbox:not(".check-all"):checked').each(function(){
|
|
|
if ($(this).attr('dataname')) {
|
|
@@ -751,12 +753,15 @@ var vm = new Vue({
|
|
|
}
|
|
|
},
|
|
|
// 数组去重
|
|
|
- unique(arr) {
|
|
|
- var res = new Map();
|
|
|
- return arr.filter((arr) => !res.has(arr) && res.set(arr, 1));
|
|
|
+ unique: function(arr) {
|
|
|
+ var res = new Map()
|
|
|
+ // return arr.filter((arr) => !res.has(arr) && res.set(arr, 1));
|
|
|
+ return arr.filter(function (arr) {
|
|
|
+ return !res.has(arr) && res.set(arr, 1)
|
|
|
+ })
|
|
|
},
|
|
|
// 是否关注企业
|
|
|
- attentionCheck(arrs, item) {
|
|
|
+ attentionCheck: function(arrs, item) {
|
|
|
var _this = this
|
|
|
$.ajax({
|
|
|
url: '/entnicheNew/customer/check',
|
|
@@ -767,7 +772,7 @@ var vm = new Vue({
|
|
|
if (res.data.names) {
|
|
|
this.attentionName = res.data.names
|
|
|
}
|
|
|
- arrs.forEach(v => {
|
|
|
+ arrs.forEach(function(v) {
|
|
|
if (res.data.names.indexOf(v.Buyer) > -1) {
|
|
|
v.isFollowed = true
|
|
|
} else {
|
|
@@ -779,7 +784,7 @@ var vm = new Vue({
|
|
|
})
|
|
|
},
|
|
|
// 是否认领企业
|
|
|
- claimcheck(arrs, item) {
|
|
|
+ claimcheck: function(arrs, item) {
|
|
|
$.ajax({
|
|
|
url: '/entnicheNew/customer/claimcheck',
|
|
|
method: 'POST',
|
|
@@ -788,13 +793,13 @@ var vm = new Vue({
|
|
|
success: function (res) {
|
|
|
if (res.data.names) {
|
|
|
this.claimcheckName = []
|
|
|
- res.data.names.forEach(s => {
|
|
|
+ res.data.names.forEach(function(s) {
|
|
|
this.claimcheckName.push(s.split(',')[0])
|
|
|
})
|
|
|
}
|
|
|
- arrs.forEach(v => {
|
|
|
+ arrs.forEach(function(v) {
|
|
|
let renName = res.data.names.join(',')
|
|
|
- res.data.names.forEach(s => {
|
|
|
+ res.data.names.forEach(function(s) {
|
|
|
if (renName.indexOf(v.Buyer) > -1) {
|
|
|
v.claim1 = true
|
|
|
if (s.split(',')[0] == v.Buyer) {
|
|
@@ -833,7 +838,7 @@ var vm = new Vue({
|
|
|
})
|
|
|
},
|
|
|
// 关注、认领接口
|
|
|
- attention(item, type, str, per) {
|
|
|
+ attention: function(item, type, str, per) {
|
|
|
let obj = {}, _this = this
|
|
|
if (type == 0) {
|
|
|
// 商机管理的关注
|
|
@@ -911,7 +916,7 @@ var vm = new Vue({
|
|
|
}.bind(this)
|
|
|
})
|
|
|
},
|
|
|
- arrDefault(array1, array2) {//比较的两个数组
|
|
|
+ arrDefault: function(array1, array2) {//比较的两个数组
|
|
|
var tempArray1 = []
|
|
|
var tempArray2 = []
|
|
|
for(var i=0;i<array2.length;i++){
|
|
@@ -926,7 +931,7 @@ var vm = new Vue({
|
|
|
}
|
|
|
return tempArray2
|
|
|
},
|
|
|
- allGuanren (type) {
|
|
|
+ allGuanren: function (type) {
|
|
|
if (this.selectName.length == 0) {
|
|
|
toastFn('至少选择一项', 1500)
|
|
|
} else {
|
|
@@ -970,7 +975,7 @@ var vm = new Vue({
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- guanAndren(item, type, index) {
|
|
|
+ guanAndren: function(item, type, index) {
|
|
|
if (type == 1) {
|
|
|
if (!item.isReceived) {
|
|
|
// 根据列表高度计算top值
|
|
@@ -996,7 +1001,7 @@ var vm = new Vue({
|
|
|
this.attention(item, type, '')
|
|
|
}
|
|
|
},
|
|
|
- caiIndus(val, index) {
|
|
|
+ caiIndus: function(val, index) {
|
|
|
let arrIndex = this.caiIndex.indexOf(index);
|
|
|
if(arrIndex>-1){
|
|
|
this.caiIndex.splice(arrIndex,1);
|
|
@@ -1018,13 +1023,13 @@ var vm = new Vue({
|
|
|
// this.searchContent = ''
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- quanBu() {
|
|
|
+ quanBu: function() {
|
|
|
this.caiIndex = [];
|
|
|
this.qutive = true;
|
|
|
this.indusList = [];
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- caiIndus1(val, index) {
|
|
|
+ caiIndus1: function(val, index) {
|
|
|
let arrIndex = this.caiIndex1.indexOf(index);
|
|
|
if(arrIndex>-1){
|
|
|
this.caiIndex1.splice(arrIndex,1);
|
|
@@ -1046,16 +1051,16 @@ var vm = new Vue({
|
|
|
// this.searchContent = ''
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- quanBu1() {
|
|
|
+ quanBu1: function() {
|
|
|
this.caiIndex1 = [];
|
|
|
this.qutive1 = true;
|
|
|
this.indusList1 = [];
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- cusMore() {
|
|
|
+ cusMore: function() {
|
|
|
console.log('1212')
|
|
|
},
|
|
|
- qyCustmer() {
|
|
|
+ qyCustmer: function() {
|
|
|
$.ajax({
|
|
|
url: '/entnicheNew/customer/history',
|
|
|
method: 'GET',
|
|
@@ -1066,11 +1071,11 @@ var vm = new Vue({
|
|
|
}.bind(this)
|
|
|
})
|
|
|
},
|
|
|
- qyChange() {
|
|
|
+ qyChange: function() {
|
|
|
// this.searchContent = ''
|
|
|
this.doSearch()
|
|
|
},
|
|
|
- jobRange() {
|
|
|
+ jobRange: function() {
|
|
|
var decide = window.localStorage.getItem('bus-key-group-SCOPE')
|
|
|
if (decide) {
|
|
|
this.jobData = JSON.parse(decide)
|
|
@@ -1080,8 +1085,8 @@ var vm = new Vue({
|
|
|
method: 'POST',
|
|
|
success: function (res) {
|
|
|
if ($.isArray(res.data.data) && res.error_code == 0) {
|
|
|
- res.data.data.forEach(v => {
|
|
|
- v.a_key.forEach(t => {
|
|
|
+ res.data.data.forEach(function(v) {
|
|
|
+ v.a_key.forEach(function(t) {
|
|
|
this.jobData.push(t)
|
|
|
})
|
|
|
})
|
|
@@ -1090,7 +1095,7 @@ var vm = new Vue({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- keyChange(appendkey, key, notkey) {
|
|
|
+ keyChange: function(appendkey, key, notkey) {
|
|
|
let str = String(appendkey.concat(key).concat(notkey)).replace(/,/g, ' ')
|
|
|
return str
|
|
|
},
|
|
@@ -1121,10 +1126,16 @@ var vm = new Vue({
|
|
|
}
|
|
|
this.filterShow = !this.filterShow
|
|
|
},
|
|
|
- moneyUnit (m, type = 'string', lv = 0) {
|
|
|
+ moneyUnit: function (m, type, lv) {
|
|
|
+ if (!type) {
|
|
|
+ type = 'string'
|
|
|
+ }
|
|
|
+ if (!lv) {
|
|
|
+ lv = 0
|
|
|
+ }
|
|
|
var mUnit = {
|
|
|
levelArr: ['元', '万元', '亿元', '万亿元'],
|
|
|
- test (num, type, lv) {
|
|
|
+ test: function (num, type, lv) {
|
|
|
if (num === 0) {
|
|
|
if (type === 'string') {
|
|
|
return '0元'
|