Commit 5a96b5ca authored by agping's avatar agping

商铺列表修改

parent 07b98d55
...@@ -144,6 +144,30 @@ ...@@ -144,6 +144,30 @@
height: 600px; height: 600px;
overflow-y: scroll; overflow-y: scroll;
} }
/*盘方员工 姓名 下拉式 搜索*/
/*经纪人 搜索 下拉式*/
.left-phone{
margin-left: 10px;
float: left;
width: 230px;
position: relative;
}
.user-ul-agent{
width: 223px;
height: auto;
float: left;
position: absolute;
background: #fff;
border: .5px solid #ccc;
border-top: none;
left: 4px;
z-index: 999;
}
.user-ul-agent li{
list-style: none;
line-height: 30px;
margin-left: -28px;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -228,8 +252,18 @@ ...@@ -228,8 +252,18 @@
<option value="310100">上海市</option> <option value="310100">上海市</option>
<option value="330100">杭州市</option> <option value="330100">杭州市</option>
</select>--> </select>-->
<!--新增盘方部门 盘方门店 -->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="盘方(员工)姓名" type="text" value=""> <!--二级联动-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id_panfang" >
<option value="">盘方部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores_panfang" value="">
</select>
<div class="left-phone">
<input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="盘方(员工)姓名" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
<!--盘方员工姓名 下拉式 搜索-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_phone" placeholder="盘方(员工)手机号" type="tel" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_phone" placeholder="盘方(员工)手机号" type="tel" value="">
<span class="fore-span ld-Marheight">创建时间:</span> <span class="fore-span ld-Marheight">创建时间:</span>
......
...@@ -37,6 +37,29 @@ ...@@ -37,6 +37,29 @@
left: -25px; left: -25px;
} }
/*经纪人 搜索 下拉式*/
.left-phone{
margin-left: 10px;
float: left;
margin-top: -5px;
width: 230px;
position: relative;
}
.user-ul-agent{
width: 223px;
height: auto;
float: left;
position: absolute;
background: #fff;
border: .5px solid #ccc;
border-top: none;
left: 4px;
}
.user-ul-agent li{
list-style: none;
line-height: 30px;
margin-left: -28px;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
...@@ -70,8 +93,21 @@ ...@@ -70,8 +93,21 @@
<input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_create_time" name="start_date" type="date"> <input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_create_time" name="start_date" type="date">
<span class="fore-span margin-left-10">-</span> <span class="fore-span margin-left-10">-</span>
<input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_end_time" name="end_date" type="date"> <input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_end_time" name="end_date" type="date">
<span class="btn btn-primary btn3 search" id="maintable_search">搜索</span> <!--部门 门店 搜索 门店 经纪人 显示-->
<span class="btn btn-primary btn3" id="maintable_reset">重置</span> <!--二级联动-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id" >
<option value="">选择部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<div class="left-phone">
<input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="user_agent_name" placeholder="选择经纪人" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
<!--经纪人搜索 门店显示-->
<span class="btn btn-primary btn3 search left" id="maintable_search">搜索</span>
<span class="btn btn-primary btn3 left" id="maintable_reset">重置</span>
<!--<span class="btn btn-info btn3" id="maintable_export">导出excel</span>--> <!--<span class="btn btn-info btn3" id="maintable_export">导出excel</span>-->
</form> </form>
</td> </td>
......
...@@ -38,6 +38,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -38,6 +38,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索 main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索
file_id_str:'', file_id_str:'',
file_id_arr:[], file_id_arr:[],
agent_id_choose:'',
init: function() { init: function() {
//初始化dot //初始化dot
...@@ -99,9 +100,38 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -99,9 +100,38 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
document.getElementById("form_search").reset(); document.getElementById("form_search").reset();
$('#business_circle_id').html(''); $('#business_circle_id').html('');
business.agent_id_choose='';
}); });
_doc.on("input", "#dish_name", function() { //客户列表 客方员工姓名 下拉式搜索
if($("#dish_name").val() == '') {
business.agent_id_choose='';
$(".user-ul-agent").html('');
} else {
business.search_phone_agent();
}
});
_doc.delegate(".addphone-agent", "click", function() { //客户列表 客户员工 下拉式 搜索 点击li事件 获取id ul消失
business.addphoneAgent(this);
});
//部门 门店 二级联动
business.getDistrictPanFang(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id_panfang', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
business.getDistrictStoreListPanFang(_id, function(_data){
var _str = '<option value="">盘方门店</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
$('#modal-dujia').on('show.bs.modal', function () { $('#modal-dujia').on('show.bs.modal', function () {
business.showOrHideDujia(); business.showOrHideDujia();
}); });
...@@ -1129,11 +1159,16 @@ if(data.code == 200) { ...@@ -1129,11 +1159,16 @@ if(data.code == 200) {
params.disc = $('#shop_area_id').val(); //区域筛选 params.disc = $('#shop_area_id').val(); //区域筛选
params.business_id=$('#business_circle_id').val();//商圈筛选 params.business_id=$('#business_circle_id').val();//商圈筛选
params.industry_type = $('#yetai_id').val(); //业态筛选 params.industry_type = $('#yetai_id').val(); //业态筛选
params.dish_name = $('#dish_name').val(); //盘方姓名
params.dish_phone = $('#dish_phone').val(); //盘方手机号 params.dish_phone = $('#dish_phone').val(); //盘方手机号
params.landlord_phone = $('#landlord_phone').val(); //房东手机号 params.landlord_phone = $('#landlord_phone').val(); //房东手机号
params.start_date = $('#start_date').val(); //时间1 params.start_date = $('#start_date').val(); //时间1
params.end_date = $('#end_date').val(); //时间2 params.end_date = $('#end_date').val(); //时间2
params.dish_district_id = $('#district_id_panfang').val(); //盘方 部门 id
params.dish_store_id = $('#guest_stores_panfang').val(); //盘方 门店 id
params.dish_name = $('#dish_name').val(); //盘方姓名 下拉式
$.ajax({ $.ajax({
url: '/index/getHouseList.html', //获取列表 url: '/index/getHouseList.html', //获取列表
...@@ -1240,6 +1275,74 @@ if(data.code == 200) { ...@@ -1240,6 +1275,74 @@ if(data.code == 200) {
} }
}); });
}, },
getDistrictPanFang: function (fn) {//调用接口 产生列表 部门
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id_panfang").append(str);
fn && fn();
}
}
});
},
getDistrictStoreListPanFang: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
search_phone_agent: function() { //客户列表 客方员工 姓名的下拉式搜索
$.ajax({
url: '/index/getAgentsTohouses',
type: 'GET',
async: true,
data: {
"type":1,
"agent_id":$('#dish_name').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
user_ul += '<li class="addphone-agent" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul-agent").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
addphoneAgent: function(obj) {//客户列表 客方姓名 搜索 input赋值
var user_ht = $(obj).html();
$("#dish_name").val(user_ht);
$(".user-ul-agent").html('');
business.agent_id_choose = $(obj).attr("data-id");
},
//初始化 城市 //初始化 城市
initializationCityFunction: function(params) { initializationCityFunction: function(params) {
$.ajax({ $.ajax({
......
...@@ -20,6 +20,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -20,6 +20,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
order_id: '', order_id: '',
switchType:3, switchType:3,
district_store_agent_id:'', district_store_agent_id:'',
agent_id_choose:'',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template + template_tax); $(document.body).append(template + template_tax);
...@@ -28,6 +29,37 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -28,6 +29,37 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
$('.left-phone,#district_id,#guest_stores').hide();//初始化 隐藏 部门 门店的搜索
//二级联动
realtime.getDistrict(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
realtime.getDistrictStoreList(_id, function(_data){
var _str = '<option value="0">选择门店</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
_doc.on("input", "#user_agent_name", function() { //客户列表 客方员工姓名 下拉式搜索
if($("#user_agent_name").val() == '') {
realtime.agent_id_choose='';
$(".user-ul-agent").html('');
} else {
realtime.search_phone_agent();
}
});
_doc.delegate(".addphone-agent", "click", function() { //客户列表 客户员工 下拉式 搜索 点击li事件 获取id ul消失
realtime.addphoneAgent(this);
});
//主页面 部门业绩 门店业绩 个人业绩 三个tab的点击事件 //主页面 部门业绩 门店业绩 个人业绩 三个tab的点击事件
_doc.on('click', '.maintable-top-sub-tr>a', function(e){ _doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault(); e.preventDefault();
...@@ -35,6 +67,16 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -35,6 +67,16 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
var _this = $(this); var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default'); _this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
realtime.mainTabIndex = _this.index(); realtime.mainTabIndex = _this.index();
if(realtime.mainTabIndex == 0){
$('.left-phone,#district_id,#guest_stores').hide();
}
if(realtime.mainTabIndex == 1){
$('#district_id,#guest_stores').show();
$('.left-phone').hide();
};
if(realtime.mainTabIndex == 2){
$('.left-phone,#district_id,#guest_stores').show();
}
realtime.getList(1); realtime.getList(1);
}); });
//点击部门列表-参数初始化 //点击部门列表-参数初始化
...@@ -140,6 +182,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -140,6 +182,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
$("#maintable_reset").click(function() { $("#maintable_reset").click(function() {
document.getElementById("maintable_form_search").reset(); document.getElementById("maintable_form_search").reset();
realtime.is_today_yeji=0; realtime.is_today_yeji=0;
realtime.agent_id_choose='';
}); });
//部门-业绩-弹出框 //部门-业绩-弹出框
_doc.on('click', '.performance-number-details', function(e) { _doc.on('click', '.performance-number-details', function(e) {
...@@ -288,8 +331,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -288,8 +331,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
'pageSize': realtime.pageSize, 'pageSize': realtime.pageSize,
'start_day':$('#maintable_create_time').val(), 'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(), 'end_day':$('#maintable_end_time').val(),
// 'is_today':realtime.is_today_yeji,
}; };
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
...@@ -319,7 +360,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -319,7 +360,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
//不点击 搜索按钮 初始化时间 //不点击 搜索按钮 初始化时间
realtime.time_search_start=$('#maintable_create_time').val(); realtime.time_search_start=$('#maintable_create_time').val();
realtime.time_search_end=$('#maintable_end_time').val(); realtime.time_search_end=$('#maintable_end_time').val();
/*分页代码*/ /*分页代码 后端返回total 值*/
add_page(data.data.total, pageNo, realtime.pageSize, realtime.getList); add_page(data.data.total, pageNo, realtime.pageSize, realtime.getList);
} else { } else {
...@@ -880,7 +921,72 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -880,7 +921,72 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
} }
}); });
}, },
getDistrict : function (fn) {//调用接口 产生列表 部门
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
search_phone_agent: function() { //客户列表 客方员工 姓名的下拉式搜索
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#user_agent_name").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
user_ul += '<li class="addphone-agent" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul-agent").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
addphoneAgent: function(obj) {//客户列表 客方姓名 搜索 input赋值
var user_ht = $(obj).html();
$("#user_agent_name").val(user_ht);
$(".user-ul-agent").html('');
realtime.agent_id_choose = $(obj).attr("data-id");
},
bargaininfoShow: function() { //报告详情 bargaininfoShow: function() { //报告详情
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
......
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