| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <extend name="$_admin_public_layout"/>
-
- <block name="main">
-
-
-
- <?php if (C('ADMIN_TABS')): ?>
- <!-- 多标签后台 -->
- <nav class="navbar navbar-default ct-tab-nav" role="navigation">
- <div class="collapse navbar-collapse">
- <ul class="nav navbar-nav navbar-left">
- <li><a href="#" id="tab-left"><i class="fa fa-caret-left"></i></a></li>
- </ul>
- <div class="ct-tab-wrap clearfix">
- <ul class="nav navbar-nav nav-close ct-tab">
- <li href="#home" role="tab" data-toggle="tab">
- <a href="#"><i class="fa fa-dashboard"></i> <span>首页</span></a>
- </li>
- </ul>
- </div>
- <ul class="nav navbar-nav navbar-right">
- <li><a href="#" id="tab-right"><i class="fa fa-caret-right"></i></a></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown">关闭操作 <b class="caret"></b></a>
- <ul class="dropdown-menu">
- <li><a href="#" class="close-all">关闭所有</a></li>
- </ul>
- </li>
- </ul>
- </div>
- </nav>
- <?php else: ?>
- <!-- 面包屑导航 -->
- <ul class="breadcrumb">
- <li><i class="fa fa-map-marker"></i></li>
- <li class="text-muted">大件</li>
- </ul>
- <?php endif; ?>
- <!-- 多标签后台内容部分 -->
- <div data-options="region:'north',title:'批次信息',split:true" style="height: 300px;">
- <div id="supBthGridToolbar">
- <form id="searchBthForm" class="smShow">
- <table width=1000px style="white-space: nowrap;border-collapse:separate; border-spacing:0px 5px;">
- <tr>
- <td align="right">
- 标签代码:
- </td>
- <td colspan="3">
- <input name="sqrcd" class="easyui-textbox" style="width:403px" type="text"/>
- </td>
- <td align="right">
- 标签标识:
- </td>
- <td>
- <input name="scd" class="easyui-validatebox" style="width:150px;" type="text" data-options="validType:'reqLength[8]'"/>
- </td>
- <td align="right">
- 标签类型:
- </td>
- <td>
- <select id="tgTp" name="tgTp" style="width:150px;"></select>
- </td>
- <tr/>
- <tr>
- <td align="right">
- 一级产品分类:
- </td>
- <td width="150px" id="aadd">
- <select id="sysUserCdOne" name="sysUserCdOne" style="width:150px;"></select> 
- </td>
- <td align="right">
- 二级产品分类:
- </td>
- <td width="150px">
- <select id="sysUserCdTwo" name="sysUserCdTwo" style="width:150px;"></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="center">
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="searchBthFun()">查询</a>
- </td>
- <tr/>
- </table>
- </form>
- <div style="margin:10px;">
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-QRCode',plain:true" onclick="rePrintFun(2)">批次补打</a>
- <!-- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-delete',plain:true" onclick="delTgFun()">删除标签</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>
- <div style="margin:10px;">
- <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true" onclick="rePrintFun(1)">标签补打</a>
- </div>
-
- </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>
-
-
-
- <script src="__PUBLIC__/libs/guide/bootstrap-tour.js"></script>
- <script src="__PUBLIC__/libs/My97DatePicker/WdatePicker.js"></script>
- <script src="__PUBLIC__/libs/guide/guide_index.js?_t=2016121401"></script>
- <script>
- var supBthGrid,supTgGrid,printType;
- //定义serializeObject方法,序列化表单
- $.fn.serializeObject = function() {
- var o = {};
- var a = this.serializeArray();
- $.each(a, function() {
- if (o[this.name]) {
- if (!o[this.name].push) {
- o[this.name] = [ o[this.name] ];
- }
- o[this.name].push(this.value || '');
- } else {
- o[this.name] = this.value || '';
- }
- });
- return o;
- };
- Date.prototype.Format = function (fmt) { //author: meizz
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours(), //小时
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "S": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- }
- function splitEmVal(str){
- console.log(str);
- var n1 = str.indexOf("[");
- if( n1 >= 0 ){
- var n2 = str.indexOf("]");
- if( n2 > 1 ){
- return str.substr(n1+1,n2-1);
- }
- }
- return "";
- };
- $(document).ready(function(){
- supBthGrid=$('#supBthGrid').datagrid({
- url:'/index.php?s=/Admin/Qcode/ProductApi',
- 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:20,//初始化页面大小
- pageList:[20,30,50,100,500],// 初始化页面大小选择列表
- queryParams:$('#searchBthForm').serializeObject(),
- striped:true,
- columns:[[
- {field:'id',title:'产品id',sortable:true,width:300,hidden:true},
- {field:'product_name',title:'产品名称',sortable:true,width:300},
- {field:'labelcode',title:'标签类型',align:'center',sortable:false,width:100},
- {field:'product_batch',title:'生产批次',sortable:true,width:100},
- {field:'pack_time',title:'包装日期/生产日期',align:'center',sortable:true,width:150},
- {field:'product_num',title:'打印个数',align:'center',sortable:true,width:100},
- {field:'print_time',title:'打印日期',align:'center',sortable:true,width:150}
- ]],
- onClickRow:function(rowIndex, rowData){
- if($('#searchBthForm').form('validate')){
- var bthForm=$('#searchBthForm').serializeObject();
- var formData=new Object();
- formData.product_id = rowData.id;
- formData.labelcode=splitEmVal(rowData.labelcode);
- formData.lgBthId=rowData.lgBthId;
- formData.smBthId=rowData.smBthId;
- formData.sqrcd=bthForm.sqrcd;
- formData.scd=bthForm.scd;
- $('#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(){
- $.messager.alert('系统提示','数据加载错误,请刷新重试!','error');
- },
- onBeforeLoad:function(param){
- var selecteRow=$('#supBthGrid').datagrid('getSelected');
- $('#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());
- }
- }
-
- </script>
- </block>
|