KpiPanel.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /**
  2. *formpanel自定义样式
  3. * 供kpi添加明细行单表直接使用
  4. */
  5. Ext.define('erp.view.hr.kpi.KpiPanel',{
  6. extend: 'Ext.form.Panel',
  7. alias: 'widget.erpKpiPanel',
  8. id: 'form',
  9. region: 'north',
  10. frame : true,
  11. layout : 'column',
  12. autoScroll : true,
  13. defaultType : 'textfield',
  14. labelSeparator : ':',
  15. buttonAlign : 'center',
  16. cls: 'u-form-default',
  17. fieldDefaults : {
  18. fieldStyle : "background:#FFFAFA;color:#515151;",
  19. focusCls: 'x-form-field-cir-focus',
  20. labelAlign : "right",
  21. msgTarget: 'side',
  22. blankText : $I18N.common.form.blankText
  23. },
  24. FormUtil: Ext.create('erp.util.FormUtil'),
  25. BaseUtil: Ext.create('erp.util.BaseUtil'),
  26. saveUrl: '',
  27. updateUrl: '',
  28. deleteUrl: '',
  29. auditUrl: '',
  30. resAuditUrl: '',
  31. submitUrl: '',
  32. resSubmitUrl: '',
  33. bannedUrl: '',
  34. resBannedUrl: '',
  35. postUrl:'',
  36. printUrl: '',
  37. getIdUrl: '',
  38. keyField: '',
  39. codeField: '',
  40. statusField: '',
  41. params: null,
  42. caller: null,
  43. formCondition:null,
  44. Contextvalue:null,
  45. LastValue:null,
  46. enableTools: true,
  47. enableKeyEvents: true,
  48. _noc: 0,
  49. initComponent : function(){
  50. var formCondition = this.formCondition;
  51. formCondition = (formCondition == null) ? "" : formCondition.replace(/IS/g,"=");
  52. //集团版
  53. var master=getUrlParam('newMaster');
  54. var param = {caller:this.caller, condition:formCondition, _noc: (getUrlParam('_noc') || this._noc)};
  55. if(master){
  56. param.master=master;
  57. }
  58. this.FormUtil.getItemsAndButtons(this, 'common/singleFormItems.action',param);//从后台拿到formpanel的items
  59. this.callParent(arguments);
  60. },
  61. getDataByField : function(field) {
  62. var form = this, f = form.child('#' + field);
  63. return f ? "'" + f.getValue() + "'" : '';
  64. },
  65. getYearmonthByField : function(field) {
  66. var form = this;
  67. var f = form.child('#' + field),
  68. v = f ? (Ext.isDate(f.value) ? f.value : Ext.Date.parse(f.value, 'Y-m-d')) : new Date();
  69. return Ext.Date.format(v, 'Ym');
  70. }
  71. });