| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <%@ page import="com.runzhixing.bean.CityPlace" %>
- <%@ page import="com.runzhixing.bean.CountryPlace" %>
- <%@ page import="com.runzhixing.bean.Station" %>
- <%@ page import="com.runzhixing.bean.AuthorityRegionPlace" %>
- <%@ page import="com.runzhixing.bean.User" %>
- <%@ page import="com.runzhixing.constant.Constant" %>
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- User user = (User)session.getAttribute(Constant.userMark);
- List<AuthorityRegionPlace> arplist = user.getPrivilegePlaces1();
- List<CityPlace> cplist = new ArrayList<CityPlace>();
- List<CountryPlace> cyplist = new ArrayList<CountryPlace>();
- List<Station> slist = new ArrayList<Station>();
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <base href="<%=basePath%>">
-
- <title>介质质量数据录入</title>
-
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
- <meta http-equiv="description" content="This is my page">
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta http-equiv="X-UA-Compatible" content="IE=10"/>
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
- <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
- <script type="text/javascript" src="css/easyui/jquery.min.js"></script>
- <script type="text/javascript" src="css/easyui/jquery.easyui.min.js" charset="utf-8"></script>
- <script type="text/javascript" src="css/easyui/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
- <link rel="stylesheet" type="text/css" href="css/common/hzbstyle.css">
- <script type="text/javascript" src="js/common/area.js"></script>
- <style type="text/css">
- a:HOVER{
- color: red;
- text-decoration: none;
- }
- a{
- color: #f08300;
- text-decoration: none;
- }
- </style>
- <script type="text/javascript" src="js/easyui/export.js"></script>
- <script type="text/javascript">
- var grid="";
- var exportString="";
-
-
- var i = 1;//第几页
- var sum;//总条数
- var pageSize =10;
- var totalpage;//总页数
- $(document).ready(function(){
- pageSize = $('#pageSize').val();
-
- selectCountry();
- selectstation();
- //fLoadData(i,pageSize);
- });
- function fLoadTable(){
- grid=$('#tt').datagrid({
- fit: true,//自动大小
- title: '介质质量数据录入',
- width: '100%',
- height: 580,
- toolbar: '#toolbar',
- fitColumns: true,
- singleSelect:false,
- loadMsg:'正在加载, 请稍等 …',
- nowrap : true,//设置为true,当数据长度超出列宽时将会自动截取
- striped : true,//设置为true将交替显示行背景
- collapsible : true,//显示可折叠按钮
- singleSelect:true,//为true时只能选择单行
- fitColumns:true,//允许表格自动缩放,以适应父容器
- rownumbers:true,
- frozenColumns:[[ //选择框
- {field:'ck',checkbox:true}
- ]],
- columns:[[
- {field:'shst',title:'硫化氢标准值',width:'8%'},
- {field:'shexAct',title:'硫化氢检测值',width:'8%'},
- {field:'waterStppm',title:'水分PPM标准值',width:'8%'},
- {field:'waterStdewPoint',title:'水分露点标准值',width:'8%'},
- {field:'waterExppm',title:'水分PPM检测值',width:'8%'},
- {field:'waterExdewPoint',title:'水分露点检测值',width:'8%'},
- {field:'checker',title:'记录人',width:'8%'},
- {field:'checkTime1',title:'记录时间',width:'10%'},
- {field:'stationName',title:'站点',width:'8%'},
- {field:'opeatorName',title:'操作人员',width:'8%'},
- {field:'operTime1',title:'录入时间',width:'10%'},
- {field:'remark',title:'备注',width:'8%'}
-
- ]]
- });
- }
- function show(message) {
- $.messager.show({
- title: '提示信息',
- msg: message,
- timeout: 2000,
- showType: 'slide'
- });
- }
- function fLoadData(page,rows){
- var v = document.getElementById("shst").value;
- if(!v||v.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("硫化氢标准值不能为空!!!");
- return false;
- }
- var v1 = document.getElementById("shexAct").value;
- if(!v1||v1.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("硫化氢检测值不能为空!!!");
- return false;
- }
- var v2 = document.getElementById("waterStppm").value;
- if(!v2||v2.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("水分PPM标准值不能为空!!!");
- return false;
- }
- var v3 = document.getElementById("waterExppm").value;
- if(!v3||v3.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("水分PPM检测值不能为空!!!");
- return false;
- }
- var v4 = document.getElementById("waterStdewPoint").value;
- if(!v4||v4.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("水分露点标准值不能为空!!!");
- return false;
- }
- var v5 = document.getElementById("waterExdewPoint").value;
- if(!v5||v5.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("水分露点检测值不能为空!!!");
- return false;
- }
- var v6 = document.getElementById("checker").value;
- if(!v6||v6.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("记录人不能为空!!!");
- return false;
- }
- var v7 = $('#checkTime').datetimebox('getValue');
- alert(v7);
- if(!v7||v7.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("记录日期不能为空!!!");
- return false;
- }
- var v8 = document.getElementById("remark").value;
- if(!v8||v8.replace(/(^s*)|(s*$)/g, "").length ==0){//v不为空格和null
- show("备注不能为空!!!");
- return false;
- }
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:$('#CNGQualityIntoForm').serialize(),
- url:"ajax/CNGQualityInto",
- success:function (data){
- var obj=eval("(" + data + ")");
- $.each(obj.rows, function(i,item){
- if(item.result==0){
- show("提交成功!!!");
- }else{
- show("提交失败!!!");
- }
- });
-
- }
- });
-
-
- }
-
- function selectCountry(){
- var id=document.getElementById("city").value;
- var select = document.getElementById("country");
- for(var i=select.options.length-1;i>=0;i--) {
- select.options.remove(i);
- }
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- url:"ajax/hiddenCity?cityId="+id,
- success:function (data){
- var obj=eval("(" + data + ")");
- $.each(obj.rows, function(i,item){
- select.options.add(new Option(item.name, item.id));
- });
-
-
- }
- });
- }
-
- function selectCountry1(){
- selectCountry();
- //selectstation();
- //changeSize();
- }
-
- function paginationpre(){
- pageSize = $('#pageSize').val();
- if(i<=1){
- return false;
- }else{
- i--;
- fLoadData(i,pageSize);
- }
- }
- function paginationnext(){
- //先跟总页数相比,看看有没得下一页
- pageSize = $('#pageSize').val();
- if(i<totalpage){
- i++;
- fLoadData(i,pageSize);
- }else{
- return false;
- }
- }
- function changeSize(){
- fLoadData(1,10);
- }
-
- function selectstation(){
- var ii=1;
- var select = document.getElementById("station");
- for(var i=select.options.length-1;i>=0;i--) {
- select.options.remove(i);
- }
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:$('#CNGQualityIntoForm').serialize(),
- //url:"ajax/hiddencheckStation",
- url:"ajax/hiddenspeStation",
- success:function (data){
- var obj=eval("(" + data + ")");
- $.each(obj.rows, function(i,item){
- select.options.add(new Option(item.name, item.id));
- });
-
-
- }
- });
- }
- function selectstation1(){
- selectstation();
- }
- function expt1(){
- expt(grid);
- }
- function exptSingle(){
- if(!grid){
- alert("数据为空");
- return false;
- }else{
- expt(grid);
- }
-
- }
- function exptAll(){
- fLoadDataAll(1,5000);
- }
-
- function fLoadDataAll(page,rows){
-
- $.messager.progress({
- title: '请等待',
- msg: '正在加载数据...',
- text: '查询中.......'
- });
- $.ajax({
- type:"POST",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- data:$('#CNGQualityIntoForm').serialize(),
- url:"ajax/CNGQualityQuery?page="+page+"&psize="+rows,
- success:function (data){
- $.messager.progress('close');
- var vData = $.parseJSON(data);
- sum = vData.total;
- totalpage = Math.ceil(sum/rows);
- document.getElementById("total").innerText = sum;
- document.getElementById("totalpage").innerText = totalpage;
- var vData = $.parseJSON(data);
- $('#tt').datagrid('loadData', vData); //将数据绑定到datagrid
- if(!grid){
- alert("数据为空");
- return false;
- }else{
- expt(grid);
- }
- }
- });
-
-
- }
-
-
- function selectpage(){
- var selectpage = $('#selectpage').val();
- if(selectpage>=1&&selectpage<=totalpage){
- i = selectpage;
- $("#selectpage").val("");
- pageSize = $('#pageSize').val();
- fLoadData(i,pageSize);
- }else{
- $("#selectpage").val("");
- return false;
- }
- }
- </script>
-
- </head>
-
- <body>
- <!-- 查询结果:数据表格 -->
- <table id="tt" cellspacing="0" cellpadding="0" >
- </table>
- <div id="toolbar" style="padding-top: 10px;height: auto;">
- <center>
- <form id="CNGQualityIntoForm" action="ajax/CNGQ" method="post">
- <span class="easyui-linkbutton" style="cursor: default;margin-bottom: 5px;"><span class="hzbspan" style="color: #f08300;font-size: 16px;" >介质质量数据录入:</span></span>
-
- <span class="hzbspan" style="color: red;font-size: 16px;" >省:</span>
- <select name="province" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan">
- <%for(AuthorityRegionPlace arp:arplist){
- cplist = arp.getCityPlace();
- %>
- <option value="<%=arp.getId() %>">
- <%=arp.getName() %>
- </option>
- <%} %>
- </select>
-
- <span class="hzbspan" style="color: red;font-size: 16px;" >市:</span>
- <select name="city" id="city" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectCountry1()">
-
- <%
-
- for(CityPlace cp:cplist){
- cyplist = cp.getSubPlaceList();
- %>
-
- <option value="<%=cp.getId() %>">
- <%=cp.getName() %>
- </option>
-
-
- <%} %>
- </select>
- <span class="hzbspan" style="color: red;font-size: 16px;" >县:</span>
- <select name="country" id = "country" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" onchange="selectstation1();" >
- </select>
- <span class="hzbspan" style="color: red;font-size: 16px;" >站点:</span>
- <select name="station" id = "station" style="width: auto;height: 24px;min-width: 100px;" class="hzbspan" >
- <option value="">全部</option>
- </select>
-
-
- <br/>
- <font class="hzbspan" color="red">******红色为必填项目******</font>
- <table>
- <tr>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >硫化氢标准值(mg/m³):</span>
- <input name="shst" id="shst" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >硫化氢检测值(mg/m³):</span>
- <input name="shexAct" id="shexAct" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >水分PPM标准值:</span>
- <input name="waterStppm" id="waterStppm" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >水分PPM检测值:</span>
- <input name="waterExppm" id="waterExppm" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- </tr>
-
-
-
- <tr>
-
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >水分露点标准值(℃) :</span>
-
- <input name="waterStdewPoint" id="waterStdewPoint" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >水分露点检测值(℃) :</span>
- <input name="waterExdewPoint" id="waterExdewPoint" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >记录人 :</span>
-
- <input name="checker" id="checker" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >记录日期:</span>
- <input name="checkTime" id="checkTime" style="width: 160px;height: 24px;" class="easyui-datetimebox >
- </td>
- </tr>
-
- <tr>
- <td>
- <span class="hzbspan" style="font-size: 16px;color: red;" >备注:</span>
- <input name="remark" id="remark" style="width: 100px;height: 24px;" class="hzbspan" >
- </td>
- </tr>
- </table>
-
-
-
- <a onclick="fLoadData(1,10);" class="easyui-linkbutton" icon="icon-save" href="javascript:void(0)" style="margin-bottom: 5px;" ><span class="hzbspan" style="color: #f08300;font-size: 16px;">添 加 </span></a>
-
- </form>
- </center>
- </div>
- <div id="dialog2"></div>
- </body>
- </html>
|