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', deleteMoreMsg: '删除的物料将不能恢复,请确认是否删除?', deleteOneMsg: '删除的物料将不能恢复,请确认是否删除?', searchField:[{ xtype : "textfield", name : "pr_code", width:300, emptyText:'输入物料编号、名称、型号、规格或品牌', getCondition: function (v) { return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_spec,''),'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )"; }, },{ editable:true, hiddenBtn:true, xtype : "remotecombo", storeUrl: '/api/document/producttype/getCombo', name : "pr_kind", fieldLabel : '物料类型' }, { xtype: 'combobox', name: 'pr_statuscode', queryMode: 'local', displayField: 'pr_status', valueField: 'pr_statuscode', fieldLabel : '状态', editable:false, store: Ext.create('Ext.data.ArrayStore', { fields: ['pr_statuscode', 'pr_status'], data: [ ["ALL", "全部"], ["ENABLE", "已启用"], ["BANNED", "已禁用"] ] }), getCondition: function(value) { if(value == 'ALL' || !value) { return '1=1'; }else { return 'pr_statuscode=\'' + value + '\''; } } }], //字段属性 caller:'Product', _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', caller: 'Product', columns : [{ text : "id", width : 0, dataIndex : "id", xtype : "numbercolumn", },{ text : "物料编号", dataIndex : "pr_code", width : 150.0 }, { text : "类型", dataIndex : "pr_kind", width : 110.0 }, { text : "物料名称", dataIndex : "pr_detail", width : 200.0 }, { text : "型号", dataIndex : "pr_orispeccode", width : 150.0 }, { text : "规格", dataIndex : "pr_spec", width : 150.0 },{ text : "品牌", dataIndex : "pr_brand", width : 110.0 }, { text : "库存", dataIndex : "po_onhand", xtype: 'numbercolumn', width : 120.0, 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_unit", width : 80.0 }, { text : "标准定价(元)", dataIndex : "pr_standardprice", xtype: 'numbercolumn', width : 130.0, 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', width : 140.0, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "最新售价(元)", dataIndex : "pr_saleprice", xtype: 'numbercolumn', width : 120.0, renderer : function(v) { var arr = (v + '.').split('.'); var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0'); var format = '0.' + xr.join(); return Ext.util.Format.number(v, format); } }, { text : "备注", dataIndex : "pr_text1", width :250.0 }, { text : "状态", dataIndex : "pr_status", width : 90.0 }] }, refresh:function(){ this.items.items[0].store.load() } });