Commit cc873269 authored by agping's avatar agping

城市部门

parent dbf106e6
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
<option value="10001">上海市</option> <option value="10001">上海市</option>
<option value="10002">杭州市</option> <option value="10002">杭州市</option>
<option value="10003">深圳市</option> <option value="10003">深圳市</option>
<option value="10004">广州市</option>
<option value="10005">北京市</option>
</select> </select>
<span class="fore-span margin-left-10">提交时间:</span> <span class="fore-span margin-left-10">提交时间:</span>
...@@ -94,6 +96,14 @@ ...@@ -94,6 +96,14 @@
<option value="0">我未审核过</option> <option value="0">我未审核过</option>
</select> </select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="financial_id" placeholder="财务日报ID" type="text" value=""> <input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="financial_id" placeholder="财务日报ID" 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>
......
...@@ -353,6 +353,15 @@ ...@@ -353,6 +353,15 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="order_id" placeholder="带看订单ID" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="order_id" placeholder="带看订单ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_id" placeholder="商铺ID" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_id" placeholder="商铺ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_address" placeholder="商铺地址" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_address" 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 class="form-control btn2 ld-Marheight" id="commit_home"> <select class="form-control btn2 ld-Marheight" id="commit_home">
<option value="">提交人所在部门</option> <option value="">提交人所在部门</option>
</select> </select>
......
...@@ -229,6 +229,16 @@ ...@@ -229,6 +229,16 @@
<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>
......
...@@ -84,10 +84,19 @@ ...@@ -84,10 +84,19 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn2 input 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>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
...@@ -84,10 +84,19 @@ ...@@ -84,10 +84,19 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn2 input 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>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
...@@ -84,10 +84,19 @@ ...@@ -84,10 +84,19 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn2 input 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>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
...@@ -812,6 +812,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -812,6 +812,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.group_name = $("input[name='groupname']").val(); params.group_name = $("input[name='groupname']").val();
params.district_id = $("#district_id2").val(); params.district_id = $("#district_id2").val();
params.store_id = $("#guest_stores").val(); params.store_id = $("#guest_stores").val();
// params.site_id = $("#district_id2_city").val();//站点筛选
params.status = $("select[name=agent_status]").val(); params.status = $("select[name=agent_status]").val();
$.ajax({ $.ajax({
url: '/index/AgentList', url: '/index/AgentList',
...@@ -1012,6 +1013,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -1012,6 +1013,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
str += '<option value="' + item.id + '">' + item.district_name + '</option>'; str += '<option value="' + item.id + '">' + item.district_name + '</option>';
}); });
$('#district_id2').html(str); $('#district_id2').html(str);
$('#guest_stores').html('<option value="">选择门店</option>');
} }
} }
}); });
......
...@@ -75,28 +75,23 @@ define(['doT', 'text!temp/financial_daily_list_template_tpl.html', 'css!style/ho ...@@ -75,28 +75,23 @@ define(['doT', 'text!temp/financial_daily_list_template_tpl.html', 'css!style/ho
bargain.agent_id_phone=''; bargain.agent_id_phone='';
}); });
var _doc = $(document); var _doc = $(document);
bargain.getDistrict(function() { $(document).on("input", "#district_id2_city", function() { //点击城市
_doc.on('input', '[name=district_id],#district_id2', function() { //列表选择城市
bargain.getDistrictList();
});
_doc.on('input', '[name=district_id]', 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 {};
}); });
});
}, },
//获取一级审核,二级审核,三级审核不同的ajax请求url //获取一级审核,二级审核,三级审核不同的ajax请求url
switchStatus: function(){ switchStatus: function(){
...@@ -186,14 +181,39 @@ define(['doT', 'text!temp/financial_daily_list_template_tpl.html', 'css!style/ho ...@@ -186,14 +181,39 @@ define(['doT', 'text!temp/financial_daily_list_template_tpl.html', 'css!style/ho
$.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]').append(str);
$('#district_id2').append(str); // $('#district_id2').append(str);
fn && fn(); fn && fn();
} }
} }
}); });
}, },
//获取城市所在部门
getDistrictList: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000,
"site_id": $('#district_id2_city').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '<option value="">提交人所在部门</option>';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$('[name=district_id]').html(str);
$('[name=store_id]').html('<option value="">提交人所在门店</option>');
}
}
});
},
//统计 //统计
getListTotal: function() { getListTotal: function() {
$.ajax({ $.ajax({
......
...@@ -18,8 +18,11 @@ ...@@ -18,8 +18,11 @@
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
//二级联动 //二级联动
report.getDistrict(function(){ $(document).on("input", "#district_id2_city", function() { //点击城市
_doc.on('input', '#district_id, #district_id2', function(){ //列表选择城市
report.getDistrictList();
});
_doc.on('input', '#district_id', function(){
var _this = $(this); var _this = $(this);
var _id = _this.val(); var _id = _this.val();
_this.next().html('');//先清空 _this.next().html('');//先清空
...@@ -34,7 +37,6 @@ ...@@ -34,7 +37,6 @@
}else{ }else{
}; };
}); });
});
//业绩图片 显示 //业绩图片 显示
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
$('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img")); $('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img"));
...@@ -148,23 +150,27 @@ ...@@ -148,23 +150,27 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
getDistrict : function (fn) { getDistrictList: function(fn) {
$.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); $('[name=district_id]').html(str);
$("#district_id2").append(str); $('#guest_stores').html('<option value="">选择门店</option>');
fn && fn();
} }
} }
}); });
......
...@@ -127,25 +127,24 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', ' ...@@ -127,25 +127,24 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#check_yes',function(e){ $(document).on('click','#check_yes',function(e){
that.checkRefund(); that.checkRefund();
}); });
$(document).on("input", "#district_id2_city", function() { //点击城市
//列表选择城市
refund.getDistrictList();
});
//二级联动 //二级联动
that.getDistrict(function() {
_doc.on('input', '#commit_home', function() { _doc.on('input', '#commit_home', function() {
var _this = $(this); var _this = $(this);
var _id = $('#commit_home').val(); var _id = $('#commit_home').val();
$('#commit_shop').html(''); //先清空
if(_id && _id != '0') { if(_id && _id != '0') {
that.getDistrictStoreList(_id, function(_data) { that.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="0">全部</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>';
}); });
$('#commit_shop').append(_str) $('#commit_shop').html(_str)
}); });
} else {}; } else {};
}); });
});
//点击li 列表消失 //点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失 $(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
...@@ -386,7 +385,7 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', ' ...@@ -386,7 +385,7 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', '
$.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>';
}); });
$('#commit_home').append(str); // $('#commit_home').append(str);
fn && fn(); fn && fn();
} else { } else {
alert(data.msg) alert(data.msg)
...@@ -394,6 +393,32 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', ' ...@@ -394,6 +393,32 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', '
} }
}); });
}, },
//获取城市所在部门
getDistrictList: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000,
"site_id": $('#district_id2_city').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '<option value="">提交人所在部门</option>';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
// $('[name=district_id]').html(str);
$('#commit_home').html(str);
$('#commit_shop').html('<option value="">提交人所在门店</option>');
}
}
});
},
getDistrictStoreList: function(id, fn) { getDistrictStoreList: function(id, fn) {
$.ajax({ $.ajax({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
......
...@@ -18,11 +18,13 @@ ...@@ -18,11 +18,13 @@
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
//二级联动 //二级联动
report.getDistrict(function(){ $(document).on("input", "#district_id2_city", function() { //点击城市
_doc.on('input', '#district_id, #district_id2', function(){ //列表选择城市
report.getDistrictList();
});
_doc.on('input', '#district_id', 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'){
report.getDistrictStoreList(_id, function(_data){ report.getDistrictStoreList(_id, function(_data){
var _str = '<option value="">选择门店</option>'; var _str = '<option value="">选择门店</option>';
...@@ -34,7 +36,6 @@ ...@@ -34,7 +36,6 @@
}else{ }else{
}; };
}); });
});
//业绩图片 显示 //业绩图片 显示
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
$('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img")); $('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img"));
...@@ -148,23 +149,27 @@ ...@@ -148,23 +149,27 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
getDistrict : function (fn) { getDistrictList: function(fn) {
$.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); $('[name=district_id]').html(str);
$("#district_id2").append(str); $('#guest_stores').html('<option value="">选择门店</option>');
fn && fn();
} }
} }
}); });
......
...@@ -604,28 +604,24 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs ...@@ -604,28 +604,24 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs
}); });
var _doc = $(document); var _doc = $(document);
bargain.getDistrict(function() { $(document).on("input", "#district_id2_city", function() { //点击城市
_doc.on('input', '[name=district_id],#district_id2', function() { //列表选择城市
bargain.getDistrictList();
});
_doc.on('input', '[name=district_id]', 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="0">约带看人所在门店</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>';
}); });
_objTemp.html(_str);
_this.next().html(_str); _this.next().html(_str);
}); });
} else {}; } else {};
}); });
});
//收款详情页面 //收款详情页面
$(document).on('click','.add-pic',function(e){ $(document).on('click','.add-pic',function(e){
// 初始化界面 // 初始化界面
...@@ -2447,7 +2443,7 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs ...@@ -2447,7 +2443,7 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs
$.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]').append(str);
$('#district_id2').append(str); $('#district_id2').append(str);
fn && fn(); fn && fn();
...@@ -2455,6 +2451,33 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs ...@@ -2455,6 +2451,33 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs
} }
}); });
}, },
//获取城市所在部门
getDistrictList: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000,
"site_id": $('#district_id2_city').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
// var str = '';
var str = '<option value="">约带看人所在部门</option>';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
// $('#district_id2').html(str);
$('[name=district_id]').html(str);
$('[name=store_id]').html('<option value="">约带看人所在门店</option>');//置空门店
}
}
});
},
getDistrictStoreList: function(id, fn) { getDistrictStoreList: function(id, fn) {
$.ajax({ $.ajax({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
......
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
$(document).on("input", "#district_id2_city", function() { //点击城市
//列表选择城市
report.getDistrictList();
});
//二级联动 //二级联动
report.getDistrict(function(){ _doc.on('input', '#district_id', 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('');//先清空 _this.next().html('');//先清空
...@@ -34,7 +37,6 @@ ...@@ -34,7 +37,6 @@
}else{ }else{
}; };
}); });
});
//业绩图片 显示 //业绩图片 显示
$ (document).delegate (".review-images", "click", function () {//提交 $ (document).delegate (".review-images", "click", function () {//提交
$('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img")); $('.review-images2').attr('src', ServerHostImageLiu + '/static/week_work_img/' + $(this).attr ("data-img"));
...@@ -149,23 +151,27 @@ ...@@ -149,23 +151,27 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
getDistrict : function (fn) { getDistrictList: function(fn) {
$.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); $('[name=district_id]').html(str);
$("#district_id2").append(str); $('#guest_stores').html('<option value="">选择门店</option>');
fn && fn();
} }
} }
}); });
......
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