浏览代码

修改车间进度查询

lvhao 11 小时之前
父节点
当前提交
1b83e75211
共有 2 个文件被更改,包括 36 次插入1 次删除
  1. 23 0
      core/CoreApp/controllers/Whlabel_bh.php
  2. 13 1
      template/erp/whlabel_bh_cj_transfer_log.html

+ 23 - 0
core/CoreApp/controllers/Whlabel_bh.php

@@ -122,6 +122,9 @@ class Whlabel_bh extends Start_Controller {
 		else if($arg == 'cj_transfer_detail'){
 			$this->_cj_transfer_detail($arg_array);
 		}
+		else if($arg == 'cj_transfer_log_count'){
+			$this->_cj_transfer_log_count();
+		}
 		else
 		{
 			 $this->_index();
@@ -2282,6 +2285,26 @@ class Whlabel_bh extends Start_Controller {
 
 	}
 
+	//针对车间的变动筛选条件的
+	public function _cj_transfer_log_count(){
+		$orderinfo = $this->input->post('orderinfo',true);
+		$tid = $this->input->post('tid',true);
+		$timetk = $this->input->post('timetk',true);
+		$timetj = $this->input->post('timetj',true);
+		$start_time = strtotime($timetk);
+		$end_time = strtotime($timetj);
+		$where = " lx = ".$tid." and type = 1 and is_over = 0 and time >= ".$start_time." and time <= ".$end_time;
+		if($orderinfo){
+			$number_list  = $this->whlabel_bh->find_all(" orderinfo = '$orderinfo'","orderinfo,number");
+			$numbers = array_column($number_list,'number');
+			$where.= " and number in (".implode(",",$numbers).") ";
+		}
+		
+		$wwcsl = $this->whlabel_bh_transfer_cr->find_count($where);
+
+		exit(json_encode(['code'=>1,'msg'=>'ok', 'data'=>['wwcsl' => $wwcsl]]));
+	}
+
 	public function _cj_transfer_detail($arg_array){
 		$number = $arg_array[0];
 		$tid = $arg_array[1];

+ 13 - 1
template/erp/whlabel_bh_cj_transfer_log.html

@@ -20,7 +20,7 @@
     <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;">未完成({$wwcsl})</font> 
+    <font class="cona " style="color:#fff;background-color: #f33;">未完成 <font id="wwcsl">{$wwcsl}</font>)</font> 
 </li>
 
 </ul>
@@ -79,6 +79,18 @@ $("select[name='transfer']").on("change",function(){
     $("input[name='tid']").val(tid);
     $("#dqbm").text($("select[name='transfer'] option:selected").text());
     $(".search span").click();
+    let formData = {
+        tid:tid,
+        orderinfo:$("input[name='orderinfo']").val(),
+        timetk:$("input[name='timetk']").val(),
+        timetj:$("input[name='timetj']").val()
+    }
+    $.post("/whlabel_bh/cj_transfer_log_count",formData,function(res){
+        if(res.code==1){
+            console.log(res.data.wwcsl);
+            $("#wwcsl").text(res.data.wwcsl);
+        }
+    },'json')
 })
 window.onload = function() { 
 if(typeof $("select[name='printer']").length < 1) return;