Browse Source

修改bug

Xiahai 6 months ago
parent
commit
6931596e21
47 changed files with 1013 additions and 730 deletions
  1. 2 1
      addons/qingdongams/model/Staff.php
  2. 348 352
      application/admin/controller/qingdongams/Dashboard.php
  3. 8 0
      application/admin/controller/qingdongams/customer/Contract.php
  4. 1 2
      application/admin/controller/qingdongams/customer/Customer.php
  5. 19 1
      application/admin/controller/qingdongams/customer/Equipmentcate.php
  6. 67 3
      application/admin/controller/qingdongams/customer/Equipmentdevice.php
  7. 1 0
      application/admin/controller/qingdongams/customer/Equipmenttype.php
  8. 8 0
      application/admin/controller/qingdongams/customer/Record.php
  9. 1 1
      application/admin/controller/qingdongams/department/Group.php
  10. 1 1
      application/admin/controller/qingdongams/department/Role.php
  11. 131 89
      application/admin/controller/qingdongams/department/Staff.php
  12. 1 3
      application/admin/controller/qingdongams/examine/Examine.php
  13. 1 1
      application/admin/controller/qingdongams/examine/ExamineRecord.php
  14. 63 9
      application/admin/controller/qingdongams/notice/Aftermarket.php
  15. 127 110
      application/admin/controller/qingdongams/parts/Parts.php
  16. 7 6
      application/admin/controller/qingdongams/report/Daily.php
  17. 12 3
      application/admin/controller/qingdongams/workorder/Workorder.php
  18. 1 1
      application/admin/library/Auth.php
  19. 13 0
      application/admin/model/qingdongams/customer/Equipmentdevice.php
  20. 7 8
      application/admin/model/qingdongams/customer/Equipmenttype.php
  21. 51 51
      application/admin/view/index/index.html
  22. 1 1
      application/admin/view/qingdongams/customer/contract/address.html
  23. 10 10
      application/admin/view/qingdongams/customer/customer/import.html
  24. 1 1
      application/admin/view/qingdongams/customer/equipmentcate/add.html
  25. 0 10
      application/admin/view/qingdongams/customer/equipmentcate/index.html
  26. 4 3
      application/admin/view/qingdongams/customer/record/add.html
  27. 18 13
      application/admin/view/qingdongams/department/staff/add.html
  28. 11 9
      application/admin/view/qingdongams/department/staff/edit.html
  29. 8 1
      application/admin/view/qingdongams/notice/aftermarket/add.html
  30. 8 1
      application/admin/view/qingdongams/notice/aftermarket/edit.html
  31. 5 1
      application/admin/view/qingdongams/notice/aftermarket/index.html
  32. 1 1
      application/admin/view/qingdongams/product/product/index.html
  33. 1 1
      application/admin/view/qingdongams/workorder/workorder/detail.html
  34. 6 0
      application/admin/view/qingdongams/workorder/workorder/detail_template/detail1.html
  35. 1 1
      application/admin/view/qingdongams/workorder/workorder/edit_template/edit5.html
  36. 2 2
      public/assets/js/backend/qingdongams/customer/customer.js
  37. 1 1
      public/assets/js/backend/qingdongams/customer/equipmentcate.js
  38. 10 4
      public/assets/js/backend/qingdongams/customer/equipmentdevice.js
  39. 5 4
      public/assets/js/backend/qingdongams/customer/record.js
  40. 8 8
      public/assets/js/backend/qingdongams/department/role.js
  41. 8 1
      public/assets/js/backend/qingdongams/department/staff.js
  42. 9 0
      public/assets/js/backend/qingdongams/examine/examine.js
  43. 15 6
      public/assets/js/backend/qingdongams/notice/aftermarket.js
  44. 3 1
      public/assets/js/backend/qingdongams/notice/aftermarket_type.js
  45. 2 2
      public/assets/js/backend/qingdongams/parts/parts.js
  46. 2 2
      public/assets/js/backend/qingdongams/product/product.js
  47. 3 4
      public/assets/js/backend/qingdongams/workorder/workorder.js

+ 2 - 1
addons/qingdongams/model/Staff.php

