Index: ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js =================================================================== diff -u -r25132 -r25136 --- ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 25132) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/invoicePlanExtractedForm.js (.../invoicePlanExtractedForm.js) (revision 25136) @@ -46,7 +46,11 @@ } } }); +var isSameTypeBarcode; +var isSameTypeBarcodeCount; + + if(sstsConfig.disableLoadToVirtualBasket == false){ beginBarcodeLabel = '条码/篮筐(首):'; hiddenEndBarcode = false;//显示尾篮筐 @@ -124,26 +128,19 @@ var name = rows[i].data['name']; var amount = rows[i].data['count']; var barcode = rows[i].data['barcode']; + sendOutGoodsStore.remove(rows[i]); - - - var isSameTypeBarcodeCount = top.Ext.getCmp("isSameTypeBarcodeCount").getValue(); - if(isSameTypeBarcodeCount=="1"){ - top.Ext.getCmp('isSameTypeBarcodeCount').setValue(""); - top.Ext.getCmp('isSameTypeBarcode').setValue(""); + //weizhenyu + //判断是否删除的是表格的最后一条 + if(isSameTypeBarcodeCount == 1){ + isSameTypeBarcodeCount = 0; + isSameTypeBarcode = ""; } - else if(isSameTypeBarcodeCount!="1"&&isSameTypeBarcodeCount!=""){ - var newStr = parseInt(isSameTypeBarcodeCount)+1; - top.Ext.getCmp('isSameTypeBarcodeCount').setValue(newStr); - top.Ext.getCmp('isSameTypeBarcode').setValue(""); + if(isSameTypeBarcodeCount != 1 && isSameTypeBarcodeCount != 0){ + isSameTypeBarcodeCount = isSameTypeBarcodeCount - 1; } - else{ - - } - - - + if(goods.tousseType == '聚合包' && sstsConfig.comboTousseSendByWrapperTousse){ adjustComboTousseAppListAoumt(goods, 'sub'); continue; @@ -194,6 +191,34 @@ break; } } + //weizhenyu + //判断初次扫码 + if(isSameTypeBarcode == "" || !isSameTypeBarcode){ + isSameTypeBarcode = barcode; + isSameTypeBarcodeCount = 1; + } + else{ + var isBatch = /^[0-9]*$/ ;//全数字的批次条码正则 + if(isBatch.test(isSameTypeBarcode)){//若为批次扫码 + if(isBatch.test(barcode)){ + isSameTypeBarcodeCount = isSameTypeBarcodeCount+1; + } + else{//不同类别 + showResult('请扫描批次条码!' , null , true); + return true; + } + } + else{//若为一次性条码扫码 isDisposable.test(isSameTypeBarcode) + if(!isBatch.test(barcode)){ + isSameTypeBarcodeCount = isSameTypeBarcodeCount+1; + } + else{//不同类别 + showResult('请扫描一次性条码!' , null , true); + return true; + } + } + } + } return false; } @@ -718,56 +743,7 @@ } - //isSameTypeBarcode.push("asdfa"); - //top.Ext.getCmp('sourceWarehouseName').setValue(name); - //top.Ext.getCmp("scanTextEnd").getValue() - - - var isSameTypeBarcode = top.Ext.getCmp("isSameTypeBarcode").getValue(); - var newArr = []; - //判断初次扫码 - if(isSameTypeBarcode==""||isSameTypeBarcode=="[]"){ - isSameTypeBarcode = barcode; - //newArr.push(barcode); - top.Ext.getCmp('isSameTypeBarcode').setValue(isSameTypeBarcode); - top.Ext.getCmp('isSameTypeBarcodeCount').setValue("1"); - } - else{ - var isBatch = /^[0-9]*$/ ;//数字 - var isDisposable = /^[0-9a-zA-Z]+$/; - isSameTypeBarcode = isSameTypeBarcode; - if(isBatch.test(isSameTypeBarcode)){//若为批次扫码 - if(isBatch.test(barcode)){ - var isSameTypeBarcodeCount = top.Ext.getCmp("isSameTypeBarcodeCount").getValue(); - isSameTypeBarcodeCount = parseInt(isSameTypeBarcodeCount); - isSameTypeBarcodeCount = isSameTypeBarcodeCount+1; - top.Ext.getCmp('isSameTypeBarcodeCount').setValue(isSameTypeBarcodeCount); - } - else{ - showResult('请扫描批次条码!' , null , true); - return false; - //不同类别 - } - } - if(!isBatch.test(isSameTypeBarcode)){//若为一次性条码扫码 isDisposable.test(isSameTypeBarcode) - if(!isBatch.test(barcode)){ - var isSameTypeBarcodeCount = top.Ext.getCmp("isSameTypeBarcodeCount").getValue(); - isSameTypeBarcodeCount = parseInt(isSameTypeBarcodeCount); - isSameTypeBarcodeCount = isSameTypeBarcodeCount+1; - top.Ext.getCmp('isSameTypeBarcodeCount').setValue(isSameTypeBarcodeCount); - } - else{ - showResult('请扫描一次性条码!' , null , true); - return false; - //不同类别 - } - } - else{} - } - - - if(singleMode){// 判断是否已经扫描过该条码 var goods = getSendOutGoodsByBarcode(barcode); if(goods != null){ @@ -946,9 +922,9 @@ Ext.Ajax.request({ url : WWWROOT + '/disinfectSystem/invoiceAction!loadGoodsByBarcode.do', params : {barcode : barcode,orgUnitCoding : orgUnitCoding,sourceWarehouseId: sourceWarehouseId}, + async : false, success : function(response, options) { top.Ext.getCmp("sendOutGoods").getEl().unmask(); - var result = Ext.decode(response.responseText); // 首先处理错误信息 if(!isUndefinedOrNullOrEmpty(result.errMsg)){ @@ -1000,8 +976,6 @@ for(var x=0;x 1) && goods.tousseFixedBarcode){// 扫单个包才提示 continue; } - var b = isBarcodeRepeat(goods.barcode); if(b && (goods.diposable == '是' || !goods.tousseFixedBarcode || goods.tousseType==EXPENSIVEGOODS_TYPE_NAME)){// 扫描多个时,如果存在已扫描的,直接忽略,跳过 continue; @@ -1153,12 +1126,6 @@ return false; } -//function getTypeName(diposable){ -// if(diposable == '是'){ -// return '一次性物品'; -// } -//} -// function findRecordByGoodsVOFromRecyclingApplication(vo) { for ( var i = 0; i < recyclingapplicationStore.getCount(); i++) { var record = recyclingapplicationStore.getAt(i); @@ -1759,16 +1726,6 @@ }, { xtype : 'hidden', - name : 'isSameTypeBarcode', - id : 'isSameTypeBarcode' - }, - { - xtype : 'hidden', - name : 'isSameTypeBarcodeCount', - id : 'isSameTypeBarcodeCount' - }, - { - xtype : 'hidden', name : 'warehouseName', id : 'warehouseName' },{ @@ -2077,7 +2034,6 @@ triggerAction : 'all', listeners : { select : function(combo, record, index){ - //alert(record.get("scanModeCode")); currentScanMode = record.get("scanModeCode"); //首尾条码全部清空,且让首条码得到焦点 top.Ext.getCmp('scanText').setValue(""); @@ -2638,7 +2594,6 @@ for(var i=0;i