Index: ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.js =================================================================== diff -u -r37289 -r38161 --- ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.js (.../instrumentRoomGoodsManagement.js) (revision 37289) +++ ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.js (.../instrumentRoomGoodsManagement.js) (revision 38161) @@ -299,6 +299,40 @@ document.location.href = url; } +//ZSYY-361:获取服务器时间 +function getTimeComboData() { + var dateHelper = new DateHelper(); + var applyDateDataArray = []; + var format = 'yyyy-MM-dd HH:mm'; + var url = WWWROOT + '/system/serverTimeAction!getInvoicePlanComboTime.do'; + dateHelper.getServerTimeByJQ(format, Ext, url, function (result) { + var time = result.time; + applyDateDataArray.push(['今天', time.todayTime]); + applyDateDataArray.push(['近两天', time.yesterdayTodayTime]); + applyDateDataArray.push(['近三天', time.threeDayBeforeTodayTime]); + applyDateDataArray.push(['所有日期', 'all']); + applyDateDataArray.push(['指定日期', '']); + }); + return applyDateDataArray; +} + +//ZSYY-361:隐藏或显示时间控件 +function hideOrShowDateBox(isShow){ + if(isShow){ + Ext.getCmp('invoiceStartText').show(); + Ext.getCmp('invoiceStart').show(); + Ext.getCmp('invoiceEndText').show(); + Ext.getCmp('invoiceEnd').show(); + Ext.getCmp('invoiceBtn').show(); + }else { + Ext.getCmp('invoiceStartText').hide(); + Ext.getCmp('invoiceStart').hide(); + Ext.getCmp('invoiceEndText').hide(); + Ext.getCmp('invoiceEnd').hide(); + Ext.getCmp('invoiceBtn').hide(); + } +} + Ext.onReady(function() { Ext.QuickTips.init(); @@ -409,20 +443,123 @@ } }]; + var items = [{ + text: '发货时间:' + }, { + xtype: 'combo', + id: 'requestTimeQuantum', + name: 'requestTimeQuantum', + valueField: 'value', + displayField: 'key', + allowBlank: true, + editable: false, + width: 120, + mode: 'local', + store: new Ext.data.SimpleStore({ + data: getTimeComboData(), + fields: ['key', 'value'] + }), + forceSelection: true, + triggerAction: 'all', + listeners: { + select: function (combo, record, index) { + var value = combo.getValue(); + if(value == 'all'){ + $Id('parm_s_invoiceStart').value = ''; + $Id('parm_s_invoiceEnd').value = ''; + grid.dwrReload(); + hideOrShowDateBox(false); + }else if(value == ''){ + hideOrShowDateBox(true); + }else { + $Id('parm_s_invoiceStart').value = value.split(';')[0]; + $Id('parm_s_invoiceEnd').value = value.split(';')[1]; + grid.dwrReload(); + hideOrShowDateBox(false); + } + } + }, + anchor: '95%' + }, { + text: '开始时间:', + id:'invoiceStartText' + }, { + xtype: 'datefieldWithMin', + id: 'invoiceStart', + name: 'invoiceStart', + width: 130, + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + selectOnFocus: true, + format: 'Y-m-d H:i', + theHours: 0, + theMinutes: 0 + }, { + text: '结束时间:', + id:'invoiceEndText' + }, { + xtype: 'datefieldWithMin', + width: 130, + id: 'invoiceEnd', + name: 'invoiceEnd', + altFormats: 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', + selectOnFocus: true, + format: 'Y-m-d H:i', + theHours: 23, + theMinutes: 59 + }, { + text: '查询', + minWidth: 50, + iconCls: 'icon_search', + id:'invoiceBtn', + handler: function () { + var invoiceStart = Ext.getCmp('invoiceStart').getRawValue(); + var invoiceEnd = Ext.getCmp('invoiceEnd').getRawValue(); + if (invoiceStart !== '' && invoiceEnd !== '') { + if(!compareDate(invoiceStart,invoiceEnd)){ + showResult("开始时间不能设置晚于结束时间"); + return; + } + $Id('parm_s_invoiceStart').value = invoiceStart; + $Id('parm_s_invoiceEnd').value = invoiceEnd; + grid.dwrReload(); + } else { + showResult("时间不能为空!", null, sstsConfig.messagePauseTimeOnSterilizationRecordPage); + } + } + }]; + + var defaultValue = ''; + if(getTimeComboData() && getTimeComboData().length > 0){ + defaultValue = getTimeComboData()[2][1]; + $Id('parm_s_invoiceStart').value = defaultValue.split(';')[0]; + $Id('parm_s_invoiceEnd').value = defaultValue.split(';')[1]; + } + + var requestTbar = new Ext.Toolbar({ + items: items + }); + grid = new Ext.ux.ForgonPageGrid( { tbar : tbar, pageSize : 20, defaultSortField : '', title : entityName + '列表', defaultSortDirection : 'ASC', - isCheckboxSelectionModel : true, + isCheckboxSelectionModel : false, rememberSelected : false, isShowSearchField : true, columns : columns, plugins: filters, autoExpandColumn : 'tousseName', renderTo : 'gridDiv', - frame : false + frame : false, + listeners: { + render: function (thisGrid) { + requestTbar.render(thisGrid.tbar); + Ext.getCmp('requestTimeQuantum').setValue(defaultValue); + hideOrShowDateBox(false); + } + } }, readerDetail, TousseInstanceTableManager.findInstrumentRoomGoodsList, null Index: ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.jsp =================================================================== diff -u -r37265 -r38161 --- ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.jsp (.../instrumentRoomGoodsManagement.jsp) (revision 37265) +++ ssts-web/src/main/webapp/disinfectsystem/toussemanager/instrumentGoodsManagement/instrumentRoomGoodsManagement.jsp (.../instrumentRoomGoodsManagement.jsp) (revision 38161) @@ -23,12 +23,14 @@ + + @@ -96,5 +98,9 @@ +