Ext.define('make.view.make.bom.ModifyBomDetailWin', { extend: 'Ext.window.Window', xtype: 'make-bom-modifybomdetailwin', controller: 'make-bom-modifybomdetailwin', cls: 'x-window-dbfind', modal: true, width: 1000, minHeight: 300, scrollable: true, bodyPadding: 10, constrain: true, closable: true, layout: 'fit', title: 'BOM明细表修改', viewModel: { data: { form : { id:0, bd_detno:null, bd_sonid:null, bd_soncode:null, bd_baseqty:null, bd_location:null, bd_remark:null, pr_detail:null, pr_orispeccode:null, pr_brand:null, pr_spec:null, }, bo_id:null, bo_mothercode:null, }, }, items: [{ xtype: 'form', layout: 'column', autoScroll: true, buttonAlign : 'center', //bodyPadding: 5, defaults:{ columnWidth:0.5, margin: '0 0 10 0', labelAlign: 'right', labelWidth: 90 }, bodyPadding: '8 12 8 12', _saveUrl: '/api/make/bom/modifyBomDetail', _deleteUrl:'/api/make/bom/deleteDetail', items: [{ xtype : "hidden", fieldLabel: 'ID', name :"id", bind:'{form.id}', readOnly:true },{ xtype : "productDbfindTrigger", fieldLabel: '物料编号', name :"bd_soncode", bind:'{form.bd_soncode}', allowBlank:false, },{ xtype : "textfield", fieldLabel: '序号', align: 'center', name :"bd_detno", bind:'{form.bd_detno}', readOnly:true, }, { xtype : "textfield", fieldLabel: '物料名称', name :"pr_detail", bind:'{form.pr_detail}', readOnly:true, },{ xtype : "numberfield", decimalPrecision: 6, minValue: 0, fieldLabel: '单位用量', name :"bd_baseqty", bind:'{form.bd_baseqty}', allowBlank:false, /*listeners: { change: 'onOneUseChange', }*/ },{ xtype : "textfield", fieldLabel: '型号', name :"pr_orispeccode", bind:'{form.pr_orispeccode}', readOnly:true, },{ xtype : "textfield", fieldLabel: '位号', name :"bd_location", bind:'{form.bd_location}', },{ xtype : "textfield", fieldLabel: '厂家/品牌', name :"pr_brand", bind:'{form.pr_brand}', readOnly:true, },{ xtype : "textfield", fieldLabel: '备注', name :"bd_remark", bind:'{form.bd_remark}', },{ xtype : "textfield", fieldLabel: '物料规格', name :"pr_spec", bind:'{form.pr_spec}', columnWidth:1, readOnly:true, },{ fieldLabel: "物料id", name: "bd_sonid", bind:'{form.bd_sonid}', xtype: "hidden", }], buttons: [{ text:'新增', formBind: true, handler:function(){ //将值置空 var win = this.up('window'); win.getViewModel().set('form',{ id:0, bd_detno:null, bd_sonid:null, bd_soncode:null, bd_baseqty:null, bd_location:null, bd_remark:null, pr_detail:null, pr_orispeccode:null, pr_brand:null, pr_spec:null, }); win.setTitle('新增BOM明细'); } },{ text:'保存', disabled: true, formBind: true, handler:'onSave' },{ text:'删除', handler:'onDelete', bind:{ disabled:'{form.bd_id}' } },{ text: '关闭', handler:'onClose' }] }], initComponent: function () { var me = this; me.callParent(); }, })