Ext.define('saas.view.document.product.BasePanel', { extend: 'saas.view.core.base.BasePanel', xtype: 'document-product-basepanel', controller: 'document-product-basepanel', viewModel: 'document-product-basepanel', searchField:[{ xtype : "dbfindtrigger", name : "pr_code", emptyText : "物料编号", width:120 },{ xtype : "textfield", name : "pr_detail", emptyText : "物料名称", width:120 },{ xtype : "textfield", name : "pr_spec", emptyText : "规格", width:100 },{ editable:false, hiddenBtn:true, xtype : "remotecombo", storeUrl: '/api/document/producttype/getCombo', name : "pr_kind", emptyText : "物料类型", width:120 },{ xtype : "textfield", name : "pr_brand", emptyText : "品牌", width:100 },{ xtype : "textfield", name : "pr_orispeccode", emptyText : "型号", width:100 }, { xtype: 'combobox', name: 'pr_statuscode', fieldLabel: '状态', queryMode: 'local', displayField: 'pr_status', valueField: 'pr_statuscode', emptyText :'全部', editable:false, store: Ext.create('Ext.data.ArrayStore', { fields: ['pr_statuscode', 'pr_status'], data: [ ["ALL", "全部"], ["OPEN", "已开启"], ["CLOSE", "已关闭"] ] }), getCondition: function(value) { if(value == 'ALL') { return '1=1'; }else { return 'pr_statuscode=\'' + value + '\''; } } }], //字段属性 _formXtype:'document-product-formpanel', _title:'物料资料', _deleteUrl:'/api/document/product/delete/', _batchOpenUrl:'/api/document/product/batchOpen', _batchCloseUrl:'/api/document/product/batchClose', _batchDeleteUrl:'/api/document/product/batchDelete', gridConfig: { idField: 'id', codeField: 'pr_code', statusCodeField:'pr_statuscode', dataUrl: '/api/document/product/list', columns : [{ text : "id", width : 0, dataIndex : "id", xtype : "numbercolumn", },{ text : "物料编号", width : 200.0, dataIndex : "pr_code" }, { text : "物料名称", dataIndex : "pr_detail", width : 120.0 }, { text : "规格", dataIndex : "pr_spec" }, { text : "类型", dataIndex : "pr_kind" }, { text : "单位", dataIndex : "pr_unit" }, { text : "总库存数", dataIndex : "po_onhand", xtype: 'numbercolumn', renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "标准单价", dataIndex : "pr_standardprice", xtype: 'numbercolumn', renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0'); var format = '0,000.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "最新采购单价", dataIndex : "pr_purcprice", xtype: 'numbercolumn', renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); }, width : 200.0, }, { text : "最新出库单价", dataIndex : "pr_saleprice", xtype: 'numbercolumn', renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); }, width : 200.0, }, { text : "型号", dataIndex : "pr_orispeccode" }, { text : "品牌", dataIndex : "pr_brand" }, { text : "供应商", dataIndex : "pr_vendname" }, { text : "最小包装", dataIndex : "pr_zxbzs", xtype: 'numbercolumn', renderer : function(v) { return Ext.util.Format.number(v, '0'); } }, { text : "L/T", dataIndex : "pr_leadtime", xtype: 'numbercolumn', renderer : function(v) { return Ext.util.Format.number(v, '0'); } }, { text : "状态", dataIndex : "pr_status" }] }, refresh:function(){ this.items.items[0].store.load() } });