Ext.define('saas.view.stock.make.FormPanel', { extend: 'saas.view.core.form.FormPanel', xtype: 'stock-make-formpanel', controller: 'stock-make-formpanel', viewModel: 'stock-make-formpanel', viewName: 'stock-make-formpanel', caller:'Make', //字段属性 _title:'制造单', _idField: 'id', _codeField: 'ma_code', _statusField: 'ma_status', _statusCodeField: 'ma_statuscode', _relationColumn: 'mm_maid', _readUrl:'/api/storage/make/read/', _saveUrl:'/api/storage/make/save', _auditUrl:'/api/storage/make/audit', _unAuditUrl: '/api/storage/make/unAudit/', _deleteUrl:'/api/storage/make/delete/', initId:0, toolBtns: [], defaultItems: [{ xtype: 'hidden', name: 'id', fieldLabel: 'id', columnWidth: 0 }, { xtype : "textfield", name : "ma_code", fieldLabel : "制造单号", columnWidth: 0.2 }, { xtype : "textfield", name : "ma_type", fieldLabel : "类型", columnWidth: 0.2 },{ xtype: 'hidden', name: 'ma_prodid', fieldLabel: '产品id', columnWidth: 0 },{ xtype : "dbfindtrigger", name : "ma_prodcode", fieldLabel : "产品编号", columnWidth: 0.2 },{ xtype : "textfield", name : "ma_proddetail", fieldLabel : "名称", columnWidth: 0.2 },{ xtype : "textfield", name : "ma_prodspec", fieldLabel : "规格", columnWidth: 0.2 },{ xtype : "textfield", name : "ma_version", fieldLabel : "版本", columnWidth: 0.2 },{ xtype : "textfield", name : "ma_produnit", fieldLabel : "单位", columnWidth: 0.2 }, { xtype : "numberfield", name : "ma_qty", fieldLabel : "数量", columnWidth: 0.2, minValue:0 },{ xtype : "hidden", name : "ma_whid", fieldLabel : "仓库id", columnWidth: 0.2 },{ xtype : "hidden", name : "ma_whcode", fieldLabel : "仓库编号", columnWidth: 0.2 },{ xtype : "dbfindtrigger", name : "ma_whname", fieldLabel : "仓库名称", columnWidth: 0.2 }, { name : "detailGridField", xtype : "detailGridField", storeModel:'saas.model.stock.Makematerial', detnoColumn: 'mm_detno', deleteDetailUrl:'/api/storage/make/deleteDetail/', columns : [ { text : "id", dataIndex : "id", xtype : "numbercolumn", hidden:true }, { text : "mm_prodidid", dataIndex : "mm_prodid", xtype : "numbercolumn", hidden:true }, { text : "物料编号", width : 200.0, dataIndex : "mm_prodcode", xtype : "", items : null, 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 : "pr_detail", width : 100.0, ignore:true, renderer: function (v, m, r) { return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v; } }, { text : "规格", dataIndex : "pr_spec", width : 100.0, ignore:true, renderer: function (v, m, r) { return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:v; } }, { text : "单位", dataIndex : "pr_unit", width : 100.0, ignore:true, renderer: function (v, m, r) { return r.data["productDTO"]?r.data["productDTO"][m.column.dataIndex]:''; } }, { text : "数量", dataIndex : "pd_qty", width : 120.0, editor : { xtype : "numberfield", decimalPrecision: 8, 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); }, summaryType: 'sum', summaryRenderer: 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 : "仓库id", dataIndex : "mm_whid", xtype : "numbercolumn", hidden:true }, { text : "仓库编号", dataIndex : "mm_whcode", hidden:true }, { text : "仓库", dataIndex : "mm_whname", width : 120.0, items : null, editor : { displayField : "display", editable : true, format : "", hideTrigger : false, maxLength : 100.0, minValue : null, positiveNum : false, queryMode : "local", store : null, valueField : "value", xtype : "dbfindtrigger" } },{ text : "替代料", dataIndex : "mm_repprodcode", width : 200.0, hidden:true }, { text : "备注", dataIndex : "mm_remark", width : 250, hidden:true }] },{ xtype : "datefield", name : "createTime", bind : "{createTime}", fieldLabel : "制单日", allowBlank : true, columnWidth : 0.25 },{ xtype : "textfield", name : "ma_recorder", fieldLabel : "制单人", columnWidth: 0.2 },{ xtype : "numberfield", name : "ma_price", fieldLabel : "单位成本", columnWidth: 0.2 },{ xtype : "numberfield", name : "ma_total", fieldLabel : "总成本", columnWidth: 0.2 }, { xtype : "datefield", name : "updateTime", bind : "{updateTime}", fieldLabel : "更新时间", allowBlank : true, columnWidth : 0.25 }, { xtype : "textfield", readOnly : true, editable : false, name : "ma_status", bind : "{ma_status}", fieldLabel : "单据状态", allowBlank : true, columnWidth : 0.25 }, { xtype : "hidden", readOnly : true, editable : false, name : "ma_statuscode", bind : "{ma_statuscode}", fieldLabel : "单据状态码", allowBlank : true, columnWidth : 0.0 }] });