xzbjj.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp" %>
  3. <head>
  4. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
  5. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
  6. <script type="text/javascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
  7. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  8. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  9. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  10. <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/plugin/jqueryui/js/jquery-ui-1.9.2.custom.min.js"></script>
  11. <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.core.js"></script>
  12. <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.widget.js"></script>
  13. <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.mouse.js"></script>
  14. <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.draggable.js"></script>
  15. <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.droppable.js"></script>
  16. <style>
  17. .big2{
  18. height:1100px;
  19. width:1500px;
  20. border:black solid 1px;
  21. text-align:center;
  22. }
  23. .small2{
  24. height:1000px;
  25. width:1100px;
  26. margin:50px auto; //外面的div高度的一半
  27. border:black solid 1px;
  28. }
  29. </style>
  30. <script type="text/javascript">
  31. function queryData1(){
  32. var xid = $("#xid").val();
  33. var temp="<%=request.getContextPath()%>/xzbjj/findXzbjjxz.action?xid="+xid;
  34. var url= encodeURI(encodeURI(temp));
  35. $("#gridTable1").setGridParam({url:url}).trigger("reloadGrid");
  36. }
  37. $(document).ready(function () {
  38. $("#xid").val('<s:property value="xid"/>');
  39. $("#wpid").val('<s:property value="wpid"/>');
  40. showdata();
  41. showJqGrid1();
  42. });
  43. function showJqGrid1() {
  44. var xid = $("#xid").val();
  45. var url1="<%=request.getContextPath()%>/xzbjj/findXzbjjxz.action?xid="+xid;
  46. jQuery("#gridTable1").jqGrid({
  47. url : url1,
  48. datastr: 'data.json',
  49. datatype : 'json',
  50. height: 1050,
  51. rowNum :10000,
  52. colNames: ['编号','父编号','部门编号','部门名称', '类型', '名称', '数值'],
  53. colModel: [
  54. { name: 'id', index: 'id', width: 200, align: 'center', hidden:true},
  55. { name: 'xid', index: 'xid', width: 200, align: 'center', hidden:true},
  56. { name: 'wpid',index: 'wpid', width: 300, hidden:true},
  57. { name: 'wpname',index: 'wpname', width: 400},
  58. { name: 'types',index: 'types', width: 200},
  59. { name: 'name',index: 'name', width: 200},
  60. { name: 'value',index: 'value', width: 200,editable : true, formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
  61. ],
  62. loadtext:'读取数据中。。。',
  63. loadui:'block',
  64. jsonReader: {
  65. repeatitems: false,
  66. root: function (obj) { return obj.rows; },
  67. page: function (obj) { return obj.pageindex; },
  68. total: function (obj) { return obj.pagecount; },
  69. records: function (obj) { return obj.total; }
  70. },
  71. prmNames: {
  72. page: 'page',
  73. rows: 'pageSize',
  74. sort: 'sortorder',
  75. order: 'sortname'
  76. },
  77. hidegrid: false,
  78. rownumbers : false,
  79. multiselect : false,
  80. loadonce : false,
  81. sortname : 'types',
  82. sortorder : 'desc',
  83. pager : '#gridPager1',
  84. viewrecords : true,
  85. altRows: true,
  86. caption : '奖金基准参数列表',
  87. cellEdit : true,
  88. cellsubmit : 'clientArray',
  89. onCellSelect : function(rowid,iCol,cellcontent,e) {
  90. },// 最后选中的行
  91. onSelectRow : function(id) {
  92. if (id && id !== lastsel) {
  93. jQuery("#gridTable1").jqGrid('restoreRow', lastsel);
  94. jQuery("#gridTable1").jqGrid('editRow', id, true);
  95. lastsel = id;
  96. }
  97. },afterInsertRow:function(rowid,rowdata,rowelem){
  98. if(rowdata.types == '基准奖金' ){
  99. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{wpname:"<font color=Green>"+rowdata.wpname+"</font>"});
  100. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{types:"<font color=Green>"+rowdata.types+"</font>"});
  101. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{name:"<font color=Green>"+rowdata.name+"</font>"});
  102. // jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{value:"<font color=Green>"+rowdata.value+"</font>"});
  103. } else if(rowdata.types == '人数' ){
  104. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{wpname:"<font color=Purple>"+rowdata.wpname+"</font>"});
  105. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{types:"<font color=Purple>"+rowdata.types+"</font>"});
  106. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{name:"<font color=Purple>"+rowdata.name+"</font>"});
  107. // jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{value:"<font color=Purple>"+rowdata.value+"</font>"});
  108. } else if(rowdata.types == '分数' ){
  109. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{wpname:"<font color=Orange>"+rowdata.wpname+"</font>"});
  110. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{types:"<font color=Orange>"+rowdata.types+"</font>"});
  111. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{name:"<font color=Orange>"+rowdata.name+"</font>"});
  112. // jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{value:"<font color=Orange>"+rowdata.value+"</font>"});
  113. } else if(rowdata.types == '系数' ){
  114. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{wpname:"<font color=Blue>"+rowdata.wpname+"</font>"});
  115. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{types:"<font color=Blue>"+rowdata.types+"</font>"});
  116. jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{name:"<font color=Blue>"+rowdata.name+"</font>"});
  117. // jQuery("#gridTable1").jqGrid('setRowData',rowdata.id,{value:"<font color=Blue>"+rowdata.value+"</font>"});
  118. }
  119. },afterSaveCell : function(rowid, cellname, value, iRow, iCol) {
  120. var rowDatas = $("#gridTable1").jqGrid('getRowData', rowid);
  121. if(rowDatas.value!=null && rowDatas.value!="")
  122. {
  123. if(!isNaN(rowDatas.value))
  124. {
  125. var obj=new Object();
  126. obj.id=rowDatas.id;
  127. obj.xid=rowDatas.xid;
  128. obj.wpid=rowDatas.wpid;
  129. var temp=rowDatas.wpname;
  130. temp=temp.replace('<font color="Green">', '');
  131. temp=temp.replace('<font color="Purple">', '');
  132. temp=temp.replace('<font color="Orange">', '');
  133. temp=temp.replace('<font color="Blue">', '');
  134. temp=temp.replace('</font>', '');
  135. obj.wpname=temp;
  136. temp=rowDatas.types;
  137. temp=temp.replace('<font color="Green">', '');
  138. temp=temp.replace('<font color="Purple">', '');
  139. temp=temp.replace('<font color="Orange">', '');
  140. temp=temp.replace('<font color="Blue">', '');
  141. temp=temp.replace('</font>', '');
  142. obj.types=temp;
  143. temp=rowDatas.name;
  144. temp=temp.replace('<font color="Green">', '');
  145. temp=temp.replace('<font color="Purple">', '');
  146. temp=temp.replace('<font color="Orange">', '');
  147. temp=temp.replace('<font color="Blue">', '');
  148. temp=temp.replace('</font>', '');
  149. obj.name=temp;
  150. obj.value=rowDatas.value;
  151. $.ajax({
  152. type:'post',
  153. dataType : "json",
  154. url:'../xzbjj/updateXzbjjxz.action',
  155. data:{"obj":JSON.stringify(obj)},
  156. success:function(data){
  157. //alert(data);
  158. queryData1();
  159. }
  160. });
  161. }else
  162. {
  163. alert("数值必须有值,必须是数值。请修改!");
  164. }
  165. }
  166. }
  167. });
  168. }
  169. function showdata()
  170. {
  171. var xid = $("#xid").val();
  172. $.ajax({
  173. type:'post',
  174. dataType : "json",
  175. url:'../xzbjj/xzbjjList.action',
  176. data:{"xid":xid},
  177. success:function(data){
  178. $("#clyx").html(data.clyx.value);
  179. $("#cljx").html(data.cljx.value);
  180. $("#clgl").html(data.clgl.value);
  181. $("#clze").html(data.clze.value);
  182. $("#kbyx").html(data.kbyx.value);
  183. $("#kbjx").html(data.kbjx.value);
  184. $("#kbgl").html(data.kbgl.value);
  185. $("#kbze").html(data.kbze.value);
  186. $("#dxyx").html(data.dxyx.value);
  187. $("#dxjx").html(data.dxjx.value);
  188. $("#dxgl").html(data.dxgl.value);
  189. $("#dxze").html(data.dxze.value);
  190. $("#sc").html(data.sc.value);
  191. $("#scze").html(data.sc.value);
  192. $("#aq").html(data.aq.value);
  193. $("#aqze").html(data.aq.value);
  194. $("#jk").html(data.jk.value);
  195. $("#jkze").html(data.jk.value);
  196. $("#ze").html(data.ze.value);
  197. }
  198. });
  199. }
  200. function updateData(){
  201. $("#chartContainer").dialog({
  202. title:"修正奖金计算参数",
  203. resizable: false,
  204. width:1200,
  205. height:1300,
  206. modal: true
  207. });
  208. }
  209. function recalculateBonus() {
  210. var xid = $("#xid").val();
  211. if (confirm("确定要重新计算奖金吗?")) {
  212. $.ajax({
  213. type:'post',
  214. dataType : "json",
  215. url:'../xzbjj/recalculateBonus.action',
  216. data:{"xid":xid},
  217. success:function(data){
  218. showdata();
  219. alert("重新计算奖金完成!");
  220. $("#chartContainer").dialog("close");
  221. }
  222. });
  223. }
  224. }
  225. /*****************************************************************************************************************************************************/
  226. function goback() {
  227. $("#f1").attr("action", "../xzbdb/xzbdbindex.action").submit();
  228. }
  229. </script>
  230. <style type="text/css">
  231. fieldset legend {
  232. color:#302A2A;
  233. font: bold 16px/2 Verdana, Geneva, sans-serif;
  234. font-weight: bold;
  235. text-align: left;
  236. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  237. }
  238. </style>
  239. </head>
  240. <body>
  241. <form action="../xzbjj/xzbjjindex.action" method="post" id="f1">
  242. <input type="hidden" id="xid" name="xid"/>
  243. <input type="hidden" id="wpid" name="wpid"/>
  244. <fieldset style="height: 50px;width: 1200px" id="fst">
  245. <legend class="item_Name">奖金展示</legend>
  246. <table class="dataform">
  247. <tr>
  248. <td width="10%" style="text-align: right">
  249. <input type="button" onclick="updateData();" id="update" value="修改参数" />
  250. </td>
  251. <td width="10%" style="text-align: right">
  252. <input type="button" onclick="goback();" id="back" value="返回" />
  253. </td>
  254. <td width="40%"></td>
  255. </tr>
  256. </table>
  257. </fieldset>
  258. <br/>
  259. <div style="width:1200px;height:1300px;display:none;align:center;valign:middle" id="chartContainer">
  260. <fieldset style="height: 1200px;width: 1100px" id="fst">
  261. <legend class="item_Name">奖金参数</legend>
  262. <table class="dataform">
  263. <tr>
  264. <td width="10%" style="text-align: right">
  265. <input type="button" onclick="recalculateBonus()" id="reBonus" value="重算奖金" />
  266. </td>
  267. <td width="40%"></td>
  268. </tr>
  269. </table>
  270. <table id='gridTable1' height="100%">
  271. </table>
  272. <div id='gridPager1'></div>
  273. </div>
  274. </fieldset>
  275. <div class='big2'>
  276. <div class='small2'>
  277. <H1>场际小指标对标(奖金明细)</H1>
  278. <table width="1068" height="900" border="1" style="a">
  279. <tr>
  280. <td rowspan="2" align="center" valign="middle">崇礼风电场</td>
  281. <td align="center" valign="middle">运行奖金</td>
  282. <td align="center" valign="middle">检修奖金</td>
  283. <td align="center" valign="middle">管理奖金</td>
  284. <td align="center" valign="middle">合计</td>
  285. </tr>
  286. <tr>
  287. <td align="center" valign="middle" id="clyx" >&nbsp;</td>
  288. <td align="center" valign="middle" id="cljx" >&nbsp;</td>
  289. <td align="center" valign="middle" id="clgl" >&nbsp;</td>
  290. <td align="center" valign="middle" id="clze" >&nbsp;</td>
  291. </tr>
  292. <tr>
  293. <td rowspan="2" align="center" valign="middle">康保风电场</td>
  294. <td align="center" valign="middle">运行奖金</td>
  295. <td align="center" valign="middle">检修奖金</td>
  296. <td align="center" valign="middle">管理奖金</td>
  297. <td align="center" valign="middle">合计</td>
  298. </tr>
  299. <tr>
  300. <td align="center" valign="middle" id="kbyx" >&nbsp;</td>
  301. <td align="center" valign="middle" id="kbjx" >&nbsp;</td>
  302. <td align="center" valign="middle" id="kbgl" >&nbsp;</td>
  303. <td align="center" valign="middle" id="kbze" >&nbsp;</td>
  304. </tr>
  305. <tr>
  306. <td rowspan="2" align="center" valign="middle">雁门关风电场</td>
  307. <td align="center" valign="middle">运行奖金</td>
  308. <td align="center" valign="middle">检修奖金</td>
  309. <td align="center" valign="middle">管理奖金</td>
  310. <td align="center" valign="middle">合计</td>
  311. </tr>
  312. <tr>
  313. <td align="center" valign="middle" id="dxyx" >&nbsp;</td>
  314. <td align="center" valign="middle" id="dxjx" >&nbsp;</td>
  315. <td align="center" valign="middle" id="dxgl" >&nbsp;</td>
  316. <td align="center" valign="middle" id="dxze" >&nbsp;</td>
  317. </tr>
  318. <tr>
  319. <td rowspan="2" align="center" valign="middle">生产技术部</td>
  320. <td colspan="3" align="center" valign="middle">生产技术部奖金</td>
  321. <td align="center" valign="middle">合计</td>
  322. </tr>
  323. <tr>
  324. <td colspan="3" align="center" valign="middle" id="sc" >&nbsp;</td>
  325. <td align="center" valign="middle" id="scze" >&nbsp;</td>
  326. </tr>
  327. <tr>
  328. <td rowspan="2" align="center" valign="middle">安全监察部</td>
  329. <td colspan="3" align="center" valign="middle">安全监察部奖金</td>
  330. <td align="center" valign="middle">合计</td>
  331. </tr>
  332. <tr>
  333. <td colspan="3" align="center" valign="middle" id="aq" >&nbsp;</td>
  334. <td align="center" valign="middle" id="aqze" >&nbsp;</td>
  335. </tr>
  336. <tr>
  337. <td rowspan="2" align="center" valign="middle">集控中心</td>
  338. <td colspan="3" align="center" valign="middle">集控中心奖金</td>
  339. <td align="center" valign="middle">合计</td>
  340. </tr>
  341. <tr>
  342. <td colspan="3" align="center" valign="middle" id="jk" >&nbsp;</td>
  343. <td align="center" valign="middle" id="jkze" >&nbsp;</td>
  344. </tr>
  345. <tr>
  346. <td colspan="4" align="center" valign="middle">合计</td>
  347. <td align="center" valign="middle" id="ze" >&nbsp;</td>
  348. </tr>
  349. </table></div>
  350. </div>
  351. </form>
  352. </body>