Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js =================================================================== diff -u -r33028 -r33048 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 33028) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/departmentMonthlyDetailDSInvoiceItemView.js (.../departmentMonthlyDetailDSInvoiceItemView.js) (revision 33048) @@ -6,345 +6,345 @@ var limitDepart = true; var departMode; var ALL = '全部'; -Ext.onReady(function() { +Ext.onReady(function () { Ext.QuickTips.init(); - if(supplyRoomType == supplyRoomTypeFirstSupplyRoom || supplyRoomType == supplyRoomTypeSecondSupplyRoom || supplyRoomType == supplyRoomTypeExpensiveGoods){ + if (supplyRoomType == supplyRoomTypeFirstSupplyRoom || supplyRoomType == supplyRoomTypeSecondSupplyRoom || supplyRoomType == supplyRoomTypeExpensiveGoods) { limitDepart = false; departMode = "remote"; - }else{ + } else { departMode = "local"; } // 记录cookie(3步) var diposableGooodsStore = new Ext.data.JsonStore({ - fields : [ 'typeName','typeValue' ], - url : WWWROOT + '/disinfectSystem/diposableGoodsAction!getDisposableGoodsTypeForFilter.do', - listeners : { - load : function(store,records) { - if(records.length > 0){ + fields: ['typeName', 'typeValue'], + url: WWWROOT + '/disinfectSystem/diposableGoodsAction!getDisposableGoodsTypeForFilter.do', + listeners: { + load: function (store, records) { + if (records.length > 0) { var combo = Ext.getCmp("disposableGoodsType"); // 触发选中事件 -// combo.fireEvent('select', combo,records[0],0); + // combo.fireEvent('select', combo,records[0],0); } } } }); diposableGooodsStore.load(); reportTypeJson = sstsConfig.typesOfDetailedAccountingMonthlyReport; - if(reportTypeJson != null && reportTypeJson.length > 1){ + if (reportTypeJson != null && reportTypeJson.length > 1) { for (var i = 0; i < reportTypeJson.length; i++) { var item = reportTypeJson[i]; var optionText = item.optionText; var reportName = item.reportName; var reportType = null; - if(reportName == '标准的明细核算月报'){ + if (reportName == '标准的明细核算月报') { reportType = 'standard'; - }else if(reportName == '单个科室的明细核算月报'){ + } else if (reportName == '单个科室的明细核算月报') { reportType = 'singleDepart'; - }else{ + } else { continue; } - dataForPatternOfReport.push([reportType,optionText]); + dataForPatternOfReport.push([reportType, optionText]); } } var patternOfReport = new Ext.data.SimpleStore({ - fields : ['id', 'name'], - data : dataForPatternOfReport - }); - function getHiddenValueByReportName(reportName){ + fields: ['id', 'name'], + data: dataForPatternOfReport + }); + function getHiddenValueByReportName(reportName) { var patternOfReport = null; - if(reportName == '单个科室的明细核算月报'){ + if (reportName == '单个科室的明细核算月报') { patternOfReport = 'singleDepart'; - }else{ + } else { patternOfReport = 'standard'; } return patternOfReport; } - function reloadReport(){ - var startTime= $Id('startTime').value; - var endTime= $Id('endTime').value; + function reloadReport() { + var startTime = $Id('startTime').value; + var endTime = $Id('endTime').value; //var departSearch = $Id('departSearch').value; var departSearch = Ext.getCmp('departSearch').getRawValue(); var departCoding = Ext.getCmp('departSearch').getValue(); var goodsSearch = $Id('goodsSearch').value; var batch = $Id('batch').value; - //goodsSearch = goodsSearch.replace(/\%/g,'%25'); - //goodsSearch = goodsSearch.replace('#','%23'); + //goodsSearch = goodsSearch.replace(/\%/g,'%25'); + //goodsSearch = goodsSearch.replace('#','%23'); var tousseType = $Id('tousseType').value; var searchType = $Id('searchType').value; var disposableGoodsType = Ext.getCmp("disposableGoodsType").value; var goodsType = Ext.getCmp("goodsType").value; - if(departSearch == "全部" || departSearch == ''){ + if (departSearch == "全部" || departSearch == '') { departSearch = ""; departCoding = ""; } var invoicePlanDepartSearch = Ext.getCmp('invoicePlanDepartSearch').getRawValue(); var invoicePlanDepartCoding = Ext.getCmp('invoicePlanDepartSearch').getValue(); - if(invoicePlanDepartSearch == "全部" || invoicePlanDepartSearch == ''){ + if (invoicePlanDepartSearch == "全部" || invoicePlanDepartSearch == '') { invoicePlanDepartCoding = ""; } - + var departGroupRawValue = Ext.getCmp('departGroup').getRawValue(); var departGroupValue = Ext.getCmp('departGroup').getValue(); - if(departGroupRawValue == '全部' || departGroupRawValue == '' || departGroupRawValue.trim() == ''){ + if (departGroupRawValue == '全部' || departGroupRawValue == '' || departGroupRawValue.trim() == '') { departGroupValue = ''; } - + var showBatchValue = $Id('showBatch').value; var showBatch = true; - if(showBatchValue == '否'){ + if (showBatchValue == '否') { showBatch = false; } - if(tousseType == "全部"){ + if (tousseType == "全部") { tousseType = ""; } - if(disposableGoodsType == "全部"){ + if (disposableGoodsType == "全部") { disposableGoodsType = ""; } - if(goodsType == "全部"){ + if (goodsType == "全部") { goodsType = ""; } myMask = new Ext.LoadMask(Ext.getBody(), { msg: '正在加载,请稍候!', removeMask: true }); var patternOfReport = null; - if(reportTypeJson == null || reportTypeJson.length == 0){//默认标准的明细核算月报 + if (reportTypeJson == null || reportTypeJson.length == 0) {//默认标准的明细核算月报 patternOfReport = 'standard'; - }else if(reportTypeJson.length == 1){//配置了一个报表格式 + } else if (reportTypeJson.length == 1) {//配置了一个报表格式 var reportName = reportTypeJson[0].reportName; - if(reportName == '标准的明细核算月报'){ + if (reportName == '标准的明细核算月报') { patternOfReport = 'standard'; - }else if(reportName == '单个科室的明细核算月报'){ + } else if (reportName == '单个科室的明细核算月报') { patternOfReport = 'singleDepart'; } - }else{//配置了多个报表格式 + } else {//配置了多个报表格式 patternOfReport = Ext.getCmp("patternOfReport").value; } - if(patternOfReport == "" && reportTypeJson != null && reportTypeJson.length > 1){ + if (patternOfReport == "" && reportTypeJson != null && reportTypeJson.length > 1) { showResult('请选择报表格式。'); return false; } - if(limitDepart){//临床科室登录,申请科室或结算科室必须有值且只能为登录科室,且不能同时为空 - if(invoicePlanDepartCoding == '' && departCoding == ''){ + if (limitDepart) {//临床科室登录,申请科室或结算科室必须有值且只能为登录科室,且不能同时为空 + if (invoicePlanDepartCoding == '' && departCoding == '') { Ext.getCmp('invoicePlanDepartSearch').focus(); showResult('请选择科室。'); return false; } } var showCustonTousseAmount = false; - if(sstsConfig.hasOwnProperty('isMonthReportShowCustonTousseAmount') && sstsConfig.isMonthReportShowCustonTousseAmount){ + if (sstsConfig.hasOwnProperty('isMonthReportShowCustonTousseAmount') && sstsConfig.isMonthReportShowCustonTousseAmount) { showCustonTousseAmount = true; } var jasperreportFileName = "DepartmentMonthDetail.jasper"; //获取配置是否查询显示供应商,默认false:不查询隐藏供应商 var showSupplierNameInDetailedAccountingMonthlyReport = false; - if(sstsConfig.hasOwnProperty('showSupplierNameInDetailedAccountingMonthlyReport') && sstsConfig.showSupplierNameInDetailedAccountingMonthlyReport){ + if (sstsConfig.hasOwnProperty('showSupplierNameInDetailedAccountingMonthlyReport') && sstsConfig.showSupplierNameInDetailedAccountingMonthlyReport) { showSupplierNameInDetailedAccountingMonthlyReport = true; } var enableDiscountPrice = sstsConfig.enableDiscountPrice; - if('standard' == patternOfReport && sstsConfig.enableToussePointsStatistics){ + if ('standard' == patternOfReport && sstsConfig.enableToussePointsStatistics) { jasperreportFileName = "DepartmentMonthDetailIntegral.jasper"; - }else if("singleDepart" == patternOfReport){//单个科室的明细核算月报 + } else if ("singleDepart" == patternOfReport) {//单个科室的明细核算月报 invoicePlanDepartCoding = ""; - if(departSearch == '' || departCoding == ''){ + if (departSearch == '' || departCoding == '') { showResult('单个科室的明细核算月报必须选择结算科室'); Ext.getCmp('departSearch').focus(); return false; - }else if(departCoding.indexOf(",") != -1){ + } else if (departCoding.indexOf(",") != -1) { showResult('单个科室的明细核算月报只能选择一个结算科室查询'); Ext.getCmp('departSearch').focus(); return false; } jasperreportFileName = "DepartmentMonthDetailOfSingleDepart.jasper"; - }else if(enableDiscountPrice && showSupplierNameInDetailedAccountingMonthlyReport){//价格供应商都显示 + } else if (enableDiscountPrice && showSupplierNameInDetailedAccountingMonthlyReport) {//价格供应商都显示 jasperreportFileName = "DepartmentMonthDetailSupplierNameAndDiscountPrice.jasper"; - }else if(enableDiscountPrice){//显示价格 + } else if (enableDiscountPrice) {//显示价格 jasperreportFileName = "DepartmentMonthDetailDiscountPrice.jasper"; - }else if(showSupplierNameInDetailedAccountingMonthlyReport){//查询显示供应商 + } else if (showSupplierNameInDetailedAccountingMonthlyReport) {//查询显示供应商 jasperreportFileName = "DepartmentMonthDetailSupplierName.jasper"; } myMask.show(); - if("DepartmentMonthDetail.jasper" == jasperreportFileName && sstsConfig.hasOwnProperty('showMaterialsAmountColumnOfDetailMonthReport') && sstsConfig.showMaterialsAmountColumnOfDetailMonthReport){ + if ("DepartmentMonthDetail.jasper" == jasperreportFileName && sstsConfig.hasOwnProperty('showMaterialsAmountColumnOfDetailMonthReport') && sstsConfig.showMaterialsAmountColumnOfDetailMonthReport) { jasperreportFileName = "departmentMonthDetailShowMaterialsAmount.jasper"; } var url = WWWROOT + "/jasperreports/jasperreportsAction!createReportFromJavaBeanSource.do"; var params = { - jasperreportName : jasperreportFileName, - departSearch : departSearch, - invoicePlanDepartCoding : invoicePlanDepartCoding, - startTime : startTime, - endTime:endTime, - tousseType:tousseType, - goodsType:goodsType, - searchType:searchType, - batch:batch, - departCoding:departCoding, - disposableGoodsType:disposableGoodsType, - showCustonTousseAmount:showCustonTousseAmount, - patternOfReport:patternOfReport, - goodsNameSearch:goodsSearch, - showBatch : showBatch, + jasperreportName: jasperreportFileName, + departSearch: departSearch, + invoicePlanDepartCoding: invoicePlanDepartCoding, + startTime: startTime, + endTime: endTime, + tousseType: tousseType, + goodsType: goodsType, + searchType: searchType, + batch: batch, + departCoding: departCoding, + disposableGoodsType: disposableGoodsType, + showCustonTousseAmount: showCustonTousseAmount, + patternOfReport: patternOfReport, + goodsNameSearch: goodsSearch, + showBatch: showBatch, departGroup: departGroupValue, - reportName:'departmentMonthDetail' + reportName: 'departmentMonthDetail' } - searchReport(url,params); + searchReport(url, params); } - Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function() {}; - - + Ext.ux.ForgonPageGrid.prototype.getGridParameterMap = function () { }; + + var departJsonStore = null; var appDepartJsonStore = null; - if(limitDepart){ - var departProperties = [{name : 'id'}, - {name : 'name'}, - {name : 'orgUnitName'}] + if (limitDepart) { + var departProperties = [{ name: 'id' }, + { name: 'name' }, + { name: 'orgUnitName' }] departJsonStore = new Ext.data.Store({ - reader : new Ext.data.JsonReader({ - fields : departProperties - }) - }); - var DepartRecord = Ext.data.Record.create(departProperties); - var departRecord = new DepartRecord({ - id : orgUnitCoding, - name : orgUnitName, - orgUnitName : orgUnitName - }); - departJsonStore.add(departRecord); - - var appDepartProperties = [{name : 'id'}, - {name : 'name'}] - appDepartJsonStore = new Ext.data.Store({ - reader : new Ext.data.JsonReader({ - fields : appDepartProperties - }) - }); - var appDepartRecord = Ext.data.Record.create(appDepartProperties); - var appDepartRecord = new DepartRecord({ - id : orgUnitCoding, - name : orgUnitName - }); - appDepartJsonStore.add(appDepartRecord); - }else{ + reader: new Ext.data.JsonReader({ + fields: departProperties + }) + }); + var DepartRecord = Ext.data.Record.create(departProperties); + var departRecord = new DepartRecord({ + id: orgUnitCoding, + name: orgUnitName, + orgUnitName: orgUnitName + }); + departJsonStore.add(departRecord); + + var appDepartProperties = [{ name: 'id' }, + { name: 'name' }] + appDepartJsonStore = new Ext.data.Store({ + reader: new Ext.data.JsonReader({ + fields: appDepartProperties + }) + }); + var appDepartRecord = Ext.data.Record.create(appDepartProperties); + var appDepartRecord = new DepartRecord({ + id: orgUnitCoding, + name: orgUnitName + }); + appDepartJsonStore.add(appDepartRecord); + } else { departJsonStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', - method : 'POST' + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/supplyRoomConfigAction!getSettleAccountsDepartJson.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - root : 'data' - },[ - {name : 'id',mapping : 'id'}, - {name : 'name',mapping : 'name'}, - {name : 'orgUnitName',mapping : 'orgUnitName'} - ] + reader: new Ext.data.JsonReader({ + root: 'data' + }, [ + { name: 'id', mapping: 'id' }, + { name: 'name', mapping: 'name' }, + { name: 'orgUnitName', mapping: 'orgUnitName' } + ] ) }); //Ext4 申请科室Store appDepartJsonStore = new Ext.data.Store({ - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/systemmanage/orgUnit/searchApplyDepartmentByKeyWord.do?onlyOneself=false&showDisableOrgUnit=false', - method : 'POST' + 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'} - ] + 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' + fields: ['id', 'shift', 'departCode'], + url: WWWROOT + '/disinfectSystem/invoiceDepartmentAction!loadDepartGroup.do?needAll=false' }); - var tousseTypeStore = new Ext.data.SimpleStore( { - fields : ['value'], - data : [ ['全部'],['全部器械包'],['器械包'],['敷料包'],['消毒物品'],['外来器械包'],['自定义器械包'],['外部代理灭菌包'],['一次性物品'],['器械材料'],['高值耗材'],['自动扣减物品'],['收费项目'] ] + var tousseTypeStore = new Ext.data.SimpleStore({ + fields: ['value'], + data: [['全部'], ['全部器械包'], ['器械包'], ['敷料包'], ['消毒物品'], ['外来器械包'], ['自定义器械包'], ['外部代理灭菌包'], ['一次性物品'], ['器械材料'], ['高值耗材'], ['自动扣减物品'], ['收费项目']] }); - - var goodsTypeStore = new Ext.data.SimpleStore( { - fields : ['value'], - data : [ ['全部'],['一次性物品'],['器械']] + + var goodsTypeStore = new Ext.data.SimpleStore({ + fields: ['value'], + data: [['全部'], ['一次性物品'], ['器械']] }); - - var searchTypeStore = new Ext.data.SimpleStore( { - fields : ['value'], - data : [ ['精确查询'],['模糊查询'] ] + + var searchTypeStore = new Ext.data.SimpleStore({ + fields: ['value'], + data: [['精确查询'], ['模糊查询']] }); - + var tousseAndDiposableGoodsStore = new Ext.data.Store({ - pageSize: 100, - proxy : new Ext.data.HttpProxy({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchTousseAndDisposableGoodsAndExpensiveGoods.do', - method : 'POST' + pageSize: 100, + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!searchTousseAndDisposableGoodsAndExpensiveGoods.do', + method: 'POST' }), - reader : new Ext.data.JsonReader({ - totalProperty : 'totalCount', - root : 'data' + reader: new Ext.data.JsonReader({ + totalProperty: 'totalCount', + root: 'data' }, [ - {name : 'id',mapping : 'id'}, - {name : 'spelling',mapping : 'spelling'}, - {name : 'name',mapping : 'name'}, - {name : 'showName',mapping : 'showName'}, - {name : 'displayName',mapping : 'displayName'}, - {name : 'amount',mapping : 'amount'}] + { name: 'id', mapping: 'id' }, + { name: 'spelling', mapping: 'spelling' }, + { name: 'name', mapping: 'name' }, + { name: 'showName', mapping: 'showName' }, + { name: 'displayName', mapping: 'displayName' }, + { name: 'amount', mapping: 'amount' }] ) }); - if ((!startTime || startTime == 'null') && (!endTime || endTime == 'null')) { + if ((!startTime || startTime == 'null') && (!endTime || endTime == 'null')) { var dt = new Date(); startTime = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/01 00:00"; endTime = dt.getFullYear() + "/" + (dt.getMonth() + 1) + "/" + dt.getDate() + " 23:59"; } var form = new Ext.form.FormPanel({ - title : '明细核算月报', - region : 'north', - labelAlign : 'right', - buttonAlign : 'center', - collapsible : true, - collapseMode : 'mini', - split : true, - border : 0, - frame : true, - bodyStyle : 'padding:0px auto;margin:0px', - height : 170, - items : [{ - layout : 'column', - height : 80, - items : [{ - xtype : 'hidden', - name : 'departCoding', - id : 'departCoding' - },{ - xtype : 'hidden', - name : 'invoicePlanDepartCoding', - id : 'invoicePlanDepartCoding' - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '开始时间', - id : 'startTime', - name : 'startTime', - editable : false, - format : 'Y-m-d H:i', - 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', - allowBlank : false, - anchor : '95%', + title: '明细核算月报', + region: 'north', + labelAlign: 'right', + buttonAlign: 'center', + collapsible: true, + collapseMode: 'mini', + split: true, + border: 0, + frame: true, + bodyStyle: 'padding:0px auto;margin:0px', + height: 170, + items: [{ + layout: 'column', + height: 80, + items: [{ + xtype: 'hidden', + name: 'departCoding', + id: 'departCoding' + }, { + xtype: 'hidden', + name: 'invoicePlanDepartCoding', + id: 'invoicePlanDepartCoding' + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '开始时间', + id: 'startTime', + name: 'startTime', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%', value: new Date(startTime), - theHours : 0, - theMinutes : 0, - listeners : { - specialkey : function(field, e) { + theHours: 0, + theMinutes: 0, + listeners: { + specialkey: function (field, e) { if (e.getKey() == Ext.EventObject.ENTER) { var isOK = field.validate(); - if(isOK){ + if (isOK) { var value = field.getValue(); field.setValue(value); var endTime = Ext.getCmp('endTime'); @@ -354,132 +354,132 @@ } } }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'datefieldWithMin', - fieldLabel : '结束时间', - id : 'endTime', - name : 'endTime', - editable : false, - format : 'Y-m-d H:i', - 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', - allowBlank : false, - anchor : '95%', + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'datefieldWithMin', + fieldLabel: '结束时间', + id: 'endTime', + name: 'endTime', + editable: false, + format: 'Y-m-d H:i', + 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', + allowBlank: false, + anchor: '95%', value: new Date(endTime), - theHours : 23, - theMinutes : 59, - listeners : { - specialkey : function(field, e) { + theHours: 23, + theMinutes: 59, + listeners: { + specialkey: function (field, e) { if (e.getKey() == Ext.EventObject.ENTER) { var isOK = field.validate(); - if(isOK){ + if (isOK) { var value = field.getValue(); field.setValue(value); var departSearch = Ext.getCmp('departSearch'); departSearch.focus(); } - + } } } }] - },{ - columnWidth : .4, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'combo', - id : 'goodsSearch', - name : 'goodsSearch', - queryParam : 'spell', - fieldLabel : '物品名称', - minChars : 0, - valueField : 'id', - displayField : 'displayName', - anchor : '100%', - store : tousseAndDiposableGoodsStore, - pageSize : 100, - width : 400, - listConfig: {width: 300}, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : true, - listeners : { - select : function(combo, record, index) { + }, { + columnWidth: .4, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'combo', + id: 'goodsSearch', + name: 'goodsSearch', + queryParam: 'spell', + fieldLabel: '物品名称', + minChars: 0, + valueField: 'id', + displayField: 'displayName', + anchor: '100%', + store: tousseAndDiposableGoodsStore, + pageSize: 100, + width: 400, + listConfig: { width: 300 }, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true, + listeners: { + select: function (combo, record, index) { Ext.getCmp('goodsSearch').setValue(record.data.showName); } } }] - },{ - columnWidth : 0.25, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'combo', - fieldLabel : "一次性物品类型", - displayField : 'typeName', - valueField : 'typeValue', - store : diposableGooodsStore, - forceSelection : true, - editable : false, - triggerAction : 'all', - name : "disposableGoodsType", - id : "disposableGoodsType", - value : '', - anchor : '95%' + }, { + columnWidth: 0.25, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'combo', + fieldLabel: "一次性物品类型", + displayField: 'typeName', + valueField: 'typeValue', + store: diposableGooodsStore, + forceSelection: true, + editable: false, + triggerAction: 'all', + name: "disposableGoodsType", + id: "disposableGoodsType", + value: '', + anchor: '95%' }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - hidden : !sstsConfig.departMonthReportAndDetailReportEnableSupplyRoomCondition, - items : [{ - xtype : 'combo', - id : 'orgUnitCoding', - name : 'orgUnitCoding', - queryParam : 'spell', - fieldLabel : '供应室', - minChars : 0, - valueField : 'id', - displayField : 'name', - store : departJsonStore, - forceSelection : true, - lazyInit : true, - triggerAction : 'all', - hideTrigger : true, - typeAhead : false, - allowBlank : true, - anchor : '95%', - listeners:{ - select:function(combo, record, index){ + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + hidden: !sstsConfig.departMonthReportAndDetailReportEnableSupplyRoomCondition, + items: [{ + xtype: 'combo', + id: 'orgUnitCoding', + name: 'orgUnitCoding', + queryParam: 'spell', + fieldLabel: '供应室', + minChars: 0, + valueField: 'id', + displayField: 'name', + store: departJsonStore, + forceSelection: true, + lazyInit: true, + triggerAction: 'all', + hideTrigger: true, + typeAhead: false, + allowBlank: true, + anchor: '95%', + listeners: { + select: function (combo, record, index) { Ext.getCmp("departCoding").setValue(record.get('id')); } } }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'multiSelect', - fieldLabel : '物品类型', - id : 'tousseType', - name : 'tousseType', - valueField : 'value', - displayField : 'value', - store : tousseTypeStore, - forceSelection : false, - value:'全部', - editable : false, - mode : 'local', - triggerAction : 'all', - anchor : '95%', - listeners : { + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'multiSelect', + fieldLabel: '物品类型', + id: 'tousseType', + name: 'tousseType', + valueField: 'value', + displayField: 'value', + store: tousseTypeStore, + forceSelection: false, + value: '全部', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%', + listeners: { select: function (combo, record, index) { //1、如果选中“全部”的项,则把所有的项选中,反之全部取消选择 if (record.get('value') == ALL) { @@ -489,34 +489,34 @@ combo.deselectAll(); } } - + //2、如果已经选中所有的项,则把“全部”项选中,反之把“全部”项取消选择 var selectAll = true; - combo.store.each(function(record) { + combo.store.each(function (record) { if (record.get('value') != ALL && !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); } - if(Ext.getCmp('disposableGoodsType')){ - if(Ext.getCmp('tousseType').getValue() == '全部' - || Ext.getCmp('tousseType').getValue() == '一次性物品'){ + if (Ext.getCmp('disposableGoodsType')) { + if (Ext.getCmp('tousseType').getValue() == '全部' + || Ext.getCmp('tousseType').getValue() == '一次性物品') { Ext.getCmp('disposableGoodsType').setDisabled(false); - }else{ + } else { Ext.getCmp('disposableGoodsType').setValue('全部'); Ext.getCmp('disposableGoodsType').setDisabled(true); } //旧的高值耗材才显示高值耗材类型,新的高值耗材不显示 - if(Ext.getCmp('tousseType').getValue() == '高值耗材' && !sstsConfig.enableExpensiveGoods){ + if (Ext.getCmp('tousseType').getValue() == '高值耗材' && !sstsConfig.enableExpensiveGoods) { Ext.getCmp('goodsTypeElement').show(); - }else{ + } else { Ext.getCmp('goodsType').setValue('全部'); Ext.getCmp('goodsTypeElement').hide(); } @@ -526,270 +526,270 @@ } }] }, { - columnWidth : .2, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'combo', - fieldLabel : '查询类型', - id : 'searchType', - name : 'searchType', - valueField : 'value', - displayField : 'value', - store : searchTypeStore, - forceSelection : true, - value:'精确查询', - editable : false, - mode : 'local', - triggerAction : 'all', - anchor : '95%' + columnWidth: .2, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'combo', + fieldLabel: '查询类型', + id: 'searchType', + name: 'searchType', + valueField: 'value', + displayField: 'value', + store: searchTypeStore, + forceSelection: true, + value: '精确查询', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%' }] - },{ - columnWidth : .21, - layout : 'form', - labelWidth : 120, - items : [{ - xtype : 'textfield', - fieldLabel : '批次', - id : 'batch', - name : 'batch', - editable:false, - allowBlank : true, - anchor : '95%' - }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - labelSeparator : '申请科室:', - id:"ddddd", - items : [{ - xtype : 'multiSelect', - id : 'invoicePlanDepartSearch', - name : 'invoicePlanDepartSearch', - valueField : 'id', - displayField : 'name', - minChars : 0, - queryParam : 'spell', - allowBlank : true, - store : appDepartJsonStore, - mode : departMode, - triggerAction : 'all', - anchor : '95%', + }, { + columnWidth: .21, + layout: 'form', + labelWidth: 120, + items: [{ + xtype: 'textfield', + fieldLabel: '批次', + id: 'batch', + name: 'batch', + editable: false, + allowBlank: true, + anchor: '95%' + }] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + labelSeparator: '申请科室:', + id: "ddddd", + items: [{ + xtype: 'multiSelect', + id: 'invoicePlanDepartSearch', + name: 'invoicePlanDepartSearch', + valueField: 'id', + displayField: 'name', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: appDepartJsonStore, + mode: departMode, + triggerAction: 'all', + anchor: '95%', listeners: { - change :function(field,newVal,oldVal){ - if(newVal == "" && Ext.getCmp('departSearch').getRawValue() == ""){ + change: function (field, newVal, oldVal) { + if (newVal == "" && Ext.getCmp('departSearch').getRawValue() == "") { Ext.getCmp('departGroup').setDisabled(false); - }else{ + } else { Ext.getCmp('departGroup').setDisabled(true); } - }, - blur:function(that){ - if(Ext.getCmp('invoicePlanDepartSearch').getRawValue() == "" && Ext.getCmp('departSearch').getRawValue() == ''){ + }, + blur: function (that) { + if (Ext.getCmp('invoicePlanDepartSearch').getRawValue() == "" && Ext.getCmp('departSearch').getRawValue() == '') { Ext.getCmp('departGroup').setDisabled(false); } } } }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - labelSeparator : '结算科室:', - items : [{ - xtype : 'multiSelect', - id : 'departSearch', - name : 'departSearch', - valueField : 'id', - displayField : 'name', - minChars : 0, - queryParam : 'spell', - allowBlank : true, - store : appDepartJsonStore, - mode : departMode, - triggerAction : 'all', - anchor : '95%', + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + labelSeparator: '结算科室:', + items: [{ + xtype: 'multiSelect', + id: 'departSearch', + name: 'departSearch', + valueField: 'id', + displayField: 'name', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: appDepartJsonStore, + mode: departMode, + triggerAction: 'all', + anchor: '95%', listeners: { - change :function(field,newVal,oldVal){ - if(newVal == "" && Ext.getCmp('invoicePlanDepartSearch').getRawValue() == ""){ + change: function (field, newVal, oldVal) { + if (newVal == "" && Ext.getCmp('invoicePlanDepartSearch').getRawValue() == "") { Ext.getCmp('departGroup').setDisabled(false); - }else{ + } else { Ext.getCmp('departGroup').setDisabled(true); } - }, - blur:function(that){ - if(Ext.getCmp('invoicePlanDepartSearch').getRawValue() == "" && Ext.getCmp('departSearch').getRawValue() == ''){ + }, + blur: function (that) { + if (Ext.getCmp('invoicePlanDepartSearch').getRawValue() == "" && Ext.getCmp('departSearch').getRawValue() == '') { Ext.getCmp('departGroup').setDisabled(false); } } } }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - labelSeparator : '科室分组:', - items : [{ - xtype : 'multiSelect', - id : 'departGroup', - name : 'departGroup', - valueField : 'id', - displayField : 'shift', - minChars : 0, - queryParam : 'spell', - allowBlank : true, - store : departGroupStore, - mode : 'remote', - triggerAction : 'all', - anchor : '95%', + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + labelSeparator: '科室分组:', + items: [{ + xtype: 'multiSelect', + id: 'departGroup', + name: 'departGroup', + valueField: 'id', + displayField: 'shift', + minChars: 0, + queryParam: 'spell', + allowBlank: true, + store: departGroupStore, + mode: 'remote', + triggerAction: 'all', + anchor: '95%', listeners: { - change :function(field,newVal,oldVal){ - if(newVal == ""){ + change: function (field, newVal, oldVal) { + if (newVal == "") { Ext.getCmp('invoicePlanDepartSearch').setDisabled(false); Ext.getCmp('departSearch').setDisabled(false); - }else{ + } else { Ext.getCmp('invoicePlanDepartSearch').setDisabled(true); Ext.getCmp('departSearch').setDisabled(true); } - }, - blur:function(that){ - if(Ext.getCmp('departGroup').getRawValue() == ''){ + }, + blur: function (that) { + if (Ext.getCmp('departGroup').getRawValue() == '') { Ext.getCmp('invoicePlanDepartSearch').setDisabled(false); Ext.getCmp('departSearch').setDisabled(false); } } } }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 150, - items : [{ - xtype : 'combo', - fieldLabel : '显示一次性物品批次', - id : 'showBatch', - name : 'showBatch', - valueField : 'value', - displayField : 'value', - store : new Ext.data.SimpleStore( { - fields : ['value'], - data : [ ['是'],['否'] ] + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 150, + items: [{ + xtype: 'combo', + fieldLabel: '显示一次性物品批次', + id: 'showBatch', + name: 'showBatch', + valueField: 'value', + displayField: 'value', + store: new Ext.data.SimpleStore({ + fields: ['value'], + data: [['是'], ['否']] }), - forceSelection : true, - value:'是', - editable : false, - mode : 'local', - triggerAction : 'all', - anchor : '95%' + forceSelection: true, + value: '是', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%' }] - },{ - columnWidth : .25, - layout : 'form', - labelWidth : 120, - id:'goodsTypeElement', - hidden : true, - items : [{ - xtype : 'combo', - fieldLabel : '高值耗材类型', - id : 'goodsType', - name : 'goodsType', - valueField : 'value', - displayField : 'value', - store : goodsTypeStore, - forceSelection : true, - value:'全部', - editable : false, - mode : 'local', - triggerAction : 'all', - anchor : '95%' + }, { + columnWidth: .25, + layout: 'form', + labelWidth: 120, + id: 'goodsTypeElement', + hidden: true, + items: [{ + xtype: 'combo', + fieldLabel: '高值耗材类型', + id: 'goodsType', + name: 'goodsType', + valueField: 'value', + displayField: 'value', + store: goodsTypeStore, + forceSelection: true, + value: '全部', + editable: false, + mode: 'local', + triggerAction: 'all', + anchor: '95%' }] - },{ - columnWidth : 0.2, - layout : 'form', - labelWidth : 120, - id : 'patternOfReportLable', - items : [{ - xtype : 'combo', - fieldLabel : "报表格式", - displayField : 'name', - valueField : 'id', - store : patternOfReport, - forceSelection : false, - editable : false, - mode : 'local', - triggerAction : 'all', - name : "patternOfReport", - id : "patternOfReport", - anchor : '95%', + }, { + columnWidth: 0.2, + layout: 'form', + labelWidth: 120, + id: 'patternOfReportLable', + items: [{ + xtype: 'combo', + fieldLabel: "报表格式", + displayField: 'name', + valueField: 'id', + store: patternOfReport, + forceSelection: false, + editable: false, + mode: 'local', + triggerAction: 'all', + name: "patternOfReport", + id: "patternOfReport", + anchor: '95%', listeners: { - change :function(field,newVal,oldVal){ - if(newVal == "singleDepart"){ + change: function (field, newVal, oldVal) { + if (newVal == "singleDepart") { var departSearch = Ext.getCmp('invoicePlanDepartSearch'); departSearch.setValue(""); Ext.getCmp('invoicePlanDepartCoding').setValue(""); } - } + } } }] }] }], - buttons:[{ - xtype : 'button', - text : '查询', - minWidth : 70, - iconCls : 'icon_search', - handler : function() { + buttons: [{ + xtype: 'button', + text: '查询', + minWidth: 70, + iconCls: 'icon_search', + handler: function () { reloadReport(); } - },{ - xtype : 'button', - text : '重置', - minWidth : 70, - iconCls : 'icon_set', - handler : function() { + }, { + xtype: 'button', + text: '重置', + minWidth: 70, + iconCls: 'icon_set', + handler: function () { $Id('departSearch').value = ""; Ext.getCmp('departSearch').setValue(""); $Id('startTime').value = ""; $Id('endTime').value = ""; } }] }); - - + + var reportForm = new Ext.Panel({ - frame:false,//渲染面板 - autoScroll:true,//自动显示滚动条 - collapsible:true,//允许展开和收缩 - bodyPadding:5, - html:'' + frame: false,//渲染面板 + autoScroll: true,//自动显示滚动条 + collapsible: true,//允许展开和收缩 + bodyPadding: 5, + html: '' }); - + var viewport = new Ext.Viewport({ - layout : 'border', - items : [form, { - id:'reportPanel', - region : 'center', - margins : '0 0 0 0', - layout : 'fit', - items : reportForm + layout: 'border', + items: [form, { + id: 'reportPanel', + region: 'center', + margins: '0 0 0 0', + layout: 'fit', + items: reportForm }] }); - if(supplyRoomType == supplyRoomTypeFirstSupplyRoom || supplyRoomType == supplyRoomTypeSecondSupplyRoom || supplyRoomType == supplyRoomTypeExpensiveGoods){ + if (supplyRoomType == supplyRoomTypeFirstSupplyRoom || supplyRoomType == supplyRoomTypeSecondSupplyRoom || supplyRoomType == supplyRoomTypeExpensiveGoods) { departJsonStore.load(); appDepartJsonStore.load(); - }else{ + } else { Ext.getCmp('invoicePlanDepartCoding').setValue(orgUnitCoding); var departSearch = Ext.getCmp('invoicePlanDepartSearch'); departSearch.setValue(orgUnitName); } reloadReport(); - - if(dataForPatternOfReport.length < 1){ + + if (dataForPatternOfReport.length < 1) { Ext.getCmp("patternOfReportLable").setVisible(false); - }else if(dataForPatternOfReport.length > 1){ - Ext.getCmp('patternOfReport').setValue(getHiddenValueByReportName(reportTypeJson[0].reportName)); + } else if (dataForPatternOfReport.length > 1) { + Ext.getCmp('patternOfReport').setValue(getHiddenValueByReportName(reportTypeJson[0].reportName)); } }); \ No newline at end of file