Ext.define('make.view.osmake.osMake.ModifyMaterialWin', { extend: 'Ext.window.Window', xtype: 'osmake-osmake-modifymaterialwin', controller: 'osmake-osmake-modifymaterialwin', cls: 'x-window-dbfind', modal: true, width: 1000, minHeight: 300, scrollable: true, bodyPadding: 10, constrain: true, closable: true, layout: 'fit', title: '用料表修改', viewModel: { data: { form : { id:0, mm_detno:null, mm_prodid:null, mm_prodcode:null, mm_oneuseqty:null, mm_qty:0, mm_remark:null, pr_detail:null, pr_spec:null, pr_orispeccode:null, pr_brand:null }, ma_qty:null, ma_id:null, }, }, items: [{ xtype: 'form', layout: 'column', autoScroll: true, buttonAlign : 'center', //bodyPadding: 5, defaults:{ columnWidth:0.3 , margin: '0 0 10 0', labelAlign: 'right', labelWidth: 90 }, bodyPadding: '8 12 8 12', _saveUrl: '/api/make/make/modifyMaterial', _deleteUrl:'/api/make/make/deleteDetail', items: [{ xtype : "hidden", fieldLabel: 'ID', name :"id", bind:'{form.id}', readOnly:true },{ xtype : "textfield", fieldLabel: '序号', align: 'center', name :"mm_detno", bind:'{form.mm_detno}', readOnly:true, }, { fieldLabel: "物料id", name: "mm_prodid", bind:'{form.mm_prodid}', xtype: "hidden", },{ xtype : "productDbfindTrigger", fieldLabel: '物料编号', name :"mm_prodcode", bind:'{form.mm_prodcode}', allowBlank:false, },{ xtype : "textfield", fieldLabel: '物料名称', name :"pr_detail", bind:'{form.pr_detail}', readOnly:true, },{ xtype : "textfield", fieldLabel: '厂家/品牌', name :"pr_brand", bind:'{form.pr_brand}', readOnly:true, },{ xtype : "textfield", fieldLabel: '型号', name :"pr_orispeccode", bind:'{form.pr_orispeccode}', readOnly:true, },{ xtype : "textfield", fieldLabel: '规格', name :"pr_spec", bind:'{form.pr_spec}', maxLength: 200, readOnly:true, },{ xtype : "hiddenfield", fieldLabel: '数量小数位数', name :"pu_decimal", bind:'{form.pu_decimal}' },{ xtype : "numberfield", fieldLabel: '单位用量', name :"mm_oneuseqty", bind:'{form.mm_oneuseqty}', allowBlank:false, listeners: { change: 'onOneUseChange', }, decimalPrecision: 6, },{ xtype : "numberfield", fieldLabel: '需求数', name :"mm_qty", bind:'{form.mm_qty}', allowBlank:false, decimalPrecision: 6, thousandSeparator :',' },{ xtype : "textfield", fieldLabel: '备注', name :"mm_remark", bind:'{form.mm_remark}', }], buttons: [{ text:'新增', formBind: true, handler:function(){ //将值置空 var win = this.up('window'); win.getViewModel().set('form',null); win.setTitle('新增用料明细'); } },{ text:'保存', disabled: true, formBind: true, handler:'onSave' },{ text:'删除', handler:'onDelete', bind:{ disabled:'{form.mm_id}' } },{ text: '关闭', handler:'onClose' }] }], initComponent: function () { var me = this; me.callParent(); }, })