Ext.define('saas.view.document.bom.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'document-bom-formpanel', controller: 'document-bom-formpanel', viewModel: 'document-bom-formpanel', viewName: 'document-bom-formpanel', caller: 'Bom', //字段属性 _title: 'BOM资料', _idField: 'id', _codeField: 'codefied', _statusField: 'bo_status', _statusCodeField: 'bo_statuscode', _readUrl: '/api/document/bom/read', _saveUrl: '/api/document/bom/save', _openUrl: '/api/document/bom/open', _closeUrl: '/api/document/bom/close', _deleteUrl: '/api/document/bom/delete', initId: 0, _deleteMsg: '删除的BOM资料将不能恢复,请确认是否删除?', codeInHeader: false, defaultButtons: [{ cls: 'x-formpanel-btn-blue', xtype: 'button', text: '新增', bind: { hidden: '{!id}' }, handler: 'add' }, { xtype: 'button', text: '保存', handler: 'onSave' }, { xtype: 'button', text: '删除', handler: 'delete' }, { xtype: 'button', bind: { text: '{auditBtnText}' }, handler: "auditBtnClick", }], auditTexts: { auditCode: 'BANNED', auditText: '已禁用', unAuditCode: 'ENABLE', unAuditText: '已启用', auditBtnText: '禁用', unAuditBtnText: '启用', }, initComponent: function () { Ext.applyIf(this, { defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id', }, { xtype: 'hidden', name: 'bo_motherid', fieldLabel: '产品id' }, { xtype: "productDbfindTrigger", name: 'bo_mothercode', fieldLabel: '产品编号', allowBlank: false }, { xtype: 'textfield', name: 'pr_brand', fieldLabel: '品牌', readOnly: true, }, { xtype: 'textfield', name: 'bo_mothername', fieldLabel: '产品名称', readOnly: true, allowBlank: false }, { xtype: 'textfield', name: 'pr_orispeccode', fieldLabel: '产品型号', readOnly: true, }, { xtype: 'textfield', name: 'pr_spec', fieldLabel: '产品规格', readOnly: true, ignore: true }, { xtype: 'textfield', name: 'bo_version', fieldLabel: '版本号', allowBlank: false }, { xtype: "detailGridField", name: 'detailGridField', detnoColumn: 'bd_detno', showCount: false, storeModel: 'saas.model.document.bomdetail', deleteDetailUrl: '/api/document/bom/deleteDetail', columns: [{ text: "ID", dataIndex: "id", hidden: true, xtype: "numbercolumn" }, { text: "关联ID", dataIndex: "bd_bomid", hidden: true, xtype: "numbercolumn" }, { allowBlank: false, text: "物料编号", dataIndex: "bd_soncode", width: 150, editor: { displayField: "display", editable: true, format: "", hideTrigger: false, maxLength: 100.0, minValue: null, positiveNum: false, queryMode: "local", store: null, valueField: "value", xtype: "productMultiDbfindTrigger" } }, { allowBlank: false, text: "物料ID", hidden: true, dataIndex: "bd_sonid", }, { text: 'model映射需要', dataIndex: 'productDTO', hidden: true, }, { text: "品牌", width: 100.0, dataIndex: "pr_brand", ignore: true, renderer: function (v, m, r) { if (!v) { return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null; } return v; } }, { text: "物料名称", width: 150.0, dataIndex: "pr_detail", ignore: true, renderer: function (v, m, r) { if (!v) { return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null; } return v; } }, { text: "型号", width: 200.0, dataIndex: "pr_orispeccode", ignore: true, renderer: function (v, m, r) { if (!v) { return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null; } return v; } }, { text: "规格", width: 200, dataIndex: "pr_spec", ignore: true, renderer: function (v, m, r) { if (!v) { return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null; } return v; } }, { allowBlank: false, text: "用量", width: 110, xtype: "numbercolumn", dataIndex: "bd_baseqty", editor: { xtype: "numberfield", decimalPrecision: 3, minValue: 0, maxLength: 10, align: 'end' }, renderer: function(v, m, r) { return saas.util.BaseUtil.numberFormat(v, 3, false); } }, { text: "单位", dataIndex: "bd_unit", width: 65 }, { text: "替代料", dataIndex: "bd_replace", width: 250, editor: { displayField: "display", editable: true, format: "", hideTrigger: false, maxLength: 100.0, minValue: null, positiveNum: false, queryMode: "local", store: null, valueField: "value", xtype: "productAddMultiDbfindTrigger" } }, { text: "备注", dataIndex: "bd_remark", width: 250, items: null, editor: { xtype: "textfield" }, }, { dataIndex: "bd_text1", text: "自定义字段1", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "bd_text2", text: "自定义字段2", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "bd_text3", text: "自定义字段3", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "bd_text4", text: "自定义字段4", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }, { dataIndex: "bd_text5", text: "自定义字段5", width: 100, hidden: true, initHidden: false, editor: { xtype: "textfield" }, }] }, { xtype: 'hidden', name: 'bo_statuscode', fieldLabel: '状态码', readOnly: true, defaultValue: '' }, { xtype: 'textfield', name: 'bo_status', fieldLabel: '产品状态', readOnly: true, defaultValue: '' }, { xtype: "textfield", name: "creatorName", readOnly: true, fieldLabel: "录入人" }, { xtype: "datefield", name: "createTime", fieldLabel: "录入时间" }, { xtype: "textfield", name: "bo_text1", fieldLabel: "自定义字段1", hidden: true, initHidden: false }, { xtype: "textfield", name: "bo_text2", fieldLabel: "自定义字段2", hidden: true, initHidden: false }, { xtype: "textfield", name: "bo_text3", fieldLabel: "自定义字段3", hidden: true, initHidden: false }, { xtype: "textfield", name: "bo_text4", fieldLabel: "自定义字段4", hidden: true, initHidden: false }, { xtype: "textfield", name: "bo_text5", fieldLabel: "自定义字段5", hidden: true, initHidden: false }], }); this.callParent(arguments); }, });