|
@@ -38,6 +38,10 @@ class Whlabel_bh extends Start_Controller {
|
|
|
$this->load->_model('Model_transfer','transfer');
|
|
|
$this->load->_model("Model_logic_u9tools","logic_u9tools");
|
|
|
$this->load->_model("Model_logic_ding","logic_ding");
|
|
|
+ $this->load->_model("Model_apiyyv1","apiyyv1");
|
|
|
+ $this->load->_model('Model_settingtest','settingtest');
|
|
|
+ $this->load->_model("Model_whlabel_bh_transfer_cr","whlabel_bh_transfer_cr");
|
|
|
+ $this->load->_model("Model_zzquque_u9","zzquque_u9");
|
|
|
}
|
|
|
//定义方法的调用规则 获取URI第二段值
|
|
|
public function _remap($arg,$arg_array)
|
|
@@ -93,6 +97,14 @@ class Whlabel_bh extends Start_Controller {
|
|
|
else if($arg == 'bdbb')
|
|
|
{
|
|
|
$this->_bdbb();
|
|
|
+ }
|
|
|
+ else if($arg == 'rk')
|
|
|
+ {
|
|
|
+ $this->_rk();
|
|
|
+ }
|
|
|
+ else if($arg == 'ck')
|
|
|
+ {
|
|
|
+ $this->_ck();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1534,34 +1546,228 @@ class Whlabel_bh extends Start_Controller {
|
|
|
$post['number'] = $data['number'];
|
|
|
$post['title'] = $data['title'];
|
|
|
$post['printtime'] = $time;
|
|
|
- $post['ts'] = $n;
|
|
|
- $post['rk'] = "|15|";//默认订单中心 打印后直接入库
|
|
|
- $post['rktime'] = "|".$time."|";
|
|
|
- $post['ctime15'] = $time;
|
|
|
+ $post['ts'] = 1;
|
|
|
+ // $post['rk'] = "";//默认订单中心 打印后直接入库
|
|
|
+ // $post['rktime'] = "";
|
|
|
+ // $post['ctime15'] = $time;
|
|
|
$post['time'] = $time;
|
|
|
$post['gtime'] = date('Yms',$time);
|
|
|
$rows = array();
|
|
|
- $label = substr($time,1).rand(10,99);
|
|
|
+ $label = date("ymdHis").rand(1000,9999);
|
|
|
$post['label'] = $label;
|
|
|
- $rows[] = array('num'=>$post['label'],'title'=>$data['orderinfo'],'jm'=>$data['pm'],'n'=>$n);
|
|
|
- if($this->whlabel_bh_transfer->insert($post))
|
|
|
+
|
|
|
+
|
|
|
+ // if($this->whlabel_bh_transfer->insert($post))
|
|
|
+ // {
|
|
|
+ // echo json_encode(array('rows'=>($rows),'id'=>$d,'success'=>true));exit;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // $this->db->trans_rollback();
|
|
|
+ // echo json_encode(array('msg'=>'错误,请重试!','success'=>false));exit;
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ if(stripos($post['features'],'-126-') !== false)
|
|
|
+ {
|
|
|
+ $drck = '12003';//进入发条库
|
|
|
+ }
|
|
|
+ else if(stripos($post['features'],'-127-') !== false)
|
|
|
+ {
|
|
|
+ $drck = '12004';//进入发块库
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $drck = '12006';//其它进入完成库
|
|
|
+ }
|
|
|
+ //创建u9的生产单
|
|
|
+ $token = $this->settingtest->get_yytoken_120();
|
|
|
+ $params = [
|
|
|
+ 'org_code'=>"120",
|
|
|
+ 'djhlx'=>'2000',
|
|
|
+ 'scbm_code'=>"12008",
|
|
|
+ "time"=>time(),
|
|
|
+ 'owner_org_code'=>"120",
|
|
|
+ 'title'=>$post['orderinfo'],
|
|
|
+ 'shipremarks'=>$data['shipremarks'],
|
|
|
+ 'list'=>[
|
|
|
+ [
|
|
|
+ 'drck'=>$drck,
|
|
|
+ 'jm'=>$post['jm'],
|
|
|
+ 'sl'=>$n,
|
|
|
+ 'drck'=>$drck,
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+
|
|
|
+ $res = $this->apiyyv1->scdCreate($params,$token);
|
|
|
+ $this->logic_ding->sendToDing("【".$post['orderinfo']."-".$data['id']."】生产备货同步u9||".json_encode($res,JSON_UNESCAPED_UNICODE));
|
|
|
+ if(!isset($res[0]['Data'])){
|
|
|
+ echo json_encode(array('msg'=>'u9同步返回异常,请重试!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ if(!$res[0]['Data'][0]['m_isSucess']){
|
|
|
+ echo json_encode(array('msg'=>'u9同步失败,请重试!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ $scid = $res[0]['Data'][0]['m_iD']."~".$res[0]['Data'][0]['m_code']."~".$drck;
|
|
|
+ $post['scid'] = $scid;
|
|
|
+ $post['scapi'] = 1;
|
|
|
+ $post['dbapi'] = 0;
|
|
|
+ $this->db->trans_begin();
|
|
|
+ $post['shipremarks'] = $data['shipremarks'];
|
|
|
+ for($i = 0;$i < $n;$i++){
|
|
|
+ $post['label'] = $label.$i;
|
|
|
+ $rows[] = array('num'=>$post['label'],'title'=>$data['orderinfo'],'jm'=>$data['pm'],'n'=>1);
|
|
|
+ $this->whlabel_bh_transfer->insert($post);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($this->db->trans_status() === TRUE)
|
|
|
{
|
|
|
+ $this->db->trans_commit();
|
|
|
echo json_encode(array('rows'=>($rows),'id'=>$d,'success'=>true));exit;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ }else{
|
|
|
$this->db->trans_rollback();
|
|
|
- echo json_encode(array('msg'=>'错误,请重试!','success'=>false));exit;
|
|
|
- }
|
|
|
+ echo json_encode(array('msg'=>'错误,请重试!','success'=>false));exit;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
|
|
|
- public function _operate()
|
|
|
+ public function _bdbb()
|
|
|
{
|
|
|
$post = $this->input->post(NULL, TRUE);
|
|
|
- if(isset($post['page']))
|
|
|
+ if(isset($post['s']))
|
|
|
+ {
|
|
|
+ $id_arr = $this->input->post('s');
|
|
|
+ $id_arr = explode(',',trim($id_arr,','));
|
|
|
+ if(!$id_arr)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>$v.' - 未查询到需要补打信息!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ //循环删除记录
|
|
|
+ foreach ($id_arr as $v)
|
|
|
+ {
|
|
|
+ $t = $this->whlabel_bh_transfer->read($v);
|
|
|
+ if(!isset($t['number']))
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>$v.' - 补打信息已被删除!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ $rows[] = array('num'=>$t['label'],'title'=>'补:'.$t['orderinfo'],'jm'=>$t['jm'],'n'=>$t['ts']);
|
|
|
+ }
|
|
|
+ echo json_encode(array('rows'=>($rows),'success'=>true));exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ public function _out()
|
|
|
+ {
|
|
|
+ $post = $this->input->post(NULL, TRUE);
|
|
|
+ if(isset($post['label']))
|
|
|
{
|
|
|
- $api = $this->input->post('api',true);
|
|
|
+ $time = time();
|
|
|
+ $label = $this->input->post('label',true);
|
|
|
+ $cz = $this->input->post('cz',true);
|
|
|
+ $transfer = $this->input->post('transfer',true);
|
|
|
+ if(!$label)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'未扫入数据!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ if(!$transfer)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'请选择需对应的部门!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ $lb = $this->whlabel_bh_transfer->get_label($label);
|
|
|
+ if(!$lb)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'错误!未找到此条码','success'=>false));exit;
|
|
|
+ }
|
|
|
+ $lbrk = array_reverse(explode('|',trim($lb['rk'],'|')));
|
|
|
+ $lbck = array_reverse(explode('|',trim($lb['ck'],'|')));
|
|
|
+ $tdata = $this->transfer->find_all();
|
|
|
+ $t = array();
|
|
|
+ foreach ($tdata as $v)
|
|
|
+ {
|
|
|
+ $t[$v['id']] = $v['title'];
|
|
|
+ }
|
|
|
+ if($cz == 1)
|
|
|
+ {
|
|
|
+ if($lb['rk'] != $lb['ck'])//判断是否没走完流程就拿到下一步奏
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>$t[$lbrk[0]].'还未出库,无法入库!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($cz == 2 && $lbrk[0] != $transfer)//判断是否没走完流程就拿到下一步奏
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>$t[$transfer].'还未入库,无法出库!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ if($cz == 1)
|
|
|
+ {
|
|
|
+ $lb['rk'] .= $transfer.'|';
|
|
|
+ $lb['rktime'] .= $time.'|';
|
|
|
+ if($lbrk[0] == $transfer)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'已有入库记录,不可连续重复录入!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if($cz == 2)
|
|
|
+ {
|
|
|
+ $lb['ck'] .= $transfer.'|';
|
|
|
+ $lb['cktime'] .= $time.'|';
|
|
|
+ if($lbck[0] == $transfer)
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'已有出库记录,不可连续重复录入!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $cztime = 'ctime'.$transfer;
|
|
|
+ //如果是完成扫出 这样会通知erp生成一个调出单
|
|
|
+ if($transfer == 3 && $cz == 2 && $lb['dbapi'] < 99){
|
|
|
+
|
|
|
+ $this->db->trans_begin();
|
|
|
+ $this->whlabel_bh_transfer->save(array('rk'=>$lb['rk'],'rktime'=>$lb['rktime'],'ck'=>$lb['ck'],'cktime'=>$lb['cktime'],'time'=>$time,'gtime'=>date('YmdH',$time),$cztime=>$time,'dbapi'=>99),$lb['id']);
|
|
|
+ $this->whlabel_bh_transfer_cr->insert(['fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>time()]);
|
|
|
+ $this->zzquque_u9->insert([
|
|
|
+ 'platform'=>'',
|
|
|
+ 'warehouse'=>0,
|
|
|
+ 'type'=>21,
|
|
|
+ 'order_no'=>$lb['orderinfo'],
|
|
|
+ 'child_order_no'=>$lb['id'],
|
|
|
+ 'status'=>0,
|
|
|
+ 'create_time'=>time(),
|
|
|
+ 'update_time'=>time(),
|
|
|
+ ]);
|
|
|
+ if ($this->db->trans_status() === TRUE){
|
|
|
+ $this->db->trans_commit();
|
|
|
+ echo json_encode(array('music'=>'1','success'=>true));exit;
|
|
|
+ }else{
|
|
|
+ $this->db->trans_rollback();
|
|
|
+ echo json_encode(array('msg'=>'数据写入失败,请重试!','success'=>false));exit;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //if(($transfer == 3 && $lb['dbapi'] < 99 && $cz == 2) || ($transfer == 13 && $lb['dbapi'] < 99 && $cz == 1))//出入库用这个
|
|
|
+ if($transfer == 11 && stripos($lb['rk'],'|8|') === false && stripos($lb['ck'],'|3|') === false && stripos($lb['rk'],'|13|') === false)//改出入库 需要调整8为3 由完成出库检测
|
|
|
+ {
|
|
|
+ echo json_encode(array('msg'=>'工厂未出库,请退回工厂!','success'=>false));exit;
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->db->trans_begin();
|
|
|
+ $this->whlabel_bh_transfer->save(array('rk'=>$lb['rk'],'rktime'=>$lb['rktime'],'ck'=>$lb['ck'],'cktime'=>$lb['cktime'],'time'=>$time,'gtime'=>date('YmdH',$time),$cztime=>$time),$lb['id']);
|
|
|
+ $this->whlabel_bh_transfer_cr->insert(['fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>time()]);
|
|
|
+ if ($this->db->trans_status() === TRUE){
|
|
|
+ $this->db->trans_commit();
|
|
|
+ echo json_encode(array('music'=>'1','success'=>true));exit;
|
|
|
+ }else{
|
|
|
+ $this->db->trans_rollback();
|
|
|
+ echo json_encode(array('msg'=>'数据写入失败,请重试!','success'=>false));exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ protected function getOperateList(){
|
|
|
+ $api = $this->input->post('api',true);
|
|
|
$page = $this->input->post('page',true);
|
|
|
$perpage = $this->input->post('perpage',true);
|
|
|
$orderinfo = $this->input->post('number',true);
|
|
@@ -1627,35 +1833,28 @@ class Whlabel_bh extends Start_Controller {
|
|
|
//格式化数据
|
|
|
foreach ($info_list as $key=>$value)
|
|
|
{
|
|
|
- $dd = $this->whlabel_bh_transfer->read($value['id']);
|
|
|
$info_list[$key]['printtime'] = date('Y-m-d H:i:s',$value['printtime']);
|
|
|
- $rk = explode('|',trim($dd['rk'],'|'));
|
|
|
- $rktime = explode('|',trim($dd['rktime'],'|'));
|
|
|
- $ck = explode('|',trim($dd['ck'],'|'));
|
|
|
- $cktime = explode('|',trim($dd['cktime'],'|'));
|
|
|
- $info_list[$key]['time'] = '';
|
|
|
- for($i=0;$i<count($rk);$i++)
|
|
|
- {
|
|
|
- if(count($rk)-1 == $i && $ot[$rk[$i]] > 0 && $rktime[$i] + $ot[$rk[$i]] < time())
|
|
|
- {
|
|
|
- $d = '<em style="color: #fc5454;">'.$t[$rk[$i]].'入库 :'.((isset($rktime[$i]))?(date('Y-m-d H:i',$rktime[$i])):'').' 超</em><br>';
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- $d = $t[$rk[$i]].'入库 :'.((isset($rktime[$i]))?(date('Y-m-d H:i',$rktime[$i])):'').'<br>';
|
|
|
- }
|
|
|
- $info_list[$key]['time'] .= $d;
|
|
|
- if(isset($ck[$i]) && $ck[$i] != '')
|
|
|
- {
|
|
|
- $info_list[$key]['time'] .= $t[$ck[$i]].'出库 :'.date('Y-m-d H:i',$cktime[$i]).'<br>';
|
|
|
- }
|
|
|
+ $log_list= $this->whlabel_bh_transfer_cr->find_all("fid = ".$value['id']);
|
|
|
+ $tmp_operate_str = "";
|
|
|
+ foreach($log_list as $k=>$v){
|
|
|
+ $tmp_operate_str.= $t[$v['lx']]."".($v['type']==1?'入库':'出库').":".date('Y-m-d H:i:s',$v['time'])."<br>";
|
|
|
}
|
|
|
- $info_list[$key]['time'] = trim($info_list[$key]['time'],'<br>');
|
|
|
+
|
|
|
+ $info_list[$key]['time'] = trim($tmp_operate_str,'<br>');
|
|
|
}
|
|
|
$total = $this->whlabel_bh_transfer->find_count($where);
|
|
|
$pagenum = ceil($total/$perpage);
|
|
|
$over = $total-($start+$perpage);
|
|
|
- $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
|
|
|
+ $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list),'where'=>$where);
|
|
|
+ return $rows;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function _operate()
|
|
|
+ {
|
|
|
+ $post = $this->input->post(NULL, TRUE);
|
|
|
+ if(isset($post['page']))
|
|
|
+ {
|
|
|
+ $rows = $this->getOperateList();
|
|
|
echo json_encode($rows);exit;
|
|
|
}
|
|
|
if(isset($_SESSION['api']))
|
|
@@ -1694,87 +1893,85 @@ class Whlabel_bh extends Start_Controller {
|
|
|
$this->_Template('whlabel_bh_operate',$this->data);
|
|
|
}
|
|
|
|
|
|
- public function _out()
|
|
|
+
|
|
|
+
|
|
|
+ public function _rk()
|
|
|
{
|
|
|
$post = $this->input->post(NULL, TRUE);
|
|
|
- if(isset($post['label']))
|
|
|
+ if(isset($post['page']))
|
|
|
{
|
|
|
- $time = time();
|
|
|
- $label = $this->input->post('label',true);
|
|
|
- $cz = $this->input->post('cz',true);
|
|
|
- $transfer = $this->input->post('transfer',true);
|
|
|
- if(!$label)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'未扫入数据!','success'=>false));exit;
|
|
|
- }
|
|
|
- if(!$transfer)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'请选择需对应的部门!','success'=>false));exit;
|
|
|
- }
|
|
|
- $lb = $this->whlabel_bh_transfer->get_label($label);
|
|
|
- if(!$lb)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'错误!未找到此条码','success'=>false));exit;
|
|
|
- }
|
|
|
- $lbrk = array_reverse(explode('|',trim($lb['rk'],'|')));
|
|
|
- $lbck = array_reverse(explode('|',trim($lb['ck'],'|')));
|
|
|
- if($cz == 1)
|
|
|
- {
|
|
|
- $lb['rk'] .= $transfer.'|';
|
|
|
- $lb['rktime'] .= $time.'|';
|
|
|
- if($lbrk[0] == $transfer)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'已有入库记录,不可连续重复录入!','success'=>false));exit;
|
|
|
- }
|
|
|
- }
|
|
|
- else if($cz == 2)
|
|
|
- {
|
|
|
- $lb['ck'] .= $transfer.'|';
|
|
|
- $lb['cktime'] .= $time.'|';
|
|
|
- if($lbck[0] == $transfer)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'已有出库记录,不可连续重复录入!','success'=>false));exit;
|
|
|
- }
|
|
|
- }
|
|
|
- $cztime = 'ctime'.$transfer;
|
|
|
- //if(($transfer == 3 && $lb['dbapi'] < 99 && $cz == 2) || ($transfer == 13 && $lb['dbapi'] < 99 && $cz == 1))//出入库用这个
|
|
|
- if($transfer == 11 && stripos($lb['rk'],'|8|') === false && stripos($lb['ck'],'|3|') === false && stripos($lb['rk'],'|13|') === false)//改出入库 需要调整8为3 由完成出库检测
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'工厂未出库,请退回工厂!','success'=>false));exit;
|
|
|
+ $res = $this->getOperateList();
|
|
|
+ $rows = array('total'=>$res['total'],'over'=>$res['over'],'pagenum'=>$res['pagenum'],'rows'=>($res['rows']),'cs'=>$res['where']);
|
|
|
+ echo json_encode($rows);exit;
|
|
|
+ }
|
|
|
+ if(isset($_SESSION['api']))
|
|
|
+ {
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
+ $usp = $user;
|
|
|
+ $pid = "";$tid="";$sid="";$wid="";
|
|
|
+ $purchase = explode('|',trim($user['purchase'],'|'));
|
|
|
+ $transfer = explode('|',trim($user['transfer'],'|'));
|
|
|
+ $warehouse = explode('|',trim($user['warehouse'],'|'));
|
|
|
+ foreach ($purchase as $value)
|
|
|
+ {
|
|
|
+ $pid .= " id = ".$value." or";
|
|
|
}
|
|
|
- if($this->whlabel_bh_transfer->save(array('rk'=>$lb['rk'],'rktime'=>$lb['rktime'],'ck'=>$lb['ck'],'cktime'=>$lb['cktime'],'time'=>$time,'gtime'=>date('YmdH',$time),$cztime=>$time),$lb['id']))
|
|
|
- {
|
|
|
- echo json_encode(array('music'=>'1','success'=>true));exit;
|
|
|
+ foreach ($transfer as $value)
|
|
|
+ {
|
|
|
+ $tid .= " id = ".$value." or";
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>'数据写入失败,请重试!','success'=>false));exit;
|
|
|
+ foreach ($warehouse as $value)
|
|
|
+ {
|
|
|
+ $wid .= " id = ".$value." or";
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ header('Location: /');exit;
|
|
|
+ }
|
|
|
+ $transfer = $this->transfer->find_all('1=1 and '.rtrim($tid,'or'));
|
|
|
+ $this->data['transfer'] = $transfer;
|
|
|
+ $this->_Template('whlabel_bh_rk',$this->data);
|
|
|
}
|
|
|
|
|
|
- public function _bdbb()
|
|
|
+
|
|
|
+ public function _ck()
|
|
|
{
|
|
|
$post = $this->input->post(NULL, TRUE);
|
|
|
- if(isset($post['s']))
|
|
|
+ if(isset($post['page']))
|
|
|
{
|
|
|
- $id_arr = $this->input->post('s');
|
|
|
- $id_arr = explode(',',trim($id_arr,','));
|
|
|
- if(!$id_arr)
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>$v.' - 未查询到需要补打信息!','success'=>false));exit;
|
|
|
- }
|
|
|
- //循环删除记录
|
|
|
- foreach ($id_arr as $v)
|
|
|
+ $res = $this->getOperateList();
|
|
|
+ $rows = array('total'=>$res['total'],'over'=>$res['over'],'pagenum'=>$res['pagenum'],'rows'=>($res['rows']),'cs'=>$res['where']);
|
|
|
+ echo json_encode($rows);exit;
|
|
|
+ }
|
|
|
+ if(isset($_SESSION['api']))
|
|
|
+ {
|
|
|
+ $user = $this->user->get_api($_SESSION['api']);
|
|
|
+ $usp = $user;
|
|
|
+ $pid = "";$tid="";$sid="";$wid="";
|
|
|
+ $purchase = explode('|',trim($user['purchase'],'|'));
|
|
|
+ $transfer = explode('|',trim($user['transfer'],'|'));
|
|
|
+ $warehouse = explode('|',trim($user['warehouse'],'|'));
|
|
|
+ foreach ($purchase as $value)
|
|
|
{
|
|
|
- $t = $this->whlabel_bh_transfer->read($v);
|
|
|
- if(!isset($t['number']))
|
|
|
- {
|
|
|
- echo json_encode(array('msg'=>$v.' - 补打信息已被删除!','success'=>false));exit;
|
|
|
- }
|
|
|
- $rows[] = array('num'=>$t['label'],'title'=>'补:'.$t['orderinfo'],'jm'=>$t['jm'],'n'=>$t['ts']);
|
|
|
- }
|
|
|
- echo json_encode(array('rows'=>($rows),'success'=>true));exit;
|
|
|
+ $pid .= " id = ".$value." or";
|
|
|
+ }
|
|
|
+ foreach ($transfer as $value)
|
|
|
+ {
|
|
|
+ $tid .= " id = ".$value." or";
|
|
|
+ }
|
|
|
+ foreach ($warehouse as $value)
|
|
|
+ {
|
|
|
+ $wid .= " id = ".$value." or";
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ header('Location: /');exit;
|
|
|
+ }
|
|
|
+ $transfer = $this->transfer->find_all('1=1 and '.rtrim($tid,'or'));
|
|
|
+ $this->data['transfer'] = $transfer;
|
|
|
+ $this->_Template('whlabel_bh_ck',$this->data);
|
|
|
+ }
|
|
|
+
|
|
|
}
|