Commit 9065c8f1 authored by hujun's avatar hujun

客户列表部门改为select和经纪人编辑去除区域id

parent e9759ab9
......@@ -92,7 +92,7 @@ class Agent extends Basic
}
$field = "a.id,a.store_id,a.district_id,a.`level`,a.`name`,a.phone,a.`status`,a.inviter_id,a.create_time,
ifnull(s.store_name,'')store_name,ifnull(d.district_name,'')district_name,ifnull(g.title,'无')groupname";
$order = 'a.id asc';
$order = 'a.id DESC';
$join = [
['a_store s', ' a.store_id=s.id','left'],
['a_district d','a.district_id=d.id','left'],
......@@ -136,6 +136,13 @@ class Agent extends Basic
if($table->repetition('phone',$data['phone']) && empty($id)) {
return $this->response(100, '存在重复值');
}
if (empty($this->params['store_id'])) {
return $this->response(100, '门店id为空!');
}
$store = new AStore();
$data['district_id'] = $store->getStoreKeyById('district_id', ['id'=>$this->params['store_id']]);
$data['password'] = md5(substr($data['phone'], -6));
if ($table->editData($data,$id)) {
return $this->response(200, '成功');
......
......@@ -124,4 +124,27 @@ class District extends Basic
return $this->response($data['status'], $data['msg'], $data['data']);
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getList() {
$data['status'] = 200;
$data['data'] = '';
$data['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$agents = new ADistrict();
$where = [];
$field = 'id,district_name';
$where['status'] = 0;
$data['data'] = $agents->getList($pageNo, $pageSize, 'id DESC', $field, $where);
return $this->response($data['status'], $data['msg'], $data['data']);
}
}
\ No newline at end of file
......@@ -171,9 +171,8 @@ class Member extends Basic{
$type = 3;
}
if (!empty($params['district_name'])) {
$district = new ADistrict();
$where['b.district_id'] = $district->getDistrictKeyById('id', ['district_name'=>$params['district_name']]);
if (!empty($params['district_id']) && $params['district_id'] != -1) {
$where['b.district_id'] = $params['district_id'];
$type = 3;
}
......
......@@ -45,7 +45,8 @@ class Basic extends Controller
'index/bannerList',
'index/getLabelsList',
'index/regions',
'index/getAuth2'
'index/getAuth2',
'index/getDistrict'
);
/**
......
......@@ -7,8 +7,8 @@
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">经纪人列表</a></li>
<li class="active">新增</li>
<li><a href="#">经纪人管理</a></li>
<li class="active">经纪人列表</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
......@@ -85,10 +85,6 @@
<label class="col-sm-3 control-label">门店ID:</label>
<input type="number" class="form-control btn6" name="store_id" value="" placeholder="填写门店ID">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">区域ID:</label>
<input type="number" class="form-control btn6" id="district_id" name="district_id" value="" placeholder="填写区域ID">
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机号:</label>
<input type="number" class="form-control btn6" name="phone" value="" placeholder="填写手机号">
......
......@@ -82,8 +82,8 @@
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">户列表</a></li>
<li class="active">添加客户</li>
<li><a href="#">源管理</a></li>
<li class="active">客户列表</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
......@@ -149,8 +149,11 @@
<option value="2"></option>
<option value="1"></option>
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" id="guest_department" placeholder="客方所属部门" type="text" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" id="guest_stores" placeholder="客方所属门店" type="text" value="">
<select class="form-control btn2 margin-top-ld input" name="" id="district_id" placeholder="">
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" id="guest_stores" placeholder="客方所属门店" type="text" value="">
<select class="form-control btn2 margin-top-ld" name="public_status">
<option value="2">客户状态</option>
......
......@@ -170,7 +170,7 @@ Route::group('index', [
'labelEdit' => ['index/label/index',['method'=>'get|post']], //编辑标签
'getLabelsList' => ['index/label/getLabelsList',['method'=>'get']], //标签列表
'lable' => ['index/label/index',['method'=>'get']], //标签列表
'getDistrict' => ['index/District/getList', [ 'method' => 'get' ] ], //获取部门列表
//数据统计
'RemarkFollowList'=>['index/remark/followUpList',['method'=>'get']],//跟进列表
'phone_list'=>['index/Phone/index',['method'=>'get']],//隐私号码列表
......
......@@ -147,7 +147,6 @@ define (['doT', 'text!temp/agent_template_tpl.html', 'css!style/home.css','pagin
$("input[name = phone]").val(data.data.phone);
$("input[name = name]").val(data.data.name);
$("input[name = store_id]").val(data.data.store_id);
$("input[name = district_id]").val(data.data.district_id);
$("#admin_off").val(data.data.admin_off);
$("#remarks").val(data.data.remarks);
$("#status").val(data.data.status);
......
......@@ -10,6 +10,7 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
$ ("body").append (template);
user.getList ();
user.event ();
user.getDistrict();
//时间控件初始化
/* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
......@@ -365,10 +366,10 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
params.rent_user=$("select[name=public_status]").val();
params.public_user=$("select[name=male_status]").val();
params.store_name=$("#guest_stores").val();
params.district_name=$("#guest_department").val()
params.district_id=$("#district_id").val()
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
console.log($("#guest_stores").val());
$.ajax ({
url: '/index/users_list',
// /index/users_list
......@@ -385,14 +386,6 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
/* $ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: user.pageSize,
onClick: function (el) {
user.getList (el.num.current);
}
});*/
$("#total_page").html(data.data.total);
console.log(data.data.total);
console.log(user.pageSize);+
......@@ -476,6 +469,24 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}
}
});
},
getDistrict : function () {
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":50},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '<option value="-1">客方所属部门</option>';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id").html(str);
}
}
});
}
};
return user;
......
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