Commit a9170351 authored by agping's avatar agping

城市筛选

parent 8747ee8b
...@@ -206,6 +206,15 @@ ...@@ -206,6 +206,15 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="cost_id" placeholder="费用报销ID" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="cost_id" placeholder="费用报销ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="提交人姓名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="提交人姓名" type="text" value="">
<ul class="user-ul" style="display:none"></ul> <ul class="user-ul" style="display:none"></ul>
<!--城市-->
<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>
......
...@@ -311,23 +311,24 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', ' ...@@ -311,23 +311,24 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#export',function(e){ $(document).on('click','#export',function(e){
that.exportExcel(); that.exportExcel();
}); });
$(document).on("input", "#district_id2_city", function() { //点击城市
//列表选择城市
that.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="">全部</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消失
...@@ -723,6 +724,32 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', ' ...@@ -723,6 +724,32 @@ define(['doT', 'text!temp/cost_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',
...@@ -956,6 +983,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', ' ...@@ -956,6 +983,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
//收款人 置空 //收款人 置空
$('#comit_store_pay').val(''); $('#comit_store_pay').val('');
cost.agent_id_store_pay=''; cost.agent_id_store_pay='';
$('#district_id2_city').val("");
}, },
//重置搜索条件 //重置搜索条件
......
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