@@ -311,7 +311,8 @@ class Staff extends Model
         self::beforeInsert(function ($row) {
             $changed = $row->getChangedData();
             $admin = [
-                'username' => $changed['mobile'],
+                'username' => $changed['username'],
+                'mobile' => $changed['mobile'],
                 'nickname' => $changed['name'],
                 'password' => $changed['password'],
                 'salt' => $changed['salt'],

File diff suppressed because it is too large
+ 348 - 352
application/admin/controller/qingdongams/Dashboard.php


+ 8 - 0
application/admin/controller/qingdongams/customer/Contract.php

@@ -52,6 +52,8 @@ class Contract extends Base {
 	 */
 	protected $model = null;
 	protected $Equipmentdevice = null;
+    protected $noNeedRight = ['index1'];
+    protected $noNeedLogin = ['index1'];
 
 
 	public function _initialize() {
@@ -665,6 +667,10 @@ class Contract extends Base {
 			$this->error(__("Invalid parameters"));
 		}
 		$map['id'] = array('in', $ids);
+
+        // 修改绑定设备的设备状态
+        \app\admin\model\qingdongams\customer\Equipmentdevice::updateStatus($ids);
+
 		$result = $this->model->destroy($map);
 		if (!$result) {
 			$this->error('删除失败');
@@ -1683,6 +1689,8 @@ class Contract extends Base {
             $this->error('信息不存在');
         }
         $files = $model->where(['id' => $id])->update(['contract_status' => 2, 'check_status' => 9]);
+        // 修改绑定设备的设备状态
+        \app\admin\model\qingdongams\customer\Equipmentdevice::updateStatus($id);
         OperationLog::createLog(OperationLog::CONTRACT_TYPE, $id, '终止合同');
         $this->success('操作成功', $files);
     }

+ 1 - 2
application/admin/controller/qingdongams/customer/Customer.php

@@ -445,8 +445,7 @@ class Customer extends Base
         }
         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('权限不足');
             }
         }

+ 19 - 1
application/admin/controller/qingdongams/customer/Equipmentcate.php

@@ -17,6 +17,7 @@ class Equipmentcate extends Backend
      * @var \app\admin\model\qingdongams\customer\Equipmentcate
      */
     protected $model = null;
+    protected $searchFields = 'name,gongneng,remark';
 
     public function _initialize()
     {
@@ -33,5 +34,22 @@ class Equipmentcate extends Backend
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
 
-
+    public function index() {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model
+            ->where($where)
+            ->order('sort', "DESC")
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
 }

+ 67 - 3
application/admin/controller/qingdongams/customer/Equipmentdevice.php

@@ -2,8 +2,12 @@
 
 namespace app\admin\controller\qingdongams\customer;
 
+use addons\qingdongams\model\Staff;
 use app\common\controller\Backend;
 use think\Db;
+use think\exception\PDOException;
+use think\exception\ValidateException;
+
 /**
  * 设备管理
  *
@@ -118,7 +122,6 @@ class Equipmentdevice extends Backend
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
             
             $map=[];
-            
             if($this->request->request('isselect')==1){
                 $map['customer_id']=$this->request->request('customer_id');
                 $ids = $this->request->request('ids');
@@ -127,7 +130,6 @@ class Equipmentdevice extends Backend
                 }
 
             }
-         
 
             $list = $this->model
                     ->where($where)
@@ -135,13 +137,75 @@ class Equipmentdevice extends Backend
                     ->order($sort, $order)
                     ->paginate($limit);
 
-      
+            foreach ($list as $value) {
+                $type_id_arr = explode(',', $value['type_id']);
+                $type_name = \app\admin\model\qingdongams\customer\Equipmenttype::where(['id'=> ['in', $type_id_arr]])->column('name');
+                $value['type_id'] = implode(',', $type_name);
+            }
 
             $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
+        $this->assignconfig('isselect', $this->request->request('isselect'));
+        $this->assignconfig('customer_id', $this->request->request('customer_id'));
         return $this->view->fetch();
     }
 
+    /**
+     * 添加
+     *
+     * @return string
+     * @throws \think\Exception
+     */
+    public function add()
+    {
+        if (false === $this->request->isPost()) {
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+
+        if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
+            $params[$this->dataLimitField] = $this->auth->id;
+        }
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
+                $this->model->validateFailException()->validate($validate);
+            }
+
+            // 添加设备时判断是否需要增加客户id
+            $customer_id = $this->request->request('customer_id') ?? '';
+            if ($customer_id) {
+                $params['customer_id'] = $customer_id;
+            }
+
+            $result = $this->model->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if ($result === false) {
+            $this->error(__('No rows were inserted'));
+        }
+        $this->success();
+    }
+
+    /**
+     * 搜索下拉列表
+     */
+    public function typeList()
+    {
+        $data = ['searchlist' => \app\admin\model\qingdongams\customer\Equipmenttype::getList()];
+        $this->success('', null, $data);
+    }
 }

+ 1 - 0
application/admin/controller/qingdongams/customer/Equipmenttype.php

@@ -17,6 +17,7 @@ class Equipmenttype extends Backend
      * @var \app\admin\model\qingdongams\customer\Equipmenttype
      */
     protected $model = null;
+    protected $searchFields = 'name,remark,xinghao,guige';
 
     public function _initialize()
     {

+ 8 - 0
application/admin/controller/qingdongams/customer/Record.php

@@ -162,6 +162,14 @@ class Record extends Base {
             return json($result);
         }
 
+        // 获取跟进类型
+        $typeList = Field::where('name', '跟进类型')->value('data');
+        $typeList = json_decode($typeList, true);
+        $recordTypeList = [];
+        foreach ($typeList as $value) {
+            $recordTypeList[$value] = $value;
+        }
+        $this->assignconfig('recordTypeList', $recordTypeList);
         return $this->view->fetch();
     }
 

+ 1 - 1
application/admin/controller/qingdongams/department/Group.php

@@ -220,7 +220,7 @@ class Group extends Base
                 }
             }
             if (!$ids) {
-                $this->error(__('You can not delete group that contain child group and administrators'));
+                $this->error('你不能删除含有子组和管理员的组');
             }
             $count = $this->model->where('id', 'in', $ids)->delete();
             if ($count) {

+ 1 - 1
application/admin/controller/qingdongams/department/Role.php

@@ -32,7 +32,7 @@ class Role extends Base
     {
         $map['id'] = $ids;
         if ($this->request->isAjax()) {
-            $data   = $this->request->post('row/a');
+            $data = $this->request->post('row/a');
 
             $result = $this->model->save(['rules'=>$data['rules'],'role_type'=>$data['role_type']], $map);
 

+ 131 - 89
application/admin/controller/qingdongams/department/Staff.php

@@ -17,9 +17,9 @@ use app\admin\model\Admin;
  */
 class Staff extends  Base {
 
-	public function _initialize() {
-		parent::_initialize();
-		$this->model      = new StaffModel();
+    public function _initialize() {
+        parent::_initialize();
+        $this->model      = new StaffModel();
 
         $this->childrenAdminIds = $this->auth->getChildrenAdminIds($this->auth->isSuperAdmin());
         $this->childrenGroupIds = $this->auth->getChildrenGroupIds($this->auth->isSuperAdmin());
@@ -27,14 +27,14 @@ class Staff extends  Base {
         //角色组
         $groupList = collection(AuthGroup::where('id', 'in', $this->childrenGroupIds)->select())->toArray();
         Tree::instance()->init($groupList);
-        $groupdata = [];
+        $groupdata = ['' => '请选择'];
         if ($this->auth->isSuperAdmin()) {
             $result = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0));
             foreach ($result as $k => $v) {
                 $groupdata[$v['id']] = $v['name'];
             }
         } else {
-            $result = [];
+            $result = ['' => '请选择'];
             $groups = $this->auth->getGroups();
             foreach ($groups as $m => $n) {
                 $childlist = Tree::instance()->getTreeList(Tree::instance()->getTreeArray($n['id']));
@@ -48,36 +48,37 @@ class Staff extends  Base {
         }
         $this->view->assign('groupdata', $groupdata);
 
-	}
+    }
 
 
     /**
      * 员工列表
      * @return string
      */
-	public function index() {
-		$this->request->filter(['strip_tags']);
-		if ($this->request->isAjax()) {
-			list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+    public function index() {
+        $this->request->filter(['strip_tags']);
+        if ($this->request->isAjax()) {
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
-			$list = $this->model->with(['parent','admin','staffrole'])
+            $list = $this->model->with(['parent','admin','staffrole'])
+                ->where(['id' => ['!=', 1]])
                 ->where($where)->order($sort, $order)->paginate($limit);
-			$row  = $list->items();
+            $row  = $list->items();
 
-			$result = array("total" => $list->total(), "rows" => $row);
+            $result = array("total" => $list->total(), "rows" => $row);
 
-			return json($result);
-		}
+            return json($result);
+        }
 
-		return $this->view->fetch();
-	}
+        return $this->view->fetch();
+    }
 
 
     /**
      * 添加员工
      * @return string
      */
-	public function add() {
+    public function add() {
         if ($this->request->isAjax()) {
             $data = $this->request->post('row/a');
             $mobile = $data['mobile'];
@@ -117,15 +118,26 @@ class Staff extends  Base {
             $this->success('提交成功');
         }
 
-		$staffname = StaffModel::where([])->column('id,name');
-		$staffs    = ['' => '无'];
-		foreach ($staffname as $id => $name) {
-			$staffs[$id] = $name;
-		}
-        $this->view->assign('roles',StaffRole::where([])->column('name','id'));
-		$this->view->assign('staffs', $staffs);
-		return $this->view->fetch();
-	}
+        $staffname = StaffModel::column('id,name');
+        $staffs    = ['' => '请选择'];
+        foreach ($staffname as $id => $name) {
+            $staffs[$id] = $name;
+        }
+        $this->view->assign('staffs', $staffs);
+
+        $staffname = StaffModel::column('id,name');
+        $staffs    = ['' => '无'];
+        foreach ($staffname as $id => $name) {
+            $staffs[$id] = $name;
+        }
+        $role_list = ['' => '请选择'];
+        $staff_role = StaffRole::column('name','id');
+        foreach ($staff_role as $key => $value) {
+            $role_list[$key] = $value;
+        }
+        $this->view->assign('roles', $role_list);
+        return $this->view->fetch();
+    }
 
 
     /**
@@ -133,21 +145,21 @@ class Staff extends  Base {
      * @param null $ids
      * @return string
      */
-	public function edit($ids = null) {
-		$map['id'] = $ids;
-		if ($this->request->isAjax()) {
-			$data   = $this->request->post('row/a');
-
+    public function edit($ids = null) {
+        $map['id'] = $ids;
+        if ($this->request->isAjax()) {
+            $row = StaffModel::where($map)->find();
 
-            if($data['password']){
+            $data = $this->request->post('row/a');
+            if ($data['password']) {
                 $newSalt = substr(md5(uniqid(true)), 0, 6);
                 $newPassword = md5(md5($data['password']) . $newSalt);
                 $data['salt'] = $newSalt;
                 $data['password'] = $newPassword;
-            }else{
+            } else {
                 unset($data['password']);
             }
-            $mobile=$data['mobile'];
+            $mobile = $data['mobile'];
             $count = StaffModel::where(['mobile'=>$mobile,'id'=>['neq',$ids]])->count();
             if($count > 0){
                 $this->error('员工手机号已存在');
@@ -157,89 +169,119 @@ class Staff extends  Base {
             }
             Db::startTrans();
             try {
-                $group = $this->request->post("group/a",[]);
-                //过滤不允许的组别,避免越权
-                $group = array_intersect($this->childrenGroupIds, $group);
-                if (!$group) {
-                    exception(__('The parent group exceeds permission limit'));
+                if ($row['id'] != 15) {
+                    // 先移除所有权限
+                    model('AuthGroupAccess')->where('uid', $row->admin_id)->delete();
+
+                    $group = $this->request->post("group/a",[]);
+                    //过滤不允许的组别,避免越权
+                    $group = array_intersect($this->childrenGroupIds, $group);
+                    if (!$group) {
+                        exception(__('The parent group exceeds permission limit'));
+                    }
+
+                    $dataset = [];
+                    foreach ($group as $value) {
+                        $dataset[] = ['uid' => $row->admin_id, 'group_id' => $value];
+                    }
+                    model('AuthGroupAccess')->saveAll($dataset);
+
+                    $data['group_ids'] = implode(',', $group);
                 }
-                $data['group_ids']=implode(',',$group);
-                $data['id']=$map['id'];
-                $result=$this->model->save($data,$map);
+                $data['id'] = $map['id'];
+                $result = $this->model->save($data, $map);
                 Db::commit();
             }catch (Exception $e){
                 Db::rollback();
                 $this->error($e->getMessage());
             }
 
-			if (!$result) {
-				$this->error('修改失败');
-			}
-			$this->success('修改成功');
-		}
-		$data = StaffModel::where($map)->find();
-		$this->view->assign("row", $data);
-
-		$staffname = StaffModel::where([])->column('id,name');
-		$staffs    = ['' => '无'];
-		foreach ($staffname as $id => $name) {
-			$staffs[$id] = $name;
-		}
-        $this->view->assign('roles',StaffRole::where([])->column('name','id'));
-		$this->view->assign('staffs', $staffs);
-
-		return $this->view->fetch();
-	}
+            if (!$result) {
+                $this->error('修改失败');
+            }
+            $this->success('修改成功');
+        }
+        $data = StaffModel::where($map)->find();
+        $this->view->assign("row", $data);
+
+        $staffname = StaffModel::where([])->column('id,name');
+        $staffs    = ['' => '请选择'];
+        foreach ($staffname as $id => $name) {
+            $staffs[$id] = $name;
+        }
+        $this->view->assign('staffs', $staffs);
+
+        $role_list = ['' => '请选择'];
+        $staff_role = StaffRole::column('name','id');
+        foreach ($staff_role as $key => $value) {
+            $role_list[$key] = $value;
+        }
+        $this->view->assign('roles',$role_list);
+
+        return $this->view->fetch();
+    }
 
     /**
      * 删除员工
      */
-	public function del($ids = null) {
-		if ($this->request->isAjax()) {
-			$map['id'] = array('in', $ids);
+    public function del($ids = null) {
+        if ($this->request->isAjax()) {
+            $map['id'] = array('in', $ids);
             $findinfo = StaffModel::where($map)->select();
             foreach($findinfo as $k=>$v){
-                if($v['admin_id'] ==1){
+                if($v['admin_id'] ==1 || $v['id'] == 15){
                     $this->error('管理员不可删除');
                 }
             }
-			$result    = StaffModel::destroy($map);
+            $result    = StaffModel::destroy($map);
 
-			if (!$result) {
-				$this->error('删除失败');
-			}
+            if (!$result) {
+                $this->error('删除失败');
+            }
 //			$cids = Customer::where(['owner_staff_id' => $ids])->column('id');
-			try {
+            try {
 //				foreach ($cids as $id) {
 //					Customer::moveSeas($id);
 //				}
-			} catch (Exception $e) {
+            } catch (Exception $e) {
                 $this->error($e->getMessage());
-			}
+            }
 
-			$this->success('删除成功');
-		}
+            $this->success('删除成功');
+        }
 
-		return $this->view->fetch();
-	}
+        return $this->view->fetch();
+    }
 
 
     /**
      * 更新状态禁用账号
      */
-	public function update_status() {
-		$id     = input('ids');
-		$status = input('status', 2, 'intval');
-
-		$staff = $this->model->where(['id' => $id])->find();
-		if (empty($staff)) {
-			$this->error('员工不存在');
-		}
-		if ($this->model->isUpdate(true)->save(['id' => $id, 'status' => $status])) {
-			$this->success('操作成功');
-		}
-		$this->error('操作失败');
-	}
+    public function update_status() {
+        $id     = input('ids');
+        $status = input('status', 2, 'intval');
+
+        $staff = $this->model->where(['id' => $id])->find();
+        if (empty($staff)) {
+            $this->error('员工不存在');
+        }
+
+        // 把对应管理员表状态改为禁用
+        $admin = Admin::where(['id' => $staff['admin_id']])->find();
+        if ($admin) {
+            if ($status == 2) {
+                $admin->status = 'hidden';
+            } else {
+                $admin->status = 'normal';
+            }
+            $admin->save();
+        }
+
+        if ($this->model->isUpdate(true)->save(['id' => $id, 'status' => $status])) {
+            $this->success('操作成功');
+        }
+        $this->error('操作失败');
+    }
 
     /**
      * 获取员工角色

+ 1 - 3
application/admin/controller/qingdongams/examine/Examine.php

@@ -64,10 +64,8 @@ class Examine extends Base {
             $wheres['relation_type'] = 'parts';
             if($status == 1){
                 $wheres['status'] = array('in','1,2');
-            }else{
-                $wheres['status']=0;
             }
-            $list   = $this->model->where($where)->where($wheres)->with([
+            $list = $this->model->where($where)->where($wheres)->with([
                 'checkStaff',
                 'parts' => ['createStaff']
             ])->order($sort, $order)->paginate($limit);

+ 1 - 1
application/admin/controller/qingdongams/examine/ExamineRecord.php

@@ -40,7 +40,7 @@ class ExamineRecord extends Base {
         $record = ExamineRecordModel::where([
             'relation_type' => $relation_type,
             'relation_id' => $relation_id,
-            'status' => 0,
+//            'status' => 0,
             'check_staff_id' => $this->_staff->id
         ])->find();
         if (empty($record)) {

+ 63 - 9
application/admin/controller/qingdongams/notice/Aftermarket.php

@@ -25,7 +25,7 @@ class Aftermarket extends Base
         parent::_initialize();
         $this->model = new AftermarketModel();
         $this->typeModel = new AftermarketType();
-        $this->categorylist = collection($this->typeModel->where([])->order('id desc')->select())->toArray();
+        $this->categorylist = collection($this->typeModel->where([])->order('sort desc')->select())->toArray();
         foreach ($this->categorylist as &$item) {
             if ($item['pid'] == 0) {
                 $item['parent'] = '#';
@@ -38,14 +38,29 @@ class Aftermarket extends Base
                 $item['id'] => $item['name']
             ];
         }
+
+        // 去掉全部分类
+        $treeList = collection($this->typeModel->where(['name' => ['<>', '全部']])->order('sort desc')->select())->toArray();
+        foreach ($treeList as &$item) {
+            if ($item['pid'] == 0) {
+                $item['parent'] = '#';
+            } else {
+                $item['parent'] = $item['pid'];
+            }
+            $item['text'] = $item['name'];
+            $item['state'] = ["opened" => true];
+            $this->treeList[] = [
+                $item['id'] => $item['name']
+            ];
+        }
         $tree = Tree::instance();
-        $tree->init($this->categorylist, 'pid');
-        $tree_list = $tree->getTreeList($tree->getTreeArray(0), 'name');
+        $tree->init($treeList, 'pid');
         $this->treeList = [];
+        $tree_list = $tree->getTreeList($tree->getTreeArray(0));
         foreach ($tree_list as $k => $v) {
             $this->treeList[$v['id']] = $v['name'];
         }
-       // dump($this->categorylist);exit;
+        // dump($this->categorylist);exit;
         $this->assign('treeList', $this->treeList);
         $this->assignconfig('typeList', $this->categorylist);
     }
@@ -57,9 +72,31 @@ class Aftermarket extends Base
         if ($this->request->isAjax()) {
 
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
-            $list = $this->model->where($where)
-                ->order($sort, $order)->paginate($limit);
+
+            $filter = $this->request->get("filter", '');
+            $filter = (array)json_decode($filter, true);
+            $filter = $filter ? $filter : [];
+
+            $wheres = [];
+            if (array_key_exists('type_ids', $filter)) {
+                if ($filter['type_ids'] != ',4,') {
+                    $wheres['type_ids'] = $filter['type_ids'];
+                }
+            }
+
+            if (array_key_exists('title', $filter)) {
+                if ($filter['title']) {
+                    $wheres['title'] = ['like', '%' . $filter['title'] . '%'];
+                }
+            }
+
+            $list = $this->model
+                // ->where($where)
+                ->where($wheres)
+                ->order('createtime', 'DESC')
+                ->paginate($limit);
             $row = $list->items();
+            $this->assignconfig('typeList', $this->categorylist);
             $result = array("total" => $list->total(), "rows" => $row);
 
             return json($result);
@@ -76,7 +113,11 @@ class Aftermarket extends Base
             $data = $this->request->post('row/a');
             $typeIds = $this->request->post('type_ids/a');
             $productIds = $this->request->post('product_ids/a');
-            $data['type_ids'] = ',' . implode(',', $typeIds) . ',';
+            if ($typeIds[0] == "") {
+                $data['type_ids'] = ',' . 4 . ',';
+            } else {
+                $data['type_ids'] = ',' . implode(',', $typeIds) . ',';
+            }
             // $data['product_ids'] = implode(',', $productIds);
             $result = $this->model->allowField(true)->save($data);
             if (!$result) {
@@ -84,6 +125,13 @@ class Aftermarket extends Base
             }
             $this->success('提交成功');
         }
+        $params = $this->request->request();
+
+        $hasType = [];
+        if ($params['type_id'] > 0) {
+            $hasType = explode(',', trim(',' . $params['type_id'] . ',', ','));
+        }
+        $this->assign('hasTypes', $hasType);
         $this->assign('productList', Product::where([])->column('name','id'));
         return $this->view->fetch();
     }
@@ -98,8 +146,14 @@ class Aftermarket extends Base
 
             $typeIds = $this->request->post('type_ids/a');
             $productIds = $this->request->post('product_ids/a');
-            $data['type_ids'] = ',' . implode(',', $typeIds) . ',';
-            $data['product_ids'] = implode(',', $productIds);
+            if ($typeIds[0] == "") {
+                $data['type_ids'] = ',' . 4 . ',';
+            } else {
+                $data['type_ids'] = ',' . implode(',', $typeIds) . ',';
+            }
+            if ($productIds) {
+                $data['product_ids'] = implode(',', $productIds);
+            }
             $result = $this->model->isUpdate(true)->save($data, $map);
             if (!$result) {
                 $this->error('修改失败');

+ 127 - 110
application/admin/controller/qingdongams/parts/Parts.php

@@ -23,130 +23,130 @@ use think\Exception;
  * @icon fa fa-user
  */
 class Parts extends Base {
-	protected $relationSearch = true;
-	protected $searchFields   = 'id,name,num';
-	/**
-	 * @var \addons\qingdongams\model\Parts
-	 */
-	protected $model = null;
+    protected $relationSearch = true;
+    protected $searchFields   = 'id,name,num';
+    /**
+     * @var \addons\qingdongams\model\Parts
+     */
+    protected $model = null;
 
 
-	public function _initialize() {
-		parent::_initialize();
-		$this->model = new \addons\qingdongams\model\Parts;
-	}
+    public function _initialize() {
+        parent::_initialize();
+        $this->model = new \addons\qingdongams\model\Parts;
+    }
 
 
-	/**
-	 * 查看
-	 */
-	public function index() {
-		//设置过滤方法
-		$this->request->filter(['strip_tags', 'trim']);
-		if ($this->request->isAjax()) {
+    /**
+     * 查看
+     */
+    public function index() {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if ($this->request->isAjax()) {
 
-			list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+            list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 //
-			//负责人为空
-			$list = $this->model->where($where)->order($sort, $order)->paginate($limit);
+            //负责人为空
+            $list = $this->model->where($where)->order($sort, $order)->paginate($limit);
 
-			$result = array("total" => $list->total(), "rows" => $list->items());
+            $result = array("total" => $list->total(), "rows" => $list->items());
 
-			return json($result);
-		}
+            return json($result);
+        }
 
-		return $this->view->fetch();
-	}
+        return $this->view->fetch();
+    }
 
 
-	/**
-	 * 添加
-	 */
-	public function add() {
-		if ($this->request->isPost()) {
-			$params = $this->request->post("row/a");
-			if ($params) {
-				$params = $this->preExcludeFields($params);
+    /**
+     * 添加
+     */
+    public function add() {
+        if ($this->request->isPost()) {
+            $params = $this->request->post("row/a");
+            if ($params) {
+                $params = $this->preExcludeFields($params);
 
                 $params['product_id']=implode(',',$params['product_id']);
-				$result = false;
-				Db::startTrans();
-				try {
-					$result = $this->model->allowField(true)->save($params);
-					Db::commit();
-				} catch (Exception $e) {
-					Db::rollback();
-					$this->error($e->getMessage());
-				}
-				if ($result !== false) {
-					$this->success();
-				} else {
-					$this->error(__('No rows were inserted'));
-				}
-			}
-			$this->error(__('Parameter %s can not be empty', ''));
-		}
-		$product=Product::where([])->column('name','id');
-
-		$this->view->assign('product',$product);
-		return $this->view->fetch();
-	}
-
-	//修改
-	public function edit($ids = null) {
-		$map['id'] = $ids;
-		if ($this->request->isAjax()) {
-			$params = $this->request->post('row/a');
-			$params = $this->preExcludeFields($params);
+                $result = false;
+                Db::startTrans();
+                try {
+                    $result = $this->model->allowField(true)->save($params);
+                    Db::commit();
+                } catch (Exception $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                }
+                if ($result !== false) {
+                    $this->success();
+                } else {
+                    $this->error(__('No rows were inserted'));
+                }
+            }
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $product=Product::where([])->column('name','id');
+
+        $this->view->assign('product',$product);
+        return $this->view->fetch();
+    }
+
+    //修改
+    public function edit($ids = null) {
+        $map['id'] = $ids;
+        if ($this->request->isAjax()) {
+            $params = $this->request->post('row/a');
+            $params = $this->preExcludeFields($params);
             $params['product_id']=implode(',',$params['product_id']);
-			$result = false;
-			Db::startTrans();
-			try {
-				$result = $this->model->allowField(true)->update($params, $map);
-				Db::commit();
-			} catch (Exception $e) {
-				Db::rollback();
-				$this->error($e->getMessage());
-			}
-			if ($result !== false) {
-				$this->success('修改成功');
-			} else {
-				$this->error('修改失败');
-			}
-		}
-		$data = $this->model->where($map)->find()->getData();
-		$this->view->assign("row", $data);
+            $result = false;
+            Db::startTrans();
+            try {
+                $result = $this->model->allowField(true)->update($params, $map);
+                Db::commit();
+            } catch (Exception $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
+            }
+            if ($result !== false) {
+                $this->success('修改成功');
+            } else {
+                $this->error('修改失败');
+            }
+        }
+        $data = $this->model->where($map)->find()->getData();
+        $this->view->assign("row", $data);
         $product=Product::where([])->column('name','id');
 
         $this->view->assign('product',$product);
-		return $this->view->fetch();
-	}
-
-
-	public function detail($ids=null){
-		$row=$this->model->where(['id'=>$ids])->find();
-
-		$this->assign('row',$row);
-		$this->assign('ids',$ids);
-		return $this->view->fetch();
-	}
-
-	/**
-	 * 删除
-	 */
-	public function del($ids = "") {
-		if (!$this->request->isPost()) {
-			$this->error(__("Invalid parameters"));
-		}
-		$ids                 = $ids ? $ids : $this->request->post("ids");
-		$row                 = $this->model->get($ids);
-		$this->modelValidate = true;
-		if (!$row) {
-			$this->error(__('No Results were found'));
-		}
-		$row->delete();
-		$this->success();
-	}
+        return $this->view->fetch();
+    }
+
+
+    public function detail($ids=null){
+        $row=$this->model->where(['id'=>$ids])->find();
+
+        $this->assign('row',$row);
+        $this->assign('ids',$ids);
+        return $this->view->fetch();
+    }
+
+    /**
+     * 删除
+     */
+    public function del($ids = "") {
+        if (!$this->request->isPost()) {
+            $this->error(__("Invalid parameters"));
+        }
+        $ids                 = $ids ? $ids : $this->request->post("ids");
+        $row                 = $this->model->get($ids);
+        $this->modelValidate = true;
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $row->delete();
+        $this->success();
+    }
 
     /**
      * 出库
@@ -240,16 +240,33 @@ class Parts extends Base {
             $this->relationSearch = true;
             list($where, $sort, $order, $offset, $limit) = $this->buildparams(null, null);
 
+            $filter = $this->request->get("filter", '');
+            $filter = (array)json_decode($filter, true);
+            $filter = $filter ? $filter : [];
+
+            if (array_key_exists('status', $filter)) {
+                $wheres['status'] = $filter['status'];
+            }
+
+            if (array_key_exists('createtime', $filter)) {
+                $time = explode(' - ', $filter['createtime']);
+                $wheres['createtime'] = ['between', [strtotime($time[0]), strtotime($time[1])]];
+            }
+
             $ids=input('ids');
             if ($ids) {
                 $reloads = PartsStockReload::where(['create_staff_id'=>$this->_staff->id])->column('id');
                 $wheres['relation_id'] =['in',$reloads];
             }
             $wheres['relation_type'] = 'parts';
-            $list   =  (new ExamineRecord())->where($where)->where($wheres)->with([
+            $list   =  (new ExamineRecord())
+//                ->where($where)
+                ->where($wheres)
+                ->with([
                 'checkStaff',
-                'parts' => ['createStaff']
-            ])->order('id', $order)->paginate($limit);
+                'parts' => ['createStaff']])
+                ->order('id', $order)
+                ->paginate($limit);
             $row    = $list->items();
 
             $result = array("total" => $list->total(), "rows" => $row);

+ 7 - 6
application/admin/controller/qingdongams/report/Daily.php

@@ -54,12 +54,13 @@ class Daily extends Base {
             // if($staff_id){
             //     $whereT['create_staff_id']=$staff_id;
             // }
-            $staff_id=$this->_staff->id;
-            $list   = $this->model
-                // ->where(function ($query) use ($staff_id,$wheres){
-                //     $query->where($wheres)
-                //         ->whereOr('','exp', Db::raw('FIND_IN_SET(' . $staff_id. ',reminds_id)'));
-                // })
+            $staff_id = $this->_staff->id;
+            $list = $this->model
+                ->where($where)
+                ->where(function ($query) use ($staff_id,$wheres){
+                    $query->where($wheres);
+//                    ->whereOr('','exp', Db::raw('FIND_IN_SET(' . $staff_id. ',reminds_id)'));
+                })
                 ->order($sort, $order)->with(['staff'])->paginate($limit);
             $row    = $list->items();
             $result = array("total" => $list->total(), "rows" => $row);

+ 12 - 3
application/admin/controller/qingdongams/workorder/Workorder.php

@@ -109,7 +109,7 @@ class Workorder extends Base
             $sheet->setCellValue('B' . $row, $item['title']);
             $sheet->setCellValue('C' . $row, $item['workorder_type']);
             $sheet->setCellValue('D' . $row, $item['schedule']);
-            $sheet->setCellValue('E' . $row, $item['customer']['name']);
+            $sheet->setCellValue('E' . $row, $item['customer']['name'] ?? '-');
             $sheet->setCellValue('F' . $row, !empty($item['contacts'])? $item['contacts']['name']:'');
             $sheet->setCellValue('G' . $row, $item['createtime']);
             // $sheet->setCellValue('H' . $row, $item['age']);
@@ -150,7 +150,7 @@ class Workorder extends Base
             if($need && $need == 'workorder'){
                 $wheres['status'] = 1;
             }
-            if($createtime && $createtime !='null '){
+            if($createtime && $createtime != 'null'){
                 $start = date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),1,date("Y")));
                 $end = date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("t"),date("Y")));
                 $wheres['createtime'] = array('between',array(strtotime($start),strtotime($end)));
@@ -172,12 +172,21 @@ class Workorder extends Base
                     ->whereOr('', 'exp', "FIND_IN_SET({$this->_staff->id},show_staff_id)");
             };
             // dump($map);
-            $list = $this->model->where($where)->where($map)->where($wheres)->where($whereStaff)->with(['customer', 'contacts','ownerStaff'])->order('id desc')->paginate($limit);
+            $list = $this->model->with(['customer', 'contacts','ownerStaff'])->where($where)->where($map)->where($wheres)->where($whereStaff)->order('id desc')->paginate($limit);
+
+            foreach ($list as $value) {
+                if ($value['owner_staff']) {
+                    $value->owner_staff_id = $value['owner_staff']['name'];
+                }
+            }
+
             $result = array("total" => $list->total(), "rows" => $list->items());
 
             return json($result);
         }
 
+        $owner_staff_list = Staff::where(['status' => 1, 'id' => ['notin', [1, 15]]])->column('name', 'id');
+        $this->assignconfig('ownerStaffList', $owner_staff_list);
         return $this->view->fetch();
     }
 

+ 1 - 1
application/admin/library/Auth.php

@@ -284,7 +284,7 @@ class Auth extends \fast\Auth
             }
         }
         // 取出所有分组
-        $groupList = \app\admin\model\AuthGroup::where(['status' => 'normal'])->select();
+        $groupList = \app\admin\model\AuthGroup::select();
         $objList = [];
         foreach ($groups as $k => $v) {
             if ($v['rules'] === '*') {

+ 13 - 0
application/admin/model/qingdongams/customer/Equipmentdevice.php

@@ -45,6 +45,19 @@ class Equipmentdevice extends Model
         });
     }
 
+    // 修改设备状态
+    public static function updateStatus($contract_id)
+    {
+        // 查找绑定对应合同的设备信息
+        $devices = self::where(['contract_id' => $contract_id, 'status' => 1])->select();
+        foreach ($devices as $device) {
+            $device->status = 0;
+            $device->customer_id = NULL;
+            $device->contract_id = NULL;
+            $device->save();
+        }
+    }
+
     public function getStatusList()
     {
         return ['0' =>'未绑定','1'=>'已绑定'];

+ 7 - 8
application/admin/model/qingdongams/customer/Equipmenttype.php

@@ -27,14 +27,13 @@ class Equipmenttype extends Model
     protected $append = [
 
     ];
-    
-
-    
-
-
-
-
-
 
+    public static function getList($notInIds = [])
+    {
+        if ($notInIds) {
+            $where['id'] = ['not in', $notInIds];
+        }
+        return self::field('id,name')->select();
+    }
 
 }

+ 51 - 51
application/admin/view/index/index.html

@@ -1,56 +1,56 @@
 <!DOCTYPE html>
 <html>
-    <head>
-        <!-- 加载样式及META信息 -->
-        {include file="common/meta" /}
-    </head>
-    <body class="hold-transition {$Think.config.fastadmin.adminskin|default='skin-black-blue'} sidebar-mini {:$Think.cookie.sidebar_collapse?'sidebar-collapse':''} fixed {:$Think.config.fastadmin.multipletab?'multipletab':''} {:$Think.config.fastadmin.multiplenav?'multiplenav':''}" id="tabs">
-
-        <div class="wrapper">
-
-            <!-- 头部区域 -->
-            <header id="header" class="main-header">
-                {if preg_match('/\/admin\/|\/admin\.php|\/admin_d75KABNWt\.php/i', url())}
-                <div class="alert alert-danger-light text-center" style="margin-bottom:0;border:none;">
-                    {:__('Security tips')}
-                </div>
-                {/if}
-
-                {include file='common/header' /}
-            </header>
-
-            <!-- 左侧菜单栏 -->
-            <aside class="main-sidebar">
-                {include file='common/menu' /}
-            </aside>
-
-            <!-- 主体内容区域 -->
-            <div class="content-wrapper tab-content tab-addtabs">
-                {if $fixedmenu}
-                <div role="tabpanel" class="tab-pane {:$referermenu?'':'active'}" id="con_{$fixedmenu.id}">
-                    <iframe src="{$fixedmenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
-                </div>
-                {/if}
-                {if $referermenu}
-                <div role="tabpanel" class="tab-pane active" id="con_{$referermenu.id}">
-                    <iframe src="{$referermenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
-                </div>
-                {/if}
-            </div>
-
-            <!-- 底部链接,默认隐藏 -->
-            <footer class="main-footer hide">
-                <div class="pull-right hidden-xs">
-                </div>
-                <strong>Copyright &copy; 2017-{:date("Y")} <a href="__PUBLIC__">{$site.name}</a>.</strong> All rights reserved.
-            </footer>
-
-            <!-- 右侧控制栏 -->
-            <div class="control-sidebar-bg"></div>
-            {include file="common/control" /}
+<head>
+    <!-- 加载样式及META信息 -->
+    {include file="common/meta" /}
+</head>
+<body class="hold-transition {$Think.config.fastadmin.adminskin|default='skin-black-blue'} sidebar-mini {:$Think.cookie.sidebar_collapse?'sidebar-collapse':''} fixed {:$Think.config.fastadmin.multipletab?'multipletab':''} {:$Think.config.fastadmin.multiplenav?'multiplenav':''}" id="tabs">
+
+<div class="wrapper">
+
+    <!-- 头部区域 -->
+    <header id="header" class="main-header">
+        {if preg_match('/\/admin\/|\/admin\.php|\/admin_d75KABNWt\.php/i', url())}
+        <div class="alert alert-danger-light text-center" style="margin-bottom:0;border:none;">
+            {:__('Security tips')}
         </div>
+        {/if}
 
-        <!-- 加载JS脚本 -->
-        {include file="common/script" /}
-    </body>
+        {include file='common/header' /}
+    </header>
+
+    <!-- 左侧菜单栏 -->
+    <aside class="main-sidebar">
+        {include file='common/menu' /}
+    </aside>
+
+    <!-- 主体内容区域 -->
+    <div class="content-wrapper tab-content tab-addtabs">
+        {if $fixedmenu}
+        <div role="tabpanel" class="tab-pane {:$referermenu?'':'active'}" id="con_{$fixedmenu.id}">
+            <iframe src="{$fixedmenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
+        </div>
+        {/if}
+        {if $referermenu}
+        <div role="tabpanel" class="tab-pane active" id="con_{$referermenu.id}">
+            <iframe src="{$referermenu.url}?addtabs=1" width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe>
+        </div>
+        {/if}
+    </div>
+
+    <!-- 底部链接,默认隐藏 -->
+    <footer class="main-footer hide">
+        <div class="pull-right hidden-xs">
+        </div>
+        <strong>Copyright &copy; 2017-{:date("Y")} <a href="__PUBLIC__">{$site.name}</a>.</strong> All rights reserved.
+    </footer>
+
+    <!-- 右侧控制栏 -->
+    <div class="control-sidebar-bg"></div>
+    {include file="common/control" /}
+</div>
+
+<!-- 加载JS脚本 -->
+{include file="common/script" /}
+</body>
 </html>

+ 1 - 1
application/admin/view/qingdongams/customer/contract/address.html

@@ -18,7 +18,7 @@
         <div class="col-xs-12 col-sm-6">
             <div class="form-group col-sm-10">
                 <label for="c-consignee_mobile">联系方式:</label>
-                <input id="c-consignee_mobile" data-rule="required" class="form-control " placeholder="下单时间" name="row[consignee_mobile]" value="{$row.consignee_mobile}" type="text">
+                <input id="c-consignee_mobile" data-rule="required" class="form-control " placeholder="联系方式" name="row[consignee_mobile]" value="{$row.consignee_mobile}" type="text">
             </div>
         </div>
         <div class="col-xs-12 col-sm-12">

+ 10 - 10
application/admin/view/qingdongams/customer/customer/import.html

@@ -11,16 +11,16 @@
 			</select>
 		</div>
 	</div>
-    <div class="form-group" id="seas_type">
-        <label class="control-label col-xs-3 col-sm-3">放入公海池:</label>
-        <div class="col-xs-8 col-sm-8">
-            <select name="seas_type_id" class="form-control" >
-                {foreach name="seas_type" item="val"}
-                <option value="{$val.id}">{$val.name}</option>
-                {/foreach}
-            </select>
-        </div>
-    </div>
+<!--    <div class="form-group" id="seas_type">-->
+<!--        <label class="control-label col-xs-3 col-sm-3">放入公海池:</label>-->
+<!--        <div class="col-xs-8 col-sm-8">-->
+<!--            <select name="seas_type_id" class="form-control" >-->
+<!--                {foreach name="seas_type" item="val"}-->
+<!--                <option value="{$val.id}">{$val.name}</option>-->
+<!--                {/foreach}-->
+<!--            </select>-->
+<!--        </div>-->
+<!--    </div>-->
     <div class="form-group" style="margin-top:20px;margin-bottom:20px;">
         <label class="control-label col-xs-3 col-sm-3">文件上传:</label>
         <div class="col-xs-8 col-sm-8">

+ 1 - 1
application/admin/view/qingdongams/customer/equipmentcate/add.html

@@ -52,7 +52,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-sort" class="form-control" name="row[sort]" type="number" value="5">
+            <input id="c-sort" class="form-control" name="row[sort]" type="number" value="">
         </div>
     </div>
     <div class="form-group layer-footer">

+ 0 - 10
application/admin/view/qingdongams/customer/equipmentcate/index.html

@@ -8,17 +8,7 @@
                     <div id="toolbar" class="toolbar">
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                         <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('qingdongams/customer/equipmentcate/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
-                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('qingdongams/customer/equipmentcate/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                         <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('qingdongams/customer/equipmentcate/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
-                        
-
-                        <div class="dropdown btn-group {:$auth->check('qingdongams/customer/equipmentcate/multi')?'':'hide'}">
-                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
-                            <ul class="dropdown-menu text-left" role="menu">
-                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
-                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
-                            </ul>
-                        </div>
 
                         <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('qingdongams/customer/equipmentcate/recyclebin')?'':'hide'}" href="qingdongams/customer/equipmentcate/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
                     </div>

+ 4 - 3
application/admin/view/qingdongams/customer/record/add.html

@@ -13,9 +13,10 @@
 		<small style="line-height:34px;" >
 			<span style="padding:5px;"></span>
 			<a href="javascript:;" id="follow_type"   data-toggle="popover" data-placement="right" data-trigger="hover" data-template='<div class="popover" role="tooltip">
-    <div class="arrow"></div>
-    <h3 class="popover-title" style="width:200px;"></h3>
-</div>'  data-original-title="跟进类型可自定义类型,在【基础设置】—【字段类型管理】中进行设置"><i class="fa fa-question-circle" style="font-size:16px;"></i></a>
+					<div class="arrow"></div>
+					<h3 class="popover-title" style="width:200px;"></h3>
+				</div>'  data-original-title="跟进类型可自定义类型,在【基础设置】—【字段类型管理】中进行设置"><i class="fa fa-question-circle" style="font-size:16px;"></i>
+			</a>
 		</small>
 	</div>
 		<div class="form-group">

+ 18 - 13
application/admin/view/qingdongams/department/staff/add.html

@@ -1,7 +1,7 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     {:token()}
     <div class="form-group">
-        <label  class="control-label col-xs-12 col-sm-2">姓名:</label>
+        <label  class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>姓名:</label>
         <div class="col-xs-12 col-sm-8">
             <input  data-rule="required" class="form-control" name="row[name]" type="text"  >
         </div>
@@ -13,7 +13,7 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">角色:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>角色:</label>
         <div class="col-xs-12 col-sm-8">
             {:build_select('group[]', $groupdata, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
         </div>
@@ -26,10 +26,9 @@
         </small>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">部门:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>部门:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_select('row[role]', $roles, null, ['class'=>'form-control selectpicker',
-            'data-rule'=>'required', 'data-live-search'=>'true'])}
+            {:build_select('row[role]', $roles, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required', 'data-live-search'=>'true'])}
         </div>
         <small style="line-height:34px;" >
             <span style="padding:0px;"></span>
@@ -47,26 +46,32 @@
 		</div>
     </div>
     <div class="form-group">
-        <label  class="control-label col-xs-12 col-sm-2">邮箱:</label>
+        <label  class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>邮箱:</label>
         <div class="col-xs-12 col-sm-8">
-            <input class="form-control" name="row[email]" type="text"  placeholder="已经存在的邮箱号不可填写" >
+            <input class="form-control" name="row[email]" type="text" placeholder="已经存在的邮箱号不可填写" data-rule="required">
         </div>
     </div>
     <div class="form-group">
-        <label  class="control-label col-xs-12 col-sm-2">手机号码:</label>
+        <label  class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>用户名:</label>
         <div class="col-xs-12 col-sm-8">
-            <input data-rule="required"    class="form-control" name="row[mobile]" type="text" placeholder="已经存在的手机号不可填写" >
+            <input data-rule="required" class="form-control" name="row[username]" type="text" placeholder="用户登录使用的用户名" >
         </div>
     </div>
     <div class="form-group">
-        <label for="c-password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
+        <label  class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>手机号码:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="text" value=""
-                   placeholder="请输入密码" autocomplete="password"/>
+            <input data-rule="required" class="form-control" name="row[mobile]" type="text" placeholder="已经存在的手机号不可填写" >
         </div>
     </div>
     <div class="form-group">
-        <label  class="control-label col-xs-12 col-sm-2">岗位:</label>
+        <label for="c-password" class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('Password')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-password" data-rule="required|password" class="form-control" name="row[password]" type="text" value=""
+                   placeholder="请输入密码" autocomplete="password" />
+        </div>
+    </div>
+    <div class="form-group">
+        <label  class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>岗位:</label>
         <div class="col-xs-12 col-sm-8">
             <input  data-rule="required" class="form-control" name="row[post]" type="text"  >
         </div>

+ 11 - 9
application/admin/view/qingdongams/department/staff/edit.html

@@ -1,7 +1,7 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     {:token()}
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">姓名:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>姓名:</label>
         <div class="col-xs-12  col-sm-8">
             <input data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}">
         </div>
@@ -12,8 +12,9 @@
             <input class="form-control" name="row[num]" type="text" value="{$row.num}">
         </div>
     </div>
+    {if condition="$row.id != 15"}
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">角色:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>角色:</label>
         <div class="col-xs-12 col-sm-8">
             {:build_select('group[]', $groupdata, $row['group_ids'], ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
         </div>
@@ -25,8 +26,9 @@
 </div>'  data-original-title="该部门在【员工管理】—【组织架构】处进行配置"><i class="fa fa-question-circle" style="font-size:16px;"></i></a>
         </small>
     </div>
+    {/if}
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">部门:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>部门:</label>
         <div class="col-xs-12 col-sm-8">
             {:build_select('row[role]', $roles, $row['role'], ['class'=>'form-control selectpicker',
             'data-rule'=>'required', 'data-live-search'=>'true'])}
@@ -48,22 +50,22 @@
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">邮箱:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>邮箱:</label>
         <div class="col-xs-12  col-sm-8">
-            <input    class="form-control"  name="row[email]" type="text" value="{$row.email}">
+            <input    class="form-control"  name="row[email]" type="text" value="{$row.email}" data-rule="required">
         </div>
     </div>
     <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">手机号码:</label>
+        <label class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>手机号码:</label>
         <div class="col-xs-12  col-sm-8">
-            <input data-rule="required"  name="row[mobile]"    class="form-control" type="text" value="{$row.mobile}" >
+            <input data-rule="required" name="row[mobile]" class="form-control" type="text" value="{$row.mobile}" >
         </div>
     </div>
 
     <div class="form-group">
-        <label for="c-password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
+        <label for="c-password" class="control-label col-xs-12 col-sm-2"><span style="color:red;">*</span>{:__('Password')}:</label>
         <div class="col-xs-12  col-sm-8">
-            <input id="c-password" data-rule="password" class="form-control" name="row[password]" type="text" value=""
+            <input id="c-password" data-rule="required|password" class="form-control" name="row[password]" type="text" value=""
                    placeholder="不修改密码请留空" autocomplete="new-password"/>
         </div>
     </div>

+ 8 - 1
application/admin/view/qingdongams/notice/aftermarket/add.html

@@ -2,7 +2,7 @@
 	<div class="form-group">
 		<label class="control-label col-xs-12 col-sm-2">类型:</label>
 		<div class="col-xs-12 col-sm-8">
-			{:build_select('type_ids[]', $treeList, [], ['class'=>'form-control selectpicker',  'multiple'=>'true','data-rule'=>'required'])}
+			{:build_select('type_ids[]', $treeList, $hasTypes, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
 		</div>
 	</div>
 	<!-- <div class="form-group">
@@ -41,6 +41,13 @@
 			</div>
 			<ul class="row list-inline faupload-preview" id="p-avatar"></ul>
 		</div>
+		<small style="line-height:34px;" >
+			<span style="padding:0px;"></span>
+			<a href="javascript:;" id="myPopover" data-toggle="popover" data-placement="right" data-trigger="hover" data-template='<div class="popover" role="tooltip">
+    <div class="arrow"></div>
+    <h3 class="popover-title" style="width:200px;"></h3>
+</div>'  data-original-title="格式限制为:gif,jpeg,jpg,png,bmp."><i class="fa fa-question-circle" style="font-size:16px;"></i></a>
+		</small>
 	</div>
 
 	<div class="form-group" id="contents">

+ 8 - 1
application/admin/view/qingdongams/notice/aftermarket/edit.html

@@ -6,7 +6,7 @@
 	<div class="form-group">
 		<label class="control-label col-xs-12 col-sm-2">类型:</label>
 		<div class="col-xs-12 col-sm-8">
-			{:build_select('type_ids[]', $treeList, $hasTypes, ['class'=>'form-control selectpicker',  'multiple'=>'true','data-rule'=>'required'])}
+			{:build_select('type_ids[]', $treeList, $hasTypes, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
 		</div>
 	</div>
 	<!-- <div class="form-group">
@@ -45,6 +45,13 @@
 			</div>
 			<ul class="row list-inline faupload-preview" id="p-avatar"></ul>
 		</div>
+		<small style="line-height:34px;" >
+			<span style="padding:0px;"></span>
+			<a href="javascript:;" id="myPopover" data-toggle="popover" data-placement="right" data-trigger="hover" data-template='<div class="popover" role="tooltip">
+    <div class="arrow"></div>
+    <h3 class="popover-title" style="width:200px;"></h3>
+</div>'  data-original-title="格式限制为:gif,jpeg,jpg,png,bmp."><i class="fa fa-question-circle" style="font-size:16px;"></i></a>
+		</small>
 	</div>
 
 	<div class="form-group" id="number">

+ 5 - 1
application/admin/view/qingdongams/notice/aftermarket/index.html

@@ -16,8 +16,12 @@
             <div id="myTabContent" class="tab-content">
                 <div class="tab-pane fade active in" id="one">
                     <div class="widget-body no-padding">
+<!--                        <div id="toolbar" class="toolbar">-->
+<!--                            {:build_toolbar('refresh,add')}-->
+<!--                        </div>-->
                         <div id="toolbar" class="toolbar">
-                            {:build_toolbar('refresh,add')}
+                            <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                            <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('qingdongams/notice/aftermarket/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
                         </div>
                         <table id="table" class="table table-striped table-bordered table-hover" width="100%">
                         </table>

+ 1 - 1
application/admin/view/qingdongams/product/product/index.html

@@ -8,7 +8,7 @@
             <div class="tab-pane fade active in" id="one">
                 <div class="widget-body no-padding">
                     <div id="toolbar" class="toolbar">
-                        {:build_toolbar('add,edit,refresh')}
+                        {:build_toolbar('add,refresh')}
 <!--                        <a class="btn btn-success btn-change btn-dialog {:$auth->check('qingdongams/product/product/import')?'':'hide'}" data-title="产品导入" data-url="qingdongams/product/product/import" data-area='["500px","400px"]'  data-params="action=start"  href="javascript:;"><i class="fa fa-upload dz-message"></i> 导入</a>-->
                     </div>
                     <table id="table" class="table table-striped table-bordered table-hover table-nowrap"

+ 1 - 1
application/admin/view/qingdongams/workorder/workorder/detail.html

@@ -397,7 +397,7 @@
 
 		<div class="form-group">
 			<span class="text-muted">负责人</span>
-			<p>{$row.owner_staff.name}</p>
+			<p>{$row.owner_staff.name ?? ''}</p>
 		</div>
 		<div class="form-group">
 			<span class="text-muted">创建时间</span>

+ 6 - 0
application/admin/view/qingdongams/workorder/workorder/detail_template/detail1.html

@@ -54,6 +54,12 @@
 			{$row.desc}
 		</div>
 	</div>
+	<div class="col-xs-6 col-sm-10">
+		<div class="form-group col-sm-10">
+			<span class="text-muted">计划备注:</span>
+			{$row.matters}
+		</div>
+	</div>
 	<div class="col-xs-12 col-sm-12">
 		<div class="form-group col-sm-10">
 			<span class="text-muted">附件:</span>

+ 1 - 1
application/admin/view/qingdongams/workorder/workorder/edit_template/edit5.html

@@ -141,7 +141,7 @@
 		<label class="control-label col-xs-12 col-sm-2"></label>
 		<div class="col-xs-12 col-sm-8">
 			<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
-			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
+<!--			<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>-->
 		</div>
 	</div>
 </form>

+ 2 - 2
public/assets/js/backend/qingdongams/customer/customer.js

@@ -322,12 +322,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 						},operate:'like',searchable:true
 					},
 
-					{field : 'contract_status', title : '成交状态',operate:'=',searchList:{0:'未成交',1:'已成交'},formatter:Table.api.formatter.status},
+					// {field : 'contract_status', title : '成交状态',operate:'=',searchList:{0:'未成交',1:'已成交'},formatter:Table.api.formatter.status},
 					{field : 'owner_staff.name', title : '归属员工',operate:false},
 					{field : 'owner_staff_id', title : '归属员工',visible:false,operate:'=',searchList:$.getJSON("qingdongams/customer/customer/stafflist")},
 					{field : 'next_time', title : '下次联系时间', operate:'RANGE', addclass:'datetimerange'},
 					{field : 'last_time', title : '最后跟进时间', operate:'RANGE', addclass:'datetimerange'},
-					{field : 'receivetime', title : '领取时间', operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
+					// {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},
 
 					{

+ 1 - 1
public/assets/js/backend/qingdongams/customer/equipmentcate.js

@@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'name', title:'系统名称', operate: 'LIKE'},
-                         {field: 'gongneng', title:'系统功能', operate: 'LIKE'},
+                        {field: 'gongneng', title:'系统功能', operate: 'LIKE'},
                         {field: 'remark', title: __('Remark'), operate: 'LIKE'},
                         {field: 'sort', title: __('Sort')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

+ 10 - 4
public/assets/js/backend/qingdongams/customer/equipmentdevice.js

@@ -2,11 +2,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
     var Controller = {
         index: function () {
+            let add_url = 'qingdongams/customer/equipmentdevice/add';
+            if (Config.isselect == 1) {
+                add_url  = 'qingdongams/customer/equipmentdevice/add?customer_id=' + Config.customer_id;
+            }
+            console.log(add_url);
+
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
                     index_url: 'qingdongams/customer/equipmentdevice/index' + location.search,
-                    add_url: 'qingdongams/customer/equipmentdevice/add',
+                    add_url: add_url,
                     edit_url: 'qingdongams/customer/equipmentdevice/edit',
                     del_url: 'qingdongams/customer/equipmentdevice/del',
                     multi_url: 'qingdongams/customer/equipmentdevice/multi',
@@ -41,14 +47,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'brand', title: __('Brand'), operate: 'LIKE'},
                         {field: 'w_time', title: __('W_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'address', title: __('Address'), operate: 'LIKE'},
-                        {field: 'type_id_text', title: __('Type_id'), operate: 'LIKE'},
+                        {field: 'type_id', title: __('Type_id'), operate:'=', searchList: $.getJSON("qingdongams/customer/equipmentdevice/typeList")},
                         {field: 'remark', title: __('Remark'), operate: 'LIKE'},
                         {field: 'sort', title: __('Sort')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
 
-                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate},
+                        {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, operate:false},
                         {
-							field: 'operate2', title: __('Operate'),visible:isselect, events: {
+							field: 'operate2', title: __('Operate'),visible:isselect, operate:false, events: {
 								'click .btn-chooseone': function (e, value, row, index) {
 									Fast.api.close(row);
 								},

+ 5 - 4
public/assets/js/backend/qingdongams/customer/record.js

@@ -58,14 +58,15 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
 
                                 },operate:false
                             },
-                            {field: 'follow_type', title: __('跟进类型')},
+                            {field: 'follow_type', title: __('跟进类型'), },
                             {field: 'follow_time', title: __('跟进时间'), operate:'RANGE', addclass:'datetimerange'},
-                            {field: 'follow', title: __('跟进状态')},
-                            {field: 'content', title: __('跟进内容')},
+                            {field : 'status', title : '跟进状态',operate:'=',searchList:{0:'未跟进',1:'已跟进'},formatter:Table.api.formatter.status},
+                            {field: 'content', title: __('跟进内容'), operate: 'like'},
                             {field: 'next_time', title: __('下次跟进时间'), operate:'RANGE', addclass:'datetimerange'},
                             {field: 'staff.name', title: __('创建人'),operate:false},
                             {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
                             {
+                                width: "100px",
                                 field     : 'operate',
                                 title     : __('Operate'),
                                 table     : table,
@@ -465,7 +466,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
             var table6 = $("#comment");
             // 初始化表格
             table6.bootstrapTable({
-                url          : 'qingdongams/customer/record/comment?record_id='+Config.idinfo.id,
+                url          : 'qingdongams/customer/record/comment?record_id=' + Config.idinfo.id,
                 pk           : 'id',
                 sortName     : 'id',
                 operate      : false,

+ 8 - 8
public/assets/js/backend/qingdongams/department/role.js

@@ -49,15 +49,15 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table', 'jstree'], function (
                             table     : table,
                             events    : Table.api.events.operate,
                             formatter : Table.api.formatter.operate,
-                            // buttons:[
-                            //     {
-                            //         name: '权限配置',
-                            //         text: __('权限配置'),
-                            //         classname: 'btn-xs btn-dialog',
-                            //         url: 'qingdongams/department/role/rule',
+                            buttons:[
+                                {
+                                    name: '权限配置',
+                                    text: __('权限配置'),
+                                    classname: 'btn-xs btn-dialog',
+                                    url: 'qingdongams/department/role/rule',
 
-                            //     },
-                            // ]
+                                },
+                            ]
                         }
                     ]
                 ],

+ 8 - 1
public/assets/js/backend/qingdongams/department/staff.js

@@ -25,6 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
 				columns           : [
 					[
 						{checkbox : true},
+						{field : 'admin.username', title : __('用户名'), operate: false},
 						{field : 'name', title : __('姓名')},
 						{field : 'img', title : __('头像'), events : Table.api.events.image, formatter : Table.api.formatter.image, operate : false},
 						{field : 'num', title : __('员工编号')},
@@ -33,7 +34,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
 						{field : 'sex', title : __('性别'),operate:false, formatter : Table.api.formatter.status, searchList : {0 : __('未知'),1 : __('男'), 2 : __('女')}},
 						{field : 'post', title : __('岗位'),operate:false},
 						{field : 'staffrole.name', title :'部门', operate : false},
-						{field : 'role', title : __('角色'), visible: false, searchList : $.getJSON("qingdongams/department/staff/getstaffrole")},
+						{field : 'role', title : __('角色'), visible: false, searchList : $.getJSON("qingdongams/department/staff/getstaffrole"), operate: false},
 						{field : 'parent_name', title : __('直属上级'),operate:false},
 						{field : 'admin.username', title : __('绑定后台账号'),operate:false},
 						{field : 'status', title : __('状态'), formatter : Table.api.formatter.status, searchList : {0 : __('审核中'), 1 : __('正常'),2:'禁用'}},
@@ -57,6 +58,12 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
 											return false;
 										}
 										return true;
+									},
+									visible:function (row) {
+										if (row.id == 15) {
+											return false;
+										}
+										return true;
 									}
 								},
 								{

+ 9 - 0
public/assets/js/backend/qingdongams/examine/examine.js

@@ -1263,6 +1263,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     url: 'qingdongams/examine/examine_record/examine?relation_type=parts&relation_id={relation_id}&status=1&noreload=1',
                                     visible: function (row) {
                                         //返回true时按钮显示,返回false隐藏
+                                        if (row.status == 1) {
+                                            return false;
+                                        }
                                         return true;
                                     },
                                     success:function(data){
@@ -1278,6 +1281,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                                     extend: ' data-area=\'\'',
                                     refresh:true,
                                     url: 'qingdongams/examine/examine_record/examine?relation_type=parts&relation_id={relation_id}&status=2&noreload=1',
+                                    visible: function (row){
+                                        if (row.status == 2) {
+                                            return false;
+                                        }
+                                        return true;
+                                    },
                                     error: function (data, ret) {
                                         console.log(data, ret);
                                         Layer.alert(ret.msg);

+ 15 - 6
public/assets/js/backend/qingdongams/notice/aftermarket.js

@@ -1,12 +1,12 @@
 define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
-
+    var type_id = 0;
     var Controller = {
         index: function () {
             // 初始化表格参数配置
             Table.api.init({
                 extend: {
                     index_url: 'qingdongams/notice/aftermarket/index' + location.search,
-                    add_url: 'qingdongams/notice/aftermarket/add',
+                    add_url: 'qingdongams/notice/aftermarket/add?type_id=' + type_id,
                     edit_url: 'qingdongams/notice/aftermarket/edit',
                     del_url: 'qingdongams/notice/aftermarket/del',
                     table: 'aftermarket'
@@ -85,7 +85,17 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                 //全选和展开
                 $('#jsTree').on("changed.jstree", function (e, data) {
                     var type_ids = data.selected;
-                    $(".commonsearch-table input[name=type_ids]").val(','+type_ids.toString()+',');
+                    type_id = type_ids.toString();
+                    Table.api.init({
+                        extend: {
+                            index_url: 'qingdongams/notice/aftermarket/index' + location.search,
+                            add_url: 'qingdongams/notice/aftermarket/add?type_id=' + type_id,
+                            edit_url: 'qingdongams/notice/aftermarket/edit',
+                            del_url: 'qingdongams/notice/aftermarket/del',
+                            table: 'aftermarket'
+                        }
+                    });
+                    $(".commonsearch-table input[name=type_ids]").val(',' + type_ids.toString() + ',');
                     table.bootstrapTable('refresh', {});
                     return false;
                 });
@@ -101,9 +111,9 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                         "data": Config.typeList
                     }
                 });
-            });
-
 
+                $('#jsTree').jstree(true).refresh();
+            });
 
             $('.search').hide();
             $('.btn-import').hide();
@@ -112,7 +122,6 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
         add: function () {
             Controller.api.bindevent();
         },
-
         edit: function () {
             Controller.api.bindevent();
         },

+ 3 - 1
public/assets/js/backend/qingdongams/notice/aftermarket_type.js

@@ -25,7 +25,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                         {field: 'state', checkbox: true},
                         {field: 'name', title: __('Name'), align: 'left', formatter: Controller.api.formatter.title},
                         {field: 'sort', title: __('Weigh')},
-
                         {
                             field     : 'operate',
                             title     : __('Operate'),
@@ -59,6 +58,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                                     },
                                     visible: function (row) {
                                         //返回true时按钮显示,返回false隐藏
+                                        if (row.id == 4) {
+                                            return false;
+                                        }
                                         return true;
                                     }
                                 },

+ 2 - 2
public/assets/js/backend/qingdongams/parts/parts.js

@@ -50,7 +50,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 						{field: 'price', title: '标准价格', operate: false},
 						{field: 'description', title: '描述'},
 						{
-							field: 'operate2', title: __('Operate'), events: {
+							field: 'operate2', title: __('Operate'), operate: false, events: {
 								'click .btn-chooseone': function (e, value, row, index) {
 									Fast.api.close({id: row.id, name: row.name});
 								},
@@ -58,7 +58,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 								return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
 							}
 						},
-						{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
+						{field: 'operate', title: __('Operate'), operate: false, table: table, events: Table.api.events.operate,
 							formatter: Table.api.formatter.buttons,visible:!isselect,
 							buttons: [
 								{

+ 2 - 2
public/assets/js/backend/qingdongams/product/product.js

@@ -49,7 +49,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 
 						{field : 'status', title : '状态',formatter: Table.api.formatter.status, searchList: { '下架': __('下架'),'上架': __('上架')}},
 						{
-							field: 'operate2', title: __('Operate'),visible:isselect, events: {
+							field: 'operate2', title: __('Operate'), operate:false, visible:isselect, events: {
 								'click .btn-chooseone': function (e, value, row, index) {
 									Fast.api.close(row);
 								},
@@ -58,7 +58,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 							}
 						},
 						{
-							field: 'operate', title: __('Operate'),table: table,visible:!isselect,
+							field: 'operate', title: __('Operate'), operate:false, table: table,visible:!isselect,
 							events: Table.api.events.operate, formatter: Table.api.formatter.buttons,
 							buttons: [
 

+ 3 - 4
public/assets/js/backend/qingdongams/workorder/workorder.js

@@ -49,18 +49,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 					[
 						{ field: 'workorder_number', title: '工单编号', operate: 'like' },
 						{ field: 'createtime', title: '派单时间', operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.date },
-						{ field: 'workorder_type', title: '工单类型', operate: 'like' },
+						{ field: 'workorder_type', title: '工单类型', searchList: {'巡检工单': '巡检工单', '维修工单': '维修工单'}},
 						{
 							field: 'title', title: '任务名称', fixedColumns: true, formatter: function (value, row, index) {
-
 								return "<a href='javascript:void(0);' data-id='" + row.id + "' class='show-detail'>" + value + "</a>";
 							}, operate: 'like'
 						},
 						{ field: 'start_time', title: '任务时间', operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.date },
-						{ field: 'owner_staff.name', title: '接单人员', operate: 'like' },
+						{ field: 'owner_staff_id', title: '接单人员', operate: 'like', searchList: Config.ownerStaffList},
 						{
 							field: 'status', title: '工单状态', formatter: Table.api.formatter.status,
-							searchList: { 1: '待处理', 2: '处理中', 3: '已完成', 9: "已撤销" }
+							searchList: {1: '待处理', 2: '处理中', 3: '已完成', 9: "已撤销" }
 						},
 						{ field: 'expected_end_time', title: '完成时间', operate: 'RANGE', addclass: 'datetimerange', formatter: Table.api.formatter.datetime },
 						// { field: 'workorder_number', title: '工单编号', operate: 'like' },

Some files were not shown because too many files changed in this diff