diff --git a/app/adminapi/controller/dept/DeptController.php b/app/adminapi/controller/dept/DeptController.php
index e0dcf84fb..91ed62ee8 100755
--- a/app/adminapi/controller/dept/DeptController.php
+++ b/app/adminapi/controller/dept/DeptController.php
@@ -15,6 +15,7 @@
 namespace app\adminapi\controller\dept;
 
 use app\adminapi\controller\BaseAdminController;
+use app\adminapi\lists\dept\DeptLists;
 use app\adminapi\logic\dept\DeptLogic;
 use app\adminapi\validate\dept\DeptValidate;
 
@@ -34,28 +35,9 @@ class DeptController extends BaseAdminController
      */
     public function lists()
     {
-        $params = $this->request->get();
-        $result = DeptLogic::lists($params);
-        return $this->success('',$result);
+	    return $this->dataLists(new DeptLists());
     }
-
-
-    /**
-     * @notes 上级部门
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/5/26 18:36
-     */
-    public function leaderDept()
-    {
-        $result = DeptLogic::leaderDept();
-        return $this->success('',$result);
-    }
-
-
+	
     /**
      * @notes 添加部门
      * @return \think\response\Json
@@ -113,22 +95,4 @@ class DeptController extends BaseAdminController
         $result = DeptLogic::detail($params);
         return $this->data($result);
     }
-
-
-    /**
-     * @notes 获取部门数据
-     * @return \think\response\Json
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/10/13 10:28
-     */
-    public function all()
-    {
-        $result = DeptLogic::getAllData();
-        return $this->data($result);
-    }
-
-
 }
\ No newline at end of file
diff --git a/app/adminapi/lists/dept/DeptLists.php b/app/adminapi/lists/dept/DeptLists.php
new file mode 100644
index 000000000..7b99c5c40
--- /dev/null
+++ b/app/adminapi/lists/dept/DeptLists.php
@@ -0,0 +1,69 @@
+<?php
+	
+	namespace app\adminapi\lists\dept;
+	
+	use app\adminapi\lists\BaseAdminDataLists;
+	use app\common\lists\ListsSearchInterface;
+	use app\common\model\dept\Dept;
+	use app\common\model\dept\Orgs;
+	
+	class DeptLists extends BaseAdminDataLists implements ListsSearchInterface {
+		
+		/**
+		 * @notes 设置搜索条件
+		 * @return \string[][]
+		 * @author 段誉
+		 * @date 2022/5/26 9:46
+		 */
+		public function setSearch(): array
+		{
+			return [
+				'%like%' => ['name','leader','mobile'],
+				'=' => ['status']
+			];
+		}
+		
+		
+		/**
+		 * @notes  获取管理列表
+		 * @return array
+		 * @author heshihu
+		 * @date 2022/2/21 17:11
+		 */
+		public function lists(): array
+		{
+			$params = $this->request->param();
+			$where = [];
+			if(isset($params['org_name']) && $params['org_name'] != ''){
+				$orgs = Orgs::where('name','like','%'.$params['org_name'].'%')->column('id');
+				$where[] = ['org_id','in',$orgs];
+			}
+			return Dept::where($this->searchWhere)->where($where)
+				->field('id,name,org_id,leader,mobile,status,sort')
+				->limit($this->limitOffset, $this->limitLength)
+				->order(['sort' => 'desc', 'id' => 'desc'])
+				->select()->each(function($item){
+					$org = Orgs::where('id',$item['org_id'])->findOrEmpty();
+					$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
+					return $item;
+				})
+				->toArray();
+		}
+		
+		/**
+		 * @notes 获取数量
+		 * @return int
+		 * @author 段誉
+		 * @date 2022/5/26 9:48
+		 */
+		public function count(): int
+		{
+			$params = $this->request->param();
+			$where = [];
+			if(isset($params['org_name']) && $params['org_name'] != ''){
+				$orgs = Orgs::where('name','like','%'.$params['org_name'].'%')->column('id');
+				$where[] = ['org_id','in',$orgs];
+			}
+			return Dept::where($this->searchWhere)->where($where)->count();
+		}
+	}
\ No newline at end of file
diff --git a/app/adminapi/logic/dept/DeptLogic.php b/app/adminapi/logic/dept/DeptLogic.php
index c39bd654a..8df0f9216 100755
--- a/app/adminapi/logic/dept/DeptLogic.php
+++ b/app/adminapi/logic/dept/DeptLogic.php
@@ -17,6 +17,8 @@ namespace app\adminapi\logic\dept;
 use app\common\enum\YesNoEnum;
 use app\common\logic\BaseLogic;
 use app\common\model\dept\Dept;
