Explorar o código

添加扫码日志

lvhao hai 9 horas
pai
achega
d87af7d487

+ 31 - 3
core/CoreApp/controllers/Whlabel.php

@@ -43,6 +43,7 @@ class Whlabel extends Start_Controller
 		$this->load->_model("Model_logic_order","logic_order");
 		$this->load->_model("Model_logic_ding","logic_ding");
 		$this->load->_model("Model_logic_u9tools","logic_u9tools");
+		$this->load->_model("Model_whlabelscanlog","whlabelscanlog");
 	}
 	//定义方法的调用规则 获取URI第二段值
 	public function _remap($arg, $arg_array)
@@ -6334,7 +6335,7 @@ class Whlabel extends Start_Controller
 				$post['details'] = $rk['details'];
 				$post['cpid'] = $rk['cpid'];
 				$post['cpbz'] = $rk['cpbz'];
-				//$post['rktype'] = $rktype;
+				$post['rktype'] = $rktype;
 				$warehouse = $this->warehouse->read($rk['warehouse']);
 				if ($warehouse['bdck'] == '') {
 					echo json_encode(array('msg' => '此仓库没有设置现货,无法入库!', 'c' => 0, 'success' => false));
@@ -6379,6 +6380,19 @@ class Whlabel extends Start_Controller
 					echo json_encode(array('msg'=>'目前非特殊仓不能入库!','success'=>true));exit;
 				}
 				 **/
+				$this->whlabelscanlog->insert([
+					'shop'=>$rk['shop'],
+					'type'=>1,
+					'purchase'=>$rk['purchase'],
+					'sku'=>$rk['sku'],
+					'features'=>$rk['features'],
+					'title'=>$rk['title'],
+					'label'=>$rk['label'],
+					'warehouse'=>$rk['warehouse'],
+					'wlid'=>$rk['id'],
+					'num'=>$num,
+					'addtime'=>time()
+				]);
 				if ($j == $num) {
 					echo json_encode(array('msg' => '入库成功!', 'success' => true));
 					exit;
@@ -6587,9 +6601,9 @@ class Whlabel extends Start_Controller
 			}
 			$xzck = ($label['warehouse'] == '12') ? 'specialstock' : 'whlabel';
 			if (stripos($label['features'], '-126-') !== false) {
-				$ck = $this->$xzck->find_all("state = '0' and shop = '" . $label['shop'] . "' and number = '" . $label['number'] . "' and warehouse = '" . $label['warehouse'] . "' and zd = ''");
+				$ck = $this->$xzck->find_all("state = '0' and shop = '" . $label['shop'] . "' and number = '" . $label['number'] . "' and warehouse = '" . $label['warehouse'] . "' and ( zd = '' or zd is null )");
 			} else {
-				$ck = $this->$xzck->find_all("state = '0' and shop = '" . $label['shop'] . "' and number = '" . $label['number'] . "' and warehouse = '" . $label['warehouse'] . "' and purchase = '" . $label['purchase'] . "' and zd = ''");
+				$ck = $this->$xzck->find_all("state = '0' and shop = '" . $label['shop'] . "' and number = '" . $label['number'] . "' and warehouse = '" . $label['warehouse'] . "' and purchase = '" . $label['purchase'] . "' and ( zd = '' or zd is null ) ");
 			}
 			$j = 0;
 			if (count($ck) >= $num) {
@@ -6599,6 +6613,20 @@ class Whlabel extends Start_Controller
 						$j++;
 					}
 				}
+
+				$this->whlabelscanlog->insert([
+					'shop'=>$label['shop'],
+					'type'=>2,
+					'purchase'=>$label['purchase'],
+					'sku'=>$label['sku'],
+					'features'=>$label['features'],
+					'title'=>$label['title'],
+					'label'=>$label['label'],
+					'warehouse'=>$label['warehouse'],
+					'wlid'=>$label['id'],
+					'num'=>$num,
+					'addtime'=>time()
+				]);
 				if ($j == $num) {
 					echo json_encode(array('msg' => '出库成功!', 'success' => true));
 					exit;

+ 11 - 0
core/CoreApp/models/Model_whlabelscanlog.php

@@ -0,0 +1,11 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+class Model_whlabelscanlog extends Lin_Model 
+{
+	function __construct(){
+		parent::__construct();
+		$this->load->database();
+		$this->table = 'whlabelscanlog';
+		$this->load_table('whlabelscanlog');
+	}
+	
+}  //end class

+ 4 - 2
template/erp/whlabel_printrk.html

@@ -12,7 +12,9 @@
 <option value="5">退库入库</option>
 <option value="6">退货可用入库</option>
 <option value="7">形态转换入库</option>
-</select>--><input style="vertical-align:middle;" value="" name="tmsku" id="tmsku" placeholder="点此处扫码" type="text"></span></p>
+</select>-->
+<input type="hidden" name="rktype" value="1">
+<input style="vertical-align:middle;" value="" name="tmsku" id="tmsku" placeholder="点此处扫码" type="text"></span></p>
 </div>
 <ul class="search">
 <li>类目:<select name="category" class="select">
@@ -137,7 +139,7 @@ $(document).keyup(function(event){
     $(".search .waybill").val("");
     $.ajax({
         url: dataurl,
-        data: "num=" + $("input[name='num']").val() + "&rktype=" + $("select[name='rktype']").children("option:selected").val() + "&tmsku=" + $("input[name='tmsku']").val(),
+        data: "num=" + $("input[name='num']").val() + "&rktype=" + $("input[name='rktype']").val() + "&tmsku=" + $("input[name='tmsku']").val(),
         type: "POST",
         dataType: "json",
         success: function(b)