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
dcfb02f3
Commit
dcfb02f3
authored
Jan 03, 2019
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复
parent
9e2fa8ca
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 @
dcfb02f3
...
@@ -335,7 +335,7 @@ function loadMain(){
...
@@ -335,7 +335,7 @@ function loadMain(){
});
});
if
(
_tempArr
.
length
>
0
){
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'
],
'0'
:
data
[
'data'
][
'agent_path'
]
+
_tempArr
[
0
][
'img'
],
'1'
:
_tempArr
[
0
][
'name'
],
'1'
:
_tempArr
[
0
][
'name'
],
'2'
:
_tempArr
[
0
][
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
_tempArr
[
0
][
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
'2'
:
_tempArr
[
0
][
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
_tempArr
[
0
][
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
...
@@ -343,7 +343,7 @@ function loadMain(){
...
@@ -343,7 +343,7 @@ function loadMain(){
'5'
:
_tempArr
[
0
][
'step'
],
'5'
:
_tempArr
[
0
][
'step'
],
'6'
:
_tempArr
[
0
][
'step_name'
]
==
'follow_up_log'
?
dealSp
(
_tempArr
[
0
]):(
_tempArr
[
0
][
'step_name'
]
==
'report'
?
dealSpYdk
(
_tempArr
[
0
]):
''
),
'6'
:
_tempArr
[
0
][
'step_name'
]
==
'follow_up_log'
?
dealSp
(
_tempArr
[
0
]):(
_tempArr
[
0
][
'step_name'
]
==
'report'
?
dealSpYdk
(
_tempArr
[
0
]):
''
),
'7'
:
'li-sp-active-top'
'7'
:
'li-sp-active-top'
})
)
;
});
};
};
$
.
each
(
data
[
'data'
][
'user_date'
],
function
(
i
,
item
)
{
$
.
each
(
data
[
'data'
][
'user_date'
],
function
(
i
,
item
)
{
...
@@ -490,39 +490,6 @@ function loadMain(){
...
@@ -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
({
_userId
&&
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
...
...
public/app/js/customerinfo_details_new_
old
.js
→
public/app/js/customerinfo_details_new_
0103
.js
View file @
dcfb02f3
...
@@ -2,6 +2,17 @@ var _doc = $(document),
...
@@ -2,6 +2,17 @@ var _doc = $(document),
_token
=
getUrlParam
(
"token"
),
_token
=
getUrlParam
(
"token"
),
_customerId
=
getUrlParam
(
'customerId'
);
_customerId
=
getUrlParam
(
'customerId'
);
/******
*
report 报备
march_in 进场
follow_up_log 跟进
pay_log 收款
refund 退款
bargain 成交报告
*
*****/
$
(
function
(){
$
(
function
(){
$
(
document
.
body
).
show
();
$
(
document
.
body
).
show
();
...
@@ -56,7 +67,13 @@ function loadMain(){
...
@@ -56,7 +67,13 @@ function loadMain(){
_userPhone
=
localStorage
.
getItem
(
'userphone'
),
//当前用户的手机号
_userPhone
=
localStorage
.
getItem
(
'userphone'
),
//当前用户的手机号
_selectPhone
=
''
,
//拨号列表里选择的号码,也是当前用户对应的手机号,可能和_userPhone是一样的
_selectPhone
=
''
,
//拨号列表里选择的号码,也是当前用户对应的手机号,可能和_userPhone是一样的
_customerPhone
=
''
,
//当前客户的手机号
_customerPhone
=
''
,
//当前客户的手机号
_backPhone
=
''
;
//绑定之后返回的号码
_backPhone
=
''
,
//绑定之后返回的号码
_temp_follow_id
=
''
,
//临时的跟进id,在绑定手机号的同时,会产生出来
_user_status
=
''
,
//状态标签上次的值
is_outpace_call_num
=
1
,
//拨打电话0:未超过限制 1:超过限制
_pageSize
=
10
,
_followUpPage
=
1
,
//跟进分页页数
_daikanPage
=
1
;
//带看分页页数
if
(
_userId
){
if
(
_userId
){
...
@@ -67,7 +84,7 @@ function loadMain(){
...
@@ -67,7 +84,7 @@ function loadMain(){
//获取客户基本信息
//获取客户基本信息
_userId
&&
$
.
ajax
({
_userId
&&
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
'/
broker/useraction_search
'
,
url
:
'/
index/userDetail
'
,
data
:
{
data
:
{
'AuthToken'
:
_token
,
'AuthToken'
:
_token
,
'user_id'
:
Number
(
_customerId
),
//客户id
'user_id'
:
Number
(
_customerId
),
//客户id
...
@@ -77,7 +94,6 @@ function loadMain(){
...
@@ -77,7 +94,6 @@ function loadMain(){
dataType
:
'json'
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
typeof
data
===
'object'
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
.
is_collect
==
'1'
){
if
(
data
.
data
.
is_collect
==
'1'
){
...
@@ -100,20 +116,27 @@ function loadMain(){
...
@@ -100,20 +116,27 @@ function loadMain(){
$
(
'#price_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'price_demand'
]
+
'元/月'
);
$
(
'#price_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'price_demand'
]
+
'元/月'
);
$
(
'#area_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'area_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'
]);
$
(
'#kefang'
).
html
(
data
[
'data'
][
'user_info'
][
'agent
_
info'
]);
var
_kefang_tel
=
data
[
'data'
][
'user_info'
][
'agentinfo'
].
split
(
'-'
)[
1
];
var
_kefang_tel
=
data
[
'data'
][
'user_info'
][
'agent
_
info'
].
split
(
'-'
)[
1
];
if
(
is_mobile
(
_kefang_tel
)
==
1
){
if
(
is_mobile
(
_kefang_tel
)
==
1
){
$
(
'#kefang'
).
attr
(
'data-tel'
,
_kefang_tel
).
next
().
css
(
'display'
,
'inline-block'
);
$
(
'#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
];
var
_yaoqingren_tel
=
data
[
'data'
][
'user_info'
][
'referrer_user'
].
split
(
'-'
)[
1
];
if
(
is_mobile
(
_yaoqingren_tel
)
==
1
){
if
(
is_mobile
(
_yaoqingren_tel
)
==
1
){
$
(
'#yaoqingren'
).
attr
(
'data-tel'
,
_yaoqingren_tel
).
next
().
css
(
'display'
,
'inline-block'
);
$
(
'#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
){
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
10
){
$
(
'#create_type'
).
html
(
'APP注册'
);
//产生类型
$
(
'#create_type'
).
html
(
'APP注册'
);
//产生类型
}
else
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
20
){
}
else
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
20
){
...
@@ -121,13 +144,79 @@ function loadMain(){
...
@@ -121,13 +144,79 @@ function loadMain(){
};
};
$
(
'#register_time'
).
html
(
data
[
'data'
][
'user_info'
][
'registration_time'
]);
//注册时间
$
(
'#register_time'
).
html
(
data
[
'data'
][
'user_info'
][
'registration_time'
]);
//注册时间
$
(
'#login_time'
).
html
(
data
[
'data'
][
'user_info'
][
'first_login_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'
]);
//创建时间
$
(
'#add_time'
).
html
(
data
[
'data'
][
'user_info'
][
'create_time'
]);
//创建时间
$
(
'#customer_pic'
).
attr
(
'src'
,
data
[
'data'
][
'user_info'
][
'user_pic'
]);
$
(
'#customer_pic'
).
attr
(
'src'
,
data
[
'data'
][
'user_info'
][
'user_pic'
]);
_customerPhone
=
data
[
'data'
][
'user_info'
][
'user_phone'
];
//当前客户手机号
_customerPhone
=
data
[
'data'
][
'user_info'
][
'user_phone'
];
//当前客户手机号
$
(
'#customer_id'
).
html
(
'客户ID:'
+
_customerId
+
','
);
$
(
'#customer_id'
).
html
(
'客户ID:'
+
_customerId
+
','
);
$
(
'#customer_phone'
).
html
(
hideTel
(
data
[
'data'
][
'user_info'
][
'user_phone'
]));
$
(
'#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
);
$
(
'#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
)
{
function
landlordType
(
m
)
{
var
_m
=
Number
(
m
);
var
_m
=
Number
(
m
);
if
(
_m
===
0
){
if
(
_m
===
0
){
...
@@ -141,11 +230,25 @@ function loadMain(){
...
@@ -141,11 +230,25 @@ function loadMain(){
}
}
};
};
$
(
'#add_city_type_area'
).
html
(
'<span class="flex-center">{0}</span><span class="flex-center">{1}</span>'
.
stringFormatObj
({
$
(
'#add_city_type_area'
).
html
(
'<span class="flex-center site-span">{0}</span><span class="flex-center">{1}</span>{2}'
.
stringFormatObj
({
'0'
:
data
[
'data'
][
'user_info'
][
'city'
]
+
data
[
'data'
][
'user_info'
][
'disc'
],
'0'
:
dealSiteName
(
data
[
'data'
][
'user_info'
][
'site_name'
]),
'1'
:
landlordType
(
data
[
'data'
][
'user_info'
][
'user_label'
])
'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'
){
if
(
data
[
'data'
][
'user_info'
][
'agent_id'
]
==
_userId
||
localStorage
.
getItem
(
'userlevel'
)
!=
'10'
){
...
@@ -170,9 +273,35 @@ function loadMain(){
...
@@ -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
){
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
({
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'
],
'0'
:
obj
[
'user_type'
],
'1'
:
obj
[
'decision_maker'
],
'1'
:
obj
[
'decision_maker'
],
...
@@ -191,23 +320,76 @@ function loadMain(){
...
@@ -191,23 +320,76 @@ function loadMain(){
'1'
:
obj
[
'intro'
]
'1'
:
obj
[
'intro'
]
});
});
};
};
var
_htmlTemp
=
''
;
if
(
data
[
'data'
][
'user_date'
]
&&
data
[
'data'
][
'user_date'
].
length
>
0
){
$
.
each
(
data
[
'data'
][
'user_date'
],
function
(
i
,
item
)
{
function
getFollowUp
(){
_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'
],
_userId
&&
$
.
ajax
({
'1'
:
item
[
'name'
],
type
:
'get'
,
'2'
:
item
[
'step_name'
]
==
'phone_fllow_up'
?
'电话跟进:'
:(
item
[
'step_name'
]
==
'fllow_up'
?
'跟进:'
:
''
),
url
:
'/index/followUpLog'
,
'3'
:
(
item
[
'create_time'
]
==
null
?
null
:
item
[
'create_time'
]),
data
:
{
'5'
:
item
[
'step'
],
'AuthToken'
:
_token
,
'6'
:
item
[
'step_name'
]
==
'follow_up_log'
?
dealSp
(
item
):(
item
[
'step_name'
]
==
'report'
?
dealSpYdk
(
item
):
''
),
"user_id"
:
_customerId
,
'7'
:
(
item
[
'step_name'
]
==
'report'
||
item
[
'step_name'
]
==
'march_in'
)?
'li-sp-active'
:
''
"page_no"
:
_followUpPage
,
});
"page_size"
:
_pageSize
});
},
$
(
'.sec-dynamic>ul'
).
html
(
_htmlTemp
);
timeout
:
30000
,
}
else
{
dataType
:
'json'
,
$
(
'.sec-dynamic>ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
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(){
...
@@ -220,9 +402,26 @@ function loadMain(){
'2'
:
item
[
'name'
]
'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
{
}
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(){
...
@@ -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 ){
var
_data_user_status
=
data
[
'data'
][
'user_info'
][
'user_status'
];
// _markAreaObj.find('a[data-markid="'+data['data']['user_info']['user_status']+'"]').addClass('genjin-mark-active').siblings().removeClass('genjin-mark-active');
if
(
_data_user_status
==
0
||
_data_user_status
==
1
||
_data_user_status
==
-
1
){
// }else{
_user_status
=
_data_user_status
;
// layerTipsX('状态标签返回有误');
}
else
{
// }
layerTipsX
(
'状态标签返回有误'
);
}
}
else
{
}
else
{
layerTipsX
(
data
[
'msg'
]);
layerTipsX
(
data
[
'msg'
]);
...
@@ -310,7 +510,6 @@ function loadMain(){
...
@@ -310,7 +510,6 @@ function loadMain(){
};
};
},
},
error
:
function
()
{
error
:
function
()
{
console
.
log
(
'aa'
);
layerTipsX
(
'error'
);
layerTipsX
(
'error'
);
},
},
complete
:
function
(
xhr
,
textStatus
){
complete
:
function
(
xhr
,
textStatus
){
...
@@ -320,6 +519,10 @@ function loadMain(){
...
@@ -320,6 +519,10 @@ function loadMain(){
}
}
});
});
//获取跟进标签列表信息
//获取跟进标签列表信息
_userId
&&
$
.
ajax
({
_userId
&&
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
...
@@ -391,24 +594,27 @@ function loadMain(){
...
@@ -391,24 +594,27 @@ function loadMain(){
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
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'
)){
if
(
!
_this
.
hasClass
(
'genjin-mark-active'
)){
_this
.
addClass
(
'genjin-mark-active'
).
siblings
().
removeClass
(
'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
){
_btnSave
.
click
(
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
genjinSave
();
});
function
genjinSave
(
type
){
var
_genjinMarkOBj
=
$
(
'.genjin-mark-area-zhuangtai .genjin-mark-active'
),
var
_genjinMarkOBj
=
$
(
'.genjin-mark-area-zhuangtai .genjin-mark-active'
),
_genjinMarkOBj2
=
$
(
'.genjin-mark-area-putong .genjin-mark-active'
),
_genjinMarkOBj2
=
$
(
'.genjin-mark-area-putong .genjin-mark-active'
),
_beizhuObjVal
=
$
.
trim
(
_beizhuObj
.
val
()),
_beizhuObjVal
=
$
.
trim
(
_beizhuObj
.
val
()),
...
@@ -424,20 +630,14 @@ function loadMain(){
...
@@ -424,20 +630,14 @@ function loadMain(){
// return false;
// return false;
// };
// };
// if((_genjinMarkOBj2.attr('data-markid') == '1') || (_genjinMarkOBj2.attr('data-markid') == '4')){
if
((
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'1'
)
||
(
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'4'
)){
//
// }else{
}
else
{
// if(_genjinMarkOBj.length == 0){
if
(
_genjinMarkOBj
.
length
==
0
){
// layerTipsX('请选择状态跟进标签');
layerTipsX
(
'请选择状态跟进标签'
);
// return false;
return
false
;
// };
};
// };
if
(
_genjinMarkOBj
.
length
==
0
){
layerTipsX
(
'请选择状态跟进标签'
);
return
false
;
};
};
var
_data
=
{
var
_data
=
{
'AuthToken'
:
_token
,
'AuthToken'
:
_token
,
'content'
:
_beizhuObjVal
,
'content'
:
_beizhuObjVal
,
...
@@ -445,6 +645,17 @@ function loadMain(){
...
@@ -445,6 +645,17 @@ function loadMain(){
'agent_id'
:
_userId
,
'agent_id'
:
_userId
,
'user_status'
:
_genjinMarkOBj
.
attr
(
'data-markid'
)
'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
(
isCallFlag
){
//电话跟进
//电话跟进
if
(
_genjinMarkOBj2
.
length
==
0
){
if
(
_genjinMarkOBj2
.
length
==
0
){
...
@@ -453,6 +664,7 @@ function loadMain(){
...
@@ -453,6 +664,7 @@ function loadMain(){
}
else
{
}
else
{
_data
[
'labels_id'
]
=
_genjinMarkOBj2
.
attr
(
'data-markid'
);
_data
[
'labels_id'
]
=
_genjinMarkOBj2
.
attr
(
'data-markid'
);
_data
[
'type'
]
=
0
;
_data
[
'type'
]
=
0
;
_data
[
'follow_id'
]
=
_temp_follow_id
;
//跟进id
(
_genjinMarkOBj2
.
attr
(
'data-free'
)
==
0
)
&&
(
_isFreeFlag
=
false
);
(
_genjinMarkOBj2
.
attr
(
'data-free'
)
==
0
)
&&
(
_isFreeFlag
=
false
);
}
}
}
else
{
}
else
{
...
@@ -485,6 +697,7 @@ function loadMain(){
...
@@ -485,6 +697,7 @@ function loadMain(){
layer
.
open
({
layer
.
open
({
content
:
'提交成功'
,
content
:
'提交成功'
,
btn
:
[
'确定'
],
btn
:
[
'确定'
],
shadeClose
:
false
,
yes
:
function
(
_index
){
yes
:
function
(
_index
){
location
.
reload
();
location
.
reload
();
...
@@ -493,25 +706,36 @@ function loadMain(){
...
@@ -493,25 +706,36 @@ function loadMain(){
});
});
};
};
}
else
{
}
else
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
layerTipsX
(
data
[
'msg'
]);
layerTipsX
(
data
[
'msg'
]);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
};
};
}
else
{
}
else
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
layerTipsX
(
'数据错误'
);
layerTipsX
(
'数据错误'
);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
};
};
},
},
error
:
function
()
{
error
:
function
()
{
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
//不能卸载complete里,因为还有解绑事件,要在解绑完成时再做处理
layerTipsX
(
'error'
);
layerTipsX
(
'error'
);
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
//不能卸载complete里,因为还有解绑事件,要在解绑完成时再做处理
},
},
complete
:
function
(
xhr
,
textStatus
){
complete
:
function
(
xhr
,
textStatus
){
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
if
(
textStatus
===
'timeout'
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
layerTipsX
(
'请求超时'
);
};
};
}
}
});
});
}
});
function
freePhone
(
obj
){
function
freePhone
(
obj
){
$
.
ajax
({
$
.
ajax
({
...
@@ -521,7 +745,8 @@ function loadMain(){
...
@@ -521,7 +745,8 @@ function loadMain(){
'AuthToken'
:
_token
,
'AuthToken'
:
_token
,
'phone_x'
:
_backPhone
,
'phone_x'
:
_backPhone
,
'phone_a'
:
_selectPhone
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
'user_id'
:
_customerId
//'phone_b': _customerPhone
},
},
timeout
:
30000
,
timeout
:
30000
,
dataType
:
'json'
,
dataType
:
'json'
,
...
@@ -532,6 +757,7 @@ function loadMain(){
...
@@ -532,6 +757,7 @@ function loadMain(){
console
.
log
(
'释放成功'
);
console
.
log
(
'释放成功'
);
layer
.
open
({
layer
.
open
({
content
:
'提交成功'
,
content
:
'提交成功'
,
shadeClose
:
false
,
btn
:
[
'确定'
],
btn
:
[
'确定'
],
yes
:
function
(
_index
){
yes
:
function
(
_index
){
...
@@ -550,6 +776,8 @@ function loadMain(){
...
@@ -550,6 +776,8 @@ function loadMain(){
layerTipsX
(
'error'
);
layerTipsX
(
'error'
);
},
},
complete
:
function
(
xhr
,
textStatus
){
complete
:
function
(
xhr
,
textStatus
){
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
if
(
textStatus
===
'timeout'
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
layerTipsX
(
'请求超时'
);
};
};
...
@@ -573,7 +801,7 @@ function loadMain(){
...
@@ -573,7 +801,7 @@ function loadMain(){
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
var
_htmlTemp
=
''
;
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
],
function
(
i
,
item
)
{
$
.
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'
:
''
,
'0'
:
''
,
'1'
:
item
[
'phone'
],
'1'
:
item
[
'phone'
],
'2'
:
'readonly'
,
'2'
:
'readonly'
,
...
@@ -608,10 +836,14 @@ function loadMain(){
...
@@ -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
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
_callModal
.
show
();
if
(
is_outpace_call_num
==
'0'
){
_callModal
.
show
();
}
else
{
layerTipsX
(
'该客户今日已达拨打上限,请明日再来'
);
};
});
});
$
(
'.call-btn-other'
).
click
(
function
(
e
){
$
(
'.call-btn-other'
).
click
(
function
(
e
){
...
@@ -619,7 +851,6 @@ function loadMain(){
...
@@ -619,7 +851,6 @@ function loadMain(){
e
.
stopPropagation
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_this
=
$
(
this
);
var
_tel
=
_this
.
prev
().
attr
(
'data-tel'
);
var
_tel
=
_this
.
prev
().
attr
(
'data-tel'
);
console
.
log
(
_tel
);
if
(
is_mobile
(
_tel
)
==
1
){
if
(
is_mobile
(
_tel
)
==
1
){
Compatible
({
Compatible
({
paraIos
:
{
paraIos
:
{
...
@@ -641,6 +872,7 @@ function loadMain(){
...
@@ -641,6 +872,7 @@ function loadMain(){
});
});
};
};
});
});
//拨打电话,选中手机号事件
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li'
,
function
(
e
){
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li'
,
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
...
@@ -651,6 +883,49 @@ function loadMain(){
...
@@ -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
){
_addPhoneBtn
.
click
(
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
...
@@ -659,10 +934,11 @@ function loadMain(){
...
@@ -659,10 +934,11 @@ function loadMain(){
return
false
;
return
false
;
}
else
{
}
else
{
_addPhoneBtn
.
hide
();
_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
){
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li>.call-edit-icon'
,
function
(
e
){
e
.
preventDefault
();
e
.
preventDefault
();
e
.
stopPropagation
();
e
.
stopPropagation
();
...
@@ -732,7 +1008,8 @@ function loadMain(){
...
@@ -732,7 +1008,8 @@ function loadMain(){
data
:
{
data
:
{
'AuthToken'
:
_token
,
'AuthToken'
:
_token
,
'phone_a'
:
_selectPhone
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
'user_id'
:
_customerId
//'phone_b': _customerPhone
},
},
timeout
:
30000
,
timeout
:
30000
,
dataType
:
'json'
,
dataType
:
'json'
,
...
@@ -745,14 +1022,15 @@ function loadMain(){
...
@@ -745,14 +1022,15 @@ function loadMain(){
if
(
typeof
data
===
'object'
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
code
==
200
)
{
_backPhone
=
data
[
'data'
][
'phone'
];
_backPhone
=
data
[
'data'
][
'phone'
];
console
.
log
(
_backPhone
);
_temp_follow_id
=
data
[
'data'
][
'follow_id'
];
//临时的跟进id
Compatible
({
Compatible
({
paraIos
:
{
paraIos
:
{
'route'
:
'call'
,
'route'
:
'call'
,
'phone'
:
_backPhone
'phone'
:
_backPhone
,
'userId'
:
Number
(
_customerId
)
},
},
fnAndroid
:
function
()
{
fnAndroid
:
function
()
{
window
.
android
.
onPhoneCall
(
_backPhone
);
window
.
android
.
onPhoneCall
(
_backPhone
,
Number
(
_customerId
)
);
},
},
fn
:
function
()
{
fn
:
function
()
{
console
.
warn
(
'error'
);
console
.
warn
(
'error'
);
...
@@ -788,4 +1066,4 @@ function loadMain(){
...
@@ -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