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', caller:'Bom', //字段属性 _title:'BOM资料', _idField: 'id', _codeField: 'bo_mothercode', _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, codeInHeader: false, defaultButtons:[{ cls: 'x-formpanel-btn-orange', 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", }], defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id', },{ xtype: 'hidden', name: 'bo_motherid', fieldLabel: '产品id' },{ xtype : "dbfindtrigger", name: 'bo_mothercode', fieldLabel: '产品编号', allowBlank: false },{ xtype: 'textfield', name: 'bo_mothername', fieldLabel: '产品名称', allowBlank: false },{ xtype: 'textfield', name: 'pr_spec', fieldLabel: '产品规格', reddOnly:true, ignore:true },{ xtype: 'textfield', name: 'bo_status', fieldLabel: '产品状态' },{ xtype: 'hidden', name: 'bo_statuscode', fieldLabel: '状态码' },{ xtype: 'textfield', name: 'bo_version', fieldLabel: '版本' }, { xtype : "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", editor : { displayField : "display", editable : true, format : "", hideTrigger : false, maxLength : 100.0, minValue : null, positiveNum : false, queryMode : "local", store : null, valueField : "value", xtype : "multidbfindtrigger" } }, { allowBlank:false, text : "物料ID", hidden : true, dataIndex : "bd_sonid", },{ text: 'model映射需要', dataIndex: 'productDTO', hidden: true, }, { text : "物料名称", dataIndex : "pr_detail", ignore:true, renderer: function (v, m, r) { return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v; } }, { text : "物料规格", dataIndex : "pr_spec", ignore:true, renderer: function (v, m, r) { return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v; } }, { allowBlank:false, text : "单位", editor : { xtype : "textfield" }, dataIndex : "bd_unit", }, { allowBlank:false, text : "用量", dataIndex : "bd_baseqty", editor : { xtype : "numberfield", decimalPrecision: 3, minValue:0 }, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "替代料", dataIndex : "bd_replace", editor : { displayField : "display", editable : true, format : "", hideTrigger : false, maxLength : 100.0, minValue : null, positiveNum : false, queryMode : "local", store : null, valueField : "value", xtype : "multidbfindtrigger" } }, { text : "备注", dataIndex : "bd_remark", width : 250, items : null, editor : { xtype : "textfield" }, }] },{ xtype : "datefield", name : "createTime", fieldLabel : "创建时间" },{ xtype : "datefield", name : "updateTime", fieldLabel : "更新时间" }], auditTexts: { auditCode: 'CLOSE', auditText: '已关闭', unAuditCode: 'OPEN', unAuditText: '已开启', auditBtnText: '禁用', unAuditBtnText: '启用', } });