Ext.define('saas.view.sale.b2b.reconciliation.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'sale-b2b-reconciliation-formpanel', controller: 'sale-b2b-reconciliation-formpanel', viewModel: 'sale-b2b-reconciliation-formpanel', viewName: 'sale-b2b-reconciliation-formpanel', //字段属性 _title: '应收对账单', _idField: 'id', _codeField: 'code', _readUrl: '/api/sale/b2b/apCheck/info', initId: 0, initComponent: function () { Ext.apply(this, { defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id' },{ xtype: 'hidden', name: 'endDate', fieldLabel: 'endDate' },{ xtype: 'hidden', name: 'beginDate', fieldLabel: 'beginDate' }, { xtype: "textfield", name: "custName", fieldLabel: "客户名称", allowBlank: true, readOnly:true }, { xtype: "textfield", name: "ac_date", fieldLabel: "对账期间", allowBlank: true, readOnly:true }, { xtype: "datefield", renderer:function(v,m,r){ if(v&&v!=''){ return Ext.Date.format(new Date(v), 'Y-m-d H:i:s'); } }, name: "apDate", fieldLabel: "制单日期", allowBlank: true, readOnly:true } ,{ xtype: "textfield", name: "recorder", fieldLabel: "制单人", allowBlank: true, readOnly:true }, { xtype: "textfield", name: "checkStatus", fieldLabel: "对账状态", allowBlank: true, readOnly:true },{ xtype: "numberfield", name: "checkAmount", fieldLabel: "对账总额", allowBlank: true, readOnly:true },{ xtype: "textfield", name: "currency", fieldLabel: "币别", allowBlank: true, readOnly:true },{ xtype: "numberfield", name: "rate", fieldLabel: "汇率", allowBlank: true, readOnly:true }, { name: "detailGridField", xtype: "detailGridField", detnoColumn: 'ad_detno', editable:false, allowEmpty: true, columns: [{ text: "id", dataIndex: "id", xtype: "numbercolumn", hidden: true },{ text: "ad_acid", dataIndex: "ad_acid", xtype: "numbercolumn", hidden: true },{ hidden:true, text: "采购单号", width: 150.0, dataIndex: "orderCode", }, { text: "验收单号", width: 120.0, dataIndex: "inoutno", },{ text: "物料编号", width: 120.0, dataIndex: "prodCode", ignore: true, },{ text: "物料名称", dataIndex: "prodTitle", width: 150.0 },{ text: "规格型号", dataIndex: "prodSpec", width: 200.0 },{ text: "单位", dataIndex: "prodUnit", width: 100.0 },{ text: "数量", xtype:'numbercolumn', width: 150.0, dataIndex: "checkQty", ignore: true, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 3, false); } },{ text: "含税单价", width: 100.0, dataIndex: "price", xtype:'numbercolumn', ignore: true, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, false); } },{ text: "税率%", xtype:'numbercolumn', width: 100.0, dataIndex: "taxrate", ignore: true, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, false); } },{ text: "金额", xtype:'numbercolumn', width: 100.0, dataIndex: "amount", renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, false); } }], initColumns: function() { // 构造序号列 var me = this, columns = me.columns, detnoField = me.detnoColumn; indexColumn = { bind: { text: "{(configurable && isAdmin) ? ('
') : '序号'}" }, dataIndex : detnoField, width : 60, xtype : "numbercolumn", align : 'center', format:'0', allowBlank: true, }; if (detnoField) { Ext.apply(me, { columns: [indexColumn].concat(columns) }); } } }] }); this.callParent(); }, listeners:{ load:function(f){ this.getViewModel().setData({ac_date:Ext.Date.format(new Date(this.getViewModel().data.beginDate),'Y-m-d') + ' --- ' + Ext.Date.format(new Date(this.getViewModel().data.endDate),'Y-m-d')}) } }, isDirty: function () { return false; } });