Index: ssts-web/src/main/webapp/disinfectsystem/packing/reviewView.js =================================================================== diff -u -r40302 -r40393 --- ssts-web/src/main/webapp/disinfectsystem/packing/reviewView.js (.../reviewView.js) (revision 40302) +++ ssts-web/src/main/webapp/disinfectsystem/packing/reviewView.js (.../reviewView.js) (revision 40393) @@ -1255,6 +1255,311 @@ otherPartAddQM = true; addQualityMonitoringByResponPart("装配管理",'',records); } + +//打印标签 +function rePrintLabel(tousseInstanceIDs){ + var records = []; + if(tousseInstanceIDs){ + for(var i=0;i= 0){ + records.push(item); + } + } + }else { + records = grid.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; i < records.length; i++) { + + var tousseObj = {}; + + ids = records[i].data['id']; + var barcodeArray = new Array(); + var barcode = records[i].data['tousseBarcode']; + var tousseNameAlias = records[i].data['tousseNameAlias'] || ''; + barcodeArray.push(barcode); + tousseObj.barcodes = barcodeArray; + var barcodePaperType = records[i].data['barcodePaperType']; + + if(description != ""){ + description += ","; + } + description += barcode; + + var virtualSeqNums = new Array(); + var virtualBasketSeqNum = records[i].data['virtualBasketSeqNum']; + virtualSeqNums.push(virtualBasketSeqNum); + tousseObj.virtualSeqNums = virtualSeqNums; + if(sstsConfig.enableFlexiblePriceCalculationOfDisinfectionGoodsFunction && records[i].tousseType == '消毒物品' && records[i].sterilizedThisTime == true){ + if(records[i].data['barcodePaperType'].sterilizationPaperType && records[i].data['barcodePaperType'].sterilizationPaperType !== ''){ + barcodePaperType = records[i].data['barcodePaperType'].sterilizationPaperType; + } + } + tousseObj.price = records[i].data['price'] || ''; + if(barcodePaperType == '小标签2'){ + var columnAmount = 1; + if(records[i].data.tousseType == '消毒物品'){ + var smallLabel2 = printConfig.smallLabel2_disinfect; + if(smallLabel2 && smallLabel2.columnAmount){ + columnAmount = smallLabel2.columnAmount; + } + }else { + var smallLabel2 = printConfig.smallLabel2; + if(smallLabel2 && smallLabel2.columnAmount){ + columnAmount = smallLabel2.columnAmount; + } + } + tousseObj.indexInColumn = i%columnAmount; + if(i == 0){ + tousseObj.noInitPrinting = null; + }else{ + tousseObj.noInitPrinting = true; + } + if(i%columnAmount == 1 || i == records.length-1){ + tousseObj.noPrinting = null; + }else{ + tousseObj.noPrinting = true; + } + } + tousseObj.fixedBarcode = records[i].data['fixedBarcode']; + tousseObj.materialsJsonArray = records[i].data['materialsJsonArray']; + tousseObj.tousseName = records[i].data['tousseName'] || records[i].data['tousseDefinition.name']; + if(tousseNameAlias !== ''){ + tousseObj.tousseName = tousseNameAlias; + } + tousseObj.tousseType = records[i].data['tousseType'] || records[i].data['tousseDefinition.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 = 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 && 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']; + var inspector = records[i].data['inspector']; + 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']; + inspector = records[i].data['inspectorCode']; + } + tousseObj.washOperator = washOperator; + tousseObj.operatorToPrint = operator; + tousseObj.wrapperForPrint = wrapperForPrint; + tousseObj.reviewerToPrint = reviewer; + tousseObj.sterilizationUserToPrint = sterilizationUser; + tousseObj.inspectorToPrint = inspector; + 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']; + tousseObj.operationDate = tousseObj.packTime?tousseObj.packTime.split(' ')[0]:''; + + 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.tousseDefinitionId = records[i].json.tousseDefinitionId; + tousseObj.idCardDefinitionUseAmount = records[i].data['idCardDefinitionUseAmount']; + tousseObj.printAmount = records[i].data.printAmount; + //打印 + // 必须先调用此代码,然后才能调用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'] || records[i].data['tousseDefinition.isTraceable']; + tousseObj.printCause = '历史装配记录重新打印'; + tousseObj.logPrintTousse = true; + //获取标识牌编号 + top.Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/tousseInstanceAction!findIdNumberByTousseInstanceId.do', + async:false, + params : {tousseInstanceId : ids}, + success : function(response, options) { + var result = JSON.parse(response.responseText); + if(result.success){ + var idNumber = result.data.idNumber || ''; + tousseObj.idCardDefinitionIdNumber = idNumber; + }else{ + showResult(result.message); + } + }, + failure : function(response, options) { + var result = JSON.parse(response.responseText); + showResult(result.message); + } + }); + //BJ309YY-27:获取配包注意事项 + top.Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!loadTousseDefinitionNote.do', + async:false, + params : {id : tousseObj.tousseDefinitionId}, + success : function(response, options) { + var result = JSON.parse(response.responseText); + if(result.success && result.data){ + var noteText = result.data.noteText || ''; + tousseObj.noteText = noteText; + }else{ + if(result.message){ + showResult(result.message); + } + } + }, + failure : function(response, options) { + var result = JSON.parse(response.responseText); + showResult(result.message); + } + }); + 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 = 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;; +// } + //SZSDSRMYY-143:支持多份打印 + for(var pi=0;pi