+use app\common\model\dept\Jobs;
+use app\common\model\dept\Orgs;
 
 
 /**
@@ -26,82 +28,7 @@ use app\common\model\dept\Dept;
  */
 class DeptLogic extends BaseLogic
 {
-
-    /**
-     * @notes 部门列表
-     * @param $params
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/5/30 15:44
-     */
-    public static function lists($params)
-    {
-        $where = [];
-        if (!empty($params['name'])) {
-            $where[] = ['name', 'like', '%' . $params['name'] . '%'];
-        }
-        if (isset($params['status']) && $params['status'] != '') {
-            $where[] = ['status', '=', $params['status']];
-        }
-        $lists = Dept::where($where)
-            ->append(['status_desc'])
-            ->order(['sort' => 'desc', 'id' => 'desc'])
-            ->select()
-            ->toArray();
-
-        $pid = 0;
-        if (!empty($lists)) {
-            $pid = min(array_column($lists, 'pid'));
-        }
-        return self::getTree($lists, $pid);
-    }
-
-
-    /**
-     * @notes 列表树状结构
-     * @param $array
-     * @param int $pid
-     * @param int $level
-     * @return array
-     * @author 段誉
-     * @date 2022/5/30 15:44
-     */
-    public static function getTree($array, $pid = 0, $level = 0)
-    {
-        $list = [];
-        foreach ($array as $key => $item) {
-            if ($item['pid'] == $pid) {
-                $item['level'] = $level;
-                $item['children'] = self::getTree($array, $item['id'], $level + 1);
-                $list[] = $item;
-            }
-        }
-        return $list;
-    }
-
-
-    /**
-     * @notes 上级部门
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/5/26 18:36
-     */
-    public static function leaderDept()
-    {
-        $lists = Dept::field(['id', 'name'])->where(['status' => 1])
-            ->order(['sort' => 'desc', 'id' => 'desc'])
-            ->select()
-            ->toArray();
-        return $lists;
-    }
-
-
+	
     /**
      * @notes 添加部门
      * @param array $params
@@ -111,10 +38,10 @@ class DeptLogic extends BaseLogic
     public static function add(array $params)
     {
         Dept::create([
-            'pid' => $params['pid'],
+			'org_id' => $params['org_id'],
             'name' => $params['name'],
-            'leader' => $params['leader'] ?? '',
-            'mobile' => $params['mobile'] ?? '',
+            'leader' => $params['leader'],
+            'mobile' => $params['mobile'],
             'status' => $params['status'],
             'sort' => $params['sort'] ?? 0
         ]);
@@ -131,18 +58,12 @@ class DeptLogic extends BaseLogic
     public static function edit(array $params): bool
     {
         try {
-            $pid = $params['pid'];
-            $oldDeptData = Dept::findOrEmpty($params['id']);
-            if ($oldDeptData['pid'] == 0) {
-                $pid = 0;
-            }
-
             Dept::update([
                 'id' => $params['id'],
-                'pid' => $pid,
+				'org_id' => $params['org_id'],
                 'name' => $params['name'],
-                'leader' => $params['leader'] ?? '',
-                'mobile' => $params['mobile'] ?? '',
+                'leader' => $params['leader'],
+                'mobile' => $params['mobile'],
                 'status' => $params['status'],
                 'sort' => $params['sort'] ?? 0
             ]);
@@ -162,6 +83,8 @@ class DeptLogic extends BaseLogic
      */
     public static function delete(array $params)
     {
+		$jobs = Jobs::where('dept_id',$params['id'])->column('id');
+		Jobs::destroy($jobs);
         Dept::destroy($params['id']);
     }
 
@@ -175,28 +98,13 @@ class DeptLogic extends BaseLogic
      */
     public static function detail($params): array
     {
-        return Dept::findOrEmpty($params['id'])->toArray();
-    }
-
-
-    /**
-     * @notes 部门数据
-     * @return array
-     * @throws \think\db\exception\DataNotFoundException
-     * @throws \think\db\exception\DbException
-     * @throws \think\db\exception\ModelNotFoundException
-     * @author 段誉
-     * @date 2022/10/13 10:19
-     */
-    public static function getAllData()
-    {
-        $data = Dept::where(['status' => YesNoEnum::YES])
-            ->order(['sort' => 'desc', 'id' => 'desc'])
-            ->select()
-            ->toArray();
-
-        $pid = min(array_column($data, 'pid'));
-        return self::getTree($data, $pid);
+		$dept = Dept::field('id,name,org_id,leader,mobile,status,sort')->where('id',$params['id'])->findOrEmpty();
+		if($dept->isEmpty()){
+			return [];
+		}
+		$org = Orgs::where('id',$dept['org_id'])->findOrEmpty();
+		$dept['org_name'] = $org->isEmpty() ? '' : $org['name'];
+        return $dept->toArray();
     }
 
 }
