lvhao 13 годин тому
батько
коміт
09dffe6e3d

+ 8 - 4
core/CoreApp/controllers/Transfer.php

@@ -844,7 +844,7 @@ class Transfer extends Start_Controller {
 		            $is_jiaji = "常规";
 		        }
 				if(empty($value['ycrk_type'])){
-					$is_jiaji .= "<p  onclick='addYcrk(".$value['id'].")'><b >异常入库</b></p>";
+					$is_jiaji .= "<br/><a href='javascript:void(0)' onclick='addYcrk(".$value['id'].")'><l style='color:#000' >异常入库</l></a>";
 				}else{
 					$is_jiaji .= "";
 				}
@@ -3345,6 +3345,10 @@ class Transfer extends Start_Controller {
 			echo json_encode(array('msg'=>'请求方式不正确','success'=>false));exit;
 		}
 		$id = $this->input->post('id',true);
+		$type = $this->input->post('type',true);
+		if(!in_array($type,[1,2,3])){
+			echo json_encode(array('msg'=>'入库类别异常,联系技术','success'=>false));exit;
+		}
 		$info = $this->systemtransfer->read($id);
 		if(empty($info)){
 			echo json_encode(array('msg'=>'数据不存在','success'=>false));exit;
@@ -3355,16 +3359,16 @@ class Transfer extends Start_Controller {
 
 		//更新数据 
 		$this->systemtransfer->save([
-			'ycrk_type'=>1,
+			'ycrk_type'=>$type,
 		],$id);
 		$list = $this->systemtransfer_cr->find_all('fid = '.$id,'*','id desc');
 		foreach ($list as $key=>$value) {
 			$this->systemtransfer_cr->save([
-				'ycrk_type'=>1,
+				'ycrk_type'=>$type,
 			],$value['id']);
 		}
 		$this->systemtransfer_cr->insert([
-			'fid'=>$id,'lx'=>0,'type'=>1,'time'=>time(),'is_over'=>0,'over_flag'=>0,
+			'fid'=>$id,'lx'=>0,'type'=>$type,'time'=>time(),'is_over'=>0,'over_flag'=>0,
 			'extra_status'=>0,'ycrk_type'=>1,
 		]);
 		echo json_encode(array('msg'=>'添加成功','success'=>true));exit;

+ 40 - 26
template/erp/transfer_operate.html

@@ -294,32 +294,46 @@ $(".systemwindow").on('click', "#bdbbprintks", function() {
 	  });
 
    function addYcrk(id){
-    //  $.post("/transfer/ycrk", {id:id}, function(a){
-    //     if(a.success){
-    //         layx.confirm('提示',a.msg,null,{
-	// 			buttons:[
-	// 				{
-	// 					label:'确定',
-	// 					callback:function(id, button, event){
-	// 						layx.destroy(id);
-    //                         $(".search span").click();
-	// 					}
-	// 				}
-	// 			],dialogIcon:'error',shadable:0.6
-	// 		})
-    //     }else{
-    //        layx.confirm('提示',a.msg,null,{
-	// 			buttons:[
-	// 				{
-	// 					label:'确定',
-	// 					callback:function(id, button, event){
-	// 						layx.destroy(id);
-	// 					}
-	// 				}
-	// 			],dialogIcon:'error',shadable:0.6
-	// 		})
-    //     }
-    //  }, "json")
+    $(".boundtj div p:eq(0)").html('<label>类 型:<select name="type" class="select"><option value="1">配货入库</option><option value="2">成品库入库</option><option value="3">外销单入库</option></select></label> <input type="hidden" name="id" value="'+id+'" />');
+    $(".boundtj div p:eq(1)").html("<font class='obaddgo' onclick='doAddYcrk()'>确 定</font><font class='esc' onclick='escDo()'>取 消</font>");
+    $(".boundtj").show();
+   }
+   function doAddYcrk(){
+     let obj = {}
+     obj.id = $(".boundtj input[name='id']").val();
+     obj.type = $(".boundtj select[name='type']").val();
+     $.post("/transfer/ycrk", obj, function(a){
+        if(a.success){
+            layx.confirm('提示',a.msg,null,{
+				buttons:[
+					{
+						label:'确定',
+						callback:function(id, button, event){
+							layx.destroy(id);
+                            escDo();
+                            $(".search span").click();
+						}
+					}
+				],dialogIcon:'error',shadable:0.6
+			})
+        }else{
+           layx.confirm('提示',a.msg,null,{
+				buttons:[
+					{
+						label:'确定',
+						callback:function(id, button, event){
+                            escDo();
+							layx.destroy(id);
+						}
+					}
+				],dialogIcon:'error',shadable:0.6
+			})
+        }
+     }, "json")
+   }
+   function escDo(){
+    $(".boundtj p").html("");
+    $(".boundtj").hide();
    }
 </script>
 <script>