Ext.define('saas.view.money.report.VendorCheck', { extend: 'saas.view.core.report.ReportPanel', xtype: 'monry-report-vendorcheck', controller: 'money-report-vendorcheck', viewModel: 'money-report-vendorcheck', viewName: 'money-report-vendorcheck', // groupField: null, listUrl: '/api/money/report/vendorCheck', defaultCondition: null, reportTitle: '供应商对账单', QueryWidth:0.4, autoLoad:false, //筛选:供应商、日期(必填) searchItems: [ { xtype: 'vendorDbfindTrigger', name: 'pi_vendname', fieldLabel: '供应商名称', columnWidth: 0.2, listeners: { beforequery: function(f) { return !!f.value; }, change: 'pi_vendname_change' } }, { // xtype: 'monthdatefield', // name: 'ym', // fieldLabel: '期初日期', // columnWidth: 0.2 // }, { xtype: 'condatefield', name: 'pi_date', fieldLabel: '单据日期', columnWidth: 0.4 }], reportModel: 'saas.model.report.VendorCheck', reportColumns: [{ text: '单据日期', dataIndex: 'pi_date', xtype:'datecolumn', width: 110 }, { text: '单号', dataIndex: 'pi_inoutno', width: 150 }, { text: '业务类型', dataIndex: 'pi_class', width: 100 }, { text: '序号', xtype: 'numbercolumn', dataIndex: 'pd_pdno', exportFormat: 'Integer', width: 65 }, { text: '物料编号', dataIndex: 'pr_code', width: 150 }, { text: '品牌', dataIndex: 'pr_brand', width: 100 }, { text: '名称', dataIndex: 'pr_detail', width: 150 }, { text: '型号', dataIndex: 'pr_orispeccode', width: 200 }, { text: '规格', dataIndex: 'pr_spec', width: 200 }, { text: '数量', dataIndex: 'qty', exportFormat: 'Quantity', xtype: 'numbercolumn', width: 110, renderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(''); return Ext.util.Format.number(v, format); } }, { text: '单位', dataIndex: 'pd_unit', width: 65 }, { text: '单价(元)', dataIndex: 'pd_netprice', exportFormat: 'Price', xtype: 'numbercolumn', width: 120, renderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); } }, { text: '含税单价(元)', dataIndex: 'pd_orderprice', exportFormat: 'Price', xtype: 'numbercolumn', width: 120, renderer: function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); } }, { text: '金额(元)', dataIndex: 'pd_nettotal', exportFormat: 'Amount', xtype: 'numbercolumn', width: 120, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); }, }, { text: '税率(%)', dataIndex: 'pd_taxrate', exportFormat: 'Amount', xtype: 'numbercolumn', width: 80, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); }, }, { text: '税额(元)', xtype: 'numbercolumn', exportFormat: 'Amount', dataIndex: 'pd_ordertotal-pd_nettotal', width: 120, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); }, }, { text: '价税合计(元)', xtype: 'numbercolumn', exportFormat: 'Amount', dataIndex: 'pd_ordertotal', width: 120, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(''); return Ext.util.Format.number(v, format); }, }], listeners: { afterrender: function(panel) { panel.setLoadButtonDisabled(true); }, beforequery: function(panel) { var form = panel.items.items[0]; var values = form.getValues(); var pi_vendname = values.pi_vendname; if(!pi_vendname) { saas.util.BaseUtil.showErrorToast('请先选择【供应商名称】'); return false; } return true; } }, setLoadButtonDisabled: function (disabled) { var panel = this, grid = panel.down('grid'), p = grid.down('pagingtoolbar'), bs = p.query('button'), loadButton = Ext.Array.findBy(bs, function (b) { return b.iconCls == 'x-tbar-loading'; }); if (loadButton) { loadButton.setDisabled(disabled); } }, applyParams: function(p) { var me = this, viewModel = me.getViewModel(), formData = viewModel.get('form'), ym = formData.ym; return Ext.Object.merge(p, { ym: ym }); } });