Commit cae1706f authored by agping's avatar agping

后台优化

parent 2e9cb8c4
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
.clear{ .clear{
clear: both; clear: both;
} }
.btn-top-house{
margin-top: 20px;
text-align: center;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -88,7 +92,7 @@ ...@@ -88,7 +92,7 @@
<th class="text-center">跟进人</th> <th class="text-center">跟进人</th>
<th class="text-center">商铺ID</th> <th class="text-center">商铺ID</th>
<th class="text-center">商铺名称</th> <th class="text-center">商铺名称</th>
<!--<th class="text-center">操作</th>--> <th class="text-center">操作</th>
</tr> </tr>
</thead> </thead>
<tbody class="text-center" id="follow_list"> <tbody class="text-center" id="follow_list">
...@@ -105,5 +109,52 @@ ...@@ -105,5 +109,52 @@
</div> </div>
</div> </div>
</div> </div>
<!-- #查看-->
<div class="modal fade modal_followup" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title detail-modal-header-tab" >
<a href="javascript:;" class="btn btn-default">商铺跟进</a>
<a href="javascript:;" class="btn btn-info">查看商铺</a>
</h4>
</div>
<div class="modal-body modal-body-one">
<div class="detail-modal-body-sec">
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="" id="modal_followup_table_list">
<tr>
<td>电话跟进:测试测试测试测试测试测试测试测试测试测试测试测试</td>
<td>刘丹丹</td>
<td>2017-09-05 15:22:33</td>
</tr>
<tr>
<td colspan="3">2017-09-05 15:22:33</td>
</tr>
</tbody>
</table>
</div>
<div class="followup-modal-comment-area">
<textarea></textarea>
</div>
<div class="btn-top-house">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="modal_followup_submit_btn">提交</button>
</div>
</div>
<div class="detail-modal-body-sec">
<iframe class="iframe-shop-detail"></iframe>
</div>
</div>
</div>
</div>
</div>
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
.main_table_th_tr>th:nth-of-type(8){ .main_table_th_tr>th:nth-of-type(8){
width: 50px; width: 50px;
} }
.btn-top-house{
margin-top: 20px;
text-align: center;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -352,7 +356,7 @@ ...@@ -352,7 +356,7 @@
</div> </div>
<!-- #查看--> <!-- #查看-->
<div class="modal fade" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade modal_followup" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one"> <div class="modal-dialog modal-dialog-one">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
...@@ -385,8 +389,11 @@ ...@@ -385,8 +389,11 @@
<div class="followup-modal-comment-area"> <div class="followup-modal-comment-area">
<textarea></textarea> <textarea></textarea>
</div> </div>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> <div class="btn-top-house">
<button type="button" class="btn btn-primary" id="modal_followup_submit_btn">提交</button> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" id="modal_followup_submit_btn">提交</button>
</div>
</div> </div>
<div class="detail-modal-body-sec"> <div class="detail-modal-body-sec">
<iframe class="iframe-shop-detail"></iframe> <iframe class="iframe-shop-detail"></iframe>
...@@ -396,44 +403,3 @@ ...@@ -396,44 +403,3 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="modal_followup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" >
跟进
</h4>
</div>
<div class="modal-body modal-body-one">
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="" id="modal_followup_table_list">
<tr>
<td>电话跟进:测试测试测试测试测试测试测试测试测试测试测试测试</td>
<td>刘丹丹</td>
<td>2017-09-05 15:22:33</td>
</tr>
<tr>
<td colspan="3">2017-09-05 15:22:33</td>
</tr>
</tbody>
</table>
</div>
<div class="followup-modal-comment-area">
<textarea></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="modal_followup_submit_btn">
提交
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
} }
/*客户动态*/ /*客户动态*/
.followup-modal-list-area { .followup-modal-list-area {
height: 350px; height: 268px;
overflow-y: scroll; overflow-y: scroll;
} }
/*客户详情 头像*/ /*客户详情 头像*/
...@@ -252,13 +252,13 @@ ...@@ -252,13 +252,13 @@
line-height: 50px; line-height: 50px;
border-top: 3px solid #ccc; border-top: 3px solid #ccc;
} }
.right-btn{ .center-btn{
float: right;
margin-top: 10px; margin-top: 10px;
margin-bottom: 20px; margin-bottom: 20px;
text-align: center;
} }
#caozuo_table_scroll{ #caozuo_table_scroll{
height: 350px; height: 268px;
overflow-y: scroll; overflow-y: scroll;
} }
...@@ -579,7 +579,7 @@ ...@@ -579,7 +579,7 @@
<!-- /.modal --> <!-- /.modal -->
</div> </div>
<!--操作详情记录--> <!--客户详情 客户跟进-->
<div class="modal fade" id="modal-record" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="modal-record" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content modal-body-details"> <div class="modal-content modal-body-details">
...@@ -716,9 +716,10 @@ ...@@ -716,9 +716,10 @@
</div> </div>
<!--客户详情保存--> <!--客户详情保存-->
<button type="button" class="btn btn-primary submit_edit right-btn" data-dismiss="modal"> <div class="center-btn">
保存 <button type="button" class="btn btn-primary submit_edit">保存</button>
</button> </div>
<h4 class="modal-title-genjing clear text-info"> <h4 class="modal-title-genjing clear text-info">
客户跟进 客户跟进
</h4> </h4>
...@@ -744,9 +745,10 @@ ...@@ -744,9 +745,10 @@
</table> </table>
</div> </div>
<!--跟进保存--> <!--跟进保存-->
<button type="button" class="btn btn-primary right-btn" id="edit_add" data-dismiss="modal"> <div class="center-btn">
保存 <button type="button" class="btn btn-primary right-btn" id="edit_add">保存</button>
</button> </div>
</div> </div>
</div> </div>
...@@ -812,9 +814,9 @@ ...@@ -812,9 +814,9 @@
</div> </div>
<label class="col-sm-3 control-label">状态标签:</label> <label class="col-sm-3 control-label">状态标签:</label>
<div class="col-sm-9"> <div class="col-sm-9">
<label class="control-label">求租</label><input type="radio" name="user_status" value="0"> <!--<label class="control-label">求租</label><input type="radio" name="user_status" value="0">
<label class="control-label">已租</label><input type="radio" name="user_status" value="1"> <label class="control-label">已租</label><input type="radio" name="user_status" value="1">
<label class="control-label">无效</label><input type="radio" name="user_status" value="-1"> <label class="control-label">无效</label><input type="radio" name="user_status" value="-1">-->
<span class="text-danger">(必填)</span> <span class="text-danger">(必填)</span>
</div> </div>
<div class="clear"> <div class="clear">
...@@ -830,7 +832,7 @@ ...@@ -830,7 +832,7 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭 <button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button> </button>
<button type="button" class="btn btn-primary" id="edit_add" data-dismiss="modal"> <button type="button" class="btn btn-primary" id="edit_add">
提交 提交
</button> </button>
</div> </div>
......
...@@ -3,6 +3,11 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css' ...@@ -3,6 +3,11 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
pageNo: 1, pageNo: 1,
/*第几页*/ /*第几页*/
pageSize: 10, pageSize: 10,
AuthToken: '',
agent_id: 0,
agent_phone: '',
agent_name: '',
isFollowupSaving: false,
/*每页显示多少条*/ /*每页显示多少条*/
id: '', id: '',
house_id: '', house_id: '',
...@@ -11,6 +16,8 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css' ...@@ -11,6 +16,8 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
ajaxObj: '', ajaxObj: '',
stopstatus: true, stopstatus: true,
boxphoto: '', boxphoto: '',
detailTabIndex:0,//查看 弹出框 tab切换 初始化
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
...@@ -20,6 +27,11 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css' ...@@ -20,6 +27,11 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
house.AuthToken = user_info_obj.AuthToken;
house.agent_id = user_info_obj.id;
house.phone = user_info_obj.phone;
house.name = user_info_obj.name;
function  getPreMonth(date)  {             function  getPreMonth(date)  {            
var  arr  =  date.split('-');             var  arr  =  date.split('-');            
var  year  =  arr[0];              var  year  =  arr[0];             
...@@ -82,6 +94,60 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css' ...@@ -82,6 +94,60 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
$('#guest_stores').html(''); $('#guest_stores').html('');
}); });
//查看弹出框里的tab点击事件,查看商铺,商铺跟进
_doc.on('click', '.detail-modal-header-tab>a', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
house.detailTabIndex = _this.index();
$('.detail-modal-body-sec:nth-of-type('+(house.detailTabIndex+1)+')').show().siblings().hide();
if(house.detailTabIndex == 1){
$('.iframe-shop-detail').attr('src', '/app_broker/shop_detail_pc?shop_id='+house.id);
}else if(house.detailTabIndex == 0){
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
house.getFollowupList();
}
});
//点击查看,触发定位事件
_doc.on('click', '[href="#modal_detail"]', function(){
var _this = $(this);
if(_this.hasClass('btn-success')){
_this.removeClass('btn-success').addClass('btn-warning');
};
});
//点击跟进,获取商铺跟进动态的接口
_doc.on('click', '[href="#modal_followup"]', function(){
house.id = $(this).attr("data-id");
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
house.getFollowupList();
});
//点击商铺跟进保存按钮,保存数据的接口
_doc.on('click', '#modal_followup_submit_btn', function(e){
e.preventDefault();
e.stopPropagation();
house.followupAdd();
});
//查看点击事件
_doc.on('click', 'a[href="#modal_shop_detail"]', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-success').addClass('btn-warning');
var _id = _this.attr('data-id');
house.id=_id;
console.log(_id);
$('.detail-modal-header-tab>a:nth-of-type(1)').removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
house.detailTabIndex = 0;
$('.detail-modal-body-sec:nth-of-type(1)').show().siblings().hide();
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
house.getFollowupList();
// $('.iframe-shop-detail').attr('src', '/app_broker/shop_detail_pc?shop_id='+_id);
});
}, },
getList: function(pageNo) { //商铺跟进列表 getList: function(pageNo) { //商铺跟进列表
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
...@@ -145,6 +211,69 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css' ...@@ -145,6 +211,69 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
}; };
} }
}); });
},
getFollowupList: function(){
$.ajax({
'type': 'get',
'url': '/broker/getListByHouseId',
data: {
'house_id': house.id,
'AuthToken': house.AuthToken
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data && Array.isArray(data.data) && data.data.length>0) {
var _htmlTemp = '';
$.each(data.data, function(i, v) {
_htmlTemp += '<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>'.stringFormatObj({
'0': v.step,
'1': v.agent_name,
'2': v.create_time
})
});
$('#modal_followup_table_list').html(_htmlTemp);
}else{
$('#modal_followup_table_list').html('<tr><td>暂无数据</td></tr>');
}
} else {
alert('请登录!');
}
}
});
},
followupAdd: function(){
var _tareaObjVal = $('.followup-modal-comment-area>textarea').val();
if(_tareaObjVal == ''){
alert('内容不能为空');
return false;
};
if(!house.isFollowupSaving){
house.isFollowupSaving = true;
$.ajax({
'type': 'post',
'url': '/broker/addShopFollowUp',
data: {
'house_id': house.id,
'AuthToken': house.AuthToken,
'agent_id': house.agent_id,
'agent_phone': house.agent_phone,
'agent_name': house.agent_name,
'follow_up_info': _tareaObjVal
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('添加成功');
house.isFollowupSaving = false;
$(".modal_followup").modal('hide');
} else {
alert('请登录!');
}
}
});
}
}, },
//调用部门 和 门店的接口 //调用部门 和 门店的接口
getDistrict: function(fn) { getDistrict: function(fn) {
......
...@@ -832,7 +832,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -832,7 +832,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
if(data.code == 200) { if(data.code == 200) {
alert('添加成功'); alert('添加成功');
business.isFollowupSaving = false; business.isFollowupSaving = false;
$("#modal_followup").modal('hide'); $(".modal_followup").modal('hide');
} else { } else {
alert('请登录!'); alert('请登录!');
} }
......
...@@ -529,10 +529,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart', ...@@ -529,10 +529,11 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}, },
edit_add: function() { //提交跟进 edit_add: function() { //提交跟进
var user_status = $("input[name = 'user_status']:checked").val(); var user_status = $("input[name = 'user_status']:checked").val();
console.log(user_status);
var genj_text = $("#genj_text").val(); var genj_text = $("#genj_text").val();
if(genj_text == '') { if(genj_text == '') {
alert('提交失败'); alert('请填写内容');
return false; return false;
} }
...@@ -554,7 +555,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart', ...@@ -554,7 +555,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
alert('修改成功'); alert('修改成功');
$("#modal-add").modal('hide'); $("#modal-record").modal('hide');
} else { } else {
alert(data.msg); alert(data.msg);
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<tr class="text-center"> <tr class="text-center">
<!--对接接口--> <!--对接接口-->
<td>[%= it[item]['create_time'] %]</td> <td>[%= it[item]['create_time'] %]</td>
<td width="60%" class="text-left">[%= it[item]['follow_up_info'] %]</td> <td width="47%" class="text-left">[%= it[item]['follow_up_info'] %]</td>
<td>[%= it[item]['name'] %]</td> <td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['house_id'] %]</td> <td>[%= it[item]['house_id'] %]</td>
<td> <td>
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
[% } %] [% } %]
</td> </td>
<td>
<a class="btn1 [%= (it[item]['is_look'] && it[item]['auth_edit_house'] == 0)?'btn-warning':'btn-success' %]" href="#modal_shop_detail" data-id='[%= it[item]["house_id"] %]' data-toggle="modal">跟进/查看</a>
</td>
<!--<td> <!--<td>
<a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>查看商铺</a> <a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>查看商铺</a>
<a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>商铺跟进</a> <a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>商铺跟进</a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment