Ext.define('saas.view.money.othreceipts.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'money-othreceipts-formpanel', controller: 'money-othreceipts-formpanel', viewModel: 'money-othreceipts-formpanel', viewName: 'money-othreceipts-formpanel', caller: 'OthReceipts', //字段属性 _title: '其它收入单', _idField: 'id', _codeField: 'or_code', _statusField: 'or_status', _statusCodeField: 'or_statuscode', _auditmanField: 'or_auditman', _auditdateField: 'or_auditdate', _relationColumn: 'ord_orid', _readUrl: '/api/money/othreceipts/read', _saveUrl: '/api/money/othreceipts/save', _auditUrl: '/api/money/othreceipts/audit', _unAuditUrl: '/api/money/othreceipts/unAudit', _deleteUrl: '/api/money/othreceipts/delete', initId: 0, initComponent: function () { Ext.apply(this, { defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id' }, { xtype: 'hidden', name: 'or_custid', fieldLabel: '客户ID' }, { xtype: 'hidden', name: 'or_custcode', fieldLabel: '客户编号' }, { xtype: "customerDbfindTrigger", name: "or_custname", fieldLabel: "客户名称", // allowBlank : false }, { xtype: 'hidden', name: 'or_bankid', fieldLabel: '账户ID' }, { xtype: 'hidden', name: 'or_bankcode', fieldLabel: '账户编号' }, { xtype: "bandinfoDbfindTrigger", name: "or_bankname", fieldLabel: "账户名称", allowBlank: false }, { xtype: 'condbfindtrigger', fieldLabel: '币别汇率', allowBlank: false, dbType: 'currencyDbfindTrigger', dbfinds: [{ from: 'cr_name', to: 'or_currency' }, { from: 'cr_rate', to: 'or_rate' }], // defaultValue: { // or_currency: 'RMB', // or_rate: 1 // }, mainFieldConfig: { readOnly: true, defaultReadOnly: true, }, supFieldConfig: { xtype: 'numberfield', readOnly: false, defaultReadOnly: false, decimalPrecision: 6, vtype: 'positiveNumber', listeners: { change: function(f, v) { var defaultCurrency = Ext.getCmp('mainView').getViewModel().get('defaultCurrency'); f.setReadOnly(f.ownerCt.items.items[0].value == defaultCurrency); } } }, // }, { // xtype: "currencyDbfindTrigger", // name: "or_currency", // fieldLabel: "币别", // defaultValue: 'RMB' // }, { // xtype: "numberfield", // name: "or_rate", // fieldLabel: "汇率", // defaultValue: 1, // decimalPrecision: 6, // vtype: 'positiveNumber' },{ xtype: 'datefield', name: 'or_date', fieldLabel: '单据日期', defaultValue: new Date(), allowBlank: false }, { name: "detailGridField", xtype: "detailGridField", storeModel: 'saas.model.money.Othreceipts', detnoColumn: 'ord_detno', deleteDetailUrl: '/api/money/othreceipts/deleteDetail', columns: [{ text: "id", dataIndex: "id", xtype: "numbercolumn", hidden: true, }, { text: "期间", dataIndex: "ord_ym", editor: { xtype: "numberfield", readOnly: true }, // defaultValue: Ext.Date.format(new Date(), 'Ym'), width: 110.0, hidden: true, items: null }, { text: "收入类别", width: 150.0, dataIndex: "ord_type", items: null, allowBlank: false, hiddenBtn: false, //true 则会关闭新增按钮功能 editor: { xtype: "remotecombo", storeUrl: '/api/document/fundinouttype/getCombo?condition=收入', addHandler: function (b) { var document = Ext.create('saas.view.document.kind.Kind', {}); var form = this.ownerCmp.ownerCt.ownerCmp.ownerCt; this.dialog = form.getController().getView().add({ xtype: 'document-kind-childwin', bind: { title: '新增收入类别' }, dataKind: 'inoutkind', belong: document.etc['inoutkind'], _parent: form, _combo: this.ownerCmp, record: null, session: true }); this.dialog.show(); } } },{ text: "金额(元)", xtype: 'numbercolumn', dataIndex: "ord_nowbalance", width: 110.0, allowBlank: false, editor: { xtype: "numberfield", decimalPrecision: 2 }, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 2, true); }, summaryType: 'sum', summaryRenderer: function(v, d, f, m) { return saas.util.BaseUtil.numberFormat(v, 2, true); } }, { text: "备注", dataIndex: "ord_remark", width: 250, editor: { xtype: "textfield" } }, { dataIndex: "ord_text1", text: "自定义字段1", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "ord_text2", text: "自定义字段2", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "ord_text3", text: "自定义字段3", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "ord_text4", text: "自定义字段4", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "ord_text5", text: "自定义字段5", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }] }, { xtype: "numberfield", name: "or_amount", fieldLabel: "收款金额(元)", readOnly: true }, { xtype: "textfield", name: "or_remark", fieldLabel: "备注", allowBlank: true, columnWidth: 0.75 }, { xtype: "hidden", name: "creatorId", fieldLabel: "录入人ID", readOnly: true }, { xtype: "textfield", name: "creatorName", fieldLabel: "录入人", readOnly: true }, { xtype: "datefield", name: "createTime", fieldLabel: "录入日期", readOnly: true, defaultValue: new Date() }, { xtype: "hidden", name: "updaterId", fieldLabel: "更新人ID", readOnly: true }, { xtype: "hidden", name: "updaterName", fieldLabel: "更新人", readOnly: true }, { xtype: "hidden", name: "updateTime", fieldLabel: "更新日期", readOnly: true, defaultValue: new Date() }, { xtype: 'textfield', name: 'or_auditman', fieldLabel: '审核人', readOnly: true }, { xtype: "datefield", name: "or_auditdate", fieldLabel: "审核日期", readOnly: true }, { xtype: "textfield", name: "or_text1", fieldLabel: "自定义字段1", hidden: true, initHidden: false }, { xtype: "textfield", name: "or_text2", fieldLabel: "自定义字段2", hidden: true, initHidden: false }, { xtype: "textfield", name: "or_text3", fieldLabel: "自定义字段3", hidden: true, initHidden: false }, { xtype: "textfield", name: "or_text4", fieldLabel: "自定义字段4", hidden: true, initHidden: false }, { xtype: "textfield", name: "or_text5", fieldLabel: "自定义字段5", hidden: true, initHidden: false }] }); this.callParent(arguments); }, });