123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
- <%@include file="/pages/includes/taglibs.jsp" %>
- <head>
- <script type="text/javascript" src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js"></script>
- <script type="text/javascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/javascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/plugin/jqueryui/js/jquery-ui-1.9.2.custom.min.js"></script>
- <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.core.js"></script>
- <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.widget.js"></script>
- <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.mouse.js"></script>
- <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.draggable.js"></script>
- <script src="<%=request.getContextPath()%>/resource/plugin/jqueryui/development-bundle/ui/jquery.ui.droppable.js"></script>
- <style>
- .big2{
- height:1500px;
- width:1500px;
- border:black solid 1px;
- text-align:center;
- }
- .small2{
- height:1200px;
- width:1100px;
- margin:50px auto; //外面的div高度的一半
- border:black solid 1px;
- }
- </style>
- <script type="text/javascript">
-
- function queryData1(){
- var xid = $("#xid").val();
- var wpid = $("#wpid").val();
- var types = $("#types").val();
- var temp="<%=request.getContextPath()%>/xzbdf/xzbdfList.action?xid="+xid+"&wpid="+wpid+"&types="+types;
- var url= encodeURI(encodeURI(temp));
- $("#gridTable1").setGridParam({url:url}).trigger("reloadGrid");
- }
- function queryData2(){
- var xid = $("#xid").val();
- var wpid = $("#wpid").val();
- var types = $("#types").val();
- var temp="<%=request.getContextPath()%>/xzbdf/findXzbxz.action?xid="+xid+"&wpid="+wpid+"&types="+types;
- var url= encodeURI(encodeURI(temp));
- $("#gridTable2").setGridParam({url:url}).trigger("reloadGrid");
- }
- $(document).ready(function () {
- $("#xid").val('<s:property value="xid"/>');
- $("#wpid").val('<s:property value="wpid"/>');
- $("#types").val('<s:property value="types"/>');
- showJqGrid1();
-
- });
- function showJqGrid1() {
- var xid = $("#xid").val();
- var wpid = $("#wpid").val();
- var types = $("#types").val();
- var url1="<%=request.getContextPath()%>/xzbdf/xzbdfList.action?xid="+xid+"&wpid="+wpid+"&types="+types;
-
-
- jQuery("#gridTable1").jqGrid({
- url : url1,
- datastr: 'data.json',
- datatype : 'json',
- height: 600,
- rowNum :10000,
- colNames: ['编号','父编号','部门编号','部门名称', '字标类型', '名称', '分数'],
- colModel: [
- { name: 'id', index: 'id', width: 200, align: 'center', hidden:true},
- { name: 'xid', index: 'xid', width: 200, align: 'center', hidden:true},
- { name: 'wpid',index: 'wpid', width: 300, hidden:true},
- { name: 'wpname',index: 'wpname', width: 500,align: 'center'},
- { name: 'types',index: 'types', width: 500,align: 'center'},
- { name: 'name',index: 'name', width: 200,align: 'center'},
- { name: 'value',index: 'value', width: 200,align: 'center', formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
- ],
- loadtext:'读取数据中。。。',
- loadui:'block',
- jsonReader: {
- repeatitems: false,
- root: function (obj) { return obj.rows; },
- page: function (obj) { return obj.pageindex; },
- total: function (obj) { return obj.pagecount; },
- records: function (obj) { return obj.total; }
- },
- prmNames: {
- page: 'page',
- rows: 'pageSize',
- sort: 'sortorder',
- order: 'sortname'
- },
- hidegrid: false,
- rownumbers : false,
- multiselect : false,
- loadonce : false,
- sortname : 'types',
- sortorder : 'desc',
- pager : '#gridPager1',
- viewrecords : true,
- altRows: true,
- caption : '得分情况列表',
- cellEdit : true,
- cellsubmit : 'clientArray',
- onCellSelect : function(rowid,iCol,cellcontent,e) {
- },// 最后选中的行
- onSelectRow : function(id) {
- if (id && id !== lastsel) {
- jQuery("#gridTable1").jqGrid('restoreRow', lastsel);
- jQuery("#gridTable1").jqGrid('editRow', id, true);
- lastsel = id;
- }
- },afterSaveCell : function(rowid, cellname, value, iRow, iCol) {
- }
- });
- }
- function showJqGrid2() {
- var xid = $("#xid").val();
- var wpid = $("#wpid").val();
- var types = $("#types").val();
- var url1="<%=request.getContextPath()%>/xzbdf/findXzbxz.action?xid="+xid+"&wpid="+wpid+"&types="+types;
-
-
- jQuery("#gridTable2").jqGrid({
- url : url1,
- datastr: 'data.json',
- datatype : 'json',
- height: 600,
- rowNum :10000,
- colNames: ['编号','父编号','部门编号','部门名称', '类型', '名称','参与指标', '参与指标数值','基准分数'],
- colModel: [
- { name: 'id', index: 'id', width: 200, align: 'center', hidden:true},
- { name: 'xid', index: 'xid', width: 200, align: 'center', hidden:true},
- { name: 'wpid',index: 'wpid', width: 300, hidden:true},
- { name: 'wpname',index: 'wpname', width: 200,align: 'center'},
- { name: 'types',index: 'types', width: 200,align: 'center'},
- { name: 'name',index: 'name', width: 200,align: 'center'},
- { name: 'targetname',index: 'targetname', width: 200,align: 'center'},
- { name: 'targetvalue',index: 'targetvalue', width: 200,align: 'center',editable : true, formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'},
- { name: 'basevalue',index: 'basevalue', width: 200,align: 'center',editable : true, formatter:'number', formatoptions:{decimalPlaces: 2},sorttype: 'int'}
- ],
- loadtext:'读取数据中。。。',
- loadui:'block',
- jsonReader: {
- repeatitems: false,
- root: function (obj) { return obj.rows; },
- page: function (obj) { return obj.pageindex; },
- total: function (obj) { return obj.pagecount; },
- records: function (obj) { return obj.total; }
- },
- prmNames: {
- page: 'page',
- rows: 'pageSize',
- sort: 'sortorder',
- order: 'sortname'
- },
- hidegrid: false,
- rownumbers : false,
- multiselect : false,
- loadonce : false,
- sortname : 'name',
- sortorder : 'desc',
- pager : '#gridPager2',
- viewrecords : true,
- altRows: true,
- caption : '得分基准参数列表',
- cellEdit : true,
- cellsubmit : 'clientArray',
- onCellSelect : function(rowid,iCol,cellcontent,e) {
- },// 最后选中的行
- onSelectRow : function(id) {
- if (id && id !== lastsel) {
- jQuery("#gridTable2").jqGrid('restoreRow', lastsel);
- jQuery("#gridTable2").jqGrid('editRow', id, true);
- lastsel = id;
-
-
- }
- },afterSaveCell : function(rowid, cellname, value, iRow, iCol) {
- var rowDatas = $("#gridTable2").jqGrid('getRowData', rowid);
-
- if(rowDatas.targetvalue==null || rowDatas.targetvalue=="" || isNaN(rowDatas.targetvalue))
- {
- alert("指标参数必须有值,必须是数值。请修改!");
- }else if(rowDatas.basevalue==null || rowDatas.basevalue=="" || isNaN(rowDatas.basevalue))
- {
- alert("基准必须有值,必须是数值。请修改!");
- }else
- {
-
- var obj=new Object();
- obj.id=rowDatas.id;
- obj.xid=rowDatas.xid;
- obj.wpid=rowDatas.wpid;
- obj.wpname=rowDatas.wpname;
- obj.types=rowDatas.types;
- obj.name=rowDatas.name;
- obj.targetname=rowDatas.targetname;
- obj.targetvalue=rowDatas.targetvalue;
- obj.basevalue=rowDatas.basevalue;
- $.ajax({
- type:'post',
- dataType : "json",
- url:'../xzbdf/updateXzbxz.action',
- data:{"obj":JSON.stringify(obj)},
- success:function(data){
- //alert(data);
- queryData2();
- }
- });
- }
-
- }
- });
- }
- function updateData(){
- showJqGrid2();
- $("#chartContainer").dialog({
- title:"修正得分计算参数",
- resizable: false,
- width:1300,
- height:950,
- modal: true
- });
- }
-
- function recalculateScore() {
-
- var xid = $("#xid").val();
- if (confirm("确定要重新计算得分吗?")) {
-
- $.ajax({
- type:'post',
- dataType : "json",
- url:'../xzbdf/recalculateScore.action',
- data:{"xid":xid},
- success:function(data){
- queryData1();
- alert("重新计算得分完成!");
- $("#chartContainer").dialog("close");
- }
- });
- }
- }
- /*****************************************************************************************************************************************************/
- function goback() {
-
- $("#f1").attr("action", "../xzbdb/xzbdbindex.action").submit();
- }
- </script>
- <style type="text/css">
- fieldset legend {
- color:#302A2A;
- font: bold 16px/2 Verdana, Geneva, sans-serif;
- font-weight: bold;
- text-align: left;
- text-shadow: 2px 2px 2px rgb(88, 126, 156);
- }
- </style>
- </head>
- <body>
- <form action="../xzbdf/xzbdfindex.action" method="post" id="f1">
- <input type="hidden" id="types" name="types"/>
- <input type="hidden" id="xid" name="xid"/>
- <input type="hidden" id="wpid" name="wpid"/>
- <fieldset style="height: 50px;width: 1200px" id="fst">
- <legend class="item_Name">得分展示</legend>
- <table class="dataform">
- <tr>
-
- <td width="10%" style="text-align: right">
- <input type="button" onclick="updateData();" id="update" value="修改参数"/>
- </td>
- <td width="10%" style="text-align: right">
- <input type="button" onclick="goback();" id="back" value="返回"/>
- </td>
- <td width="40%"></td>
- </tr>
- </table>
- </fieldset>
- <br/>
- <div style="width:1250px;height:800px;display:none;align:center;valign:middle" id="chartContainer">
- <fieldset style="height: 800px;width: 1250px" id="fst">
- <legend class="item_Name">得分参数</legend>
- <table class="dataform">
- <tr>
- <td width="10%" style="text-align: right">
- <input type="button" onclick="recalculateScore()" id="reScore" value="重算得分" />
- </td>
- <td width="40%"></td>
- </tr>
- </table>
- <br/>
- <table id='gridTable2' height="100%">
- </table>
-
- <div id='gridPager2'></div>
- </div>
- </fieldset>
- <table id='gridTable1' height="100%">
- </table>
- <div id='gridPager1'></div>
- </div>
-
- </form>
- </body>
|