123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <%@ 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/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/ecmascript" src="<%=request.getContextPath() %>/resource/plugin/jqgrid/js/i18n/grid.locale-cn.js"></script>
-
- <script type="text/ecmascript" src="<%=request.getContextPath()%>/resource/js/system/jqdatagrid.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/javascript" src="<%=request.getContextPath()%>/resource/plugin/highslide/highslide-with-html.js"></script>
- <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/highslide/highslide.css" />
-
- <script type="text/javascript">
- $(document).ready(function() {
-
- $("#pid").val("<s:property value='pid'/>");
- showJqGrid();
- });
- function gosave() {
- var pid = $("#pid").val();
- var array1 = [];
- var array2 = [];
- var state=true;
- $("#gridTable").find("tr").each(function(i){
- if(i>0){
- var tempid = $(this).find("td").eq(0).text();
- var tempVal =$(this).find("td").eq(8).find("input").val();
- var tempName = $(this).find("td").eq(9).find("input").val();
- // 为空判断
- tempVal = tempVal.replace(/\s+/g, "");
- if(tempVal==""){
- $(this).find("td").eq(8).find("input").css({"background-color":"red"});
- alert("分数不能为空");
- state=false;
- return false;
- }
-
- // 非法数字判断
- if(isNaN(tempVal)){
- $(this).find("td").eq(8).find("input").css({"background-color":"red"});
- alert("分数必须为数字");
- state=false;
- return false;
- }
- // 超过最大值
- var temp=$(this).find("td").eq(7).text();
- if(!isNaN(tempVal) && !isNaN(temp)){
- if(parseFloat(tempVal)>parseFloat(temp))
- {
- $(this).find("td").eq(8).find("input").css({"background-color":"red"});
- alert("分数不能超过满分");
- state=false;
- return false;
- }
- }
-
-
-
- array1.push(tempid+"/"+tempVal);
- array2.push(tempid+"/"+tempName);
- }
- });
- if(state)
- {
-
- var temp="/gradeassessday/batchMeasurerecordSave.action?ids="+array1+"&idname="+array2+"&pid="+pid;
- var url= encodeURI(encodeURI(temp));
- $.ajax({
- type: "POST",
- url: url,
- dataType:"json",
- complete:function (XMLHttpRequest, textStatus) {
- queryApData();
- alert('保存成功');
- }
- });
- }
-
- }
- function goback() {
- $("#f1").attr("action", "/gradeassessday/gadayindex.action").submit();
- }
- function queryApData() {
- $("#gridTable").jqGrid('GridUnload');
- showJqGrid();
- }
- function showJqGrid() {
- var pid = $("#pid").val();
- jQuery("#gridTable").jqGrid({
- url:'gadaymrlist.action?pid=' + pid,
- mtype:'POST',
- datatype: "json",
- colNames:['编号','名称','类别', '计算公式','计算值','权重公式','得分','上限值','下限值','满分','修改得分','描述'],
- colModel:[
- { name: 'id', index: 'id', width: 130, align: 'center',hidden:true},
- { name: 'name', index: 'name', width: 150, align: 'center'},
- { name: 'typeobj', index: 'typeobj', width: 100, align: 'center'},
- { name: 'formuls', index: 'formuls', width: 600, align: 'center'},
- { name: 'calculatevalue', index: 'calculatevalue', width: 150, align: 'center'},
- { name: 'formula', index: 'formula', width: 300, align: 'center'},
- { name: 'score', index: 'score', width: 100, align: 'center'},
- { name: 'valueh', index: 'valueh', width: 100, align: 'center'},
- { name: 'valuel', index: 'valuel', width: 100, align: 'center'},
- { name: 'wvalue', index: 'wvalue', width: 100, align: 'center'},
- { name: 'modscore', index: 'modscore', width: 100, align: 'center',editable : true},
- { name: 'description', index: 'description', width: 400, align: 'center',editable : true}
- ],
- rowNum:1000,
- height:'auto',
- width:'auto',
- autowidth: true,
- sortorder: "desc",
- caption: " 日定量分析指标",
- pager: '#gridPager',
- viewrecords: true,
- afterInsertRow:function(rowid,rowdata,rowelem){
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{id:rowdata.id});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{name:rowdata.name});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{typeobj:rowdata.typeobj});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{formuls:rowdata.formuls});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{calculatevalue:rowdata.calculatevalue});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{formula:rowdata.formula});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{score:rowdata.score});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{valueh:rowdata.valueh});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{valuel:rowdata.valuel});
- jQuery("#gridTable").jqGrid('setRowData',rowdata.id,{wvalue:rowdata.wvalue});
- jQuery("#gridTable").jqGrid('editRow', rowdata.id,{modscore:rowdata.modscore});
- jQuery("#gridTable").jqGrid('editRow', rowdata.id,{description:rowdata.description});
- }
- });
- }
- </script>
- </head>
- <body>
- <form action="" method="post" id="f1" style="width: 1620px;">
- <div class="panelcontainer" style="width: 1620px;">
- <div
- style="float: left; line-height: 39px; margin-left: 20px; width: 80px;">
- <input type="button" value="保存" onClick="gosave()" />
- </div>
- <div
- style="float: left; line-height: 39px; margin-left: 20px; width: 80px;">
- <input type="button" value=" 返回" onClick="goback()" />
- </div>
- </div>
- <s:hidden id="pid" name="pid"></s:hidden>
- <s:hidden id="wpid" name="wpid"></s:hidden>
- <s:hidden id="pjid" name="pjid"></s:hidden>
- <s:hidden id="lnid" name="lnid"></s:hidden>
- <s:hidden id="tid" name="tid"></s:hidden>
- <s:hidden id="recorddate" name="recorddate"></s:hidden>
-
- <table id='gridTable' >
- </table>
- <div id='gridPager'></div>
- </form>
- </body>
|