Ext.define('saas.view.purchase.report.Purchase', { extend: 'saas.view.core.report.ReportPanel', xtype: 'purchase-report-purchase', controller: 'purchase-report-purchase', viewModel: 'purchase-report-purchase', viewName: 'purchase-report-purchase', groupField: null, listUrl: '/api/purchase/report/purchaseDetail', defaultCondition: null, reportTitle: '采购明细报表', QueryWidth:0.2, //筛选:供应商、日期(必填)、业务状态 searchItems: [ { xtype: 'vendorDbfindTrigger', name: 'pu_vendname', fieldLabel: '供应商名称', columnWidth: 0.2 }, { xtype: 'condatefield', name: 'pu_date', fieldLabel: '单据日期', columnWidth: 0.4 }, { xtype: 'multicombo', name: 'pu_acceptstatuscode', fieldLabel: '业务状态', columnWidth: 0.2, datas: [ ["TURNIN", "已入库"], ["UNTURNIN", "未入库"], ["PART2IN", "部分入库"], ["CLOSE", "已关闭"] ] }], reportModel: 'saas.model.report.Purchase', reportColumns: [ { text: 'id', dataIndex: 'pu_id', hidden: true }, { text: '采购单号', dataIndex: 'pu_code', width: 150 }, { text: '供应商编号', dataIndex: 'pu_vendcode', hidden: true }, { text: '供应商名称', dataIndex: 'pu_vendname', width: 250 }, { text: '业务状态', align: 'center', dataIndex: 'pu_acceptstatus', width: 90 }, { text: '采购员', dataIndex: 'pu_buyername', width: 110 }, { text: '单据日期', xtype: 'datecolumn', dataIndex: 'pu_date', width: 110 }, { text: '序号', dataIndex: 'pd_detno', exportFormat: 'Integer', xtype: 'numbercolumn', width: 80 }, { text: '物料编号', width: 150, dataIndex: 'pd_prodcode' }, { text: '品牌', dataIndex: 'pr_brand', width: 200 }, { text: '名称', dataIndex: 'pr_detail', width: 200 }, { text: '型号', dataIndex: 'pr_orispeccode', width: 200 }, { text: '规格', dataIndex: 'pr_spec', width: 150 }, { text: '采购数量', dataIndex: 'pd_qty', xtype: 'numbercolumn', exportFormat: 'Quantity', width: 110, summaryType: 'sum', 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); }, summaryRenderer: 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: 'pr_unit', width: 80 }, { text: '单价(元)', dataIndex: 'pd_price', exportFormat: 'Price', width: 110, xtype: 'numbercolumn', 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_taxrate', exportFormat: 'Integer', width: 80, xtype: 'numbercolumn', renderer: function(v) { return Ext.util.Format.number(v, '0'); } }, { text: '金额(元)', dataIndex: 'pd_total', exportFormat: 'Amount', width: 110, xtype: 'numbercolumn', 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); }, summaryType: 'sum', summaryRenderer: 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_taxprice', exportFormat: 'Price', width: 150, xtype: 'numbercolumn', 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: '不含税金额(元)', exportFormat: 'Amount', width: 150, dataIndex: 'pd_taxtotal', xtype: 'numbercolumn', 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_pdacceptqty', exportFormat: 'Quantity', width: 110, xtype: 'numbercolumn', 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); }, summaryType: 'sum', summaryRenderer: 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_pdaccepttotal', exportFormat: 'Amount', width: 110, xtype: 'numbercolumn', 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_remark', width: 250 }] });