Index: ssts-web/src/main/webapp/disinfectsystem/materialmanager/materialOutView.js =================================================================== diff -u -r12724 -r13119 --- ssts-web/src/main/webapp/disinfectsystem/materialmanager/materialOutView.js (.../materialOutView.js) (revision 12724) +++ ssts-web/src/main/webapp/disinfectsystem/materialmanager/materialOutView.js (.../materialOutView.js) (revision 13119) @@ -1,4 +1,4 @@ -var entityName = "器械退库管理"; +var entityName = "材料退库单"; var grid; var diposableGoodsStore = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ @@ -18,12 +18,20 @@ name : 'name', mapping : 'name' }, { + name : 'displayName', + mapping : 'displayName' + }, { name : 'cost', mapping : 'cost' }, { name : 'referencePrice', mapping : 'referencePrice' - }]) + }]), + listeners : { + beforeload : function(store,option) { + store.baseParams['wareHouseId'] = top.Ext.getCmp('wareHouseId').getValue(); + } + } }); var supplierStore = new Ext.data.Store({ @@ -130,6 +138,26 @@ }); function addGodownEntry(type) { + 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('wareHouseId')) { + top.Ext.getCmp('wareHouseId').setValue(records[0].data.id); + } + if (top.Ext.getCmp('wareHouseName')) { + top.Ext.getCmp('wareHouseName').setValue(records[0].data.name); + } + } + } + }*/ + }); var form = new top.Ext.FormPanel({ id : 'godownEntryForm', frame : true, @@ -154,6 +182,14 @@ name : 'items', id : 'items' },{ + xtype : 'hidden', + name : 'wareHouseId', + id : 'wareHouseId' + },{ + xtype : 'hidden', + name : 'wareHouseName', + id : 'wareHouseName' + },{ id:'serialNum', columnWidth : .33, layout : 'form', @@ -200,6 +236,30 @@ value : new Date(), anchor : '95%' }] + },{ + columnWidth : .35, + 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%', + listeners : { + select : function(combo, record, index) { + top.Ext.getCmp('wareHouseId').setValue(combo.value); + top.Ext.getCmp('wareHouseName').setValue(combo.getRawValue()); + } + } + }] }, { columnWidth : 1, layout : 'form', @@ -321,15 +381,15 @@ queryParam : 'spell', minChars : 0, valueField : 'id', - displayField : 'name', + displayField : 'displayName', store : diposableGoodsStore, forceSelection : true, lazyInit : false, triggerAction : 'all', hideTrigger : true, typeAhead : false, allowBlank : true, - width : 150, + width : 220, listeners : { select : function(combo, record, index) { top.Ext.getCmp('name1').setValue(record.data.name); @@ -359,7 +419,7 @@ hideTrigger : true, typeAhead : false, allowBlank : true, - width : 200, + width : 150, listeners : { select : function(combo, record, index) { combo.setValue(record.data.name); @@ -377,7 +437,7 @@ maxLength : '16', id : 'amount1', name : 'amount1', - width : 70, + width : 50, regex: /^\d+$/, regexText:'只能输入数字', anchor : '95%', @@ -395,7 +455,7 @@ maxLength : '16', id : 'cost1', name : 'cost1', - width : 70, + width : 50, regex: /^(([1-9]+[0-9]*.{1}[0-9]+)|([0].{1}[1-9]+[0-9]*)|([1-9][0-9]*)|([0][.][0-9]+[1-9]*))$/, regexText:'只能输入正数', anchor : '95%', @@ -436,7 +496,7 @@ var window = new top.Ext.Window( { id : 'recyclingApplicationWin', layout : 'fit', - title : '材料退库单信息', + title : entityName + '信息', width : 810, modal : true, autoHeight : true, @@ -445,7 +505,7 @@ items : [ form ] }); window.show(); - + top.Ext.getCmp('btnSave').setDisabled(false); if(type == 'insert'){ } @@ -507,6 +567,7 @@ function editRecord(id){ addGodownEntry(); + top.Ext.getCmp('btnSave').setDisabled(true); top.Ext.getCmp("serialNum").show(); top.Ext.getCmp('godownEntryForm').form.load({ url : WWWROOT + '/disinfectSystem/MaterialEntryAction!loadMaterialEntry.do', @@ -576,6 +637,13 @@ var sign = true; var tbar = [{ + text : '添加', + hidden : SSTS_WarehouseEntry_Create, + iconCls : 'btn_ext_add', + handler : function() { + addGodownEntry('insert'); + } + },{ text : '删除', hidden : SSTS_WarehouseEntry_Delete, iconCls : 'btn_ext_application_del', @@ -618,7 +686,7 @@ tbar : tbar, pageSize : 20, defaultSortField : 'id', - title : '材料退库单列表', + title : entityName + '列表', defaultSortDirection : 'ASC', isCheckboxSelectionModel : false, rememberSelected : false,