\ No newline at end of file
diff --git a/app/adminapi/validate/dept/DeptValidate.php b/app/adminapi/validate/dept/DeptValidate.php
index 26aa0adb7..8518663f2 100755
--- a/app/adminapi/validate/dept/DeptValidate.php
+++ b/app/adminapi/validate/dept/DeptValidate.php
@@ -17,6 +17,7 @@ namespace app\adminapi\validate\dept;
 use app\common\model\auth\Admin;
 use app\common\model\auth\AdminDept;
 use app\common\model\dept\Dept;
+use app\common\model\dept\Orgs;
 use app\common\validate\BaseValidate;
 
 
@@ -30,8 +31,10 @@ class DeptValidate extends BaseValidate
 
     protected $rule = [
         'id' => 'require|checkDept',
-        'pid' => 'require|integer',
-        'name' => 'require|unique:'.Dept::class.'|length:1,30',
+	    'org_id' => 'require|checkOrg',
+        'name' => 'require|checkUnique|length:1,30',
+	    'leader' => 'require',
+	    'mobile' => 'require|mobile',
         'status' => 'require|in:0,1',
         'sort' => 'egt:0',
     ];
@@ -39,13 +42,15 @@ class DeptValidate extends BaseValidate
 
     protected $message = [
         'id.require' => '参数缺失',
+	    'org_id.require' => '请选择所属组织',
         'name.require' => '请填写部门名称',
         'name.length' => '部门名称长度须在1-30位字符',
         'name.unique' => '部门名称已存在',
-        'sort.egt' => '排序值不正确',
-        'pid.require' => '请选择上级部门',
-        'pid.integer' => '上级部门参数错误',
+	    'leader.require' => '请填写部门负责人',
+	    'mobile.require' => '请填写部门负责人联系电话',
+	    'mobile.mobile' => '部门负责人联系电话格式错误',
         'status.require' => '请选择部门状态',
+	    'sort.egt' => '排序值不正确',
     ];
 
 
@@ -57,7 +62,7 @@ class DeptValidate extends BaseValidate
      */
     public function sceneAdd()
     {
-        return $this->remove('id', true)->append('pid', 'checkDept');
+        return $this->remove('id', true);
     }
 
 
