Index: ssts-web/src/main/webapp/homepage/supplyRoomOperate.js =================================================================== diff -u -r15794 -r16631 --- ssts-web/src/main/webapp/homepage/supplyRoomOperate.js (.../supplyRoomOperate.js) (revision 15794) +++ ssts-web/src/main/webapp/homepage/supplyRoomOperate.js (.../supplyRoomOperate.js) (revision 16631) @@ -64,65 +64,107 @@ function loadData(){ - var goodNmae = $Id('goodsSearch').value; + var goodName = $Id('goodsSearch').value; var tousseType = $Id('tousseType').value; var department = $Id('department').value; - var startDate= $Id('startDate').value; - var endDate= $Id('endDate').value; - + //ie下不加IDS也能找到对应的dom + var startDate= $Id('startDate' + IDS).value || $Id('startDate').value; + var endDate= $Id('endDate' + IDS).value || $Id('endDate').value; + //任务组的displayName + var taskGroup = Ext.getCmp('taskGroup').getRawValue(); + if(startDate == null || startDate == '' || endDate == null || endDate == ''){ showResult('查询时间有误,请正确选择查询时间。'); return false; } - + applicationStore.removeAll(); washStore.removeAll(); packingStore.removeAll(); reviewStore.removeAll(); sterilizationStore.removeAll(); invoicePlanStore.removeAll(); + + var queryParam1 = { + tousseName : goodName, + tousseType : tousseType, + startDate : startDate, + endDate : endDate, + taskGroup : taskGroup, + department : department + }; + var queryParam2 = { + tousseName : goodName, + tousseType : tousseType, + startDate : startDate, + endDate : endDate, + taskGroup : taskGroup + }; + loadStoreByParams(applicationStore, queryParam1); + loadStoreByParams(washStore, queryParam2); + loadStoreByParams(packingStore, queryParam2); + loadStoreByParams(reviewStore, queryParam2); + loadStoreByParams(sterilizationStore, queryParam2); + loadStoreByParams(invoicePlanStore, queryParam1); + // applicationStore.baseParams['tousseName'] = goodName; + // applicationStore.baseParams['tousseType'] = tousseType; + // applicationStore.baseParams['department'] = department; + // applicationStore.baseParams['startDate'] = startDate; + // applicationStore.baseParams['endDate'] = endDate; + // applicationStore.baseParams['taskGroup'] = taskGroup; + // applicationStore.load({params:{start: 0, limit: 10}}); - applicationStore.baseParams['tousseName'] = goodNmae; - applicationStore.baseParams['tousseType'] = tousseType; - applicationStore.baseParams['department'] = department; - applicationStore.baseParams['startDate'] = startDate; - applicationStore.baseParams['endDate'] = endDate; - applicationStore.load({params:{start: 0, limit: 10}}); + // washStore.baseParams['tousseName'] = goodName; + // washStore.baseParams['tousseType'] = tousseType; + // washStore.baseParams['startDate'] = startDate; + // washStore.baseParams['endDate'] = endDate; + // washStore.baseParams['taskGroup'] = taskGroup; + // washStore.load({params:{start: 0, limit: 10}}); + + // packingStore.baseParams['tousseName'] = goodName; + // packingStore.baseParams['tousseType'] = tousseType; + // packingStore.baseParams['startDate'] = startDate; + // packingStore.baseParams['endDate'] = endDate; + // packingStore.baseParams['taskGroup'] = taskGroup; + // packingStore.load({params:{start: 0, limit: 10}}); + + // reviewStore.baseParams['tousseName'] = goodName; + // reviewStore.baseParams['tousseType'] = tousseType; + // reviewStore.baseParams['startDate'] = startDate; + // reviewStore.baseParams['endDate'] = endDate; + // reviewStore.baseParams['taskGroup'] = taskGroup; + // reviewStore.load({params:{start: 0, limit: 10}}); + + // sterilizationStore.baseParams['tousseName'] = goodName; + // sterilizationStore.baseParams['tousseType'] = tousseType; + // sterilizationStore.baseParams['startDate'] = startDate; + // sterilizationStore.baseParams['endDate'] = endDate; + // sterilizationStore.baseParams['taskGroup'] = taskGroup; + // sterilizationStore.load({params:{start: 0, limit: 10}}); + + // invoicePlanStore.baseParams['tousseName'] = goodName; + // invoicePlanStore.baseParams['tousseType'] = tousseType; + // invoicePlanStore.baseParams['department'] = department; + // invoicePlanStore.baseParams['startDate'] = startDate; + // invoicePlanStore.baseParams['endDate'] = endDate; + // invoicePlanStore.baseParams['taskGroup'] = taskGroup; + // invoicePlanStore.load({params:{start: 0, limit: 10}}); - washStore.baseParams['tousseName'] = goodNmae; - washStore.baseParams['tousseType'] = tousseType; - washStore.baseParams['startDate'] = startDate; - washStore.baseParams['endDate'] = endDate; - washStore.load({params:{start: 0, limit: 10}}); - - packingStore.baseParams['tousseName'] = goodNmae; - packingStore.baseParams['tousseType'] = tousseType; - packingStore.baseParams['startDate'] = startDate; - packingStore.baseParams['endDate'] = endDate; - packingStore.load({params:{start: 0, limit: 10}}); - - reviewStore.baseParams['tousseName'] = goodNmae; - reviewStore.baseParams['tousseType'] = tousseType; - reviewStore.baseParams['startDate'] = startDate; - reviewStore.baseParams['endDate'] = endDate; - reviewStore.load({params:{start: 0, limit: 10}}); - - sterilizationStore.baseParams['tousseName'] = goodNmae; - sterilizationStore.baseParams['tousseType'] = tousseType; - sterilizationStore.baseParams['startDate'] = startDate; - sterilizationStore.baseParams['endDate'] = endDate; - sterilizationStore.load({params:{start: 0, limit: 10}}); - - invoicePlanStore.baseParams['tousseName'] = goodNmae; - invoicePlanStore.baseParams['tousseType'] = tousseType; - invoicePlanStore.baseParams['department'] = department; - invoicePlanStore.baseParams['startDate'] = startDate; - invoicePlanStore.baseParams['endDate'] = endDate; - invoicePlanStore.load({params:{start: 0, limit: 10}}); - } +/** + * 根据参数加载对应的store + * @param store 要加载的store + * @param queryParam 请求的参数 + */ +function loadStoreByParams(store, queryParam) { + var pageParam = {start: 0, limit: 10}; + Ext.apply(store.baseParams, queryParam); + store.load({params: pageParam}); +} + + function GetDateStr(AddDayCount,hh,mm) { var dd = new Date(); dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期 @@ -179,7 +221,25 @@ ] ) }); - + + //任务组store + var taskStore = new Ext.data.Store({ + hidden : !sstsConfig.isShowTaskGroup, + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/taskGroupAction!loadTaskGroupStore.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + root : 'data', + totalProperty: 'totalCount' + },[ + {name : 'id',mapping : 'valueField'}, + {name : 'taskGroupName',mapping : 'displayField'} + ] + ) + }); + + var startDate = new Date(); startDate.setHours(0,0,0); @@ -204,7 +264,7 @@ height : 40, labelWidth : 70, items : [{ - columnWidth : .3, + columnWidth : .18, layout : 'form', labelWidth : 60, items : [{ @@ -232,7 +292,7 @@ } }] },{ - columnWidth : .2, + columnWidth : .15, layout : 'form', labelWidth : 60, items : [{ @@ -258,9 +318,36 @@ } } }] - },{ - columnWidth : .25, + columnWidth : .15, + layout : 'form', + labelWidth : 60, + items : [{ + xtype : 'combo', + id : 'taskGroup', + name : 'taskGroup', + hidden : !sstsConfig.isShowTaskGroup, + queryParam : 'spell', + fieldLabel : '任务组', + minChars : 0, + valueField : 'id', + displayField : 'taskGroupName', + anchor : '95%', + listWidth : 150, + store : taskStore, + lazyInit : true, + triggerAction : 'all', + hideTrigger : true, + typeAhead : false, + allowBlank : true, + listeners : { + select : function(combo, record, index) { + // Ext.getCmp('department').setValue(record.data.name); + } + } + }] + },{ + columnWidth : .18, layout : 'form', labelWidth : 60, items : [{ @@ -288,7 +375,7 @@ } }] },{ - columnWidth : .25, + columnWidth : .18, layout : 'form', labelWidth : 60, items : [{