Index: ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.jsp (revision 34038) @@ -0,0 +1,29 @@ +<%@page import="java.util.Date"%> +<%@page import="java.text.SimpleDateFormat"%> +<%@ page contentType="text/html; charset=UTF-8"%> +<%@page import="java.text.SimpleDateFormat"%> +<%@ include file="/common/taglibs.jsp"%> + + +<% + SimpleDateFormat dateFormat =new SimpleDateFormat("yyyy-MM-dd"); + request.setAttribute("newDate", dateFormat.format(new Date())); +%> +<%@ include file="/common/includeExtJsAndCss.jsp"%> +<%@ include file="/common/includeExtJs4_2.jsp"%> + +清洗耗材补充记录 + + + + + + + + \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/consumptiveMaterial/consumptiveMaterialAddRecord/view.js (revision 34038) @@ -0,0 +1,333 @@ +var listStore; + +function reloadGird(pageNowReal) { + var startDate = Ext4.getCmp('startDate').getRawValue(); + var endDate = Ext4.getCmp('endDate').getRawValue(); + var userId = Ext4.getCmp('userId').getValue(); + var consumptiveMaterialTypeId = Ext4.getCmp('consumptiveMaterialTypeId').getValue(); + var consumptiveMaterialContainerId = Ext4.getCmp('consumptiveMaterialContainerId').getValue(); + var washDisinfectRecordSerialNum = Ext4.getCmp('washDisinfectRecordSerialNum').getValue(); + treeStore.proxy.extraParams = { + startDate: startDate, + endDate: endDate, + userId: userId || '', + consumptiveMaterialTypeId: consumptiveMaterialTypeId || '', + consumptiveMaterialContainerId: consumptiveMaterialContainerId || '', + washDisinfectRecordSerialNum: washDisinfectRecordSerialNum || '', + pageNow: pageNowReal || 1 + }; + treeStore.reload(); +} + +function handlePagingButtonRequest(_this, e, eOpts) { + var pagCountInfo = Ext4.getCmp('pagCountInfo').text; + var pageNowReal = parseInt(Ext4.getCmp('pageNowReal').getValue()); + var pageCountReal = parseInt(Ext4.getCmp('pageCountReal').getValue()); + var buttonText = _this.text; + + if (!pagCountInfo) { + showResult("没数据"); + return false; + } + + if (buttonText == '第一页') { + if (pageNowReal == 1) { + showResult("已经是第一页了"); + return false; + } + pageNowReal = 1; + } else if (buttonText == '上一页') { + --pageNowReal; + if (pageNowReal < 1) { + showResult("已经是第一页了"); + return false; + } + } else if (buttonText == '下一页') { + ++pageNowReal; + if (pageNowReal > pageCountReal) { + showResult("已经是最后一页了"); + return false; + } + } else if (buttonText == '最后一页') { + if (pageNowReal == pageCountReal) { + showResult("已经是最后一页了"); + return false; + } + pageNowReal = pageCountReal + } + + reloadGird(pageNowReal); +} + +Ext4.onReady(function () { + Ext4.QuickTips.init(); + //耗材种类 + var typeStore = new top.Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/consumptiveMaterialTypeAction!loadConsumptiveMaterialTypes.do', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] + }); + typeStore.load(); + //操作员 + var userJsonStore = new top.Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/systemmanage/user/loadUserByDepartmentCode!loadUserByDepartmentCode.do', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] + }); + //清洗机 + var rinserStore = new top.Ext4.data.Store({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/consumptiveMaterialContainerAction!loadConsumptiveMaterialContainer.do', + reader: { + root: 'data' + } + }, + fields: [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' } + ] + }); + var width = Ext4.getBody().dom.clientWidth; + var form = new Ext4.form.Panel({ + region: 'north', + frame: true, + border: 0, + title: '清洗耗材补充记录', + bodyPadding: '5 5 0', + autoScroll: true, + buttonAlign: 'center', + fieldDefaults: { + labelAlign: 'right', + labelWidth: 70 + }, + width: width, + items: [{ + height: 60, + width: '100%', + layout: 'column', + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + layout: 'form', + columnWidth: .25, + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + xtype: 'datefield', + border: 0, + fieldLabel: '开始时间', + id: 'startDate', + name: 'startDate', + format: 'Y-m-d', + allowBlank: false, + editable: false, + anchor: '95%', + value: new Date(startDate) + }] + }, { + layout: 'form', + columnWidth: .25, + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + xtype: 'datefield', + border: 0, + fieldLabel: '结束时间', + id: 'endDate', + name: 'endDate', + format: 'Y-m-d', + allowBlank: false, + editable: false, + anchor: '95%', + value: new Date(startDate) + }] + }, { + layout: 'form', + columnWidth: .25, + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + xtype: 'combo', + id: 'userId', + name: 'userId', + queryParam: 'spell', + fieldLabel: '操作员', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: userJsonStore, + pageSize: 50, + forceSelection: true, + lazyInit: true, + anchor: '95%', + listWidth: 300, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true + }] + }, { + layout: 'form', + columnWidth: .25, + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + xtype: 'combo', + labelWidth:120, + fieldLabel: '清洗机容器名称', + id: 'consumptiveMaterialContainerId', + name: 'consumptiveMaterialContainerId', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: rinserStore, + forceSelection: true, + lazyInit: false, + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: true + }] + }, { + layout: 'form', + columnWidth: .25, + bodyStyle: { background: '#EBF5EC', border: 0 }, + items: [{ + xtype: 'combo', + fieldLabel: '耗材种类', + id: 'consumptiveMaterialTypeId', + name: 'consumptiveMaterialTypeId', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: typeStore, + forceSelection: true, + lazyInit: false, + editable: false, + triggerAction: 'all', + typeAhead: false, + allowBlank: true + }] + }], + }], + buttons: [{ + text: '查询', + handler: function () { + var startDate = Ext4.getCmp('startDate').getRawValue(); + var endDate = Ext4.getCmp('endDate').getRawValue(); + var userId = Ext4.getCmp('userId').getValue(); + var consumptiveMaterialTypeId = Ext4.getCmp('consumptiveMaterialTypeId').getValue(); + var consumptiveMaterialContainerId = Ext4.getCmp('consumptiveMaterialContainerId').getValue(); + listStore.proxy.extraParams = { + startDate: startDate, + endDate: endDate, + userId: userId || '', + consumptiveMaterialTypeId: consumptiveMaterialTypeId || '', + consumptiveMaterialContainerId: consumptiveMaterialContainerId || '' + }; + listStore.reload(); + } + }, { + text: '重置', + handler: function () { + Ext4.getCmp('userId').setValue(''); + Ext4.getCmp('consumptiveMaterialTypeId').setValue(''); + Ext4.getCmp('consumptiveMaterialContainerId').setValue(''); + Ext4.getCmp('startDate').setRawValue(startDate); + Ext4.getCmp('endDate').setRawValue(startDate); + } + }] + }); + + var columns = [ + { header: "id", dataIndex: 'id', hidden: true }, + { header: "操作时间", dataIndex: 'operationDateTime', width: 150 }, + { header: "操作员", dataIndex: 'operator', width: 80 }, + { header: "清洗机容器名称", dataIndex: 'containerName', width: 100 }, + { header: "耗材种类", dataIndex: 'typeName', width: 100 }, + { header: "耗材名称", dataIndex: 'disposableGoodsName', width: 200 }, + { header: "补充数量", dataIndex: 'disposableGoodsAddAmount', width: 80 }, + { header: "单位", dataIndex: 'disposableGoodsUnit', width: 80 }, + { header: "补充容量", dataIndex: 'addAmount', width: 100 }, + { header: "余量", dataIndex: 'totalAmount', width: 100 }, + { header: "容量单位", dataIndex: 'typeUnit', width: 80 }, + { header: "耗材批次号", dataIndex: 'batchNumber', width: 100 }, + { header: "备注", dataIndex: 'remark', sortable: false, width: 200 } + ]; + + listStore = new Ext4.data.JsonStore({ + proxy: { + type: 'ajax', + url: WWWROOT + '/disinfectSystem/consumptiveMaterialContainerAction!loadConsumptiveMaterialAddRecord.do', + reader: { + root: 'data', + totalProperty: 'rowCount' + }, + extraParams: {} + }, + fields: [ + { name: 'id' }, + { name: 'operationDateTime' }, + { name: 'operator' }, + { name: 'containerName' }, + { name: 'typeName' }, + { name: 'disposableGoodsName' }, + { name: 'disposableGoodsAddAmount' }, + { name: 'disposableGoodsUnit' }, + { name: 'addAmount' }, + { name: 'totalAmount' }, + { name: 'typeUnit' }, + { name: 'batchNumber' }, + { name: 'remark' } + ], + listeners: { + beforeload: function (thiz) { + var startDate = Ext4.getCmp('startDate').getRawValue(); + var endDate = Ext4.getCmp('endDate').getRawValue(); + listStore.proxy.extraParams.startDate = startDate; + listStore.proxy.extraParams.endDate = endDate; + } + } + }); + + listStore.loadPage(1); + + var listGrid = new Ext4.grid.GridPanel({ + columns: columns, + frame: false, + autoScroll: false, + store: listStore, + dockedItems: [{ + xtype: 'pagingtoolbar', + store: listStore, // same store GridPanel is using + dock: 'bottom', + displayInfo: true + }], + viewConfig: { + autoFill: true + } + }); + + new Ext4.container.Viewport({ + layout: 'border', + items: [form, { + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: [listGrid] + }] + }); + +}); \ No newline at end of file