Index: ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js =================================================================== diff -u -r30129 -r30331 --- ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js (.../rePrintBarcodeWin.js) (revision 30129) +++ ssts-web/src/main/webapp/disinfectsystem/packing/rePrintBarcodeWin.js (.../rePrintBarcodeWin.js) (revision 30331) @@ -525,214 +525,218 @@ text : '打印', iconCls : 'icon_print', handler : function() { - var records = rePrintGrid.getSelectionModel().getSelections(); - if (records.length == 0) { - showResult("请选择要重新打印的器械包!" , null , sstsConfig.messagePauseTimeOnPackingPage); - return false; - } - var printFullName = true; - DWREngine.setAsync(false); - PackingTableManager.isPrintUserFullName(function(print){ - if(!print){ - printFullName = false; - } - }); - DWREngine.setAsync(true); - - var description = ""; - for ( var i = 0, len = records.length; i < len; i++) { - - var tousseObj = {}; - - ids = records[i].data['id']; - var barcodeArray = new Array(); - var barcode = records[i].data['tousseBarcode']; - barcodeArray.push(barcode); - tousseObj.barcodes = barcodeArray; - - if(description != ""){ - description += ","; - } - description += barcode; - - var virtualSeqNums = new Array(); - var virtualBasketSeqNum = records[i].data['virtualBasketSeqNum']; - virtualSeqNums.push(virtualBasketSeqNum); - tousseObj.virtualSeqNums = virtualSeqNums; - - tousseObj.fixedBarcode = records[i].data['fixedBarcode']; - tousseObj.materialsJsonArray = records[i].data['materialsJsonArray']; - tousseObj.tousseName = records[i].data['tousseName']; - tousseObj.tousseType = records[i].get("tousseType"); - - var isDisinfection = false; - - if (tousseObj.tousseType == '消毒物品'){ - isDisinfection = true; - } - tousseObj.isDisinfection = isDisinfection; - tousseObj.isSterile = records[i].data['isSterile']; - - tousseObj.packageType = records[i].data['packType']; - tousseObj.pageType = records[i].data['barcodePaperType']; - // 获取包装方式的简称 - var packageTypeAbbreviation = ''; - DWREngine.setAsync(false); - TousseInstanceTableManager.getPackageTypeAbbreviation(tousseObj.packageType,function(_packageTypeAbbreviation){ - packageTypeAbbreviation = _packageTypeAbbreviation; - }); - DWREngine.setAsync(true); - - tousseObj.packageTypeAbbreviation = packageTypeAbbreviation; - tousseObj.sterilingType = records[i].data['sterilization']; - tousseObj.supplierName = records[i].data['supplierName']; - //灭菌日期、失效日期 - var sterileStartTime = records[i].data['sterileStartTime']; - tousseObj.sterilizationDate = sterileStartTime; - tousseObj.validDate = records[i].data['validUntilStr']; - tousseObj.toolAmount = records[i].data['toolAmount']; - tousseObj.implantAmount = records[i].data['implantAmount']; - - if (sterileStartTime.length > 10){ - tousseObj.sterilizationDate = sterileStartTime.substring(0,10); - } - - - var operator = records[i].data['packer']; - var wrapperForPrint = records[i].data['wrapper']; - var washOperator = records[i].data['washOperator']; - var reviewer = records[i].data['reviewer']; - var sterilizationUser = records[i].data['sterilizationUser']; - if(!printFullName){ - operator = records[i].data['packerCode']; - wrapperForPrint = records[i].data['wrapperCode']; - reviewer = records[i].data['reviewerCode']; - sterilizationUser = records[i].data['sterilizationUserCode']; - washOperator = records[i].data['washOperatorCode']; - } - tousseObj.washOperator = washOperator; - tousseObj.operatorToPrint = operator; - tousseObj.wrapperForPrint = wrapperForPrint; - tousseObj.reviewerToPrint = reviewer; - tousseObj.sterilizationUserToPrint = sterilizationUser; - tousseObj.sterilizerName = records[i].data['sterilizer']; - tousseObj.sterileFrequency = records[i].data['frequency']; - var materialTypeTotal = records[i].data['materialTypeTotal']; - var warningDateStr = records[i].data['warningDateStr']; - - - // 修改配包人,审核人 - var packer2 = records[i].data['packer']; - var reviewer2 = records[i].data['reviewer']; - var packerCode2 = records[i].data['packerCode']; - var reviewerCode2 = records[i].data['reviewerCode']; - tousseObj.packTime = records[i].data['packTime']; - - var foreignTousseAppInfo = null; - var tousseAppID = 0; - if(tousseObj.tousseType == '外来器械包' || tousseObj.tousseType == '外来器械拆分小包'){ + top.Ext.MessageBox.confirm("请确认","确定要重新打印标签吗?",function(button, text) { + if ("yes" == button){ + var records = rePrintGrid.getSelectionModel().getSelections(); + if (records.length == 0) { + showResult("请选择要重新打印的器械包!" , null , sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + var printFullName = true; DWREngine.setAsync(false); - ForeignTousseApplicationTableManager.findForeignTousseApplicationByBarcode(barcode,function(result){ - if(result != null && result.length > 0){ - foreignTousseAppInfo = JSON.parse(result); - foreignTousseAppInfo.supplierName = records[i].get('supplierName'); - tousseAppID = foreignTousseAppInfo.tousseAppID; + PackingTableManager.isPrintUserFullName(function(print){ + if(!print){ + printFullName = false; } }); DWREngine.setAsync(true); - } - tousseObj.foreignTousseApp_id = tousseAppID; - tousseObj.printOrgSource = records[i].data['printOrgSource']; - tousseObj.department = records[i].data['department']; - tousseObj.depart = tousseObj.department; - tousseObj.applicant = (getPrintUserFullName == true)?records[i].data['applicant']:records[i].data['applicantCode']; - tousseObj.maker = (getPrintUserFullName == true)?records[i].data['maker']:records[i].data['makerCode']; - tousseObj.assistant = (getPrintUserFullName == true)?records[i].data['assistant']:records[i].data['assistantCode']; - tousseObj.applicantDepart = records[i].data['applicantDepart']; - tousseObj.remark = records[i].data['remark']; - tousseObj.idCardDefinitionUseAmount = records[i].data['idCardDefinitionUseAmount']; - //打印 - // 必须先调用此代码,然后才能调用Ext.MessageBox.updateProgress - top.Ext.MessageBox.progress('【' + tousseObj.tousseName + '】打印中', '请稍候...'); - top.Ext.MessageBox.updateProgress((i + 1)/records.length,'第' + (i + 1) + '个,共' + records.length + '个'); - - var print = true; - - if(print){ - // 是否打印表格线 - DWREngine.setAsync(false); - ExpirationDateInfoTableManager.getExpirationDateByPackageTypeAndDateFormat(sterileStartTime,'yyyy-MM-dd HH:mm:ss',tousseObj.packageType,function(result){ - var expirationDateObj = JSON.parse(result); - tousseObj.markTousse = expirationDateObj.markTousse; - }); - DWREngine.setAsync(true); - tousseObj.isPrint = records[i].data['isPrint']; - tousseObj.isTraceable = records[i].data['isTraceable']; - tousseObj.printCause = '历史装配记录重新打印'; - tousseObj.logPrintTousse = true; - - top.Ext4.applyIf(tousseObj,records[i].data); - // 外部代理灭菌单上的器械包的打印 - if('外部代理灭菌' == tousseObj.tousseType){ - var hospitalName = ""; - var sterilizer = tousseObj.sterilizerName; - var frequency = tousseObj.sterileFrequency; - var applicant = tousseObj.applicant; - var depart = tousseObj.applicantDepart; - var material = ''; - var printBarcode = barcode; - if(!tousseObj.isTraceable){//不追溯打固定条码 - printBarcode = tousseObj.fixedBarcode; - } - tousseObj.tousseNameWithoutDepart = tousseObj.tousseName; - tousseObj.sterilizationUser = records[i].data['sterilizationUser']; - var printSummaryObj = {'barcode':printBarcode, 'name':tousseObj.tousseName,'tousseNameWithoutDepart':tousseObj.tousseNameWithoutDepart, 'applicant':applicant, 'depart': depart, 'sterilizationDate':tousseObj.sterilizationDate, 'validDate':tousseObj.validDate, - 'hospitalName':hospitalName, 'sterilizer':sterilizer, 'frequency':frequency, 'material':material, 'sterilingType':tousseObj.sterilingType, - 'maker':tousseObj.maker,'assistant':tousseObj.assistant}; - top.Ext4.applyIf(printSummaryObj,tousseObj); + var description = ""; + for ( var i = 0, len = records.length; i < len; i++) { - setMaterialsForPrint(printSummaryObj,barcode); - setSterilisationAbbreviationForPrint(printSummaryObj,barcode); - defaultForeignPrintPackage(printSummaryObj); - - } - else{ + var tousseObj = {}; - //先将名称存到另一个未含科室名的名称属性里(针对东莞中医院的打印调整) - tousseObj.tousseNameWithoutDepart = tousseObj.tousseName; - var haveUnSupplementMaterials = records[i].data['haveUnSupplementMaterials']; - if(haveUnSupplementMaterials == true){ - tousseObj.tousseNameWithoutDepart = "◆ " + tousseObj.tousseNameWithoutDepart; - tousseObj.tousseName = "◆ " + tousseObj.tousseName; + ids = records[i].data['id']; + var barcodeArray = new Array(); + var barcode = records[i].data['tousseBarcode']; + barcodeArray.push(barcode); + tousseObj.barcodes = barcodeArray; + + if(description != ""){ + description += ","; } + description += barcode; - //打印消毒物品 - if(tousseObj.isDisinfection){ - printLabelOfDisinfection(tousseObj); + var virtualSeqNums = new Array(); + var virtualBasketSeqNum = records[i].data['virtualBasketSeqNum']; + virtualSeqNums.push(virtualBasketSeqNum); + tousseObj.virtualSeqNums = virtualSeqNums; + + tousseObj.fixedBarcode = records[i].data['fixedBarcode']; + tousseObj.materialsJsonArray = records[i].data['materialsJsonArray']; + tousseObj.tousseName = records[i].data['tousseName']; + tousseObj.tousseType = records[i].get("tousseType"); + + var isDisinfection = false; + + if (tousseObj.tousseType == '消毒物品'){ + isDisinfection = true; } - // 打印器械包 - else{ - addDepartPrefixForTousseName(tousseObj); -// if(tousseObj.printOrgSource != "无"){ -// tousseObj.tousseName = "(" + tousseObj.department + ")" + tousseObj.tousseName;; -// } - printLabel(tousseObj); + tousseObj.isDisinfection = isDisinfection; + tousseObj.isSterile = records[i].data['isSterile']; + + tousseObj.packageType = records[i].data['packType']; + tousseObj.pageType = records[i].data['barcodePaperType']; + // 获取包装方式的简称 + var packageTypeAbbreviation = ''; + DWREngine.setAsync(false); + TousseInstanceTableManager.getPackageTypeAbbreviation(tousseObj.packageType,function(_packageTypeAbbreviation){ + packageTypeAbbreviation = _packageTypeAbbreviation; + }); + DWREngine.setAsync(true); + + tousseObj.packageTypeAbbreviation = packageTypeAbbreviation; + tousseObj.sterilingType = records[i].data['sterilization']; + tousseObj.supplierName = records[i].data['supplierName']; + //灭菌日期、失效日期 + var sterileStartTime = records[i].data['sterileStartTime']; + tousseObj.sterilizationDate = sterileStartTime; + tousseObj.validDate = records[i].data['validUntilStr']; + tousseObj.toolAmount = records[i].data['toolAmount']; + tousseObj.implantAmount = records[i].data['implantAmount']; + + if (sterileStartTime.length > 10){ + tousseObj.sterilizationDate = sterileStartTime.substring(0,10); } + + + var operator = records[i].data['packer']; + var wrapperForPrint = records[i].data['wrapper']; + var washOperator = records[i].data['washOperator']; + var reviewer = records[i].data['reviewer']; + var sterilizationUser = records[i].data['sterilizationUser']; + if(!printFullName){ + operator = records[i].data['packerCode']; + wrapperForPrint = records[i].data['wrapperCode']; + reviewer = records[i].data['reviewerCode']; + sterilizationUser = records[i].data['sterilizationUserCode']; + washOperator = records[i].data['washOperatorCode']; + } + tousseObj.washOperator = washOperator; + tousseObj.operatorToPrint = operator; + tousseObj.wrapperForPrint = wrapperForPrint; + tousseObj.reviewerToPrint = reviewer; + tousseObj.sterilizationUserToPrint = sterilizationUser; + tousseObj.sterilizerName = records[i].data['sterilizer']; + tousseObj.sterileFrequency = records[i].data['frequency']; + var materialTypeTotal = records[i].data['materialTypeTotal']; + var warningDateStr = records[i].data['warningDateStr']; + + + // 修改配包人,审核人 + var packer2 = records[i].data['packer']; + var reviewer2 = records[i].data['reviewer']; + var packerCode2 = records[i].data['packerCode']; + var reviewerCode2 = records[i].data['reviewerCode']; + tousseObj.packTime = records[i].data['packTime']; + + var foreignTousseAppInfo = null; + var tousseAppID = 0; + if(tousseObj.tousseType == '外来器械包' || tousseObj.tousseType == '外来器械拆分小包'){ + DWREngine.setAsync(false); + ForeignTousseApplicationTableManager.findForeignTousseApplicationByBarcode(barcode,function(result){ + if(result != null && result.length > 0){ + foreignTousseAppInfo = JSON.parse(result); + foreignTousseAppInfo.supplierName = records[i].get('supplierName'); + tousseAppID = foreignTousseAppInfo.tousseAppID; + } + }); + DWREngine.setAsync(true); + } + tousseObj.foreignTousseApp_id = tousseAppID; + tousseObj.printOrgSource = records[i].data['printOrgSource']; + tousseObj.department = records[i].data['department']; + tousseObj.depart = tousseObj.department; + tousseObj.applicant = (getPrintUserFullName == true)?records[i].data['applicant']:records[i].data['applicantCode']; + tousseObj.maker = (getPrintUserFullName == true)?records[i].data['maker']:records[i].data['makerCode']; + tousseObj.assistant = (getPrintUserFullName == true)?records[i].data['assistant']:records[i].data['assistantCode']; + tousseObj.applicantDepart = records[i].data['applicantDepart']; + tousseObj.remark = records[i].data['remark']; + tousseObj.idCardDefinitionUseAmount = records[i].data['idCardDefinitionUseAmount']; + //打印 + // 必须先调用此代码,然后才能调用Ext.MessageBox.updateProgress + top.Ext.MessageBox.progress('【' + tousseObj.tousseName + '】打印中', '请稍候...'); + top.Ext.MessageBox.updateProgress((i + 1)/records.length,'第' + (i + 1) + '个,共' + records.length + '个'); + + var print = true; + + if(print){ + // 是否打印表格线 + DWREngine.setAsync(false); + ExpirationDateInfoTableManager.getExpirationDateByPackageTypeAndDateFormat(sterileStartTime,'yyyy-MM-dd HH:mm:ss',tousseObj.packageType,function(result){ + var expirationDateObj = JSON.parse(result); + tousseObj.markTousse = expirationDateObj.markTousse; + }); + DWREngine.setAsync(true); + + tousseObj.isPrint = records[i].data['isPrint']; + tousseObj.isTraceable = records[i].data['isTraceable']; + tousseObj.printCause = '历史装配记录重新打印'; + tousseObj.logPrintTousse = true; + + top.Ext4.applyIf(tousseObj,records[i].data); + // 外部代理灭菌单上的器械包的打印 + if('外部代理灭菌' == tousseObj.tousseType){ + var hospitalName = ""; + var sterilizer = tousseObj.sterilizerName; + var frequency = tousseObj.sterileFrequency; + var applicant = tousseObj.applicant; + var depart = tousseObj.applicantDepart; + var material = ''; + var printBarcode = barcode; + if(!tousseObj.isTraceable){//不追溯打固定条码 + printBarcode = tousseObj.fixedBarcode; + } + tousseObj.tousseNameWithoutDepart = tousseObj.tousseName; + tousseObj.sterilizationUser = records[i].data['sterilizationUser']; + var printSummaryObj = {'barcode':printBarcode, 'name':tousseObj.tousseName,'tousseNameWithoutDepart':tousseObj.tousseNameWithoutDepart, 'applicant':applicant, 'depart': depart, 'sterilizationDate':tousseObj.sterilizationDate, 'validDate':tousseObj.validDate, + 'hospitalName':hospitalName, 'sterilizer':sterilizer, 'frequency':frequency, 'material':material, 'sterilingType':tousseObj.sterilingType, + 'maker':tousseObj.maker,'assistant':tousseObj.assistant}; + top.Ext4.applyIf(printSummaryObj,tousseObj); + + setMaterialsForPrint(printSummaryObj,barcode); + setSterilisationAbbreviationForPrint(printSummaryObj,barcode); + defaultForeignPrintPackage(printSummaryObj); + + } + else{ + + //先将名称存到另一个未含科室名的名称属性里(针对东莞中医院的打印调整) + tousseObj.tousseNameWithoutDepart = tousseObj.tousseName; + var haveUnSupplementMaterials = records[i].data['haveUnSupplementMaterials']; + if(haveUnSupplementMaterials == true){ + tousseObj.tousseNameWithoutDepart = "◆ " + tousseObj.tousseNameWithoutDepart; + tousseObj.tousseName = "◆ " + tousseObj.tousseName; + } + + //打印消毒物品 + if(tousseObj.isDisinfection){ + printLabelOfDisinfection(tousseObj); + } + // 打印器械包 + else{ + addDepartPrefixForTousseName(tousseObj); + // if(tousseObj.printOrgSource != "无"){ + // tousseObj.tousseName = "(" + tousseObj.department + ")" + tousseObj.tousseName;; + // } + printLabel(tousseObj); + } + } + + } } + //重新打印加日志记录 + top.Ext4.Ajax.request({ + url : WWWROOT + '/log/saveLog.do', + params : {model : '装配模块',type : 'A',description : "重新打印标签条码:" + description}, + success : function(response, options) { + + } + }); + hideMessageBox(true); } - } - //重新打印加日志记录 - top.Ext4.Ajax.request({ - url : WWWROOT + '/log/saveLog.do', - params : {model : '装配模块',type : 'A',description : "重新打印标签条码:" + description}, - success : function(response, options) { - - } - }); - - hideMessageBox(true); + }); } },'-',{ text : '废弃',