lvhao 10 часов назад
Родитель
Сommit
5ec383fa8c

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

@@ -1493,11 +1493,15 @@ class Beihuogl extends Start_Controller {
             $data = $this->input->post(null,true);
             $dcd_no = $data['dcd_no'];
             $drd_no = $data['drd_no'];
-            $list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and drd_no = '".$drd_no."' and is_rk = 0");
-
+            $list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and is_rk = 0");
             $whlabel_arr = [];
             $time = time();
+            $err_list= [];
             foreach($list as $k=>$v){
+                if(empty($v['sku'])){
+                    $err_list[] = $v['jm']."不存在";
+                    continue;
+                }
                 for($i=0;$i<$v['num'];$i++){
                     $whlabel_arr[] = [
                         'sku'=>$v['sku'],
@@ -1517,10 +1521,13 @@ class Beihuogl extends Start_Controller {
                 }
                 
              }
+             if(!empty($err_list)){
+                echo json_encode(['success'=>false,'msg'=>implode('<br/>', $err_list)]);exit;
+             }
              $this->db->trans_start();
              $this->db->insert_batch('whlabel',$whlabel_arr);
              $this->db->where('dcd_no',$dcd_no);
-             $this->db->where('drd_no',$drd_no);
+             //$this->db->where('drd_no',$drd_no);
              $this->db->update('bhdcd',['status'=>3,'rk_time'=>$time,'is_rk'=>1]);
 
              if($this->db->trans_status() === FALSE){

+ 7 - 7
template/erp/beihuogl_ckbherprk.html

@@ -150,22 +150,22 @@
             {loop $list as $good}
             <tr>
                 <input type="hidden" name="arr_id[]" value="{$good['id']}" />
-                <td>{$good['zh']}  
+                <td  {if $good['is_rk'] == 1} style="background-color:#ccc !important;color:red !important;"  {/if}>{$good['zh']}  
                     <br/>
                     {$good['jm']} 
                 </td>
-                <td> 
+                <td {if $good['is_rk'] == 1} style="background-color:#ccc !important;color:red !important;"  {/if}> 
                     <span id="ccwl_num_id_{$good['id']}">{$good['real_num']}</span> 
-                    {if $list[0]['status'] == 2  || $list[0]['status'] == 1}
+                    {if $list[0]['status'] < 3 && $good['is_rk'] == 0}
                     <i class='fa fa-edit' data-id="{$good['id']}" data-real_num="{$good['real_num']}" onclick='edit_real(this)'></i>
                     {/if}
                 </td>
-                <td>
+                <td {if $good['is_rk'] == 1} style="background-color:#ccc !important;color:red !important;"  {/if}>
                     {$good['bh_no']}
                 </td>
-                <td>
+                <td {if $good['is_rk'] == 1} style="background-color:#ccc !important;color:red !important;"  {/if}>
                     {$good['kw']}
-                    {if $list[0]['status'] == 2 || $list[0]['status'] == 1}
+                    {if $list[0]['status'] < 3  && $good['is_rk'] == 0}
                     <i class='fa fa-edit' data-id="{$good['id']}" data-kw="{$good['kw']}" onclick='edit_kw(this)'></i>
                     {/if}
                 </td>
@@ -179,7 +179,7 @@
 </ul>
 <input  type="hidden" name="id" value="{$info['id']}" />
 <div class="button">
-    {if $list[0]['status'] == 2 || $list[0]['status'] == 1}
+    {if $list[0]['status'] < 3}
     <font onclick="shrk()">审核入库</font>
     {/if}
     <font class="fh">关 闭</font>

+ 38 - 0
template/erp/beihuogl_ckdcd.html

@@ -214,6 +214,44 @@ function escDo(){
     $(".boundtj p").html("");
     $(".boundtj").hide();
 }
+
+function dcdjzrk(that){
+    let del_id = $(that).data('id')
+    layx.confirm('提示','确定此条信息不允许入库吗?',null,{
+        buttons:[
+            {
+                label:'确定',
+                callback:function(id, button, event){
+                    layx.destroy(id);
+                    $.post("/beihuogl/dcdjzrk",{id:del_id},function(a){
+                        if(a.success){
+                            $(".search span").click();
+                        }else{
+                            layx.confirm('错误提示',a.msg,null,{
+                                buttons:[
+                                    {
+                                        label:'确定',
+                                        callback:function(id, button, event){
+                                            layx.destroy(id);
+                                        }
+                                    }
+                                ],dialogIcon:'error',shadable:0.6
+                            });
+                        }
+                    },'json')  
+                }
+            },
+            {
+                label:'取消',
+                callback:function(id, button, event){
+                    layx.destroy(id);
+                }
+            }
+        ],dialogIcon:'success',shadable:0.6
+    });
+
+    
+}
 </script>
 <script type="text/javascript" src="{$theme}js/laydate.js"></script>
 <script type="text/javascript" src="{$theme}js/excel/xlxs.js" ></script>