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,27 +75,22 @@ define(['doT', 'text!temp/financial_daily_list_template_tpl.html', 'css!style/ho ...@@ -75,27 +75,22 @@ 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() { //列表选择城市
var _this = $(this); bargain.getDistrictList();
var _id = _this.val(); });
_this.next().html(''); //先清空 _doc.on('input', '[name=district_id]', function() {
//新增 编辑 var _this = $(this);
var _objTemp = _this.parent().next().find('select'); var _id = _this.val();
_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 = ''; $.each(_data, function(i, item) {
var _str = '<option value="">全部</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_objTemp.html(_str);
_this.next().html(_str);
}); });
} else {}; _this.next().html(_str);
}); });
} else {};
}); });
}, },
//获取一级审核,二级审核,三级审核不同的ajax请求url //获取一级审核,二级审核,三级审核不同的ajax请求url
...@@ -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,23 +18,25 @@ ...@@ -18,23 +18,25 @@
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(){ //列表选择城市
var _this = $(this); report.getDistrictList();
var _id = _this.val(); });
_this.next().html('');//先清空 _doc.on('input', '#district_id', function(){
if(_id && _id != '0'){ var _this = $(this);
report.getDistrictStoreList(_id, function(_data){ var _id = _this.val();
var _str = '<option value="">选择门店</option>'; _this.next().html('');//先清空
$.each(_data, function(i,item) { if(_id && _id != '0'){
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; report.getDistrictStoreList(_id, function(_data){
}); var _str = '<option value="">选择门店</option>';
_this.next().html(_str); $.each(_data, function(i,item) {
}); _str += '<option value="'+item.id+'">'+item.store_name+'</option>';
}else{ });
}; _this.next().html(_str);
}); });
}); }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,27 +150,31 @@ ...@@ -148,27 +150,31 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
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: {
dataType: 'json', "pageSize": 1000,
success: function (data) { "site_id": $('#district_id2_city').val()
if (data.code == 200 && data.data != null) {
var str = ''; },
$.each(data.data, function(i,item) { dataType: 'json',
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; success: function(data) {
}); if(data.code == 200 && data.data != null) {
$("#district_id").append(str); var str = '<option value="">选择部门</option>';
$("#district_id2").append(str); $.each(data.data, function(i, item) {
fn && fn(); str += '<option value="' + item.id + '">' + item.district_name + '</option>';
} });
} $('[name=district_id]').html(str);
}); $('#guest_stores').html('<option value="">选择门店</option>');
},
}
}
});
},
getDistrictStoreList: function(id, fn){ getDistrictStoreList: function(id, fn){
$.ajax ({ $.ajax ({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
......
...@@ -127,24 +127,23 @@ define(['doT', 'text!temp/open_check_template_tpl.html', 'css!style/home.css', ' ...@@ -127,24 +127,23 @@ 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(); if(_id && _id != '0') {
$('#commit_shop').html(''); //先清空 that.getDistrictStoreList(_id, function(_data) {
if(_id && _id != '0') { var _str = '<option value="">提交人所在门店</option>';
that.getDistrictStoreList(_id, function(_data) { $.each(_data, function(i, item) {
var _str = '<option value="0">全部</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
$('#commit_shop').append(_str)
}); });
} else {}; $('#commit_shop').html(_str)
}); });
} else {};
}); });
//点击li 列表消失 //点击li 列表消失
...@@ -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,23 +18,24 @@ ...@@ -18,23 +18,24 @@
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(){ //列表选择城市
var _this = $(this); report.getDistrictList();
var _id = _this.val(); });
_this.next().html('');//先清空 _doc.on('input', '#district_id', function(){
if(_id && _id != '0'){ var _this = $(this);
report.getDistrictStoreList(_id, function(_data){ var _id = _this.val();
var _str = '<option value="">选择门店</option>'; if(_id && _id != '0'){
$.each(_data, function(i,item) { report.getDistrictStoreList(_id, function(_data){
_str += '<option value="'+item.id+'">'+item.store_name+'</option>'; var _str = '<option value="">选择门店</option>';
}); $.each(_data, function(i,item) {
_this.next().html(_str); _str += '<option value="'+item.id+'">'+item.store_name+'</option>';
}); });
}else{ _this.next().html(_str);
}; });
}); }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,27 +149,31 @@ ...@@ -148,27 +149,31 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
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: {
dataType: 'json', "pageSize": 1000,
success: function (data) { "site_id": $('#district_id2_city').val()
if (data.code == 200 && data.data != null) {
var str = ''; },
$.each(data.data, function(i,item) { dataType: 'json',
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; success: function(data) {
}); if(data.code == 200 && data.data != null) {
$("#district_id").append(str); var str = '<option value="">选择部门</option>';
$("#district_id2").append(str); $.each(data.data, function(i, item) {
fn && fn(); str += '<option value="' + item.id + '">' + item.district_name + '</option>';
} });
} $('[name=district_id]').html(str);
}); $('#guest_stores').html('<option value="">选择门店</option>');
},
}
}
});
},
getDistrictStoreList: function(id, fn){ getDistrictStoreList: function(id, fn){
$.ajax ({ $.ajax ({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
......
...@@ -604,27 +604,23 @@ define(['doT', 'text!temp/reportList_shop_template_tpl.html', 'css!style/home.cs ...@@ -604,27 +604,23 @@ 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() { //列表选择城市
var _this = $(this); bargain.getDistrictList();
var _id = _this.val(); });
_this.next().html(''); //先清空 _doc.on('input', '[name=district_id]', function() {
//新增 编辑 var _this = $(this);
var _objTemp = _this.parent().next().find('select'); var _id = _this.val();
_objTemp.html(''); //先清空 if(_id && _id != '0') {
if(_id && _id != '0') { bargain.getDistrictStoreList(_id, function(_data) {
bargain.getDistrictStoreList(_id, function(_data) { var _str = '<option value="0">约带看人所在门店</option>';
// var _str = ''; $.each(_data, function(i, item) {
var _str = '<option value="0">全部</option>'; _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_objTemp.html(_str);
_this.next().html(_str);
}); });
} else {}; _this.next().html(_str);
});
});
} 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,24 +17,26 @@ ...@@ -17,24 +17,26 @@
}, },
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('');//先清空 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>'; $.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>'; });
}); _this.next().html(_str);
_this.next().html(_str); });
}); }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,27 +151,31 @@ ...@@ -149,27 +151,31 @@
} }
}); });
}, },
//调用部门 和 门店的接口 //获取城市所在部门
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: {
dataType: 'json', "pageSize": 1000,
success: function (data) { "site_id": $('#district_id2_city').val()
if (data.code == 200 && data.data != null) {
var str = ''; },
$.each(data.data, function(i,item) { dataType: 'json',
str += '<option value="'+item.id+'">'+item.district_name+'</option>'; success: function(data) {
}); if(data.code == 200 && data.data != null) {
$("#district_id").append(str); var str = '<option value="">选择部门</option>';
$("#district_id2").append(str); $.each(data.data, function(i, item) {
fn && fn(); str += '<option value="' + item.id + '">' + item.district_name + '</option>';
} });
} $('[name=district_id]').html(str);
}); $('#guest_stores').html('<option value="">选择门店</option>');
},
}
}
});
},
getDistrictStoreList: function(id, fn){ getDistrictStoreList: function(id, fn){
$.ajax ({ $.ajax ({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
......
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