Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js =================================================================== diff -u -r37770 -r37773 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js (.../tousseDeliverStatisticsView.js) (revision 37770) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/tousseDeliverStatisticsView.js (.../tousseDeliverStatisticsView.js) (revision 37773) @@ -14,10 +14,29 @@ var startTime = $Id('startTime').value; var endTime = $Id('endTime').value; - var departCoding = Ext.getCmp('querySupplyRoom').getValue();//20181225 + var departCoding = Ext.getCmp('querySupplyRoom').getValue(); if (departCoding.indexOf(ALL) == 0) { departCoding = ""; } + + var tousseType = $Id('tousseType').value; + if (tousseType == "全部") { + tousseType = ""; + } + + var settleAccountsDepartName = Ext.getCmp('settleAccountsDepartCoding').getRawValue(); + var settleAccountsDepartCoding = Ext.getCmp('settleAccountsDepartCoding').getValue(); + + if (settleAccountsDepartName == "全部" || settleAccountsDepartName == '') { + settleAccountsDepartCoding = ""; + } + + var departGroupName = Ext.getCmp('departGroup').getRawValue(); + var departGroupId = Ext.getCmp('departGroup').getValue(); + if (departGroupName == '全部' || departGroupName == '' || departGroupName.trim() == '') { + departGroupId = ''; + } + myMask = new Ext.LoadMask(Ext.getBody(), { msg: '正在加载,请稍候!', removeMask: true @@ -30,6 +49,9 @@ startDay: startTime, endDay: endTime, departCoding: departCoding, + tousseType: tousseType, + settleAccountsDepartCoding: settleAccountsDepartCoding, + departGroup: departGroupId, reportName: 'tousseDeliverStatistics' } @@ -38,7 +60,7 @@ Ext.onReady(function () { Ext.QuickTips.init(); - //20181225 + var supplyRoomRecord = Ext.data.Record.create([ { name: 'departCode', type: 'string' }, { name: 'name', type: 'string' } @@ -54,7 +76,6 @@ method: 'POST' }), baseParams: { type: "12" }, - // reader : rd, reader: new Ext.data.JsonReader({ fields: [ { name: 'id', mapping: 'id' }, @@ -100,7 +121,28 @@ } } }); - //20181225 end + + //结算科室Store + var appDepartJsonStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/systemmanage/orgUnit/searchApplyDepartmentByKeyWord.do?onlyOneself=false&showDisableOrgUnit=false', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'departmentCode' }, + { name: 'name', mapping: 'departmentName' } + ] + ) + }); + + //科室分组Store + var departGroupStore = new Ext.data.SimpleStore({ + fields: ['id', 'shift', 'departCode'], + url: WWWROOT + '/disinfectSystem/invoiceDepartmentAction!loadDepartGroup.do?needAll=false' + }); + form = new Ext.form.FormPanel({ title: entityName, region: 'north', @@ -112,11 +154,11 @@ border: 0, frame: true, bodyStyle: 'padding:0px auto;margin:0px',// padding:1px;padding-top:5px; - height: 110, + height: 130, labelWidth: 80, items: [{ layout: 'column', - height: 40, + height: 60, items: [{ columnWidth: .3, layout: 'form', @@ -177,9 +219,8 @@ }, { columnWidth: .3, layout: 'form', - labelWidth: 90, labelSeparator: '选择供应室:', - items: [{//20181225 + items: [{ xtype: 'multiSelect', id: 'querySupplyRoom', name: 'querySupplyRoom', @@ -225,27 +266,126 @@ } } }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'multiSelect', + fieldLabel: '物品类型', + id: 'tousseType', + name: 'tousseType', + valueField: 'value', + displayField: 'value', + store: new Ext.data.SimpleStore({ + fields: ['value'], + data: [['全部'], ['器械包'], ['消毒物品'], ['敷料包'], ['外来器械包'], ['外来器械小包'], ['外部代理灭菌'], ['自定义器械包']] + }), + forceSelection: false, + value: '全部', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%', + listeners: { + select: function (combo, record, index) { + //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 + if (record.get('value') == '全部') { + if (record.get('checked')) { + combo.selectAll(); + } else { + combo.deselectAll(); + } + } - // items : [{ - // xtype : 'combo', - // id : 'querySupplyRoom', - // name : 'querySupplyRoom', - // valueField : 'departCode', - // displayField : 'name', - // allowBlank : true, - // editable : false, - // store : supplyRoomStore, - // forceSelection : true, - // mode : 'local', - // triggerAction : 'all', - // anchor : '95%', - // listeners : { - // render : function(_this) { - // supplyRoomStore.load(); - // } - // } - // }] - // + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 + var selectAll = true; + combo.store.each(function (record) { + if (record.get('value') != '全部' && !record.get(this.checkField)) { + selectAll = false; + return; + } + }, combo); + + var all = combo.store.getAt(0); + if (selectAll) { + all.set(combo.checkField, true); + } else { + all.set(combo.checkField, false); + } + combo.setValue(combo.getCheckedValue()); + }, + render: function (thiz) { + thiz.selectAll(); + } + } + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'multiSelect', + fieldLabel: '结算科室', + id: 'settleAccountsDepartCoding', + name: 'settleAccountsDepartCoding', + valueField: 'id', + displayField: 'name', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: appDepartJsonStore, + mode: 'remote', + multiSelectIsClear: false, + triggerAction: 'all', + anchor: '95%', + listeners: { + change: function (field, newVal, oldVal) { + if (newVal == "") { + Ext.getCmp('departGroup').setDisabled(false); + } else { + Ext.getCmp('departGroup').setDisabled(true); + } + }, + blur: function (that) { + if (Ext.getCmp('settleAccountsDepartCoding').getRawValue() == '') { + Ext.getCmp('departGroup').setDisabled(false); + } + } + } + }] + }, { + columnWidth: .3, + layout: 'form', + items: [{ + xtype: 'multiSelect', + fieldLabel: '科室分组', + id: 'departGroup', + name: 'departGroup', + valueField: 'id', + displayField: 'shift', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: departGroupStore, + multiSelectIsClear: false, + editable: false, + mode: 'remote', + triggerAction: 'all', + anchor: '95%', + listeners: { + change: function (field, newVal, oldVal) { + if (newVal == "") { + Ext.getCmp('settleAccountsDepartCoding').setDisabled(false); + } else { + Ext.getCmp('settleAccountsDepartCoding').setDisabled(true); + } + }, + blur: function (that) { + if (Ext.getCmp('departGroup').getRawValue() == '') { + Ext.getCmp('settleAccountsDepartCoding').setDisabled(false); + } + } + } + }] }] }], buttons: [{ @@ -262,8 +402,15 @@ minWidth: 70, iconCls: 'icon_set', handler: function () { - $Id('startTime').value = ""; - $Id('endTime').value = ""; + Ext.getCmp('startTime').setValue(new Date()); + Ext.getCmp('endTime').setValue(new Date()); + Ext.getCmp('tousseType').setValue('全部'); + Ext.getCmp('settleAccountsDepartCoding').setValue(''); + Ext.getCmp('settleAccountsDepartCoding').setRawValue(''); + Ext.getCmp('departGroup').setValue(''); + Ext.getCmp('departGroup').setRawValue(''); + Ext.getCmp('settleAccountsDepartCoding').setDisabled(false); + Ext.getCmp('departGroup').setDisabled(false); } }, { xtype: 'button', @@ -316,5 +463,5 @@ failure: function (response, options) { } }); - supplyRoomRemoteStore.load();//20181225 + supplyRoomRemoteStore.load(); }); \ No newline at end of file