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', viewName: 'document-product-basepanel', deleteMoreMsg: '删除的物料将不能恢复,请确认是否删除?', deleteOneMsg: '删除的物料将不能恢复,请确认是否删除?', initComponent: function () { Ext.apply(this, { searchField: [{ xtype: "textfield", name: "pr_code", width: 300, emptyText: '输入物料编号、名称、型号或品牌', getCondition: function (v) { return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )"; }, }, { editable: true, hiddenBtn: true, xtype: "remotecombo", storeUrl: '/api/document/producttype/getCombo', name: "pr_kind", fieldLabel: '物料类型', emptyText: '全部', }, { xtype: 'combobox', name: 'pr_statuscode', queryMode: 'local', displayField: 'pr_status', valueField: 'pr_statuscode', fieldLabel: '状态', emptyText: '全部', editable: false, defaultValue: 'ENABLE', 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_brand", width: 100.0 }, { text: "物料名称", dataIndex: "pr_detail", width: 150.0 }, { text: "型号", dataIndex: "pr_orispeccode", width: 200.0 }, { text: "规格", dataIndex: "pr_spec", width: 200.0 }, { text: "物料类型", dataIndex: "pr_kind", width: 100 }, { text: "库存", dataIndex: "po_onhand", xtype: 'numbercolumn', width: 100.0, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 3, false); } }, { text: "单位", dataIndex: "pr_unit", width: 65.0 }, { text: "标准定价(元)", dataIndex: "pr_standardprice", xtype: 'numbercolumn', width: 110.0, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, true); } }, { text: "最新购价(元)", dataIndex: "pr_purcprice", xtype: 'numbercolumn', width: 110.0, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, true); } }, { text: "最新售价(元)", dataIndex: "pr_saleprice", xtype: 'numbercolumn', width: 110.0, renderer: function (v, m, r) { return saas.util.BaseUtil.numberFormat(v, 4, true); } }, { text: "备注", dataIndex: "pr_text1", width: 250.0 }, { text: "状态", dataIndex: "pr_status", align: 'center', width: 80.0 }] }, }); this.callParent(arguments); }, refresh: function () { this.items.items[0].store.load() } });