Commit 72319449 authored by agping's avatar agping

客户列表修改

parent d7eec2b1
...@@ -7,6 +7,34 @@ ...@@ -7,6 +7,34 @@
.modal-backdrop.fade.in{ .modal-backdrop.fade.in{
opacity: 0; opacity: 0;
} }
#batch{
float: left;
height: 34px;
line-height: 34px;
}
.ld-Marheight{
margin-top: 15px;
}
.phone_list{
margin-top: 32px;
width: 182px;
margin-left: -182px;
}
.phone_jia1{
float: left;
width: 182px;
}
.phone_list li{
height: 22px;
line-height: 22px;
}
.phone_list li:nth-of-type(even) {
display: none;
}
.modal-dialog-one{
width: 668px;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -79,6 +107,9 @@ ...@@ -79,6 +107,9 @@
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<!-- 批量修改客方 -->
<a href="#modal_modify_user" data-toggle="modal" class="btn btn-info btn3 margin-top-ld"><i class="icon-plus"></i>
批量修改客方</a>
</form> </form>
</td> </td>
</tr> </tr>
...@@ -271,4 +302,43 @@ ...@@ -271,4 +302,43 @@
</div> </div>
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal --> </div><!-- /.modal -->
</div>
<!-- #批量修改客方-->
<div class="modal fade" id="modal_modify_user" 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">
<br>
<!-- ============添加========== -->
<div class="jian_class1">
<input name="ues_id" placeholder="请输入经纪人姓名" type="tel" value="" class="phone_jia1 old_agents form-control" >
<ul class="phone_list"></ul>
</div>
<span class="btn3" id="batch">批量修改为&nbsp;&nbsp;</span>
<div class="jian_class1">
<input name="ues_id" placeholder="请输入经纪人姓名" type="tel" value="" class="phone_jia1 new_agents form-control">
<ul class="phone_list"></ul>
</div>
<br><br><br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="modify_add" data-dismiss="modal">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div> </div>
\ No newline at end of file
...@@ -23,6 +23,7 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin ...@@ -23,6 +23,7 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
business.resetLoad(); business.resetLoad();
}, },
event: function () { event: function () {
var _doc = $(document);
$("#search").click(function () { $("#search").click(function () {
business.getList(1); business.getList(1);
}); });
...@@ -78,7 +79,11 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin ...@@ -78,7 +79,11 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
$ (document).delegate (".jian", "click", function () {//叉号 $ (document).delegate (".jian", "click", function () {//叉号
business.jianbox(); business.jianbox();
}); });
// 批量修改客方
$ (document).delegate ("#modify_add", "click", function () {
business.modify_add();
});
// 批量修改客方
$(document).on('input','.phone_jia,.phone_add', function(e) {//搜索手机号码/加号搜索 $(document).on('input','.phone_jia,.phone_add', function(e) {//搜索手机号码/加号搜索
e.preventDefault(); e.preventDefault();
...@@ -139,6 +144,68 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin ...@@ -139,6 +144,68 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
$("#liudan_pic_pre").append(img_url); $("#liudan_pic_pre").append(img_url);
}); });
}); });
// 下拉列表
var _ajaxObjTel = null;
_doc.on('input', '.phone_jia1' ,function(){
var _this = $(this),
_thisVal = $.trim(_this.val());
_this.removeAttr('data-id');//移除之前携带的信息
if(_thisVal != ''){
_ajaxObjTel && _ajaxObjTel.abort();
_ajaxObjTel = $.ajax({
type: 'GET',
url: '/index/getBroker_new',
data: {
'phone': $.trim(_this.val())
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
if(data['data'].length > 0){
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li data-id="{3}">{2}{0}-{1}<li>'.stringFormatObj({
'0': item['name'],
'1': item['phone'],
'2': _this.parent().nextAll('.input-add-tel').data('hideid')?'':(item['id']+'-'),
'3': item['id']
});
});
// 输出trim
_this.next().show().html(_htmlTemp);
}else{
_this.next().html('');
};
}else {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
//alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
};
});
_doc.on('click', '.jian_class1>ul>li', function(){
var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id'));
_this.parent().html('').hide();
});
//
}, },
// 获取信息 手机号 名字 // 获取信息 手机号 名字
...@@ -220,7 +287,6 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin ...@@ -220,7 +287,6 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
} }
$("#modal-dujia").addClass("yz"); $("#modal-dujia").addClass("yz");
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url' : '/index/editExclusive', 'url' : '/index/editExclusive',
...@@ -402,25 +468,63 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin ...@@ -402,25 +468,63 @@ define (['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css','ckfin
}); });
}, },
//
// 批量修改客方
modify_add : function () {//modify_add批量修改客方
var old_agents_text = $('.old_agents').val();
var new_agents_text = $('.new_agents').val();
console.log($('.phone_jia1:eq(0)').attr('data-id'));
console.log($('.phone_jia1:eq(1)').attr('data-id'));
if (old_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
if (new_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
$.ajax ({
url: '/index/batchEditCustomer',
type: 'POST',
async: true,
data: {
"old_agents_id":$('.phone_jia1:eq(0)').attr('data-id'),
"agents_id":$('.phone_jia1:eq(1)').attr('data-id'),
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
console.log(666);
}
}
});
},
//==============批量修改客方===========
getList: function (pageNo) { getList: function (pageNo) {
business.pageNo = pageNo; business.pageNo = pageNo;
var params = {}; var params = {};
// 获取当前的时间 // 获取当前的时间
// if(pageNo!=1){ // if(pageNo!=1){
// var myDate = new Date(); // var myDate = new Date();
// var y = myDate.getFullYear(); // var y = myDate.getFullYear();
// var m = myDate.getMonth()+1; // var m = myDate.getMonth()+1;
// var d = myDate.getDate(); // var d = myDate.getDate();
// var m1=m-1; // var m1=m-1;
// if(m1==0){
// m1=12; // if(m1==0){
// } // m1=12;
// var day_end=y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d); // }
// var day_start=y+'-'+(m1<10?('0'+m1):m1)+'-'+(d<10?('0'+d):d);
// $('#start_date').val(day_start); // var day_end=y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
// $('#end_date').val(day_end); // var day_start=y+'-'+(m1<10?('0'+m1):m1)+'-'+(d<10?('0'+d):d);
// // alert(55) // $('#start_date').val(day_start);
// $('#end_date').val(day_end);
// // alert(55)
// } // }
......
...@@ -74,7 +74,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -74,7 +74,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
user.modify_add(); user.modify_add();
}); });
$ (document).delegate (".caozuo", "click", function () {//点击操作跟进详情 $ (document).delegate (".caozuo", "click", function () {//点击操作跟进详情
user.user_id = $ (this).attr ("data-id"); user.user_id = $ (this).attr ("data-id");
user.Caozuo(); user.Caozuo();
...@@ -105,7 +104,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -105,7 +104,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
user.Submit_follow(); user.Submit_follow();
}); });
// =============下拉列表======================== // =============下拉列表========================
var _ajaxObjTel = null; var _ajaxObjTel = null;
_doc.on('input', '.phone_jia' ,function(){ _doc.on('input', '.phone_jia' ,function(){
var _this = $(this), var _this = $(this),
_thisVal = $.trim(_this.val()); _thisVal = $.trim(_this.val());
...@@ -159,13 +158,13 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -159,13 +158,13 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}; };
}); });
_doc.on('click', '.jian_class>ul>li', function(){ _doc.on('click', '.jian_class>ul>li', function(){
var _this = $(this); var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id')); _this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id'));
_this.parent().html('').hide(); _this.parent().html('').hide();
}); });
// ===================
}, },
addphone:function(obj){ addphone:function(obj){
var user_ht=$(obj).html(); var user_ht=$(obj).html();
...@@ -282,8 +281,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -282,8 +281,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}, },
// //
// 批量修改客方666
// //
modify_add : function () {//modify_add批量修改客方 modify_add : function () {//modify_add批量修改客方
var old_agents_text = $('.old_agents').val(); var old_agents_text = $('.old_agents').val();
...@@ -363,8 +361,8 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', ' ...@@ -363,8 +361,8 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
params.registration_end=$("#registration_end").val() params.registration_end=$("#registration_end").val()
params.login_status = $("select[name=login_status]").val(); params.login_status = $("select[name=login_status]").val();
params.activate = $("select[name=activate]").val(); params.activate = $("select[name=activate]").val();
params.rent_user=$("select[name=lguest_status]").val(); params.rent_user=$("select[name=public_status]").val();
params.public_user=$("select[name=public_status]").val(); params.public_user=$("select[name=male_status]").val();
params.store_name=$("#guest_stores").val(); params.store_name=$("#guest_stores").val();
params.district_name=$("#guest_department").val() params.district_name=$("#guest_department").val()
params.pageNo = user.pageNo; params.pageNo = user.pageNo;
......
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