Ver código fonte

采购工差单未审批完不能创建新的

wufeng 2 anos atrás
pai
commit
7433f8511b
1 arquivos alterados com 9 adições e 0 exclusões
  1. 9 0
      app/admin/controller/Purch.php

+ 9 - 0
app/admin/controller/Purch.php

@@ -646,6 +646,15 @@ class Purch extends Base
         $rid= isset($apply_id["data"]['id']) ?  $apply_id["data"]['id'] : "";
         $rname= isset($apply_id["data"]['nickname']) ?  $apply_id["data"]['nickname'] : "";
         $diff_price = round($diff_weight*$cg['gold_price']+$diff_weight*$cg['teach_fee'],2);
+
+        //如果有未处理的工差单,不允许创建新的
+        $wait_check = Db::name('purchease_diff')
+            ->field('id')
+            ->where(['apply_id'=>$rid,'status'=>1,'is_del'=>0])
+            ->find();
+
+        if(!empty($wait_check)) return error_show('1005','您还有未处理的工差单,请先处理');
+
         $data=[
             "cgdNo"=>$cgdNo,
             "good_code"=>$cg['spuCode'],