cqp 3 mesi fa
parent
commit
7a46fe6db8

+ 4 - 4
app/Service/DeviceWorkService.php

@@ -214,14 +214,14 @@ class DeviceWorkService extends Service
         if(! $status) return [false, $msg];
         if(! $status) return [false, $msg];
 
 
         if($is_add){
         if($is_add){
-            $bool = MonthlyDwOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyDwOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();
         }else{
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
             if(empty($data['id'])) return [false,'ID不能为空'];
-            $bool = MonthlyDwOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyDwOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('id','<>',$data['id'])
                 ->where('id','<>',$data['id'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();

+ 4 - 4
app/Service/PersonSalaryService.php

@@ -203,14 +203,14 @@ class PersonSalaryService extends Service
         if(! $status) return [false, $msg];
         if(! $status) return [false, $msg];
 
 
         if($is_add){
         if($is_add){
-            $bool = MonthlyPsOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyPsOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();
         }else{
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
             if(empty($data['id'])) return [false,'ID不能为空'];
-            $bool = MonthlyPsOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyPsOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('id','<>',$data['id'])
                 ->where('id','<>',$data['id'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();

+ 4 - 4
app/Service/PersonWorkService.php

@@ -213,14 +213,14 @@ class PersonWorkService extends Service
         if(! $status) return [false, $msg];
         if(! $status) return [false, $msg];
 
 
         if($is_add){
         if($is_add){
-            $bool = MonthlyPwOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyPwOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();
         }else{
         }else{
             if(empty($data['id'])) return [false,'ID不能为空'];
             if(empty($data['id'])) return [false,'ID不能为空'];
-            $bool = MonthlyPwOrder::where('code',$data['code'])
-                ->where('top_depart_id', $data['top_depart_id'])
+            $bool = MonthlyPwOrder::where('top_depart_id', $data['top_depart_id'])
+                ->where('month', $data['month'])
                 ->where('id','<>',$data['id'])
                 ->where('id','<>',$data['id'])
                 ->where('del_time',0)
                 ->where('del_time',0)
                 ->exists();
                 ->exists();

+ 7 - 0
routes/api.php

@@ -109,5 +109,12 @@ Route::group(['middleware'=> ['checkLogin']],function ($route){
     $route->any('monthlyPsOrderAdd', 'Api\PersonSalaryController@monthlyPsOrderAdd');
     $route->any('monthlyPsOrderAdd', 'Api\PersonSalaryController@monthlyPsOrderAdd');
     $route->any('monthlyPsOrderDel', 'Api\PersonSalaryController@monthlyPsOrderDel');
     $route->any('monthlyPsOrderDel', 'Api\PersonSalaryController@monthlyPsOrderDel');
     $route->any('monthlyPsOrderDetail', 'Api\PersonSalaryController@monthlyPsOrderDetail');
     $route->any('monthlyPsOrderDetail', 'Api\PersonSalaryController@monthlyPsOrderDetail');
+
+    //设备月度折旧单
+    $route->any('monthlyDwOrderList', 'Api\DeviceWorkController@monthlyDwOrderList');
+    $route->any('monthlyDwOrderEdit', 'Api\DeviceWorkController@monthlyDwOrderEdit');
+    $route->any('monthlyDwOrderAdd', 'Api\DeviceWorkController@monthlyDwOrderAdd');
+    $route->any('monthlyDwOrderDel', 'Api\DeviceWorkController@monthlyDwOrderDel');
+    $route->any('monthlyDwOrderDetail', 'Api\DeviceWorkController@monthlyDwOrderDetail');
 });
 });