lvhao 7 hodín pred
rodič
commit
daa773dae0

+ 7 - 3
core/CoreApp/controllers/Beihuogl.php

@@ -1802,7 +1802,7 @@ class Beihuogl extends Start_Controller {
     private function _checkdcdsku($arg_array){
         $dcd_no = $arg_array[0];
         $list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' ");
-        echo "<pre>";
+        $err_list = [];
         foreach($list as $k=>$v){
             if(empty($v['sku'])){
                 $goods_info = $this->goods->find("jm = '".$v['jm']."' ");
@@ -1813,13 +1813,17 @@ class Beihuogl extends Start_Controller {
                         'number'=>trim(str_replace("-","",$goods_info['features'])),
                         'features'=>$goods_info['features'],
                     ];
-                    var_dump($update_arr);
                     $this->bhdcd->save($update_arr,$v['id']);
                 }else{
-                    var_dump($v['jm'].'的sku不存在');
+                    $err_list[] = $v['jm'];
                 }
             }
         }
+        if(empty($err_list)){
+            echo json_encode(['success'=>true,'msg'=>'校验成功,可入库']);
+        }else{
+            echo json_encode(['success'=>false,'msg'=>'校验失败,请点击未录入料品导出']);
+        }
     }
 
     private function _ckbherprk($arg_array){

+ 25 - 1
template/erp/beihuogl_ckbherprk.html

@@ -389,7 +389,31 @@ function wlrlpdc(){
 //重置料品信息
 function czlpxx(){
     let dcd_no = $("input[name='dcd_no']").val();
-    alert(dcd_no)
+    $.get("/beihuogl/checkdcdsku/"+dcd_no, {}, function(res){
+        if(res.success){
+            layx.confirm('提示',res.msg,null,{
+				buttons:[
+					{
+						label:'确定',
+						callback:function(id, button, event){
+							layx.destroy(id);
+						}
+					}
+				],dialogIcon:'success',shadable:0.6
+			})
+        }else{
+            layx.confirm('提示',res.msg,null,{
+				buttons:[
+					{
+						label:'确定',
+						callback:function(id, button, event){
+							layx.destroy(id);
+						}
+					}
+				],dialogIcon:'error',shadable:0.6
+			})
+        }
+    },'json')
 }
 
 function downloadexcel(data,dcd_no){