| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>打码统计</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="ctx" content="" />
- <link rel="stylesheet" type="text/css" href="/static/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="/static/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="/static/styles/demo.css">
- <link rel="stylesheet" type="text/css" href="/static/uploadify/uploadify.css">
- <script type="text/javascript" src="/static/basejs/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="/static/easyui/jquery.easyui.min.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-lang-zh_CN.js"></script>
- <script type="text/javascript" src="/static/uploadify/jquery.uploadify.js"></script>
- <script type="text/javascript" src="/static/basejs/th.js"></script>
- <script type="text/javascript" src="/static/easyui/formatter.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-extend.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-validatebox-extend.js"></script>
- <script type="text/javascript" src="/static/easyui/easyui-loading.js"></script>
- <script type="text/javascript" src="../../static/basejs/jquery.qrcode.min.js"></script>
- <script type="text/javascript" src="../../static/basejs/printLabel.js"></script>
- </head>
- <body class="easyui-layout">
- <div data-options="region:'north',title:'批次信息',split:true" style="height: 500px;">
- <div id="supBthGridToolbar">
- <form id="searchBthForm" class="smShow">
- <table width=1000px style="white-space: nowrap;">
- <tr>
- <td align="right">
- 生产批次:
- </td>
- <td align="left">
- <input name="sqrcd" class="easyui-validatebox" style="width:150px;height:22px;" type="text"/>
- </td>
- <td align="right">
- 产品名称:
- </td>
- <td>
- <select name="sysCdNm" style="height:30px;">
- <option value="0">全部</option>
- <volist name="list" id="val">
- <option value="{$val.id}">{$val.product_name}</option>
- </volist>
- </select>
- </td>
- <!-- <td align="right">-->
- <!-- 产品编号:-->
- <!-- </td>-->
- <!-- <td>-->
- <!-- <input name="scd" class="easyui-validatebox" style="width:150px;height:22px;" type="text" data-options="validType:'reqLength[8]'"/>-->
- <!-- </td>-->
- <!-- <td align="right">
- 标签类型:
- </td>
- <td>
- <select id="tgTp" name="tgTp" style="width:150px;height:30px;">
- <option value="1">大标签</option>
- <option value="2">小标签</option>
- </select>
- </td>-->
- <tr/>
- <!-- <tr>-->
- <!-- <td align="right">-->
- <!-- 一级产品分类:-->
- <!-- </td>-->
- <!-- <td width="150px" id="aadd">-->
- <!-- <select id="sysUserCdOne" name="sysUserCdOne" style="width:150px;height:30px;">-->
- <!-- <volist name="toplist" id="vo">-->
- <!-- <option value="{$i-1}">{$vo}</option>-->
- <!-- </volist>-->
- <!-- </select> -->
- <!-- </td>-->
- <!-- <td align="right">-->
- <!-- 二级产品分类:-->
- <!-- </td>-->
- <!-- <td width="150px">-->
- <!-- <select id="sysUserCdTwo" name="sysUserCdTwo" style="width:150px;height:30px;">-->
- <!-- <option value="0">全部</option>-->
- <!-- </select> -->
- <!-- </td>-->
- <!--<td align="right">
- 产品名称:
- </td>
- <td>
- <input name="sysCdNm" class="easyui-textbox" style="width:150px;" type="text"/>
- </td>
- <td align="right">
- 生产批次:
- </td>
- <td>
- <input name="prodBth" class="easyui-textbox" style="width:150px" type="text"/>
- </td>-->
- <!-- <tr/>-->
- <tr>
- <td align="right">
- 开始时间:
- </td>
- <td>
- <input id ="startDate" name="startDate" class="easyui-datebox" style="width:150px" type="text" value="" data-options="editable:false"/>
- </td>
- <td align="right">
- 结束时间:
- </td>
- <td>
- <input id ="endDate" name="endDate" class="easyui-datebox" style="width:150px" type="text" value="" data-options="editable:false"/>
- </td>
- <!-- <td align="right">
- 包装/生产日期:
- </td>
- <td width="150px">
- <input id="prodDt" name="prodDt" class="easyui-datebox" style="width:150px;" type="text" data-options="editable:false"/>
- </td>-->
- <td colspan="2" align="left">
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="searchBthFun()">查询</a>
- </td>
- <tr/>
- </table>
- </form>
- <div class="panel-header" style="width: 1671px;"><div class="panel-title">总计发码量:{$total}</div>
- <div class="panel-tool">
- <a href="javascript:;" class="panel-tool-collapse" style="display: none;"></a>
- <a href="javascript:;" class="layout-button-up"></a>
- </div>
- </div>
- <div>
- <!-- <a href="#" style="color:#0fa2f1" class="easyui-linkbutton" data-options="iconCls:'icon-QRCode',plain:true" onclick="rePrintFun(2)">查看详情</a>-->
- <!-- <a href="#" style="color:#0fa2f1" class="easyui-linkbutton" data-options="iconCls:'icon-delete',plain:true" onclick="delTgFun()">导出excel</a>-->
- </div>
- </div>
- <table id="supBthGrid"></table>
- </div>
- <!--<div data-options="region:'center',title:'标签信息',split:true" >
- <div id="supTgGridToolbar">
- <form id="searchTgForm">
- <input name="tgTp" type="text" style="display: none;"/><!– 标签类型 –>
- <input name="product_id" type="text" style="display:none;">
- <input name="lgBthId" type="text" style="display: none;"/><!– 大批次ID –>
- <input name="smBthId" type="text" style="display: none;"/><!– 小批次ID –>
- <input name="sqrcd" type="text" style="display: none;"/>
- <input name="scd" type="text" style="display: none;"/>
- </form>
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true" onclick="rePrintFun(1)">标签补打</a>
- </div>
- <!– <table id=supTgGrid></table>–>
- </div>-->
- <div id="reptWin">
- <form id="reptForm" style="padding: 10px;">
- <input id="printType" name="printType" style="display: none;"/>
- 重复打印数量:<input id="reptQty" name="reptQty" data-options="required:true,validType:['int','minValue[1]','maxValue[10]']" class="easyui-validatebox"/>
- </form>
- </div>
- </body>
- </html>
- <script>
- $('#sysUserCdOne').change(function(){
- $('#sysUserCdTwo').html('');
- $sid=$(this).val();
- //alert($sid);
- $.ajax({
- url:"/index.php?s=/Admin/Qcode/MaterialTwoApi",
- type:'get',
- dataType:'json',
- data:'id='+$sid,
- success:function(data){
- var result='';
- for(var i in data){
- result+="<option value='"+i+"'>"+data[i]+"</option>";
- }
- $('#sysUserCdTwo').append(result);
- },
- error:function(){
- }
- });
- });
- function splitEmVal(str){
- var n1 = str.indexOf("[");
- if( n1 >= 0 ){
- var n2 = str.indexOf("]");
- if( n2 > 1 ){
- return str.substr(n1+1,n2-1);
- }
- }
- return "";
- };
- var supBthGrid,supTgGrid,printType;
- $(document).ready(function(){
- supBthGrid=$('#supBthGrid').datagrid({
- url:'/index.php?s=/Admin/Qcode/DamaCountApi',
- method:'get',
- toolbar:'#supBthGridToolbar',
- rownumbers : true, // 如果为true,则显示一个行号列。
- singleSelect : true, // 如果为true,则只允许选择一行。
- nowrap : false, // 如果为true,则在同一行中显示数据。设置为true可以提高加载性能。
- fit : true, // datagrid自适应宽高
- fitColumns : true, // 使列自动展开/收缩到合适的数据表格宽度。
- autoRowHeight : false, // 定义设置行的高度,根据该行的内容。设置为false可以提高负载性能。
- pagination : true, // 显示分页工具条
- sortName:'crtDt', // 排序字段
- sortOrder:'desc', // 排序方式
- pageSize:10,//初始化页面大小
- pageList:[10,20,30,50,100,500],// 初始化页面大小选择列表
- queryParams:$('#searchBthForm').serializeObject(),
- columns:[[
- {field:'id',title:'产品id',align:'center',sortable:true,width:150,hidden:true},
- {field:'bach_num',title:'生产批次',align:'center',sortable:true,width:150},
- {field:'matter_no',title:'产品编号',align:'center',sortable:false,width:100},
- {field:'matter_name',title:'产品名称',align:'center',sortable:true,width:300},
- // {field:'label_type',title:'标签类型',align:'center',sortable:true,width:150},
- {field:'largeTotal',title:'大标签发码量',align:'center',sortable:true,width:100},
- {field:'smallTotal',title:'小标签发码量',align:'center',sortable:true,width:100},
- {field:'matter_size',title:'产品规格',align:'center',sortable:true,width:150},
- ]],
- onClickRow:function(rowIndex, rowData){
- //console.log(rowData);
- if($('#searchBthForm').form('validate')){
- var bthForm=$('#searchBthForm').serializeObject();
- var formData=new Object();
- formData.product_id = rowData.id;
- $('#searchTgForm').form('load',formData);
- supTgGrid.datagrid('load',$('#searchTgForm').serializeObject());
- }
- },
- onLoadError:function(){
- $.messager.alert('系统提示','数据加载错误,请刷新重试!','error');
- },
- onBeforeLoad:function(param){
- if(supBthGrid!=null){
- supBthGrid.datagrid('loadData',{total:0,rows:[]});
- }
- if(supTgGrid!=null){
- supTgGrid.datagrid('loadData',{total:0,rows:[]});
- }
- return true;
- }
- });
- /*supTgGrid=$('#supTgGrid').datagrid({
- url:'index.php?s=/Admin/Qcode/PrintListApi',
- method:'get',
- toolbar:'#supTgGridToolbar',
- rownumbers : true, // 如果为true,则显示一个行号列。
- //singleSelect : false, // 如果为true,则只允许选择一行。
- nowrap : false, // 如果为true,则在同一行中显示数据。设置为true可以提高加载性能。
- fit : true, // datagrid自适应宽高
- fitColumns : true, // 使列自动展开/收缩到合适的数据表格宽度。
- autoRowHeight : false, //定义设置行的高度,根据该行的内容。设置为false可以提高负载性能。
- pagination : true, // 显示分页工具条
- sortName:'sqrcd', // 排序字段
- sortOrder:'asc', // 排序方式
- pageSize:20,//初始化页面大小
- pageList:[20,30,50,100,500],// 初始化页面大小选择列表
- columns:[[
- {field:'ck',checkbox:true},
- {field:'labelcode',title:'标签代码',align:'center',sortable:true,width:250},
- {field:'print_time',title:'打印时间',align:'center',sortable:true,width:100},
- {field:'bd_num',title:'补打次数',align:'right',sortable:true,width:50},
- {field:'last_time',title:'最近补打时间',align:'center',sortable:true,width:100}
- ]],
- onLoadError:function(data){
- console.log(data);
- $.messager.alert('系统提示','数据加载错误,请刷新重试!','error');
- },
- onBeforeLoad:function(param){
- console.log(param);
- var selecteRow=$('#supBthGrid').datagrid('getSelected');
- console.log(selecteRow);
- $('#supTgGrid').datagrid('clearChecked');
- if(selecteRow==null){
- return false;
- }
- return true;
- }
- });*/
- //初始化日期输入框
- initDateBox();
- $('#reptWin').dialog({
- title: '确认对话框',
- width: 300,
- height: 130,
- closed: true,
- cache: false,
- modal: true,
- buttons:[{
- text:'打印',
- handler:function(){
- startPrint();
- $('#reptWin').window('close');
- }
- },{
- text:'取消',
- handler:function(){
- $('#reptWin').window('close');
- }
- }]
- });
- });
- //初始化日期输入框
- function initDateBox(){
- var nowDate=new Date;
- $('#endDate').datebox('setValue', nowDate.Format("yyyy-MM-dd"));
- nowDate.setMonth(nowDate.getMonth()-1);
- $('#startDate').datebox('setValue', nowDate.Format("yyyy-MM-dd"));
- }
- function searchBthFun(){
- if($('#searchBthForm').form('validate')){
- supBthGrid.datagrid('load',$('#searchBthForm').serializeObject());
- }
- }
- //删除标签
- function delTgFun(){
- var selectRow= supBthGrid.datagrid("getSelected");
- if(selectRow==null){
- $.messager.alert('系统提示','请先选择要删除的批次标签!','info');return;
- }
- $.messager.confirm('确认对话框', '您确定要删除整个批次的标签?', function(r){
- if (r){
- $('body').loading();
- var tgTp =splitEmVal(selectRow.tgTp);
- var bthId;
- if(tgTp=='1'){
- bthId = selectRow.lgBthId;
- }else if(tgTp=='2'){
- bthId = selectRow.smBthId;
- }else{
- $.messager.alert('系统提示','数据加载错误,请刷新重试!','error');return ;
- }
- var sysCdNm = selectRow.sysCdNm;
- var prodBth = selectRow.prodBth;
- $.post("index.php?s=/Admin/Qcode/delTg", {id : bthId,tgTp:tgTp}, function(response) {
- var result = eval('(' + response + ')');
- if (result.success) {
- //$.messager.alert('系统提示'," [ " + sysCdNm + " ( " + prodBth + " ) ] 批次的标签数据"+result.message,'info');
- $.messager.show({
- title:'系统消息',
- msg:result.message,
- timeout:5000,
- showType:'slide'
- });
- searchBthFun();
- }
- else{
- $.messager.alert('系统提示',result.message,'error');
- }
- $('body').loadend();
- });
- }
- });
- }
- //补打选择标签(type表示打印类型:1勾选补打,2选择批次补打)
- function rePrintFun(type){
- var confirmMsg="您确定要打印已选择标签?";
- if(type==2){
- confirmMsg="您确定要打印整个批次的标签?";
- var selected= supBthGrid.datagrid("getSelected");
- if(selected==null){
- $.messager.alert('系统提示','请先选择需要打印的批次!','info');return;
- }
- }else{
- var checked= supTgGrid.datagrid("getChecked");
- //console.log(checked);
- if(checked==null || checked.length==0){
- $.messager.alert('系统提示','请先勾选需要打印的标签!','info');return;
- }
- }
- $('#reptWin').window('open'); // open a window
- $('#reptForm').form('load',{'printType':type,'reptQty':1});
- }
- function searchTgFun(){
- supTgGrid.datagrid('load',$('#searchTgForm').serializeObject());
- }
- function startPrint(){
- if($('#reptForm').form('validate')){
- var reFormData=$('#reptForm').serializeObject();
- //startPrint();
- var bthRow=supBthGrid.datagrid('getSelected');
- //var tgTp=$("#tgTp").combobox("getValue");
- // var tgTp=splitEmVal(bthRow.tgTp);
- var idList=new Array();
- var chechRows=supTgGrid.datagrid('getChecked');
- for(var i in chechRows){
- idList.push(chechRows[i].id);
- }
- var reptQty=$('#reptQty').val();
- //console.log(idList.toString());
- $.ajax({
- url:"index.php?s=/Admin/Qcode/rePrintTg",
- type:"POST",
- dataType:"json",
- data : {
- "type" : reFormData.printType,
- "idList" : idList.toString(),
- "reptQty":reptQty
- },
- success:function(result) {
- //alert(result);
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- $.messager.alert('系统提示','数据加载错误,请刷新重试!','error');
- return false;
- }
- });
- }else{
- $.messager.alert('系统提示',"请正确输入重复打印次数!",'info');
- }
- }
- </script>
|