123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- Ext.define('erp.view.scm.reserve.MonthAccount',{
- extend: 'Ext.Viewport',
- layout: 'anchor',
- hideBorders: true,
- initComponent : function(){
- var me = this;
- Ext.apply(me, {
- items: [{
- xtype: 'form',
- anchor: '100% 10%',
- bodyStyle: 'background:#f1f1f1',
- layout: 'column',
- defaults: {
- xtype: 'displayfield',
- columnWidth: .2,
- margin: '5 0 0 10'
- },
- items: [{
- fieldLabel: '期间',
- id: 'info_ym',
- margin: '8 0 0 10',
- value: Ext.Date.format(new Date(), 'Ym')
- },{
- xtype: 'checkbox',
- id: 'chkun',
- boxLabel: '包括未记账凭证'
- },{
- xtype: 'checkbox',
- id: 'chkbalance',
- boxLabel: '只显示有差额科目'
- }],
- buttonAlign: 'center',
- buttons: [{
- name: 'query',
- id: 'query',
- text: $I18N.common.button.erpQueryButton,
- iconCls: 'x-button-icon-query',
- cls: 'x-btn-gray',
- margin: '0 4 0 0'
- },{
- name: 'export',
- text: $I18N.common.button.erpExportButton,
- iconCls: 'x-button-icon-excel',
- cls: 'x-btn-gray',
- handler: function(btn){
- var grid = btn.ownerCt.ownerCt.ownerCt.down("#scmMonthAccountGrid");
- Ext.create('erp.util.BaseUtil').exportGrid(grid,'存货核算对账检查');
- }
- },{
- text: $I18N.common.button.erpCloseButton,
- iconCls: 'x-button-icon-close',
- cls: 'x-btn-gray',
- margin: '0 4 0 0',
- handler: function(){
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().close();
- }
- }]
- },{
- xtype: 'grid',
- anchor: '100% 90%',
- id:'scmMonthAccountGrid',
- columnLines: true,
- columns: [{
- text: '期间',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_yearmonth',
- xtype: 'numbercolumn',
- format: '0',
- width: 80
- },{
- text: '科目',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_catecode',
- width: 110
- },{
- text: '期初余额',
- cls: 'x-grid-header-1',
- columns: [{
- text: '库存系统',
- cls: 'x-grid-header-1',
- dataIndex: 'pwm_beginamount',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '总账系统',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_beginbalance',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '差额',
- cls: 'x-grid-header-1',
- dataIndex: 'beginbalance',
- align: 'right',
- width: 120,
- renderer: function(val, meta, record) {
- val = record.get('pwm_beginamount') - record.get('cm_beginbalance');
- if(record.get('beginbalance') != val) {
- record.set('beginbalance', val);
- }
- return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
- }
- }]
- },{
- text: '本期借方发生',
- cls: 'x-grid-header-1',
- columns: [{
- text: '库存系统',
- cls: 'x-grid-header-1',
- dataIndex: 'pwm_nowinamount',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '总账系统',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_nowdebit',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '差额',
- cls: 'x-grid-header-1',
- dataIndex: 'nowdebit',
- align: 'right',
- width: 120,
- renderer: function(val, meta, record) {
- val = record.get('pwm_nowinamount') - record.get('cm_nowdebit');
- if(record.get('nowdebit') != val) {
- record.set('nowdebit', val);
- }
- return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
- }
- }]
- },{
- text: '本期贷方发生',
- cls: 'x-grid-header-1',
- columns: [{
- text: '库存系统',
- cls: 'x-grid-header-1',
- dataIndex: 'pwm_nowoutamount',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '总账系统',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_nowcredit',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '差额',
- cls: 'x-grid-header-1',
- dataIndex: 'nowcredit',
- align: 'right',
- width: 120,
- renderer: function(val, meta, record) {
- val = record.get('pwm_nowoutamount') - record.get('cm_nowcredit');
- if(record.get('nowcredit') != val) {
- record.set('nowcredit', val);
- }
- return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
- }
- }]
- },{
- text: '期末余额',
- cls: 'x-grid-header-1',
- columns: [{
- text: '库存系统',
- cls: 'x-grid-header-1',
- dataIndex: 'pwm_endamount',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '总账系统',
- cls: 'x-grid-header-1',
- dataIndex: 'cm_endbalance',
- xtype: 'numbercolumn',
- format: '0,000.000',
- align: 'right',
- width: 120
- },{
- text: '差额',
- cls: 'x-grid-header-1',
- dataIndex: 'endbalance',
- align: 'right',
- width: 120,
- renderer: function(val, meta, record) {
- val = record.get('pwm_endamount') - record.get('cm_endbalance');
- if(record.get('endbalance') != val) {
- record.set('endbalance', val);
- }
- return val == 0 ? '' : Ext.util.Format.number(val, '0,000.000');
- }
- }]
- }],
- store: Ext.create('Ext.data.Store', {
- fields: [{
- name: 'isCount', type: 'bool'
- },{
- name: 'cm_yearmonth', type: 'number'
- },{
- name: 'cm_catecode', type: 'string'
- },{
- name: 'pwm_beginamount', type: 'number'
- },{
- name: 'pwm_nowinamount', type: 'number'
- },{
- name: 'pwm_nowoutamount', type: 'number'
- },{
- name: 'pwm_endamount', type: 'number'
- },{
- name: 'cm_beginbalance', type: 'number'
- },{
- name: 'cm_nowdebit', type: 'number'
- },{
- name: 'cm_nowcredit', type: 'number'
- },{
- name: 'cm_endbalance', type: 'number'
- },{
- name: 'beginbalance', type: 'number'
- },{
- name: 'nowdebit', type: 'number'
- },{
- name: 'nowcredit', type: 'number'
- },{
- name: 'endbalance', type: 'number'
- }],
- viewConfig: {
- getRowClass: function(record) {
- return record.get('isCount') ? 'isCount' : null;
- }
- }
- })
- }]
- });
- me.callParent(arguments);
- }
- });
|