|
@@ -7,17 +7,31 @@ use think\facade\Config;
|
|
//记录操作流程
|
|
//记录操作流程
|
|
class Workflow extends \think\Model
|
|
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){
|
|
public static function SaveFlow($data){
|
|
- $conf =Config::get("process");
|
|
|
|
|
|
+ $conf =self::$conf;
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
$action = isset($conf[$data['order_type']]) ? $conf[$data['order_type']]:[];
|
|
$last =end($action);
|
|
$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);
|
|
$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();
|
|
$proces = self::where(["order_type"=>$data['order_type'],"order_code"=>$data['order_code'],"is_del"=>0])->find();
|
|
if($proces){
|
|
if($proces){
|
|
$info=[
|
|
$info=[
|
|
"order_process"=>$data['order_status'],
|
|
"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_uid"=>$data['action_uid'],
|
|
"action_name"=>$data['action_name'],
|
|
"action_name"=>$data['action_name'],
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
@@ -29,7 +43,7 @@ class Workflow extends \think\Model
|
|
"order_code"=>$data['order_code'],
|
|
"order_code"=>$data['order_code'],
|
|
"order_id"=>$data['order_id'],
|
|
"order_id"=>$data['order_id'],
|
|
"order_process"=>$data['order_status'],
|
|
"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_id"=>$data['action_uid'],
|
|
"apply_name"=>$data['action_name'],
|
|
"apply_name"=>$data['action_name'],
|
|
"action_uid"=>$data['action_uid'],
|
|
"action_uid"=>$data['action_uid'],
|
|
@@ -39,6 +53,18 @@ class Workflow extends \think\Model
|
|
];
|
|
];
|
|
self::insert($proces);
|
|
self::insert($proces);
|
|
}
|
|
}
|
|
- // self::save($proces);
|
|
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 待办事项新建
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ public function Addwait($data){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function checkStatus(){
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|