瀏覽代碼

提交数据

lvhao 5 月之前
父節點
當前提交
9e7a82d80e
共有 2 個文件被更改,包括 400 次插入2 次删除
  1. 155 2
      core/CoreApp/controllers/Zzququeu9.php
  2. 245 0
      template/erp/zzququeu9zt.html

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

@@ -45,6 +45,10 @@ class Zzququeu9 extends Start_Controller {
           elseif($arg == 'excel'){
                $this->_excel();
           }
+          elseif($arg == 'mcindex')
+          {
+               $this->_mcindex();
+          }
           else
           {
                $this->_index();
@@ -609,7 +613,156 @@ class Zzququeu9 extends Start_Controller {
     }
 
 
-    public function mcindex(){
-      
+    public function _mcindex(){
+     $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);
+
+          $status = $this->input->post('status',true);
+
+          $order_no = $this->input->post('order_no',true);
+          $where='type = 1 or type = 2 ';
+          if($order_no){
+              $where .= " and order_no = '".$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){
+               $dc_no = "";
+               if($v['dc_status'] == 0){
+                    $dc_no = "<span  data-action='dc' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调出单</span>";
+               }elseif($v['dc_status'] == -1){
+                    $error = $this->zzququeu9_logs->find_all("oid = ".$v['id']." and one_type = 1 and two_type = 1 ","*",'id desc',0,1);
+                    if($error[0]['apply_api']=='lpck'){
+                        $ret_data = json_decode($error[0]['ret_data'],true);
+                        $apply_data = json_decode($error[0]['apply_data'],true);
+                        if(isset($ret_data["ResMsg"])){
+                              if(empty($apply_data['0'])){
+                                   $tmp_str = $ret_data["ResMsg"];
+                              }else{
+                                   $tmp_str = $ret_data["ResMsg"]."【". $apply_data[0]['EntityCode']."】";
+                              }
+                              
+                        }else{
+                              $tmp_str = "料品同步失败";
+                        }
+                    }else{
+
+                         $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'];
+                         }else{
+                               $tmp_str = "料品同步失败";
+                         }
+                    }
+                    $dc_no = "<span data-action='dc' 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>';
+               }
+               if(!empty($v['dc_no'])){
+                    if($v['type'] == 1){
+                         $dc_no = $v['dc_no']."【销售组织】"."<br/>".$dc_no;
+                    }else{
+                         $dc_no = $v['dc_no']."【香港组织】"."<br/>".$dc_no;
+                    }
+               }
+               $cg_no = "";
+               if($v['type'] == 1){
+                    if($v['cg_status'] == 1){
+                         $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."'>采购单提交异常</span>";
+                    }elseif($v['cg_status'] == -1){
+                         $cg_no .= "<span data-action='cg' data-process='1' data-id='".$v['id']."' >创建采购单失败</span>";
+                    }elseif($v['cg_status'] == 2){
+                         $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' >采购单未审核</span>";
+                    }elseif($v['cg_status'] == -2){
+                         $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."' >采购单提交失败</span>";
+                    }elseif($v['cg_status'] == -3){
+                         $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' >采购单审核失败</span>";
+                    }
+                    if(!empty($v['cg_no'])){
+                         $cg_no = $v['cg_no']."【香港组织】<br/>".$cg_no;
+                    }
+               }
+              
+               $xs_no = "";
+               if($v['type'] == 1){
+                   if($v['xs_status'] == 1){
+                         $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' >销售单未提交</span>";
+                    }elseif($v['xs_status'] == -1){
+                         $xs_no .= "<span data-action='xs' data-process='1' data-id='".$v['id']."' >销售单创建失败</span>";
+                    }elseif($v['xs_status'] == 2){
+                         $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' >销售单未审核</span>";
+                    }elseif($v['xs_status'] == -2){
+                         $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' >销售单提交失败</span>";
+                    }elseif($v['xs_status'] == -3){
+                         $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' >销售单审核失败</span>";
+                    }
+                    if(!empty($v['xs_no'])){
+                         $xs_no = $v['xs_no']."【销售组织】<br/>".$xs_no;
+                    }
+               }
+               $dr_no = "";
+               if($v['dr_status'] == 1){
+                    $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' >调入单未提交</span>";
+               }elseif($v['dr_status'] == -1){
+                    $dr_no .= "<span data-action='dr' data-process='1' data-id='".$v['id']."' >创建调入单失败</span>";
+               }elseif($v['dr_status'] == 2){
+                    $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' >调入单未审核</span>";
+               }elseif($v['dr_status'] == -2){
+                    $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' >调入单提交失败</span>";
+               }elseif($v['dr_status'] == -3){
+                    $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' >调入单审核失败</span>";
+               }
+               if(!empty($v['dr_no'])){
+                    $dr_no = $v['dr_no']."【香港组织】<br/>".$dr_no;
+               }
+
+               $list[] = [
+                    'id'=>$v['id'],
+                    'order_no'=>$v['order_no'],
+                    'type'=>isset($type_list[$v['type']])?$type_list[$v['type']]:"异常",
+                    'dc_no'=> $dc_no,
+                    'cg_no'=>$cg_no,
+                    'xs_no'=>$xs_no,
+                    'dr_no'=>$dr_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('zzququeu9zt',$this->data);
     }
 }

+ 245 - 0
template/erp/zzququeu9zt.html

@@ -0,0 +1,245 @@
+{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>
+                    <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/mcindex";
+        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%");
+                $(this).find('td:eq(8)').css("width", "8%");
+                $(this).find('td:eq(9)').css("width", "8%");
+                $(this).find('td:eq(10)').css("width", "8%");
+                // $(this).find('td:eq(11)').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+"/"+process+"/"+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}