Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
13bd8395
Commit
13bd8395
authored
Jan 03, 2019
by
xishifeng
Committed by
zw
Jan 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复
parent
0b3dddf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
353 additions
and
109 deletions
+353
-109
customerinfo_details_new.js
public/app/js/customerinfo_details_new.js
+2
-35
customerinfo_details_new_0103.js
public/app/js/customerinfo_details_new_0103.js
+351
-74
No files found.
public/app/js/customerinfo_details_new.js
View file @
13bd8395
...
...
@@ -335,7 +335,7 @@ function loadMain(){
});
if
(
_tempArr
.
length
>
0
){
$
(
'#last_dy_div>ul'
).
html
(
'<li class="{7}"><div class="li-top"><div class="li-top-left"><img src="{0}" onerror="javascript:this.src=
\'
/app/images/ic_default_headpic.png
\'
" /></div><div class="li-top-right"><div class="li-top-right-header"><div>{1}</div><div>{3}</div></div><p>{2}{5}</p>{6}</div></div><div class="first-sec-active"></div></li>'
.
stringFormatObj
({
_htmlTemp
+=
'<li class="{7}"><div class="li-top"><div class="li-top-left"><img src="{0}" onerror="javascript:this.src=
\'
/app/images/ic_default_headpic.png
\'
" /></div><div class="li-top-right"><div class="li-top-right-header"><div>{1}</div><div>{3}</div></div><p>{2}{5}</p>{6}</div></div><div class="first-sec-active"></div></li>'
.
stringFormatObj
({
'0'
:
data
[
'data'
][
'agent_path'
]
+
_tempArr
[
0
][
'img'
],
'1'
:
_tempArr
[
0
][
'name'
],
'2'
:
_tempArr
[
0
][
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
_tempArr
[
0
][
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
...
...
@@ -343,7 +343,7 @@ function loadMain(){
'5'
:
_tempArr
[
0
][
'step'
],
'6'
:
_tempArr
[
0
][
'step_name'
]
==
'follow_up_log'
?
dealSp
(
_tempArr
[
0
]):(
_tempArr
[
0
][
'step_name'
]
==
'report'
?
dealSpYdk
(
_tempArr
[
0
]):
''
),
'7'
:
'li-sp-active-top'
})
)
;
});
};
$
.
each
(
data
[
'data'
][
'user_date'
],
function
(
i
,
item
)
{
...
...
@@ -490,39 +490,6 @@ function loadMain(){
}
});
//获取跟进信息
_userId
&&
$
.
ajax
({
type
:
'get'
,
url
:
'/broker/followUpLog'
,
data
:
{
'AuthToken'
:
_token
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
//获取跟进标签列表信息
_userId
&&
$
.
ajax
({
type
:
'GET'
,
...
...
public/app/js/customerinfo_details_new_
old
.js
→
public/app/js/customerinfo_details_new_
0103
.js
View file @
13bd8395
...
...
@@ -2,6 +2,17 @@ var _doc = $(document),
_token
=
getUrlParam
(
"token"
),
_customerId
=
getUrlParam
(
'customerId'
);
/******
*
report 报备
march_in 进场
follow_up_log 跟进
pay_log 收款
refund 退款
bargain 成交报告
*
*****/
$
(
function
(){
$
(
document
.
body
).
show
();
...
...
@@ -56,7 +67,13 @@ function loadMain(){
_userPhone
=
localStorage
.
getItem
(
'userphone'
),
//当前用户的手机号
_selectPhone
=
''
,
//拨号列表里选择的号码,也是当前用户对应的手机号,可能和_userPhone是一样的
_customerPhone
=
''
,
//当前客户的手机号
_backPhone
=
''
;
//绑定之后返回的号码
_backPhone
=
''
,
//绑定之后返回的号码
_temp_follow_id
=
''
,
//临时的跟进id,在绑定手机号的同时,会产生出来
_user_status
=
''
,
//状态标签上次的值
is_outpace_call_num
=
1
,
//拨打电话0:未超过限制 1:超过限制
_pageSize
=
10
,
_followUpPage
=
1
,
//跟进分页页数
_daikanPage
=
1
;
//带看分页页数
if
(
_userId
){
...
...
@@ -67,7 +84,7 @@ function loadMain(){
//获取客户基本信息
_userId
&&
$
.
ajax
({
type
:
'POST'
,
url
:
'/
broker/useraction_search
'
,
url
:
'/
index/userDetail
'
,
data
:
{
'AuthToken'
:
_token
,
'user_id'
:
Number
(
_customerId
),
//客户id
...
...
@@ -77,7 +94,6 @@ function loadMain(){
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
.
is_collect
==
'1'
){
...
...
@@ -100,20 +116,27 @@ function loadMain(){
$
(
'#price_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'price_demand'
]
+
'元/月'
);
$
(
'#area_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'area_demand'
]
+
'㎡'
);
is_outpace_call_num
=
data
[
'data'
][
'is_outpace_call_num'
];
//拨打电话,0:未超过限制 1:超过限制
$
(
'#kefang'
).
html
(
data
[
'data'
][
'user_info'
][
'agentinfo'
]);
var
_kefang_tel
=
data
[
'data'
][
'user_info'
][
'agentinfo'
].
split
(
'-'
)[
1
];
$
(
'#kefang'
).
html
(
data
[
'data'
][
'user_info'
][
'agent
_
info'
]);
var
_kefang_tel
=
data
[
'data'
][
'user_info'
][
'agent
_
info'
].
split
(
'-'
)[
1
];
if
(
is_mobile
(
_kefang_tel
)
==
1
){
$
(
'#kefang'
).
attr
(
'data-tel'
,
_kefang_tel
).
next
().
css
(
'display'
,
'inline-block'
);
};
$
(
'#yaoqingren'
).
html
(
data
[
'data'
][
'user_info'
][
'referrer_user'
]).
attr
(
'data-tel'
,
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
]);
//邀请人
if
(
data
[
'data'
][
'user_info'
][
'referrer_source'
]
==
10
){
$
(
'#zhuanjieshao'
).
html
(
'是'
);
$
(
'#yaoqingren'
).
html
(
hideTel
(
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
])
+
',客户ID:'
+
data
[
'data'
][
'user_info'
][
'referrer_id'
]).
attr
(
'data-tel'
,
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
]);
//邀请人
}
else
{
$
(
'#zhuanjieshao'
).
html
(
'否'
);
$
(
'#yaoqingren'
).
html
(
data
[
'data'
][
'user_info'
][
'referrer_user'
]).
attr
(
'data-tel'
,
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
]);
//邀请人
}
var
_yaoqingren_tel
=
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
];
if
(
is_mobile
(
_yaoqingren_tel
)
==
1
){
$
(
'#yaoqingren'
).
attr
(
'data-tel'
,
_yaoqingren_tel
).
next
().
css
(
'display'
,
'inline-block'
);
};
$
(
'#isvip'
).
html
(
data
[
'data'
][
'user_info'
][
'vip'
]
?
'是'
:
'否'
);
//是否是vip
$
(
'#isvip'
).
html
(
Number
(
data
[
'data'
][
'user_info'
][
'vip'
])
?
'是'
:
'否'
);
//是否是vip
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
10
){
$
(
'#create_type'
).
html
(
'APP注册'
);
//产生类型
}
else
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
20
){
...
...
@@ -121,13 +144,79 @@ function loadMain(){
};
$
(
'#register_time'
).
html
(
data
[
'data'
][
'user_info'
][
'registration_time'
]);
//注册时间
$
(
'#login_time'
).
html
(
data
[
'data'
][
'user_info'
][
'first_login_time'
]);
//下载登录时间
if
(
data
[
'data'
][
'user_info'
][
'source_intro'
]){
if
(
data
[
'data'
][
'user_info'
][
'source_intro'
]
==
'0'
){
$
(
'#source_intro'
).
parent
().
hide
();
}
else
{
$
(
'#source_intro'
).
html
(
sourceIntro
(
data
[
'data'
][
'user_info'
][
'source_intro'
]));
//客户来源
}
}
else
{
$
(
'#source_intro'
).
parent
().
hide
();
};
$
(
'#add_time'
).
html
(
data
[
'data'
][
'user_info'
][
'create_time'
]);
//创建时间
$
(
'#customer_pic'
).
attr
(
'src'
,
data
[
'data'
][
'user_info'
][
'user_pic'
]);
_customerPhone
=
data
[
'data'
][
'user_info'
][
'user_phone'
];
//当前客户手机号
$
(
'#customer_id'
).
html
(
'客户ID:'
+
_customerId
+
','
);
$
(
'#customer_phone'
).
html
(
hideTel
(
data
[
'data'
][
'user_info'
][
'user_phone'
]));
if
(
data
[
'data'
][
'is_outstrip_twenty_four_hours'
]
==
0
){
//在保护期内
$
(
'#baohuqi_span'
).
show
();
};
//保护期内和是否能拨打没有关系
if
(
data
[
'data'
][
'user_info'
][
'vip'
]
==
1
){
if
(
data
[
'data'
][
'examine_vip'
]
==
0
){
//或者examine_vip为0时,是否可以查看vip客户 0:可查看 1:不可查看
$
(
'.call-btn-main'
).
show
();
}
else
{
if
((
data
[
'data'
][
'user_info'
][
'agent_id'
]
==
_userId
)
||
(
data
[
'data'
][
'is_can_look'
]
==
0
)){
//客方与当前用户一致时
//或者is_can_look为0时,总监,总监是客方的总监
$
(
'.call-btn-main'
).
show
();
}
else
{}
};
}
else
{
//如果不是vip,则按照以前的逻辑走
if
(
data
[
'data'
][
'is_outstrip_twenty_four_hours'
]
==
0
){
//在保护期内
$
(
'#baohuqi_span'
).
show
();
if
(
data
[
'data'
][
'user_info'
][
'agent_id'
]
==
_userId
){
//客方与当前用户一致时
//或者is_can_look为0时,总监,总监是客方的总监
$
(
'.call-btn-main'
).
show
();
}
else
{}
}
else
{
//超过保护期
$
(
'.call-btn-main'
).
show
();
}
}
$
(
'#call_modal_phone_self'
).
val
(
_userPhone
);
//客户来源类型判断
function
sourceIntro
(
m
)
{
var
_m
=
Number
(
m
);
//来源简述 1网络 2客户介绍 3 朋友介绍 4上门挂牌 5打跟进 6驻守 7 其他
if
(
_m
===
1
){
return
'网络'
;
}
else
if
(
_m
===
2
){
return
'客户介绍'
;
}
else
if
(
_m
===
3
){
return
'朋友介绍'
;
}
else
if
(
_m
===
4
){
return
'上门挂牌'
;
}
else
if
(
_m
===
5
){
return
'打跟进'
;
}
else
if
(
_m
===
6
){
return
'驻守'
;
}
else
if
(
_m
===
7
){
return
'其他'
;
}
else
{
return
'other'
;
}
};
function
landlordType
(
m
)
{
var
_m
=
Number
(
m
);
if
(
_m
===
0
){
...
...
@@ -141,11 +230,25 @@ function loadMain(){
}
};
$
(
'#add_city_type_area'
).
html
(
'<span class="flex-center">{0}</span><span class="flex-center">{1}</span>'
.
stringFormatObj
({
'0'
:
data
[
'data'
][
'user_info'
][
'city'
]
+
data
[
'data'
][
'user_info'
][
'disc'
],
'1'
:
landlordType
(
data
[
'data'
][
'user_info'
][
'user_label'
])
$
(
'#add_city_type_area'
).
html
(
'<span class="flex-center site-span">{0}</span><span class="flex-center">{1}</span>{2}'
.
stringFormatObj
({
'0'
:
dealSiteName
(
data
[
'data'
][
'user_info'
][
'site_name'
]),
'1'
:
landlordType
(
data
[
'data'
][
'user_info'
][
'user_label'
]),
'2'
:
(
data
[
'data'
][
'user_info'
][
'vip'
]
==
1
)?
'<span class="flex-center site-span">VIP</span>'
:
''
}));
//处理返回的站点名字
function
dealSiteName
(
arr
){
if
(
arr
){
if
(
Array
.
isArray
(
arr
)){
return
arr
.
join
(
','
);
}
else
{
return
arr
;
}
}
else
{
return
''
;
}
};
if
(
data
[
'data'
][
'user_info'
][
'agent_id'
]
==
_userId
||
localStorage
.
getItem
(
'userlevel'
)
!=
'10'
){
...
...
@@ -170,9 +273,35 @@ function loadMain(){
});
};
//发送消息没有权限控制
$
(
'#return_btn'
).
show
().
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
user_id
=
_customerId
;
var
user_name
=
data
[
'data'
][
'user_info'
][
'user_name'
];
var
user_phone
=
data
[
'data'
][
'user_info'
][
'user_phone'
];
var
user_nick
=
data
[
'data'
][
'user_info'
][
'user_nick'
];
var
user_img
=
data
[
'data'
][
'user_info'
][
'user_pic'
];
Compatible
({
paraIos
:
{
'route'
:
'onSendClick'
,
'userId'
:
Number
(
user_id
),
'userName'
:
String
(
user_name
),
'userPhone'
:
String
(
user_phone
),
'userImg'
:
String
(
user_img
)
},
fnAndroid
:
function
()
{
//window.android.onClientEdit(String(_customerId));
window
.
android
.
onSendClick
(
String
(
user_id
),
String
(
user_name
),
String
(
user_phone
),
String
(
user_img
))
},
fn
:
function
()
{
console
.
warn
(
'error'
);
}
});
});
//动态详情列表
function
dealSp
(
obj
){
console
.
log
(
obj
[
'img_path'
]
+
obj
[
'explain_img'
]);
return
'<p>属于哪类客户:{0}</p><p>第一决策人:{1}</p><p>租商铺做什么:{2}</p><p>对面积的要求:{3}</p><p>对价格的要求:{4}</p><p>所在区域:{5}</p><p>补充说明:{6}</p>{7}'
.
stringFormatObj
({
'0'
:
obj
[
'user_type'
],
'1'
:
obj
[
'decision_maker'
],
...
...
@@ -191,23 +320,76 @@ function loadMain(){
'1'
:
obj
[
'intro'
]
});
};
var
_htmlTemp
=
''
;
if
(
data
[
'data'
][
'user_date'
]
&&
data
[
'data'
][
'user_date'
].
length
>
0
){
$
.
each
(
data
[
'data'
][
'user_date'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li class="{7}"><div class="li-top"><div class="li-top-left"><img src="{0}" onerror="javascript:this.src=
\'
/app/images/ic_default_headpic.png
\'
" /></div><div class="li-top-right"><div class="li-top-right-header"><div>{1}</div><div>{3}</div></div><p>{2}{5}</p>{6}</div></div></li>'
.
stringFormatObj
({
'0'
:
data
[
'data'
][
'agent_path'
]
+
item
[
'img'
],
'1'
:
item
[
'name'
],
'2'
:
item
[
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
item
[
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
'3'
:
(
item
[
'create_time'
]
==
null
?
null
:
item
[
'create_time'
]),
'5'
:
item
[
'step'
],
'6'
:
item
[
'step_name'
]
==
'follow_up_log'
?
dealSp
(
item
):(
item
[
'step_name'
]
==
'report'
?
dealSpYdk
(
item
):
''
),
'7'
:
(
item
[
'step_name'
]
==
'report'
||
item
[
'step_name'
]
==
'march_in'
)?
'li-sp-active'
:
''
});
});
$
(
'.sec-dynamic>ul'
).
html
(
_htmlTemp
);
}
else
{
$
(
'.sec-dynamic>ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
};
function
getFollowUp
(){
//获取跟进信息
_userId
&&
$
.
ajax
({
type
:
'get'
,
url
:
'/index/followUpLog'
,
data
:
{
'AuthToken'
:
_token
,
"user_id"
:
_customerId
,
"page_no"
:
_followUpPage
,
"page_size"
:
_pageSize
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data2
)
{
if
(
typeof
data2
===
'object'
)
{
if
(
data2
.
code
==
200
)
{
var
_htmlTemp
=
''
;
if
(
data2
[
'data'
]
&&
data2
[
'data'
].
length
>
0
){
/**********
*
report 报备
march_in 进场
follow_up_log 跟进
pay_log 收款
refund 退款
bargain 成交报告
*
* **********/
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li class="{7}"><div class="li-top"><div class="li-top-left"><img src="{0}" onerror="javascript:this.src=
\'
/app/images/ic_default_headpic.png
\'
" /></div><div class="li-top-right"><div class="li-top-right-header"><div>{1}</div><div>{3}</div></div><p>{2}{5}</p>{6}</div></div></li>'
.
stringFormatObj
({
'0'
:
data
[
'data'
][
'agent_path'
]
+
item
[
'img'
],
'1'
:
item
[
'name'
],
'2'
:
item
[
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
item
[
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
'3'
:
(
item
[
'create_time'
]
==
null
?
null
:
item
[
'create_time'
]),
'5'
:
item
[
'step'
],
'6'
:
item
[
'step_name'
]
==
'follow_up_log'
?
dealSp
(
item
):(
item
[
'step_name'
]
==
'report'
?
dealSpYdk
(
item
):
''
),
'7'
:
(
item
[
'step_name'
]
==
'report'
||
item
[
'step_name'
]
==
'march_in'
)?
'li-sp-active'
:
''
});
});
$
(
'.sec-dynamic>ul'
).
html
(
_htmlTemp
);
}
else
{
$
(
'.sec-dynamic>ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
};
}
else
{
layerTipsX
(
data2
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
}
getFollowUp
();
//客方修改日志
...
...
@@ -220,9 +402,26 @@ function loadMain(){
'2'
:
item
[
'name'
]
});
});
$
(
'.record-main>ul'
).
html
(
_htmlTemp2
);
$
(
'#modify_kefang_ul'
).
html
(
_htmlTemp2
);
}
else
{
$
(
'#modify_kefang_ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
}
//客方邀请人(介绍人)日志
var
_htmlTemp3
=
''
;
if
(
data
[
'data'
][
'user_invite_history'
].
length
>
0
){
$
.
each
(
data
[
'data'
][
'user_invite_history'
],
function
(
i
,
item
)
{
_htmlTemp3
+=
'<li><div><p>操作时间</p><p>{0}</p></div><div><span class="dot-block"><mark></mark></span><p>{1}</p><p>操作人:{2}{3}</p></div></li>'
.
stringFormatObj
({
'0'
:
item
[
'create_time'
]?
item
[
'create_time'
].
split
(
' '
)[
0
]:
item
[
'create_time'
],
'1'
:
item
[
'remark'
],
'2'
:
item
[
'name'
],
//'3': (item['referrer_source'] == 10)?('<span>客户ID:'+item['referrer_id']+'</span>'):''
'3'
:
''
});
});
$
(
'#modify_jieshaoren_ul'
).
html
(
_htmlTemp3
);
}
else
{
$
(
'
.record-main>
ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
$
(
'
#modify_jieshaoren_
ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
}
//点击收藏按钮触发的事件
...
...
@@ -296,11 +495,12 @@ function loadMain(){
});
//标签没有默认状态了
// if(data['data']['user_info']['user_status'] == 0 || data['data']['user_info']['user_status'] == 1 || data['data']['user_info']['user_status'] == -1 ){
// _markAreaObj.find('a[data-markid="'+data['data']['user_info']['user_status']+'"]').addClass('genjin-mark-active').siblings().removeClass('genjin-mark-active');
// }else{
// layerTipsX('状态标签返回有误');
// }
var
_data_user_status
=
data
[
'data'
][
'user_info'
][
'user_status'
];
if
(
_data_user_status
==
0
||
_data_user_status
==
1
||
_data_user_status
==
-
1
){
_user_status
=
_data_user_status
;
}
else
{
layerTipsX
(
'状态标签返回有误'
);
}
}
else
{
layerTipsX
(
data
[
'msg'
]);
...
...
@@ -310,7 +510,6 @@ function loadMain(){
};
},
error
:
function
()
{
console
.
log
(
'aa'
);
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
...
...
@@ -320,6 +519,10 @@ function loadMain(){
}
});
//获取跟进标签列表信息
_userId
&&
$
.
ajax
({
type
:
'GET'
,
...
...
@@ -391,24 +594,27 @@ function loadMain(){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
// if((_this.attr('data-markid') == '1') || (_this.attr('data-markid') == '4')){
// //如果选择了未打通,或取消拨打,则直接关闭
// if(_this.parent().parent().index() === 0){
// //只有在.genjin-mark-area-putong,电话跟进特有,下的标签才会隐藏
// _genjinModal.hide();//跟进模态框关闭
// return false;
// }
// };
if
(
!
_this
.
hasClass
(
'genjin-mark-active'
)){
_this
.
addClass
(
'genjin-mark-active'
).
siblings
().
removeClass
(
'genjin-mark-active'
);
};
if
(
_this
.
attr
(
'data-markid'
)
==
'1'
){
//如果选择了未打通,则直接关闭
if
(
_this
.
parent
().
parent
().
index
()
===
0
){
//只有在.genjin-mark-area-putong,电话跟进特有,下的标签才会隐藏
genjinSave
(
'sp1'
);
return
false
;
}
};
});
//跟进的提交按钮点击事件
_btnSave
.
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
genjinSave
();
});
function
genjinSave
(
type
){
var
_genjinMarkOBj
=
$
(
'.genjin-mark-area-zhuangtai .genjin-mark-active'
),
_genjinMarkOBj2
=
$
(
'.genjin-mark-area-putong .genjin-mark-active'
),
_beizhuObjVal
=
$
.
trim
(
_beizhuObj
.
val
()),
...
...
@@ -424,20 +630,14 @@ function loadMain(){
// return false;
// };
// if((_genjinMarkOBj2.attr('data-markid') == '1') || (_genjinMarkOBj2.attr('data-markid') == '4')){
//
// }else{
// if(_genjinMarkOBj.length == 0){
// layerTipsX('请选择状态跟进标签');
// return false;
// };
// };
if
(
_genjinMarkOBj
.
length
==
0
){
layerTipsX
(
'请选择状态跟进标签'
);
return
false
;
if
((
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'1'
)
||
(
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'4'
)){
}
else
{
if
(
_genjinMarkOBj
.
length
==
0
){
layerTipsX
(
'请选择状态跟进标签'
);
return
false
;
};
};
var
_data
=
{
'AuthToken'
:
_token
,
'content'
:
_beizhuObjVal
,
...
...
@@ -445,6 +645,17 @@ function loadMain(){
'agent_id'
:
_userId
,
'user_status'
:
_genjinMarkOBj
.
attr
(
'data-markid'
)
};
if
(
type
===
'sp1'
){
if
(
_beizhuObjVal
){
}
else
{
_data
[
'content'
]
=
'未打通'
;
};
if
(
_genjinMarkOBj
.
length
==
0
){
_data
[
'user_status'
]
=
_user_status
;
};
};
if
(
isCallFlag
){
//电话跟进
if
(
_genjinMarkOBj2
.
length
==
0
){
...
...
@@ -453,6 +664,7 @@ function loadMain(){
}
else
{
_data
[
'labels_id'
]
=
_genjinMarkOBj2
.
attr
(
'data-markid'
);
_data
[
'type'
]
=
0
;
_data
[
'follow_id'
]
=
_temp_follow_id
;
//跟进id
(
_genjinMarkOBj2
.
attr
(
'data-free'
)
==
0
)
&&
(
_isFreeFlag
=
false
);
}
}
else
{
...
...
@@ -485,6 +697,7 @@ function loadMain(){
layer
.
open
({
content
:
'提交成功'
,
btn
:
[
'确定'
],
shadeClose
:
false
,
yes
:
function
(
_index
){
location
.
reload
();
...
...
@@ -493,25 +706,36 @@ function loadMain(){
});
};
}
else
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
layerTipsX
(
data
[
'msg'
]);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
};
}
else
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
layerTipsX
(
'数据错误'
);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
};
},
error
:
function
()
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
//不能卸载complete里,因为还有解绑事件,要在解绑完成时再做处理
layerTipsX
(
'error'
);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
//不能卸载complete里,因为还有解绑事件,要在解绑完成时再做处理
},
complete
:
function
(
xhr
,
textStatus
){
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
});
}
function
freePhone
(
obj
){
$
.
ajax
({
...
...
@@ -521,7 +745,8 @@ function loadMain(){
'AuthToken'
:
_token
,
'phone_x'
:
_backPhone
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
'user_id'
:
_customerId
//'phone_b': _customerPhone
},
timeout
:
30000
,
dataType
:
'json'
,
...
...
@@ -532,6 +757,7 @@ function loadMain(){
console
.
log
(
'释放成功'
);
layer
.
open
({
content
:
'提交成功'
,
shadeClose
:
false
,
btn
:
[
'确定'
],
yes
:
function
(
_index
){
...
...
@@ -550,6 +776,8 @@ function loadMain(){
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
...
...
@@ -573,7 +801,7 @@ function loadMain(){
if
(
data
.
code
==
200
)
{
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<li class="{0}"><input placeholder="请输入本机手机号" maxlength="11" type="tel" value="{1}" {2} /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div></li>'
.
stringFormatObj
({
_htmlTemp
+=
'<li class="{0}"><input placeholder="请输入本机手机号" maxlength="11" type="tel" value="{1}" {2} /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div><
div class="call-delete-icon"><img src="/app/images/search_gb.png" /></div><
/li>'
.
stringFormatObj
({
'0'
:
''
,
'1'
:
item
[
'phone'
],
'2'
:
'readonly'
,
...
...
@@ -608,10 +836,14 @@ function loadMain(){
});
//点击头部区域拨打电话出现弹窗部分
$
(
'#call_list_open_btn'
).
click
(
function
(
e
){
$
(
'#call_list_open_btn
>.call-btn-main
'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
_callModal
.
show
();
if
(
is_outpace_call_num
==
'0'
){
_callModal
.
show
();
}
else
{
layerTipsX
(
'该客户今日已达拨打上限,请明日再来'
);
};
});
$
(
'.call-btn-other'
).
click
(
function
(
e
){
...
...
@@ -619,7 +851,6 @@ function loadMain(){
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_tel
=
_this
.
prev
().
attr
(
'data-tel'
);
console
.
log
(
_tel
);
if
(
is_mobile
(
_tel
)
==
1
){
Compatible
({
paraIos
:
{
...
...
@@ -641,6 +872,7 @@ function loadMain(){
});
};
});
//拨打电话,选中手机号事件
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -651,6 +883,49 @@ function loadMain(){
};
};
});
//删除手机号按钮,点击事件
_doc
.
on
(
'click'
,
'.call-delete-icon'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
layer
.
open
({
content
:
'确认删除此号码吗?'
,
btn
:
[
'确定'
,
'取消'
],
yes
:
function
(
_index
){
var
_phoneTemp
=
_this
.
parent
().
find
(
'input'
).
val
();
_this
.
parent
().
remove
();
console
.
log
(
_phoneTemp
);
$
.
ajax
({
type
:
'POST'
,
url
:
ServerHostTempC
+
'/broker/agentsPhone'
,
data
:
{
'AuthToken'
:
_token
,
'agents_id'
:
_userId
,
'phone'
:
_phoneTemp
,
'type'
:
'delete'
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
layer
.
close
(
_index
);
}
});
});
//添加手机号,出现输入框事件
_addPhoneBtn
.
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -659,10 +934,11 @@ function loadMain(){
return
false
;
}
else
{
_addPhoneBtn
.
hide
();
_addPhoneListObj
.
append
(
'<li class="call-add"><input placeholder="请输入本机手机号" maxlength="11" type="tel" /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div></li>'
).
find
(
'.call-add>input'
).
focus
();
_addPhoneListObj
.
append
(
'<li class="call-add"><input placeholder="请输入本机手机号" maxlength="11" type="tel" /><div class="call-edit-icon">完成</div><div class="call-submit-ing-icon">提交中ing</div><div class="call-select-icon"><img src="/app/images/ic_duigou_gre.png" /></div><
div class="call-delete-icon"><img src="/app/images/search_gb.png" /></div><
/li>'
).
find
(
'.call-add>input'
).
focus
();
};
});
//添加手机号调用接口事件
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li>.call-edit-icon'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -732,7 +1008,8 @@ function loadMain(){
data
:
{
'AuthToken'
:
_token
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
'user_id'
:
_customerId
//'phone_b': _customerPhone
},
timeout
:
30000
,
dataType
:
'json'
,
...
...
@@ -745,14 +1022,15 @@ function loadMain(){
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
_backPhone
=
data
[
'data'
][
'phone'
];
console
.
log
(
_backPhone
);
_temp_follow_id
=
data
[
'data'
][
'follow_id'
];
//临时的跟进id
Compatible
({
paraIos
:
{
'route'
:
'call'
,
'phone'
:
_backPhone
'phone'
:
_backPhone
,
'userId'
:
Number
(
_customerId
)
},
fnAndroid
:
function
()
{
window
.
android
.
onPhoneCall
(
_backPhone
);
window
.
android
.
onPhoneCall
(
_backPhone
,
Number
(
_customerId
)
);
},
fn
:
function
()
{
console
.
warn
(
'error'
);
...
...
@@ -788,4 +1066,4 @@ function loadMain(){
});
};
});
};
\ No newline at end of file
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment