lvhao 18 hodín pred
rodič
commit
80527f96ee

+ 34 - 4
core/CoreApp/controllers/Whlabel_bh.php

@@ -2282,9 +2282,25 @@ class Whlabel_bh extends Start_Controller {
 		$end_time = strtotime(date('Y-m-d')) + 24 * 60 * 60;
 		
 	
-		$wwcsl = $this->whlabel_bh_transfer_cr->find_count(" lx = ".$tid." and type = 1 and is_over = 0 and time >= ".$start_time." and time <= ".$end_time);
-
+		$log_list = $this->whlabel_bh_transfer_cr->find_all(" lx = ".$tid." and type = 1  and time >= ".$start_time." and time <= ".$end_time,"*","id desc");
+	
+		$wwcsl = $jszs = $wgzs = 0;
+		$tmp_list = [];
+		foreach($log_list as $k=>$v){
+			if(!isset($tmp_list[$v['fid']])){
+				$tmp_list[$v['fid']] = $v;
+				$jszs += 1;
+				if($v['is_over'] == 1){
+					$wgzs += 1;
+				}else{
+					$wwcsl += 1;
+				}
+			}
+		}
+		 
 		$this->data['wwcsl'] = $wwcsl;
+		$this->data['jszs'] = $jszs;
+		$this->data['wgzs'] = $wgzs;
 		$this->data['transfer_list'] = $transfer_list;
 
 		$this->_Template('whlabel_bh_cj_transfer_log',$this->data);
@@ -2306,9 +2322,23 @@ class Whlabel_bh extends Start_Controller {
 			$where.= " and number in (".implode(",",$numbers).") ";
 		}
 		
-		$wwcsl = $this->whlabel_bh_transfer_cr->find_count($where);
+		$log_list = $this->whlabel_bh_transfer_cr->find_all($where);
+		$wwcsl = $jszs = $wgzs = 0;
+		$tmp_list = [];
+		foreach($log_list as $k=>$v){
+			if(!isset($tmp_list[$v['fid']])){
+				$tmp_list[$v['fid']] = $v;
+				$jszs += 1;
+				if($v['is_over'] == 1){
+					$wgzs += 1;
+				}else{
+					$wwcsl += 1;
+				}
+			}
+		}
+		 
 
-		exit(json_encode(['code'=>1,'msg'=>'ok', 'data'=>['wwcsl' => $wwcsl]]));
+		exit(json_encode(['code'=>1,'msg'=>'ok', 'data'=>['wwcsl' => $wwcsl,'jszs'=>$jszs,'wgzs'=>$wgzs]]));
 	}
 
 	public function _cj_transfer_detail($arg_array){

+ 10 - 2
template/erp/whlabel_bh_cj_transfer_log.html

@@ -20,9 +20,14 @@
     <input type="hidden" name="tid" value="{$transfer['id']}">
 <li><span>确 定</span></li>
 <li style="margin-right: 30px;">
-    <font class="cona " style="color:#fff;background-color: #f33;">未完成 (<font id="wwcsl">{$wwcsl}</font>)</font> 
+    <font class="cona " style="color:#fff;background-color: #f33;">在库数量 (<font id="wwcsl">{$wwcsl}</font>)</font> 
+</li>
+<li style="margin-right: 30px;">
+    <font class="cona " style="color:#fff;background-color: #f33;">接收总数 (<font id="jszs">{$jszs}</font>)</font> 
+</li>
+<li style="margin-right: 30px;">
+    <font class="cona " style="color:#fff;background-color: #f33;">完工总数 (<font id="wgzs">{$wgzs}</font>)</font> 
 </li>
-
 </ul>
 
 <table class="datatitle data" border="0" style="border-collapse:collapse;">
@@ -90,7 +95,10 @@ $("select[name='transfer']").on("change",function(){
     $.post("/whlabel_bh/cj_transfer_log_count",formData,function(res){
         if(res.code==1){
             console.log(res.data.wwcsl);
+           
             $("#wwcsl").text(res.data.wwcsl);
+            $("#jszs").text(res.data.jszs);
+            $("#wgzs").text(res.data.wgzs);
         }
     },'json')
 })