Browse Source

工厂备货列表

lvhao 21 hours ago
parent
commit
88a1255811
2 changed files with 354 additions and 2 deletions
  1. 114 2
      core/CoreApp/controllers/Zzququeu9.php
  2. 240 0
      template/erp/zzququeu9gcbh.html

+ 114 - 2
core/CoreApp/controllers/Zzququeu9.php

@@ -72,8 +72,9 @@ class Zzququeu9 extends Start_Controller {
           }
           elseif($arg == 'wxxs'){
                $this->_wxxs($arg_array);
-          }
-          else
+          }elseif($arg == 'gcbh_index'){
+               $this->_gcbh_index();
+          }else
           {
                $this->_index();
           }
@@ -1141,4 +1142,115 @@ class Zzququeu9 extends Start_Controller {
                exit;
           }
     }
+
+    public function _gcbh_index(){
+
+          $post = $this->input->post(NULL, TRUE);
+
+          if(isset($post['page']))
+          {
+               $page = $this->input->post('page',true);
+               $perpage = $this->input->post('perpage',true);
+               
+               $timetk = $this->input->post('timetk',true);//订单开始时间
+               $timetj = $this->input->post('timetj',true);//订单结束时间
+               $timetk = strtotime($timetk);
+               $timetj = strtotime($timetj);
+               $order_no = $this->input->post('order_no',true);
+               $type = $this->input->post('type',true);
+               $where = " ( type = 21) ";
+               if($order_no){
+               $where .= " and order_no like '%".$order_no."%' ";
+               }
+               if($timetk && $timetj){
+               $where .= " and create_time  > ".$timetk." and create_time  < ".$timetj." ";
+               }
+               if(empty($page))
+               {
+                    $start = 0;
+                    $perpage = 1;
+               }
+               else
+               {
+                    $start = ($page - 1)*$perpage;
+               }
+               
+               $info_list = $this->zzquque_u9->find_all($where,'*','id desc',$start,$perpage);
+               $type_list = $this->zzquque_u9->getType();
+               $list = [];
+               foreach($info_list as $k=>$v){
+                    $bzsh_no = $v['bzsh_no'];
+                    if($v['bzsh_status'] == 0){
+                    
+                         $bzsh_no = "<span  data-action='wxcprk' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建成品入库单</span>";
+                    
+                    
+                    }elseif($v['bzsh_status'] == -1){
+                         $error = $this->zzququeu9_logs->find_all("oid = ".$v['id']." and one_type = 20 and two_type = 1 ","*",'id desc',0,1);
+                    
+                         $tmp_str= "";
+                         if(isset($error[0]['ret_data'])){
+                              $ret_data = json_decode($error[0]['ret_data'],true);
+                              if(isset($ret_data[0]["ResMsg"])){
+                                        $tmp_str = $ret_data[0]["ResMsg"];
+                              }elseif(isset($ret_data['msg'])){
+                                   $tmp_str = $ret_data['msg'];
+                              }elseif(isset($ret_data['Data'])){
+                                   foreach($ret_data['Data'] as $iit){
+                                        if(!$iit['m_isSucess']){
+                                             $tmp_str .= $iit['m_errorMsg']."<br>";
+                                        }
+                                        
+                                   }
+                                   
+                              }else{
+                                        $tmp_str = "系统执行失败,请重试";
+                              }
+                              
+                         }else{
+                              $tmp_str = "";
+                         }
+                    
+                         $bzsh_no = "<span data-action='wxcprk' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建成品入库单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="'.$tmp_str.'"></i><p>';
+                    }elseif($v['bzsh_status'] == 1){
+                         $bzsh_no = $v['bzsh_no']."<br/><span data-action='wxcprksh' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建成品入库单</span>";
+                    }
+
+                    
+                    $xs_no = " ";
+                    if($v['xs_status'] == -1){
+                         $xs_no .= "<span data-action='wxxs' data-process='1'  onclick='doAction(this)'  data-id='".$v['id']."' >创建销售单</span>";
+                    }elseif($v['xs_status'] == 0){
+                         $xs_no .= "<span data-action='wxxs' data-process='1' onclick='doAction(this)' data-id='".$v['id']."' >创建销售单</span>";
+                    }
+                    if(!empty($v['xs_no'])){
+                         $xs_no = $v['xs_no']."<br/>".$xs_no;
+                    }
+                    $bzch_no = empty($v['bzch_no'])?"":$v['bzch_no'];               
+                    
+                    $list[] = [
+                         'id'=>$v['id'],
+                         'order_no'=>$v['order_no'],
+                         'type'=>"工厂外销单",
+                         'bzsh_no'=> $bzsh_no,
+                         'xs_no'=>$xs_no,
+                         'bzch_no'=>$bzch_no,
+                         // 'xs_two_no'=>"",
+                         // 'bzch_no'=>"",
+                         //'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'])
+                    ];
+               }
+
+               $total = $this->zzquque_u9->find_count($where);
+               $pagenum = ceil($total/$perpage);
+               $over = $total-($start+$perpage);
+               $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($list));
+               echo json_encode($rows);exit;    
+          }
+          $this->_Template('zzququeu9gcbh',$this->data);
+
+    }
 }

