Commit eb0691b7 authored by agping's avatar agping

商圈 筛选

parent 7d15a014
...@@ -173,6 +173,9 @@ ...@@ -173,6 +173,9 @@
<select class="form-control btn2" id="shop_area_id"> <select class="form-control btn2" id="shop_area_id">
<option value="" selected="selected">区域</option> <option value="" selected="selected">区域</option>
</select> </select>
<select class="form-control btn2" id="business_circle_id">
<option value="" selected="selected">商圈</option>
</select>
<select class="form-control btn2" id="shop_type"> <select class="form-control btn2" id="shop_type">
<option value="-1">商铺类型</option> <option value="-1">商铺类型</option>
<option value="0">商场</option> <option value="0">商场</option>
......
...@@ -276,13 +276,40 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -276,13 +276,40 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
$('#user_area_choose').html(''); //先清空 $('#user_area_choose').html(''); //先清空
if(_id && _id != '0') { if(_id && _id != '0') {
business.getDistrictStoreList(_id, function(_data) { business.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="">区域</option>'; var _str = '<option value="">区域</option>';
$.each(_data, function(i, item) { $.each(_data, function(i, item) {
_str += '<option value="' + item.fullName + '">' + item.fullName + '</option>'; _str += '<option value="' + item.fullName + '">' + item.fullName + '</option>';
}); });
$('#shop_area_id').html(_str); $('#shop_area_id').html(_str);
business.getList();
});
} else {};
});
//点击 区域 获取 商圈
_doc.on('input', '#shop_area_id', function() {
var _this = $(this);
var _id = _this.val();
var _province=$('#user_city_choose').val();
var _city=$('#shop_area_id').val();
if(_province == 310100){
_province='上海市';
_city='上海市';
};
if(_province == 330100){
_province='浙江省';
_city='杭州市';
};
$('#user_area_choose').html(''); //先清空
if(_id && _id != '0') {
business.getBusinessCircle(_id, _province,_city,function(_data) {
var _str = '<option value="">商圈</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.name + '</option>';
});
$('#business_circle_id').html(_str);
business.getList();
}); });
} else {}; } else {};
}); });
...@@ -529,7 +556,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -529,7 +556,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
if(_limitTop && (_fileNum < _limitTop)) { if(_limitTop && (_fileNum < _limitTop)) {
var formData = new FormData(); var formData = new FormData();
formData.append('type', 'business_school_file'); formData.append('type', 'exclusive_file');
formData.append('image', _this[0].files[0]); formData.append('image', _this[0].files[0]);
console.log(formData); console.log(formData);
$.ajax({ $.ajax({
...@@ -650,7 +677,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -650,7 +677,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
console.log(file_paths[i]['file_name']) console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/'); var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({ file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'], '0': file_paths[i]['file_name'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])) '1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
})); }));
}; };
...@@ -1047,6 +1074,7 @@ if(data.code == 200) { ...@@ -1047,6 +1074,7 @@ if(data.code == 200) {
params.city = '杭州市' ; params.city = '杭州市' ;
} }
params.disc = $('#shop_area_id').val(); //区域筛选 params.disc = $('#shop_area_id').val(); //区域筛选
params.business_id=$('#shop_area_id').val()//商圈筛选
params.industry_type = $('#yetai_id').val(); //业态筛选 params.industry_type = $('#yetai_id').val(); //业态筛选
params.dish_name = $('#dish_name').val(); //盘方姓名 params.dish_name = $('#dish_name').val(); //盘方姓名
params.dish_phone = $('#dish_phone').val(); //盘方手机号 params.dish_phone = $('#dish_phone').val(); //盘方手机号
...@@ -1130,6 +1158,26 @@ if(data.code == 200) { ...@@ -1130,6 +1158,26 @@ if(data.code == 200) {
} }
} }
}); });
},
//商圈 筛选
getBusinessCircle: function(id,province,city,fn) {
$.ajax({
url: '/index/getBusinessAll',
type: 'GET',
async: true,
data: {
'province': province,
'city': city,
'disc': id
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}, },
delBusiness: function() { delBusiness: function() {
$.ajax({ $.ajax({
......
...@@ -44,6 +44,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -44,6 +44,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
customerInfo: {}, customerInfo: {},
all_custom : true , // true :所有客户 ,false :当前客户 all_custom : true , // true :所有客户 ,false :当前客户
main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索 main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索
user_status:'',
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
...@@ -101,6 +102,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -101,6 +102,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
var day_start = getPreMonth(day_end); var day_start = getPreMonth(day_end);
$('#start_date').val(day_start); $('#start_date').val(day_start);
$('#end_date').val(day_end);//客户列表 进来 默认时间 一个月 $('#end_date').val(day_end);//客户列表 进来 默认时间 一个月
//默认 筛选求租客户
$("select[name=public_status]").val('0');
user.getList(); user.getList();
user.event(); user.event();
//新增 默认上海 //新增 默认上海
...@@ -111,6 +114,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -111,6 +114,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}); });
$('#user_area_add').html(_str); $('#user_area_add').html(_str);
}); });
//汉化实现 //汉化实现
;(function($){ ;(function($){
...@@ -162,6 +166,17 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -162,6 +166,17 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
}); });
//点击 无效
_doc.on('click', '.is_invalid', function(e) {
e.preventDefault();
e.stopPropagation();
user.user_id = $(this).attr("data-id");
user.user_status = $(this).attr("data-status");
$(this).attr('class', 'btn1 btn-default is_invalid');
if(user.user_status*1 != -1){
user.isInvalid();
}
});
//收藏 取消收藏 //收藏 取消收藏
$(document).delegate(".is_show", "click", function() { //点击收藏 取消收藏 $(document).delegate(".is_show", "click", function() { //点击收藏 取消收藏
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
...@@ -1589,7 +1604,24 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind ...@@ -1589,7 +1604,24 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
} }
}); });
}, },
//客户列表 无效 修改
isInvalid: function() {
checkLogin();
$.ajax({
url:'/index/updateUserStatus',
type: 'POST',
async: true,
data: {
"user_id": user.user_id,
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
}
}
});
},
//筛选 //筛选
getList: function(pageNo) { getList: function(pageNo) {
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存 var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
......
<script id="user_list_tpl" type="text/template"> <script id="user_list_tpl" type="text/template">
[% var sw=function(s){switch(Number(s)){case 2:return"btn-info";case 1:return"btn-default"}}; %] [% var sw=function(s){switch(Number(s)){case 2:return"btn-info";case 1:return"btn-default"}}; %]
[% var sw3=function(s){switch(Number(s)){case 0:return"btn-info";case 1:return"btn-info";case -1:return"btn-default"}}; %]
[% if(it[0]) { %] [% for(var item in it){ %] [% if(it[0]) { %] [% for(var item in it){ %]
<tr class="text-center"> <tr class="text-center">
<td>[%= it[item]['id'] %]</td> <td>[%= it[item]['id'] %]</td>
...@@ -59,6 +61,8 @@ ...@@ -59,6 +61,8 @@
<a class="btn1 btn-success caozuo cao-zuo-record" href="#modal-record-edit" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>客户编辑</a> <a class="btn1 btn-success caozuo cao-zuo-record" href="#modal-record-edit" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>客户编辑</a>
[% } %] [% } %]
<a class="btn1 is_invalid [%= sw3(it[item]['user_status']) %]" href="" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["user_status"] %]'>无效</a>
[% } %] [% } %]
</td> </td>
</tr> </tr>
......
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