|
@@ -95,6 +95,8 @@ class Beihuogl extends Start_Controller {
|
|
|
$this->_ckexcel($arg_array);
|
|
$this->_ckexcel($arg_array);
|
|
|
}elseif($arg == 'checkdcdsku'){
|
|
}elseif($arg == 'checkdcdsku'){
|
|
|
$this->_checkdcdsku($arg_array);
|
|
$this->_checkdcdsku($arg_array);
|
|
|
|
|
+ }elseif($arg == 'dcdkwyz'){
|
|
|
|
|
+ $this->_dcdkwyz();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -1547,7 +1549,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,rk_time,is_rk",$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,is_rk,szkw",$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'=>([]));
|
|
@@ -1562,15 +1564,28 @@ class Beihuogl extends Start_Controller {
|
|
|
$list[$k]['create_time'] = empty($v['create_time'])?"":date("Y-m-d",$v['create_time']);
|
|
$list[$k]['create_time'] = empty($v['create_time'])?"":date("Y-m-d",$v['create_time']);
|
|
|
|
|
|
|
|
$str = "";
|
|
$str = "";
|
|
|
- if($v['is_rk'] == 0){
|
|
|
|
|
- $str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#DC143C;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dcdjzrk(this)' data-id='".$v['id']."' data-num='".$v['num']."'>禁止入库</a>";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if(!empty($v['rk_time'])){
|
|
if(!empty($v['rk_time'])){
|
|
|
$str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#D2691E;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dybq(this)' data-id='".$v['id']."' >打印标签</a>";
|
|
$str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#D2691E;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dybq(this)' data-id='".$v['id']."' >打印标签</a>";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if($v['is_rk'] == 0){
|
|
|
|
|
+ $str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#DC143C;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dcdrk(this)' data-type='1' data-id='".$v['id']."' data-num='".$v['num']."'>禁止入库</a>";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#778899;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dcdrk(this)' data-type='2' data-id='".$v['id']."' data-num='".$v['num']."'>允许入库</a>";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(empty($v['szkw'])){
|
|
|
|
|
+ $str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#9932CC;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dcdyz(this)' data-type='1' data-id='".$v['id']."' data-num='".$v['num']."'>禁止验证</a>";
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $str .= "<a href='javascript:void(0)' style='margin-right:4px;color: #fff;background-color:#00CED1;padding:4px 8px;border-radius:5px;font-size:13px' onclick='dcdyz(this)' data-type='2' data-id='".$v['id']."' data-num='".$v['num']."'>允许验证</a>";
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
$list[$k]['rk_time'] = $str;
|
|
$list[$k]['rk_time'] = $str;
|
|
|
unset($list[$k]['is_rk']);
|
|
unset($list[$k]['is_rk']);
|
|
|
|
|
+ unset($list[$k]['szkw']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1666,7 +1681,7 @@ class Beihuogl extends Start_Controller {
|
|
|
$dcd_no = $data['dcd_no'];
|
|
$dcd_no = $data['dcd_no'];
|
|
|
$drd_no = $data['drd_no'];
|
|
$drd_no = $data['drd_no'];
|
|
|
$list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and is_rk = 0");
|
|
$list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and is_rk = 0");
|
|
|
- $whlabel_arr = [];
|
|
|
|
|
|
|
+ $spec_arr = $whlabel_arr = [];
|
|
|
$time = time();
|
|
$time = time();
|
|
|
$err_list= [];
|
|
$err_list= [];
|
|
|
foreach($list as $k=>$v){
|
|
foreach($list as $k=>$v){
|
|
@@ -1674,31 +1689,73 @@ class Beihuogl extends Start_Controller {
|
|
|
$err_list[] = $v['jm']."不存在";
|
|
$err_list[] = $v['jm']."不存在";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- for($i=0;$i<$v['num'];$i++){
|
|
|
|
|
- $whlabel_arr[] = [
|
|
|
|
|
- 'purchase'=>1,
|
|
|
|
|
- 'sku'=>$v['sku'],
|
|
|
|
|
- 'number'=>$v['number'],
|
|
|
|
|
- 'features'=>$v['features'],
|
|
|
|
|
- 'title'=>$v['title'],
|
|
|
|
|
- 'zh'=>$v['zh'],
|
|
|
|
|
- 'warehouse'=>'13',
|
|
|
|
|
- 'enter'=>$time,
|
|
|
|
|
- 'state'=>0,
|
|
|
|
|
- 'retreatwarehouse'=>'13',
|
|
|
|
|
- 'time'=>$time,
|
|
|
|
|
- 'details'=>$v['kw'],
|
|
|
|
|
- 'bs'=>1,
|
|
|
|
|
- 'rktype'=>9,
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ if(empty($v['szkw'])){
|
|
|
|
|
+ $tmp_info = $this->whlabel->find("warehouse = '".$v['erp_warehouse']."' and sku = '".$v['sku']."' and details != 'DZ001' ","*","id desc");
|
|
|
|
|
+ if(!empty($tmp_info)){
|
|
|
|
|
+ if(!empty($tmp_info['details'])){
|
|
|
|
|
+ if($tmp_info['details'] != $v['kw']){
|
|
|
|
|
+ $err_list[] = $v['jm']."的库位信息";
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if($v['erp_warehouse'] == '12'){
|
|
|
|
|
+ //特殊仓处理方案
|
|
|
|
|
+ for($i=0;$i<$v['num'];$i++){
|
|
|
|
|
+ $spec_arr[] = [
|
|
|
|
|
+ 'purchase'=>1,
|
|
|
|
|
+ 'sku'=>$v['sku'],
|
|
|
|
|
+ 'number'=>$v['number'],
|
|
|
|
|
+ 'features'=>$v['features'],
|
|
|
|
|
+ 'featurespp'=>'',
|
|
|
|
|
+ 'label'=>'',
|
|
|
|
|
+ 'title'=>$v['title'],
|
|
|
|
|
+ // 'zh'=>$v['zh'],
|
|
|
|
|
+ 'warehouse'=>$v['erp_warehouse'],
|
|
|
|
|
+ 'enter'=>$time,
|
|
|
|
|
+ 'state'=>0,
|
|
|
|
|
+ 'retreatwarehouse'=>$v['erp_warehouse'],
|
|
|
|
|
+ 'time'=>$time,
|
|
|
|
|
+ 'details'=>$v['kw'],
|
|
|
|
|
+ 'bs'=>1,
|
|
|
|
|
+ 'rktype'=>9,
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ for($i=0;$i<$v['num'];$i++){
|
|
|
|
|
+ $whlabel_arr[] = [
|
|
|
|
|
+ 'purchase'=>1,
|
|
|
|
|
+ 'sku'=>$v['sku'],
|
|
|
|
|
+ 'number'=>$v['number'],
|
|
|
|
|
+ 'features'=>$v['features'],
|
|
|
|
|
+ 'title'=>$v['title'],
|
|
|
|
|
+ 'zh'=>$v['zh'],
|
|
|
|
|
+ 'warehouse'=>$v['erp_warehouse'],
|
|
|
|
|
+ 'enter'=>$time,
|
|
|
|
|
+ 'state'=>0,
|
|
|
|
|
+ 'retreatwarehouse'=>$v['erp_warehouse'],
|
|
|
|
|
+ 'time'=>$time,
|
|
|
|
|
+ 'details'=>$v['kw'],
|
|
|
|
|
+ 'bs'=>1,
|
|
|
|
|
+ 'rktype'=>9,
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
if(!empty($err_list)){
|
|
if(!empty($err_list)){
|
|
|
echo json_encode(['success'=>false,'msg'=>implode('<br/>', $err_list)]);exit;
|
|
echo json_encode(['success'=>false,'msg'=>implode('<br/>', $err_list)]);exit;
|
|
|
}
|
|
}
|
|
|
$this->db->trans_start();
|
|
$this->db->trans_start();
|
|
|
- $this->db->insert_batch('whlabel',$whlabel_arr);
|
|
|
|
|
|
|
+ if(!empty($whlabel_arr)){
|
|
|
|
|
+ $this->db->insert_batch('whlabel',$whlabel_arr);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($spec_arr)){
|
|
|
|
|
+ $this->db->insert_batch('specialstock',$spec_arr);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$this->db->where('dcd_no',$dcd_no);
|
|
$this->db->where('dcd_no',$dcd_no);
|
|
|
//$this->db->where('drd_no',$drd_no);
|
|
//$this->db->where('drd_no',$drd_no);
|
|
|
$this->db->update('bhdcd',['status'=>3,'rk_time'=>$time,'is_rk'=>1]);
|
|
$this->db->update('bhdcd',['status'=>3,'rk_time'=>$time,'is_rk'=>1]);
|
|
@@ -1723,9 +1780,15 @@ class Beihuogl extends Start_Controller {
|
|
|
}
|
|
}
|
|
|
$in_where = rtrim($in_where,",");
|
|
$in_where = rtrim($in_where,",");
|
|
|
$in_where .= " )";
|
|
$in_where .= " )";
|
|
|
|
|
+ $warehouse_list = [
|
|
|
|
|
+ 12=>'特殊仓',
|
|
|
|
|
+ 13=>'许昌仓',
|
|
|
|
|
+ 16=>'定制头套仓'
|
|
|
|
|
+ ];
|
|
|
foreach($list as $k=>$v){
|
|
foreach($list as $k=>$v){
|
|
|
$list[$k]['status_show'] = isset($status_list[$v['status']])?$status_list[$v['status']]:"";
|
|
$list[$k]['status_show'] = 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]['warehouse_show'] = isset($warehouse_list[$v['erp_warehouse']])?$warehouse_list[$v['erp_warehouse']]:"";
|
|
|
if(!empty($v['kw'])){
|
|
if(!empty($v['kw'])){
|
|
|
$list[$k]['kw'] = $v['kw'];
|
|
$list[$k]['kw'] = $v['kw'];
|
|
|
}else{
|
|
}else{
|
|
@@ -1782,6 +1845,10 @@ class Beihuogl extends Start_Controller {
|
|
|
$update_arr = [
|
|
$update_arr = [
|
|
|
'kw'=>trim($val),
|
|
'kw'=>trim($val),
|
|
|
];
|
|
];
|
|
|
|
|
+ }elseif($column == 'ck'){
|
|
|
|
|
+ $update_arr = [
|
|
|
|
|
+ 'erp_warehouse'=>trim($val),
|
|
|
|
|
+ ];
|
|
|
}else{
|
|
}else{
|
|
|
echo json_encode(['success'=>false,'msg'=>'请求参数未设置']);exit;
|
|
echo json_encode(['success'=>false,'msg'=>'请求参数未设置']);exit;
|
|
|
}
|
|
}
|
|
@@ -1910,12 +1977,26 @@ class Beihuogl extends Start_Controller {
|
|
|
private function _dcdjzrk(){
|
|
private function _dcdjzrk(){
|
|
|
if($this->input->method() === 'post'){
|
|
if($this->input->method() === 'post'){
|
|
|
$id = $this->input->post('id',true);
|
|
$id = $this->input->post('id',true);
|
|
|
|
|
+ $type = $this->input->post('type',true);
|
|
|
|
|
+ $is_rk = 0;
|
|
|
|
|
+ if($type == 1){
|
|
|
|
|
+ $is_rk = 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $is_rk = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$info = $this->bhdcd->read($id);
|
|
$info = $this->bhdcd->read($id);
|
|
|
- if($info['is_rk'] == 0){
|
|
|
|
|
- $this->bhdcd->save(['is_rk'=>1],$id);
|
|
|
|
|
- echo json_encode(['success'=>true,'msg'=>'此条信息已禁止入库']);exit;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if($info['is_rk'] != $is_rk){
|
|
|
|
|
+ $this->bhdcd->save(['is_rk'=>$is_rk],$id);
|
|
|
|
|
+ echo json_encode(['success'=>true,'msg'=>'修改成功']);exit;
|
|
|
}else{
|
|
}else{
|
|
|
- echo json_encode(['success'=>true,'msg'=>'此条信息已禁止入库']);exit;
|
|
|
|
|
|
|
+ if($type ==1){
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'此条信息已禁止入库']);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'此条信息已允许入库']);exit;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
echo json_encode(['success'=>false,'msg'=>'请求方式错误']);exit;
|
|
echo json_encode(['success'=>false,'msg'=>'请求方式错误']);exit;
|
|
@@ -1935,6 +2016,33 @@ class Beihuogl extends Start_Controller {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private function _dcdkwyz(){
|
|
|
|
|
+ if($this->input->method() === 'post'){
|
|
|
|
|
+ $id = $this->input->post('id',true);
|
|
|
|
|
+ $type = $this->input->post('type',true);
|
|
|
|
|
+ $szkw = 0;
|
|
|
|
|
+ if($type == 1){
|
|
|
|
|
+ $szkw = 1;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $szkw = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ $info = $this->bhdcd->read($id);
|
|
|
|
|
+ if($info['szkw'] != $szkw){
|
|
|
|
|
+ $this->bhdcd->save(['szkw'=>$szkw],$id);
|
|
|
|
|
+ echo json_encode(['success'=>true,'msg'=>'修改成功']);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if($type ==1){
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'此条信息已禁止验证库位']);exit;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'此条信息已允许验证库位']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }else{
|
|
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'请求方式错误']);exit;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private function _ckexcel($arg_array){
|
|
private function _ckexcel($arg_array){
|
|
|
$id = $arg_array[0];
|
|
$id = $arg_array[0];
|
|
|
$info = $this->bhccwl->read($id);
|
|
$info = $this->bhccwl->read($id);
|