Index: ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js =================================================================== diff -u -r29811 -r29889 --- ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js (.../comboToussePackingView.js) (revision 29811) +++ ssts-web/src/main/webapp/disinfectsystem/packing/comboToussePackingView.js (.../comboToussePackingView.js) (revision 29889) @@ -494,6 +494,81 @@ barcodeField.setValue(""); } +//选择聚合包 +function selectComboTousseStore(records){ + var waitComboTousseStore = top.Ext4.getCmp("waitComboTousseGrid").getStore(); + waitComboTousseStore.removeAll(); + var comboGrid = top.Ext4.getCmp("comboGrid").getStore(); + comboGrid.removeAll(); + var comboTousseDataGrid = top.Ext4.getCmp("comboTousseDataGrid").getStore(); + comboTousseDataGrid.removeAll(); + + var record = records; + if (records.length > 0){ + record = records[0]; + } + var packageType = record.data.packageType; + var sterilingMethod = record.data.sterilingMethod; + top.Ext4.getCmp("comboToussePackageType").setValue(packageType); + top.Ext4.getCmp("sterilingType3").setValue(sterilingMethod); + + var includeTousses = record.data.includeTousses; + var comboToussePacking_orgUnit = top.Ext4.getCmp('comboToussePacking_orgUnit').getValue(); + if(includeTousses.length > 0){ + Ext4.Ajax.request({ + url : WWWROOT + '/disinfectSystem/packingAction!findComboTousseIncludeToussePackingTaskAmount.do', + params : { + id : record.data.id, + includeTousses : JSON.stringify(includeTousses), + departCoding: comboToussePacking_orgUnit + },success : function(response, options) { + var result = Ext4.decode(response.responseText); + if(!result.success){ + showResult(result.message , null , sstsConfig.messagePauseTimeOnPackingPage); + return false; + } + var includeTousseJson = result.data; + + itemsLen = includeTousseJson.length; + + for(var i = 0 ; i < includeTousseJson.length ; i++){ + var id = includeTousseJson[i].id; + var name = includeTousseJson[i].name; + var amount = includeTousseJson[i].currrentTaskAmount; + var packageType = includeTousseJson[i].packageType; + var errorAmount = includeTousseJson[i].errorAmount; + var damageAmount = includeTousseJson[i].damageAmount; + var unWashAmount = includeTousseJson[i].unWashAmount; + var tousseAmount = includeTousseJson[i].tousseAmount; + if(amount == 0 && unWashAmount == 0){ + continue; + } + var addItem = [{ + id : id, + tousseName : name, + amount : amount, + maxAmount : amount, + packageType:packageType, + errorAmount : errorAmount, + damageAmount : damageAmount, + unWashAmount : unWashAmount, + tousseAmount : tousseAmount + }] + waitComboTousseStore.insert(0,addItem); + waitAmount[id] = { + name: name, + amount: amount + }; + } + }, + failure : function(response, options) { + var result = Ext4.decode(response.responseText); + showResult(result.cause , null , sstsConfig.messagePauseTimeOnPackingPage); + } + }); + } +} + function packingComboTousse(){ top.Ext4.define('cellEditingGrid',{ @@ -577,6 +652,13 @@ } comboTousseStore.proxy.extraParams["spell"] = top.Ext4.getCmp("comboTousseName").getRawValue(); }); + + comboTousseStore.on('load',function(thiz,item){ + if(item.length == 1){ + top.Ext4.getCmp("comboTousseName").setValue(item[0].data.name); + selectComboTousseStore(item[0]) + } + }) //申请科室Store var allComboTousseDefinitionDepartStoreExt2 = new Ext4.data.Store({ @@ -642,78 +724,7 @@ typeAhead : false, listeners : { select : function(combo, records, index) { - - var waitComboTousseStore = top.Ext4.getCmp("waitComboTousseGrid").getStore(); - waitComboTousseStore.removeAll(); - var comboGrid = top.Ext4.getCmp("comboGrid").getStore(); - comboGrid.removeAll(); - var comboTousseDataGrid = top.Ext4.getCmp("comboTousseDataGrid").getStore(); - comboTousseDataGrid.removeAll(); - - var record = records; - if (records.length > 0){ - record = records[0]; - } - var packageType = record.data.packageType; - var sterilingMethod = record.data.sterilingMethod; - top.Ext4.getCmp("comboToussePackageType").setValue(packageType); - top.Ext4.getCmp("sterilingType3").setValue(sterilingMethod); - - var includeTousses = record.data.includeTousses; - var comboToussePacking_orgUnit = top.Ext4.getCmp('comboToussePacking_orgUnit').getValue(); - if(includeTousses.length > 0){ - Ext4.Ajax.request({ - url : WWWROOT + '/disinfectSystem/packingAction!findComboTousseIncludeToussePackingTaskAmount.do', - params : { - id : record.data.id, - includeTousses : JSON.stringify(includeTousses), - departCoding: comboToussePacking_orgUnit - },success : function(response, options) { - var result = Ext4.decode(response.responseText); - if(!result.success){ - showResult(result.message , null , sstsConfig.messagePauseTimeOnPackingPage); - return false; - } - var includeTousseJson = result.data; - - itemsLen = includeTousseJson.length; - - for(var i = 0 ; i < includeTousseJson.length ; i++){ - var id = includeTousseJson[i].id; - var name = includeTousseJson[i].name; - var amount = includeTousseJson[i].currrentTaskAmount; - var packageType = includeTousseJson[i].packageType; - var errorAmount = includeTousseJson[i].errorAmount; - var damageAmount = includeTousseJson[i].damageAmount; - var unWashAmount = includeTousseJson[i].unWashAmount; - var tousseAmount = includeTousseJson[i].tousseAmount; - if(amount == 0 && unWashAmount == 0){ - continue; - } - var addItem = [{ - id : id, - tousseName : name, - amount : amount, - maxAmount : amount, - packageType:packageType, - errorAmount : errorAmount, - damageAmount : damageAmount, - unWashAmount : unWashAmount, - tousseAmount : tousseAmount - }] - waitComboTousseStore.insert(0,addItem); - waitAmount[id] = { - name: name, - amount: amount - }; - } - }, - failure : function(response, options) { - var result = Ext4.decode(response.responseText); - showResult(result.cause , null , sstsConfig.messagePauseTimeOnPackingPage); - } - }); - } + selectComboTousseStore(records) } } }]; @@ -1203,17 +1214,6 @@ // allowBlank : !sstsConfig.sterilizerNotAllowBlank, anchor : '80%', listeners : { -// select : function(combo, record, index) { -// top.Ext4.getCmp("comboTousseName").setValue(''); -// var waitComboTousseStore = top.Ext4.getCmp("waitComboTousseGrid").getStore(); -// waitComboTousseStore.removeAll(); -// var comboGrid = top.Ext4.getCmp("comboGrid").getStore(); -// comboGrid.removeAll(); -// var comboTousseDataGrid = top.Ext4.getCmp("comboTousseDataGrid").getStore(); -// comboTousseDataGrid.removeAll(); -// -// comboTousseStore.reload(); -// }, change: function(combo, newValue, oldValue, eOpts){ top.Ext4.getCmp("comboTousseName").setValue(''); var waitComboTousseStore = top.Ext4.getCmp("waitComboTousseGrid").getStore(); @@ -1223,12 +1223,7 @@ var comboTousseDataGrid = top.Ext4.getCmp("comboTousseDataGrid").getStore(); comboTousseDataGrid.removeAll(); - comboTousseStore.reload(); -// comboTousseStore.reload({ -// params : { -// spell: top.Ext4.getCmp("comboTousseName").getValue() -// } -// }); + comboTousseStore.reload(); } } }],