xzbdf.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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:1500px;
  19. width:1500px;
  20. border:black solid 1px;
  21. text-align:center;
  22. }
  23. .small2{
  24. height:1200px;
  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 wpid = $("#wpid").val();
  34. var types = $("#types").val();
  35. var temp="<%=request.getContextPath()%>/xzbdf/xzbdfList.action?xid="+xid+"&wpid="+wpid+"&types="+types;
  36. var url= encodeURI(encodeURI(temp));
  37. $("#gridTable1").setGridParam({url:url}).trigger("reloadGrid");
  38. }
  39. function queryData2(){
  40. var xid = $("#xid").val();
  41. var wpid = $("#wpid").val();
  42. var types = $("#types").val();
  43. var temp="<%=request.getContextPath()%>/xzbdf/findXzbxz.action?xid="+xid+"&wpid="+wpid+"&types="+types;
  44. var url= encodeURI(encodeURI(temp));
  45. $("#gridTable2").setGridParam({url:url}).trigger("reloadGrid");
  46. }
  47. $(document).ready(function () {
  48. $("#xid").val('<s:property value="xid"/>');
  49. $("#wpid").val('<s:property value="wpid"/>');
  50. $("#types").val('<s:property value="types"/>');
  51. showJqGrid1();
  52. });
  53. function showJqGrid1() {
  54. var xid = $("#xid").val();
  55. var wpid = $("#wpid").val();
  56. var types = $("#types").val();
  57. var url1="<%=request.getContextPath()%>/xzbdf/xzbdfList.action?xid="+xid+"&wpid="+wpid+"&types="+types;
  58. jQuery("#gridTable1").jqGrid({
  59. url : url1,
  60. datastr: 'data.json',
  61. datatype : 'json',
  62. height: 600,
  63. rowNum :10000,
  64. colNames: ['编号','父编号','部门编号','部门名称', '字标类型', '名称', '分数'],
  65. colModel: [
  66. { name: 'id', index: 'id', width: 200, align: 'center', hidden:true},
  67. { name: 'xid', index: 'xid', width: 200, align: 'center', hidden:true},
  68. { name: 'wpid',index: 'wpid', width: 300, hidden:true},
  69. { name: 'wpname',index: 'wpname', width: 500,align: 'center'},
  70. { name: 'types',index: 'types', width: 500,align: 'center'},
  71. { name: 'name',index: 'name', width: 200,align: 'center'},
  72. { name: 'value',index: 'value', width: 200,align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
  73. ],
  74. loadtext:'读取数据中。。。',
  75. loadui:'block',
  76. jsonReader: {
  77. repeatitems: false,
  78. root: function (obj) { return obj.rows; },
  79. page: function (obj) { return obj.pageindex; },
  80. total: function (obj) { return obj.pagecount; },
  81. records: function (obj) { return obj.total; }
  82. },
  83. prmNames: {
  84. page: 'page',
  85. rows: 'pageSize',
  86. sort: 'sortorder',
  87. order: 'sortname'
  88. },
  89. hidegrid: false,
  90. rownumbers : false,
  91. multiselect : false,
  92. loadonce : false,
  93. sortname : 'types',
  94. sortorder : 'desc',
  95. pager : '#gridPager1',
  96. viewrecords : true,
  97. altRows: true,
  98. caption : '得分情况列表',
  99. cellEdit : true,
  100. cellsubmit : 'clientArray',
  101. onCellSelect : function(rowid,iCol,cellcontent,e) {
  102. },// 最后选中的行
  103. onSelectRow : function(id) {
  104. if (id && id !== lastsel) {
  105. jQuery("#gridTable1").jqGrid('restoreRow', lastsel);
  106. jQuery("#gridTable1").jqGrid('editRow', id, true);
  107. lastsel = id;
  108. }
  109. },afterSaveCell : function(rowid, cellname, value, iRow, iCol) {
  110. }
  111. });
  112. }
  113. function showJqGrid2() {
  114. var xid = $("#xid").val();
  115. var wpid = $("#wpid").val();
  116. var types = $("#types").val();
  117. var url1="<%=request.getContextPath()%>/xzbdf/findXzbxz.action?xid="+xid+"&wpid="+wpid+"&types="+types;
  118. jQuery("#gridTable2").jqGrid({
  119. url : url1,
  120. datastr: 'data.json',
  121. datatype : 'json',
  122. height: 600,
  123. rowNum :10000,
  124. colNames: ['编号','父编号','部门编号','部门名称', '类型', '名称','参与指标', '参与指标数值','基准分数'],
  125. colModel: [
  126. { name: 'id', index: 'id', width: 200, align: 'center', hidden:true},
  127. { name: 'xid', index: 'xid', width: 200, align: 'center', hidden:true},
  128. { name: 'wpid',index: 'wpid', width: 300, hidden:true},
  129. { name: 'wpname',index: 'wpname', width: 200,align: 'center'},
  130. { name: 'types',index: 'types', width: 200,align: 'center'},
  131. { name: 'name',index: 'name', width: 200,align: 'center'},
  132. { name: 'targetname',index: 'targetname', width: 200,align: 'center'},
  133. { name: 'targetvalue',index: 'targetvalue', width: 200,align: 'center',editable : true, formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
  134. { name: 'basevalue',index: 'basevalue', width: 200,align: 'center',editable : true, formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
  135. ],
  136. loadtext:'读取数据中。。。',
  137. loadui:'block',
  138. jsonReader: {
  139. repeatitems: false,
  140. root: function (obj) { return obj.rows; },
  141. page: function (obj) { return obj.pageindex; },
  142. total: function (obj) { return obj.pagecount; },
  143. records: function (obj) { return obj.total; }
  144. },
  145. prmNames: {
  146. page: 'page',
  147. rows: 'pageSize',
  148. sort: 'sortorder',
  149. order: 'sortname'
  150. },
  151. hidegrid: false,
  152. rownumbers : false,
  153. multiselect : false,
  154. loadonce : false,
  155. sortname : 'name',
  156. sortorder : 'desc',
  157. pager : '#gridPager2',
  158. viewrecords : true,
  159. altRows: true,
  160. caption : '得分基准参数列表',
  161. cellEdit : true,
  162. cellsubmit : 'clientArray',
  163. onCellSelect : function(rowid,iCol,cellcontent,e) {
  164. },// 最后选中的行
  165. onSelectRow : function(id) {
  166. if (id && id !== lastsel) {
  167. jQuery("#gridTable2").jqGrid('restoreRow', lastsel);
  168. jQuery("#gridTable2").jqGrid('editRow', id, true);
  169. lastsel = id;
  170. }
  171. },afterSaveCell : function(rowid, cellname, value, iRow, iCol) {
  172. var rowDatas = $("#gridTable2").jqGrid('getRowData', rowid);
  173. if(rowDatas.targetvalue==null || rowDatas.targetvalue=="" || isNaN(rowDatas.targetvalue))
  174. {
  175. alert("指标参数必须有值,必须是数值。请修改!");
  176. }else if(rowDatas.basevalue==null || rowDatas.basevalue=="" || isNaN(rowDatas.basevalue))
  177. {
  178. alert("基准必须有值,必须是数值。请修改!");
  179. }else
  180. {
  181. var obj=new Object();
  182. obj.id=rowDatas.id;
  183. obj.xid=rowDatas.xid;
  184. obj.wpid=rowDatas.wpid;
  185. obj.wpname=rowDatas.wpname;
  186. obj.types=rowDatas.types;
  187. obj.name=rowDatas.name;
  188. obj.targetname=rowDatas.targetname;
  189. obj.targetvalue=rowDatas.targetvalue;
  190. obj.basevalue=rowDatas.basevalue;
  191. $.ajax({
  192. type:'post',
  193. dataType : "json",
  194. url:'../xzbdf/updateXzbxz.action',
  195. data:{"obj":JSON.stringify(obj)},
  196. success:function(data){
  197. //alert(data);
  198. queryData2();
  199. }
  200. });
  201. }
  202. }
  203. });
  204. }
  205. function updateData(){
  206. showJqGrid2();
  207. $("#chartContainer").dialog({
  208. title:"修正得分计算参数",
  209. resizable: false,
  210. width:1300,
  211. height:950,
  212. modal: true
  213. });
  214. }
  215. function recalculateScore() {
  216. var xid = $("#xid").val();
  217. if (confirm("确定要重新计算得分吗?")) {
  218. $.ajax({
  219. type:'post',
  220. dataType : "json",
  221. url:'../xzbdf/recalculateScore.action',
  222. data:{"xid":xid},
  223. success:function(data){
  224. queryData1();
  225. alert("重新计算得分完成!");
  226. $("#chartContainer").dialog("close");
  227. }
  228. });
  229. }
  230. }
  231. /*****************************************************************************************************************************************************/
  232. function goback() {
  233. $("#f1").attr("action", "../xzbdb/xzbdbindex.action").submit();
  234. }
  235. </script>
  236. <style type="text/css">
  237. fieldset legend {
  238. color:#302A2A;
  239. font: bold 16px/2 Verdana, Geneva, sans-serif;
  240. font-weight: bold;
  241. text-align: left;
  242. text-shadow: 2px 2px 2px rgb(88, 126, 156);
  243. }
  244. </style>
  245. </head>
  246. <body>
  247. <form action="../xzbdf/xzbdfindex.action" method="post" id="f1">
  248. <input type="hidden" id="types" name="types"/>
  249. <input type="hidden" id="xid" name="xid"/>
  250. <input type="hidden" id="wpid" name="wpid"/>
  251. <fieldset style="height: 50px;width: 1200px" id="fst">
  252. <legend class="item_Name">得分展示</legend>
  253. <table class="dataform">
  254. <tr>
  255. <td width="10%" style="text-align: right">
  256. <input type="button" onclick="updateData();" id="update" value="修改参数"/>
  257. </td>
  258. <td width="10%" style="text-align: right">
  259. <input type="button" onclick="goback();" id="back" value="返回"/>
  260. </td>
  261. <td width="40%"></td>
  262. </tr>
  263. </table>
  264. </fieldset>
  265. <br/>
  266. <div style="width:1250px;height:800px;display:none;align:center;valign:middle" id="chartContainer">
  267. <fieldset style="height: 800px;width: 1250px" id="fst">
  268. <legend class="item_Name">得分参数</legend>
  269. <table class="dataform">
  270. <tr>
  271. <td width="10%" style="text-align: right">
  272. <input type="button" onclick="recalculateScore()" id="reScore" value="重算得分" />
  273. </td>
  274. <td width="40%"></td>
  275. </tr>
  276. </table>
  277. <br/>
  278. <table id='gridTable2' height="100%">
  279. </table>
  280. <div id='gridPager2'></div>
  281. </div>
  282. </fieldset>
  283. <table id='gridTable1' height="100%">
  284. </table>
  285. <div id='gridPager1'></div>
  286. </div>
  287. </form>
  288. </body>