Price.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. Ext.define('erp.view.crm.customermgr.customervisit.Price',{
  2. extend:'Ext.grid.Panel',
  3. alias:'widget.Price',
  4. requires:['erp.view.core.toolbar.Toolbar'],
  5. layout:'fit',
  6. id:'Price',
  7. emptyText : $I18N.common.grid.emptyText,
  8. columnLines : true,
  9. autoScroll : true,
  10. //detno:'md_detno',
  11. keyField:'pr_id',
  12. mainField:'pr_vrid',
  13. columns:[],
  14. bodyStyle:'bachgroud-color:#f1f1f1;',
  15. plugins:Ext.create('Ext.grid.plugin.CellEditing',{
  16. clicksToEdit:1
  17. }),
  18. bbar:{
  19. xtype: 'erpToolbar',
  20. id:'Pricebar'
  21. },
  22. caller:'Price',
  23. test:0,
  24. GridUtil:Ext.create('erp.util.GridUtil'),
  25. BaseUtil:Ext.create('erp.util.BaseUtil'),
  26. initComponent:function(){
  27. this.callParent(arguments);
  28. // console.log(urlCondition);
  29. //得到页面上显示的formCondition属性
  30. var urlCondition = this.BaseUtil.getUrlParam('formCondition');
  31. //定义通过IS拆分后的数值
  32. var cons=null;
  33. //存在urlCondition的情况下
  34. if(urlCondition){
  35. //对urlCondition进行拆分 urlCondition的格式一半为pp_idIS1
  36. if(urlCondition.indexOf('IS')>=0){
  37. cons = urlCondition.split("IS");
  38. }else{
  39. cons = urlCondition.split("=");
  40. if(cons[1].indexOf('\'')>=0){
  41. cons[1]=cons[1].slice(1,cons[1].length-1);
  42. }
  43. }
  44. }
  45. var pp_id=0;
  46. if(cons!=null){
  47. if(cons[0]&&cons[1]){
  48. if(cons[0]!=null&&cons[0]!=''){
  49. if(cons[1]>0){
  50. pp_id=cons[1];
  51. }else{
  52. pp_id=0;
  53. }
  54. }
  55. }
  56. }
  57. var condition = " pr_vrid='"+pp_id+"'";
  58. this.getMyData(condition);
  59. },
  60. getMyData:function(condition){
  61. // console.log(condition);
  62. var me = this;
  63. var params = {
  64. caller:this.caller,
  65. condition:condition
  66. };
  67. if(me.columns && me.columns.length > 2){
  68. me.GridUtil.loadNewStore(me,params);
  69. } else {
  70. me.GridUtil.getGridColumnsAndStore(me,'common/singleGridPanel.action',params);
  71. }
  72. }
  73. });