kpiResult.jsp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <%@ page language="java" contentType="text/html; charset=utf-8"
  2. pageEncoding="utf-8"%>
  3. <%
  4. String path = request.getContextPath();
  5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  6. %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  11. <link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css" type="text/css"></link>
  12. <!--[if IE]>
  13. <link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-ie-scoped.css" type="text/css"></link>
  14. <![endif]-->
  15. <link rel="stylesheet" href="<%=basePath %>resource/css/main.css" type="text/css"></link>
  16. <script type="text/javascript" src="<%=basePath %>resource/ext/ext-all.js"></script>
  17. <script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
  18. <script type="text/javascript">
  19. Ext.Loader.setConfig({
  20. enabled: true
  21. });//开启动态加载
  22. Ext.application({
  23. name: 'erp',//为应用程序起一个名字,相当于命名空间
  24. appFolder: basePath+'app',//app文件夹所在路径
  25. controllers: [//声明所用到的控制层
  26. 'hr.kpi.KpiResult'
  27. ],
  28. launch: function() {
  29. Ext.create('erp.view.hr.kpi.KpiResult');//创建视图
  30. }
  31. });
  32. var caller = 'KpiResult';
  33. var formCondition = '';
  34. var gridCondition = '';
  35. function scoreFrom(ktd_kiid){
  36. var kt_bemanid=Ext.getCmp('kt_bemanid').value;
  37. var kt_kdbid=Ext.getCmp('kt_kdbid').value;
  38. Ext.define('model-score', {
  39. extend: 'Ext.data.Model',
  40. fields: [{name:'type', type:'string'},
  41. {name:'percent', type:'string'},
  42. {name:'count', type:'string'},
  43. {name:'avg', type:'string'}]
  44. });
  45. var param = {kt_kdbid:kt_kdbid,kt_bemanid: kt_bemanid,ktd_kiid: ktd_kiid};
  46. Ext.Ajax.request({
  47. url : basePath + 'hr/kpi/getScorefrom.action',
  48. params: param,
  49. method : 'post',
  50. callback : function(options,success,response){
  51. if (!response) return;
  52. var res = new Ext.decode(response.responseText);
  53. var data = Ext.decode(res.data.replace(/,}/g, '}').replace(/,]/g, ']'));
  54. var cal=res.cal;
  55. var g_store=Ext.create('Ext.data.Store', {
  56. model:'model-score',
  57. proxy :{type: 'memory'},
  58. data:data
  59. });
  60. var win = Ext.create('Ext.window.Window', {
  61. id: 'win-scorefrom',
  62. title: '分数来源',
  63. height: 400,
  64. width: 400,
  65. maximizable: false,
  66. buttonAlign: 'center',
  67. layout: 'anchor' ,
  68. items: [{
  69. xtype:'form',
  70. anchor:'100% 30%',
  71. cls: 'u-form-default',
  72. bodyStyle: 'background-color:#f1f1f1;',
  73. items:[{
  74. xtype:'textfield',
  75. style:'text-align:center',
  76. fieldStyle: 'background:#E0E0FF;color:#515151',
  77. width:350,
  78. readOnly:true,
  79. fieldLabel: '计算方法',
  80. value: 'sum(平均分*权重)/sum(权重)'
  81. },{
  82. xtype:'textareafield',
  83. width:350,
  84. style:'text-align:center',
  85. fieldStyle: 'background:#E0E0FF;color:#515151',
  86. readOnly:true,
  87. fieldLabel: '分数计算',
  88. value: cal
  89. }]
  90. },{
  91. xtype:'grid',
  92. anchor:'100% 70%',
  93. store:g_store,
  94. columns: [
  95. { header: '类型', dataIndex: 'type' ,width: 100 },
  96. { header: '权重(%)', dataIndex: 'percent',width: 80},
  97. { header: '数量(条)', dataIndex: 'count' },
  98. { header: '平均分', dataIndex: 'avg' }
  99. ],
  100. bodyStyle: 'background-color:#f1f1f1;'
  101. }],
  102. buttons: [{
  103. text: '关 闭',
  104. iconCls: 'x-button-icon-close',
  105. cls: 'x-btn-gray',
  106. handler: function() {
  107. Ext.getCmp('win-scorefrom').close();
  108. }
  109. }]
  110. });
  111. win.show();
  112. }
  113. });
  114. }
  115. </script>
  116. </head>
  117. <body >
  118. </body>
  119. </html>