lvhao hai 1 día
pai
achega
0cc7d3ed2d

+ 47 - 0
core/CoreApp/controllers/Transfer.php

@@ -19,6 +19,7 @@ class Transfer extends Start_Controller {
 		$this->load->_model('Model_shop','shop');
 		$this->load->_model('Model_systemtransfer_cr','systemtransfer_cr');
 		$this->load->_model("Model_logic_ding","logic_ding");
+		$this->load->_model("Model_zzquque_u9","zzquque_u9");
 	}
 	//定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
@@ -1122,6 +1123,52 @@ class Transfer extends Start_Controller {
 						$this->systemtransfer->save(array('dbapi'=>$rk['dbapi'],'scid'=>$rk['scid']),$lb['id']);
 					    echo json_encode(array('msg'=>'订单号:'.$lb['number'].' 用友报错:'.$rk['error'],'success'=>false));exit;
 				    }
+				}elseif($lb['type'] == 2){
+					
+					$this->db->trans_begin();
+					$this->systemtransfer->save(array('rk'=>$lb['rk'],'rktime'=>$lb['rktime'],'ck'=>$lb['ck'],'cktime'=>$lb['cktime'],'time'=>$time,'gtime'=>date('YmdH',$time),'dbapi'=>99,$cztime=>$time),$lb['id']);
+					$this->systemtransfer_cr->insert(array('fid'=>$lb['id'],'lx'=>$transfer,'type'=>$cz,'time'=>$time));
+					$this->zzquque_u9->insert([
+						'platform'=>'',
+						'warehouse'=>0,
+						'type'=>20,   //5代表美仓  
+						'order_no'=>$lb['number'],
+						'child_order_no'=>$lb['id'],
+						'status'=>0,
+						'create_time'=>time(),
+						'update_time'=>time(),
+					]);
+					//处理定时任务每三分钟 执行一次的bug  在出库的时候直接同步相关信息
+					if($cz == 2){
+						$this->_doCheckIsOverTime($lb['id'],$transfer);
+					}
+					if ($this->db->trans_status() === TRUE)
+					{
+						$this->db->trans_commit();
+						if($nu['state'] == '216')
+						{
+							echo json_encode(array('msg'=>'数据已录入成功!提示:此订单已出库,可选择终止生产。','success'=>false));exit;
+						}
+						elseif(($nu['state'] == '217') || ($nu['state'] == '214')){
+							//标记订单已经取消
+							$this->_doCheckCancelFlag($lb['id']);
+							echo json_encode(array('msg'=>'数据已录入成功!提示:【该单已取消】,可选择终止生产。','success'=>false));exit;
+						}
+						else
+						{
+							if($lb['is_jiaji'] == 2){
+								echo json_encode(array('music'=>'1','is_jiaji'=>2,'success'=>true));exit;
+							}else{
+								echo json_encode(array('music'=>'1','success'=>true));exit;
+							}
+							
+						}
+					}
+					else
+					{
+						$this->db->trans_rollback();
+						echo json_encode(array('msg'=>'数据写入失败,请重试!','success'=>false));exit;
+					}
 				}
 				else
 				{

+ 2 - 2
template/erp/js/print.js

@@ -1631,11 +1631,11 @@ else
     });
 });
 
-function newbbnumberprint(d,n,zps,b,ph,is_jiaji) {
+function newbbnumberprint(d,n,zps,b,ph,is_jiaji,lx = 0) {
 	layx.load('loadId','操作中,请稍后',{shadable:0.6});
     $.ajax({
         url: addedit,
-        data: "type=0&data="+d+"&n="+n+"&zps="+zps+"&b="+b+"&ph="+ph+"&is_jiaji="+is_jiaji,
+        data: "type="+lx+"&data="+d+"&n="+n+"&zps="+zps+"&b="+b+"&ph="+ph+"&is_jiaji="+is_jiaji,
         type: "POST",
         dataType: "json",
         success: function(a) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 27 - 9
template/erp/transfer_number.html