Commit 62d104aa by html5-李恒逸

修改只有第一个人可以分配bug

parent d60907a1
...@@ -343,7 +343,9 @@ class Report extends CI_Controller ...@@ -343,7 +343,9 @@ class Report extends CI_Controller
$managerId = (int)$post['mid']; $managerId = (int)$post['mid'];
$cbid = (int)$post['cbid']; $cbid = (int)$post['cbid'];
$reset = $post['reset']; $reset = $post['reset'];
if(empty($manager_id)){
$manager_id=0;
}
if (!in_array($userType, array('sale', 'manager')) || !$cbid || (!$saleId && !$managerId)) { if (!in_array($userType, array('sale', 'manager')) || !$cbid || (!$saleId && !$managerId)) {
$result = array('errcode' => 4,'errmsg' => '参数错误'); $result = array('errcode' => 4,'errmsg' => '参数错误');
} else { } else {
...@@ -351,7 +353,8 @@ class Report extends CI_Controller ...@@ -351,7 +353,8 @@ class Report extends CI_Controller
//重新分配,记录日志 //重新分配,记录日志
//if ($reset) { //if ($reset) {
$customerBuilding = $this->customer_building->get(array('id' => $cbid)); $customerBuilding = $this->customer_building->get(array('id' => $cbid));
// echo '<pre>';
// print_r($customerBuilding);die;
$reportedInfo = $this->customer_building->get_report_id($customerBuilding['id']); $reportedInfo = $this->customer_building->get_report_id($customerBuilding['id']);
//若此客户已经分配,其他报备则不可分配 //若此客户已经分配,其他报备则不可分配
...@@ -820,7 +823,7 @@ class Report extends CI_Controller ...@@ -820,7 +823,7 @@ class Report extends CI_Controller
//$where .= ' B.id in('.$b_id.') and'; //$where .= ' B.id in('.$b_id.') and';
} }
$buildings_select=$this->manager->get_buildings('id = ' . $user_id); $buildings_select=$this->manager->get_buildings('id = ' . $user_id);
$where .= ' B.id in (' . $buildings_select[0]['building_id'].')'; $where .= ' B.id in (' . $buildings_select[0]['building_id'].')';
$where = trim($where,' and '); $where = trim($where,' and ');
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
} ?> } ?>
</div> </div>
<div style='margin-top:5px;'></div> <div style='margin-top:5px;'></div>
<button type="submit" class="btn blue" id="search">搜索</button> <button type="submit" class="btn blue" id="search">搜索</button>
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
//分销商筛选 //分销商筛选
$('#parent_name').on('keyup click',function(){ $('#parent_name').on('keyup click',function(){
var arr=new Array(); var arr=new Array();
<?php <?php
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
var con=$(this).val(); var con=$(this).val();
var i; var i;
var str=''; var str='';
$('#channel_list').show(); $('#channel_list').show();
//制作分销商下拉菜单 //制作分销商下拉菜单
for(i=0;i<arr.length;i++){ for(i=0;i<arr.length;i++){
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
} }
$('#channel_list li').unbind(); $('#channel_list li').unbind();
//点击选择分销商 //点击选择分销商
$('#channel_list').on('click','li',function(){ $('#channel_list').on('click','li',function(){
$('#parent_id').attr("value",$(this).val()); $('#parent_id').attr("value",$(this).val());
...@@ -520,7 +520,7 @@ ...@@ -520,7 +520,7 @@
$('.newdetermine').click(function(){ $('.newdetermine').click(function(){
$('.userList').hide(); $('.userList').hide();
$('.hzz-keepout').show(); $('.hzz-keepout').show();
if (_type && _mid && flag) { if (_type && flag) {
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: "<?php echo site_url('admin/report/allot') ?>", url: "<?php echo site_url('admin/report/allot') ?>",
...@@ -540,17 +540,19 @@ ...@@ -540,17 +540,19 @@
alert('出错了'); alert('出错了');
} }
}); });
}else if(!_mid){ }
$('.hzz-keepout').hide(); // else if(!_mid){
alert("没有销售经理,不支持分配"); // $('.hzz-keepout').hide();
// alert("没有销售经理,不支持分配");
}else{ //
// }
else{
$('.hzz-keepout').hide(); $('.hzz-keepout').hide();
alert('请选择销售'); alert('请选择销售');
} }
}); });
//搜索姓名 //搜索姓名
$('#search_uname').on('keyup click',function() { $('.search_uname').on('keyup click',function() {
var _val = $.trim($(this).val()); var _val = $.trim($(this).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