Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r16319 -r16517 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 16319) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 16517) @@ -1756,7 +1756,8 @@ top.Ext4.define('applicationTreeGrid', { extend: 'top.Ext4.tree.Panel', xtype: 'tree-grid', - height: windowHeight - 200 , // 高度为窗口高度减去基础信息的高度 + height: top.screen.width <= 1280 ? windowHeight * 0.60 : windowHeight - 200, + // height: windowHeight - 200 , // 高度为窗口高度减去基础信息的高度 width: 498, useArrows: true, rootVisible: false, @@ -3321,8 +3322,319 @@ }); } +/** + * 设置自定义过滤条件,用于状态筛选筛选, + * @param field 对应的参数key + */ +function reloadFilterPara(field) { + var parm_s_status = document.getElementById('parm_s_status'); + if (field == 'all'){ + parm_s_status.value = ''; + } + else if (field == 'unFinish' ){ + parm_s_status.value = 'unFinish'; + } + else if (field == 'finish'){ + parm_s_status.value = 'finish'; + } + // grid.getStore().reload(); + grid.dwrReload(); +} +/** + * 根据传过来的值来重新加载grid的dwr数据 + * @param fieldValue 传过来的值 + * @param domId dom节点的id + */ +function reloadConditionPara(fieldValue, domId) { + var dom = document.getElementById(domId); + dom.value = fieldValue; + grid.dwrReload(); +} +/** + * 设置隐藏域里的时间筛选过滤 + * @param val 要设定的值 + */ +function reloadHiddenField(val) { + var submitTime = document.getElementById('parm_s_showSubmitTime'); + submitTime.value = val; + grid.dwrReload(); +} + +function reloadTimeField(){ + var startDate = Ext.getCmp("startDate").getValue(); + var endDate = Ext.getCmp("endDate").getValue(); + if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ + Ext.Msg.alert('警告', '日期不能为空!'); + return; + } + var value1 = Date.parse(startDate); + var value2 = Date.parse(endDate); + if (value1 > value2) { + Ext.Msg.alert('警告', '开始日期不能大于结束日期!'); + return; + } + document.getElementById('parm_s_startTime').value = value1; + document.getElementById('parm_s_endTime').value = value2; + document.getElementById('parm_s_timeSearchFmt').value = sstsConfig.timeSearchFmt; + grid.dwrReload(); +} + +/** + * 创建搜索的工具栏 + * @param searchComboConfig + * @returns {[*,*,*,*,*,*,*,string,*]} + */ +function createSearchTbar(searchComboConfig) { + var tbar2 = [ + {hidden: sstsConfig.recyclingApplicationVersion != 2, text: '状态筛选:'}, + searchComboConfig.quickScreenCombo, + {hidden: !sstsConfig.showTimeSearch, text: '开始日期:'}, + { + xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + fieldLabel: '开始日期', + hidden: !sstsConfig.showTimeSearch, + name: 'startDate', + format: sstsConfig.timeSearchFmt || 'Y-m-d', + name: 'startDate', + id: 'startDate', + readOnly: false, + editable: false, + width: sstsConfig.timeSearchFmt ? 130 : 100 + }, + {hidden: !sstsConfig.showTimeSearch, text: '结束日期:'}, + { + xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + fieldLabel: '结束日期', + hidden: !sstsConfig.showTimeSearch, + name: 'endDate', + id: 'endDate', + readOnly: false, + editable: false, + // 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', + format: sstsConfig.timeSearchFmt || 'Y-m-d', + width: sstsConfig.timeSearchFmt ? 130 : 100 + }, + {hidden: !sstsConfig.isShowDeptGroup, text: '按科室分组过滤:'}, + searchComboConfig.departmentGroupCombo, + { + hidden: !sstsConfig.showTimeSearch, + xtype: 'button', + text: '查询', + // iconCls : 'btn_ext_application_search', + iconCls: 'icon_search', + handler: reloadTimeField + }, + '->', + { + //加->表示往右居中 + text: '全部申请单', + hidden: true, + iconCls: 'btn_ext_add_tousse', + handler: function () { + //调用父级窗口的添加tab方法 + top.addTabJquery('showAllApplicationForm', '全部申请单', top.DisinfectsystemTreeData[0].children[0].href); + // window.parent.addTabJquery(id,title,href); + } + } + ]; + return tbar2; +} + +function createOperationTbar(isSupplyRoomUser) { + return [ + { + text: '借物', + iconCls: 'btn_ext_add_tousse', + hidden: SSTS_borrow_Create || (sstsConfig.recyclingApplicationVersion == 2 && !isSupplyRoomUser), + handler: function () { + addAndEditTousseLease(''); + } + }, { + text: '删除', + iconCls: 'btn_ext_application_del', + hidden: SSTS_RecycApplication_Delete, + handler: function () { + deleteRecyclingApplication(grid); + } + }, { + text: '终止', + iconCls: 'btn_ext_pause', + id: 'endBtn', + hidden: SSTS_Invoice_End, + handler: function () { + terminateInvoicePlan(grid); + } + }, { + type: 'button', + text: '打印' + invoicePlanPrintButtonName, + iconCls: 'icon_print', + hidden: SSTS_PrintApplicationGoods, + menu: new Ext.menu.Menu({ + items: [ + {text: '批量打印' + invoicePlanPrintButtonName, hidden: !isSupplyRoomUser, handler: bathPrint}, + { + text: '打印一次性物品', handler: function () { + var ids = getSelectedIds(); + if (ids != null && ids != false) { + top.Ext.MessageBox.confirm("请确认", "要打印所选的申请单的一次性物品吗?", + function (btn) { + if (btn == 'yes') { + //通过json stringify和parse克隆js对象 + var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); + config.isPrintTousse = false; + config.isPrintDisinfectGoods = false; + config.isPrintDressing = false; + config.isPrintDisposableGoods = true; + config.isMergePrintTousseAndDisposable = false; + config.printApplyInfo = false; + var printParams = getPrintJsonParams("print", ids, config); + if (isUndefinedOrNullOrEmpty(printConfig.invoicePlan_disposableGoods)) { + formTypeOfPrinted = "invoicePlan"; + } else { + formTypeOfPrinted = "invoicePlan_disposableGoods"; + } + + printApplyGoods(printParams, 0, SSTS_PrintApplicationGoods, null); + } + }); + } + } + }, + { + text: '打印器械包及消毒物品', handler: function () { + var ids = getSelectedIds(); + if (ids != null && ids != false) { + top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的器械包及消毒物品吗?", + function (btn) { + if (btn == 'yes') { + //通过json stringify和parse克隆js对象 + var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); + config.isPrintTousse = true; + config.isPrintDisinfectGoods = true; + config.isPrintDressing = true; + config.isPrintDisposableGoods = false; + config.printApplyInfo = false; + + var printParams = getPrintJsonParams("print", ids, config); + formTypeOfPrinted = "invoicePlan"; + printApplyGoods(printParams, 0, SSTS_PrintApplicationGoods, null); + } + }); + } + } + }, { + text: '打印全部物品', handler: function () { + var ids = getSelectedIds(); + if (ids != null && ids != false) { + top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的全部物品吗?", + function (btn) { + if (btn == 'yes') { + //通过json stringify和parse克隆js对象 + var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); + config.isPrintTousse = true; + config.isPrintDisinfectGoods = true; + config.isPrintDressing = true; + config.isPrintDisposableGoods = true; + config.printApplyInfo = false; + + var printParams = getPrintJsonParams("print", ids, config); + formTypeOfPrinted = "invoicePlan"; + printApplyGoods(printParams, 0, SSTS_PrintApplicationGoods, null); + } + }); + } + } + }, { + text: '器械包分组打印', hidden: !sstsConfig.enableInvoicePlanTousseGroupPrint, handler: function () { + var ids = getSelectedIds(); + if (ids == false) { + return; + } + var selectResult = showSelectTousseGroup(); + if (selectResult == null && selectResult == undefined) { + return; + } + var tousseGroupIds = selectResult; + if (tousseGroupIds == '' || tousseGroupIds == null) { + showResult('请选择器械包分组!'); + return; + } + if (ids != null && ids != false) { + top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的物品吗?", + function (btn) { + if (btn == 'yes') { + //通过json stringify和parse克隆js对象 + var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); + config.isPrintTousse = true; + config.isPrintDisinfectGoods = true; + config.isPrintDressing = true; + config.isPrintDisposableGoods = false; + config.printApplyInfo = false; + config.tousseGroupIds = tousseGroupIds; + + var printParams = getPrintJsonParams("tousseGroupPrint", ids, config); + formTypeOfPrinted = "invoicePlan"; + printApplyGoods(printParams, 0, SSTS_PrintApplicationGoods, null); + } + }); + } + } + }] + }) + }, { + text: '设为已打印', + iconCls: 'btn_ext_application_edit', + hidden: SSTS_PrintApplicationGoods, + handler: function () { + updatePrintState(grid); + } + } + ]; +} + +/** + * 创建按科室分组下拉选项 + * @returns + */ +function createDeptGroupCombo() { + var deptGroupStore = new Ext.data.Store({ + proxy: new Ext.data.HttpProxy({ + url: WWWROOT + '/disinfectSystem/baseData/departmentGroupAction!loadDeptGroup.do', + method: 'POST' + }), + reader: new Ext.data.JsonReader({ + root: 'data', + totalProperty: 'totalCount' + }, [ + {name: 'departCodes', mapping: 'departCodes'}, + {name: 'name', mapping: 'name'} + ] + ) + }); + + var departmentGroupCombo = { + xtype: 'combo', + fieldLabel: '状态筛选', + store: deptGroupStore, + width: 200, + triggerAction: 'all', + displayField: 'name', + valueField: 'departCodes', + forceSelection: true, + value: '全部', + editable: false, + listeners: { + select: function (combo, record, index) { + var deptGroupId = record.get('departCodes'); + reloadConditionPara(deptGroupId, 'parm_s_departCodes'); + } + } + }; + return departmentGroupCombo; +} + Ext.onReady(function() { Ext.QuickTips.init(); @@ -3453,55 +3765,6 @@ ] }); - /** - * 设置自定义过滤条件,用于状态筛选筛选, - * @param field 对应的参数key - */ - function reloadFilterPara(field) { - var parm_s_status = document.getElementById('parm_s_status'); - if (field == 'all'){ - parm_s_status.value = ''; - } - else if (field == 'unFinish' ){ - parm_s_status.value = 'unFinish'; - } - else if (field == 'finish'){ - parm_s_status.value = 'finish'; - } - // grid.getStore().reload(); - grid.dwrReload(); - } - - /** - * 设置隐藏域里的时间筛选过滤 - * @param val 要设定的值 - */ - function reloadHiddenField(val) { - var submitTime = document.getElementById('parm_s_showSubmitTime'); - submitTime.value = val; - grid.dwrReload(); - } - - function reloadTimeField(){ - var startDate = Ext.getCmp("startDate").getValue(); - var endDate = Ext.getCmp("endDate").getValue(); - if (isUndefinedOrNullOrEmpty(startDate) || isUndefinedOrNullOrEmpty(endDate)){ - Ext.Msg.alert('警告', '日期不能为空!'); - return; - } - var value1 = Date.parse(startDate); - var value2 = Date.parse(endDate); - if (value1 > value2) { - Ext.Msg.alert('警告', '开始日期不能大于结束日期!'); - return; - } - document.getElementById('parm_s_startTime').value = value1; - document.getElementById('parm_s_endTime').value = value2; - document.getElementById('parm_s_timeSearchFmt').value = sstsConfig.timeSearchFmt; - grid.dwrReload(); - } - - //状态筛选combo Store var quickScreenStatus = new Ext.data.SimpleStore({ fields: ['key', 'val'], @@ -3563,8 +3826,21 @@ } }; + var departmentGroupCombo = createDeptGroupCombo(); var isSupplyRoomUser = validateIsSupplyRoomUser(); + + //搜索的tbar + var searchTbar = new Ext.Toolbar({ + items : createSearchTbar({ + quickScreenCombo : quickScreenCombo, + departmentGroupCombo : departmentGroupCombo + }) + }); + + //操作的tbar + var operationTbar = createOperationTbar(isSupplyRoomUser); + var tbar = [{ text : '申请物品', iconCls : 'btn_ext_add_tousse', @@ -3626,202 +3902,14 @@ handler : function() { addAndEditForeignProxyDisinfection(''); } - },{ - text : '借物', - iconCls : 'btn_ext_add_tousse', - hidden : SSTS_borrow_Create || (sstsConfig.recyclingApplicationVersion == 2 && !isSupplyRoomUser), - handler : function() { - addAndEditTousseLease(''); - } - }, { - text : '删除', - iconCls : 'btn_ext_application_del', - hidden : SSTS_RecycApplication_Delete, - handler : function() { - deleteRecyclingApplication(grid); - } - },{ - text : '终止', - iconCls : 'btn_ext_pause', - id : 'endBtn', - hidden : SSTS_Invoice_End, - handler : function(){ - terminateInvoicePlan(grid); - } - },{ - type : 'button', - text : '打印' + invoicePlanPrintButtonName, - iconCls : 'icon_print', - hidden:SSTS_PrintApplicationGoods, - menu: new Ext.menu.Menu({ - items: [ - {text: '批量打印' + invoicePlanPrintButtonName, hidden: !isSupplyRoomUser,handler: bathPrint}, - {text: '打印一次性物品', handler:function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选的申请单的一次性物品吗?", - function(btn) { - if (btn == 'yes') { - //通过json stringify和parse克隆js对象 - var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); - config.isPrintTousse = false; - config.isPrintDisinfectGoods = false; - config.isPrintDressing = false; - config.isPrintDisposableGoods = true; - config.isMergePrintTousseAndDisposable = false; - config.printApplyInfo = false; - var printParams = getPrintJsonParams("print", ids , config); - if(isUndefinedOrNullOrEmpty(printConfig.invoicePlan_disposableGoods)){ - formTypeOfPrinted = "invoicePlan"; - }else{ - formTypeOfPrinted = "invoicePlan_disposableGoods"; - } - - printApplyGoods(printParams,0,SSTS_PrintApplicationGoods,null); - } - }); - } - } - }, - {text: '打印器械包及消毒物品', handler: function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的器械包及消毒物品吗?", - function(btn) { - if (btn == 'yes') { - //通过json stringify和parse克隆js对象 - var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); - config.isPrintTousse = true; - config.isPrintDisinfectGoods = true; - config.isPrintDressing = true; - config.isPrintDisposableGoods = false; - config.printApplyInfo = false; - - var printParams = getPrintJsonParams("print", ids , config); - formTypeOfPrinted = "invoicePlan"; - printApplyGoods(printParams,0,SSTS_PrintApplicationGoods,null); - } - }); - } - } - },{text: '打印全部物品', handler: function(){ - var ids = getSelectedIds(); - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的全部物品吗?", - function(btn) { - if (btn == 'yes') { - //通过json stringify和parse克隆js对象 - var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); - config.isPrintTousse = true; - config.isPrintDisinfectGoods = true; - config.isPrintDressing = true; - config.isPrintDisposableGoods = true; - config.printApplyInfo = false; + } + ]; - var printParams = getPrintJsonParams("print", ids , config); - formTypeOfPrinted = "invoicePlan"; - printApplyGoods(printParams,0,SSTS_PrintApplicationGoods,null); - } - }); - } - } - },{ - text: '器械包分组打印', hidden:!sstsConfig.enableInvoicePlanTousseGroupPrint, handler: function(){ - var ids = getSelectedIds(); - if(ids == false){ - return; - } - var selectResult = showSelectTousseGroup(); - if(selectResult == null && selectResult == undefined){ - return; - } - var tousseGroupIds = selectResult; - if(tousseGroupIds == '' || tousseGroupIds == null){ - showResult('请选择器械包分组!'); - return; - } - if (ids != null && ids != false){ - top.Ext.MessageBox.confirm("请确认", "要打印所选申请单的物品吗?", - function(btn) { - if (btn == 'yes') { - //通过json stringify和parse克隆js对象 - var config = JSON.parse(JSON.stringify(printConfig.invoicePlan)); - config.isPrintTousse = true; - config.isPrintDisinfectGoods = true; - config.isPrintDressing = true; - config.isPrintDisposableGoods = false; - config.printApplyInfo = false; - config.tousseGroupIds = tousseGroupIds; + //如果屏幕分辨率大于1280,则tbar和operationTbar放在一行 + if (top.screen.width >= 1280){ + tbar = tbar.concat(operationTbar); + } - var printParams = getPrintJsonParams("tousseGroupPrint", ids , config); - formTypeOfPrinted = "invoicePlan"; - printApplyGoods(printParams,0,SSTS_PrintApplicationGoods,null); - } - }); - } - } - }] - }) - },{ - text : '设为已打印', - iconCls : 'btn_ext_application_edit', - hidden : SSTS_PrintApplicationGoods, - handler : function(){ - updatePrintState(grid); - } - },{ - hidden : sstsConfig.recyclingApplicationVersion != 2, - text : '状态筛选:' - }, - quickScreenCombo, - // { text : '时间筛选:'},submitTimeCombo, - { - hidden : !sstsConfig.showTimeSearch, - text : '开始日期:' - }, { - xtype : sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', - fieldLabel : '开始日期', - hidden : !sstsConfig.showTimeSearch, - name : 'startDate', - format : sstsConfig.timeSearchFmt || 'Y-m-d', - name : 'startDate', - id : 'startDate', - readOnly : false, - editable : false, - width : sstsConfig.timeSearchFmt ? 130 : 100 - }, { - hidden : !sstsConfig.showTimeSearch, - text : '结束日期:' - }, { - xtype : sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', - fieldLabel : '结束日期', - hidden : !sstsConfig.showTimeSearch, - name : 'endDate', - id : 'endDate', - readOnly : false, - editable : false, - // 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', - format : sstsConfig.timeSearchFmt || 'Y-m-d', - width : sstsConfig.timeSearchFmt ? 130 : 100 - },{ - hidden : !sstsConfig.showTimeSearch, - xtype : 'button', - text : '查询', - // iconCls : 'btn_ext_application_search', - iconCls : 'icon_search', - handler : reloadTimeField - }, - '->',{ - //加->表示往右居中 - text : '全部申请单', - hidden: true, - iconCls : 'btn_ext_add_tousse', - handler : function(){ - //调用父级窗口的添加tab方法 - top.addTabJquery('showAllApplicationForm','全部申请单',top.DisinfectsystemTreeData[0].children[0].href); - // window.parent.addTabJquery(id,title,href); - } - }]; // 省医要求:如果是科室申领,默认申请单是未提交状态(省医才有版本2) if (recyclingApplicationVersion == 2 && listType != 'all'){ @@ -3845,7 +3933,17 @@ plugins: filters, autoExpandColumn : 'operationRemark', renderTo : 'gridDiv', - frame : false + frame : false, + listeners:{ + 'render' : function(){ + // tbar分行 + if (top.screen.width < 1280){ + new Ext.Toolbar({items: operationTbar}).render(this.tbar); + } + //搜索的工具栏另开一行 + searchTbar.render(this.tbar); + } + } }, readerDetail, RecyclingApplicationTableManager.findRecyclingApplicationTableList,