Commit a9170351 authored by agping's avatar agping

城市筛选

parent 8747ee8b
......@@ -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="comit_name" placeholder="提交人姓名" type="text" value="">
<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">
<option value="">提交人所在部门</option>
</select>
......
......@@ -311,22 +311,23 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#export',function(e){
that.exportExcel();
});
$(document).on("input", "#district_id2_city", function() { //点击城市
//列表选择城市
that.getDistrictList();
});
//二级联动
that.getDistrict(function() {
_doc.on('input', '#commit_home', function() {
var _this = $(this);
var _id = $('#commit_home').val();
$('#commit_shop').html(''); //先清空
if(_id && _id != '0') {
that.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
$('#commit_shop').append(_str)
_doc.on('input', '#commit_home', function() {
var _this = $(this);
var _id = $('#commit_home').val();
if(_id && _id != '0') {
that.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="">提交人所在门店</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
} else {};
});
$('#commit_shop').html(_str)
});
} else {};
});
//点击li 列表消失
......@@ -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) {
$.ajax({
url: '/index/getDistrictStoreList',
......@@ -956,6 +983,7 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
//收款人 置空
$('#comit_store_pay').val('');
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