Index: ssts-web/src/main/webapp/disinfectsystem/stocktakeinfomanager/stockTakeInfoView.js =================================================================== diff -u -r12387 -r12713 --- ssts-web/src/main/webapp/disinfectsystem/stocktakeinfomanager/stockTakeInfoView.js (.../stockTakeInfoView.js) (revision 12387) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakeinfomanager/stockTakeInfoView.js (.../stockTakeInfoView.js) (revision 12713) @@ -296,6 +296,24 @@ xtype: 'toolbar', items: tbarArr }); + + var wareHouseStore = new Ext.data.JsonStore({ + url : WWWROOT + '/disinfectSystem/baseData/wareHouseAction!getWareHouseData.do', + root: 'data', + fields: [ + {name : 'id',mapping : 'id'}, + {name : 'name',mapping : 'name'} + ], + listeners : { + load : function(store,records) { + if(records.length > 0 && id == "") { + if (top.Ext.getCmp('wareHouse')) { + top.Ext.getCmp('wareHouse').setValue(records[0].data.id); + } + } + } + } + }); var form = new top.Ext.FormPanel({ id : 'stockTakeInfoForm', @@ -337,6 +355,14 @@ name : 'isUpdateStock', id : 'isUpdateStock' },{ + xtype : 'hidden', + name : 'wareHouseId', + id : 'wareHouseId' + },{ + xtype : 'hidden', + name : 'wareHouseName', + id : 'wareHouseName' + },{ columnWidth : .5, layout : 'form', labelWidth : 50, @@ -362,19 +388,36 @@ id : 'stockTakeDateStr', name : 'stockTakeDateStr', format : 'Y-m-d H:i', - altFormats:'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', allowBlank : false, value : new Date(), anchor : '95%' }] }, { + columnWidth : .5, + layout : 'form', + labelWidth : 40, + items : [{ + xtype : 'combo', + fieldLabel : '仓库', + id : 'wareHouse', + name : 'wareHouse', + editable:false, + valueField : 'id', + displayField : 'name', + store : wareHouseStore, + forceSelection : true, + allowBlank : false, + triggerAction : 'all', + anchor : '95%' + }] + }, { columnWidth : 1, layout : 'form', labelWidth : 40, items : [{ xtype : 'textarea', fieldLabel : '备注', - height : 50, + height : 30, id : 'remark', name : 'remark', maxLength : 665, @@ -440,8 +483,10 @@ }); window.show(); - top.Ext.getCmp('tempName').focus(false, 100); + top.Ext.getCmp('tempName').focus(false, 100); + wareHouseStore.load(); + if(id){ form.getForm().load({ url : WWWROOT + '/disinfectSystem/stockTakeInfoAction!loadStockTakeInfo.do', @@ -483,6 +528,10 @@ setFormParams(form,['id','remark','type','stockTakeDateStr']); var items = buildJSONStringFromStore(top.Ext.getCmp('stockTakeItemGrid').getStore()); top.Ext.getCmp("items").setValue(items); + + top.Ext.getCmp("wareHouseId").setValue(top.Ext.getCmp("wareHouse").getValue()); + top.Ext.getCmp("wareHouseName").setValue(top.Ext.getCmp("wareHouse").getRawValue()); + // items为json数组字符串,不会为null if(items == '[]'){ showResult('盘点明细列表不能为空');