Ver código fonte

修改核对在途单

lvhao 1 mês atrás
pai
commit
392ed0163d

+ 27 - 3
core/CoreApp/controllers/Zzququeu9.php

@@ -81,7 +81,11 @@ class Zzququeu9 extends Start_Controller {
                $this->_bhcprk($arg_array);
           }elseif($arg == 'cpkbh_index'){
                $this->_cpkbh_index();
-          }else
+          }
+          elseif($arg == 'checkProduct'){
+               $this->_checkProduct();
+          }
+          else
           {
                $this->_index();
           }
@@ -923,7 +927,8 @@ class Zzququeu9 extends Start_Controller {
                     //'bzsh_no'=>$bzsh_no,
                    
                     'create_time'=>date("Y-m-d H:i:s",$v['create_time']),
-                    'update_time'=>date("Y-m-d H:i:s",$v['update_time'])
+                    'update_time'=>date("Y-m-d H:i:s",$v['update_time']),
+                    'operate'=>"<span onclick='checkProduct(this)' style='background-color:#FF8C00' data-id='".$v['id']."' >物料核对</span>"
                ];
           }
 
@@ -1465,7 +1470,26 @@ class Zzququeu9 extends Start_Controller {
                echo json_encode($rows);exit;    
           }
           $this->_Template('zzququeu9cpkbh',$this->data);
+    }
 
-
+    protected function _checkProduct(){
+          $post = $this->input->post(NULL, TRUE);
+          if(empty($post)){
+               echo json_encode(array('msg'=>'参数错误','success'=>false,'data'=>[]));
+               exit;
+          }
+          $info = $this->zzquque_u9->read($post['id']);
+          if(empty($info)){
+               echo json_encode(array('msg'=>'数据异常','success'=>false,'data'=>[]));
+               exit;
+          }
+          $res = $this->logic_u9ztsd->checkProduct($info);
+          if($res['code'] == 1){
+               echo json_encode(array('msg'=>$res['msg'],'success'=>true,'data'=>$res['data']));
+               exit;
+          }else{
+               echo json_encode(array('msg'=>$res['msg'],'success'=>false,'data'=>[]));
+               exit;
+          }
     }
 }

+ 31 - 0
core/CoreApp/models/Model_logic_u9ztsd.php

@@ -199,6 +199,37 @@ class Model_logic_u9ztsd extends Lin_Model {
             return $this->logic_tools->ret_arr(-1,$rr);
         }
     }
+
+    public function checkProduct($info){
+        $pre_data = $this->transPrepare();
+        $typeclass = $pre_data['typeclass'];
+        $classid = $pre_data['classid'];
+        $list = $this->whlabeltransport->find_all("order_no = '".$info['order_no']."'");
+    
+
+        $dc_list = [];
+        foreach($list as $k=>$v){
+            if(stripos($v['features'],'-131-') !== false)
+            {
+                continue;
+            }
+            $v['features'] = str_replace(array('-163-','-164-','-165-','-166-'),'-',$v['features']);
+            $shipremarks = $v["text"];
+            $tmp_ret = $this->logic_u9tools->getOneU9bm($v['features'],$classid,$typeclass);
+            $dc_list[] =[
+                'jm'=>$tmp_ret['jm'],
+                'bm'=>$tmp_ret['bm'],
+                'zh'=>$tmp_ret['zh'],
+                'dcsl'=>$v['num'],
+                'is_register'=>0,//商品是否被注册  先都当没注册  后面会先确认下
+            ];
+            $res = $this->apiyyv1->cxLp($dc_list,$this->getToken(130));
+            echo "<pre>";
+            print_r($res);
+
+        }
+
+    }
     
 }
  

+ 45 - 1
template/erp/zzququeu9zt.html

@@ -73,6 +73,7 @@
                     <!-- <td>标准收货单</td> -->
                     <td>添加时间</td>
                     <td>最后更新时间</td>
+                    <td>操作</td>
                 </tr>
             </table>
         </div>
@@ -243,7 +244,50 @@
         window.location.href = url
     }
 
-     
+
+    function checkProduct(that){
+        
+        let id = $(that).data('id');
+        //layx.load('loadId','数据处理中,请稍候...')
+        $.post({
+            url: "/zzququeu9/checkProduct",
+            data: {id:id},
+            type: "POST",
+            dataType: "json",
+            success: function(c) {
+                layx.destroy('loadId');
+                if(c.success){
+                    layx.confirm('提示',c.msg,null,{
+                        buttons:[
+                            {
+                                label:'确定',
+                                callback:function(id, button, event){
+                                
+                                    layx.destroy(id);
+                                }
+                            }
+                        ],dialogIcon:'success',shadable:0.6
+                    });
+                }else{
+                    layx.confirm('提示',c.msg,null,{
+                        buttons:[
+                            {
+                                label:'确定',
+                                callback:function(id, button, event){
+                                
+                                    layx.destroy(id);
+                                }
+                            }
+                        ],dialogIcon:'error',shadable:0.6
+                    });
+                }
+            }
+        })
+    }
+
+    function getLiaoHaoExcel(){
+
+    }
     </script>
     <script type="text/javascript" src="{$theme}js/laydate.js"></script>
     <script type="text/javascript" src="{$theme}js/print.js?v=202007160001"></script>