Commit 02894097 authored by agping's avatar agping

收款记录 加城市 部门 门店

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