moonsflyer 9 月之前
父节点
当前提交
487131cf79
共有 35 个文件被更改,包括 678 次插入565 次删除
  1. 2 2
      .bowerrc
  2. 10 2
      .env.sample
  3. 2 1
      addons/qingdong/model/CustomerFile.php
  4. 4 0
      addons/qingdong/model/RecordFile.php
  5. 2 2
      addons/qingdong/model/StaffCollect.php
  6. 1 0
      addons/qingdong/validate/Customer.php
  7. 1 0
      application/admin/controller/Category.php
  8. 41 14
      application/admin/controller/qingdong/customer/Business.php
  9. 61 35
      application/admin/controller/qingdong/customer/Customer.php
  10. 4 2
      application/admin/controller/qingdong/customer/Leads.php
  11. 16 0
      application/admin/controller/qingdong/customer/Receivables.php
  12. 138 137
      application/admin/controller/qingdong/customer/Seas.php
  13. 6 18
      application/admin/view/qingdong/customer/contract/detail.html
  14. 154 154
      application/admin/view/qingdong/customer/contract/edit.html
  15. 6 6
      application/admin/view/qingdong/customer/contract/import.html
  16. 30 30
      application/admin/view/qingdong/customer/contract/words.html
  17. 1 2
      application/admin/view/qingdong/customer/customer/addteam.html
  18. 1 1
      application/admin/view/qingdong/customer/customer/change.html
  19. 22 15
      application/admin/view/qingdong/customer/customer/detail.html
  20. 21 21
      application/admin/view/qingdong/customer/customer/edit.html
  21. 6 6
      application/admin/view/qingdong/customer/customer/editteam.html
  22. 6 6
      application/admin/view/qingdong/customer/customer/map.html
  23. 46 45
      application/admin/view/qingdong/customer/customer/words.html
  24. 3 0
      application/admin/view/qingdong/customer/record/detail.html
  25. 1 1
      application/common/library/token/Driver.php
  26. 37 7
      application/index/controller/Ajax.php
  27. 38 40
      public/assets/js/backend/qingdong/customer/customer.js
  28. 18 18
      public/assets/js/backend/qingdong/customer/leads.js
  29. 二进制
      public/assets/js/backend/qingdong/dashboard.js
  30. 二进制
      public/export/2025-03-26/客户20250326152659.xlsx
  31. 二进制
      public/export/2025-04-07/客户20250407164305.xlsx
  32. 二进制
      public/export/2025-04-07/客户20250407164358.xlsx
  33. 二进制
      public/export/2025-04-09/客户20250409120047.xlsx
  34. 二进制
      public/export/2025-04-10/客户20250410101302.xlsx
  35. 0 0
      public/gjqPhXsBKN.php

+ 2 - 2
.bowerrc

@@ -5,7 +5,7 @@ trace = false
 [database]
 hostname = 127.0.0.1
 database = crm_chenghe
-username = root
-password = root
+username = crm_chenghe
+password = jLaprrmCZjFyBBRe
 hostport = 3306
 prefix = fa_

+ 10 - 2
.env.sample

