Index: ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js =================================================================== diff -u -r41186 -r41228 --- ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 41186) +++ ssts-web/src/main/webapp/disinfectsystem/qualitymonitoring/qualitymonitoringInstanceForm.js (.../qualitymonitoringInstanceForm.js) (revision 41228) @@ -3268,13 +3268,17 @@ id: 'basketBarcode' + materialItemCount, fieldLabel: "篮筐条码", anchor: '95%', + index: materialItemCount, listeners: { specialkey: function (field, e) { if (e.getKey() == 13) { var idName = field.getId().replace("basketBarcode", "position"); getPostionByBasketBarcode(field.getValue(), idName); field.setValue(''); } + }, + focus: function (field) { + focusInputId = 'basketBarcode' + field.index; } } }] @@ -4076,85 +4080,15 @@ name: 'tempBarcode' + tousseItemCount + "_" + 1, id: 'tempBarcode' + tousseItemCount + "_" + 1, fieldLabel: "器械包条码", + index: tousseItemCount, listeners: { specialkey: function (field, e) { if (e.getKey() == 13) { - var result = getTousseInstanceMsg(field.getValue()); - if (result != null) { - var oldResponsiblePerson = Ext.getCmp(idpreKey3 + "_" + 1).getValue(); - // 获取条码成功 - // 设置器械包名称,器械包条码,器械包id,器械包类型 - if (result.barcode != null && result.barcode != '') { - /* 判断器械包条码是否已经扫描start */ - var isScanned = tousseBarcodeIsScanned(tousseAndMaterialWrapperCount, field.getValue()); - if (isScanned) { - field.setValue(""); - return; - } - getBarcodeRemark(result); - /* 判断器械包条码是否已经扫描end */ - Ext.getCmp(idpreKey + "_" + 3).setValue(result.tousseName + "(" + field.getValue() + ")"); - Ext.getCmp(idpreKey2 + "_" + 1).setValue(field.getValue());//存入隐藏域 - Ext.getCmp(idpreKey3 + "_" + 1).setValue(result.responsiblePerson || ''); - } else { - Ext.getCmp('tousseName').setValue(result.tousseName); - Ext.getCmp(idpreKey + "_" + 3).setValue(result.tousseName); - } - - Ext.getCmp(idpreKey + "_" + 5).setValue(result.tousseInstanceId); - // 可以选择重新回收和重新装配 - Ext.getCmp(idpreKey + "_" + 2).enable(); - Ext.getCmp(idpreKey + "_" + 4).enable(); - Ext.getCmp(idpreKey + "_" + 12).enable(); - - var fisrtWrapper = field.ownerCt.ownerCt.ownerCt.ownerCt;//获取父元素 - //设置炉号炉次 - if (fisrtWrapper.id == "tousseInfoFieldSet") {//代表是第一个块 - if (Ext.getCmp('configItemOptionSterName')) { - Ext.getCmp('configItemOptionSterName').setValue(result.sterilizerName); - Ext.getCmp('configItemOptionSterFre').setValue(result.sterileFrequency); - } - } else {//代表是添加的块 - var rememberNum3 = rememberNum; - if (Ext.getCmp('itemsFieldSet' + "_" + rememberNum3)) { - var itemsFieldSetWrapper = Ext.getCmp('itemsFieldSet' + "_" + rememberNum3).items.items; - for (var y = 0; y < itemsFieldSetWrapper.length; y++) { - if (itemsFieldSetWrapper[y].items) { - if (itemsFieldSetWrapper[y].items.items[0].fieldLabel == "炉次") { - Ext.getCmp(itemsFieldSetWrapper[y].items.items[0].id).setValue(result.sterileFrequency); - } else if ((itemsFieldSetWrapper[y].items.items[0].fieldLabel == "炉号")) { - Ext.getCmp(itemsFieldSetWrapper[y].items.items[0].id).setValue(result.sterilizerName); - } else { - continue; - } - } else { - continue; - } - - } - } - } - if (sstsConfig.enableAddingMultipleResponsiblePersons) { - getBarcodeResponsiblePerson(oldResponsiblePerson); - } - } - getNextFocus(field); - field.setValue(""); - var index = field.id.split('_')[0].replace('tempBarcode', ''); - if (Ext.getCmp('tousseDefinitionId' + index)) { - Ext.getCmp('tousseDefinitionId' + index).setValue(result.tousseDefinitionId); - clearOptions(); - } - //重新加载包内的材料 - if (materialItemCount > 0) { - for (var i = 1; i <= materialItemCount; i++) { - if (Ext.getCmp('material' + index + '_' + i)) { - Ext.getCmp('material' + index + '_' + i).store.reload(); - Ext.getCmp('material' + index + '_' + i).setValue('') - } - } - } + loadBarcodeForTousseInfo(field.getValue(), field.index) } + }, + focus: function (field) { + focusInputId = 'tempBarcode' + field.index + "_" + 1; } }, anchor: '95%' @@ -6126,6 +6060,52 @@ checkIsTousseInstanceRepackingAndSubmitFormNew(thiz, JSON.stringify(tousseAndMaterialAll), saveAndCreate); } +//BJDXZLYY-69:根据条码处理不同的业务,focusInputId为焦点所在的输入框的id,目前只有PDA有用 +function receiveBarcode(barcode) { + if (focusInputId !== '') { + switch (focusInputId) { + case 'responsiblePersonBarcode'://扫描责任人条码 + loadResponPersonByBarcode(barcode, 'responsiblePerson'); + break; + case 'createUserName'://扫描登记人 + loadResponPersonByBarcode(barcode, 'createUserName'); + break; + case 'scanBarcode'://重新回收篮筐条码 + loadBasketByBarcodeAndProcedures(barcode); + break; + case 'rinseBasketsBarcode'://清洗篮筐条码 + loadBarcodeForWashRecord(barcode); + break; + case 'idCardAndTousseBarcode'://扫描标识牌/器械包条码(回收清点) + loadRecyclePersonByBarcode(barcode); + break; + case 'tousseBarcode'://扫描器械包条码(灭菌管理) + loadSterilizationByBarcode(barcode); + break; + case 'tempBarcode'://扫描器械包条码(器械包信息) + getTousseInstanceNameAndResponsiblePerson(barcode, Ext.getCmp('formDefinitionId').getValue(), materialDefinitionStore, true, '0'); + Ext.getCmp('tempBarcode').setValue(''); + break; + case 'basketBarcode'://篮筐条码(器械包信息) + var idName = Ext.getCmp('basketBarcode').getId().replace("basketBarcode", "position"); + getPostionByBasketBarcode(barcode, idName); + break; + default: + if (focusInputId.split('_').length > 0) {//扫描器械包条码(器械包信息) + if (focusInputId.split('_')[0].indexOf('tempBarcode') >= 0) { + var name = focusInputId.split('_')[0]; + var index = name.split('tempBarcode')[1]; + loadBarcodeForTousseInfo(barcode, index) + } + } else if (focusInputId.split('basketBarcode').length > 0) {//篮筐条码(器械包信息) + var idName = Ext.getCmp(focusInputId).getId().replace("basketBarcode", "position"); + getPostionByBasketBarcode(barcode, idName); + Ext.getCmp(focusInputId).setValue(''); + } + } + } +} + function loadResponPersonByBarcode(barcode, domId) { if (isUndefinedOrNullOrEmpty(barcode)) { showResultQM('条码不能为空!'); @@ -6163,6 +6143,138 @@ }); } +//CDSLQYQYYY-147:重新回收篮筐条码 +function loadBasketByBarcodeAndProcedures(barcode) { + ContainerTableManager.getBasketByBarcodeAndProcedures(barcode, basketAllowProcedure, function (jsonStr) { + var obj = Ext.util.JSON.decode(jsonStr); + if (obj.success) { + Ext.getCmp('containerName').setValue(obj.containerName); + if (obj.containerName !== '') { + Ext.getCmp('containerName').disable(); + } + } else { + showResultQM(obj.message); + } + Ext.getCmp("containerBarcode").setValue(barcodeValue); + }); +} + +//CDSLQYQYYY-147:清洗篮筐条码 +function loadBarcodeForWashRecord(barcode) { + Ext.Ajax.request({ + url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForWashRecord.do', + params: { basketBarcode: barcode }, + success: function (response, options) { + var result = Ext.decode(response.responseText); + if (result.success == false) { + showResultQM(result.message); + } else { + if (result.data.length > 1) { + loadScanBarcodeMsg('rinseBasketsName', 'cleaningMachinePosition', 'cleaningMachineDate', 'cleaningMachineName', 'cleaningMachineProgramName', 'cleaningStartTime', 'cleaningEndTime', 'scanWashRecord_id', barcode); + } else if (result.data.length == 1) { + var record = result.data[0]; + Ext.getCmp('rinseBasketsName').setValue(record.washBasketName); + Ext.getCmp('cleaningMachinePosition').setValue(record.position); + Ext.getCmp('cleaningMachineDate').setValue(record.washDate); + Ext.getCmp('cleaningMachineName').setValue(record.disinfectIdentification); + Ext.getCmp('cleaningMachineProgramName').setValue(record.disinfectProgram); + Ext.getCmp('cleaningStartTime').setValue(record.startDate); + Ext.getCmp('cleaningEndTime').setValue(record.endDate); + Ext.getCmp('scanWashRecord_id').setValue(record.washRecordID); + if (sstsConfig.enableAddingMultipleResponsiblePersons) { + getBarcodeResponsiblePerson('', record.operator); + } else { + Ext.getCmp('responsiblePerson').setValue(record.personInCharge); + } + materialDefinitionStore.load() + } + } + } + }); +} + +//CDSLQYQYYY-147:扫描器械包条码(器械包信息) +function loadBarcodeForTousseInfo(barcode, tousseItemCount) { + var field = Ext.getCmp('tempBarcode' + tousseItemCount + "_" + 1); + var idpreKey = 'tempBarcode' + tousseItemCount; + var idpreKey2 = 'tempBarcodeHidden' + tousseItemCount; + var idpreKey3 = 'hiddenResponsiblePerson' + tousseItemCount; + var result = getTousseInstanceMsg(barcode); + if (result != null) { + var oldResponsiblePerson = Ext.getCmp(idpreKey3 + "_" + 1).getValue(); + // 获取条码成功 + // 设置器械包名称,器械包条码,器械包id,器械包类型 + if (result.barcode != null && result.barcode != '') { + /* 判断器械包条码是否已经扫描start */ + var isScanned = tousseBarcodeIsScanned(tousseAndMaterialWrapperCount, barcode); + if (isScanned) { + field.setValue(""); + return; + } + getBarcodeRemark(result); + /* 判断器械包条码是否已经扫描end */ + Ext.getCmp(idpreKey + "_" + 3).setValue(result.tousseName + "(" + barcode + ")"); + Ext.getCmp(idpreKey2 + "_" + 1).setValue(barcode);//存入隐藏域 + Ext.getCmp(idpreKey3 + "_" + 1).setValue(result.responsiblePerson || ''); + } else { + Ext.getCmp('tousseName').setValue(result.tousseName); + Ext.getCmp(idpreKey + "_" + 3).setValue(result.tousseName); + } + + Ext.getCmp(idpreKey + "_" + 5).setValue(result.tousseInstanceId); + // 可以选择重新回收和重新装配 + Ext.getCmp(idpreKey + "_" + 2).enable(); + Ext.getCmp(idpreKey + "_" + 4).enable(); + Ext.getCmp(idpreKey + "_" + 12).enable(); + + var fisrtWrapper = field.ownerCt.ownerCt.ownerCt.ownerCt;//获取父元素 + //设置炉号炉次 + if (fisrtWrapper.id == "tousseInfoFieldSet") {//代表是第一个块 + if (Ext.getCmp('configItemOptionSterName')) { + Ext.getCmp('configItemOptionSterName').setValue(result.sterilizerName); + Ext.getCmp('configItemOptionSterFre').setValue(result.sterileFrequency); + } + } else {//代表是添加的块 + var rememberNum3 = rememberNum; + if (Ext.getCmp('itemsFieldSet' + "_" + rememberNum3)) { + var itemsFieldSetWrapper = Ext.getCmp('itemsFieldSet' + "_" + rememberNum3).items.items; + for (var y = 0; y < itemsFieldSetWrapper.length; y++) { + if (itemsFieldSetWrapper[y].items) { + if (itemsFieldSetWrapper[y].items.items[0].fieldLabel == "炉次") { + Ext.getCmp(itemsFieldSetWrapper[y].items.items[0].id).setValue(result.sterileFrequency); + } else if ((itemsFieldSetWrapper[y].items.items[0].fieldLabel == "炉号")) { + Ext.getCmp(itemsFieldSetWrapper[y].items.items[0].id).setValue(result.sterilizerName); + } else { + continue; + } + } else { + continue; + } + + } + } + } + if (sstsConfig.enableAddingMultipleResponsiblePersons) { + getBarcodeResponsiblePerson(oldResponsiblePerson); + } + } + getNextFocus(field); + field.setValue(""); + if (Ext.getCmp('tousseDefinitionId' + field.index)) { + Ext.getCmp('tousseDefinitionId' + field.index).setValue(result.tousseDefinitionId); + clearOptions(); + } + //重新加载包内的材料 + if (materialItemCount > 0) { + for (var i = 1; i <= materialItemCount; i++) { + if (Ext.getCmp('material' + field.index + '_' + i)) { + Ext.getCmp('material' + field.index + '_' + i).store.reload(); + Ext.getCmp('material' + field.index + '_' + i).setValue('') + } + } + } +} + //扫描标识牌/器械包条码 function loadRecyclePersonByBarcode(barcode) { if (isUndefinedOrNullOrEmpty(barcode)) { @@ -7047,6 +7159,9 @@ showResultQM('该工号或条码不存在!'); } } + }, + focus: function () { + focusInputId = 'createUserName'; } } }] @@ -7098,6 +7213,9 @@ Ext.getCmp("responsiblePersonBarcode").setValue(''); loadResponPersonByBarcode(barcodeValue, 'responsiblePerson'); } + }, + focus: function () { + focusInputId = 'responsiblePersonBarcode'; } }, anchor: '95%' @@ -7132,19 +7250,11 @@ if (e.getKey() == 13) { var barcodeValue = field.getValue(); Ext.getCmp("scanBarcode").setValue(''); - ContainerTableManager.getBasketByBarcodeAndProcedures(barcodeValue, basketAllowProcedure, function (jsonStr) { - var obj = Ext.util.JSON.decode(jsonStr); - if (obj.success) { - Ext.getCmp('containerName').setValue(obj.containerName); - if (obj.containerName !== '') { - Ext.getCmp('containerName').disable(); - } - } else { - showResultQM(obj.message); - } - Ext.getCmp("containerBarcode").setValue(barcodeValue); - }); + loadBasketByBarcodeAndProcedures(barcodeValue); } + }, + focus: function () { + focusInputId = 'scanBarcode'; } }, anchor: '95%' @@ -7183,43 +7293,11 @@ if (e.getKey() == 13) { var barcodeValue = field.getValue(); Ext.getCmp("rinseBasketsBarcode").setValue(''); - Ext.Ajax.request({ - url: WWWROOT + '/disinfectSystem/qualityMonitoringInstanceAction!scanBarcodeForWashRecord.do', - params: { basketBarcode: barcodeValue }, - success: function (response, options) { - var result = Ext.decode(response.responseText); - if (result.success == false) { - showResultQM(result.message); - } else { - if (result.data.length > 1) { - loadScanBarcodeMsg('rinseBasketsName', 'cleaningMachinePosition', 'cleaningMachineDate', 'cleaningMachineName', 'cleaningMachineProgramName', 'cleaningStartTime', 'cleaningEndTime', 'scanWashRecord_id', barcodeValue); - } else if (result.data.length == 1) { - var record = result.data[0]; - Ext.getCmp('rinseBasketsName').setValue(record.washBasketName); - Ext.getCmp('cleaningMachinePosition').setValue(record.position); - Ext.getCmp('cleaningMachineDate').setValue(record.washDate); - Ext.getCmp('cleaningMachineName').setValue(record.disinfectIdentification); - Ext.getCmp('cleaningMachineProgramName').setValue(record.disinfectProgram); - Ext.getCmp('cleaningStartTime').setValue(record.startDate); - Ext.getCmp('cleaningEndTime').setValue(record.endDate); - Ext.getCmp('scanWashRecord_id').setValue(record.washRecordID); - //Ext.getCmp('tousseDefinitionId').setValue(record.tousseDefinitionId || ''); - //Ext.getCmp('tousseName').setValue(record.tousseName || ''); - if (sstsConfig.enableAddingMultipleResponsiblePersons) { - getBarcodeResponsiblePerson('', record.operator); - } else { - Ext.getCmp('responsiblePerson').setValue(record.personInCharge); - } - materialDefinitionStore.load() - } - } - }, - failure: function (response, options) { - - } - }); - + loadBarcodeForWashRecord(barcodeValue) } + }, + focus: function () { + focusInputId = 'rinseBasketsBarcode'; } }, anchor: '95%' @@ -7356,6 +7434,9 @@ Ext.getCmp("idCardAndTousseBarcode").setValue(''); loadRecyclePersonByBarcode(barcodeValue); } + }, + focus: function () { + focusInputId = 'idCardAndTousseBarcode'; } }, anchor: '95%' @@ -7479,6 +7560,9 @@ //后台接口赋值 loadSterilizationByBarcode(barcodeValue); } + }, + focus: function () { + focusInputId = 'tousseBarcode'; } }, anchor: '95%' @@ -7928,6 +8012,9 @@ getNextFocus(field); field.setValue(''); } + }, + focus: function () { + focusInputId = 'tempBarcode'; } }, anchor: '95%' @@ -8173,6 +8260,9 @@ getPostionByBasketBarcode(field.getValue(), idName); field.setValue(''); } + }, + focus: function () { + focusInputId = 'basketBarcode'; } } }]