lvhao 1 день назад
Родитель
Сommit
03791717eb
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      core/CoreApp/controllers/Beihuogl.php

+ 10 - 0
core/CoreApp/controllers/Beihuogl.php

@@ -622,6 +622,10 @@ class Beihuogl extends Start_Controller {
     private function _ccwlbhmake(){
         if($this->input->method() === 'post'){
             $data = $this->input->post();
+            if(empty($data['arr_id'])){
+               echo json_encode(['success'=>false,'msg'=>'至少选一个呀!!!']);
+                exit;
+            }
             $bh_no = $data['bh_no'];
             $select_id = $data['arr_id'];
             if(empty($select_id)){
@@ -634,6 +638,12 @@ class Beihuogl extends Start_Controller {
                 $num = $num+1;
                 $num = str_pad($num, 3, '0', STR_PAD_LEFT);
                 $bh_no = "BH-".date("ymd")."-".$num;
+            }else{
+                $info = $this->bhccwl->find("bh_no = '".$bh_no."'");
+                if(!empty($info)){
+                    echo json_encode(['success'=>false,'msg'=>'生成的备货单编号已经存在']);
+                    exit;
+                }
             }
 
             $list = $this->bhsq->find_all('id in ('.implode(',',$select_id).')');