소스 검색

添加未打印界面

lvhao 17 시간 전
부모
커밋
2787cef050
2개의 변경된 파일374개의 추가작업 그리고 0개의 파일을 삭제
  1. 123 0
      core/CoreApp/controllers/Whlabel_bh.php
  2. 251 0
      template/erp/whlabel_bhwdy.html

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

@@ -128,6 +128,9 @@ class Whlabel_bh extends Start_Controller {
 		else if($arg == 'excelwchz'){
 			$this->_excelwchz();
 		}
+		else if($arg == 'wdyindex'){
+			$this->_wdyindex();
+		}
 		else
 		{
 			 $this->_index();
@@ -326,6 +329,126 @@ class Whlabel_bh extends Start_Controller {
 		$this->data['vip'] = $user['vip'];
 		$this->_Template('whlabel_bh',$this->data);
 	}
+
+
+	public function _wdyindex(){
+		$post = $this->input->post(NULL, TRUE);
+		if(isset($post['page']))  
+		{
+		    $page = $this->input->post('page',true);
+		    $perpage = $this->input->post('perpage',true);
+			$orderinfo = $this->input->post('orderinfo',true);
+			$jm = $this->input->post('jm',true);
+			$title = $this->input->post('title',true);
+			$pm = $this->input->post('pm',true);
+			$category = $this->input->post('category',true);
+			$size = $this->input->post('size',true);
+			$grade = $this->input->post('grade',true);
+			$color = $this->input->post('color',true);
+			$lowe = $this->input->post('lowe',true);
+			$type = $this->input->post('type',true);
+			$shipremarks = $this->input->post('shipremarks',true);
+			$timetk = $this->input->post('timetk',true);
+			$timetj = $this->input->post('timetj',true);
+			$timetk = strtotime($timetk);
+			$timetj = strtotime($timetj);
+			$where = " bhnum > printsl ";
+			if($timetk && $timetj)
+            {
+                $where .= " and time > '$timetk' and time < '$timetj'";
+            }
+			if($orderinfo)
+            {
+                $where  .= " and orderinfo like '%$orderinfo%'";
+            }
+			if($jm)
+            {
+                $where  .= " and jm like '%$jm%'";
+            }
+			if($title)
+            {
+                $where  .= " and title like '%$title%'";
+            }
+			if($pm)
+            {
+                $where  .= " and pm like '%$pm%'";
+            }
+			if($category)
+            {
+                $where  .= " and features like '%-$category-%'";
+            }
+			if($size)
+            {
+                $where  .= " and features like '%-$size-%'";
+            }
+			if($grade)
+            {
+                $where  .= " and features like '%-$grade-%'";
+            }
+			if($color)
+            {
+                $where  .= " and features like '%-$color-%'";
+            }
+			if($lowe)
+            {
+                $where  .= " and features like '%-$lowe-%'";
+            }
+			if($type)
+            {
+                $where  .= " and type = '$type'";
+            }
+			if($shipremarks)
+            {
+                $where  .= " and shipremarks like '%$shipremarks%'";
+            }
+            //数据排序
+            $order_str = "time desc";
+            if(empty($page))
+		    {
+                $start = 0;
+		    	$perpage = 1;
+            }
+		    else
+		    {
+                $start = ($page - 1)*$perpage;
+            }
+            //取得信息列表
+            $info_list = $this->whlabel_bh->find_all($where,'id,orderinfo,title,shipremarks,bhnum,printnum,num,printsl,time,extra_type',$order_str,$start,$perpage);
+			foreach ($info_list as $key=>$value) 
+		    {
+				$d = $this->whlabel_bh->read($value['id']);
+				$info_list[$key]['title'] =  "<font data-id='".$value['id']."' data-cz='0' class='whlabel_bh_cz'>".$d['jm'].'</font><br><strong style="color:#fc5454;font-weight: bold;">'.$d['pm'].'</strong><br>'.$value['title'];
+				$printnum = $this->whlabel_bh_transfer->find_all("number = '".$d['number']."'");
+				$printnum = array_sum(array_column($printnum,'ts'));
+				$info_list[$key]['printnum'] = $printnum;
+				$info_list[$key]['num'] = $value['bhnum']-$printnum;
+				$info_list[$key]['time'] = date('Y-m-d',$value['time']).'<br>'.date('H:i:s',$value['time']);
+				if($value['extra_type'] == 1){
+					$info_list[$key]['extra_type'] =  "<span data-id='".$value['id']."' data-num='".$value['bhnum']."' class='whlabel_bh_print'>打印布标</span>";
+				}else{
+					$info_list[$key]['extra_type'] = "";
+				}
+				
+		    }
+		    $total = $this->whlabel_bh->find_count($where);
+		    $pagenum = ceil($total/$perpage);
+		    $over = $total-($start+$perpage);
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
+		    echo json_encode($rows);exit;
+			
+		}
+
+		if(isset($_SESSION['api']))
+		{
+			$user = $this->user->get_api($_SESSION['api']);
+		}
+		else
+		{
+			header('Location: /');exit;
+		}
+	
+		$this->_Template('whlabel_bhwdy',$this->data);
+	}
 	
 	//入库操作
 	public function _add()

+ 251 - 0
template/erp/whlabel_bhwdy.html

@@ -0,0 +1,251 @@
+{Template header}
+<body>
+<div class="warp">
+<div class="fixed">
+<ul class="search">
+<li>类目:<select name="category" class="select">
+<option value="">请选择</option>{loop typeclass(16) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>长度:<select name="size" class="select">
+<option value="">请选择</option>{loop typeclass(14) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>等级:<select name="grade" class="select">
+<option value="">请选择</option>{loop typeclass(13) as $val}
+<option value="{$val['id']}">{$val['title']}</option>{/loop}</select></li>
+<li>颜色:<select name="color" class="select">
+<option value="">请选择</option>
+<option value="57">Natural Black</option>
+{loop typeclassyc(8) as $val} <!-- 这个是不显示部分颜色 -->
+{if $val['id'] != 57}
+<option value="{$val['id']}">{$val['title']}</option>
+{/if}
+{/loop}</select></li>
+<li>曲度:<select name="lowe" class="select">
+<option value="">请选择</option>
+{loop typeclassyc(15) as $val} <!-- 这个是不显示部分曲度 -->
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}
+</select></li>
+<li>SKU:<input value="" name="jm" type="text" style="width:200px"></li>
+<li>英文名称:<input value="" name="title" type="text" style="width:360px"></li>
+<li>中文名称:<input value="" name="pm" type="text" style="width:360px"></li>
+<li>标题:<input value="" name="orderinfo" type="text" style="width:260px"></li>
+<li>备注:<input value="" name="shipremarks" type="text" style="width:260px"></li>
+<li>添加日期:<input id="timetk"  value="{date('Y-m-d',time()-29*24*3600)} 0:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" style="width:130px">
+至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d',time()+24*3600)} 0:00" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})" style="width:130px"></li>
+<li><span>确 定</span></li>
+</ul>
+<!-- <div class="control">
+
+</div> -->
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
+<td>标题</td>
+<td>英文/中文</td>
+<td>备注</td>
+<td>备货</td>
+
+<td>已打</td>
+<td>未打</td>
+<td>记录已打</td>
+<td>添加时间</td>
+<td>打印</td>
+</tr>
+</table>
+</div>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+</table>
+<div class="bomf"></div>
+</div>
+<div style="display:none;">
+<input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
+</div>
+<div class="boundtj">
+<div>
+<p>调入仓库:<select name="warehouse" class="select">
+{loop warehouse(100) as $val}
+{if $val['id'] != 13 && $val['id'] != 3 && $val['id'] != 12 && $val['id'] != 16 && $val['id'] != 7 && $val['id'] != 8 && $val['id'] != 9}
+<option value="{$val['id']}">{$val['title']}</option>
+{/if}
+{/loop}
+</select></p>
+<p>调拨数量:<input value="" name="num" type="text" autocomplete="off"></p>
+<p style="color:#F00">注意:一旦操作将无法撤回,请仔细核对信息!</p>
+<p><font class="whlabel_ksdb">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<input value="" name="dbid" type="hidden">
+<div class="systemwindow">
+<div>
+<p><select name="printer" class="select" style="width:200px;margin-left:15px;"><option value="">请选择打印机</option></select></p>
+<p></p>
+<p><font class="button">确 定</font><font class="esc">取 消</font></p>
+</div>
+</div>
+<script type="text/javascript" src="{$theme}js/laydate.js"></script>
+<script type="text/javascript" src="{$theme}lodop/LodopFuncs.js"></script>
+<script type="text/javascript" src="{$theme}lodop/dolodop.js"></script>
+<script type="text/javascript" src="{$theme}js/jquery-barcode.min.js"></script>
+<script type="text/javascript" src="{$theme}js/print_bh.js?{time()}"></script>
+<script>
+var dataurl = "/whlabel_bh/wdyindex";var fdataurl = "/whlabel_bh/wdyindex";var excel = "/whlabel_bh/wdyindex";;
+// var editurl = "/whlabel_bh/edit/";
+// var editdj = 1;
+// var editt = "备货 - 修改";
+var customon = 1;
+function custom(){
+$(".data tr").each(function() {
+$(this).find('td:eq(1)').css("width","13%");
+$(this).find('td:eq(2)').css("width","40%");
+$(this).find('td:eq(3)').css("width","10%");
+$(this).find('td:eq(4)').css("width","4%");
+$(this).find('td:eq(5)').css("width","4%");
+$(this).find('td:eq(6)').css("width","4%");
+$(this).find('td:eq(7)').css("width","6%");
+$(this).find('td:eq(8)').css("width","8%");
+$(this).find('td:eq(9)').css("width","10%");
+});}
+//修改数量
+$(".systemwindow").on('click',".gz",function() {
+var num = $(this).parents(".num").find("font").text()*1;
+$(this).parents(".num").find("font").text(num+1)*1;
+	});
+$(".systemwindow").on('click',".gj",function() {
+var num = $(this).parents(".num").find("font").text()*1;
+if(num > 1)
+{
+$(this).parents(".num").find("font").text(num-1)*1;
+}
+	});
+$(".datatext").on('click',".whlabel_bh_print",function() {
+	var id = $(this).attr('data-id');
+	var num = $(this).attr('data-num');
+            $(".systemwindow div p:eq(1)").html('打印数量 :<input value="'+num+'" name="bbnum" style="width: 80px;height: 26px;color: #000;border: 1px #ccc solid;font-size: 13px;margin-right: 20px;text-align: center;color: #333;border-radius: 5px;" type="text">');
+            $(".systemwindow div p:eq(2)").html("<font data-id='"+id+"' id='whlabel_bh_ksprint'>打 印</font><font class='esc'>取 消</font>");
+            $(".systemwindow").show();
+});
+$(".systemwindow").on('click',"#whlabel_bh_ksprint",function() {
+	var d = $(this).data("id");
+	var n = $("input[name='bbnum']").val();
+	whlabelbhksprint(d,n);
+});
+$(".systemwindow").on('click',".esc",function() {
+ $(".systemwindow").hide();	
+});
+$(".pldrlh").click(function() {
+		if($(this).find("option:selected").val() != "")
+		{
+var me = $(this);
+$("#upload-file").click();
+$("#upload-file").unbind("change");
+$("#upload-file").bind("change",function(){
+uploadFilepldrlh(me);
+	layx.load('loadId','导入中,请稍后',{shadable:0.6});
+});
+		}
+});
+
+function uploadFilepldrlh(me){
+var file = document.getElementById("upload-file").files[0];
+var data = new FormData();
+data.append("userfile",file);
+$.ajax({
+data : data,
+type : "POST",
+url : "/whlabel_bh/xxpl",
+timeout: 1200000,
+cache : false,
+contentType : false,
+processData : false,
+dataType:"json",
+success: function(a) {
+	 layx.destroy('loadId');
+            if (a && a.success) {
+				 if(a.error == 1)
+				 {
+					 errora(a);
+				 }
+				 else
+				 {
+					  errorb(a);
+				 }
+            } else {
+				errorc(a);
+            }
+        },
+error: function (XMLHttpRequest,textStatus) {
+	 console.log(XMLHttpRequest);  //XMLHttpRequest.responseText    XMLHttpRequest.status   XMLHttpRequest.readyState
+            console.log(textStatus);
+					$(".express").hide();
+                 layx.alert('错误','请求超时!请查看是否成功!',function(id,button){
+  $(".search span").click();
+},{dialogIcon:'error'});
+            },
+    });
+}
+/*******************************打印相关信息*********************************************/
+
+//获取打印机列表
+let lodop;
+let printers = [];//打印机列表
+//获取打印机列表
+function getPrinterList(){
+    lodop=getLodop();
+    var result = lodop.GET_PRINTER_COUNT(); // 获取打印机数量
+    let print_str = "";
+    let print_name = "";
+    for (var i = 1; i <= result; i++) {
+        print_name = lodop.GET_PRINTER_NAME(i)
+        printers.push(print_name); // 获取每个打印机的名称
+        print_str += "<option value='"+i+"'>"+print_name+"</option>"
+    }
+    if(printers.length <= 0){
+        alert("请到检查打印机是否连接正确")
+    }
+    
+    $("select[name='printer']").append(print_str)
+}
+
+setTimeout(() => {
+    getPrinterList()
+}, 1000);
+
+function whlabelbhksprint(d,n) {//外购
+	if ($("select[name='printer']").children("option:selected").val() == "") {
+				$(".ts p").html("请选择打印机!");
+				$(".ts").show();
+				setTimeout('$(".ts").fadeOut()', 1000);
+				return;
+	} 
+	layx.load('loadId','操作中,请稍后',{shadable:0.6});
+	$.ajax({
+		url: dataurl+"bbprint/",
+		data: "d="+d+"&n="+n,
+		type: "POST",
+		dataType: "json",
+		success: function(a) {
+			$(".systemwindow").hide();
+			layx.destroy('loadId');
+			if (a && a.success) {
+				newbhbubiao(a['rows']);
+				$(".express p:eq(0)").html('打印完成');
+				$(".express p:eq(1)").html("<font class='printfh' data-id='"+a.id+"'>确 定</font>");
+				$(".express").show();
+				return;
+			} else {
+				layx.alert('错误',a.msg,function(a,msg){
+					},{dialogIcon:'error'});
+			}
+		}
+	});
+};
+
+
+window.onload = function() { 
+	if(typeof $("select[name='printer']").length < 1) return;
+	//setTimeout(function(){ wprinter.printer()},1000);
+};
+</script>
+
+{Template footer}