作者 jinglong
1 个管道 的构建 通过 耗费 46 秒

修改总领导多个人

@@ -1185,8 +1185,9 @@ class CommonController extends RestBaseController @@ -1185,8 +1185,9 @@ class CommonController extends RestBaseController
1185 1185
1186 //根据企业id查询甲方总领导项目组名称 1186 //根据企业id查询甲方总领导项目组名称
1187 public function getAsProjectGroup(){ 1187 public function getAsProjectGroup(){
  1188 + $uid = ','.$this->userId.',';
1188 $company = Db::name('company') 1189 $company = Db::name('company')
1189 - ->where(['u_ls_id'=>$this->userId,'pid'=>['<>',0]]) 1190 + ->where(['u_ls_id'=>['like','%'.$uid.'%'],'pid'=>['<>',0]])
1190 ->field('id') 1191 ->field('id')
1191 ->select() 1192 ->select()
1192 ->toArray(); 1193 ->toArray();
@@ -196,6 +196,7 @@ class AdminProjectController extends AdminBaseController @@ -196,6 +196,7 @@ class AdminProjectController extends AdminBaseController
196 $arr = [ 196 $arr = [
197 ['id' => 0,'name'=>'员工'], 197 ['id' => 0,'name'=>'员工'],
198 ['id' => 1,'name'=>'领导'], 198 ['id' => 1,'name'=>'领导'],
  199 + ['id' => 2,'name'=>'总领导'],
199 ]; 200 ];
200 $this->assign('list',$arr); 201 $this->assign('list',$arr);
201 $this->assign('company_id',$company_id); 202 $this->assign('company_id',$company_id);
@@ -245,33 +246,32 @@ class AdminProjectController extends AdminBaseController @@ -245,33 +246,32 @@ class AdminProjectController extends AdminBaseController
245 $u_l_id = ','.$u_l_id; 246 $u_l_id = ','.$u_l_id;
246 247
247 //如果有总领导 248 //如果有总领导
248 - $u_ls_id = 0; 249 + $u_ls_id = '';
249 $companyModel = new CompanyModel(); 250 $companyModel = new CompanyModel();
  251 +
250 if($data['is_children'] == 1){ 252 if($data['is_children'] == 1){
251 - $res = $common->getIsMobile($data['mobile2']);  
252 - $userModel = new UserModel();  
253 - if(!$res){  
254 - //创建总领导  
255 - if(!empty($data['mobile2'])){  
256 - $leader['user_login'] = $data['user_login2'];  
257 - $leader['mobile'] = $data['mobile2'];  
258 - $leader['position'] = $data['position2'];  
259 - $leader['user_pass'] = cmf_password(123456);  
260 - $leader['user_type'] = 2;  
261 - $leader['identity'] = 2;  
262 - $leader['create_time'] = time();  
263 - $arr2 = $userModel->create($leader);  
264 - $u_ls_id = $arr2->id;  
265 - }  
266 - }else{  
267 - if(!empty($data['mobile2'])){  
268 - $leader['user_login'] = $data['user_login2'];  
269 - $leader['position'] = $data['position2'];  
270 - $userModel->where('mobile',$data['mobile2'])->update($leader);  
271 - $u_ls_id = $res['id']; 253 + //合并甲方总领导
  254 + if(!empty($data['mobile2'])){
  255 + $res2 = $common->array_merge_more($keys, $data['user_login2'], $data['mobile2'], $data['position2']);
  256 + foreach ($res2 as $value2){
  257 + $res = $common->getIsMobile($value2['mobile']);
  258 + if(!$res){
  259 + //创建总领导
  260 + $value2['user_pass'] = cmf_password(123456);
  261 + $value2['user_type'] = 2;
  262 + $value2['identity'] = 2;
  263 + $value2['create_time'] = time();
  264 + $arr2 = $userModel->create($value2);
  265 + $u_ls_id .= $arr2->id.',';
  266 + }else{
  267 + $u_ls_id .= $res['id'].',';
  268 + }
272 } 269 }
273 } 270 }
274 } 271 }
  272 + if(!empty($u_ls_id)){
  273 + $u_ls_id = ','.$u_ls_id;
  274 + }
275 275
276 //创建甲方公司 276 //创建甲方公司
277 $admin_id = cmf_get_current_admin_id(); 277 $admin_id = cmf_get_current_admin_id();
@@ -366,17 +366,9 @@ class AdminProjectController extends AdminBaseController @@ -366,17 +366,9 @@ class AdminProjectController extends AdminBaseController
366 $part_a = $common->getCompanyById($post['a_cid'],'*'); 366 $part_a = $common->getCompanyById($post['a_cid'],'*');
367 $post['part_a'] = $part_a; 367 $post['part_a'] = $part_a;
368 368
369 - //根据总领导id获取总领导信息  
370 - $leader['user_login'] = '';  
371 - $leader['mobile'] = '';  
372 - $leader['position'] = '';  
373 - if($part_a['is_children'] == 1){  
374 - $user_leader = $common->getUserInfo($part_a['u_ls_id']);  
375 - $leader['user_login'] = $user_leader['user_login'];  
376 - $leader['mobile'] = $user_leader['mobile'];  
377 - $leader['position'] = $user_leader['position'];  
378 - }  
379 - $post['u_ls_id_a'] = $leader; 369 + //获取甲方企业总领导
  370 + $u_ls_ids = explode(',',trim($part_a['u_ls_id'],','));
  371 + $post['u_ls_id_a'] = $common->getUserName($u_ls_ids);
380 372
381 //获取甲方企业负责人 373 //获取甲方企业负责人
382 $u_l_ids = explode(',',trim($part_a['u_l_id'],',')); 374 $u_l_ids = explode(',',trim($part_a['u_l_id'],','));
@@ -436,6 +428,16 @@ class AdminProjectController extends AdminBaseController @@ -436,6 +428,16 @@ class AdminProjectController extends AdminBaseController
436 428
437 //甲方企业id,甲方员工id 429 //甲方企业id,甲方员工id
438 $project = $common->getProject(['id'=>$data['id']],'id,a_cid'); 430 $project = $common->getProject(['id'=>$data['id']],'id,a_cid');
  431 +
  432 + //领导
  433 + if(!empty($data['u_l_id'])){
  434 + $company_a['u_l_id'] = ','.implode($data['u_l_id'],',').',';//领导
  435 + }
  436 + //员工
  437 + if(!empty($data['u_s_id'])){
  438 + $company_a['u_s_id'] = ','.implode($data['u_s_id'],',').',';//员工
  439 + }
  440 +
439 $companyModel = new CompanyModel(); 441 $companyModel = new CompanyModel();
440 //更新甲方企业公司名称,logo,营业执照 442 //更新甲方企业公司名称,logo,营业执照
441 $company_a['company_name'] = $data['company_name']; 443 $company_a['company_name'] = $data['company_name'];
@@ -446,37 +448,13 @@ class AdminProjectController extends AdminBaseController @@ -446,37 +448,13 @@ class AdminProjectController extends AdminBaseController
446 $company_a['company_name_head'] = $data['company_name_head'];//甲方总公司名称 448 $company_a['company_name_head'] = $data['company_name_head'];//甲方总公司名称
447 $company_a['head_logo'] = $data['head_logo'];//总公司logo 449 $company_a['head_logo'] = $data['head_logo'];//总公司logo
448 //$company_a['address'] = $data['address'];//地区 450 //$company_a['address'] = $data['address'];//地区
449 - //查询该总领导是否存在  
450 - $res = $common->getIsMobile($data['mobile2']);  
451 - $userModel = new UserModel();  
452 - if(!$res){  
453 - //创建总领导  
454 - if(!empty($data['mobile2'])){  
455 - $leader['user_login'] = $data['user_login2'];  
456 - $leader['mobile'] = $data['mobile2'];  
457 - $leader['position'] = $data['position2'];  
458 - $leader['user_pass'] = cmf_password(123456);  
459 - $leader['user_type'] = 2;  
460 - $leader['identity'] = 2;  
461 - $leader['create_time'] = time();  
462 - $arr2 = $userModel->create($leader);  
463 - $u_ls_id = $arr2->id;  
464 - $companyModel->where('id',$project['a_cid'])->update(['u_ls_id'=>$u_ls_id]);  
465 - }  
466 -  
467 - }else{  
468 - if(!empty($data['mobile2'])){  
469 - $leader['user_login'] = $data['user_login2'];  
470 - $leader['position'] = $data['position2'];  
471 - $userModel->where('mobile',$data['mobile2'])->update($leader);  
472 - $companyModel->where('id',$project['a_cid'])->update(['u_ls_id'=>$res['id']]);  
473 - }  
474 - 451 + if(!empty($data['u_ls_id'])){
  452 + $company_a['u_ls_id'] = ','.implode($data['u_ls_id'],',').',';//总领导
475 } 453 }
476 }else{ 454 }else{
477 $company_a['company_name_head'] = '';//甲方总公司名称 455 $company_a['company_name_head'] = '';//甲方总公司名称
478 //$company_a['address'] = '';//地区 456 //$company_a['address'] = '';//地区
479 - $company_a['u_ls_id'] = 0;//总领导 457 + $company_a['u_ls_id'] = '';//总领导
480 } 458 }
481 $companyModel->where('id',$project['a_cid'])->update($company_a); 459 $companyModel->where('id',$project['a_cid'])->update($company_a);
482 460
@@ -551,10 +529,7 @@ class AdminProjectController extends AdminBaseController @@ -551,10 +529,7 @@ class AdminProjectController extends AdminBaseController
551 public function addUserPost(){ 529 public function addUserPost(){
552 $data = $this->request->param(); 530 $data = $this->request->param();
553 $adminCommon = new AdminCommonController(); 531 $adminCommon = new AdminCommonController();
554 - $res = $adminCommon->getIsMobile($data['mobile']);  
555 - if($res){  
556 - $this->error('手机号不能重复');  
557 - } 532 +
558 //创建普通用户 533 //创建普通用户
559 $userModel = new UserModel(); 534 $userModel = new UserModel();
560 $arr['user_login'] = $data['user_login']; 535 $arr['user_login'] = $data['user_login'];
@@ -564,7 +539,27 @@ class AdminProjectController extends AdminBaseController @@ -564,7 +539,27 @@ class AdminProjectController extends AdminBaseController
564 $arr['user_pass'] = cmf_password(123456); 539 $arr['user_pass'] = cmf_password(123456);
565 $arr['user_type'] = 2; 540 $arr['user_type'] = 2;
566 $arr['create_time'] = time(); 541 $arr['create_time'] = time();
567 - $res_user = $userModel->create($arr); 542 +
  543 + if($data['identity'] == 2){
  544 + //总领导
  545 + $res = $adminCommon->getIsMobile($data['mobile']);
  546 + if($res){
  547 + //存在则不用添加
  548 + $res_user = 2;
  549 + $uid = $res['id'];
  550 + }else{
  551 + //不存在则新增用户
  552 + $res_user = $userModel->create($arr);
  553 + $uid = $res_user->id;
  554 + }
  555 + }else{
  556 + $res = $adminCommon->getIsMobile($data['mobile']);
  557 + if($res){
  558 + $this->error('手机号不能重复');
  559 + }
  560 + $res_user = $userModel->create($arr);
  561 + $uid = $res_user->id;
  562 + }
568 563
569 if($res_user){ 564 if($res_user){
570 $common = new AdminCommonController(); 565 $common = new AdminCommonController();
@@ -573,7 +568,6 @@ class AdminProjectController extends AdminBaseController @@ -573,7 +568,6 @@ class AdminProjectController extends AdminBaseController
573 568
574 //更新所属公司的员工或领导 569 //更新所属公司的员工或领导
575 $companyModel = new CompanyModel(); 570 $companyModel = new CompanyModel();
576 - $uid = $res_user->id;  
577 if($data['identity'] == 0){ 571 if($data['identity'] == 0){
578 //更新项目甲方员工 572 //更新项目甲方员工
579 $projectModel = new ProjectModel(); 573 $projectModel = new ProjectModel();
@@ -584,11 +578,16 @@ class AdminProjectController extends AdminBaseController @@ -584,11 +578,16 @@ class AdminProjectController extends AdminBaseController
584 $res = $this->getStaffLeader($project['a_cid'],'id,u_s_id'); 578 $res = $this->getStaffLeader($project['a_cid'],'id,u_s_id');
585 $u_s_id = $res['u_s_id'].$uid.','; 579 $u_s_id = $res['u_s_id'].$uid.',';
586 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_s_id'=>$u_s_id]); 580 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_s_id'=>$u_s_id]);
587 - }else{ 581 + }else if($data['identity'] == 1){
588 //更新甲方公司的领导 582 //更新甲方公司的领导
589 $res = $this->getStaffLeader($project['a_cid'],'id,u_l_id'); 583 $res = $this->getStaffLeader($project['a_cid'],'id,u_l_id');
590 $u_l_id = $res['u_l_id'].$uid.','; 584 $u_l_id = $res['u_l_id'].$uid.',';
591 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_l_id'=>$u_l_id]); 585 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_l_id'=>$u_l_id]);
  586 + }else{
  587 + //更新甲方公司的总领导
  588 + $res = $this->getStaffLeader($project['a_cid'],'id,u_ls_id');
  589 + $u_ls_id = $res['u_ls_id'].$uid.',';
  590 + $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_ls_id'=>$u_ls_id]);
592 } 591 }
593 if($res1){ 592 if($res1){
594 $this->success("添加成功"); 593 $this->success("添加成功");
@@ -603,12 +602,26 @@ class AdminProjectController extends AdminBaseController @@ -603,12 +602,26 @@ class AdminProjectController extends AdminBaseController
603 public function delUserPost(){ 602 public function delUserPost(){
604 $data = $this->request->param(); 603 $data = $this->request->param();
605 $userModel = new UserModel(); 604 $userModel = new UserModel();
606 - $res_user = $userModel->where(['id'=>$data['uid']])->delete();  
607 - if($res_user){  
608 - $common = new AdminCommonController();  
609 - //甲方企业id,甲方员工id  
610 - $project = $common->getProject(['id'=>$data['project_id']],'id,a_cid,a_sid'); 605 + $common = new AdminCommonController();
  606 + //甲方企业id,甲方员工id
  607 + $project = $common->getProject(['id'=>$data['project_id']],'id,a_cid,a_sid');
  608 +
  609 + if($data['identity'] == 2){
  610 + //总领导,查询该账号是否存在其他项目中
  611 + $u_ls_id = ','.$data['uid'].',';
  612 + $res = $this->getLeadersCount(['id'=>['<>',$project['a_cid']],'u_ls_id'=>['like','%'.$u_ls_id.'%']]);
  613 + if($res == 0){
  614 + //不存在则删除
  615 + $res_user = $userModel->where(['id'=>$data['uid']])->delete();
  616 + }else{
  617 + //存在不用删除
  618 + $res_user = 1;
  619 + }
  620 + }else{
  621 + $res_user = $userModel->where(['id'=>$data['uid']])->delete();
  622 + }
611 623
  624 + if($res_user){
612 $companyModel = new CompanyModel(); 625 $companyModel = new CompanyModel();
613 $uid = ','.$data['uid']; 626 $uid = ','.$data['uid'];
614 if($data['identity'] == 0){ 627 if($data['identity'] == 0){
@@ -621,11 +634,16 @@ class AdminProjectController extends AdminBaseController @@ -621,11 +634,16 @@ class AdminProjectController extends AdminBaseController
621 $res = $this->getStaffLeader($project['a_cid'],'id,u_s_id'); 634 $res = $this->getStaffLeader($project['a_cid'],'id,u_s_id');
622 $u_s_id = str_replace($uid,'',$res['u_s_id']); 635 $u_s_id = str_replace($uid,'',$res['u_s_id']);
623 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_s_id'=>$u_s_id]); 636 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_s_id'=>$u_s_id]);
624 - }else{ 637 + }else if($data['identity'] == 1){
625 //更新甲方公司的领导 638 //更新甲方公司的领导
626 $res = $this->getStaffLeader($project['a_cid'],'id,u_l_id'); 639 $res = $this->getStaffLeader($project['a_cid'],'id,u_l_id');
627 $u_l_id = str_replace($uid,'',$res['u_l_id']); 640 $u_l_id = str_replace($uid,'',$res['u_l_id']);
628 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_l_id'=>$u_l_id]); 641 $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_l_id'=>$u_l_id]);
  642 + }else{
  643 + //更新甲方公司的总领导
  644 + $res = $this->getStaffLeader($project['a_cid'],'id,u_ls_id');
  645 + $u_ls_id = str_replace($uid,'',$res['u_ls_id']);
  646 + $res1 = $companyModel->where('id',$project['a_cid'])->update(['u_ls_id'=>$u_ls_id]);
629 } 647 }
630 if($res1){ 648 if($res1){
631 //更新推送甲方表 649 //更新推送甲方表
@@ -647,6 +665,14 @@ class AdminProjectController extends AdminBaseController @@ -647,6 +665,14 @@ class AdminProjectController extends AdminBaseController
647 $this->error("删除用户失败"); 665 $this->error("删除用户失败");
648 } 666 }
649 667
  668 + //查询甲方其他公司是否存在总领导
  669 + public function getLeadersCount($where){
  670 + $res = Db::name('company')
  671 + ->where($where)
  672 + ->count();
  673 + return $res;
  674 + }
  675 +
650 //查询甲方公司领导或者员工 676 //查询甲方公司领导或者员工
651 public function getStaffLeader($id,$field){ 677 public function getStaffLeader($id,$field){
652 $res = Db::name('company') 678 $res = Db::name('company')
@@ -9,10 +9,10 @@ @@ -9,10 +9,10 @@
9 height:150px; 9 height:150px;
10 overflow-y: scroll; 10 overflow-y: scroll;
11 } 11 }
12 - .users_leader_s{ 12 + .users_leaders{
13 border:1px solid #f0f0f0; 13 border:1px solid #f0f0f0;
14 padding:5px 10px; 14 padding:5px 10px;
15 - height:80px; 15 + height:100px;
16 overflow-y: scroll; 16 overflow-y: scroll;
17 } 17 }
18 .users_staff{ 18 .users_staff{
@@ -134,24 +134,34 @@ @@ -134,24 +134,34 @@
134 <!--<input class="form-control" type="text" name="address" placeholder="请输入企业地区"/>--> 134 <!--<input class="form-control" type="text" name="address" placeholder="请输入企业地区"/>-->
135 <!--</td>--> 135 <!--</td>-->
136 <!--</tr>--> 136 <!--</tr>-->
  137 + <!--<tr class="address company_address">-->
  138 + <!--<th>企业总领导</th>-->
  139 + <!--<td>-->
  140 + <!--<input class="form-control" type="text" name="user_login2" placeholder="请输入企业总领导"/>-->
  141 + <!--</td>-->
  142 + <!--</tr>-->
  143 +
137 <tr class="address company_address"> 144 <tr class="address company_address">
138 <th>企业总领导</th> 145 <th>企业总领导</th>
139 <td> 146 <td>
140 - <input class="form-control" type="text" name="user_login2" placeholder="请输入企业总领导"/>  
141 - </td>  
142 - </tr>  
143 - <tr class="address company_address">  
144 - <th>手机号(唯一)</th>  
145 - <td>  
146 - <input class="form-control" type="tel" name="mobile2" placeholder="请输入总领导手机号" value=""/>  
147 - </td>  
148 - </tr>  
149 - <tr class="address company_address">  
150 - <th>职位</th>  
151 - <td>  
152 - <input class="form-control" type="text" name="position2" placeholder="请输入总领导职位"/> 147 + <div class="users_leaders user_leaders_a">
  148 +
  149 + </div>
153 </td> 150 </td>
154 </tr> 151 </tr>
  152 +
  153 + <!--<tr class="address company_address">-->
  154 + <!--<th>手机号(唯一)</th>-->
  155 + <!--<td>-->
  156 + <!--<input class="form-control" type="tel" name="mobile2" placeholder="请输入总领导手机号" value=""/>-->
  157 + <!--</td>-->
  158 + <!--</tr>-->
  159 + <!--<tr class="address company_address">-->
  160 + <!--<th>职位</th>-->
  161 + <!--<td>-->
  162 + <!--<input class="form-control" type="text" name="position2" placeholder="请输入总领导职位"/>-->
  163 + <!--</td>-->
  164 + <!--</tr>-->
155 <!--是否有子企业end--> 165 <!--是否有子企业end-->
156 166
157 <tr> 167 <tr>
@@ -350,6 +360,11 @@ @@ -350,6 +360,11 @@
350 $(this).parent('.users').remove(); 360 $(this).parent('.users').remove();
351 }); 361 });
352 362
  363 + //移除总领导
  364 + $(document).on('click','.u_ls_del',function () {
  365 + $(this).parent('.users').remove();
  366 + });
  367 +