@@ -81,7 +86,7 @@ class DeptValidate extends BaseValidate
      */
     public function sceneEdit()
     {
-        return $this->append('pid', 'checkPid');
+        return $this->only(['id','org_id','name','leader','mobile','status']);
     }
 
 
@@ -93,18 +98,32 @@ class DeptValidate extends BaseValidate
      */
     public function sceneDelete()
     {
-        return $this->only(['id'])->append('id', 'checkAbleDetele');
+        return $this->only(['id'])->append('id','checkDept');
     }
+	
+	//验证唯一
+	public function checkUnique($value,$rule,$data): bool|string
+	{
+		if(!empty($data['id'])) return true;
+		$dep = Dept::where('org_id',$data['org_id'])->where('name',$data['name'])->findOrEmpty();
+		if(!$dep->isEmpty()){
+			return '部门已存在';
+		}
+		return true;
+	}
 
-
-    /**
-     * @notes 校验部门
-     * @param $value
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/5/25 18:17
-     */
-    public function checkDept($value)
+	//校验组织
+	public function checkOrg($value): bool|string
+	{
+		$org = Orgs::findOrEmpty($value);
+		if ($org->isEmpty()) {
+			return '组织不存在';
+		}
+		return true;
+	}
+	
+	//校验部门
+    public function checkDept($value): bool|string
     {
         $dept = Dept::findOrEmpty($value);
         if ($dept->isEmpty()) {
@@ -112,68 +131,5 @@ class DeptValidate extends BaseValidate
         }
         return true;
     }
-
-
-    /**
-     * @notes 校验能否删除
-     * @param $value
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/5/26 14:22
-     */
-    public function checkAbleDetele($value)
-    {
-        $hasLower = Dept::where(['pid' => $value])->findOrEmpty();
-        if (!$hasLower->isEmpty()) {
-            return '已关联下级部门,暂不可删除';
-        }
-
-        $check = AdminDept::where(['dept_id' => $value])->findOrEmpty();
-        if (!$check->isEmpty()) {
-            return '已关联管理员,暂不可删除';
-        }
-
-        $dept = Dept::findOrEmpty($value);
-        if ($dept['pid'] == 0) {
-            return '顶级部门不可删除';
-        }
-
-        return true;
-    }
-
-    /**
-     * @notes 校验部门
-     * @param $value
-     * @param $rule
-     * @param array $data
-     * @return bool|string
-     * @author 段誉
-     * @date 2022/5/26 18:41
-     */
-    public function checkPid($value, $rule, $data = [])
-    {
-        // 当前编辑的部门id信息是否存在
-        $dept = Dept::findOrEmpty($data['id']);
-        if ($dept->isEmpty()) {
-            return '当前部门信息缺失';
-        }
-
-        // 顶级部门不校验上级部门id
-        if ($dept['pid'] == 0) {
-            return true;
-        }
-
-        if ($data['id'] == $value) {
-            return '上级部门不可是当前部门';
-        }
-
-        $leaderDept = Dept::findOrEmpty($value);
-        if ($leaderDept->isEmpty()) {
-            return '部门不存在';
-        }
-
-        return true;
-    }
-
-
+	
 }
\ No newline at end of file
diff --git a/app/common/model/dept/Dept.php b/app/common/model/dept/Dept.php
index fb66097f4..52803ad1e 100755
--- a/app/common/model/dept/Dept.php
+++ b/app/common/model/dept/Dept.php
@@ -29,18 +29,11 @@ class Dept extends BaseModel
     use SoftDelete;
 
     protected $deleteTime = 'delete_time';
-
-    /**
-     * @notes 状态描述
-     * @param $value
-     * @param $data
-     * @return string
-     * @author 段誉
-     * @date 2022/5/25 18:03
-     */
-    public function getStatusDescAttr($value, $data)
-    {
-        return $data['status'] ? '正常' : '停用';
-    }
+	
+	public function getStatusAttr($value): string
+	{
+		$status = [1=>'禁用',0=>'正常'];
+		return $status[$value];
+	}
 
 }
\ No newline at end of file