@@ -39,7 +39,14 @@ class Customer Extends Model {
 	public function ownerStaff() {
 		return $this->hasOne(Staff::class, 'id', 'owner_staff_id')->field('id,name,img');
 	}
+    // 负责人(多对多关系)
+    public function ownerStaffs() {
+        return $this->belongsToMany(Staff::class, 'customer_staff', 'staff_id', 'customer_id')->field('id,name,img');
+    }
 
+    public function adminUser(){
+        return $this->hasOne('app\admin\model\Admin', 'id', 'create_staff_id');
+    }
 
 	//获取联系人
 	public function contacts() {
@@ -328,17 +335,18 @@ class Customer Extends Model {
 	 * 批量转移客户
 	 */
 	public static function batchTransfer($ids, $staff_id) {
+
 		Db::startTrans();
 		try {
 			if (Customer::where(['id' => ['in',$ids]])->update([
-					'owner_staff_id' => $staff_id,
+					'owner_staff_id' => implode(',',$staff_id),
 					'updatetime'     => time()
 				]) == false) {
 				throw new Exception('修改失败');
 			}
 			if (Contacts::where(['customer_id' => ['in',$ids]])->count()) {//存在联系人 则修改负责人
 				if (Contacts::where(['customer_id' => ['in',$ids]])->update([
-						'owner_staff_id' => $staff_id,
+						'owner_staff_id' => implode(',',$staff_id),
 						'updatetime'     => time()
 					]) == false) {
 					throw new Exception('修改失败');

+ 2 - 1
addons/qingdong/model/CustomerFile.php

@@ -56,7 +56,8 @@ class Record Extends Model {
 		}
         $staff  = Staff::info();
         if ($params['relation_type'] == RecordModel::CUSTOMER_TYPE) {//客户
-            $create_staff_id = Customer::where(['id' => $params['relation_id']])->value('owner_staff_id');
+//            $create_staff_id = Customer::where(['id' => $params['relation_id']])->value('owner_staff_id');
+            $create_staff_id = $staff->id;
 
         } elseif ($params['relation_type'] == RecordModel::CONTACTS_TYPE) {//联系人
             $create_staff_id = Contacts::where(['id' => $params['relation_id']])->value('owner_staff_id');

+ 4 - 0
addons/qingdong/model/RecordFile.php

@@ -196,6 +196,7 @@ class Staff Extends Model {
 	public static function getList($notInIds=[]) {
 
 		$where=['status'=>1];
+
 		if($notInIds){
 			$where['id']=['not in',$notInIds];
 		}
@@ -262,6 +263,7 @@ class Staff Extends Model {
                 ])->column('id');
                 break;
             case 6://全部
+
                 $l_ids = self::where([
                     'status' => 1,
                     'id' => ['neq', $staff->id]
@@ -271,6 +273,7 @@ class Staff Extends Model {
         if (empty($l_ids)) {//返回空 下属查询 会查询全部
             return ['-1'];
         }
+
         return $l_ids;
     }
 
@@ -302,6 +305,7 @@ class Staff Extends Model {
     }
     //获取自己及下属员工
     public static function allList($notInIds=[]) {
+
         $where['id']=['in',self::getMyStaffIds()];
         $where['status']=1;
         return self::where($where)->field('id,name')->select();

+ 2 - 2
addons/qingdong/model/StaffCollect.php

@@ -14,7 +14,7 @@ class Contract extends Validate {
 		'owner_staff_id'  => 'require|number',
 		'order_staff_id'  => 'require|number',
 		'customer_id'     => 'require|number',
-		'contacts_id'     => 'require|number',
+//		'contacts_id'     => 'require|number',
 		'name'           => 'max:50',
 		'num'            => 'max:64',
 		'order_date'     => 'date',
@@ -58,7 +58,7 @@ class Contract extends Validate {
 	protected $scene = [
 		'create' => [
 			'customer_id',
-			'contacts_id',
+//			'contacts_id',
 			'name',
 			'num',
 			'order_date',

+ 1 - 0
addons/qingdong/validate/Customer.php

@@ -75,6 +75,7 @@ class Ajax extends Backend
         Config::load(APP_PATH . 'extra/upload.php', 'upload');
 
         $chunkid = $this->request->post("chunkid");
+
         if ($chunkid) {
             if (!Config::get('upload.chunking')) {
                 $this->error(__('Chunk file disabled'));

+ 1 - 0
application/admin/controller/Category.php

@@ -116,6 +116,7 @@ class Record extends Base {
         $relation_type=input('relation_type',3);
         if ($this->request->isPost()) {
             $params = $this->request->post('row/a');
+
             // 表单验证
             if (($result = $this->qingdongValidate($params, 'Record', 'create')) !== true) {
                 $this->error($result);

+ 41 - 14
application/admin/controller/qingdong/customer/Business.php

@@ -72,6 +72,7 @@ class Contract extends Base {
             switch($type){
                 case 1:
                     $staff = Staff::info();
+
                     $wheres['owner_staff_id'] =  $staff->id;
                     break;
                 case 2:
@@ -124,9 +125,12 @@ class Contract extends Base {
                     break;
 
             }
+            $staff = Staff::info();
+
             $ids=[];
             $group_id=input('group_id');
             $staff_id=input('staff_id');
+
             if ($group_id) {//角色组
                 $ids = Staff::getGroupStaffIds($group_id);
             }
@@ -136,21 +140,27 @@ class Contract extends Base {
             if ($group_id || $staff_id) {
                 $wheres['owner_staff_id'] = ['in', $ids];
             }
+
+            $staff = Staff::info();
+            $staffid   = $staff->id;
+            $s = "FIND_IN_SET(".$staffid.",order_staff_id)";
 			$list = $this->model->where($where)
-                ->where($wheres)
+                ->where($s)
                 ->with([
 				'customer',
 				'orderStaff',
 				'contacts'
 			])->order($sort, $order)->paginate($limit);
+
             $allmoney = $this->model->where($wheres)->where(array('check_status'=>2))->sum('money');
             $repayment_money = Receivables::where($wheres)->where(array('check_status'=>2))->sum('money'); //已回款
             $no_money = $allmoney - $repayment_money;
             if($no_money <= 0){
                 $no_money = 0;
             }
-			$result = array("total" => $list->total(), "rows" => $list->items(),'allmoney'=>$allmoney,'repayment_money'=>$repayment_money,'no_money'=>$no_money);
 
+			$result = array("total" => $list->total(), "rows" => $list->items(),'allmoney'=>$allmoney,'repayment_money'=>$repayment_money,'no_money'=>$no_money,
+                'role' => $staff->role);
 			return json($result);
 		}
 
@@ -172,7 +182,9 @@ class Contract extends Base {
 
                 $params = $this->preExcludeFields($params);
 
-
+                $nowsaff = Staff::info();
+                $params['order_staff_id'] = $nowsaff->id;
+                $params['flow_staff_ids'] = '1';
                 // 表单验证
                 if (($result = $this->qingdongValidate($params, 'Contract', 'create')) !== true) {
                     $this->error($result);
@@ -187,9 +199,9 @@ class Contract extends Base {
                 try {
                     $params = Form::updateFormParams(Form::CONTRACT_TYPE, $params);
 
-                    if($params['product']){
-                        $params['product']=json_decode($params['product'],true);
-                    }
+//                    if($params['product']){
+//                        $params['product']=json_decode($params['product'],true);
+//                    }
                     $result = $this->model::createContract($params);
                     Db::commit();
                 } catch (Exception $e) {
@@ -216,6 +228,7 @@ class Contract extends Base {
         }else{
             $business = Business::getList();
         }
+
         $this->assign('flow',$flow);
         $this->assign('staff', Staff::getStaff());
         $this->assign('customers', Customer::getList());
@@ -238,10 +251,11 @@ class Contract extends Base {
 		if ($this->request->isAjax()) {
 			$params = $this->request->post('row/a');
 			$params = $this->preExcludeFields($params);
-            $row = $this->model::where(['id' => $ids, 'check_status' => ['in', [3, 4]]])->find();
-            if (empty($row)) {
-                $this->error('合同审核中或已审核通过无法修改');
-            }
+            $row = $this->model::where(['id' => $ids])->find();
+//            if (empty($row)) {
+//                $this->error('合同审核中或已审核通过无法修改');
+//            }
+            $params['flow_staff_ids'] = '1';
             // 表单验证
             if (($result = $this->qingdongValidate($params, 'Contract', 'create')) !== true) {
                 $this->error($result);
@@ -258,9 +272,9 @@ class Contract extends Base {
                 $params['id']=$ids;
                 $params['owner_staff_id'] = $row['owner_staff_id'];
 
-                if($params['product']){
-                    $params['product']=json_decode($params['product'],true);
-                }
+//                if($params['product']){
+//                    $params['product']=json_decode($params['product'],true);
+//                }
                 $result = $this->model::updateContract($params);
                 Db::commit();
             } catch (Exception $e) {
@@ -294,6 +308,7 @@ class Contract extends Base {
         if (empty($flow)) {
             $this->error('无可用审批流,请联系管理员','qingdong/work/flow');
         }
+
         $this->assign('flow',$flow);
 		$this->view->assign("row", $row);
 		$this->assign('customers', Customer::getList());
@@ -344,11 +359,22 @@ class Contract extends Base {
                 $row['ratios'][$k] = $v;
             }
         }
+        $staff = Staff::info();
         $row['repayment_money'] = Receivables::where(['contract_id'=>$ids])->sum('money'); //已回款
         $row['no_money'] = $row['money'] -$row['repayment_money'];
         if($row['no_money'] <= 0){
             $row['no_money'] = 0;
         }
+        $filedcontect = Form::getDataValue('contract',$row);
+        if($staff->role != 1 && $staff->role != 2){
+            foreach ($filedcontect as $k=>$v){
+                unset($filedcontect[2]);
+            }
+            $filedcontect = array_values($filedcontect);
+        }
+
+        //重新排序
+
         $this->assign('examine_record',ExamineRecord::getList(ExamineRecord::CONTRACT_TYPE,$ids));
 
         $this->assign('flow',Flow::getstepdetail(Flow::CONTRACT_STATUS, $ids));
@@ -358,8 +384,9 @@ class Contract extends Base {
         $log=OperationLog::getList(OperationLog::CONTRACT_TYPE, $ids);
 		$this->assign('operation_log',$log);
 		$this->assign('row', $row);
+		$this->assign('role', $staff->role);
 		$this->assign('ids', $ids);
-		$this->assign('form_data', Form::getDataValue('contract',$row));
+		$this->assign('form_data',$filedcontect);
         $this->assignconfig("idinfo", ['id' => $ids]);
 		return $this->view->fetch();
 	}

+ 61 - 35
application/admin/controller/qingdong/customer/Customer.php

@@ -57,27 +57,34 @@ class Customer extends Base
 
 
     /**
-     * 查看
+     * 查看111
      */
     public function index()
     {
         //设置过滤方法
         $this->request->filter(['strip_tags', 'trim']);
+        $staff = Staff::info();
+        $staff_id = $staff->id;
         if ($this->request->isAjax()) {
+
             if ($this->request->request('keyField')) {
                 return $this->selectpage();
             }
             //0:全部 1:我负责的 2:下属负责的 3:今日待跟进 4:今日已跟进 5:从未跟进的
             $type = input('type', 0);
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-            $staff = Staff::info();
-            $staff_id = $staff->id;
+
             switch ($type) {
                 case 1://我负责
-                    $wheres['owner_staff_id'] = $staff_id;
+                    $wheres[] = Db::raw("FIND_IN_SET($staff_id, owner_staff_id)");
                     break;
                 case 2://下属负责
-                    $wheres['owner_staff_id'] = array('in', Staff::getLowerStaffId());
+                    $lowerStaffIds = Staff::getLowerStaffId();
+                    $subConditions = [];
+                    foreach ($lowerStaffIds as $id) {
+                        $subConditions[] = Db::raw("FIND_IN_SET($id, owner_staff_id)");
+                    }
+                    $wheres[] = Db::raw('(' . implode(' OR ', $subConditions) . ')');
                     break;
                 case 3:
                     $start = date('Y-m-d 00:00:00');
@@ -91,11 +98,10 @@ class Customer extends Base
                         if ($recordData == 0) {
                             $relationId[] = $v['relation_id'];
                         }
-
                     }
                     $wheres['id'] = array('in', $relationId);
                     $staff = Staff::info();
-                    $wheres['owner_staff_id'] = $staff->id;
+                    $wheres[] = Db::raw("FIND_IN_SET($staff_id, owner_staff_id)");
                     break;
                 case 4:
                     $start = date('Y-m-d 00:00:00');
@@ -109,38 +115,33 @@ class Customer extends Base
                         if ($recordData >= 1) {
                             $relationId[] = $v['relation_id'];
                         }
-
                     }
                     $wheres['id'] = array('in', $relationId);
                     $staff = Staff::info();
-                    $wheres['owner_staff_id'] = $staff->id;
+                    $wheres[] = Db::raw("FIND_IN_SET($staff_id, owner_staff_id)");
                     break;
                 case 5:
                     $record = collection(Record::where(array('relation_type' => 1, 'next_time' => array('neq', '')))->column('relation_id'))->toArray();
                     $wheres['id'] = array('not in', $record);
                     $staff = Staff::info();
-                    $wheres['owner_staff_id'] = $staff->id;
+                    $wheres[] = Db::raw("FIND_IN_SET($staff_id, owner_staff_id)");
                     break;
                 default:
-                    $wheres['owner_staff_id'] = array('in', Staff::getMyStaffIds());
+                    $wheres[] = Db::raw("FIND_IN_SET($staff_id, owner_staff_id)");
                     break;
-
             }
-            $owner_staff_id = $wheres['owner_staff_id'];
-            unset($wheres['owner_staff_id']);
-            $list = $this->model->where($where)->with(['ownerStaff'])
-                ->where($wheres)->where(function ($query) use ($staff_id, $owner_staff_id, $type) {
-                    if ($type == 0) {//全部
-                        $query->where(['ro_staff_id' => ['like', "%,{$staff_id},%"]])
-                            ->whereOr('rw_staff_id', 'like', "%,{$staff_id},%")
-                            ->whereOr(['owner_staff_id' => $owner_staff_id]);
-                    } else {
-                        $query->where(['owner_staff_id' => $owner_staff_id]);
-                    }
-                })
+
+//            $list = $this->model->where($where)->with(['ownerStaff'])
+//                ->where($wheres)
+//                ->where('owner_staff_id != 0 and owner_staff_id is not null')
+//                ->order($sort, $order)->paginate($limit);
+            $list = $this->model->where($where)
+                ->where($wheres)
                 ->where('owner_staff_id != 0 and owner_staff_id is not null')
                 ->order($sort, $order)->paginate($limit);
+
             $rows = $list->items();
+
             foreach ($rows as &$v) {
                 $v['operation_team'] = 'read';
                 if ($v['owner_staff_id'] == $this->_staff->id ||
@@ -153,18 +154,25 @@ class Customer extends Base
                 } else {
                     $v['operation'] = 'read';//只读权限
                 }
+                if($v['create_staff_id'] == $this->_staff->id){
+                    $v['operation'] = 'update';//修改权限
+                }
+                $names = Staff::where('id', 'in', $v['owner_staff_id'])->column('name');
+                $v['owner_staff']['name'] = implode(',', $names);
 
             }
-            $result = array("total" => $list->total(), "rows" => $list->items());
+            $result = array("total" => $list->total(), "rows" => $list->items(),"staff_id" => $staff_id);
 
             return json($result);
         }
         $field = FormField::getFields(FormField::CUSTOMER_TYPE);
+        $this->assign('staff_group', $staff->group_ids);
         $this->assignconfig('fields', $field);
         return $this->view->fetch();
     }
 
 
+
     /**
      * 添加
      */
@@ -174,6 +182,7 @@ class Customer extends Base
             $params = $this->request->post("row/a");
             if ($params) {
                 $params = $this->preExcludeFields($params);
+
                 // 表单验证
                 if (($result = $this->qingdongValidate($params, 'Customer', 'create')) !== true) {
                     $this->error($result);
@@ -192,6 +201,7 @@ class Customer extends Base
                 if ($result !== true) {
                     $this->error($result);
                 }
+
                 $result = false;
                 Db::startTrans();
                 try {
@@ -222,6 +232,7 @@ class Customer extends Base
             }
             $this->error(__('Parameter %s can not be empty', ''));
         }
+
         $this->assign('form_data', Form::getDataValue(Form::CUSTOMER_TYPE));
         $remind = Remind::where(['type' => Remind::CUSTOMER_TYPE])->find();
         $staff_ids = $remind['staff_ids'] ?? '';
@@ -232,7 +243,6 @@ class Customer extends Base
         return $this->view->fetch();
     }
 
-
     /**
      * 修改
      */
@@ -244,12 +254,18 @@ class Customer extends Base
         if (empty($row)) {
             $this->error(__('No Results were found'));
         }
-        if (!in_array($row['owner_staff_id'], Staff::getMyStaffIds()) && $row['owner_staff_id'] != 0) {
+//        if (!in_array($row['owner_staff_id'], Staff::getMyStaffIds()) && $row['owner_staff_id'] != 0) {
+//
+//            if (!in_array($this->_staff->id, explode(',', $row['rw_staff_id'])) &&
+//                !in_array($this->_staff->id, explode(',', $row['ro_staff_id']))) {//是否在团队内
+//                $this->error('权限不足');
+//            }
+//        }
+        $staff = Staff::info();
+        $ownerarray = explode(',', $row['owner_staff_id']);
 
-            if (!in_array($this->_staff->id, explode(',', $row['rw_staff_id'])) &&
-                !in_array($this->_staff->id, explode(',', $row['ro_staff_id']))) {//是否在团队内
-                $this->error('权限不足');
-            }
+        if (!in_array($staff->id, $ownerarray)) {
+            $this->error('权限不足');
         }
         if ($this->request->isPost()) {
             $params = $this->request->post("row/a");
@@ -306,6 +322,7 @@ class Customer extends Base
      */
     public function stafflist()
     {
+
         $data = ['searchlist' => Staff::getList()];
         $this->success('', null, $data);
     }
@@ -366,6 +383,7 @@ class Customer extends Base
     public function batch_change($ids = null)
     {
         $ids = json_decode($ids, true);
+
         $ids = $this->model->where([
             'id' => ['in', $ids]
         ])->column('id');
@@ -373,7 +391,9 @@ class Customer extends Base
             $this->error(__('No Results were found'));
         }
         if ($this->request->isPost()) {
+
             $params = $this->request->post("row/a");
+
             if ($params) {
                 $params = $this->preExcludeFields($params);
 
@@ -414,9 +434,12 @@ class Customer extends Base
             $this->error(__('No Results were found'));
         }
         if (!in_array($row['owner_staff_id'], Staff::getMyStaffIds()) && $row['owner_staff_id'] != 0) {
-
-            if (!in_array($this->_staff->id, explode(',', $row['rw_staff_id'])) &&
-                !in_array($this->_staff->id, explode(',', $row['ro_staff_id']))) {//是否在团队内
+//
+//            if (!in_array($this->_staff->id, explode(',', $row['rw_staff_id'])) &&
+//                !in_array($this->_staff->id, explode(',', $row['ro_staff_id'])) ) {//是否在团队内
+//                $this->error('权限不足');
+//            }
+            if(!in_array($this->_staff->id, explode(',', $row['owner_staff_id']))){
                 $this->error('权限不足');
             }
         }
@@ -430,11 +453,14 @@ class Customer extends Base
             if (in_array($this->_staff->id, explode(',', $row['rw_staff_id']))) {
                 $row['operation_team'] = 'update';//可修改客户不可操作其他
             }
+
             $row['operation'] = 'update';//修改权限
         } else {
             $row['operation'] = 'read';//只读权限
         }
-
+        if($row['create_staff_id'] == $this->_staff->id){
+            $row['operation'] = 'update';//修改权限
+        }
         $form = Form::getDataValue(Form::CUSTOMER_TYPE, $row);
         foreach ($form as $ks => $vs) {
             //备注显示

+ 4 - 2
application/admin/controller/qingdong/customer/Leads.php

@@ -38,9 +38,11 @@ class Need extends Base
         $where['next_time'] = array(array('egt',date('Y-m-d 00:00:00')),array('lt',date('Y-m-d 23:59:59')));
         $where['follow_type'] = ['neq', '其它'];
         $where['status'] = 0;
+//        unset($where['create_staff_id']);
         // 待跟进客户
-        $where1['relation_type'] = 1;
-        $customerlist = Record::where($where)->where($where1)->column('relation_id');
+//        $where1['relation_type'] = 1;
+
+        $customerlist = Record::where($where)->column('relation_id');
         $customerlist1 = 0;
         if($customerlist){
             $whereExit['relation_id'] = array('in',$customerlist);

+ 16 - 0
application/admin/controller/qingdong/customer/Receivables.php

@@ -35,6 +35,7 @@ class Record extends Base {
         $busniess_id = input('busniess_id','','trim');
         //0:全部 1:我负责的 2:下属负责的 3:今日待跟进 4:今日已跟进
         $type = input('type',0);
+
         $this->request->filter(['strip_tags']);
         if ($this->request->isAjax()) {
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
@@ -84,16 +85,21 @@ class Record extends Base {
                     break;
                 default:
                     $wheres['create_staff_id'] =  array('in',Staff::getMyStaffIds());
+
                     break;
 
             }
 
             $wheres['relation_type'] = 1;
+
             if(isset($need) && $need =='customer'){
                 $staff = Staff::info();
                 $wheres['create_staff_id'] =  $staff->id;
+                $wheres['reminds_id'] = $staff->id;
                 $wheres['status'] = 0;
+
                 $wheres['next_time'] = array(array('egt',date('Y-m-d 00:00:00')),array('lt',date('Y-m-d 23:59:59')));
+
                 $customerlist = $this->model->where($wheres)->column('relation_id');
                 if($customerlist){
                     $whereExit['relation_id'] = array('in',$customerlist);
@@ -146,12 +152,19 @@ class Record extends Base {
                 $wheres['relation_id'] = $busniess_id;
                 unset($wheres['create_staff_id']);
             }
+            $staff = Staff::info();
+            if($staff->group_ids != 1 && $staff->group_ids != 9){
+                $wheres['create_staff_id'] =  $staff->id;
+            }
+
 
             $list   = $this->model->where($where)->where($wheres)->with(['staff','customer'])->order($sort, $order)->paginate($limit);
             foreach($list as $k=>$v){
                 if(!isset($v['customer']) || !$v['customer']){
                     $v['customer'] = array('id'=>'','name'=>'');
                 }
+                //获取staff名称
+                $v['staff_name'] = Staff::where(['id'=>$v['staff_id']])->value('name');
             }
             $row    = $list->items();
             $result = array("total" => $list->total(), "rows" => $row);
@@ -169,10 +182,13 @@ class Record extends Base {
         $relation_type=input('relation_type',1);
         if ($this->request->isPost()) {
             $params = $this->request->post('row/a');
+            $params['follow_type'] = 1;
+
             // 表单验证
             if (($result = $this->qingdongValidate($params, 'Record', 'create')) !== true) {
                 $this->error($result);
             }
+
             if(!empty($params['files'])){
                 $params['files']=File::getId($params['files']);
             }

+ 138 - 137
application/admin/controller/qingdong/customer/Seas.php

@@ -32,146 +32,147 @@
 			</div>
 		</div>
 
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label>客户签约人: </label>
-				<input type="hidden" name="row[contacts_id]" data-rule="required"  value="" >
-				<div class="form-control">
-					<a href="javascript:void(0)" class="select-contacts" data-name="row[contacts_id]"
-					   data-url="qingdong/customer/contacts/index?isselect=1"  >【请点击选择】</a>
-				</div>
-
-			</div>
-		</div>
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label>商机名称:</label>
-
-				<input type="hidden" name="row[business_id]" value="" >
-				<div class="form-control">
-					<a href="javascript:void(0)" class="select-business" data-name="row[business_id]"
-					   data-url="qingdong/customer/business/index?isselect=1"  >【请点击选择】</a>
-				</div>
-			</div>
-		</div>
-
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label for="order_staff">公司签约人:</label>
-				<select id="order_staff" name="row[order_staff_id]" data-rule="required" class="form-control selectpicker" data-live-search="true">
-					<option value="">请选择</option>
-					{foreach name="staffs" item="val"}
-					<option value="{$val.id}">{$val.name}</option>
-					{/foreach}
-				</select>
-
-			</div>
-		</div>
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>客户签约人: </label>-->
+<!--				<input type="hidden" name="row[contacts_id]" data-rule="required"  value="" >-->
+<!--				<div class="form-control">-->
+<!--					<a href="javascript:void(0)" class="select-contacts" data-name="row[contacts_id]"-->
+<!--					   data-url="qingdong/customer/contacts/index?isselect=1"  >【请点击选择】</a>-->
+<!--				</div>-->
+
+<!--			</div>-->
+<!--		</div>-->
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>商机名称:</label>-->
+
+<!--				<input type="hidden" name="row[business_id]" value="" >-->
+<!--				<div class="form-control">-->
+<!--					<a href="javascript:void(0)" class="select-business" data-name="row[business_id]"-->
+<!--					   data-url="qingdong/customer/business/index?isselect=1"  >【请点击选择】</a>-->
+<!--				</div>-->
+<!--			</div>-->
+<!--		</div>-->
+
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label for="order_staff">公司签约人:</label>-->
+<!--				<select id="order_staff" name="row[order_staff_id][]" data-rule="required" class="form-control selectpicker" data-live-search="true" multiple="true">-->
+<!--&lt;!&ndash;					<option value="">请选择</option>&ndash;&gt;-->
+<!--					{foreach name="staffs" item="val"}-->
+<!--					<option value="{$val.id}">{$val.name}</option>-->
+<!--					{/foreach}-->
+<!--				</select>-->
+
+
+<!--			</div>-->
+<!--		</div>-->
 
 		{include file="qingdong/common/form_add" /}
 
-		<div class="col-xs-12 col-sm-12">
-			<div class="form-group col-sm-10">
-				<label>产品列表:</label>
-			</div>
-		</div>
-		<table class="table table-responsive fieldlist" data-name="row[product]" data-template="testtpl2" data-tag="tr">
-			<tr>
-				<td>商品名称</td>
-				<td>零售价</td>
-				<td>批发价</td>
-				<td>产品</td>
-				<td>规格</td>
-				<td>数量</td>
-				<td></td>
-			</tr>
-			<tr>
-				<td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
-			</tr>
-			<textarea name="row[product]" class="form-control hide" cols="30" rows="5">[]</textarea>
-		</table>
-
-		{if condition="$ratio neq null"}
-		<div class="col-xs-12 col-sm-12">
-			<div class="form-group col-sm-8">
-
-				<blockquote style="padding: 2px 10px;">
-					<div class="form-inline">
-						<label for="ratio_id">业绩分成:</label>
-						<select name="row[ratio_id]" id="ratio_id" class="form-control" >
-							<option value="0">无</option>
-							{foreach name="ratio" item="val"}
-							<option value="{$val.id}" data-ratio='{$val.ratio|htmlentities}' >{$val.name}</option>
-							{/foreach}
-						</select>
-					</div>
-				</blockquote>
-
-				<table class="table table_ratio" style="width: 300px;display: none">
-					<thead>
-					<tr>
-						<th width="80">比例</th>
-						<th>团队成员</th>
-					</tr>
-					</thead>
-					<tbody>
-
-					</tbody>
-				</table>
-			</div>
-		</div>
-		{/if}
-		{if condition="$flow.status == 1"}
-
-		<div class="col-xs-12 col-sm-12">
-			<div class="form-group col-sm-10">
-
-				<blockquote style="padding: 2px 10px;">
-					<p>审核信息 <span class="label label-danger">固定审批流</span></p>
-				</blockquote>
-
-				{foreach name="$flow.stepList" item="val"}
-				<div class="row">
-					<div class="level">
-						<span>第{$val.order_id}级</span><br>
-						{if condition="$val.status == 3"}
-						<span class="label label-info">发起人主管</span>
-						{elseif condition="$val.status == 1"/}
-						<span class="label label-info">{:count($val['stafflist'])}人或签</span>
-						{else/}
-						<span class="label label-info">{:count($val['stafflist'])}人并签</span>
-						{/if}
-					</div>
-					{foreach name="$val.stafflist" item="ves"}
-						<div class="stafflist">
-							<img src="{$ves.img}" class="img-circle">
-							{$ves.name}
-						</div>
-					{/foreach}
-				</div>
-				<hr>
-				{/foreach}
-
-
-			</div>
-		</div>
-
-		{else/}
-
-		<div class="col-xs-12 col-sm-12">
-			<div class="form-group col-sm-8">
-
-				<blockquote style="padding: 2px 10px;">
-					<p>审核信息 <span class="label label-danger">发起人自选</span></p>
-				</blockquote>
-				<div style="margin-left: 20px">
-					<input data-source="qingdong/customer/contract/getstaff"
-						   class="form-control selectpage" placeholder="请选择审批人" data-pagination="true" data-page-size="10" name="row[flow_staff_ids]" type="text" data-multiple="true">
-				</div>
-
-			</div>
-		</div>
-		{/if}
+<!--		<div class="col-xs-12 col-sm-12">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>产品列表:</label>-->
+<!--			</div>-->
+<!--		</div>-->
+<!--		<table class="table table-responsive fieldlist" data-name="row[product]" data-template="testtpl2" data-tag="tr">-->
+<!--			<tr>-->
+<!--				<td>服务名称</td>-->
+<!--				<td>零售价</td>-->
+<!--				<td>批发价</td>-->
+<!--				<td>产品</td>-->
+<!--				<td>规格</td>-->
+<!--				<td>数量</td>-->
+<!--				<td></td>-->
+<!--			</tr>-->
+<!--			<tr>-->
+<!--				<td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>-->
+<!--			</tr>-->
+<!--			<textarea name="row[product]" class="form-control hide" cols="30" rows="5">[]</textarea>-->
+<!--		</table>-->
+
+<!--		{if condition="$ratio neq null"}-->
+<!--		<div class="col-xs-12 col-sm-12">-->
+<!--			<div class="form-group col-sm-8">-->
+
+<!--				<blockquote style="padding: 2px 10px;">-->
+<!--					<div class="form-inline">-->
+<!--						<label for="ratio_id">业绩分成:</label>-->
+<!--						<select name="row[ratio_id]" id="ratio_id" class="form-control" >-->
+<!--							<option value="0">无</option>-->
+<!--							{foreach name="ratio" item="val"}-->
+<!--							<option value="{$val.id}" data-ratio='{$val.ratio|htmlentities}' >{$val.name}</option>-->
+<!--							{/foreach}-->
+<!--						</select>-->
+<!--					</div>-->
+<!--				</blockquote>-->
+
+<!--				<table class="table table_ratio" style="width: 300px;display: none">-->
+<!--					<thead>-->
+<!--					<tr>-->
+<!--						<th width="80">比例</th>-->
+<!--						<th>团队成员</th>-->
+<!--					</tr>-->
+<!--					</thead>-->
+<!--					<tbody>-->
+
+<!--					</tbody>-->
+<!--				</table>-->
+<!--			</div>-->
+<!--		</div>-->
+<!--		{/if}-->
+<!--		{if condition="$flow.status == 1"}-->
+
+<!--		<div class="col-xs-12 col-sm-12">-->
+<!--			<div class="form-group col-sm-10">-->
+
+<!--				<blockquote style="padding: 2px 10px;">-->
+<!--					<p>审核信息 <span class="label label-danger">固定审批流</span></p>-->
+<!--				</blockquote>-->
+
+<!--				{foreach name="$flow.stepList" item="val"}-->
+<!--				<div class="row">-->
+<!--					<div class="level">-->
+<!--						<span>第{$val.order_id}级</span><br>-->
+<!--						{if condition="$val.status == 3"}-->
+<!--						<span class="label label-info">发起人主管</span>-->
+<!--						{elseif condition="$val.status == 1"/}-->
+<!--						<span class="label label-info">{:count($val['stafflist'])}人或签</span>-->
+<!--						{else/}-->
+<!--						<span class="label label-info">{:count($val['stafflist'])}人并签</span>-->
+<!--						{/if}-->
+<!--					</div>-->
+<!--					{foreach name="$val.stafflist" item="ves"}-->
+<!--						<div class="stafflist">-->
+<!--							<img src="{$ves.img}" class="img-circle">-->
+<!--							{$ves.name}-->
+<!--						</div>-->
+<!--					{/foreach}-->
+<!--				</div>-->
+<!--				<hr>-->
+<!--				{/foreach}-->
+
+
+<!--			</div>-->
+<!--		</div>-->
+
+<!--		{else/}-->
+
+<!--		<div class="col-xs-12 col-sm-12">-->
+<!--			<div class="form-group col-sm-8">-->
+
+<!--				<blockquote style="padding: 2px 10px;">-->
+<!--					<p>审核信息 <span class="label label-danger">发起人自选</span></p>-->
+<!--				</blockquote>-->
+<!--				<div style="margin-left: 20px">-->
+<!--					<input data-source="qingdong/customer/contract/getstaff"-->
+<!--						   class="form-control selectpage" placeholder="请选择审批人" data-pagination="true" data-page-size="10" name="row[flow_staff_ids]" type="text" data-multiple="true">-->
+<!--				</div>-->
+
+<!--			</div>-->
+<!--		</div>-->
+<!--		{/if}-->
 
 
 	</div>

+ 6 - 18
application/admin/view/qingdong/customer/contract/detail.html

@@ -299,14 +299,12 @@
             <span class="text-muted">客户名称</span>
             <p>{if condition="isset($row.customer.name)"}{$row.customer.name}{/if}</p>
         </div>
-        <div class="form-group">
-            <span class="text-muted">商机名称</span>
-            <p>{if condition="isset($row.business.name)"}{$row.business.name}{/if}</p>
-        </div>
+        {if $role == 1 || $role == 2}
         <div class="form-group">
             <span class="text-muted">合同金额(元)</span>
             <p>{$row.money}</p>
         </div>
+
         <div class="form-group">
             <span class="text-muted">回款金额(元)</span>
             <p>{$row.repayment_money}</p>
@@ -315,6 +313,7 @@
             <span class="text-muted">未回款金额(元)</span>
             <p>{$row.no_money}</p>
         </div>
+        {/if}
         <div class="form-group">
             <span class="text-muted">下单时间</span>
             <p>{$row.order_date}</p>
@@ -330,9 +329,9 @@
             <li role="presentation" class="active"><a href="#record" aria-controls="home" role="tab" data-toggle="tab">跟进记录</a></li>
             <li role="presentation"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
             <li role="presentation"><a href="#product" aria-controls="profile" role="tab" data-toggle="tab">产品明细</a></li>
-
+            {if $role == 1 && $role == 2}
             <li role="presentation"><a href="#settings2" aria-controls="profile" role="tab" data-toggle="tab">回款信息</a></li>
-
+            {/if}
             <li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>
         </ul>
 
@@ -366,19 +365,8 @@
                 <div class="form-group">
                     {include file="qingdong/common/form_detail" /}
 
-                    <div class="col-xs-6 col-sm-5">
-                        <div class="form-group col-sm-10">
-                            <span class="text-muted">客户签约人:</span>
-                            <span class="text-black">{$row.contacts.name}</span>
-                        </div>
-                    </div>
 
-                    <div class="col-xs-6 col-sm-5">
-                        <div class="form-group col-sm-10">
-                            <span class="text-muted">公司签约人:</span>
-                            <span class="text-black">{$row.order_staff.name}</span>
-                        </div>
-                    </div>
+
                     {if condition="$row.ratios neq null"}
                     <div class="col-xs-12 col-sm-10">
 

+ 154 - 154
application/admin/view/qingdong/customer/contract/edit.html

@@ -39,163 +39,163 @@
             </div>
         </div>
 
-        <div class="col-xs-12 col-sm-6">
-            <div class="form-group col-sm-10">
-                <label>客户签约人: </label>
-                <input type="hidden" name="row[contacts_id]" data-rule="required"  value="{$row.contacts_id}" >
-                <div class="form-control">
-                    <a href="javascript:void(0)" class="select-contacts" data-name="row[contacts_id]"
-                       data-url="qingdong/customer/contacts/index?isselect=1"  >
-                        {if condition="$row.contacts"}{$row.contacts.name}{else/}【请点击选择】{/if}
-                    </a>
-                </div>
-
-            </div>
-        </div>
-        <div class="col-xs-12 col-sm-6">
-            <div class="form-group col-sm-10">
-                <label>商机名称:</label>
-
-                <input type="hidden" name="row[business_id]" value="" >
-                <div class="form-control">
-                    <a href="javascript:void(0)" class="select-business" data-name="row[business_id]"
-                       data-url="qingdong/customer/business/index?isselect=1"  >
-                        {if condition="$row.business"}{$row.business.name}{else/}【请点击选择】{/if}
-                    </a>
-                </div>
-            </div>
-        </div>
-
-        <div class="col-xs-12 col-sm-6">
-            <div class="form-group col-sm-10">
-                <label for="order_staff">公司签约人:</label>
-                <select id="order_staff" name="row[order_staff_id]" data-rule="required" class="form-control selectpicker" data-live-search="true">
-                    <option value="">请选择</option>
-                    {foreach name="staffs" item="val"}
-                    <option value="{$val.id}" {eq name="$val.id" value="$row.order_staff_id"}selected{/eq} >{$val.name}</option>
-                    {/foreach}
-                </select>
-
-            </div>
-        </div>
+<!--        <div class="col-xs-12 col-sm-6">-->
+<!--            <div class="form-group col-sm-10">-->
+<!--                <label>客户签约人: </label>-->
+<!--                <input type="hidden" name="row[contacts_id]" data-rule="required"  value="{$row.contacts_id}" >-->
+<!--                <div class="form-control">-->
+<!--                    <a href="javascript:void(0)" class="select-contacts" data-name="row[contacts_id]"-->
+<!--                       data-url="qingdong/customer/contacts/index?isselect=1"  >-->
+<!--                        {if condition="$row.contacts"}{$row.contacts.name}{else/}【请点击选择】{/if}-->
+<!--                    </a>-->
+<!--                </div>-->
+
+<!--            </div>-->
+<!--        </div>-->
+<!--        <div class="col-xs-12 col-sm-6">-->
+<!--            <div class="form-group col-sm-10">-->
+<!--                <label>商机名称:</label>-->
+
+<!--                <input type="hidden" name="row[business_id]" value="" >-->
+<!--                <div class="form-control">-->
+<!--                    <a href="javascript:void(0)" class="select-business" data-name="row[business_id]"-->
+<!--                       data-url="qingdong/customer/business/index?isselect=1"  >-->
+<!--                        {if condition="$row.business"}{$row.business.name}{else/}【请点击选择】{/if}-->
+<!--                    </a>-->
+<!--                </div>-->
+<!--            </div>-->
+<!--        </div>-->
+
+<!--        <div class="col-xs-12 col-sm-6">-->
+<!--            <div class="form-group col-sm-10">-->
+<!--                <label for="order_staff">公司签约人:</label>-->
+<!--                <select id="order_staff" name="row[order_staff_id]" data-rule="required" class="form-control selectpicker" data-live-search="true">-->
+<!--                    <option value="">请选择</option>-->
+<!--                    {foreach name="staffs" item="val"}-->
+<!--                    <option value="{$val.id}" {eq name="$val.id" value="$row.order_staff_id"}selected{/eq} >{$val.name}</option>-->
+<!--                    {/foreach}-->
+<!--                </select>-->
+
+<!--            </div>-->
+<!--        </div>-->
 
         {include file="qingdong/common/form_edit" /}
 
-        <div class="col-xs-12 col-sm-12">
-            <div class="form-group col-sm-10">
-                <label>产品列表:</label>
-            </div>
-        </div>
-        <div class="col-xs-12 col-sm-12">
-            <div class="form-group col-sm-12">
-                <table class="table table-responsive fieldlist" data-name="row[product]" data-template="testtpl2" data-tag="tr">
-                    <tr>
-                        <td>商品名称</td>
-                        <td>零售价</td>
-                        <td>批发价</td>
-                        <td>产品</td>
-                        <td>规格</td>
-                        <td>数量</td>
-                        <td></td>
-                    </tr>
-                    <tr>
-                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
-                    </tr>
-                    <textarea name="row[product]" class="form-control hide" cols="30"
-                              rows="5">{$row.product}</textarea>
-                </table>
-            </div>
-        </div>
-
-        <div class="col-xs-12 col-sm-12">
-            <div class="form-group col-sm-8">
-
-                <blockquote style="padding: 2px 10px;">
-                    <div class="form-inline">
-                        <label>业绩分成:</label>
-                        <select name="row[ratio_id]" id="ratio_id" class="form-control" >
-                            <option value="0">无</option>
-                            {foreach name="ratio" item="val"}
-                            <option value="{$val.id}" data-ratio='{$val.ratio|htmlentities}' >{$val.name}</option>
-                            {/foreach}
-                        </select>
-                    </div>
-                </blockquote>
-
-                <table class="table table_ratio" style="width: 300px;">
-                    <thead>
-                    <tr>
-                        <th width="80">比例</th>
-                        <th>团队成员</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                        {foreach name="$row.ratios" item="val" key="index"}
-                        <tr>
-                            <td>{$val.ratio}%<input type='hidden' name='row[ratios][{$index}][ratio]'
-                                                    value='{$val.ratio}'></td>
-                            <td><input  data-source="qingdong/customer/customer/getteam"
-                                       class="form-control selectpage" name="row[ratios][{$index}][staff_id]"
-                                       placeholder="请选择团队成员" type="text" value="{$val.staff_id}" ></td>
-                        </tr>
-                        {/foreach}
-                    </tbody>
-                </table>
-            </div>
-        </div>
-        {if condition="$flow.status == 1"}
-
-        <div class="col-xs-12 col-sm-12">
-            <div class="form-group col-sm-10">
-
-                <blockquote style="padding: 2px 10px;">
-                    <p>审核信息 <span class="label label-danger">固定审批流</span></p>
-                </blockquote>
-
-                {foreach name="$flow.stepList" item="val"}
-                <div class="row">
-                    <div class="level">
-                        <span>第{$val.order_id}级</span><br>
-                        {if condition="$val.status == 3"}
-                        <span class="label label-info">发起人主管</span>
-                        {elseif condition="$val.status == 1"/}
-                        <span class="label label-info">{:count($val['stafflist'])}人或签</span>
-                        {else/}
-                        <span class="label label-info">{:count($val['stafflist'])}人并签</span>
-                        {/if}
-                    </div>
-                    {foreach name="$val.stafflist" item="ves"}
-                    <div class="stafflist">
-                        <img src="{$ves.img}" class="img-circle">
-                        {$ves.name}
-                    </div>
-                    {/foreach}
-                </div>
-                <hr>
-                {/foreach}
-
-
-            </div>
-        </div>
-
-        {else/}
-
-        <div class="col-xs-12 col-sm-12">
-            <div class="form-group col-sm-8">
-
-                <blockquote style="padding: 2px 10px;">
-                    <p>审核信息 <span class="label label-danger">发起人自选</span></p>
-                </blockquote>
-                <div style="margin-left: 20px">
-                    <input data-source="qingdong/customer/contract/getstaff"
-                           class="form-control selectpage" placeholder="请选择审批人" data-pagination="true" data-page-size="10" name="row[flow_staff_ids]" type="text" value="{$row.flow_staff_ids}"  data-multiple="true">
-                </div>
-
-            </div>
-        </div>
-        {/if}
-
-    </div>
+<!--        <div class="col-xs-12 col-sm-12">-->
+<!--            <div class="form-group col-sm-10">-->
+<!--                <label>产品列表:</label>-->
+<!--            </div>-->
+<!--        </div>-->
+<!--        <div class="col-xs-12 col-sm-12">-->
+<!--            <div class="form-group col-sm-12">-->
+<!--                <table class="table table-responsive fieldlist" data-name="row[product]" data-template="testtpl2" data-tag="tr">-->
+<!--                    <tr>-->
+<!--                        <td>商品名称</td>-->
+<!--                        <td>零售价</td>-->
+<!--                        <td>批发价</td>-->
+<!--                        <td>产品</td>-->
+<!--                        <td>规格</td>-->
+<!--                        <td>数量</td>-->
+<!--                        <td></td>-->
+<!--                    </tr>-->
+<!--                    <tr>-->
+<!--                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>-->
+<!--                    </tr>-->
+<!--                    <textarea name="row[product]" class="form-control hide" cols="30"-->
+<!--                              rows="5">{$row.product}</textarea>-->
+<!--                </table>-->
+<!--            </div>-->
+<!--        </div>-->
+
+<!--        <div class="col-xs-12 col-sm-12">-->
+<!--            <div class="form-group col-sm-8">-->
+
+<!--                <blockquote style="padding: 2px 10px;">-->
+<!--                    <div class="form-inline">-->
+<!--                        <label>业绩分成:</label>-->
+<!--                        <select name="row[ratio_id]" id="ratio_id" class="form-control" >-->
+<!--                            <option value="0">无</option>-->
+<!--                            {foreach name="ratio" item="val"}-->
+<!--                            <option value="{$val.id}" data-ratio='{$val.ratio|htmlentities}' >{$val.name}</option>-->
+<!--                            {/foreach}-->
+<!--                        </select>-->
+<!--                    </div>-->
+<!--                </blockquote>-->
+
+<!--                <table class="table table_ratio" style="width: 300px;">-->
+<!--                    <thead>-->
+<!--                    <tr>-->
+<!--                        <th width="80">比例</th>-->
+<!--                        <th>团队成员</th>-->
+<!--                    </tr>-->
+<!--                    </thead>-->
+<!--                    <tbody>-->
+<!--                        {foreach name="$row.ratios" item="val" key="index"}-->
+<!--                        <tr>-->
+<!--                            <td>{$val.ratio}%<input type='hidden' name='row[ratios][{$index}][ratio]'-->
+<!--                                                    value='{$val.ratio}'></td>-->
+<!--                            <td><input  data-source="qingdong/customer/customer/getteam"-->
+<!--                                       class="form-control selectpage" name="row[ratios][{$index}][staff_id]"-->
+<!--                                       placeholder="请选择团队成员" type="text" value="{$val.staff_id}" ></td>-->
+<!--                        </tr>-->
+<!--                        {/foreach}-->
+<!--                    </tbody>-->
+<!--                </table>-->
+<!--            </div>-->
+<!--        </div>-->
+<!--        {if condition="$flow.status == 1"}-->
+
+<!--        <div class="col-xs-12 col-sm-12">-->
+<!--            <div class="form-group col-sm-10">-->
+
+<!--                <blockquote style="padding: 2px 10px;">-->
+<!--                    <p>审核信息 <span class="label label-danger">固定审批流</span></p>-->
+<!--                </blockquote>-->
+
+<!--                {foreach name="$flow.stepList" item="val"}-->
+<!--                <div class="row">-->
+<!--                    <div class="level">-->
+<!--                        <span>第{$val.order_id}级</span><br>-->
+<!--                        {if condition="$val.status == 3"}-->
+<!--                        <span class="label label-info">发起人主管</span>-->
+<!--                        {elseif condition="$val.status == 1"/}-->
+<!--                        <span class="label label-info">{:count($val['stafflist'])}人或签</span>-->
+<!--                        {else/}-->
+<!--                        <span class="label label-info">{:count($val['stafflist'])}人并签</span>-->
+<!--                        {/if}-->
+<!--                    </div>-->
+<!--                    {foreach name="$val.stafflist" item="ves"}-->
+<!--                    <div class="stafflist">-->
+<!--                        <img src="{$ves.img}" class="img-circle">-->
+<!--                        {$ves.name}-->
+<!--                    </div>-->
+<!--                    {/foreach}-->
+<!--                </div>-->
+<!--                <hr>-->
+<!--                {/foreach}-->
+
+
+<!--            </div>-->
+<!--        </div>-->
+
+<!--        {else/}-->
+
+<!--        <div class="col-xs-12 col-sm-12">-->
+<!--            <div class="form-group col-sm-8">-->
+
+<!--                <blockquote style="padding: 2px 10px;">-->
+<!--                    <p>审核信息 <span class="label label-danger">发起人自选</span></p>-->
+<!--                </blockquote>-->
+<!--                <div style="margin-left: 20px">-->
+<!--                    <input data-source="qingdong/customer/contract/getstaff"-->
+<!--                           class="form-control selectpage" placeholder="请选择审批人" data-pagination="true" data-page-size="10" name="row[flow_staff_ids]" type="text" value="{$row.flow_staff_ids}"  data-multiple="true">-->
+<!--                </div>-->
+
+<!--            </div>-->
+<!--        </div>-->
+<!--        {/if}-->
+
+<!--    </div>-->
 
 
     <div class="form-group layer-footer">

+ 6 - 6
application/admin/view/qingdong/customer/contract/import.html

@@ -4,11 +4,11 @@
     <div class="panel-heading">
         <ul class="nav nav-tabs">
             <li class="active"><a href="#first" data-toggle="tab">全部</a></li>
-            <li><a href="#second" data-toggle="tab">我创建的</a></li>
-            <li><a href="#third" data-toggle="tab">下属创建的</a></li>
-            <li><a href="#four" data-toggle="tab">今日待跟进</a></li>
-            <li><a href="#five" data-toggle="tab">今日已跟进</a></li>
-            <li><a href="#six" data-toggle="tab">从未跟进的</a></li>
+<!--            <li><a href="#second" data-toggle="tab">我创建的</a></li>-->
+<!--            <li><a href="#third" data-toggle="tab">下属创建的</a></li>-->
+<!--            <li><a href="#four" data-toggle="tab">今日待跟进</a></li>-->
+<!--            <li><a href="#five" data-toggle="tab">今日已跟进</a></li>-->
+<!--            <li><a href="#six" data-toggle="tab">从未跟进的</a></li>-->
         </ul>
     </div>
     {:build_heading()}
@@ -101,7 +101,7 @@
                         <span class="contract_money" style="display:none">合同总金额:<strong class="allmoney"></strong> &nbsp;&nbsp;&nbsp;&nbsp; 已回款金额:<strong class="repayment_money"></strong> &nbsp;&nbsp;&nbsp;&nbsp; 未回款金额:<strong class="no_money"></strong></span>
                     </div>
                     <table id="table5" class="table table-striped table-bordered table-hover table-nowrap"
-                           width="100%">
+                           width="100%" >
                     </table>
                 </div>
             </div>

+ 30 - 30
application/admin/view/qingdong/customer/contract/words.html

@@ -12,36 +12,36 @@
 		{include file="qingdong/common/form_add" /}
 
 
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label>地理位置:</label>
-				<div class="input-group">
-					<input  id="address_text"  placeholder="请选择地理地址" class="form-control" disabled type="text"/>
-					<div class="input-group-addon no-border no-padding">
-					<span><button type="button" class="btn btn-primary" id="fachoose-map" >
-						<i class="fa fa-list"></i> {:__('Choose')}</button></span>
-					</div>
-				</div>
-				<input id="lng" name="row[lng]" type="hidden" value=""  >
-				<input id="lat" name="row[lat]" type="hidden" value=""  >
-				<input id="address" name="row[address]" type="hidden" value=""  >
-			</div>
-		</div>
-
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label >详细地址:</label>
-				<input  placeholder="请输入详细地址" id="address_detail" class="form-control" name="row[address_detail]" type="text"/>
-			</div>
-		</div>
-
-		<div class="col-xs-12 col-sm-12">
-			<div class="form-group col-sm-10">
-				<label >提醒谁看:</label>
-
-				{:build_select('row[reminds_id]', $staff, $staff_ids, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'', 'data-live-search'=>'true'])}
-			</div>
-		</div>
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>地理位置:</label>-->
+<!--				<div class="input-group">-->
+<!--					<input  id="address_text"  placeholder="请选择地理地址" class="form-control" disabled type="text"/>-->
+<!--					<div class="input-group-addon no-border no-padding">-->
+<!--					<span><button type="button" class="btn btn-primary" id="fachoose-map" >-->
+<!--						<i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
+<!--					</div>-->
+<!--				</div>-->
+<!--				<input id="lng" name="row[lng]" type="hidden" value=""  >-->
+<!--				<input id="lat" name="row[lat]" type="hidden" value=""  >-->
+<!--				<input id="address" name="row[address]" type="hidden" value=""  >-->
+<!--			</div>-->
+<!--		</div>-->
+
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label >详细地址:</label>-->
+<!--				<input  placeholder="请输入详细地址" id="address_detail" class="form-control" name="row[address_detail]" type="text"/>-->
+<!--			</div>-->
+<!--		</div>-->
+
+<!--		<div class="col-xs-12 col-sm-12">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label >提醒谁看:</label>-->
+
+<!--				{:build_select('row[reminds_id]', $staff, $staff_ids, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'', 'data-live-search'=>'true'])}-->
+<!--			</div>-->
+<!--		</div>-->
 	</div>
 
 

+ 1 - 2
application/admin/view/qingdong/customer/customer/addteam.html

@@ -11,8 +11,7 @@
 	<div class="col-xs-12 col-sm-6 form-group-selects">
 		<div class="form-group col-sm-10">
 			<label for="c-staff_id">变更负责人为:</label>
-			<select name="row[owner_staff_id]" id="c-staff_id" class="form-control selectpicker" data-live-search="true">
-				<option value="">请选择</option>
+			<select name="row[owner_staff_id][]" id="c-staff_id" class="form-control selectpicker" data-live-search="true" multiple="true">
 				{foreach name="staffs" item="val"}
 				<option value="{$val.id}"  >{$val.name}</option>
 				{/foreach}

+ 1 - 1
application/admin/view/qingdong/customer/customer/change.html

@@ -9,7 +9,7 @@
 	<div class="col-xs-12 col-sm-6">
 		<div class="form-group col-sm-10">
 			<label for="c-staff_id">变更负责人为:</label>
-			<select name="row[owner_staff_id]" id="c-staff_id" class="form-control selectpicker" data-live-search="true">
+			<select name="row[owner_staff_id]" id="c-staff_id" class="form-control selectpicker" data-live-search="true" >
 				<option value="">请选择</option>
 				{foreach name="staffs" item="val"}
 				<option value="{$val.id}" {eq name="val.id" value="$row.owner_staff_id" }selected{/eq} >{$val.name}</option>

+ 22 - 15
application/admin/view/qingdong/customer/customer/detail.html

@@ -78,20 +78,20 @@
 				<p>{$row.level}星</p>
 			</div>
 
-			<div class="form-group">
-				<span class="text-muted">跟进状态</span>
-				<p>{$row.follow}</p>
-			</div>
+<!--			<div class="form-group">-->
+<!--				<span class="text-muted">跟进状态</span>-->
+<!--				<p>{$row.follow}</p>-->
+<!--			</div>-->
 
 			<div class="form-group">
 				<span class="text-muted">创建人</span>
 				<p>{if condition="isset($row.create_staff.name)"}{$row.create_staff.name}{/if}</p>
 			</div>
 
-			<div class="form-group">
-				<span class="text-muted">负责人</span>
-				<p>{if condition="isset($row.owner_staff.name)"}{$row.owner_staff.name}{/if}</p>
-			</div>
+<!--			<div class="form-group">-->
+<!--				<span class="text-muted">负责人</span>-->
+<!--				<p>{if condition="isset($row.owner_staff.name)"}{$row.owner_staff.name}{/if}</p>-->
+<!--			</div>-->
 			<div class="form-group">
 				<span class="text-muted">更新时间</span>
 				<p>{notempty name="row.updatetime"}
@@ -104,25 +104,31 @@
 	<div>
 
 		<ul class="nav nav-tabs" role="tablist">
+
 			<li role="presentation" class="active"><a href="#record" aria-controls="home" role="tab" data-toggle="tab">跟进记录</a></li>
-			<li role="presentation"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
+
+			<li role="presentation" ><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
 			<li role="presentation"><a href="#contacts" aria-controls="messages" role="tab" data-toggle="tab">联系人</a></li>
-			<li role="presentation"><a href="#settings7" aria-controls="settings" role="tab" data-toggle="tab">商机</a></li>
+<!--			<li role="presentation"><a href="#settings7" aria-controls="settings" role="tab" data-toggle="tab">商机</a></li>-->
+			{if condition="$row.operation == 'update'"}
 			<li role="presentation"><a href="#settings1" aria-controls="settings" role="tab" data-toggle="tab">合同</a></li>
-			<li role="presentation"><a href="#settings5" aria-controls="settings" role="tab" data-toggle="tab">费用</a></li>
+			{/if}
+<!--			<li role="presentation"><a href="#settings5" aria-controls="settings" role="tab" data-toggle="tab">费用</a></li>-->
+			{if condition="$row.operation == 'update'"}
 			<li role="presentation"><a href="#settings2" aria-controls="settings" role="tab" data-toggle="tab">回款信息</a></li>
+			{/if}
 			{if condition="$row.operation == 'update' && $row.operation_team == 'read'"}
 			<li role="presentation"><a href="#team" aria-controls="settings" role="tab"
 									   data-toggle="tab">相关团队</a></li>
 			{/if}
-			<li role="presentation"><a href="#settings3" aria-controls="settings" role="tab" data-toggle="tab">附件</a></li>
-			<li role="presentation"><a href="#settings6" aria-controls="settings" role="tab" data-toggle="tab">签到记录</a></li>
-			<li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>
+<!--			<li role="presentation"><a href="#settings3" aria-controls="settings" role="tab" data-toggle="tab">附件</a></li>-->
+<!--			<li role="presentation"><a href="#settings6" aria-controls="settings" role="tab" data-toggle="tab">签到记录</a></li>-->
+<!--			<li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>-->
 		</ul>
 
 		<div class="tab-content" style="overflow-y: scroll;height:565px">
 			<div role="tabpanel" class="tab-pane fade active in panel-body" id="record">
-
+				{if condition="$row.operation == 'update'"}
 				<div id="toolbar_records" class="toolbar">
 					{:build_toolbar('refresh')}
 					{if condition="$row.operation == 'update'"}
@@ -130,6 +136,7 @@
 					   data-url="qingdong/customer/record/add?ids={$row.id}" data-title="新建跟进" data-refresh="true" data-area=["90%","90%"]>新建跟进</a>
 					{/if}
 				</div>
+				{/if}
 				<table id="records" class="table table-striped table-bordered table-hover table-nowrap"
 					   width="100%">
 				</table>

+ 21 - 21
application/admin/view/qingdong/customer/customer/edit.html

@@ -11,28 +11,28 @@
 	<div class="form-group">
 		{include file="qingdong/common/form_edit" /}
 
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label>地理位置:</label>
-				<div class="input-group">
-					<input  id="address_text"  placeholder="请选择地理地址" class="form-control" disabled type="text" value="{$row.address}"/>
-					<div class="input-group-addon no-border no-padding">
-					<span><button type="button" class="btn btn-primary" id="fachoose-map" >
-						<i class="fa fa-list"></i> {:__('Choose')}</button></span>
-					</div>
-				</div>
-				<input id="lng" name="row[lng]" type="hidden" value="{$row.lng}"  >
-				<input id="lat" name="row[lat]" type="hidden" value="{$row.lat}"  >
-				<input id="address" name="row[address]" type="hidden" value="{$row.address}"  >
-			</div>
-		</div>
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>地理位置:</label>-->
+<!--				<div class="input-group">-->
+<!--					<input  id="address_text"  placeholder="请选择地理地址" class="form-control" disabled type="text" value="{$row.address}"/>-->
+<!--					<div class="input-group-addon no-border no-padding">-->
+<!--					<span><button type="button" class="btn btn-primary" id="fachoose-map" >-->
+<!--						<i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
+<!--					</div>-->
+<!--				</div>-->
+<!--				<input id="lng" name="row[lng]" type="hidden" value="{$row.lng}"  >-->
+<!--				<input id="lat" name="row[lat]" type="hidden" value="{$row.lat}"  >-->
+<!--				<input id="address" name="row[address]" type="hidden" value="{$row.address}"  >-->
+<!--			</div>-->
+<!--		</div>-->
 
-		<div class="col-xs-12 col-sm-6">
-			<div class="form-group col-sm-10">
-				<label >详细地址:</label>
-				<input  placeholder="请输入详细地址" id="address_detail" class="form-control" name="row[address_detail]" type="text" value="{$row.address_detail}"/>
-			</div>
-		</div>
+<!--		<div class="col-xs-12 col-sm-6">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label >详细地址:</label>-->
+<!--				<input  placeholder="请输入详细地址" id="address_detail" class="form-control" name="row[address_detail]" type="text" value="{$row.address_detail}"/>-->
+<!--			</div>-->
+<!--		</div>-->
 	</div>
 
 

+ 6 - 6
application/admin/view/qingdong/customer/customer/editteam.html

@@ -7,11 +7,11 @@
     <div class="panel-heading">
         <ul class="nav nav-tabs">
             <li class="active"><a href="#first" data-toggle="tab">全部</a></li>
-            <li><a href="#second" data-toggle="tab">我负责的</a></li>
-            <li><a href="#third" data-toggle="tab">下属负责的</a></li>
-            <li><a href="#four" data-toggle="tab">今日待跟进</a></li>
-            <li><a href="#five" data-toggle="tab">今日已跟进</a></li>
-            <li><a href="#six" data-toggle="tab">从未跟进的</a></li>
+<!--            <li><a href="#second" data-toggle="tab">我负责的</a></li>-->
+<!--            <li><a href="#third" data-toggle="tab">下属负责的</a></li>-->
+<!--            <li><a href="#four" data-toggle="tab">今日待跟进</a></li>-->
+<!--            <li><a href="#five" data-toggle="tab">今日已跟进</a></li>-->
+<!--            <li><a href="#six" data-toggle="tab">从未跟进的</a></li>-->
         </ul>
     </div>
     {:build_heading()}
@@ -24,7 +24,7 @@
                         {:build_toolbar('refresh,add')}
                         <a class="btn btn-warning btn-change btn-imports {:$auth->check('qingdong/customer/customer/import')?'':'hide'}"  data-params="action=start"  href="javascript:;"><i class="fa fa-upload dz-message"></i> 导入</a>
                         <a class="btn btn-success btn-export {:$auth->check('qingdong/customer/customer/export')?'':'hide'}" data-multiple="false" initialized="true" href="javascript:;"><i class="fa fa-download dz-message"></i> 导出</a>
-                        <a class="btn btn-primary btn-change btn-transfer {:$auth->check('qingdong/customer/customer/batch_change')?'':'hide'}"><i class="fa fa-mail-reply"></i> 批量转移</a>
+                        {if $staff_group == 1 || $staff_group == 9}<a class="btn btn-primary btn-change btn-transfer {:$auth->check('qingdong/customer/customer/batch_change')?'':'hide'}"><i class="fa fa-mail-reply"></i> 批量转移</a>{/if}
                         <a class="btn btn-danger btn-send-email {:$auth->check('qingdong/general/email/batch_send_email')?'':'hide'}" data-url="qingdong/general/email/batch_send_email" data-types="customer" data-title="批量发送邮件" ><i class="fa fa-envelope-square"></i> 批量发送邮件</a>
                         <a class="btn btn-info  btn-send-sms {:$auth->check('qingdong/general/sms/batch_send_sms')?'':'hide'}"
                            data-url="qingdong/general/sms/batch_send_sms" data-types="customer" data-title="批量发送短信" ><i class="fa fa-telegram"></i> 批量发送短信</a>

+ 6 - 6
application/admin/view/qingdong/customer/customer/map.html

@@ -70,12 +70,12 @@
 				</select>
 			</div>
 		</div>
-		<div class="col-xs-12 col-sm-10">
-			<div class="form-group col-sm-10">
-				<label>提醒谁看:</label>
-				{:build_select('row[reminds_id]', $staff, null, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'required', 'data-live-search'=>'true'])}
-			</div>
-		</div>
+<!--		<div class="col-xs-12 col-sm-10">-->
+<!--			<div class="form-group col-sm-10">-->
+<!--				<label>提醒谁看:</label>-->
+<!--				{:build_select('row[reminds_id]', $staff, null, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'required', 'data-live-search'=>'true'])}-->
+<!--			</div>-->
+<!--		</div>-->
 		<input type="hidden" name="row[relation_type]" value="1">
 
 	</div>

+ 46 - 45
application/admin/view/qingdong/customer/customer/words.html

@@ -2,16 +2,17 @@
 <form id="edit-form" class="form-horizontal col-sm-12" role="form" data-toggle="validator" method="POST" action="">
 	{:token()}
 
-	<div class="form-group">
+<!--	<div class="form-group">-->
 
-			<label for="c-type" class="control-label col-xs-12 col-sm-2">跟进类型:</label>
-			<div class="form-group col-sm-8">
-				<select id="c-type" name="row[follow_type]" data-rule="required" class="form-control">
-					{:build_field_option('跟进类型')}
-				</select>
-			</div>
+<!--			<label for="c-type" class="control-label col-xs-12 col-sm-2">跟进类型:</label>-->
+<!--			<div class="form-group col-sm-8">-->
+<!--				<select id="c-type" name="row[follow_type]" data-rule="required" class="form-control">-->
+<!--					{:build_field_option('跟进类型')}-->
+<!--				</select>-->
+<!--			</div>-->
 
-	</div>
+<!--	</div>-->
+		<input type="hidden" name="row[relation_id]" value="{$ids}">
 		<div class="form-group">
 			<label for="c-next_time" class="control-label col-xs-12 col-sm-2">下次跟进时间:</label>
 			<div class="form-group col-sm-8">
@@ -21,43 +22,43 @@
 		</div>
 
 
-		{eq name="relation_type" value="2"}
-	<div class="form-group">
-			<label class="control-label col-xs-12 col-sm-2">联系人:</label>
-			<div class="form-group col-sm-8">
-				{:build_select('row[relation_id]', $contacts, $ids, ['class'=>'form-control selectpicker', 'required'=>'required', 'data-live-search'=>'true'])}
-			</div>
-	</div>
-		{else/}
-		<div class="form-group">
-			<label class="control-label col-xs-12 col-sm-2">关联客户:</label>
-			<div class="form-group col-sm-8">
-
-				{:build_select('row[relation_id]', $customer, $ids, ['class'=>'form-control selectpicker', 'required'=>'required', 'data-live-search'=>'true'])}
-			</div>
-
-		</div>
-		{/eq}
-	<div class="form-group">
-		<label class="control-label col-xs-12 col-sm-2">客户状态:</label>
-		<div class="form-group col-sm-8">
-
-			<select name="row[follow]" class="form-control">
-				<option value="">点击选择</option>
-				{foreach name="follow" item="val"}
-				<option value="{$val}">{$val}</option>
-				{/foreach}
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-xs-12 col-sm-2">提醒谁看:</label>
-		<div class="form-group col-sm-8">
-
-			{:build_select('row[reminds_id]', $staff, $staff_ids, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'', 'data-live-search'=>'true'])}
-		</div>
-
-	</div>
+<!--		{eq name="relation_type" value="2"}-->
+<!--	<div class="form-group">-->
+<!--			<label class="control-label col-xs-12 col-sm-2">联系人:</label>-->
+<!--			<div class="form-group col-sm-8">-->
+<!--				{:build_select('row[relation_id]', $contacts, $ids, ['class'=>'form-control selectpicker', 'required'=>'required', 'data-live-search'=>'true'])}-->
+<!--			</div>-->
+<!--	</div>-->
+<!--		{else/}-->
+<!--		<div class="form-group">-->
+<!--			<label class="control-label col-xs-12 col-sm-2">关联客户:</label>-->
+<!--			<div class="form-group col-sm-8">-->
+
+<!--				{:build_select('row[relation_id]', $customer, $ids, ['class'=>'form-control selectpicker', 'required'=>'required', 'data-live-search'=>'true'])}-->
+<!--			</div>-->
+
+<!--		</div>-->
+<!--		{/eq}-->
+<!--	<div class="form-group">-->
+<!--		<label class="control-label col-xs-12 col-sm-2">客户状态:</label>-->
+<!--		<div class="form-group col-sm-8">-->
+
+<!--			<select name="row[follow]" class="form-control">-->
+<!--				<option value="">点击选择</option>-->
+<!--				{foreach name="follow" item="val"}-->
+<!--				<option value="{$val}">{$val}</option>-->
+<!--				{/foreach}-->
+<!--			</select>-->
+<!--		</div>-->
+<!--	</div>-->
+<!--	<div class="form-group">-->
+<!--		<label class="control-label col-xs-12 col-sm-2">提醒谁看:</label>-->
+<!--		<div class="form-group col-sm-8">-->
+
+<!--			{:build_select('row[reminds_id]', $staff, $staff_ids, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'', 'data-live-search'=>'true'])}-->
+<!--		</div>-->
+
+<!--	</div>-->
 
 		<input type="hidden" name="row[relation_type]" value="{$relation_type}">
 	<div class="form-group">

+ 3 - 0
application/admin/view/qingdong/customer/record/detail.html

@@ -107,6 +107,7 @@ class Upload
             throw new UploadException(__('Uploaded file format is limited'));
         }
         //验证文件后缀
+
         if ($this->config['mimetype'] === '*'
             || in_array($this->fileInfo['suffix'], $mimetypeArr) || in_array('.' . $this->fileInfo['suffix'], $mimetypeArr)
             || in_array($typeArr[0] . "/*", $mimetypeArr) || (in_array($this->fileInfo['type'], $mimetypeArr) && stripos($this->fileInfo['type'], '/') !== false)) {
@@ -354,6 +355,7 @@ class Upload
      */
     public function upload($savekey = null)
     {
+
         if (empty($this->file)) {
             throw new UploadException(__('No file upload or server upload limit exceeded'));
         }
@@ -395,6 +397,7 @@ class Upload
             }
         }
         $this->file = $file;
+
         $category = request()->post('category');
         $category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : '';
         $auth = Auth::instance();

+ 1 - 1
application/common/library/token/Driver.php

@@ -21,7 +21,7 @@ return [
     /**
      * 可上传的文件类型
      */
-    'mimetype'  => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm',
+    'mimetype'  => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,pdf,txt,md,xml,doc,docx,xls,xlsx,ppt,pptx',
     /**
      * 是否支持批量上传
      */

+ 37 - 7
application/index/controller/Ajax.php

@@ -303,14 +303,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             return '';
                         },operate:false},
                     {field : 'customer_id', title : '客户名称', visible: false, addClass: "selectpage", extend: "data-source='qingdong/customer/customer/index' data-field='name'"},
-                    {field : 'order_date', title : '签约时间',operate: 'RANGE', addclass: 'datetimerange'},
+                    // {field : 'order_date', title : '签约时间',operate: 'RANGE', addclass: 'datetimerange'},
+
                     {field : 'money', title : '合同金额',operate:false},
-                    {field : 'start_time', title : '合同生效时间',operate: 'RANGE', addclass: 'datetimerange'},
-                    {field : 'end_time', title : '合同到期时间',operate: 'RANGE', addclass: 'datetimerange'},
-                    {field : 'contacts.name', title : '客户签约人',operate:false},
-                    {field : 'order_staff.name', title : '公司签约人',operate:false},
-                    {field : 'remark', title : '备注',operate:false},
-                    {field : 'check_status', title : '合同状态',formatter:Table.api.formatter.status, searchList: {0:'待审核', 1: '审核中',2:'审核通过',3:"审核未通过",4:"已撤销"},custom: {0: 'gray', 1: 'gray',2: 'success', 3: 'danger', 4: 'danger'}},
+                    // {field : 'start_time', title : '合同生效时间',operate: 'RANGE', addclass: 'datetimerange'},
+                    // {field : 'end_time', title : '合同到期时间',operate: 'RANGE', addclass: 'datetimerange'},
+                    // {field : 'contacts.name', title : '客户签约人',operate:false},
+                    // {field : 'order_staff.name', title : '公司签约人',operate:false},
+                    // {field : 'remark', title : '备注',operate:false},
+                    // {field : 'check_status', title : '合同状态',formatter:Table.api.formatter.status, searchList: {0:'待审核', 1: '审核中',2:'审核通过',3:"审核未通过",4:"已撤销"},custom: {0: 'gray', 1: 'gray',2: 'success', 3: 'danger', 4: 'danger'}},
                     {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
                     {
                         field: 'operate2', title: __('Operate'), events: {
@@ -325,6 +326,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         field: 'operate', title: __('Operate'),  events: Table.api.events.operate, formatter: Table.api.formatter.buttons,
                         buttons: [
                             {
+                                name: 'edit',
+                                text: __('编辑'),
+                                title: __('编辑'),
+                                extend:'data-area=["80%","80%"]',
+                                classname: 'records btn-dialog',
+                                url: 'qingdong/customer/contract/edit',
+                                visible: function (row) {
+                                    if(row.operation =='read'){
+                                        return false;
+                                    }
+                                    //返回true时按钮显示,返回false隐藏
+                                    return true;
+                                }
+                            },
+                            {
                                 name: 'detail',
                                 text: __('跟进'),
                                 title: __('跟进'),
@@ -353,6 +369,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
                 ]
             ],
+
             pagination        : true,
             search            : false,
             commonSearch      : true,
@@ -360,6 +377,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             //显示导出按钮
             showExport: false,
             onLoadSuccess:function(row){
+                var role = row.role;
+
+                // 根据 role 值动态修改 columns 配置
+                var table = $("#table");
+                if (role === 1 || role === 2) {
+                    table.bootstrapTable('showColumn', 'money');
+                } else {
+                    table.bootstrapTable('hideColumn', 'money');
+                }
+
                 $('.contract_money').show()
                 $('.allmoney').html(row.allmoney);
                 $('.repayment_money').html(row.repayment_money);
@@ -402,11 +429,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 Controller.tableinfo.url=location.href+'&type=0';
                 Controller.tableinfo.toolbar='#toolbar';
                 Controller.tableinfo.columns[0][Controller.tableinfo.columns[0].length-1].table=table;
+
                 if (q.isselect == 1) {
                     Controller.tableinfo.columns[0][Controller.tableinfo.columns[0].length - 1].visible = false;
                 } else {
                     Controller.tableinfo.columns[0][Controller.tableinfo.columns[0].length - 2].visible = false;
                 }
+
                 // 初始化表格
                 table.bootstrapTable(Controller.tableinfo);
                 // 为表格绑定事件
@@ -614,6 +643,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 }
                             },
                             {field: 'next_time', title: __('下次跟进时间')},
+                            {field: 'staff_name', title: __('跟进员工')},
                             {
                                 field     : 'operate',
                                 title     : __('Operate'),

+ 38 - 40
public/assets/js/backend/qingdong/customer/customer.js

@@ -32,6 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 						console.log(value);
 					}
 				};
+				console.log($.fn.bootstrapTable.defaults.extend.detail_url);
 				Fast.api.open($.fn.bootstrapTable.defaults.extend.detail_url + "?ids=" + $(this).data('id'), '客户详情', options);
 			});
 			//导入
@@ -308,18 +309,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 							return "<a href='javascript:void(0);' data-id='" + row.id + "' class='show-detail'>" + value + "</a>";
 						},operate:'like',searchable:true
 					},
-					{field : 'subname', title : '助记名称',operate:'like'},
-					{field : 'owner_staff.name', title : '归属员工',operate:false},
-					{field : 'owner_staff_id', title : '归属员工',visible:false,operate:'=',searchList:$.getJSON("qingdong/customer/customer/stafflist")},
-					{field : 'contract_status', title : '成交状态',operate:'=',searchList:{0:'未成交',1:'已成交'},formatter:Table.api.formatter.status},
-					{field : 'industry', title : '客户所属',operate:'like'},
-					{field : 'follow', title : '客户状态',operate:'like'},
-					{field : 'source', title : '客户来源',operate:'like'},
-					{field : 'level', title : '客户星级',operate:'=',searchList:{0:'无',1:'1星',2:'2星',3:'3星',4:'4星',5:'5星'},formatter:Table.api.formatter.status},
-
-					{field : 'next_time', title : '下次联系时间',operate:false},
-					{field : 'last_time', title : '最后跟进时间',operate:false},
-					{field : 'receivetime', title : '领取时间', operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
+					// {field : 'subname', title : '助记名称',operate:'like'},
+					// {field : 'owner_staff.name', title : '归属员工',operate:false},
+					// {field : 'owner_staff_id', title : '归属员工',visible:false,operate:'=',searchList:$.getJSON("qingdong/customer/customer/stafflist")},
+					// {field : 'contract_status', title : '成交状态',operate:'=',searchList:{0:'未成交',1:'已成交'},formatter:Table.api.formatter.status},
+					// {field : 'industry', title : '客户所属',operate:'like'},
+					// {field : 'follow', title : '客户状态',operate:'like'},
+					// {field : 'source', title : '客户来源',operate:'like'},
+					// {field : 'level', title : '客户星级',operate:'=',searchList:{0:'无',1:'1星',2:'2星',3:'3星',4:'4星',5:'5星'},formatter:Table.api.formatter.status},
+					//
+					// {field : 'next_time', title : '下次联系时间',operate:false},
+					// {field : 'last_time', title : '最后跟进时间',operate:false},
+					// {field : 'receivetime', title : '领取时间', operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
 
 					{field: 'createtime', title: __('Createtime'),autocomplete:false, operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
 
@@ -359,35 +360,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                 classname: ' records btn-dialog',
                                 url: 'qingdong/customer/record/add/relation_type/1',
                                 visible: function (row) {
-                                    //返回true时按钮显示,返回false隐藏
-                                    if(row.operation =='read'){
-                                        return false;
-                                    }
+
                                     return true;
                                 }
                             },
-                            {
-                                name: 'seas',
-                                text: __('公海'),
-                                title: __('公海'),
-                                classname: 'seas btn-ajax',
-                                url: 'qingdong/customer/customer/seas',
-                                visible: function (row) {
-                                    //返回true时按钮显示,返回false隐藏
-                                    if(row.operation_team=='update' || row.operation =='read'){
-                                        return false;
-                                    }
-                                    return true;
-                                },
-                                confirm: '确定将当前客户放入公海吗?',
-                                refresh:true,
-                                error: function (data, ret) {
-                                    console.log(data, ret);
-                                    Layer.alert(ret.msg);
-                                    return false;
-                                },
-
-                            },
+                            // {
+                            //     name: 'seas',
+                            //     text: __('公海'),
+                            //     title: __('公海'),
+                            //     classname: 'seas btn-ajax',
+                            //     url: 'qingdong/customer/customer/seas',
+                            //     visible: function (row) {
+                            //         //返回true时按钮显示,返回false隐藏
+                            //         if(row.operation_team=='update' || row.operation =='read'){
+                            //             return false;
+                            //         }
+                            //         return true;
+                            //     },
+                            //     confirm: '确定将当前客户放入公海吗?',
+                            //     refresh:true,
+                            //     error: function (data, ret) {
+                            //         console.log(data, ret);
+                            //         Layer.alert(ret.msg);
+                            //         return false;
+                            //     },
+							//
+                            // },
 
                         ]
                     },
@@ -657,9 +655,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 					showToggle   : false,
 					columns      : [
 						[
-							{field: 'follow_type', title: __('跟进类型')},
+							// {field: 'follow_type', title: __('跟进类型')},
 							{field: 'follow_time', title: __('跟进时间')},
-							{field: 'follow', title: __('跟进状态')},
+							// {field: 'follow', title: __('跟进状态')},
 							{field: 'content', title: __('跟进内容'),cellStyle:function (value,row,index,field) {
 									return {
 										css: {

+ 18 - 18
public/assets/js/backend/qingdong/customer/leads.js

@@ -40,24 +40,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 						{field : 'remarks', title : '备注信息',operate:false},
 						{field : 'address', title : '省市区',operate:false},
 						{field : 'address_detail', title : '详细地址',operate:false},
-						{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.buttons,
-							buttons: [
-								{
-									name: 'seas',
-									text: __('领取'),
-									title: __('领取'),
-									classname: 'records btn-ajax',
-									url: 'qingdong/customer/customer/receive',
-									confirm: '确定要领取当前客户吗?',
-									refresh:true,
-									error: function (data, ret) {
-										console.log(data, ret);
-										Layer.alert(ret.msg);
-										return false;
-									}
-								},
-							]
-						}
+						// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.buttons,
+						// 	buttons: [
+						// 		{
+						// 			name: 'seas',
+						// 			text: __('领取'),
+						// 			title: __('领取'),
+						// 			classname: 'records btn-ajax',
+						// 			url: 'qingdong/customer/customer/receive',
+						// 			confirm: '确定要领取当前客户吗?',
+						// 			refresh:true,
+						// 			error: function (data, ret) {
+						// 				console.log(data, ret);
+						// 				Layer.alert(ret.msg);
+						// 				return false;
+						// 			}
+						// 		},
+						// 	]
+						// }
 					]
 				]
 			});

二进制
public/assets/js/backend/qingdong/dashboard.js


二进制
public/export/2025-03-26/客户20250326152659.xlsx


二进制
public/export/2025-04-07/客户20250407164305.xlsx


二进制
public/export/2025-04-07/客户20250407164358.xlsx


二进制
public/export/2025-04-09/客户20250409120047.xlsx


二进制
public/export/2025-04-10/客户20250410101302.xlsx


+ 0 - 0
public/gjqPhXsBKN.php