|
@@ -26,6 +26,9 @@
|
|
|
<div class="j-container">
|
|
|
{{include "/big-member/header.html"}}
|
|
|
<!--S-Vue-->
|
|
|
+ <div id="jyKeepEntComponent">
|
|
|
+ <keep-ent-component ref="vKeepComponent" @on-save-tag="onSaveTag" :bid="nowOpenBid" :first="false"></keep-ent-component>
|
|
|
+ </div>
|
|
|
<div class="j-main prodetail" id="v-pro" v-cloak>
|
|
|
<div class="prodetailTop">
|
|
|
<div class="prodetail_title">
|
|
@@ -147,7 +150,7 @@
|
|
|
</div>
|
|
|
<span class="columnLine"></span>
|
|
|
<div class="claim" @click="claimBtn($event, this)">
|
|
|
- <span class="j-icon icon-add-claim"></span>
|
|
|
+ <span class="j-icon icon-claim"></span>
|
|
|
<span class="icon-claim-text" style="color:#2ABED1;font-size: .26rem;">认领客户</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -218,6 +221,7 @@
|
|
|
<script src=//cdn-common.jianyu360.com/cdn/lib/vue/2.6.11/vue.min.js></script>
|
|
|
<script src=//cdn-common.jianyu360.com/cdn/lib/vant/2.12.24/lib/vant.min.js></script>
|
|
|
<script src=//cdn-common.jianyu360.com/cdn/lib/zepto/1.2.0/zepto.min.js></script>
|
|
|
+<script src='/common-module/keep-tags/keep-ent-tags-template.js?v={{Msg "seo" "version"}}'></script>
|
|
|
{{include "/big-member/commonjs.html"}}
|
|
|
<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "version"}}'></script>
|
|
|
|
|
@@ -275,6 +279,28 @@
|
|
|
}
|
|
|
}
|
|
|
var localEmail = {{.T.email}} || sessionStorage.getItem('reportEmail') || ''
|
|
|
+ // 商机管理-认领客户
|
|
|
+ var vKeepEntComponent = new Vue({
|
|
|
+ delimiters: ['${', '}'],
|
|
|
+ el: '#jyKeepEntComponent',
|
|
|
+ data: {
|
|
|
+ nowOpenBid: ''
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ changeBid (id, type) {
|
|
|
+ this.nowOpenBid = id
|
|
|
+ this.$refs.vKeepComponent.ajaxAddKeep(id, type)
|
|
|
+ },
|
|
|
+ onSaveTag (data) {
|
|
|
+ var getclient = sessionStorage.getItem('setClientInfo')
|
|
|
+ if(getclient) {
|
|
|
+ getclient = JSON.parse(getclient)
|
|
|
+ getclient.label = data
|
|
|
+ vm.setClaimState(getclient)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
var vNode = {
|
|
|
delimiters: ['${', '}'],
|
|
|
el: '#v-pro',
|
|
@@ -367,54 +393,68 @@
|
|
|
success: function(res) {
|
|
|
console.log(res)
|
|
|
if(res.data.iscoll) {
|
|
|
- if(res.data.names.length > 0) {
|
|
|
- $('.icon-claim-text').text('已认领')
|
|
|
- } else {
|
|
|
- $('.icon-claim-text').text('认领')
|
|
|
- }
|
|
|
+ _this.changeClaimState(res.data.names.length > 0)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 认领
|
|
|
claimBtn: function(e, that) {
|
|
|
- e.stopPropagation()
|
|
|
- let claim = $('.icon-claim-text').text()
|
|
|
- if(claim == '已认领') {
|
|
|
- this.$toast('不支持在该页面进行退回')
|
|
|
- return
|
|
|
- }
|
|
|
- let _this = this
|
|
|
- let params = {
|
|
|
- "name": this.$data.prolist.buyer, //采购单位名称
|
|
|
- "province": this.$data.prolist.area, //省份
|
|
|
- "city": this.$data.prolist.city, //区域
|
|
|
- "mold": 1, //1 认领;默认 0关注
|
|
|
- "D": false, //true 取关;默认 false 关注
|
|
|
- }
|
|
|
- $.ajax({
|
|
|
- type: 'POST',
|
|
|
- url: '/entnicheNew/customer/attention',
|
|
|
- contentType: 'application/json',
|
|
|
- data: JSON.stringify(params),
|
|
|
- success: function(res) {
|
|
|
- console.log(res)
|
|
|
- if(res.error_code == 0) {
|
|
|
- if(res.data) {
|
|
|
- if(params.mold == 0) {
|
|
|
- _this.follow = !_this.follow
|
|
|
- } else {
|
|
|
- _this.$toast('认领成功')
|
|
|
- $('.icon-claim-text').text('已认领')
|
|
|
- }
|
|
|
- } else {
|
|
|
- _this.$toast(res.error_msg)
|
|
|
- }
|
|
|
- // this.getActionState(utils.getParam('entName'), 'g')
|
|
|
- // this.getActionState(utils.getParam('entName'), 'r')
|
|
|
- }
|
|
|
+ e.stopPropagation()
|
|
|
+ let claim = $('.icon-claim-text').text()
|
|
|
+ var claimState = claim === '已认领'
|
|
|
+ // if(claim == '已认领') {
|
|
|
+ // return this.$toast('不支持在该页面进行退回')
|
|
|
+ // }
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ "name": this.$data.prolist.buyer, //采购单位名称
|
|
|
+ "province": this.$data.prolist.area, //省份
|
|
|
+ "city": this.$data.prolist.city, //区域
|
|
|
+ "mold": 1, //1 认领;默认 0关注
|
|
|
+ "D": claimState, //true 取关;默认 false 关注
|
|
|
}
|
|
|
- })
|
|
|
+ sessionStorage.setItem('setClientInfo', JSON.stringify(params))
|
|
|
+
|
|
|
+ if (!claimState) {
|
|
|
+ vKeepEntComponent.changeBid(params.name, !claimState)
|
|
|
+ } else {
|
|
|
+ // 取消认领
|
|
|
+ this.setClaimState(params)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setClaimState: function (params) {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: '/entnicheNew/customer/attention',
|
|
|
+ contentType: 'application/json',
|
|
|
+ data: JSON.stringify(params),
|
|
|
+ success: function(res) {
|
|
|
+ if(res.error_code == 0) {
|
|
|
+ if(res.data) {
|
|
|
+ if (params.D) {
|
|
|
+ _this.$toast('取消认领成功')
|
|
|
+ } else {
|
|
|
+ _this.$toast('认领成功')
|
|
|
+ }
|
|
|
+ _this.changeClaimState(!params.D)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.$toast(res.error_msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeClaimState: function (f) {
|
|
|
+ if (f) {
|
|
|
+ $('.icon-claim-text').text('已认领')
|
|
|
+ $('.claim .j-icon').removeClass('icon-claim').addClass('icon-add-claim')
|
|
|
+ } else {
|
|
|
+ $('.icon-claim-text').text('认领客户')
|
|
|
+ $('.claim .j-icon').removeClass('icon-add-claim').addClass('icon-claim')
|
|
|
+ }
|
|
|
},
|
|
|
// 获取项目详情
|
|
|
getProDetail: function () {
|
|
@@ -844,7 +884,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- var tt = new Vue(vNode)
|
|
|
+ var vm = new Vue(vNode)
|
|
|
</script>
|
|
|
|
|
|
</body>
|