| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596 | 
							- <?php 
 
- defined('BASEPATH') OR exit('No direct script access allowed');
 
- class Zzququeu9 extends Start_Controller {
 
-     public function __construct(){
 
-         parent::__construct();
 
-         $this->load->library('session');
 
-         $this->load->_model('Model_zzquque_u9','zzquque_u9');
 
-         $this->load->_model("Model_logic_order","logic_order");
 
-         $this->load->_model("Model_logic_u9xgsd","logic_u9xgsd");
 
-         $this->load->_model('Model_zzququeu9_logs','zzququeu9_logs');
 
-     }
 
-     public function _remap($arg,$arg_array)
 
-     {
 
- 		if($arg == 'dc')//调出单
 
-           {
 
-                $this->_dc($arg_array);
 
-           }
 
-           elseif($arg == 'cg')//采购
 
-           {
 
-                $this->_cg($arg_array);
 
-           }
 
-           elseif($arg == 'xs')//销售单
 
-           {
 
-                $this->_xs($arg_array);
 
-           }
 
-           elseif($arg == 'bzch')//标准出货
 
-           {
 
-                $this->_bzch($arg_array);
 
-           }
 
-           elseif($arg == 'bzsh')//标准收货
 
-           {
 
-                $this->_bzsh($arg_array);
 
-           }
 
-           elseif($arg == 'dr')//调入单
 
-           {
 
-                $this->_dr($arg_array);
 
-           }
 
-           elseif($arg == 'xs_two')//调入单
 
-           {
 
-                $this->_xs_two($arg_array);
 
-           }
 
-           elseif($arg == 'add'){
 
-                $this->_add();
 
-           }
 
-           elseif($arg == 'excel'){
 
-                $this->_excel();
 
-           }
 
-           else
 
-           {
 
-                $this->_index();
 
-           }
 
- 	}
 
-     public function _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);
 
-                $status = $this->input->post('status',true);
 
- 			$order_no = $this->input->post('order_no',true);
 
-                $where='type = 10 ';
 
- 			if($order_no){
 
- 			    $where .= " and order_no = '".$order_no."' ";
 
- 			}
 
-                if($timetk && $timetj){
 
-                    $where .= " and create_time  > ".$timetk." and create_time  < ".$timetj." ";
 
-                }
 
-                if($status){
 
-                     if($status = 1){
 
-                          $where .= " and dc_status < 0 ";
 
-                     }elseif($status = 2){
 
-                          $where .= " and cg_status < 0 ";
 
-                     }elseif($status = 3){
 
-                          $where .= " and xs_status < 0 ";
 
-                     }elseif($status = 4){
 
-                          $where .= " and dr_status < 0 ";
 
-                     }elseif($status = 5){
 
-                          $where .= " and xs_two_status < 0 ";
 
-                     }elseif($status = 6){
 
-                          $where .= " and bzsh_status <0 ";
 
-                     }
 
-                }
 
- 			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);
 
-                              if(isset($ret_data[0]["ResMsg"])){
 
-                                    $tmp_str = $ret_data[0]["ResMsg"];
 
-                              }else{
 
-                                    $tmp_str = "料品同步失败";
 
-                              }
 
-                          }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'])){
 
-                          $dc_no = $v['dc_no']."<br/>".$dc_no;
 
-                     }
 
-                     $cg_no = "";
 
-                     if($v['cg_status'] == 0){
 
-                          $cg_no .= "<span  data-action='cg' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建采购单</span>";
 
-                     }elseif($v['cg_status'] == 1){
 
-                          $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交采购单</span>";
 
-                     }elseif($v['cg_status'] == -1){
 
-                          $cg_no .= "<span data-action='cg' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建采购单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="采购单创建失败"></i><p>';
 
-                     }elseif($v['cg_status'] == 2){
 
-                          $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核采购单</span>";
 
-                     }elseif($v['cg_status'] == -2){
 
-                          $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交采购单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="采购单提交失败"></i><p>';
 
-                     }elseif($v['cg_status'] == -3){
 
-                          $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核采购单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="采购单审核失败"></i><p>';
 
-                     }
 
-                     if(!empty($v['cg_no'])){
 
-                          $cg_no = $v['cg_no']."<br/>".$cg_no;
 
-                     }
 
-                     $xs_no = "";
 
