Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r27043 -r27290 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 27043) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 27290) @@ -283,27 +283,50 @@ * @returns {*} */ function showSelectUser(shiftType){ - var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectUser.jsp?allowNull=false&onlyOneOrg=true&resultType=code&tabType=orgUnit&sameLevel=yes&range=all"; + var params = { + allowNull:false, + onlyOneOrg:true, + resultType:'code', + tabType:'orgUnit', + sameLevel:'yes', + range:'all' + } + + var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectUser.jsp"; + if (!isUndefinedOrNullOrEmpty(shiftType)){ - url += "&shiftType=" + shiftType; + params.shiftType = shiftType; } - return openModalWindow(url, "选择回收员", "1000", "750"); + + return openModalWindowForExt(url,params, "选择用户", "1000", "750"); } /** * 选择器械包分组,根据分组进行发货计划的打印 * @returns */ function showSelectTousseGroup(){ - var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseGroup.jsp?allowNull=false&resultType=code"; - return openModalWindow(url, "选择器械包分组", "1000", "750"); + var params = { + allowNull:false, + resultType:'code' + } + + var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectTousseGroup.jsp"; + + return openModalWindowForExt(url,params, "选择器械包分组", "1000", "750"); } /** * 选择器械包分组,根据分组进行发货计划的打印 * @returns */ function showSelectDepartmentGroup(){ - var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectDepartGroup.jsp?allowNull=false&resultType=code"; - return openModalWindow(url, "选择回收科室分组", "1000", "750"); + var params = { + allowNull:false, + resultType:'code' + } + + var url = WWWROOT+"/disinfectsystem/recyclingApplication/selectDepartGroup.jsp"; + + return openModalWindowForExt(url,params, "选择回收科室分组", "1000", "750"); } function sumTotal(store){ if(store.getCount()!=0){ @@ -1958,86 +1981,102 @@ function bathPrint(){ var shiftType = getShiftTypeCookie() var selectResult = showSelectUser(shiftType); - if(selectResult == null && selectResult == undefined){ + + if(selectResult == undefined){ return; - } - var id = selectResult.split("&#;")[0]; - if(id == '' || id == null){ - showResult('请选择对应的班次!'); - return; - } - var config = printConfig.invoicePlan; - var printParams = getPrintJsonParams("batchPrint", id , config); - function doBatchPrintService(repeat){ - var mask; - if (!isIE6OrIE7){ - createMask.call(objMask,'printMask','正在处理批量打印请求,请稍候...',Ext.getBody(),true); - objMask.printMask.show(); - }else{ - mask = new Ext.LoadMask(Ext.getBody(), { msg: '正在处理批量打印请求,请稍候...'}); - mask.show(); - } - //如需打印看效果需要 设一下 repeat = true; - printParams.printScope.reprintTodayPrintedTousseItem = repeat; - RecyclingApplicationTableManager.findPrintRecyclingGoods(JSON.stringify(printParams) , function(result){ - var obj = JSON.parse(result); - //如果批量打印发货计划的版本为1时 - if(sstsConfig.batchPrintInvoicePlanVersion == 1){ - commonEquipmentDeliveryPlanList(obj); - if (!isIE6OrIE7){ - createMask.call(objMask,'printMask','正在处理批量打印请求,请稍候...',Ext.getBody(),true); - objMask.printMask.show(); - }else{ - mask = new Ext.LoadMask(Ext.getBody(), { msg: '正在处理批量打印请求,请稍候...'}); - mask.show(); + }else { + var loop = setInterval(function() { + if(selectResult.hidden) { + clearInterval(loop); + + var returnValue = selectResult.returnValue || ''; + + if(returnValue == ''){ + return ''; + } + + var id = returnValue.split("&#;")[0]; + if(id == '' || id == null){ + showResult('请选择对应的班次!'); + return; } - return ; - } - if (!isIE6OrIE7){ - objMask.printMask.hide(); - } - else { - mask.hide(); - } - if (obj.success){ - if (sstsConfig.isShowNoPrintList && obj.noPrintList){ - showResult("如下科室未填写申请单:【" + obj.noPrintList + "】","",-1); - } - var newP = top.Ext.MessageBox.show({ - title:'请等待', - msg:'打印中……', - width:350, - progress:true, - closable:false - }); - formTypeOfPrinted = "invoicePlan"; - printByJsonPrintObject(obj, newP,false,0,true); - } - else{ - showResult(obj.message); - } - }); - } - if(sstsConfig.reprintTodayPrintedTousseItem){ - RecyclingApplicationTableManager.haveTodayPrintedTousseItem(JSON.stringify(printParams),function(result){ - var obj = JSON.parse(result); - if(obj.haveTodayPrinted){ - top.Ext.MessageBox.confirm("请确认","部分申请单已打印,是否重复打印", - function(button, text) { - if ("yes" == button){ - doBatchPrintService(true); + var config = printConfig.invoicePlan; + var printParams = getPrintJsonParams("batchPrint", id , config); + + function doBatchPrintService(repeat){ + var mask; + if (!isIE6OrIE7){ + createMask.call(objMask,'printMask','正在处理批量打印请求,请稍候...',Ext.getBody(),true); + objMask.printMask.show(); + }else{ + mask = new Ext.LoadMask(Ext.getBody(), { msg: '正在处理批量打印请求,请稍候...'}); + mask.show(); + } + //如需打印看效果需要 设一下 repeat = true; + printParams.printScope.reprintTodayPrintedTousseItem = repeat; + RecyclingApplicationTableManager.findPrintRecyclingGoods(JSON.stringify(printParams) , function(result){ + var obj = JSON.parse(result); + //如果批量打印发货计划的版本为1时 + if(sstsConfig.batchPrintInvoicePlanVersion == 1){ + commonEquipmentDeliveryPlanList(obj); + if (!isIE6OrIE7){ + createMask.call(objMask,'printMask','正在处理批量打印请求,请稍候...',Ext.getBody(),true); + objMask.printMask.show(); }else{ - doBatchPrintService(false); + mask = new Ext.LoadMask(Ext.getBody(), { msg: '正在处理批量打印请求,请稍候...'}); + mask.show(); } + return ; } - ); - }else{ - doBatchPrintService(false); - } - }); - }else{ - doBatchPrintService(false); + if (!isIE6OrIE7){ + objMask.printMask.hide(); + } + else { + mask.hide(); + } + if (obj.success){ + if (sstsConfig.isShowNoPrintList && obj.noPrintList){ + showResult("如下科室未填写申请单:【" + obj.noPrintList + "】","",-1); + } + var newP = top.Ext.MessageBox.show({ + title:'请等待', + msg:'打印中……', + width:350, + progress:true, + closable:false + }); + + formTypeOfPrinted = "invoicePlan"; + printByJsonPrintObject(obj, newP,false,0,true); + } + else{ + showResult(obj.message); + } + }); + } + if(sstsConfig.reprintTodayPrintedTousseItem){ + RecyclingApplicationTableManager.haveTodayPrintedTousseItem(JSON.stringify(printParams),function(result){ + var obj = JSON.parse(result); + if(obj.haveTodayPrinted){ + top.Ext.MessageBox.confirm("请确认","部分申请单已打印,是否重复打印", + function(button, text) { + if ("yes" == button){ + doBatchPrintService(true); + }else{ + doBatchPrintService(false); + } + } + ); + }else{ + doBatchPrintService(false); + } + }); + }else{ + doBatchPrintService(false); + } + } + },500); } } @@ -2497,81 +2536,98 @@ } } }, { - text: '器械包分组打印', hidden: !sstsConfig.enableInvoicePlanTousseGroupPrint, handler: function () { + 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); - } - }); - } + if(selectResult == undefined){ + return ''; + }else { + var loop = setInterval(function() { + if(selectResult.hidden) { + clearInterval(loop); + + var tousseGroupIds = selectResult.returnValue || ''; + + if(tousseGroupIds == ''){ + 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); + } + }); + } + } + },500); + } } },{ - text: '打印回收汇总单', hidden: !sstsConfig.printWaitRecyclingInvoicePlanSummary, handler: function () { + text: '打印回收汇总单',hidden: !sstsConfig.printWaitRecyclingInvoicePlanSummary, handler: function () { top.Ext.MessageBox.confirm("请确认", "要打印回收汇总单吗?", function (btn) { if (btn == 'yes') { - var departmentGroupIds = null; if(sstsConfig.printInvoicePlanSummarySelectDepartgroup){ - departmentGroupIds = showSelectDepartmentGroup(); - if (departmentGroupIds == null && departmentGroupIds == undefined) { - return; - } - if (departmentGroupIds == '') { - showResult('请选择回收科室分组!'); - return; - } + var selectResult = showSelectDepartmentGroup(); + + if(selectResult == undefined){ + return ''; + }else { + var loop = setInterval(function() { + if(selectResult.hidden) { + clearInterval(loop); + + var departmentGroupIds = selectResult.returnValue || ''; + + if(departmentGroupIds == ''){ + return ''; + } + + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingRecordAction!printWaitRecyclingInvoicePlanSummary.do', + params : {departmentGroupIds : departmentGroupIds}, + success : function(response, options) { + var obj = Ext.decode(response.responseText); + if(obj.success){ + printWaitRecyclingInvoicePlanSummary(Ext4.Date.format(new Date(),'Y-m-d H:i:s'),obj.printUser,obj); + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingRecordAction!updateInvoicePlanRecyclingSummaryPrintStatus.do', + params : {invoicePlanIds : Ext.encode(obj.invoicePlanIds)} + }) + }else{ + showResult(obj.message); + } + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + if(result && result.message){ + showResult(result.message); + }else{ + showResult('打印失败'); + } + } + }); + } + },500); + } } - - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/recyclingRecordAction!printWaitRecyclingInvoicePlanSummary.do', - params : {departmentGroupIds : departmentGroupIds}, - success : function(response, options) { - var obj = Ext.decode(response.responseText); - if(obj.success){ - printWaitRecyclingInvoicePlanSummary(Ext4.Date.format(new Date(),'Y-m-d H:i:s'),obj.printUser,obj); - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/recyclingRecordAction!updateInvoicePlanRecyclingSummaryPrintStatus.do', - params : {invoicePlanIds : Ext.encode(obj.invoicePlanIds)} - }) - }else{ - showResult(obj.message); - } - }, - failure : function(response, options) { - var result = Ext.decode(response.responseText); - if(result && result.message){ - showResult(result.message); - }else{ - showResult('打印失败'); - } - } - }); } }); }