cqpCow 1 year ago
parent
commit
c6c2ad7625
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/Service/DeleteService.php

+ 1 - 0
app/Service/DeleteService.php

@@ -214,6 +214,7 @@ class DeleteService extends Service
         $construction = Construction::where('id',$data['id'])->where('del_time',0)->first();
         if(empty($construction)) return [false,'施工单不存在或已被删除'];
         $construction = $construction->toArray();
+        if($construction['state'] != Construction::STATE_TWO) return [false,'施工单未确认无法排期!'];
         if(empty($data['schedule_id']) ||empty($data['day_stamp']) || empty($data['day_start_stamp']) || empty($data['day_end_stamp'])) return [false,'排班时间信息不能为空'];
         //day_stamp 日期的时间戳(0点的) day_start_stamp 日期加上开始时分的时间戳  day_end_stamp 日期加上结束时分的时间戳
         if($construction['day_stamp'] != $data['day_stamp'] || $construction['day_start_stamp'] != $data['day_start_stamp'] && $construction['day_end_stamp'] != $data['day_end_stamp']) {