- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <script src="/test/js/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- var employeNum=0;
- var url="/test/monitorMethod.do?json=json"
- $.post(url,null,function (date){
- var objs=eval(date);
- for(var i in objs) {
- var obj=objs[i];
- $("#listMethod").append("<input type=checkbox name=selMethod value="+obj.num+">"+obj.num+obj.name+"<br>");
- }
- });
- var url="/test/employe.do?json=json"
- $.post(url,null,function (date){
- var objs=eval(date);
- $("#monintorEmployes,#collator,#auditor").empty();
- $("#monintorEmployes,#collator,#auditor").append("<option disabled=disabled value=0>编号 姓名</option>");
- for(var i in objs) {
- var obj=objs[i];
- employeNum++;
- $("#monintorEmployes,#collator,#auditor").append("<option value="+obj.num+">"+obj.num+" "+obj.name+"</option>");
- }
- });
- $("#sub").click(function(){
- var Num=$("#num").val();
- var num=$.trim(Num);
- var Name=$("#name").val();
- var name=$.trim(Name);
- var intervalTime=$("#intervalTime").val();
- var year=$("#year").val();
- var month=$("#month").val();
- var day=$("#day").val();
- var monitorTime=year+"-"+month+"-"+day;
- var NoiseDevice=$("#noiseDevice").val();
- var noiseDevice=$.trim(NoiseDevice);
- var WindDevice=$("#windDevice").val();
- var windDevice=$.trim(windDevice);
- var Weather=$("#weather").val();
- var weather=$.trim(Weather);
- var BeforeMonitor=$("#beforeMonitor").val();
- var beforeMonitor=$.trim(BeforeMonitor);
- var AfterMonitor=$("#afterMonitor").val();
- var afterMonitor=$.trim(AfterMonitor);
- var VerifyDevice=$("#verifyDevice").val();
- var verifyDevice=$.trim(VerifyDevice);
- var VerifyDeviceNum=$("#verifyDeviceNum").val();
- var verifyDeviceNum=$.trim(VerifyDeviceNum);
- var Content=$("#content").val();
- var content=$.trim(Content);
- var BeMonitoredSign=$("#beMonitoredSign").val();
- var beMonitoredSign=$.trim(BeMonitoredSign);
- var collator_num=$("#collator").val();
- var auditor_num=$("#auditor").val();
- //var monintorEmployeStr=$("#monintorEmployes").val();
- //alert(monintorEmployeStr);
- var monintorEmployeStr="";
- $("[name='monintorEmployes']").each(function(){
- if($(this).val()!=null && monintorEmployeStr.indexOf($(this).val())==-1)
- monintorEmployeStr+=$(this).val()+",";
- })
- monintorEmployeStr=monintorEmployeStr.substring(0,monintorEmployeStr.length-1);
- alert(monintorEmployeStr);
- var value="";
- $("[name='selMethod']").each(function(){
- if(this.checked)
- value+=$(this).val()+",";
- })
- var monintorMethodStr=value.substring(0,value.length-1);
- var url="/test/monitorReport.do?command=addMonitorReport";
- $.post(url,{num:num,name:name,intervalTime:intervalTime,monitorTime:monitorTime,
- noiseDevice:noiseDevice,windDevice:windDevice,weather:weather,beforeMonitor:beforeMonitor,
- afterMonitor:afterMonitor,verifyDevice:verifyDevice,verifyDeviceNum:verifyDeviceNum,
- content:content,beMonitoredSign:beMonitoredSign,collator_num:collator_num,
- auditor_num:auditor_num,monintorEmployeStr:monintorEmployeStr,monintorMethodStr:monintorMethodStr},
- function (date){
- alert("添加成功");
- });
- });
- $("#addMonintor").click(function(){
- if($(this).parent().children().size()<=employeNum)
- $("#monintorEmployes").clone().insertBefore($(this));
- else
- alert("超过员工数,不能在添加了");
- });
- });
- </script>
- </head>
- <body>
- <h2 align="center">福州市环境监测站</h2>
- <h3 align="center">噪声测量记录表(首页)</h3>
- <table border="1" cellspacing="0" width="80%" align="center" style="">
- <tr>
- <td width="10%">任务编号:</td>
- <td width="40%" colspan="2"><input type="text" id="num" name="num"></td>
- <td width="10%">监测地点:</td>
- <td width="40%" colspan="2"><input type="text" id="address" name="address" size="30"></td>
- </tr>
- <tr>
- <td width="10%">监测日期:</td>
- <td width="60%" colspan="4"><input type="text" id="year" name="year" size="4">年<input type="text" id="month" name="month" size="2">月<input type="text" id="day" name="day" size="2">日</td>
- <td width="30%">昼间<input type="radio" id="intervalTime" name="intervalTime" value="1" checked="checked">
- 夜间<input type="radio" id="intervalTime" name="intervalTime" value="2">
- </td>
- </tr>
- <tr>
- <td width="10%">监测仪器及编号</td>
- <td width="30%" colspan="2"><div>噪声仪器:<input type="text" id="noiseDevice" name="noiseDevice">
- <br>风速仪器:<input type="text" id="windDevice" name="windDevice"></div></td>
- <td width="10%">气象条件</td>
- <td width="50%" colspan="2"><textarea rows="3" cols="30" id="weather" name="weather"></textarea></td>
- </tr>
- <tr>
- <td width="10%">校 准 值</td>
- <td width="20%">测量前:<input type="text" id="beforeMonitor" name="beforeMonitor" size="5">dB</td>
- <td width="20%">测量后:<input type="text" id="afterMonitor" name="afterMonitor" size="5">dB</td>
- <td width="10%">校准仪器</td>
- <td width="20%"><input type="text" id="verifyDevice" name="verifyDevice" size="15"></td>
- <td width="20%">编号<input type="text" id="verifyDeviceNum" name="verifyDeviceNum" size="12"></td>
- </tr>
- <tr>
- <td width="10%">监测方法</td>
- <td colspan="5" width="90%"><div id="listMethod">
- </div></td>
- </tr>
- <tr id="a">
- <td width="10%">监测人员:</td>
- <td colspan="5" width="90%">
- <select id="monintorEmployes" name="monintorEmployes">
- </select>
- <img src="/test/images/add.jpg" id="addMonintor">
- </td>
- </tr>
- <tr>
- <td width="5%" rowspan="2">监测工况:</td>
- <td colspan="5" width="95%"><textarea rows="20" cols="90" id="content" name="content"></textarea></td>
- </tr>
- <tr>
- <td colspan="3" width="80%"></td>
- <td colspan="2" width="20%" align="right">被监测方签字<input type="text" id="beMonitoredSign" name="beMonitoredSign"></td>
- </tr>
- <tr>
- <td width="20%" align="center" colspan="3">
- 校对者:<select id="collator" name="collator">
- </select>
- </td>
- <td width="20%" align="center" colspan="3">
- 审核者:<select id="auditor" name="auditor">
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="6" width="100%" align="center"><input type="button" id="sub" value="提交" size="20"></td>
- </tr>
- </table>
- </body>
- </html>