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
9e33a220
Commit
9e33a220
authored
Aug 10, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
恢复1
parent
5fbfc271
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
825 additions
and
33 deletions
+825
-33
customerinfo_details_new.html
...ation/app_broker/view/index/customerinfo_details_new.html
+1
-1
customerinfo_details_new.js
public/app/js/customerinfo_details_new.js
+26
-32
customerinfo_details_new_081001.js
public/app/js/customerinfo_details_new_081001.js
+798
-0
No files found.
application/app_broker/view/index/customerinfo_details_new.html
View file @
9e33a220
...
...
@@ -159,7 +159,7 @@
<script
type=
"text/javascript"
src=
"/app/js/jquery-1122-min.js"
></script>
<script
src=
"/app/js/common.js?new42"
charset=
"utf-8"
></script>
<script
src=
"/app/js/customerinfo_details_new.js?new5
3
"
></script>
<script
src=
"/app/js/customerinfo_details_new.js?new5
4
"
></script>
</body>
...
...
public/app/js/customerinfo_details_new.js
View file @
9e33a220
...
...
@@ -391,27 +391,24 @@ 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
()),
...
...
@@ -427,14 +424,20 @@ function loadMain(){
// return false;
// };
if
((
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'1'
)
||
(
_genjinMarkOBj2
.
attr
(
'data-markid'
)
==
'4'
)){
}
else
{
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;
// };
// };
if
(
_genjinMarkOBj
.
length
==
0
){
layerTipsX
(
'请选择状态跟进标签'
);
return
false
;
};
var
_data
=
{
'AuthToken'
:
_token
,
'content'
:
_beizhuObjVal
,
...
...
@@ -442,17 +445,6 @@ 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'
]
=
'-1'
;
};
};
if
(
isCallFlag
){
//电话跟进
if
(
_genjinMarkOBj2
.
length
==
0
){
...
...
@@ -518,7 +510,8 @@ function loadMain(){
};
}
});
}
});
function
freePhone
(
obj
){
$
.
ajax
({
...
...
@@ -795,4 +788,4 @@ function loadMain(){
});
};
});
};
};
\ No newline at end of file
public/app/js/customerinfo_details_new_081001.js
0 → 100644
View file @
9e33a220
var
_doc
=
$
(
document
),
_token
=
getUrlParam
(
"token"
),
_customerId
=
getUrlParam
(
'customerId'
);
$
(
function
(){
$
(
document
.
body
).
show
();
if
(
_token
!==
null
)
{
h5PageC
(
_token
,
function
(
data
)
{
if
(
Number
(
localStorage
.
getItem
(
'userid'
))){
loadMain
();
}
else
{
layerTipsX
(
'登录信息有误,请重新登录'
);
}
});
}
else
{
layerTipsX
(
'参数错误,请重新登录'
);
};
//返回键,和原生对接
//****************此页面和app交互时,苹果的要特殊处理,和其他页面用的方法不一致,这个页面需要url跳转来传递参数***************
_doc
.
on
(
"click"
,
"#back_btn"
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
localStorage
.
removeItem
(
'appVersion'
);
localStorage
.
removeItem
(
'isPos'
);
Compatible
({
paraIos
:
{
'route'
:
'back'
},
fnAndroid
:
function
()
{
window
.
android
.
onBackPressed
();
},
fn
:
function
()
{
console
.
warn
(
'error'
);
}
});
});
});
function
loadMain
(){
var
_genjinModal
=
$
(
'#genjin_modal'
),
//跟进模态框dom
_callModal
=
$
(
'#call_modal'
),
//拨打电话模态框dom
_markAreaObj
=
$
(
'.genjin-mark-area-zhuangtai>.genjin-mark-area-alink'
),
//跟进标签列表状态标签区域dom
_markAreaObj2
=
$
(
'.genjin-mark-area-putong>.genjin-mark-area-alink'
),
//跟进标签列表普通标签区域dom
_beizhuObj
=
$
(
'#content'
),
//跟进的备注内容
_genjinCloseBtn
=
$
(
'#close_btn'
),
//跟进模态框关闭按钮
_btnSave
=
$
(
'#btn_save'
),
//跟进的保存按钮
_btnSaveTemp
=
$
(
'#btn_save_temp'
),
//跟进保存按钮临时
_userId
=
Number
(
localStorage
.
getItem
(
'userid'
)),
//当前用户id
isCallFlag
=
true
,
//是否是电话跟进,默认不是
_addPhoneBtn
=
$
(
'#add_phone_btn'
),
//添加电话按钮
_addPhoneListObj
=
$
(
'#call_modal_phone_list'
),
//添加电话列表对象dom
_userPhone
=
localStorage
.
getItem
(
'userphone'
),
//当前用户的手机号
_selectPhone
=
''
,
//拨号列表里选择的号码,也是当前用户对应的手机号,可能和_userPhone是一样的
_customerPhone
=
''
,
//当前客户的手机号
_backPhone
=
''
;
//绑定之后返回的号码
if
(
_userId
){
}
else
{
layerTipsX
(
'信息有误,请重新登录'
);
}
//获取客户基本信息
_userId
&&
$
.
ajax
({
type
:
'POST'
,
url
:
'/broker/useraction_search'
,
data
:
{
'AuthToken'
:
_token
,
'user_id'
:
Number
(
_customerId
),
//客户id
'agent_id'
:
Number
(
_userId
)
//当前用户的id
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
data
.
data
.
is_collect
==
'1'
){
//收藏状态 1:表示已经收藏 2:暂未收藏
$
(
'#mark_btn'
).
attr
(
'data-ismark'
,
'1'
).
find
(
'img'
).
attr
(
'src'
,
'/app/images/icon_collection_choice@2x.png'
);
};
$
(
'#customer_code'
).
html
(
data
[
'data'
][
'user_info'
][
'user_id'
]);
$
(
'#customer_name, #name'
).
html
((
data
[
'data'
][
'user_info'
][
'user_name'
]
==
null
?
''
:
data
[
'data'
][
'user_info'
][
'user_name'
])
+
(
data
[
'data'
][
'user_info'
][
'user_nick'
]?(
'('
+
data
[
'data'
][
'user_info'
][
'user_nick'
]
+
')'
):
''
));
if
(
data
[
'data'
][
'user_info'
][
'sex'
]
==
2
){
$
(
'.sex-icon'
).
attr
(
'src'
,
'/app/images/girl_ic@2x.png'
);
};
//如果业态没有则隐藏这个span
if
(
data
[
'data'
][
'user_info'
][
'industry_type'
]){
$
(
'#industry_type'
).
html
(
data
[
'data'
][
'user_info'
][
'industry_type'
]);
}
else
{
$
(
'#industry_type'
).
hide
();
}
$
(
'#price_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'price_demand'
]
+
'元/月'
);
$
(
'#area_demand'
).
html
(
data
[
'data'
][
'user_info'
][
'area_demand'
]
+
'㎡'
);
$
(
'#kefang'
).
html
(
data
[
'data'
][
'user_info'
][
'agentinfo'
]);
var
_kefang_tel
=
data
[
'data'
][
'user_info'
][
'agentinfo'
].
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
]);
//邀请人
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
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
10
){
$
(
'#create_type'
).
html
(
'APP注册'
);
//产生类型
}
else
if
(
data
[
'data'
][
'user_info'
][
'source'
]
==
20
){
$
(
'#create_type'
).
html
(
'经纪人新增'
);
//产生类型
};
$
(
'#register_time'
).
html
(
data
[
'data'
][
'user_info'
][
'registration_time'
]);
//注册时间
$
(
'#login_time'
).
html
(
data
[
'data'
][
'user_info'
][
'first_login_time'
]);
//下载登录时间
$
(
'#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'
]));
$
(
'#call_modal_phone_self'
).
val
(
_userPhone
);
function
landlordType
(
m
)
{
var
_m
=
Number
(
m
);
if
(
_m
===
0
){
return
'普通用户'
;
}
else
if
(
_m
===
1
){
return
'是租客也是房东'
;
}
else
if
(
_m
===
2
){
return
'纯房东'
;
}
else
{
return
'other'
;
}
};
$
(
'#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'
])
}));
if
(
data
[
'data'
][
'user_info'
][
'agent_id'
]
==
_userId
||
localStorage
.
getItem
(
'userlevel'
)
!=
'10'
){
//客方和当前登录用户一致,或者当前登录用户为店长或者总监时,才能进行编辑客户
$
(
'#edit_btn'
).
show
().
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
//location.href = ServerHost+'/app_broker/customerinfo_customer_add?customerId='+_customerId;
Compatible
({
paraIos
:
{
'route'
:
'onClientEdit'
,
'userId'
:
Number
(
_customerId
)
},
fnAndroid
:
function
()
{
window
.
android
.
onClientEdit
(
String
(
_customerId
));
},
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'
],
'2'
:
obj
[
'industry_type'
],
'3'
:
obj
[
'area_requirement'
],
'4'
:
obj
[
'price_requirement'
],
'5'
:
obj
[
'area_detail'
],
'6'
:
obj
[
'explain'
],
'7'
:
obj
[
'explain_img'
]?
'<ol class="li-img-list"><li><a href="/app_broker/imagebody?fullUrl='
+
obj
[
'img_path'
]
+
obj
[
'explain_img'
]
+
'"><img src="'
+
obj
[
'img_path'
]
+
obj
[
'explain_img'
]
+
'" /></a></li></ol>'
:
''
});
};
//约带看时的特殊处理
function
dealSpYdk
(
obj
){
return
'<p>到场时间:{0}</p><p class="sp-yuedaikan-beizhu-span">备注:{1}</p>'
.
stringFormatObj
({
'0'
:
obj
[
'predict_see_time'
],
'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>'
);
};
//客方修改日志
var
_htmlTemp2
=
''
;
if
(
data
[
'data'
][
'user_history'
].
length
>
0
){
$
.
each
(
data
[
'data'
][
'user_history'
],
function
(
i
,
item
)
{
_htmlTemp2
+=
'<li><div><p>操作时间</p><p>{0}</p></div><div><span class="dot-block"><mark></mark></span><p>{1}</p><p>操作人:{2}</p></div></li>'
.
stringFormatObj
({
'0'
:
item
[
'create_time'
]?
item
[
'create_time'
].
split
(
' '
)[
0
]:
item
[
'create_time'
],
'1'
:
item
[
'remark'
],
'2'
:
item
[
'name'
]
});
});
$
(
'.record-main>ul'
).
html
(
_htmlTemp2
);
}
else
{
$
(
'.record-main>ul'
).
html
(
'<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>'
);
}
//点击收藏按钮触发的事件
var
isAjaxIng
=
false
;
//是否正在执行请求操作
$
(
'#mark_btn'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
isMark
=
((
_this
.
attr
(
'data-ismark'
)
==
'1'
)?
true
:
false
);
//点击的时候,是否是已经收藏的状态,记录
if
(
!
isAjaxIng
){
isAjaxIng
=
true
;
//只有没有在执行请求操作的时候,才能进行请求
$
.
ajax
({
type
:
'GET'
,
url
:
ServerHostTempC
+
'/broker/addCollectUser'
,
data
:
{
'AuthToken'
:
_token
,
'agents_id'
:
_userId
,
//当前用户的id
'user_id'
:
_customerId
,
//客户id
'status'
:
isMark
?
2
:
1
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
isAjaxIng
=
false
;
if
(
isMark
){
_this
.
attr
(
'data-ismark'
,
'0'
).
find
(
'img'
).
attr
(
'src'
,
'/app/images/icon_collection@2x.png'
);
}
else
{
_this
.
attr
(
'data-ismark'
,
'1'
).
find
(
'img'
).
attr
(
'src'
,
'/app/images/icon_collection_choice@2x.png'
);
}
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
}
});
//添加报备的点击事件
$
(
'#baobei_btn'
).
click
(
function
(){
Compatible
({
paraIos
:
{
'route'
:
'baobei'
,
'name'
:
data
[
'data'
][
'user_info'
][
'user_name'
],
'phone'
:
data
[
'data'
][
'user_info'
][
'user_phone'
],
'sex'
:
data
[
'data'
][
'user_info'
][
'sex'
],
'userId'
:
data
[
'data'
][
'user_info'
][
'user_id'
]
},
fnAndroid
:
function
()
{
window
.
android
.
onProjectReport
(
data
[
'data'
][
'user_info'
][
'user_name'
],
data
[
'data'
][
'user_info'
][
'user_phone'
],
data
[
'data'
][
'user_info'
][
'sex'
],
parseInt
(
data
[
'data'
][
'user_info'
][
'user_id'
]));
},
fn
:
function
()
{
console
.
warn
(
'error'
);
}
});
});
//标签没有默认状态了
// 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('状态标签返回有误');
// }
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
console
.
log
(
'aa'
);
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
//获取跟进标签列表信息
_userId
&&
$
.
ajax
({
type
:
'GET'
,
url
:
ServerHostTempC
+
'/broker/getULabelsListApp'
,
data
:
{
'AuthToken'
:
_token
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
var
_htmlTemp
=
''
;
$
.
each
(
data
[
'data'
][
'list'
],
function
(
i
,
item
)
{
_htmlTemp
+=
'<a data-markid="{1}" data-free="{2}">{0}</a>'
.
stringFormatObj
({
'0'
:
item
[
'name'
],
'1'
:
item
[
'id'
],
'2'
:
item
[
'free'
]
});
});
_markAreaObj2
.
html
(
_htmlTemp
);
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
//tab栏点击事件
$
(
'.tab-area>div'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_index
=
$
(
this
).
index
();
$
(
'.tab-area>div'
).
eq
(
_index
).
addClass
(
'tab-active'
).
siblings
().
removeClass
(
'tab-active'
);
$
(
'.main-area>section'
).
eq
(
_index
).
show
().
siblings
().
hide
();
});
//跟进按钮点击事件
$
(
'#genjin_btn'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
isCallFlag
=
false
;
//改为非电话跟进
_markAreaObj2
.
parent
().
hide
();
//普通跟进的时候普通标签区域隐藏
_genjinCloseBtn
.
show
();
_genjinModal
.
show
();
//跟进模态框显示
_beizhuObj
.
val
(
''
);
//清空跟进输入框内容
//_markAreaObj.find('a').removeClass('genjin-mark-active');//清空跟进标签选择数据
});
//跟进模态框关闭按钮点击事件
_genjinCloseBtn
.
click
(
function
(
e
){
isCallFlag
=
true
;
//改为非电话跟进
_genjinModal
.
hide
();
});
//跟进模态框,列表标签的点击事件
_doc
.
on
(
'click'
,
'.genjin-mark-area-alink>a'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
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
()),
_isFreeFlag
=
true
;
//是否释放
//取消自动关闭
// if((_genjinMarkOBj2.attr('data-markid') == '1') || (_genjinMarkOBj2.attr('data-markid') == '4')){
// //如果选择了未打通,或取消拨打,则直接关闭
// if(isCallFlag&&_isFreeFlag){
// //释放
// freePhone();
// };
// _genjinModal.hide();//跟进模态框关闭
// 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
,
'user_id'
:
_customerId
,
'agent_id'
:
_userId
,
'user_status'
:
_genjinMarkOBj
.
attr
(
'data-markid'
)
};
if
(
type
===
'sp1'
){
if
(
_beizhuObjVal
){
}
else
{
_data
[
'content'
]
=
'未打通'
;
};
if
(
_genjinMarkOBj
.
length
==
0
){
_data
[
'user_status'
]
=
'-1'
;
};
};
if
(
isCallFlag
){
//电话跟进
if
(
_genjinMarkOBj2
.
length
==
0
){
layerTipsX
(
'请选择普通跟进标签'
);
return
false
;
}
else
{
_data
[
'labels_id'
]
=
_genjinMarkOBj2
.
attr
(
'data-markid'
);
_data
[
'type'
]
=
0
;
(
_genjinMarkOBj2
.
attr
(
'data-free'
)
==
0
)
&&
(
_isFreeFlag
=
false
);
}
}
else
{
//普通跟进
if
(
_beizhuObjVal
==
''
){
layerTipsX
(
'请填写跟进信息'
);
return
false
;
}
else
{
_data
[
'type'
]
=
1
;
}
};
$
.
ajax
({
type
:
'POST'
,
url
:
ServerHostTempC
+
'/broker/add_phone_follow_up'
,
data
:
_data
,
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{
_btnSave
.
hide
();
_btnSaveTemp
.
css
(
'display'
,
'block'
);
},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
if
(
isCallFlag
&&
_isFreeFlag
){
//释放
freePhone
();
}
else
{
layer
.
open
({
content
:
'提交成功'
,
btn
:
[
'确定'
],
yes
:
function
(
_index
){
location
.
reload
();
layer
.
close
(
_index
);
}
});
};
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
_btnSaveTemp
.
hide
();
_btnSave
.
css
(
'display'
,
'block'
);
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
}
function
freePhone
(
obj
){
$
.
ajax
({
type
:
'POST'
,
url
:
ServerHostTempC
+
'/broker/agentsUnBind'
,
data
:
{
'AuthToken'
:
_token
,
'phone_x'
:
_backPhone
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
console
.
log
(
'释放成功'
);
layer
.
open
({
content
:
'提交成功'
,
btn
:
[
'确定'
],
yes
:
function
(
_index
){
location
.
reload
();
layer
.
close
(
_index
);
}
});
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
};
//拨打电话模态框,获取电话列表
_userId
&&
$
.
ajax
({
type
:
'GET'
,
url
:
ServerHostTempC
+
'/broker/agentsPhone'
,
data
:
{
'AuthToken'
:
_token
,
'agents_id'
:
_userId
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
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
({
'0'
:
''
,
'1'
:
item
[
'phone'
],
'2'
:
'readonly'
,
});
});
$
(
'.call-modal-main>ol'
).
append
(
_htmlTemp
);
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
//拨打电话模态框,取消按钮点击事件
$
(
'#call_btn_cancel'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
_callModal
.
hide
();
});
//点击头部区域拨打电话出现弹窗部分
$
(
'#call_list_open_btn'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
_callModal
.
show
();
});
$
(
'.call-btn-other'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
var
_tel
=
_this
.
prev
().
attr
(
'data-tel'
);
console
.
log
(
_tel
);
if
(
is_mobile
(
_tel
)
==
1
){
Compatible
({
paraIos
:
{
'route'
:
'call'
,
'phone'
:
_tel
},
fnAndroid
:
function
()
{
window
.
android
.
onPhoneCall
(
_tel
);
},
fn
:
function
()
{
console
.
warn
(
'error'
);
}
});
}
else
{
layer
.
open
({
content
:
'所选的号码格式不正确'
,
skin
:
'msg'
,
time
:
2
});
};
});
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
);
if
(
_this
.
find
(
'input'
)[
0
].
readOnly
){
if
(
!
_this
.
hasClass
(
'call-select'
)){
_this
.
addClass
(
'call-select'
).
siblings
().
removeClass
(
'call-select'
);
};
};
});
_addPhoneBtn
.
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
_addPhoneListObj
.
find
(
'li'
).
length
>=
3
){
layerTipsX
(
'可添加的号码最多为3'
);
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
();
};
});
_doc
.
on
(
'click'
,
'#call_modal_phone_list>li>.call-edit-icon'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
_this
=
$
(
this
),
_phoneTemp
=
$
.
trim
(
_this
.
prev
().
val
());
if
(
!
is_mobile
(
_phoneTemp
)){
layerTipsX
(
'请输入正确的手机号码'
);
return
false
;
};
$
.
ajax
({
type
:
'POST'
,
url
:
ServerHostTempC
+
'/broker/agentsPhone'
,
data
:
{
'AuthToken'
:
_token
,
'agents_id'
:
_userId
,
'phone'
:
_phoneTemp
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{
_this
.
hide
();
_this
.
next
().
show
();
},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
_this
.
prev
().
attr
(
'readonly'
,
'readonly'
).
parent
().
removeClass
(
'call-add'
).
addClass
(
'call-select'
).
siblings
().
removeClass
(
'call-select'
);
_addPhoneBtn
.
show
();
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
_this
.
next
().
hide
();
_this
.
parent
().
hasClass
(
'call-add'
)
&&
_this
.
show
();
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
});
var
_callFlag
=
true
;
$
(
'#call_btn_ok'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
!
_callFlag
){
return
false
;
};
var
_selectObj
=
$
(
'.call-select'
);
if
(
_selectObj
.
length
!=
1
){
layerTipsX
(
'选择出错'
);
return
false
;
}
else
{
_selectPhone
=
$
.
trim
(
_selectObj
.
find
(
'input'
).
val
());
};
if
(
_selectPhone
&&
_customerPhone
){
$
.
ajax
({
type
:
'POST'
,
url
:
ServerHostTempC
+
'/broker/bindAXB'
,
data
:
{
'AuthToken'
:
_token
,
'phone_a'
:
_selectPhone
,
'phone_b'
:
_customerPhone
},
timeout
:
30000
,
dataType
:
'json'
,
beforeSend
:
function
()
{
_callFlag
=
false
;
$
(
'#call_btn_ok'
).
hide
();
$
(
'#call_btn_ok_temp'
).
show
();
},
success
:
function
(
data
)
{
if
(
typeof
data
===
'object'
)
{
if
(
data
.
code
==
200
)
{
_backPhone
=
data
[
'data'
][
'phone'
];
console
.
log
(
_backPhone
);
Compatible
({
paraIos
:
{
'route'
:
'call'
,
'phone'
:
_backPhone
},
fnAndroid
:
function
()
{
window
.
android
.
onPhoneCall
(
_backPhone
);
},
fn
:
function
()
{
console
.
warn
(
'error'
);
}
});
_callModal
.
hide
();
//拨打电话模态框隐藏
_genjinCloseBtn
.
hide
();
//跟进模态框关闭按钮隐藏
_markAreaObj2
.
parent
().
show
();
//普通跟进标签列表显示
_beizhuObj
.
val
(
''
);
//清空跟进输入框内容
_markAreaObj2
.
find
(
'a'
).
removeClass
(
'genjin-mark-active'
);
//清空普通跟进标签选择数据
setTimeout
(
function
(){
_genjinModal
.
show
();
//跟进模态框打开
},
1000
);
}
else
{
layerTipsX
(
data
[
'msg'
]);
};
}
else
{
layerTipsX
(
'数据错误'
);
};
},
error
:
function
()
{
layerTipsX
(
'error'
);
},
complete
:
function
(
xhr
,
textStatus
){
$
(
'#call_btn_ok_temp'
).
hide
();
$
(
'#call_btn_ok'
).
show
();
_callFlag
=
true
;
if
(
textStatus
===
'timeout'
){
layerTipsX
(
'请求超时'
);
};
}
});
};
});
};
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