Commit fe11a6d8 authored by agping's avatar agping

城市

parent ebf6a61d
...@@ -107,6 +107,14 @@ ...@@ -107,6 +107,14 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_time" name="end_date" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_time" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_address" placeholder="房源地址" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_address" placeholder="房源地址" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_num" placeholder="房源号" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_num" placeholder="房源号" type="text" value="">
<select class="form-control btn4 ld-Marheight" name="" id="district_id2_city">
<option value="">分佣方所在城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
<option value="10004">广州市</option>
<option value="10005">北京市</option>
</select>
<select name="district_id" class="form-control btn4 ld-Marheight"> <select name="district_id" class="form-control btn4 ld-Marheight">
<option value="">分佣方所属部门</option> <option value="">分佣方所属部门</option>
</select> </select>
......
...@@ -134,13 +134,21 @@ ...@@ -134,13 +134,21 @@
<option value="10">市场一部</option> <option value="10">市场一部</option>
<option value="20">市场二部</option> <option value="20">市场二部</option>
</select>--> </select>-->
<select class="form-control btn4 ld-Marheight" name="" id="district_id2_city">
<option value="">选择城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
<option value="10004">广州市</option>
<option value="10005">北京市</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="district_id" > <select class="form-control btn4 ld-Marheight input" name="" id="district_id" >
<option value="">部门名称</option> <option value="">部门名称</option>
</select> </select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value=""> <select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
<option value="">门店名称</option>
</select> </select>
<!--<select name="qx-store" class="form-control btn2 ld-Marheight" id="qx-store"> <!--<select name="qx-store" class="form-control btn2 ld-Marheight" id="qx-store">
<option value="" selected="selected">选择部门</option> <option value="" selected="selected">选择部门</option>
......
...@@ -93,6 +93,14 @@ ...@@ -93,6 +93,14 @@
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_internal_address" placeholder="房源地址" type="text" value=""> <input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_internal_address" placeholder="房源地址" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_shop_num" placeholder="房源编号" type="text" value=""> <input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_shop_num" placeholder="房源编号" type="text" value="">
<!--<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_user_phone" placeholder="客户电话" type="text" value="">--> <!--<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="maintable_user_phone" placeholder="客户电话" type="text" value="">-->
<select class="form-control btn4 ld-Marheight" name="" id="district_id2_city">
<option value="">分佣方所在城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
<option value="10004">广州市</option>
<option value="10005">北京市</option>
</select>
<select name="district_id" class="form-control btn4"> <select name="district_id" class="form-control btn4">
<option value="">分佣方所在部门</option> <option value="">分佣方所在部门</option>
</select> </select>
......
...@@ -149,10 +149,20 @@ ...@@ -149,10 +149,20 @@
<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">
<!--部门 门店 搜索 门店 经纪人 显示--> <!--部门 门店 搜索 门店 经纪人 显示-->
<!--二级联动--> <!--二级联动-->
<select class="form-control btn4 ld-Marheight" name="" id="district_id2_city">
<option value="">选择城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
<option value="10004">广州市</option>
<option value="10005">北京市</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="district_id" > <select class="form-control btn4 ld-Marheight input" name="" id="district_id" >
<option value="">选择部门</option> <option value="">选择部门</option>
</select> </select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value=""> <select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
<option value="">选择门店</option>
</select> </select>
<div class="left-phone"> <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=""> <input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="user_agent_name" placeholder="选择经纪人" type="text" value="">
......
...@@ -87,28 +87,23 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', ' ...@@ -87,28 +87,23 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
$("#export").click(function() { //导出列表 $("#export").click(function() { //导出列表
bargain.exportList(); bargain.exportList();
}); });
$(document).on("input", "#district_id2_city", function() { //点击城市
bargain.getDistrict();
});
//分佣方 所属部门 门店 筛选 //分佣方 所属部门 门店 筛选
bargain.getDistrict(function() {
_doc.on('input', '[name=district_id],#district_id2', function() { _doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
if(_id && _id != '0') { if(_id && _id != '0') {
bargain.getDistrictStoreList(_id, function(_data) { bargain.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="">全部</option>'; var _str = '<option value="">分佣方所属门店</option>';
$.each(_data, function(i, item) { $.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
}); });
_objTemp.html(_str);
_this.next().html(_str); _this.next().html(_str);
}); });
} else {}; } else {};
}); });
});
//分佣方 姓名下拉式 //分佣方 姓名下拉式
$(document).on("input", "#partical_name", function() { //手机号新增搜索客方 $(document).on("input", "#partical_name", function() { //手机号新增搜索客方
if($("#partical_name").val() == '') { if($("#partical_name").val() == '') {
...@@ -257,6 +252,12 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', ' ...@@ -257,6 +252,12 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
params.partial_id = bargain.agent_id_phone;//分佣方姓名 下拉式 搜索 params.partial_id = bargain.agent_id_phone;//分佣方姓名 下拉式 搜索
params.district_id = $("select[name='district_id'] option:selected").val();//部门 params.district_id = $("select[name='district_id'] option:selected").val();//部门
params.store_id = $("select[name='store_id'] option:selected").val();//门店 params.store_id = $("select[name='store_id'] option:selected").val();//门店
if($("#district_id2_city").val()){
if(!$("name[district_id]").val()){
alert('请选择部门进行搜索');
return
}
}
$.ajax({ $.ajax({
url: bargain.listUrl, //获取列表 url: bargain.listUrl, //获取列表
type: 'GET', type: 'GET',
...@@ -293,25 +294,25 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', ' ...@@ -293,25 +294,25 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'css!style/home.css', '
window.open(bargain.exportUrl + '?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&partial_id=' + partial_id + '&district_id=' + district_id + '&house_number=' + house_number + '&bargain_id=' + bargain_id + '&store_id=' + store_id); window.open(bargain.exportUrl + '?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&partial_id=' + partial_id + '&district_id=' + district_id + '&house_number=' + house_number + '&bargain_id=' + bargain_id + '&store_id=' + store_id);
}, },
getDistrict: function(fn) { getDistrict: function() {
$.ajax({ $.ajax({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: { data: {
"pageSize": 1000 "pageSize": 1000,
"site_id": $('#district_id2_city').val()
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
var str = ''; var str = '<option value="">分佣方所在部门</option>';
$.each(data.data, function(i, item) { $.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>'; str += '<option value="' + item.id + '">' + item.district_name + '</option>';
}); });
$('[name=district_id]').append(str); $('[name=district_id]').html(str);
$('#district_id2').append(str);
fn && fn();
} }
} }
}); });
......
...@@ -79,15 +79,15 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -79,15 +79,15 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
business.getDistrict(function(){ $(document).on("input", "#district_id2_city", function() { //点击城市
business.getDistrict();
});
_doc.on('input', '#district_id, #district_id2', function(){ _doc.on('input', '#district_id, #district_id2', function(){
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){ if(_id && _id != '0'){
business.getDistrictStoreList(_id, function(_data){ business.getDistrictStoreList(_id, function(_data){
// var _str = ''; var _str = '<option value="">门店名称</option>';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i,item) { $.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; _str += '<option value="'+item.id+'">'+item.store_name+'</option>';
}); });
...@@ -96,7 +96,6 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -96,7 +96,6 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
}else{ }else{
}; };
}); });
});
//商铺 办公楼切换 //商铺 办公楼切换
_doc.on('click', '.maintable-top-sub-tr>a', function(e){ _doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault(); e.preventDefault();
...@@ -494,22 +493,27 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs ...@@ -494,22 +493,27 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
}); });
}, },
//调用部门 和 门店的接口 //调用部门 和 门店的接口
getDistrict : function (fn) { getDistrict : function () {
$.ajax ({ $.ajax ({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"pageSize":1000}, data: {
"pageSize":1000,
"site_id": $('#district_id2_city').val()
},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200 && data.data != null) { if (data.code == 200 && data.data != null) {
var str = ''; var str = '<option value="">部门名称</option>';
$.each(data.data, function(i,item) { $.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; str += '<option value="'+item.id+'">'+item.district_name+'</option>';
}); });
$("#district_id").append(str); $('#district_id').html(str);
$("#district_id2").append(str);
fn && fn();
} }
} }
}); });
......
...@@ -104,28 +104,23 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r ...@@ -104,28 +104,23 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r
}); });
var _doc = $(document); var _doc = $(document);
bargain.getDistrict(function() { $(document).on("input", "#district_id2_city", function() { //点击城市
bargain.getDistrict();
});
_doc.on('input', '[name=district_id],#district_id2', function() { _doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
if(_id && _id != '0') { if(_id && _id != '0') {
bargain.getDistrictStoreList(_id, function(_data) { bargain.getDistrictStoreList(_id, function(_data) {
// var _str = ''; var _str = '<option value="">分佣方所在门店</option>';
var _str = '<option value="">全部</option>';
$.each(_data, function(i, item) { $.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
}); });
_objTemp.html(_str);
_this.next().html(_str); _this.next().html(_str);
}); });
} else {}; } else {};
}); });
});
}, },
getDepart: function(s, fn){ getDepart: function(s, fn){
$.ajax({ $.ajax({
...@@ -332,6 +327,12 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r ...@@ -332,6 +327,12 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r
'phone': $.trim($('#agent_phone').val()), 'phone': $.trim($('#agent_phone').val()),
'bargain_id' : $.trim($('#bargain_id').val()), 'bargain_id' : $.trim($('#bargain_id').val()),
}; };
if($("#district_id2_city").val()){
if(!$("name[district_id]").val()){
alert('请选择部门进行搜索');
return
}
}
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: bargain.listUrl, //获取业绩明细列表 url: bargain.listUrl, //获取业绩明细列表
...@@ -365,25 +366,25 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r ...@@ -365,25 +366,25 @@ define(['doT','text!temp/performance_subsidiary_template_tpl.html', 'text!temp/r
} }
}); });
}, },
getDistrict: function(fn) { getDistrict: function() {
$.ajax({ $.ajax({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: { data: {
"pageSize": 1000 "pageSize": 1000,
"site_id": $('#district_id2_city').val()
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
var str = ''; var str = '<option value="">分佣方所在部门</option>';
$.each(data.data, function(i, item) { $.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>'; str += '<option value="' + item.id + '">' + item.district_name + '</option>';
}); });
$('[name=district_id]').append(str); $("[name=district_id]").html(str);
$('#district_id2').append(str);
fn && fn();
} }
} }
}); });
......
...@@ -34,12 +34,14 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -34,12 +34,14 @@ 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();//初始化 隐藏 部门 门店的搜索 $('.left-phone,#district_id,#guest_stores,#district_id2_city').hide();//初始化 隐藏 部门 门店的搜索
$('#district_id').val('');//置空 部门 id $('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id $('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空 realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
$(document).on("input", "#district_id2_city", function() { //点击城市
realtime.getDistrict();
});
//二级联动 //二级联动
realtime.getDistrict(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id', function(){ _doc.on('input', '#district_id', function(){
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
...@@ -55,7 +57,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -55,7 +57,6 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
}else{ }else{
}; };
}); });
});
//城市 筛选 //城市 筛选
_doc.on('input', '#realtime_city_choose', function() { _doc.on('input', '#realtime_city_choose', function() {
realtime.getList(); realtime.getList();
...@@ -114,13 +115,13 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -114,13 +115,13 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
_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){ if(realtime.mainTabIndex == 0){
$('.left-phone,#district_id,#guest_stores').hide(); $('.left-phone,#district_id,#guest_stores,#district_id2_city').hide();
$('#district_id').val('');//置空 部门 id $('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id $('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空 realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
} }
if(realtime.mainTabIndex == 1){ if(realtime.mainTabIndex == 1){
$('#district_id,#guest_stores').show(); $('#district_id,#guest_stores,#district_id2_city').show();
$('.left-phone').hide(); $('.left-phone').hide();
$('#district_id').val('');//置空 部门 id $('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id $('#guest_stores').val('');//置空 门店id
...@@ -128,7 +129,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -128,7 +129,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
}; };
if(realtime.mainTabIndex == 2){ if(realtime.mainTabIndex == 2){
$('.left-phone,#district_id,#guest_stores').show(); $('.left-phone,#district_id,#guest_stores,#district_id2_city').show();
$('#district_id').val('');//置空 部门 id $('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id $('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空 realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
...@@ -468,6 +469,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -468,6 +469,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
'site_id':$('#realtime_city_choose').val() 'site_id':$('#realtime_city_choose').val()
}; };
if($("#district_id2_city").val()){
if(!$("#district_id").val()){
alert('请选择部门进行搜索');
return
}
}
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: realtime.switchUrl(), url: realtime.switchUrl(),
...@@ -1165,21 +1172,25 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r ...@@ -1165,21 +1172,25 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
} }
}); });
}, },
getDistrict : function (fn) {//调用接口 产生列表 部门 getDistrict : function () {//调用接口 产生列表 部门
$.ajax ({ $.ajax ({
url: '/index/getDistrict', url: '/index/getDistrict',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"pageSize":1000}, data: {
"pageSize":1000,
"site_id": $('#district_id2_city').val()
},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200 && data.data != null) { if (data.code == 200 && data.data != null) {
var str = ''; var str = '<option value="">选择部门</option>';
$.each(data.data, function(i,item) { $.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; str += '<option value="'+item.id+'">'+item.district_name+'</option>';
}); });
$("#district_id").append(str); $("#district_id").html(str);
fn && fn(); $('#guest_stores').html('<option value="">选择门店</option>');
} }
} }
}); });
......
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