353 //移除员工 368 //移除员工
354 $(document).on('click','.u_s_del',function () { 369 $(document).on('click','.u_s_del',function () {
355 $(this).parent('.users').remove(); 370 $(this).parent('.users').remove();
@@ -380,7 +395,7 @@ @@ -380,7 +395,7 @@
380 html += '<input type="hidden" name="position[]" value="'+data.position+'">'; 395 html += '<input type="hidden" name="position[]" value="'+data.position+'">';
381 html += '</div>'; 396 html += '</div>';
382 $('.user_staff_a').append(html); 397 $('.user_staff_a').append(html);
383 - }else{ 398 + }else if(data.identity == 1){
384 //领导 399 //领导
385 html += '<div class="users">'; 400 html += '<div class="users">';
386 html += '<div class="user_name">'+data.user_login+'('+data.mobile+')</div>'; 401 html += '<div class="user_name">'+data.user_login+'('+data.mobile+')</div>';
@@ -394,6 +409,20 @@ @@ -394,6 +409,20 @@
394 html += '<input type="hidden" name="position1[]" value="'+data.position+'">'; 409 html += '<input type="hidden" name="position1[]" value="'+data.position+'">';
395 html += '</div>'; 410 html += '</div>';
396 $('.user_leader_a').append(html); 411 $('.user_leader_a').append(html);
  412 + }else{
  413 + //总领导
  414 + html += '<div class="users">';
  415 + html += '<div class="user_name">'+data.user_login+'('+data.mobile+')</div>';
  416 + //删除图标
  417 + html += '<div class="u_ls_del" style="cursor: pointer;">';
  418 + html += '<img src="/static/images/del.png" alt="" style="width:16px;height:16px;">';
  419 + html += '</div>';
  420 + //隐藏数据,姓名,身份,手机号,职位
  421 + html += '<input type="hidden" name="user_login2[]" value="'+data.user_login+'">';
  422 + html += '<input type="hidden" name="mobile2[]" value="'+data.mobile+'">';
  423 + html += '<input type="hidden" name="position2[]" value="'+data.position+'">';
  424 + html += '</div>';
  425 + $('.user_leaders_a').append(html);
397 } 426 }
398 427
399 layer.close(index); //如果设定了yes回调,需进行手工关闭 428 layer.close(index); //如果设定了yes回调,需进行手工关闭
@@ -9,10 +9,10 @@ @@ -9,10 +9,10 @@
9 height:150px; 9 height:150px;
10 overflow-y: scroll; 10 overflow-y: scroll;
11 } 11 }
12 - .users_leader_s{ 12 + .users_leaders{
13 border:1px solid #f0f0f0; 13 border:1px solid #f0f0f0;
14 padding:5px 10px; 14 padding:5px 10px;
15 - height:80px; 15 + height:100px;
16 overflow-y: scroll; 16 overflow-y: scroll;
17 } 17 }
18 .users_staff{ 18 .users_staff{
@@ -153,21 +153,28 @@ @@ -153,21 +153,28 @@
153 <tr class="address company_address"> 153 <tr class="address company_address">
154 <th>企业总领导</th> 154 <th>企业总领导</th>
155 <td> 155 <td>
156 - <input class="form-control" type="text" name="user_login2" placeholder="请输入企业总领导" value="{$post.u_ls_id_a.user_login}"/>  
157 - </td>  
158 - </tr>  
159 - <tr class="address company_address">  
160 - <th>手机号(唯一)</th>  
161 - <td>  
162 - <input class="form-control" type="tel" name="mobile2" placeholder="请输入总领导手机号" value="{$post.u_ls_id_a.mobile}"/>  
163 - </td>  
164 - </tr>  
165 - <tr class="address company_address">  
166 - <th>职位</th>  
167 - <td>  
168 - <input class="form-control" type="text" name="position2" placeholder="请输入总领导职位" value="{$post.u_ls_id_a.position}"/> 156 + <div class="users_leaders user_leaders_a">
  157 + <volist name="post.u_ls_id_a" id="vo">
  158 + <div class="users">
  159 + <div class="user_name">{$vo.user_login}({$vo.mobile})</div>
  160 + <?php
  161 + if($login_uid != 1){
  162 + ?>
  163 + <div class="u_ls_del" style="cursor: pointer;">
  164 + <img src="/static/images/del.png" alt="" style="width:16px;height:16px;">
  165 + <input type="hidden" class="u_ls_ids" value="{$vo.id}">
  166 + </div>
  167 + <?php
  168 + }
  169 + ?>
  170 + <input type="hidden" name="u_ls_id[]" value="{$vo.id}"/>
  171 + <input type="hidden" name="user_login2[]" value="{$vo.user_login}"/>
  172 + </div>
  173 + </volist>
  174 + </div>
169 </td> 175 </td>
170 </tr> 176 </tr>
  177 +
171 <!--是否有子企业end--> 178 <!--是否有子企业end-->
172 179
173 <tr> 180 <tr>
@@ -474,6 +481,21 @@ @@ -474,6 +481,21 @@
474 481
475 }); 482 });
476 483
  484 + //删除总领导
  485 + $('.u_ls_del').click(function () {
  486 + var project_id = $('#id').val();
  487 + var uid = $(this).children('.u_ls_ids').val();
  488 + layer.open({
  489 + content: '确认删除企业总领导?',
  490 + btn: ['确认', '取消'],
  491 + shadeClose: false,
  492 + yes: function(){
  493 + del(project_id,2,uid);
  494 + }
  495 + });
  496 +
  497 + });
  498 +
477 //删除员工 499 //删除员工
478 $('.u_s_del').click(function () { 500 $('.u_s_del').click(function () {
479 var project_id = $('#id').val(); 501 var project_id = $('#id').val();