Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js =================================================================== diff -u -r27570 -r27571 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js (.../goodsApplicationForm.js) (revision 27570) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationForm.js (.../goodsApplicationForm.js) (revision 27571) @@ -664,53 +664,81 @@ if(field.lastValue == field.focusLastValue){ return; } - - Ext.Ajax.request({ - url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMainBindGoods.do?', - params : {goodId : data.tousseDefinitionID}, - success : function(response, options) { - var responseText = response.responseText || ''; - if(responseText == ''){ - setTimeout(function() { - updateCount(data,field); - }, 100); - }else { - var result = JSON.parse(responseText); - if(result.data.length > 1){ - var storeData = leftTemplateStore.getRootNode().childNodes; - var newResultArray = []; - var k = 0; - var nameStr = ''; - for(var i=0;i 1){ - currentRecord.set('count',field.nowValue); + + if(field.lastValue == 0){ + currentRecord.set('count',field.focusLastValue); + var msgBox = new top.Ext4.create('Ext.window.MessageBox', { + width : 500, + height : 200 + }); + msgBox.alert('提示信息', '数量不能修改为0!'); + }else { + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/tousseDefinitionAction!getMainBindGoods.do?', + params : {goodId : data.tousseDefinitionID}, + success : function(response, options) { + var responseText = response.responseText || ''; + if(responseText == ''){ + setTimeout(function() { + updateCount(data,field); + }, 100); + }else { + if(data.count == 0){ + currentRecord.set('count',field.focusLastValue); var msgBox = new top.Ext4.create('Ext.window.MessageBox', { width : 500, height : 200 }); - msgBox.alert('提示信息', data.name+'同时被多个物品('+nameStr+')绑定,不允许修改'+data.name+'的数量!'); + msgBox.alert('提示信息', data.name+'被其他物品绑定,数量不能修改为0!'); + return; + } + + var result = JSON.parse(responseText); + if(result.data.length > 1){ + var storeData = leftTemplateStore.getRootNode().childNodes; + var newResultArray = []; + var k = 0; + var nameStr = ''; + for(var i=0;i 1){ + currentRecord.set('count',field.focusLastValue); + var msgBox = new top.Ext4.create('Ext.window.MessageBox', { + width : 500, + height : 200 + }); + msgBox.alert('提示信息', data.name+'同时被多个物品('+nameStr+')绑定,不允许修改'+data.name+'的数量!'); + }else { + setTimeout(function() { + updateCount(data,field); + }, 100); + } }else { - setTimeout(function() { - updateCount(data,field); - }, 100); + if(result.data[0].bidirectional == true){ + setTimeout(function() { + updateCount(data,field); + }, 100); + }else { + currentRecord.set('count',field.focusLastValue); + var msgBox = new top.Ext4.create('Ext.window.MessageBox', { + width : 500, + height : 200 + }); + msgBox.alert('提示信息', data.name+'被物品('+result.data[0].name+')单向绑定,不允许修改'+data.name+'的数量!'); + } } - }else { - setTimeout(function() { - updateCount(data,field); - }, 100); } } - } - }); + }); + } }, focus:function(field, event, eOpts){ var data = currentRecord.data;