Commit 02894097 authored by agping's avatar agping

收款记录 加城市 部门 门店

parent 6d0c16ff
...@@ -456,6 +456,16 @@ ...@@ -456,6 +456,16 @@
<select class="form-control ld-Marheight user_city_choose_site_list" id="city"> <select class="form-control ld-Marheight user_city_choose_site_list" id="city">
</select> </select>
</div>--> </div>-->
<div class="form-group">
<select class="form-control 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>
</div>
<div class="form-group"> <div class="form-group">
<select class="form-control ld-Marheight" id="commit_home"> <select class="form-control ld-Marheight" id="commit_home">
<option value="">提交人所在部门</option> <option value="">提交人所在部门</option>
......
...@@ -786,22 +786,23 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -786,22 +786,23 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
$(this).parent().parent().remove(); $(this).parent().parent().remove();
}); });
$(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(); 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 {};
}); });
//分佣方 姓名下拉式 //分佣方 姓名下拉式
...@@ -1117,8 +1118,31 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -1117,8 +1118,31 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
} }
}); });
}, },
//获取城市所在部门
getDistrictStoreList: function(id, 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>';
});
$('#commit_home').html(str);
$('#commit_shop').html('<option value="">提交人所在门店</option>');
}
}
});
},
//获取城市所在部门的门店
getDistrictStoreList: function(id, fn) {
$.ajax({ $.ajax({
url: '/index/getDistrictStoreList', url: '/index/getDistrictStoreList',
type: 'GET', type: 'GET',
...@@ -1132,7 +1156,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -1132,7 +1156,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
if(data.code == 200 && data.data != null) { if(data.code == 200 && data.data != null) {
fn && fn(data.data); fn && fn(data.data);
} else { } else {
alert(data.msg); alert(data.msg)
} }
} }
}); });
...@@ -1612,6 +1636,12 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -1612,6 +1636,12 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
var params = that.buildSearchParams(false); var params = that.buildSearchParams(false);
params.pageNo = that.pageNo; params.pageNo = that.pageNo;
params.pageSize = that.pageSize ; params.pageSize = that.pageSize ;
if($("#district_id2_city").val()){
if(!$("#commit_home").val()){
alert('请选择部门进行搜索');
return
}
}
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/getCollection', url: '/index/getCollection',
......
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