wugg 2 anni fa
parent
commit
d65752183b

+ 2 - 4
app/admin/controller/Process.php

@@ -7,14 +7,12 @@ use think\App;
 use think\facade\Db;
 
 //流程单
-class Process extends BaseController
+class Process extends Base
 {
-    public $post="";
+
  public function __construct(App $app)
  {
-
      parent::__construct($app);
-     $this->post = $this->request->post();
  }
 
     /**

+ 3 - 21
app/admin/controller/Proorder.php

@@ -2,36 +2,18 @@
 
 namespace app\admin\controller;
 
-use app\BaseController;
 use think\App;
 use think\facade\Db;
 
 //消息(已读未读)
-class Proorder extends BaseController
+class Proorder extends Base
 {
-public $post="";
+
 public function __construct(App $app)
 {
     parent::__construct($app);
-    $this->post=$this->request->post();
 }
-//public function llist(){
-//    $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
-//    $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";
-//    $where =[['c.is_del',"=",0]];
-//    $count = Db::name('process')->alias('a')
-//        ->join("process_order b","b.order_type=a.process_type","left")
-//        ->join("action_process c","c.pid=a.id","left")
-//        ->where($where)->count();
-//    $total = ceil("$count/$size");
-//    $page = $page>$total ? $total:$page;
-//    $list = Db::name('process')->alias('a')
-//        ->join("process_order b","b.order_type=a.process_type","left")
-//        ->join("action_process c","c.pid=a.id","left")
-//        ->field('b.order_type,b.order_code,c.order_name,b.action_process')
-//        ->where($where)->page($page,$size)->order("a.addtime desc")->select();
-//    return app_show(0,"获取成功",['list'=>$list,'count'=>$count]);
-//}
+
 public function list(){
     $page = isset($this->post['page']) && $this->post['page'] !==""? intval($this->post['page']) :"1";
     $size = isset($this->post['size']) && $this->post['size'] !==""? intval($this->post['size']) :"10";

+ 30 - 4
app/admin/model/Workflow.php

@@ -7,17 +7,31 @@ use think\facade\Config;
 //记录操作流程
 class Workflow extends \think\Model
 {
+    public static  $conf=[];
+    public function __construct(array $data = [])
+    {
+        parent::__construct($data);
+        self::$conf=Config::get("process");
+    }
 
     public static function SaveFlow($data){
-        $conf =Config::get("process");
+        $conf =self::$conf;
         $action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
         $last =end($action);
+        $order_status=2;//默认进行中
+        if((is_array($last)&&in_array($data['action_process'],$last))||$last==$data['action_process']){
+            $order_status=3; //流程结束
+        }
+
         $header =reset($action);
+        if((is_array($header)&&in_array($data['action_process'],$header))||$header==$data['action_process']){
+            $order_status=1; //流程新建
+        }
         $proces = self::where(["order_type"=>$data['order_type'],"order_code"=>$data['order_code'],"is_del"=>0])->find();
         if($proces){
             $info=[
                 "order_process"=>$data['order_status'],
-                "order_status"=>$last==$data['action_process']?3:($header==$data['action_process']?1:2),
+                "order_status"=>$order_status,
                 "action_uid"=>$data['action_uid'],
                 "action_name"=>$data['action_name'],
                 "updatetime"=>date("Y-m-d H:i:s")
@@ -29,7 +43,7 @@ class Workflow extends \think\Model
                 "order_code"=>$data['order_code'],
                 "order_id"=>$data['order_id'],
                 "order_process"=>$data['order_status'],
-                "order_status"=>$last==$data['action_process']?3:($header==$data['action_process']?1:2),
+                "order_status"=>$order_status,
                 "apply_id"=>$data['action_uid'],
                 "apply_name"=>$data['action_name'],
                 "action_uid"=>$data['action_uid'],
@@ -39,6 +53,18 @@ class Workflow extends \think\Model
             ];
             self::insert($proces);
         }
-       // self::save($proces);
+
+    }
+
+    /**
+     * 待办事项新建
+     *
+     */
+    public  function  Addwait($data){
+
+    }
+
+    public function checkStatus(){
+
     }
 }