Skip to content

Commit

Permalink
加入wareform默认填充值
Browse files Browse the repository at this point in the history
  • Loading branch information
reedmi committed Mar 17, 2015
1 parent 8689a57 commit d669168
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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;
}
Expand All @@ -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']
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,12 @@ Ext.define('drp.app.view.projects.inventories.MonthendInventoryView', {
layout : {
type : 'border'
},
title : '<center height=40>月底汇总',
title : '<center height=40>每日总账',
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 : '库存量',
Expand Down Expand Up @@ -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',
Expand Down
9 changes: 8 additions & 1 deletion src/main/webapp/drp/app/view/resources/WareViewForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '保质期',
Expand Down

0 comments on commit d669168

Please sign in to comment.