|
@@ -2,29 +2,9 @@
|
|
|
|
|
|
namespace App\Service;
|
|
|
|
|
|
-use App\Model\Construction;
|
|
|
-use App\Model\ConstructionOrderSub;
|
|
|
-use App\Model\InOutRecord;
|
|
|
-use App\Model\Inventory;
|
|
|
-use App\Model\InventoryInSub;
|
|
|
-use App\Model\InventoryOutSub;
|
|
|
-use App\Model\MaterialCharge;
|
|
|
-use App\Model\MaterialOrder;
|
|
|
-use App\Model\MaterialOrderInSub;
|
|
|
-use App\Model\MaterialReturn;
|
|
|
-use App\Model\RollFilmInventory;
|
|
|
-use App\Model\Setting;
|
|
|
-use App\Model\Transfer;
|
|
|
-use App\Model\TransferInSub;
|
|
|
-use App\Model\TransferOutSub;
|
|
|
-use App\Model\Warranty;
|
|
|
-use App\Service\Oa\OaService;
|
|
|
+use App\Model\SalesOrder;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
-/**
|
|
|
- * 所有审批相关与流水
|
|
|
- * @package App\Models
|
|
|
- */
|
|
|
class CheckService extends Service
|
|
|
{
|
|
|
//审批操作对应的数值
|
|
@@ -47,15 +27,30 @@ class CheckService extends Service
|
|
|
const TYPE_TWO = 2;//不通过
|
|
|
|
|
|
public static $opt_case = [
|
|
|
-
|
|
|
+ self::four => 'confirmSalesOrder'
|
|
|
];
|
|
|
|
|
|
public static $record = [
|
|
|
|
|
|
];
|
|
|
|
|
|
+ public function confirmSalesOrder($data){
|
|
|
+ $model = SalesOrder::where('id',$data['id'])->where('del_time',0)->first();
|
|
|
+
|
|
|
+ if($data['type'] == self::TYPE_ONE){
|
|
|
+ if($model->state == SalesOrder::State_one) return [false,'已锁定,操作失败!'];
|
|
|
+ $model->state = SalesOrder::State_one;
|
|
|
+ }else{
|
|
|
+ if($model->state == SalesOrder::State_zero) return [false,'未锁定,操作失败!'];
|
|
|
+ $model->state = SalesOrder::State_zero;
|
|
|
+ }
|
|
|
+ $model->save();
|
|
|
+
|
|
|
+ return [true,$model];
|
|
|
+ }
|
|
|
+
|
|
|
public function checkAll($data,$user){
|
|
|
- if(empty($data['order_number']) || empty($data['opt_case'])) return [false,'必传参数不能为空或者参数值错误!'];
|
|
|
+ if(empty($data['id']) || empty($data['opt_case']) || empty($data['type'])) return [false,'必传参数不能为空或者参数值错误!'];
|
|
|
|
|
|
//具体方法
|
|
|
$function = self::$opt_case[$data['opt_case']];
|