Index: ssts-web/src/main/webapp/ext/js/multiSelectCombo.js =================================================================== diff -u --- ssts-web/src/main/webapp/ext/js/multiSelectCombo.js (revision 0) +++ ssts-web/src/main/webapp/ext/js/multiSelectCombo.js (revision 16228) @@ -0,0 +1,213 @@ +if ('function' !== typeof RegExp.escape) +{ + RegExp.escape = function (s) + { + if ('string' !== typeof s) + { + return s; + } + return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); + }; +} + +Ext.ns('Ext.form'); + +Ext.form.MultiSelect = Ext.extend(Ext.form.ComboBox, +{ + checkField: 'checked', + multi: true, + separator: ',', + initComponent: function () + { + if (!this.tpl) + { + this.tpl = '' + '
' + + '' + + '{[values.' + this.displayField + ']}' + + '
' + + '
'; + } + + Ext.form.MultiSelect.superclass.initComponent.apply(this, arguments); + + this.on( + { + scope: this, + beforequery: this.onBeforeQuery, + blur: this.onRealBlur + }); + + this.onLoad = this.onLoad.createSequence(function () + { + if (this.el) + { + var v = this.el.dom.value; + this.el.dom.value = ''; + this.el.dom.value = v; + } + }); + }, + initEvents: function () + { + Ext.form.MultiSelect.superclass.initEvents.apply(this, arguments); + this.keyNav.tab = false; + }, + beforeBlur: function () + { + }, + postBlur: function () + { + }, + + clearValue: function () + { + this.value = ''; + this.setRawValue(this.value); + this.store.clearFilter(); + this.store.each(function (r) + { + r.set(this.checkField, false); + }, this); + if (this.hiddenField) + { + this.hiddenField.value = ''; + } + this.applyEmptyText(); + }, + getCheckedDisplay: function () + { + var re = new RegExp(this.separator, "g"); + return this.getCheckedValue(this.displayField).replace(re, this.separator + ' '); + }, + getCheckedValue: function (field) + { + field = field || this.valueField; + var c = []; + var snapshot = this.store.snapshot || this.store.data; + snapshot.each(function (r) + { + if (r.get(this.checkField)) + { + c.push(r.get(field)); + } + }, this); + + return c.join(this.separator); + }, + onBeforeQuery: function (qe) + { + qe.query = qe.query.replace(new RegExp(RegExp.escape(this.getCheckedDisplay()) + '[ ' + this.separator + ']*'), ''); + }, + onRealBlur: function () + { + this.list.hide(); + var rv = this.getRawValue(); + var rva = rv.split(new RegExp(RegExp.escape(this.separator) + ' *')); + var va = []; + var snapshot = this.store.snapshot || this.store.data; + + Ext.each(rva, function (v) + { + snapshot.each(function (r) + { + if (v === r.get(this.displayField)) + { + va.push(r.get(this.valueField)); + } + }, this); + }, this); + this.setValue(va.join(this.separator)); + this.store.clearFilter(); + }, + onSelect: function (record, index) + { + if (this.fireEvent('beforeselect', this, record, index) !== false) + { + record.set(this.checkField, !record.get(this.checkField)); + + if (this.store.isFiltered()) + { + this.doQuery(this.allQuery); + } + + if (this.multi) + { + if (record.get("key") == "---" && record.get(this.checkField)) + { + this.setValue("---"); + } + else + { + this.setValue(this.getCheckedValue()); + } + } + else + { + this.clearValue(); + this.value = record.get(this.valueField); + this.setRawValue(record.get(this.displayField)); + this.list.hide(); + } + + this.fireEvent('select', this, record, index); + } + }, + setValue: function (v) + { + if (v) + { + v = '' + v; + if (this.valueField) + { + this.store.clearFilter(); + this.store.each(function (r) + { + var checked = !(!v.match('(^|' + this.separator + ')' + + RegExp.escape(r.get(this.valueField)) + + '(' + this.separator + '|$)')); + r.set(this.checkField, checked); + }, this); + this.value = this.getCheckedValue(); + this.setRawValue(this.getCheckedDisplay()); + if (this.hiddenField) + { + this.hiddenField.value = this.value; + } + } + else + { + this.value = v; + this.setRawValue(v); + if (this.hiddenField) + { + this.hiddenField.value = v; + } + } + if (this.el) + { + this.el.removeClass(this.emptyClass); + } + } + else + { + this.clearValue(); + } + }, + selectAll: function () + { + this.store.each(function (record) + { + record.set(this.checkField, true); + }, this); + this.doQuery(this.allQuery); + this.setValue(this.getCheckedValue()); + }, + deselectAll: function () + { + this.clearValue(); + } +}); +Ext.reg('multiSelect', Ext.form.MultiSelect); \ No newline at end of file Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r16134 -r16228 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 16134) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 16228) @@ -925,7 +925,38 @@ //如果物品类型不为空时 if (StringUtils.isNotBlank(tousseType)) { - if(TousseItem.DIPOSABLE_YES.equals(tousseType) || TousseItem.TYPE_DIPOSABLE_GOODS.equals(tousseType)){ + Set tousseTypeSet = new HashSet(); + String[] tousseTypesArray = tousseType.split(","); + for (String type : tousseTypesArray) { + switch(type){ + case "一次性物品": + tousseTypeSet.add(TousseItem.TYPE_DIPOSABLE_GOODS); + break; + case "普通器械包": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_INSIDE); + break; + case "敷料包": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_DRESSING); + break; + case "消毒物品": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_DISINFECTION); + break; + case "自定义器械包": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_CUSTOM); + break; + case "外来器械包": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_FOREIGN); + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_SPLIT); + break; + case "外部代理灭菌包": + tousseTypeSet.add(TousseDefinition.PACKAGE_TYPE_FOREIGNPROXY); + break; + } + } + if(!tousseTypeSet.isEmpty()){ + // 新的传参方式 + where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and ((po.type = '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (recyclingAmount - sendOutAmount) > 0) or (po.type <> '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (amount - sendOutAmount) > 0)) and %s)",SqlUtils.getStringFieldInCollectionsPredicate("tousseType", tousseTypeSet)); + }else if(TousseItem.DIPOSABLE_YES.equals(tousseType) || TousseItem.TYPE_DIPOSABLE_GOODS.equals(tousseType)){ where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and (amount - sendOutAmount > 0) and tousseType = '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); }else if(TousseItem.DIPOSABLE_NO.equals(tousseType)){ where8 = String.format("po.id in (select invoicePlan.id from TousseItem where (isTerminated is null or isTerminated <> true) and ((po.type = '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (recyclingAmount - sendOutAmount) > 0) or (po.type <> '"+InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION+"' and (amount - sendOutAmount) > 0)) and tousseType != '%s')",TousseItem.TYPE_DIPOSABLE_GOODS); Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp =================================================================== diff -u -r16146 -r16228 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp (.../invoicePlanExtractedView.jsp) (revision 16146) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.jsp (.../invoicePlanExtractedView.jsp) (revision 16228) @@ -48,6 +48,7 @@ + @@ -58,6 +59,7 @@ + @@ -88,7 +90,8 @@ //申请日期下拉选项数据 <%--var applyDateDataArray = [['全部',''],['今天','${today}'],['昨天','${yesterday}'],['近三天','${lastThreeDays}'],['近一周','${lastSixDays}']];--%> //物品类型下拉选项数据 - var tousseTypeDataArray = [['全部',''],['一次性物品','<%=TousseItem.DIPOSABLE_YES %>'],['非一次性物品','<%=TousseItem.DIPOSABLE_NO %>']]; + //var tousseTypeDataArray = [['一次性物品','<%=TousseItem.DIPOSABLE_YES %>'],['非一次性物品','<%=TousseItem.DIPOSABLE_NO %>']]; + var tousseTypeDataArray = [['一次性物品','一次性物品'],['普通器械包','普通器械包'],['敷料包','敷料包'],['消毒物品','消毒物品'],['自定义器械包','自定义器械包'],['外来器械包','外来器械包'],['外部代理灭菌包','外部代理灭菌包']]; //已选择的条件(申请日期、物品类型、申请单号) var selectedApplyDate = ""; var selectedTousseType = ""; Index: ssts-web/src/main/webapp/ext/resources/css/multiSelectCombo.css =================================================================== diff -u --- ssts-web/src/main/webapp/ext/resources/css/multiSelectCombo.css (revision 0) +++ ssts-web/src/main/webapp/ext/resources/css/multiSelectCombo.css (revision 16228) @@ -0,0 +1,5 @@ + +.ux-MultiSelect-icon { width:16px; height:16px; float:left; background-position: -1px -1px ! important; background-repeat:no-repeat ! important; } +.ux-MultiSelect-icon-checked { background: transparent url(../images/default/menu/checked.gif); } +.ux-MultiSelect-icon-unchecked { background: transparent url(../images/default/menu/unchecked.gif); } + Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js =================================================================== diff -u -r16100 -r16228 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 16100) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedView.js (.../invoicePlanExtractedView.js) (revision 16228) @@ -196,7 +196,7 @@ var selectModel = new Ext.grid.CheckboxSelectionModel(); grid = new Ext.grid.GridPanel({ store : new Ext.data.Store({ - autoLoad: true, + autoLoad: false, proxy : new Ext.data.HttpProxy({ url : WWWROOT + '/disinfectSystem/invoicePlanAction!getDepartInvoiePlansByDepartCodes.do', method : 'POST' @@ -239,6 +239,12 @@ }, loadMask:{msg:'正在加载,请稍候...'}, title : '发货计划列表', + listeners : { + render : function(grid){ + Ext.getCmp('tousseType').selectAll(); + refreshList(); + } + }, tbar : [{ text : '科室分组:' },{ @@ -311,22 +317,22 @@ }, { text : '物品类型:' },{ - xtype : 'combo', + xtype : 'multiSelect', id : 'tousseType', name : 'tousseType', valueField : 'value', displayField : 'key', allowBlank : true, editable : false, fieldLabel:'类型', - width : 120, + width : 150, emptyText:'请选择物品类型', mode:'local', store : new Ext.data.SimpleStore({ data:tousseTypeDataArray, fields:['key','value'] }), - forceSelection : true, +// forceSelection : true, triggerAction : 'all', listeners : { select : function(combo, record, index){ @@ -345,6 +351,7 @@ refreshList(false,true); } }] + }); var viewport = new Ext.Viewport({ Index: ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java =================================================================== diff -u -r16217 -r16228 --- ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16217) +++ ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/service/InvoiceManagerImpl.java (.../InvoiceManagerImpl.java) (revision 16228) @@ -4716,7 +4716,7 @@ String orgUnitCoding, String applyDate, String tousseType){ Collection invoicePlans = invoicePlanManager.getInvoicePlanListByOrgUnitCodingsAndTousseType(Arrays.asList(orgUnitCoding), applyDate, tousseType); - return getWaitDeliverGoods(invoicePlans, applyDate , tousseType); + return getWaitDeliverGoods(invoicePlans, applyDate , null); } @Override @@ -4744,7 +4744,7 @@ invoicePlanId); if (invoicePlan == null) return CollectionUtils.emptyCollection(); - return getWaitDeliverGoods(Collections.singleton(invoicePlan) , applyDate , tousseType); + return getWaitDeliverGoods(Collections.singleton(invoicePlan) , applyDate , null); } /**