|
@@ -1656,7 +1656,7 @@ class Whlabel_bh extends Start_Controller {
|
|
|
{
|
|
|
echo json_encode(array('msg'=>$v.' - 补打信息已被删除!','success'=>false));exit;
|
|
|
}
|
|
|
- $rows[] = array('num'=>$t['label'],'title'=>'补:'.$t['orderinfo'],'jm'=>$t['jm'],'n'=>$t['ts']);
|
|
|
+ $rows[] = array('num'=>$t['label'],'title'=>'补:'.$t['orderinfo'],'jm'=>$t['jm'],'n'=>1);
|
|
|
}
|
|
|
echo json_encode(array('rows'=>($rows),'success'=>true));exit;
|
|
|
}
|
|
@@ -1710,6 +1710,10 @@ class Whlabel_bh extends Start_Controller {
|
|
|
{
|
|
|
echo json_encode(array('msg'=>'已有入库记录,不可连续重复录入!','success'=>false));exit;
|
|
|
}
|
|
|
+ //必须走配货
|
|
|
+ if(($transfer != 1) && (strpos($lb['rk'],'|1|') === false) ){
|
|
|
+ echo json_encode(array('msg'=>'请先到配货!','success'=>false));exit;
|
|
|
+ }
|
|
|
}
|
|
|
else if($cz == 2)
|
|
|
{
|
|
@@ -1720,13 +1724,18 @@ class Whlabel_bh extends Start_Controller {
|
|
|
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->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,'status'=>2,'dbapi'=>99),$lb['id']);
|
|
|
+ $this->whlabel_bh_transfer_cr->insert(['fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>time(),'is_over'=>1]);
|
|
|
+ $ct_info = $this->whlabel_bh_transfer_cr->find("fid = ".$lb['id']." and lx = ".$transfer." and type = 1 and is_over = 0","*",'id desc');
|
|
|
+ if($ct_info){
|
|
|
+ $this->whlabel_bh_transfer_cr->save(['is_over'=>1],$ct_info['id']);
|
|
|
+ }
|
|
|
$this->zzquque_u9->insert([
|
|
|
'platform'=>'',
|
|
|
'warehouse'=>0,
|
|
@@ -1753,10 +1762,25 @@ class Whlabel_bh extends Start_Controller {
|
|
|
{
|
|
|
echo json_encode(array('msg'=>'工厂未出库,请退回工厂!','success'=>false));exit;
|
|
|
}
|
|
|
-
|
|
|
+ $save_data = [
|
|
|
+ 'rk'=>$lb['rk'],'rktime'=>$lb['rktime'],'ck'=>$lb['ck'],'cktime'=>$lb['cktime'],'time'=>$time,'gtime'=>date('YmdH',$time),$cztime=>$time
|
|
|
+ ];
|
|
|
+ //配货入库需更新一下配货状态
|
|
|
+ if($transfer == 1 && $cz == 1 && $lb['status'] == 0){
|
|
|
+ $save_data['status'] = 1;
|
|
|
+ }
|
|
|
$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()]);
|
|
|
+ $this->whlabel_bh_transfer->save($save_data,$lb['id']);
|
|
|
+ if($cz == 2){
|
|
|
+ $this->whlabel_bh_transfer_cr->insert(['fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>time(),'is_over'=>1]);
|
|
|
+ $ct_info = $this->whlabel_bh_transfer_cr->find("fid = ".$lb['id']." and lx = ".$transfer." and type = 1 and is_over = 0","*",'id desc');
|
|
|
+ if($ct_info){
|
|
|
+ $this->whlabel_bh_transfer_cr->save(['is_over'=>1],$ct_info['id']);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $this->whlabel_bh_transfer_cr->insert(['fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>time(),'is_over'=>0]);
|
|
|
+ }
|
|
|
+
|
|
|
if ($this->db->trans_status() === TRUE){
|
|
|
$this->db->trans_commit();
|
|
|
echo json_encode(array('music'=>'1','success'=>true));exit;
|