|
|
@@ -0,0 +1,243 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <meta charset="utf-8" />
|
|
|
+ <meta name="keywords" content="dongke,mes,ibossmes">
|
|
|
+ <meta name="description" content="制造企业生产过程执行管理系统">
|
|
|
+ <meta name="author" content="xuwei">
|
|
|
+ <title>东科软件</title>
|
|
|
+ <script src="/plugins/xeasyui/xeasyui.min.js"></script>
|
|
|
+ <link href="/plugins/xeasyui/toolbar.min.css" rel="stylesheet" />
|
|
|
+</head>
|
|
|
+<body class="easyui-layout">
|
|
|
+ <!--中部主体-->
|
|
|
+ <div id="toolbarLayout" data-options="border:false,region:'north',title:'',iconCls:'icon-grid'">
|
|
|
+ <!--工具条-->
|
|
|
+ <div id="tb" style="overflow: hidden;" class="i-toolbar" data-options="border:false,region:'north',title:'',iconCls:'icon-grid',height:210">
|
|
|
+ <a href="javascript:void(0)" id="btnSearch" title="搜索" class="easyui-linkbutton" iconcls="icon-search" plain="true" toggle="true" onclick="tbSearch()">搜索</a>
|
|
|
+ <a href="javascript:void(0)" id="btnExport" title="导出" class="easyui-linkbutton" iconcls="icon-excel" plain="true" onclick="tbExport()">导出</a>
|
|
|
+ <a href="javascript:void(0)" id="btnReload" title="刷新" class="easyui-linkbutton" iconcls="icon-reload" plain="true" onclick="tbReload()">刷新</a>
|
|
|
+ <div id="tbSearchDiv" style="display: block; padding: 10px;">
|
|
|
+ <form id="ffMaster">
|
|
|
+ <div>
|
|
|
+ 产成品交接时间:
|
|
|
+ <input class="easyui-datebox" id="datebeginMasterS" name="datebeginMasterS" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
|
|
|
+ -
|
|
|
+ <input class="easyui-datebox" id="datebeginMasterD" name="datebeginMasterD" data-options="required:false,prompt:'',tipPosition:'top'" style="width:165px; height:32px;">
|
|
|
+ 产品类型:
|
|
|
+ <input class="easyui-combotree" id="goodstypecode" name="goodstypecode" data-options="required:false,prompt:'',tipPosition:'top',url:'../../list.ashx?m=getGoodsType',method:'get',panelHeight:'200px',editable:true" style="width: 160px; height: 32px;"></span>
|
|
|
+ <span class="labelspan">产品条码<input class="easyui-textbox" id="barcode" name="barcode" data-options="required:false,prompt:'',tipPosition:'top',required:false" style="width: 120px; height: 32px;"></span>
|
|
|
+ <a href="javascript:void(0)" id="btnSearchSubmit" title="清空" class="easyui-linkbutton" plain="false" onclick="$('#ffMaster').form('clear')">清空</a>
|
|
|
+ <a href="javascript:void(0)" id="btnSearchSubmit" title="搜索" class="easyui-linkbutton" plain="false" onclick="tbSearchSubmit()">搜索</a>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div data-options="border:false,region:'center',title:'',iconCls:'icon-grid'">
|
|
|
+ <div id="tableTabs" class="easyui-tabs" data-options="border:false" style="width: 100%; height: 100%">
|
|
|
+ <div title="产品表">
|
|
|
+ <!--表格-->
|
|
|
+ <table class="easyui-datagrid"
|
|
|
+ id="DataGrid"
|
|
|
+ data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true,onDblClickRow: dgDblclickrow">
|
|
|
+ <thead>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div title="产品跟踪表">
|
|
|
+ <!--表格-->
|
|
|
+ <table class="easyui-datagrid"
|
|
|
+ id="DataGridMaster"
|
|
|
+ data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true">
|
|
|
+ <thead>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div title="产品信息表">
|
|
|
+ <table class="easyui-datagrid"
|
|
|
+ id="PropertyGridDetail"
|
|
|
+ data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true">
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div title="物料信息表">
|
|
|
+ <!--表格-->
|
|
|
+ <table class="easyui-datagrid"
|
|
|
+ id="DataGridMateriel"
|
|
|
+ data-options="method:'get',border:false,singleSelect:true,fit:true,fitColumns:true">
|
|
|
+ <thead>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <script type="text/javascript">
|
|
|
+
|
|
|
+ var pgColumns = [[
|
|
|
+ { field: 'name', title: '属性', width: '150px', sortable: true, align: 'left' },
|
|
|
+ { field: 'value', title: '值', width: '150px', resizable: false, align: 'left' }
|
|
|
+ ]];
|
|
|
+
|
|
|
+ function formatterUA(value, row, index) {
|
|
|
+ return Math.round(value * 10000) / 100 + '%';
|
|
|
+ }
|
|
|
+
|
|
|
+ $(document).ready(function () {
|
|
|
+ var ctime = new Date();
|
|
|
+ var beginDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + ctime.getDate();
|
|
|
+ var endDate = ctime.getFullYear() + "-" + (ctime.getMonth() + 1) + "-" + (ctime.getDate()+1);
|
|
|
+ $("#datebeginMasterS").datebox("setValue", beginDate);
|
|
|
+ $("#datebeginMasterD").datebox("setValue", endDate);
|
|
|
+
|
|
|
+ tbSearchSubmit();
|
|
|
+
|
|
|
+ });
|
|
|
+ //主表双击事件
|
|
|
+ function dgDblclickrow(index, row) {
|
|
|
+ $("#tableTabs").tabs("select", 1);
|
|
|
+ LoadDataGridDetail(index, row);
|
|
|
+ }
|
|
|
+ //加载子表数据
|
|
|
+ function LoadDataGridDetail(index, row) {
|
|
|
+ var barcode = row["产品条码"];
|
|
|
+ //产品追踪表
|
|
|
+ $('#DataGridMaster').datagridLoadRpt({
|
|
|
+ title: '',
|
|
|
+ idField: 'SID',
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=master&id=' + request('id') + '&barcodeDB=' + barcode,
|
|
|
+ fixWidth: 160,
|
|
|
+ mergeWidth: 100,
|
|
|
+ splitChar: '_',
|
|
|
+ columnMenu: '#btnColumnMenu',
|
|
|
+ columnMoving: true
|
|
|
+ });
|
|
|
+ //产品属性表
|
|
|
+ $('#PropertyGridDetail').propertygrid({
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=property&barcodeDB=' + barcode,
|
|
|
+ method: 'get',
|
|
|
+ columns: pgColumns,
|
|
|
+ border: false,
|
|
|
+ showGroup: false,
|
|
|
+ scrollbarSize: 0
|
|
|
+ });
|
|
|
+ //物料信息表
|
|
|
+ $('#DataGridMateriel').datagridLoadRpt({
|
|
|
+ title: '',
|
|
|
+ idField: 'SID',
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=materiel&id=' + request('id') + '&barcodeDB=' + barcode,
|
|
|
+ fixWidth: 160,
|
|
|
+ mergeWidth: 100,
|
|
|
+ splitChar: '_',
|
|
|
+ columnMenu: '#btnColumnMenu',
|
|
|
+ columnMoving: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //搜索提交
|
|
|
+ function tbSearchSubmit() {
|
|
|
+ var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
|
|
|
+ var barcode = $('#barcode').textbox('getValue');
|
|
|
+
|
|
|
+ if ($('#ffMaster').form("validate")) {
|
|
|
+
|
|
|
+ if (index == 0) {
|
|
|
+ $('#DataGrid').datagridLoad({
|
|
|
+ title: '',
|
|
|
+ idField: 'SID',
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=goods&id=' + request('id'),
|
|
|
+ fixWidth: 160,
|
|
|
+ mergeWidth: 100,
|
|
|
+ splitChar: '_',
|
|
|
+ columnMenu: '#btnColumnMenu',
|
|
|
+ columnMoving: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if ((index == 0 || index == 1 || index == 2) && barcode.length>0) {
|
|
|
+ //产品追踪表
|
|
|
+ $('#DataGridMaster').datagridLoadRpt({
|
|
|
+ title: '',
|
|
|
+ idField: 'SID',
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=master&id=' + request('id'),
|
|
|
+ fixWidth: 160,
|
|
|
+ mergeWidth: 100,
|
|
|
+ splitChar: '_',
|
|
|
+ columnMenu: '#btnColumnMenu',
|
|
|
+ columnMoving: true
|
|
|
+ });
|
|
|
+ //产品属性表
|
|
|
+ $('#PropertyGridDetail').propertygrid({
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=property',
|
|
|
+ method: 'get',
|
|
|
+ columns: pgColumns,
|
|
|
+ border: false,
|
|
|
+ showGroup: false,
|
|
|
+ scrollbarSize: 0
|
|
|
+ });
|
|
|
+ //物料信息表
|
|
|
+ $('#DataGridMateriel').datagridLoadRpt({
|
|
|
+ title: '',
|
|
|
+ idField: 'SID',
|
|
|
+ queryParams: $('#ffMaster').serializeJson(),
|
|
|
+ url: 'rpt.ashx?m=materiel&id=' + request('id'),
|
|
|
+ fixWidth: 160,
|
|
|
+ mergeWidth: 100,
|
|
|
+ splitChar: '_',
|
|
|
+ columnMenu: '#btnColumnMenu',
|
|
|
+ columnMoving: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //导出
|
|
|
+ function tbExport() {
|
|
|
+ var index = $('#tableTabs').tabs('getTabIndex', $('#tableTabs').tabs('getSelected'));
|
|
|
+ var title = $('#tableTabs').tabs('getTab', index).panel('options').title;//表格名称
|
|
|
+ var id = "DataGridMaster";
|
|
|
+ if (index == 1) {
|
|
|
+ id = "PropertyGridDetail";
|
|
|
+ }
|
|
|
+ //加载表头
|
|
|
+ var fields = $('#'+id).datagrid('getColumnFields');
|
|
|
+ var headers = [];
|
|
|
+ for (var i = 0; i < fields.length; i++) {
|
|
|
+ //headers.push($('#DataGridMaster').datagrid('getColumnOption', fields[i])['title']);
|
|
|
+ headers.push(fields[i]);
|
|
|
+ }
|
|
|
+ $('#' + id).datagridExport({
|
|
|
+ headers: headers,
|
|
|
+ fileName: '导出数据(' + title + ').xls',
|
|
|
+ workSheet: '导出数据(' + title + ')'
|
|
|
+ });
|
|
|
+ //导出多sheet
|
|
|
+ //$.dataGridToExcel(
|
|
|
+ // ['DataGridMaster', 'PropertyGridDetail'],
|
|
|
+ // ['产品跟踪表', '产品信息'],
|
|
|
+ // "导出数据(产品跟踪表).xls"
|
|
|
+ //);
|
|
|
+ }
|
|
|
+
|
|
|
+ //搜索按钮
|
|
|
+ function tbSearch() {
|
|
|
+ $('#tbSearchDiv').toggle();
|
|
|
+ $('#toolbarLayout').panel('resize', { height: 'auto' });
|
|
|
+ $('body').layout('resize');
|
|
|
+ $('#tableTabs').tabs('resize');
|
|
|
+ }
|
|
|
+
|
|
|
+ //刷新
|
|
|
+ function tbReload() {
|
|
|
+ tbSearchSubmit();
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|