load->library('session'); $this->load->_model('Model_zzquque_u9','zzquque_u9'); } 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); } else { $this->_index(); } } public function _index(){ $post = $this->input->post(NULL, TRUE); if(isset($post['page'])) { $where='1=1'; $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); 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 = empty($v['dc_no'])?"":$v['dc_no']; if($v['dc_status'] == 0){ $dc_no .= "
"."创建调出单"; }elseif($v['dc_status'] == 1){ $dc_no .= "
"."提交调出单"; }elseif($v['dc_status'] == -1){ $dc_no .= "
"."创建调出单"; }elseif($v['dc_status'] == 2){ $dc_no .= "
"."审核调出单"; }elseif($v['dc_status'] == -2){ $dc_no .= "
"."提交调出单"; }elseif($v['dc_status'] == -3){ $dc_no .= "
"."审核调出单"; } $cg_no = empty($v['cg_no'])?"":$v['cg_no']; if($v['cg_status'] == 0){ $cg_no .= "
"."创建采购单"; }elseif($v['cg_status'] == 1){ $cg_no .= "
"."提交采购单"; }elseif($v['cg_status'] == -1){ $cg_no .= "
"."创建采购单"; }elseif($v['cg_status'] == 2){ $cg_no .= "
"."审核采购单"; }elseif($v['cg_status'] == -2){ $cg_no .= "
"."提交采购单"; }elseif($v['cg_status'] == -3){ $cg_no .= "
"."审核采购单"; } $xs_no = empty($v['xs_no'])?"":$v['xs_no']; if($v['xs_status'] == 0){ $xs_no .= "
"."创建销售单"; }elseif($v['xs_status'] == 1){ $xs_no .= "
"."提交销售单"; }elseif($v['xs_status'] == -1){ $xs_no .= "
"."创建销售单"; }elseif($v['xs_status'] == 2){ $xs_no .= "
"."审核销售单"; }elseif($v['xs_status'] == -2){ $xs_no .= "
"."提交销售单"; }elseif($v['xs_status'] == -3){ $xs_no .= "
"."审核销售单"; } $xs_two_no = empty($v['xs_two_no'])?"":$v['xs_two_no']; if($v['xs_two_status'] == 0){ $xs_two_no .= "
"."创建销售单"; }elseif($v['xs_two_status'] == 1){ $xs_two_no .= "
"."提交销售单"; }elseif($v['xs_two_status'] == -1){ $xs_two_no .= "
"."创建销售单"; }elseif($v['xs_two_status'] == 2){ $xs_two_no .= "
"."审核销售单"; }elseif($v['xs_two_status'] == -2){ $xs_two_no .= "
"."提交销售单"; }elseif($v['xs_two_status'] == -3){ $xs_two_no .= "
"."审核销售单"; } $bzch_no =empty($v['bzch_no'])?"":$v['bzch_no']; if($v['bzch_status'] == 0){ $bzch_no .= "
"."创建标准出货单"; }elseif($v['bzch_status'] == 1){ $bzch_no .= "
"."提交标准出货单"; }elseif($v['bzch_status'] == -1){ $bzch_no .= "
"."创建标准出货单"; }elseif($v['bzch_status'] == 2){ $bzch_no .= "
"."审核标准出货单"; }elseif($v['bzch_status'] == -2){ $bzch_no .= "
"."提交标准出货单"; }elseif($v['bzch_status'] == -3){ $xs_no .= "
"."审核标准出货单"; } $bzsh_no =empty($v['bzsh_no'])?"":$v['bzsh_no']; $dr_no = empty($v['dr_no'])?"":$v['dr_no']; if($v['bzch_status'] == 0){ $xs_two_no .= "
"."创建标准出货单"; }elseif($v['bzch_status'] == 1){ $bzch_no .= "
"."提交标准出货单"; }elseif($v['bzch_status'] == -1){ $bzch_no .= "
"."创建标准出货单"; }elseif($v['bzch_status'] == 2){ $bzch_no .= "
"."审核标准出货单"; }elseif($v['bzch_status'] == -2){ $bzch_no .= "
"."提交标准出货单"; }elseif($v['bzch_status'] == -3){ $xs_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, 'xs_two_no'=>$xs_two_no, 'bzch_no'=>$bzch_no, 'bzsh_no'=>$bzsh_no, 'dr_no'=>$dr_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){ } public function _cg($arg_array){ } public function _xs($arg_array){ } public function _bzch($arg_array){ } public function _bzsh($arg_array){ } public function _dr($arg_array){ } public function _xs_two($arg_array){ } }