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