+ 240 - 0
template/erp/zzququeu9gcbh.html

@@ -0,0 +1,240 @@
+{Template header}
+<script src="{$theme}js/system.js"></script>
+<script type="text/javascript" src="{$theme}js/layer/layer.js"></script>
+<style>
+    .layui-layer-page .layui-layer-content {
+        overflow: none;
+    }
+    
+    .layui-layer-content ul {
+        padding: 0 8px;
+    }
+    
+    .layui-layer-content ul li {
+        margin: 8px 0;
+    }
+    
+    #layui-layer1 {
+        overflow: auto;
+    }
+    
+    .layui-form-checked {
+        margin-left: 10px;
+        display: inline-block;
+    }
+    .shou_btn{
+        width: 70px;
+        height: 30px;
+        line-height: 30px;
+        background: #2ca8a1;
+        text-align: center;
+        color: #fff;
+        border-radius: 5px;
+        display: inline-block;
+        margin-left: 20px;
+        cursor: pointer;
+    }
+</style>
+
+<body>
+    <div class="warp">
+        <div class="fixed">
+            <ul class="search">
+                <li>
+                    <li>编号:<input value="" name="order_no" type="text"></li>
+                    <li>出库时间<input id="timetk" value="{date('Y-m-d',time()-29*24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"> 至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00"
+                            name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>
+                    <li><span>确 定</span></li>
+            </ul>
+            <div class="control">
+    
+                <!-- <a href="javascript:void(0);" class="btn btn-success" onclick="addData()">添 加</a> -->
+                
+                <!-- <a href="javascript:void(0);" style="font-size: 15px;" class="check">删 除</a> -->
+                <!-- <a href="javascript:void(0);" style="font-size: 15px;background-color: #f39c12;" onclick="excelexport()">按条件导出</a> -->
+                </div>
+            
+            <table class="datatitle data" border="0" style="border-collapse:collapse;">
+                <tr>
+                    <td><label onClick=""><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+                    <td>编号</td>
+                    <td>类型</td>
+                    <td>成品入库</td>
+                    <td>销售单</td>
+                    <td>标准出货</td>
+                    <!-- <td>标准收货单</td> -->
+                    <td>添加时间</td>
+                    <td>最后更新时间</td>
+                </tr>
+            </table>
+        </div>
+        <table class="datatext data" border="0" style="border-collapse:collapse;">
+        </table>
+        <div class="lbwlxq"></div>
+        <div class="bomf"></div>
+    </div>
+    <div class="ts"><p class="tsn"></p></div>
+    <div class="systemwindow">
+    <div>
+    <p></p>
+    <p><font class="button">确 定</font><font class="esc">取 消</font></p>
+    </div>
+    </div>
+    
+    
+    <div class="lbwlxq"></div>
+    <div class="bomf"></div>
+
+    
+    <script>
+       
+        customon = 1;
+        var dataurl = "/zzququeu9/waixiao";
+        function custom() {
+            $(".data tr").each(function() {
+                $(this).find('td:eq(0)').css("width", "1%");
+                $(this).find('td:eq(1)').css("width", "8%");
+                $(this).find('td:eq(2)').css("width", "6%");
+                $(this).find('td:eq(3)').css("width", "8%");
+                $(this).find('td:eq(4)').css("width", "10%");
+                $(this).find('td:eq(5)').css("width", "8%");
+                $(this).find('td:eq(6)').css("width", "8%");
+                $(this).find('td:eq(7)').css("width", "8%");
+            });
+        }
+
+        function doAction(that){
+            let action = $(that).data('action')
+            let process = $(that).data('process')
+            let id = $(that).data('id')
+            layx.load('loadId','提交中,请稍后',{shadable:0.6});
+            $.ajax({
+                url:"/zzququeu9/"+action+"/"+id,
+                data:{},
+                type:"post",
+                dataType:"json",
+                success:function(a){
+                    layx.destroy('loadId');
+                    if (a && a.success) {
+                        $(".systemwindow div p:eq(0)").html(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<font  onclick='doCheck()'>确 定</font>");
+                        $(".systemwindow").show();
+                    }else{
+                        $(".systemwindow div p:eq(0)").text(a.msg);
+                        $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
+                        $(".systemwindow").show();
+                    }
+                }
+            })
+        }
+
+
+    //记录重发单的信息
+    function addData(){
+        layx.html('no-icon', '<span style="font-size:18px;padding-left:10px">录入订单编码</span>', layx.multiLine(function() {
+            /*
+            <style type="text/css">
+                p{
+                        padding:10px;
+                }
+                .order_no {width:98%;margin:0px;height:90px}
+            </style>
+            <p><textarea class='order_no' name="order_no" style="border: 1px solid #000" placeholder="请输入要执行订单编码" ></textarea></p>
+            */
+        }), {
+            minMenu: false,
+            closeMenu: false,
+            movable: false,
+            shadable: true,
+            width: 300,
+            height: 50,
+            statusBar: true,
+            buttons: [
+                {
+                    label: '取消',
+                    callback: function(id, button, event) {
+                        layx.destroy(id);
+                    },
+                    style: 'color:#000;font-size:16px;'
+                },
+                {
+                    label: '提交',
+                    callback: function(id, button, event) {
+                        let order_no = $(".order_no").val()
+                        layx.destroy(id);
+                        
+                        layx.load('loadId','提交中,请稍后',{shadable:0.6});
+                        $.post("/zzququeu9/add",{
+                            order_no:order_no
+                        },function(a){
+                            layx.destroy('loadId');
+                            if (a && a.success) {
+                                $(".systemwindow div p:eq(0)").html(a.msg);
+                                $(".systemwindow div p:eq(1)").html("<font  onclick='doCheck()'>确 定</font>");
+                                $(".systemwindow").show();
+                            }else{
+                                $(".systemwindow div p:eq(0)").text(a.msg);
+                                $(".systemwindow div p:eq(1)").html("<p><font onclick='doCheck()'>确 定</font></p>");
+                                $(".systemwindow").show();
+                            }
+                        },'json')
+                        
+                    },
+                    style: 'color:#000;font-size:16px;'
+                }
+            ]
+        });
+    }
+
+    function doCheck(){
+        $(".systemwindow").hide();
+        setTimeout('searchspan(2)', 500);
+    }
+    
+    $(".datatext").on('mouseover mouseout',".method",function(event) {
+        if (event.type === "mouseover") {
+         $(this).parent().parent("td").append('<font style="position: absolute;z-index: 1;border-radius:3px;border: 1px solid #39F;padding:0 10px;background-color: #FFF;box-shadow: rgba(0, 0, 0, 0.3) 1px 1px 24px;">'+$(this).data("t")+'</font>');
+        }else if(event.type == "mouseout"){
+         $(this).parent().siblings("font").remove();
+        }
+    });
+    $(".data").on('mouseover',".lbwlxx",function() {
+        var offset = $(this).offset();
+        ///得到位置
+        var left1 = offset.left + 20;
+        ///得到位置
+        var top1 = offset.top + 20;
+        $(".lbwlxq").css({'top': top1, 'left': left1});
+        $(".lbwlxx").mouseover(function(){
+            $(".lbwlxq").html($(this).find('font').html());
+            $(".lbwlxq").show();
+        });
+        $(".data").on('mouseout',".lbwlxx",function() {
+            $(".lbwlxq").html("");
+            $(".lbwlxq").hide();
+        });
+    });
+    function excelexport(){
+        let url = "/zzququeu9/excel"
+        //timetk="+$("input[name='timetk']").val()+"&timetj="+$("input[name='timetj']").val();
+        let order_no = $("input[name='order_no']").val();
+        url += "?order_no="+order_no
+        let timetk = $("input[name='timetk']").val();
+        url += "&timetk="+timetk;
+        let timetj = $("input[name='timetj']").val()
+        url += "&timetj="+timetj;
+        let status = $(".select").val()
+        if(status){
+            url += "&status="+status;
+        }
+        
+        window.location.href = url
+    }
+
+     
+    </script>
+    <script type="text/javascript" src="{$theme}js/laydate.js"></script>
+    <script type="text/javascript" src="{$theme}js/print.js?v=202007160001"></script>
+
+
+    {Template footer}