From d669168da9dd3502dfd82e5f0fc0ac5d01c05df6 Mon Sep 17 00:00:00 2001 From: reedmi Date: Wed, 18 Mar 2015 02:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5wareform=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MonthendInventoryController.js | 48 +------------------ .../inventories/MonthendInventoryView.js | 34 ++----------- .../drp/app/view/resources/WareViewForm.js | 9 +++- 3 files changed, 13 insertions(+), 78 deletions(-) diff --git a/src/main/webapp/drp/app/controller/projects/inventories/MonthendInventoryController.js b/src/main/webapp/drp/app/controller/projects/inventories/MonthendInventoryController.js index 2d83b3a..e56760f 100644 --- a/src/main/webapp/drp/app/controller/projects/inventories/MonthendInventoryController.js +++ b/src/main/webapp/drp/app/controller/projects/inventories/MonthendInventoryController.js @@ -4,56 +4,16 @@ Ext.define('drp.app.controller.projects.inventories.MonthendInventoryController' monthendInventoryGrid : null, projectId : null, systemSelected : null, - - init : function() { me = this; this.control({ 'monthendinventoryview' : { afterrender : function(panel) { - systemSelected = false; - monthendInventoryGrid = panel.down('gridpanel'); - monthendInventoryGrid.setDisabled(true); - - if(user.type != "MaterialKeeper"){ - monthendInventoryGrid.down('#exportExcel_btn').setVisible(false); - } - } - }, - - 'monthendinventoryview > treepanel' : { - select : function(treepanel, record){ - monthendInventoryGrid.setDisabled(false); - //判断选择的是否为系统 - if(record.isLeaf()){ - systemSelected = true; - }else{ - systemSelected = false; - } - - projectId = record.data.id; - var _url = "project/"+projectId+"/inventories/monthend"; - var store = monthendInventoryGrid.getStore(); - store.getProxy().url = _url; - Ext.apply(store.proxy.extraParams, { - formonth : monthendInventoryGrid.down("monthfield").getSubmitValue() - }); - store.load(); - }, - afterrender : function(treepanel){ - var store = treepanel.getStore(); - Ext.apply(store.proxy.extraParams, { - userType : user.type, - userId : user.id - }); - store.load({ - node : store.getRootNode() - }); } }, - + 'monthendinventoryview monthfield' : { select : function(monthfield) { @@ -72,10 +32,6 @@ Ext.define('drp.app.controller.projects.inventories.MonthendInventoryController' 'monthendinventoryview button[action=exportExcel]' : { click : function(btn){ - if(!systemSelected){ - Ext.Msg.alert("提示", "请选择左侧的系统,并导出盘点表"); - return; - } var formonth = btn.up('monthendinventoryview').down('monthfield').getSubmitValue(); document.location = "project/"+projectId+"/inventories/monthend/export?formonth="+formonth; } @@ -84,6 +40,6 @@ Ext.define('drp.app.controller.projects.inventories.MonthendInventoryController' }, views : ['drp.app.view.projects.inventories.MonthendInventoryView','drp.widget.MonthField'], - models :['drp.app.model.projects.ProjectModel','drp.app.model.projects.inventories.MonthEndInventoryModel'], + models :['drp.app.model.projects.inventories.MonthEndInventoryModel'], stores : ['drp.app.store.projects.inventories.MonthEndInventoryStore'] }); \ No newline at end of file diff --git a/src/main/webapp/drp/app/view/projects/inventories/MonthendInventoryView.js b/src/main/webapp/drp/app/view/projects/inventories/MonthendInventoryView.js index a2c7e84..bf8409b 100644 --- a/src/main/webapp/drp/app/view/projects/inventories/MonthendInventoryView.js +++ b/src/main/webapp/drp/app/view/projects/inventories/MonthendInventoryView.js @@ -6,34 +6,12 @@ Ext.define('drp.app.view.projects.inventories.MonthendInventoryView', { layout : { type : 'border' }, - title : '
月底汇总', + title : '
每日总账', initComponent : function() { var me = this; Ext.applyIf(me, { items : [{ - xtype : 'treepanel', - region : 'west', - width : 200, - rootVisible : false, - - title : '项目列表', - store : Ext.create("Ext.data.TreeStore",{ - defaultRootId : '', - //防止store自动加载 - //http://www.sencha.com/forum/showthread.php?150004-How-to-stop-TreeStore-autoload - root : { - data : [] - }, - model : 'drp.app.model.projects.ProjectModel' - }), - columns : [{ - xtype : 'treecolumn', - dataIndex : 'name', - text : '名称', - flex : 1 - }] - }, { xtype : 'gridpanel', region : 'center', title : '库存量', @@ -98,18 +76,12 @@ Ext.define('drp.app.view.projects.inventories.MonthendInventoryView', { fieldLabel: '日期', listeners : { afterrender : function(mf){ - if(mf.getValue()==null){ + if(mf.getValue() == null){ mf.setValue(new Date()); } } } - }, '->', /*{ - xtype: 'button', - icon : 'resources/images/icons/upload.gif', - margin : '1 5 1 0', - itemId : 'importExcel_btn', - text: '导入excel' - }, */{ + }, '->', { xtype: 'button', icon : 'resources/images/icons/download.gif', margin : '1 5 1 0', diff --git a/src/main/webapp/drp/app/view/resources/WareViewForm.js b/src/main/webapp/drp/app/view/resources/WareViewForm.js index e9439db..f6ea827 100644 --- a/src/main/webapp/drp/app/view/resources/WareViewForm.js +++ b/src/main/webapp/drp/app/view/resources/WareViewForm.js @@ -82,7 +82,14 @@ Ext.define("drp.app.view.resources.WareViewForm", { name : 'produceOn', format:'Y-m-d', editable : false, - fieldLabel : '生产日期' + fieldLabel : '生产日期', + listeners : { + afterrender : function(df){ + if(df.getValue() == null){ + df.setValue(new Date()); + } + } + } }, { xtype : 'combobox', fieldLabel : '保质期',