|
@@ -12,6 +12,7 @@ class Beihuogl extends Start_Controller {
|
|
|
$this->load->_model("Model_goods","goods");
|
|
$this->load->_model("Model_goods","goods");
|
|
|
$this->load->_model("Model_settingtest","settingtest");
|
|
$this->load->_model("Model_settingtest","settingtest");
|
|
|
$this->load->_model("Model_bhdcd","bhdcd");
|
|
$this->load->_model("Model_bhdcd","bhdcd");
|
|
|
|
|
+ $this->load->_model("Model_whlabellabel","whlabellabel");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//定义方法的调用规则 获取URI第二段值
|
|
//定义方法的调用规则 获取URI第二段值
|
|
@@ -80,6 +81,8 @@ class Beihuogl extends Start_Controller {
|
|
|
$this->_u9scdexcel($arg_array);
|
|
$this->_u9scdexcel($arg_array);
|
|
|
}elseif($arg == 'ccwlskucheck'){
|
|
}elseif($arg == 'ccwlskucheck'){
|
|
|
$this->_ccwlskucheck();
|
|
$this->_ccwlskucheck();
|
|
|
|
|
+ }elseif($arg == 'printlabel'){
|
|
|
|
|
+ $this->_printlabel();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1322,7 +1325,7 @@ class Beihuogl extends Start_Controller {
|
|
|
$start = ($page - 1)*$perpage;
|
|
$start = ($page - 1)*$perpage;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $list = $this->bhdcd->find_all($where,"id,bh_no,dcd_no,drd_no,status,jm,num,kw,create_time",$order_str,$start,$perpage);
|
|
|
|
|
|
|
+ $list = $this->bhdcd->find_all($where,"id,bh_no,dcd_no,drd_no,status,jm,num,kw,create_time,rk_time",$order_str,$start,$perpage);
|
|
|
|
|
|
|
|
if(empty($list)){
|
|
if(empty($list)){
|
|
|
$rows = array('total'=>0,'over'=>1,'pagenum'=>0,'rows'=>([]));
|
|
$rows = array('total'=>0,'over'=>1,'pagenum'=>0,'rows'=>([]));
|
|
@@ -1334,7 +1337,8 @@ class Beihuogl extends Start_Controller {
|
|
|
$list[$k]['status'] = isset($status_list[$v['status']])?$status_list[$v['status']]:"";
|
|
$list[$k]['status'] = isset($status_list[$v['status']])?$status_list[$v['status']]:"";
|
|
|
$list[$k]['drd_no'] = empty($v['drd_no'])?"":$v['drd_no'];
|
|
$list[$k]['drd_no'] = empty($v['drd_no'])?"":$v['drd_no'];
|
|
|
$list[$k]['kw'] = empty($v['kw'])?"":$v['kw'];
|
|
$list[$k]['kw'] = empty($v['kw'])?"":$v['kw'];
|
|
|
- $list[$k]['create_time'] = empty($v['create_time'])?"":date("Y-m-d H:i:s",$v['create_time']);
|
|
|
|
|
|
|
+ $list[$k]['create_time'] = empty($v['create_time'])?"":date("Y-m-d",$v['create_time']);
|
|
|
|
|
+ $list[$k]['rk_time'] = empty($v['rk_time'])?"": "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#D2691E;padding:4px 10px;border-radius:5px;font-size:15px' onclick='dybq(this)' data-id='".$v['id']."' data-num='".$v['num']."'>打印标签</a>";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1577,4 +1581,61 @@ class Beihuogl extends Start_Controller {
|
|
|
exit($str);
|
|
exit($str);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ //打印标签
|
|
|
|
|
+ private function _printlabel(){
|
|
|
|
|
+ if($this->input->method() === 'post'){
|
|
|
|
|
+ $id = $this->input->post('id',true);
|
|
|
|
|
+ $xbqnum = $this->input->post('num',true);
|
|
|
|
|
+ $info = $this->bhdcd->read($id);
|
|
|
|
|
+ if(empty($info)){
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'数据不存在']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $featurespp = str_replace(array('-163-', '-164-', '-165-', '-166-'), '-', $info['features']);
|
|
|
|
|
+ $featurespp = explode('-', trim($featurespp, '-'));
|
|
|
|
|
+ if (isset($featurespp[5])) {
|
|
|
|
|
+ $tmp_featurespp = $featurespp[0] . '-' . $featurespp[3] . '-' . $featurespp[4] . '-' . $featurespp[5];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $tmp_featurespp = $featurespp[0] . '-' . $featurespp[3] . '-' . $featurespp[4];
|
|
|
|
|
+ }
|
|
|
|
|
+ $label = '';
|
|
|
|
|
+ $cpid = $this->whlabellabel->find_count();
|
|
|
|
|
+ $cpid = $cpid + 1;
|
|
|
|
|
+ $time = time();
|
|
|
|
|
+ $label = time().rand(10,99);
|
|
|
|
|
+ $label = substr($label,1);
|
|
|
|
|
+ $insert_arr = [
|
|
|
|
|
+ 'purchase'=>1,
|
|
|
|
|
+ 'shop'=>'',
|
|
|
|
|
+ 'sku'=>$info['sku'],
|
|
|
|
|
+ 'number'=>$info['number'],
|
|
|
|
|
+ 'features'=>$info['features'],
|
|
|
|
|
+ 'featurespp'=>$tmp_featurespp,
|
|
|
|
|
+ 'title'=>$info['title'],
|
|
|
|
|
+ 'label'=>$label,
|
|
|
|
|
+ 'warehouse'=>13,
|
|
|
|
|
+ 'time'=>$time,
|
|
|
|
|
+ 'details'=>$info['kw'],
|
|
|
|
|
+ 'cpid'=>$cpid,
|
|
|
|
|
+ 'jm'=>$info['jm'],
|
|
|
|
|
+ 'cpbz'=>''
|
|
|
|
|
+ ];
|
|
|
|
|
+ $this->db->trans_begin();
|
|
|
|
|
+ $this->whlabellabel->insert($insert_arr);
|
|
|
|
|
+ if ($this->db->trans_status() === TRUE) {
|
|
|
|
|
+ $this->db->trans_commit();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $this->db->trans_rollback();
|
|
|
|
|
+ echo json_encode(array('msg' => '错误,请重试!', 'success' => false));
|
|
|
|
|
+ exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ $details = '位置:(' . $info['kw'] . ') <font style="font-size: 18px;">' . $cpid . '</font>' ;
|
|
|
|
|
+ $details = ' <b style="font-size: 18px;">'."许昌仓</b> ".$details;
|
|
|
|
|
+ $purchase = "龙盈工厂";
|
|
|
|
|
+ echo json_encode(array('title' => $info['title'], 'num' => $label, 'bqsku' => $info['sku'], 'xbqnum' => $xbqnum, 'zh' => str_replace('自然色 ', '', rtrim($info['zh'], ' ')), 'details' => $details, 'purchase' => $purchase, 'cpbz' => "", 'usa' => 0, 'success' => true));
|
|
|
|
|
+ exit; //特殊仓目前不需要仓库选项
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'请求方式错误']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|