Index: ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js =================================================================== diff -u -r35411 -r36576 --- ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js (.../operationReservationInvoiceView.js) (revision 35411) +++ ssts-web/src/main/webapp/disinfectsystem/invoice/operationReservationInvoiceView.js (.../operationReservationInvoiceView.js) (revision 36576) @@ -208,7 +208,7 @@ }, [ {name : 'id',mapping : 'id'}, {name : 'name',mapping : 'name'}, - {name : 'orgUnitCode',mapping : 'orgUnitCode'}, + {name : 'orgUnitCode',mapping : 'orgUnitCode'} ]), listeners : { load : function(store,records) { @@ -228,6 +228,30 @@ } }); +var storageLocationStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/baseData/storageLocationAction!loadStorageLocationForOperationReservationInvoice.do', + method : 'POST' + }), + reader : new Ext.data.JsonReader({ + totalProperty : 'totalCount', + root : 'data' + }, [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'}, + {name : 'barcode',mapping : 'barcode'}, + {name : 'storageLocationCode',mapping : 'storageLocationCode'} + ]), + listeners : { + beforeload:function(thiz){ + var invoicePlanId = top.Ext.getCmp('invoicePlanIdHidden').getValue(); + if(invoicePlanId){ + thiz.baseParams["invoicePlanId"] = invoicePlanId; + } + } + } +}); + if(sstsConfig.disableLoadToVirtualBasket == false){ beginBarcodeLabel = '条码/篮筐(首):'; hiddenEndBarcode = false;//显示尾篮筐 @@ -889,7 +913,7 @@ invoicePrintModule.batchPrintInvoiceWithType(invoiceIds.join(","),'全部'); } } -function doSaveAction(form,window,printInvoiceCallback){ +function doSaveAction(form,window,saveType){ if (!form.getForm().isValid()) { showResult('请正确填写表单各值'); return false; @@ -919,11 +943,25 @@ // 一定要事务提交成功才返回发货计划列表界面 showResult(action.result.message); if(action.result.success){ - if(printInvoiceCallback != null){ - printInvoiceCallback(action.result.invoiceIds); + if(saveType == 'saveAndPrint'){ + printInvoiceAfterInvoice(action.result.invoiceIds); + window.close(); + grid.getStore().reload(); + }else if(saveType == 'saveAndInvoice'){ + recyclingapplicationStore.load(); + if(recyclingapplicationStore.getCount() > 0){ + showResult('发货完成,您可以继续扫描物品进行发货'); + sendOutGoodsStore.removeAll(); + grid.getStore().reload(); + }else { + showResult('发货成功'); + window.close(); + grid.getStore().reload(); + } + }else { + window.close(); + grid.getStore().reload(); } - window.close(); - grid.getStore().reload(); } }, failure : function(form, action) { @@ -1385,7 +1423,6 @@ anchor : '99%' }] },{ - columnWidth : .5, layout : 'form', labelWidth : 90, columnWidth :.33, @@ -1423,6 +1460,115 @@ }] },{ layout : 'form', + columnWidth :.33, + labelWidth :70, + hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items:[{ + xtype : 'combo', + id : 'storageLocationAddr', + name : 'storageLocationAddr', + valueField : 'queryValue', + displayField : 'queryMode', + width:180, + fieldLabel : '开口选择', + mode : 'local', + readOnly : true, + editable: false, + triggerAction : 'all', + forceSelection : true, + anchor : '99%', + store : new Ext.data.SimpleStore({ + fields : ['queryMode','queryValue'], + data : [['一号开口','S01-1'],['二号开口','S01-2'],['三号开口','S01-3']] + }) + }] + },{ + layout : 'form', + columnWidth :.33, + labelWidth :70, + hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items:[{ + xtype:'hidden', + id:'storageLocationId', + name:'storageLocationId' + },{ + xtype:'hidden', + id:'kardexContainerHost', + name:'kardexContainerHost', + value:'194.1.2.135' + },{ + xtype:'hidden', + id:'kardexContainerPort', + name:'kardexContainerPort', + value:'15008' + },{ + xtype : 'combo', + fieldLabel : '托盘选择', + id : 'storageLocationName', + name : 'storageLocationName', + minChars : 0, + valueField : 'name', + displayField : 'name', + store : storageLocationStore, + triggerAction : 'all', + readOnly : true, + editable: false, + forceSelection : true, + allowBlank : true, + anchor : '99%', + listeners : { + select : function(combo, record, index) { + console.log(record) + top.Ext.getCmp('storageLocationId').setValue(record.data.id); + } + } + }] + },{ + layout : 'form', + columnWidth :.33, + hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + items:[{ + xtype : 'button', + text : '取回托盘', + handler : function() { + var storageLocationId = top.Ext.getCmp("storageLocationId").getValue(); + var storageLocationAddr = top.Ext.getCmp("storageLocationAddr").getValue(); + var kardexContainerHost = top.Ext.getCmp("kardexContainerHost").getValue(); + var kardexContainerPort = top.Ext.getCmp("kardexContainerPort").getValue(); + var params = { + storageLocationId:storageLocationId, + addr:storageLocationAddr, + status:'取出', + host:kardexContainerHost, + port:kardexContainerPort + } + if(storageLocationAddr == ''){ + showResult('开口不能为空'); + return; + } + if(storageLocationId == ''){ + showResult('托盘不能为空'); + return; + } + showResult('已经发送命令给货柜,托盘调度中,请稍候!'); + Ext.Ajax.timeout=2*60*1000; + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/baseData/storageRecordAction!sendKardexContainerTCPCommand.do', + async:false, + params : params, + timeout: 2*60*1000, + success : function(response) { + var result = Ext.decode(response.responseText); + showResult(result.message); + }, + failure : function(response, options) { + showResult(response.responseText); + } + }); + } + }] + },{ + layout : 'form', columnWidth : 1, labelWidth :70, items : [{ @@ -1631,12 +1777,19 @@ doSaveAction(form,window); } },{ + text : '保存并继续发货', + disabled : committedStatus ? false : true,//未提交则保存按钮置灰 + hidden:!sstsConfig.enableOperationReservationShippedToTraysOfKardexContainer, + handler : function() { + doSaveAction(form,window,'saveAndInvoice'); + } + },{ text : '保存并打印', disabled : committedStatus ? false : true,//未提交则保存按钮置灰 id:'saveAndPrintButton', hidden:!sstsConfig.enableSaveAndPrintWhenInvoice, handler : function() { - doSaveAction(form,window,printInvoiceAfterInvoice); + doSaveAction(form,window,'saveAndPrint'); } }, { text : '取消',