Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/InvoicePlanAction.java =================================================================== diff -u -r19643 -r20103 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/InvoicePlanAction.java (.../InvoicePlanAction.java) (revision 19643) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/InvoicePlanAction.java (.../InvoicePlanAction.java) (revision 20103) @@ -55,11 +55,13 @@ import com.forgon.serialnumber.service.SerialNumManager; import com.forgon.systemsetting.model.HttpOption; import com.forgon.systemsetting.service.HttpOptionManager; +import com.forgon.tools.Constants; import com.forgon.tools.StrutsParamUtils; import com.forgon.tools.StrutsResponseUtils; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JsonPropertyFilter; +import com.forgon.tools.string.StringTools; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -586,4 +588,48 @@ } } + /** + * 获取所有的申请单的类型. + */ + public void getAllApplyType() { + List list = new ArrayList(); + + list.add(createApplyTypeJSONObject("全部")); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_COMBO_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_TOUSSE_APPLICATION_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_DIPOSABLE_GOODS_APPLICATION_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_DISINFECT_GOODS_APPLICATION_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_BORROWINGSINGLE)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_SPECIALIZED_INSTRUMENT_APPLICATION_FROM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_APPLYING_FOR_RETURN_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_PROXYDISINFECTION)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_FOREIGNPROXYDISINFECTION)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_FOREIGNTOUSSEAPPLIACTION)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_CUSTOM_TOUSSE_APPLIACTION_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_TOUSSE_EXPANSION_FORM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_SECOND_SUPPLY_ROOM)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_RECYCLINGCREATE_APPLICATION)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_QUALITY_MONITOR_RECYCLE_APPLICATION)); + list.add(createApplyTypeJSONObject(InvoicePlan.TYPE_OPERATION_RESERVATION_APPLICATION)); + if (StringTools.equals(StrutsParamUtils.getPraramValue("neddCustomDeliveryType", ""), "yes")) { + list.add(createApplyTypeJSONObject(Invoice.TYPE_CUSTOM)); + } + JSONObject result = new JSONObject(); + result.put("totalCount", list.size()); + result.put("data", list); + StrutsResponseUtils.output(result); + } + + /** + * 创建申请类型的JSONObject + * @param applyType + * @return + */ + private JSONObject createApplyTypeJSONObject(String applyType) { + JSONObject obj = new JSONObject(); + obj.put("applyType", applyType); + return obj; + } + + } Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js =================================================================== diff -u -r19547 -r20103 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 19547) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.js (.../invoiceView.js) (revision 20103) @@ -1,6 +1,6 @@ var entityName = "发货单"; var grid; -var tousseTypeDataArray = [['一次性物品','一次性物品'],['器械包','器械包'],['敷料包','敷料包'],['消毒物品','消毒物品'],['自定义器械包','自定义器械包'],['外来器械包','外来器械包'],['外来器械拆分小包','外来器械拆分小包'],['外部代理灭菌','外部代理灭菌']]; +var tousseTypeDataArray = [['全部','全部'],['一次性物品','一次性物品'],['器械包','器械包'],['敷料包','敷料包'],['消毒物品','消毒物品'],['自定义器械包','自定义器械包'],['外来器械包','外来器械包'],['外来器械拆分小包','外来器械拆分小包'],['外部代理灭菌','外部代理灭菌']]; var rd = new Ext.data.JsonReader({ fields : [ {name : 'id'}, @@ -1840,8 +1840,7 @@ } }, anchor : '95%' - }, - { + },{ text : '物品类型:' },{ xtype : 'multiSelect', @@ -1852,7 +1851,7 @@ allowBlank : true, editable : false, fieldLabel:'类型', - width : 300, + width : 150, emptyText:'请选择物品类型', mode:'local', store : new Ext.data.SimpleStore({ @@ -1863,14 +1862,62 @@ triggerAction : 'all', listeners : { select : function(combo, record, index){ - refreshList(); - }, - render : function() { - Ext.getCmp('tousseType').selectAll(); + if (record.get('value') == '全部') { + if (record.get('checked')) { + combo.selectAll() + } else { + combo.deselectAll() + } + } + grid.dwrReload(); } }, anchor : '95%' },{ + text : '申请单类型:', + hidden: !sstsConfig.accordingToApplyTypeFilter + },{ + xtype: 'multiSelect', + hidden: !sstsConfig.accordingToApplyTypeFilter, + store : new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/invoicePlanAction!getAllApplyType.do?neddCustomDeliveryType=yes', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data', + totalProperty: 'totalCount' + }, [{name: 'applyType', mapping: 'applyType'}] + ) + }), + fieldLabel: '请单类型', + displayField: 'applyType', + valueField: 'applyType', + allowBlank : true, + editable : false, + width : 150, + emptyText:'请选择申请单类型', + triggerAction: 'all', + listWidth: 200, + mode: 'remote', + //这个要设置成false,不然多选鼠标离开之后,combo上面的值不会显示 + forceSelection : false, + listeners: { + select: function (combo, record, index) { + if (record.get('applyType') == '全部') { + if (record.get('checked')) { + combo.selectAll() + } else { + combo.deselectAll() + } + } + + var dom = document.getElementById('parm_s_applyType'); + dom.value = combo.getValue(); + grid.dwrReload(); + } + } + },{ type : 'button', text : '打印'+entityName, hidden : !(sstsConfig.printInvoiceVersion==2), Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp =================================================================== diff -u -r19463 -r20103 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp (.../invoiceView.jsp) (revision 19463) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoiceView.jsp (.../invoiceView.jsp) (revision 20103) @@ -113,6 +113,7 @@
+
\ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js =================================================================== diff -u -r20092 -r20103 --- ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js (.../config.js) (revision 20092) +++ ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js (.../config.js) (revision 20103) @@ -152,6 +152,8 @@ isShowDeptGroup : true, //是否显示按器械包分组选择框 isShowTousseGroup : true, + //申请单列表和发货单列表是否需按申请单类型过滤(为true需要,为false或者没配都不需要) + accordingToApplyTypeFilter : true, //是否显示打印过滤选择框 showPrintFilter: true, //科室申领时间过滤,开始日期是否为当天 Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r19994 -r20103 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 19994) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 20103) @@ -2100,6 +2100,10 @@ tbar2.push({text: '按器械包分组:'}); tbar2.push(searchComboConfig.tousseGroupCombo); } + if (sstsConfig.accordingToApplyTypeFilter){ + tbar2.push({text: '按申请单类型:'}); + tbar2.push(searchComboConfig.applyTypeCombo); + } if (sstsConfig.showPrintFilter){ tbar2.push({text: '是否已打印过滤:'}); tbar2.push(searchComboConfig.printCombo); @@ -2315,14 +2319,53 @@ forceSelection : false, listeners: { select: function (combo, record, index) { - // var tousseGroupId = record.get('id'); + if (record.get('tousseGroupName') == '全部') { + if (record.get('checked')) { + combo.selectAll() + } else { + combo.deselectAll() + } + } reloadConditionPara(combo.getValue(), 'parm_s_tousseGroupId'); } } }); } /** + * 创建按申请单类型的下拉选项 + * @returns + */ +function createApplyTypeCombo() { + var applyTypeStoreConfig = { + url : WWWROOT + '/disinfectSystem/invoicePlanAction!getAllApplyType.do', + model : [{name: 'applyType', mapping: 'applyType'}] + } + return createCombo({ + xtype: 'multiSelect', + storeConfig : applyTypeStoreConfig, + fieldLabel: '按申请单类型', + displayField: 'applyType', + valueField: 'applyType', + listWidth: 200, + //这个要设置成false,不然多选鼠标离开之后,combo上面的值不会显示 + forceSelection : false, + listeners: { + select: function (combo, record, index) { + if (record.get('applyType') == '全部') { + if (record.get('checked')) { + combo.selectAll() + } else { + combo.deselectAll() + } + } + reloadConditionPara(combo.getValue(), 'parm_s_applyType'); + } + } + }); +} + +/** * 创建打印状态过滤的下拉选项 */ function createPrintCombo() { @@ -2389,6 +2432,7 @@ width: comboConfig.width || 150, mode: comboConfig.mode || 'remote', triggerAction: 'all', + listWidth: comboConfig.listWidth || 150, displayField: comboConfig.displayField, valueField: comboConfig.valueField, forceSelection: Ext.isEmpty(comboConfig.forceSelection) ? true : comboConfig.forceSelection, @@ -2695,6 +2739,7 @@ quickScreenCombo : quickScreenCombo, departmentGroupCombo : createDeptGroupCombo(), tousseGroupCombo : createTousseGroupCombo(), + applyTypeCombo : createApplyTypeCombo(), printCombo : createPrintCombo() }); Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/ReAppTableSqlHandler.java =================================================================== diff -u -r18570 -r20103 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/ReAppTableSqlHandler.java (.../ReAppTableSqlHandler.java) (revision 18570) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/ReAppTableSqlHandler.java (.../ReAppTableSqlHandler.java) (revision 20103) @@ -4,6 +4,8 @@ import com.forgon.databaseadapter.service.DateQueryAdapter; import com.forgon.disinfectsystem.entity.invoicemanager.InvoicePlan; import com.forgon.tools.SqlBuilder; +import com.forgon.tools.string.StringTools; + import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; @@ -49,8 +51,22 @@ this.createStatusFilterSql(sqlWhereParamMap, sqlBuilder); this.createDeptGroupFilterSql(sqlWhereParamMap, sqlBuilder); this.createTousseGroupFilterSql(sqlWhereParamMap, sqlBuilder); + this.createApplyTypeFilterSql(sqlWhereParamMap, sqlBuilder); } + /** + * 创建按申请单类型过滤. + * + * @param sqlWhereParamMap 页面的参数 + * @param sqlBuilder 原来的sql + */ + private void createApplyTypeFilterSql(Map sqlWhereParamMap, + StringBuilder sqlBuilder) { + String applyType = sqlWhereParamMap.get("applyType"); + if (StringUtils.isNotBlank(applyType) && applyType.indexOf("全部") == -1) { + sqlBuilder.append(String.format(" and %s ", SqlBuilder.build_IN_Statement("po.type", SqlBuilder.IN, applyType.split(Constants.IDS_SEPARATOR_COMMA)))); + } + } /** * 创建按器械包分组过滤 Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp =================================================================== diff -u -r19890 -r20103 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 19890) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 20103) @@ -156,6 +156,7 @@ + Index: ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/dwr/table/InvoiceTableManager.java =================================================================== diff -u -r18588 -r20103 --- ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/dwr/table/InvoiceTableManager.java (.../InvoiceTableManager.java) (revision 18588) +++ ssts-invoice/src/main/java/com/forgon/disinfectsystem/invoicemanager/dwr/table/InvoiceTableManager.java (.../InvoiceTableManager.java) (revision 20103) @@ -37,6 +37,7 @@ import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseDefinitionManager; import com.forgon.security.model.User; import com.forgon.tools.MathTools; +import com.forgon.tools.SqlBuilder; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.string.StringTools; import com.forgon.tools.util.SqlUtils; @@ -127,6 +128,7 @@ .get("recyclingApplicantID"); String invoiceType = sqlWhereParamMap.get("invoiceType"); String selectedTousseType = sqlWhereParamMap.get("selectedTousseType"); + String applyType = sqlWhereParamMap.get("applyType"); String selectedDepartCodes = sqlWhereParamMap.get("selectedDepartCodes"); // String sql = "where po.invoicePlan is not null"; String sql = "where 1=1 "; @@ -152,12 +154,18 @@ sql += String.format(" and %s ", SqlUtils.getStringFieldInCollectionsPredicate("po.departCoding", Arrays.asList(selectedDepartCodesArr))); } - if (StringUtils.isNotBlank(selectedTousseType)) { + + //按物品类型过滤 + if (StringUtils.isNotBlank(selectedTousseType) && selectedTousseType.indexOf("全部") == -1) { String[] selectedTousseTypeArr = selectedTousseType.split(","); sql += String.format(" and po.id in(select i.invoiceID from InvoiceItem i where %s) ", SqlUtils.getStringFieldInCollectionsPredicate("i.tousseType", Arrays.asList(selectedTousseTypeArr))); - }else{ -// sql += " and 1=1 "; } + + //按申请单类型过滤 + if (StringUtils.isNotBlank(applyType) && applyType.indexOf("全部") == -1) { + sql += String.format(" and %s ", SqlBuilder.build_IN_Statement("po.invoicePlanType", SqlBuilder.IN, applyType.split(Constants.IDS_SEPARATOR_COMMA))); + } + String json = gridManager.renderGrid(parameterMap, Invoice.class.getSimpleName(), sql, new String[] { "invoicePlan", "returnedTousseItems",