-                     if($v['xs_status'] == 0){
 
-                          $xs_no .= "<span  data-action='xs' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>";
 
-                     }elseif($v['xs_status'] == 1){
 
-                          $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>";
 
-                     }elseif($v['xs_status'] == -1){
 
-                          $xs_no .= "<span data-action='xs' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="销售单创建失败"></i><p>';
 
-                     }elseif($v['xs_status'] == 2){
 
-                          $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>";
 
-                     }elseif($v['xs_status'] == -2){
 
-                          $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="销售单提交失败"></i><p>';
 
-                     }elseif($v['xs_status'] == -3){
 
-                          $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="销售单审核失败"></i><p>';
 
-                     }
 
-                     if(!empty($v['xs_no'])){
 
-                          $xs_no = $v['xs_no']."<br/>".$xs_no;
 
-                     }
 
-                     $xs_two_no ='';
 
-                     if($v['xs_two_status'] == 0){
 
-                          $xs_two_no .= "<span  data-action='xs_two' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>";
 
-                     }elseif($v['xs_two_status'] == 1){
 
-                          $xs_two_no .= "<span data-action='xs_two' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>";
 
-                     }elseif($v['xs_two_status'] == -1){
 
-                          $xs_two_no .= "<span data-action='xs_two' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['xs_two_status'] == 2){
 
-                          $xs_two_no .= "<span data-action='xs_two' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>";
 
-                     }elseif($v['xs_two_status'] == -2){
 
-                          $xs_two_no .= "<span data-action='xs_two' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['xs_two_status'] == -3){
 
-                          $xs_two_no  .= "<span data-action='xs_two' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }
 
-                     if(!empty($v['xs_two_no'])){
 
-                          $xs_two_no = $v['xs_two_no']."<br/>".$xs_two_no;
 
-                     }
 
-                     
 
-                     $bzch_no ="";
 
-                     if($v['bzch_status'] == 0){
 
-                          $bzch_no  .= "<span  data-action='bzch' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建出货单</span>";
 
-                     }elseif($v['bzch_status'] == 1){
 
-                          $bzch_no .= "<span data-action='bzch' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交出货单</span>";
 
-                     }elseif($v['bzch_status'] == -1){
 
-                          $bzch_no .= "<span data-action='bzch' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建出货单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['bzch_status'] == 2){
 
-                          $bzch_no .= "<span data-action='bzch' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核出货单</span>";
 
-                     }elseif($v['bzch_status'] == -2){
 
-                          $bzch_no .= "<span data-action='bzch' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交出货单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['bzch_status'] == -3){
 
-                          $bzch_no .= "<span data-action='bzch' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核出货单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }
 
-                     //$bzsh_no =empty($v['bzsh_no'])?"":$v['bzsh_no'];
 
-                     if(!empty($v['bzch_no'])){
 
-                          $bzch_no = $v['bzch_no']."<br/>".$bzch_no;
 
-                     }
 
-                     $dr_no = "";
 
-                     if($v['dr_status'] == 0){
 
-                          $dr_no .= "<span  data-action='dr' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调入单</span>";
 
-                     }elseif($v['dr_status'] == 1){
 
-                          $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交调入单</span>";
 
-                     }elseif($v['dr_status'] == -1){
 
-                          $dr_no .= "<span data-action='dr' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调入单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['dr_status'] == 2){
 
-                          $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核调入单</span>";
 
-                     }elseif($v['dr_status'] == -2){
 
-                          $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交调入单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }elseif($v['dr_status'] == -3){
 
-                          $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核调入单</span>".'<p style="color:blue"><i  class="method fa fa-exclamation-circle" data-t="123"></i><p>';
 
-                     }
 
-                     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'=>$xs_two_no,
 
-                          'bzch_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('zzququeu9',$this->data);
 
-     }
 
-     public function _dc($arg_array){
 
-       $process= $arg_array[0];
 
-       $id = $arg_array[1];
 
-       $info = $this->zzquque_u9->read($id);
 
-      
 
-       if($process == 1){
 
-           if(!in_array($info['dc_status'],[0,-1])){
 
-                echo json_encode(array('msg'=>'当前状态不符合创建调出单的条件','success'=>false));
 
-                exit;
 
-           }
 
-           $r = $this->logic_u9xgsd->createDc($info);
 
-           if($r['code'] == 1){
 
-                echo json_encode(array('msg'=>'创建调出单成功','success'=>true));
 
-                exit;
 
-           }else{
 
-                echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-                exit;
 
-           }
 
-       }else if($process == 2){
 
-           if(!in_array($info['dc_status'],[1,-2])){
 
-                echo json_encode(array('msg'=>'当前状态不符合提交调出单的条件','success'=>false));
 
-                exit;
 
-           }
 
-           $r = $this->logic_u9xgsd->subDc($info);
 
-           if($r['code'] == 1){
 
-                echo json_encode(array('msg'=>'提交调出单成功','success'=>true));
 
-                exit;
 
-           }else{
 
-                echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-                exit;
 
-           }
 
-       }else if($process == 3){
 
-           if(!in_array($info['dc_status'],[2,-3])){
 
-                echo json_encode(array('msg'=>'当前状态不符合审核调出单的条件','success'=>false));
 
-                exit;
 
-           }
 
-           $r = $this->logic_u9xgsd->shDc($info);
 
-           if($r['code'] == 1){
 
-                echo json_encode(array('msg'=>'审核调出单成功','success'=>true));
 
-                exit;
 
-           }else{
 
-                echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-                exit;
 
-           }
 
-       }else{
 
-           echo json_encode(array('msg'=>'当前状态不符合创建调出单的条件','success'=>false));
 
-           exit;
 
-       }
 
-      
 
-     }
 
-     public function _cg($arg_array){
 
-      $process= $arg_array[0];
 
-      $id = $arg_array[1];
 
-      $info = $this->zzquque_u9->read($id);
 
-      if($info['dc_status'] != 3){
 
-           echo json_encode(array('msg'=>'调出单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($process == 1){
 
-          if(!in_array($info['cg_status'],[0,-1])){
 
-               echo json_encode(array('msg'=>'当前状态不符合创建采购单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->createCg($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'创建采购单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 2){
 
-          if(!in_array($info['cg_status'],[1,-2])){
 
-               echo json_encode(array('msg'=>'当前状态不符合提交采购单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->subCg($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'提交采购单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 3){
 
-          if(!in_array($info['cg_status'],[2,-3])){
 
-               echo json_encode(array('msg'=>'当前状态不符合审核采购单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->shCg($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'审核采购单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else{
 
-          echo json_encode(array('msg'=>'当前状态不符合创建采购单的条件','success'=>false));
 
-          exit;
 
-      }
 
-     }
 
-     public function _xs($arg_array){
 
-      $process= $arg_array[0];
 
-      $id = $arg_array[1];
 
-      $info = $this->zzquque_u9->read($id);
 
-      if($info['dc_status'] != 3){
 
-           echo json_encode(array('msg'=>'调出单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($process == 1){
 
-          if(!in_array($info['xs_status'],[0,-1])){
 
-               echo json_encode(array('msg'=>'当前状态不符合创建销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->createXs($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'创建销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 2){
 
-          if(!in_array($info['xs_status'],[1,-2])){
 
-               echo json_encode(array('msg'=>'当前状态不符合提交销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->subXs($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'提交销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 3){
 
-          if(!in_array($info['xs_status'],[2,-3])){
 
-               echo json_encode(array('msg'=>'当前状态不符合审核销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->shXs($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'审核销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else{
 
-          echo json_encode(array('msg'=>'当前状态不符合创建销售单的条件','success'=>false));
 
-          exit;
 
-      }    
 
-     }
 
-    
 
-     public function _dr($arg_array){
 
-      $process= $arg_array[0];
 
-      $id = $arg_array[1];
 
-      $info = $this->zzquque_u9->read($id);
 
-      if($info['dc_status'] != 3){
 
-           echo json_encode(array('msg'=>'调出单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($process == 1){
 
-          if(!in_array($info['dr_status'],[0,-1])){
 
-               echo json_encode(array('msg'=>'当前状态不符合查询调入单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->createDr($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'查询调入单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 2){
 
-          if(!in_array($info['dr_status'],[1,-2])){
 
-               echo json_encode(array('msg'=>'当前状态不符合提交调入单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->subDr($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'提交调入单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 3){
 
-          if(!in_array($info['dr_status'],[2,-3])){
 
-               echo json_encode(array('msg'=>'当前状态不符合审核调入单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->shDr($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'审核调入单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else{
 
-          echo json_encode(array('msg'=>'当前状态不符合创建调入单的条件','success'=>false));
 
-          exit;
 
-      }    
 
-     }
 
-     public function _xs_two($arg_array){
 
-      $process= $arg_array[0];
 
-      $id = $arg_array[1];
 
-      $info = $this->zzquque_u9->read($id);
 
-      if($info['dc_status'] != 3){
 
-           echo json_encode(array('msg'=>'调出单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($process == 1){
 
-          if(!in_array($info['xs_two_status'],[0,-1])){
 
-               echo json_encode(array('msg'=>'当前状态不符合查询香港销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->createXsTwo($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'创建香港销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 2){
 
-          if(!in_array($info['xs_two_status'],[1,-2])){
 
-               echo json_encode(array('msg'=>'当前状态不符合提交香港销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->subXsTwo($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'提交香港销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 3){
 
-          if(!in_array($info['xs_two_status'],[2,-3])){
 
-               echo json_encode(array('msg'=>'当前状态不符合审核香港销售单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->shXsTwo($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'审核香港销售单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else{
 
-          echo json_encode(array('msg'=>'当前状态不符合创建香港销售单的条件','success'=>false));
 
-          exit;
 
-      }  
 
-     }
 
-     public function _bzch($arg_array){
 
-      $process= $arg_array[0];
 
-      $id = $arg_array[1];
 
-      $info = $this->zzquque_u9->read($id);
 
-      if($info['dc_status'] != 3){
 
-           echo json_encode(array('msg'=>'调出单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($info['xs_two_status'] != 3){
 
-           echo json_encode(array('msg'=>'香港销售单未审核不能执行后续操作','success'=>false));
 
-           exit;
 
-      }
 
-      if($process == 1){
 
-          if(!in_array($info['bzsh_status'],[0,-1])){
 
-               echo json_encode(array('msg'=>'当前状态不符合创建标准收货单的条件','success'=>false));
 
-               exit;
 
-          }
 
-          $r = $this->logic_u9xgsd->createCh($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'创建标准收货单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else if($process == 2){
 
-          
 
-          $r = $this->logic_u9xgsd->subAndShCh($info);
 
-          if($r['code'] == 1){
 
-               echo json_encode(array('msg'=>'审核标准收货单成功','success'=>true));
 
-               exit;
 
-          }else{
 
-               echo json_encode(array('msg'=>$r['msg'],'success'=>false));
 
-               exit;
 
-          }
 
-      }else{
 
-          echo json_encode(array('msg'=>'当前状态不符合创建标准收货单的条件','success'=>false));
 
-          exit;
 
-      }    
 
-     }
 
-     public function _bzsh($arg_array){
 
-     
 
-     }
 
-     public function  _add(){
 
-        $order_no  = $this->input->post('order_no',true);
 
-        if(empty($order_no)){
 
-           echo json_encode(['msg'=>'请输入要添加的订单编码!','success'=>false]);exit;   
 
-        }
 
-         $info = $this->logic_order->getInfo("number = '" .$order_no."'");
 
-         if(empty($info)){
 
-            echo json_encode(['msg'=>'订单不存在!请仔细核对单号','success'=>false]);exit; 
 
-         }
 
-         $num = $this->zzquque_u9->find_all("order_no = '".$info['number']."'");
 
-         if(empty($num)){
 
-              $this->zzquque_u9->insert([
 
-                 'platform'=>$info['lv_platform'],
 
-                 'warehouse'=>$info['type'],
 
-                 'type'=>10,
 
-                 'order_no'=>$info['number'],
 
-                 'create_time'=>time(),
 
-                 'update_time'=>time(),
 
-             ]);
 
-             echo json_encode(['msg'=>'添加成功','success'=>true]);exit; 
 
-         }else{
 
-             echo json_encode(['msg'=>'订单不允许重复添加','success'=>false]);exit; 
 
-         }
 
-        
 
-         
 
-     }
 
-     public function _excel(){
 
-         $params = $this->input->get();
 
-         $where = "1 = 1";
 
-         if(!empty($params['order_no'])){
 
-           $where .= " order_no =  '".$params['order_no']."' ";
 
-         } 
 
-         if(!empty($params['timetk'])){
 
-           $where .= " create_time >  ".strtotime($params['timetk'])." ";
 
-         }       
 
-         if(!empty($params['timetj'])){
 
-           $where .= " create_time <  ".strtotime($params['timetj'])." ";
 
-         }    
 
-         if(!empty($params['status'])){
 
-           $where .= " status = ".$params['status'];
 
-         }
 
-         var_dump($where);
 
-     }
 
- }
 
 
  |