540 lines
33 KiB
Plaintext
540 lines
33 KiB
Plaintext
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gas-Table_Cal.aspx.cs" Inherits="NGTools.Pages.D_CNG.gas_Table_Cal" %>
|
|||
|
|
|||
|
|
|||
|
<!DOCTYPE html>
|
|||
|
|
|||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|||
|
<head runat="server">
|
|||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|||
|
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" />
|
|||
|
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
|
|||
|
<title>流量计算</title>
|
|||
|
|
|||
|
<!--2个样式表文件-->
|
|||
|
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/default/easyui.css" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../../Scripts/EASYUI/themes/icon.css" />
|
|||
|
<!--2个js文件 ,要先引入jquery,然后再引入easyui-->
|
|||
|
<script src="../../Scripts/EASYUI/jquery.min.js"></script>
|
|||
|
<script src="../../Scripts/EASYUI/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="../../Scripts/EASYUI/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
|
|||
|
<script src="../../Scripts/EASYUI/base-loading.js"></script>
|
|||
|
<script src="../../Scripts/EASYUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
|
|||
|
<script src="../../MYJS/MyTools.js"></script>
|
|||
|
<script src="../../MYJS/constant.js"></script>
|
|||
|
|
|||
|
</head>
|
|||
|
<body class="easyui-layout">
|
|||
|
|
|||
|
<div id="west"data-options="region:'west', split:true" title="组织结构" style="width: 208px;">
|
|||
|
<div id="treeWestT" class="easyui-panel" title="天然气组分" style="width: 200px; height: 30px"></div>
|
|||
|
<div id="treeWest" class="easyui-accordion" title="" style="width: 200px; height: 45%"></div>
|
|||
|
<div id="treeWest2T" class="easyui-panel" title="管束车或储罐" style="width: 200px; height: 30px"></div>
|
|||
|
<div id="treeWest2" class="easyui-accordion" title="" style="width: 200px; height: 45%"></div>
|
|||
|
</div>
|
|||
|
<div id="center"data-options="region:'center', split:true" title="">
|
|||
|
<form id="formPar" class="easyui-form">
|
|||
|
<div id="btn" title="" class="easyui-panel" style="width: 900px; height: 55px; padding: 10px; text-align: center">
|
|||
|
<a id="CalFlow" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" FlowCal()" style="width: 150px">管束车体积表格计算</a>
|
|||
|
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
|||
|
<a id="ExportXls" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="EasyUIDataGridToExcle()" style="width: 130px">导出计算表格</a>
|
|||
|
</div>
|
|||
|
<div>
|
|||
|
<div id="pp" class="easyui-progressbar" data-options="value:0" style="width: 900px; height: 5px"></div>
|
|||
|
</div>
|
|||
|
<div id="NGRun" class="easyui-panel" title="工况参数" style="width: 900px; height: 150px; padding: 5px;">
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">起始压力(MPa):</a><input required="required" name="inP" id="inP" class="easyui-numberbox" data-options="precision:3" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">起始温度(℃):</a><input required="required" name="inWd" id="inWd" class="easyui-numberbox" data-options="precision:3" style="text-align: right; padding: 5px; width: 130px;" value="-10" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">大气压(MPa):</a><input required="required" name="DDDQY" id="DDDQY" class="easyui-numberbox" data-options="precision:6" style="text-align: right; padding: 5px; width: 130px;" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">压力间隔(MPa):</a><input required="required" name="yljg" id="yljg" class="easyui-numberbox" data-options="precision:2" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="0.1" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">温度间隔(MPa):</a><input required="required" name="wdjg" id="wdjg" class="easyui-numberbox" data-options="precision:2" style="text-align: right; padding: 5px; width: 130px;" value="1" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">参比条件:</a><input required="required" name="CBTJ" id="CBTJ" class="easyui-combobox" style="text-align: right; padding: 5px; width: 150px;" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">终止压力(MPa):</a><input required="required" name="inPe" id="inPe" class="easyui-numberbox" data-options="precision:3" style="border-color: #FF0000; text-align: right; padding: 5px; width: 130px; background-color: #0099CC;" value="" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">终止温度(℃):</a><input required="required" name="inWde" id="inWde" class="easyui-numberbox" data-options="precision:3" style="text-align: right; padding: 5px; width: 130px;" value="50" />
|
|||
|
<a style="width: 130px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">管束车水容积(m³):</a><input required="required" name="gscsrj" id="gscsrj" required="required" class="easyui-numberbox" data-options="precision:3" style="text-align: right; width: 120px;" />
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 250px; padding: 5px;" data-options="collapsible:true">
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">甲烷C1:</a>
|
|||
|
<input required="required" name="NG_C1" id="NG_C1" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" value="0" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氮气N2:</a>
|
|||
|
<input required="required" name="NG_N2" id="NG_N2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">二氧化碳CO2:</a>
|
|||
|
<input required="required" name="NG_CO2" id="NG_CO2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">乙烷C2:</a>
|
|||
|
<input required="required" name="NG_C2" id="NG_C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<br />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">丙烷C3:</a>
|
|||
|
<input required="required" name="NG_C3" id="NG_C3" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">水H2O:</a>
|
|||
|
<input required="required" name="NG_H2O" id="NG_H2O" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">硫化氢H2S:</a>
|
|||
|
<input required="required" name="NG_H2S" id="NG_H2S" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氢气H2:</a>
|
|||
|
<input required="required" name="NG_H2" id="NG_H2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<br />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">一氧化碳CO:</a>
|
|||
|
<input required="required" name="NG_CO" id="NG_CO" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氧气O2:</a>
|
|||
|
<input required="required" name="NG_O2" id="NG_O2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异丁烷iC4:</a>
|
|||
|
<input required="required" name="NG_iC4" id="NG_iC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正丁烷nC4:</a>
|
|||
|
<input required="required" name="NG_nC4" id="NG_nC4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<br />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">异戊烷iC5:</a>
|
|||
|
<input required="required" name="NG_iC5" id="NG_iC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">正戊烷nC5:</a>
|
|||
|
<input required="required" name="NG_nC5" id="NG_nC5" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">己烷C6:</a>
|
|||
|
<input required="required" name="NG_C6" id="NG_C6" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">庚烷C7:</a>
|
|||
|
<input required="required" name="NG_C7" id="NG_C7" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<br />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">辛烷C8:</a>
|
|||
|
<input required="required" name="NG_C8" id="NG_C8" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">壬烷C9:</a>
|
|||
|
<input required="required" name="NG_C9" id="NG_C9" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">癸烷C10:</a>
|
|||
|
<input required="required" name="NG_C10" id="NG_C10" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氦气He:</a>
|
|||
|
<input required="required" name="NG_He" id="NG_He" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<br />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">氩气Ar:</a>
|
|||
|
<input required="required" name="NG_Ar" id="NG_Ar" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
<a style="text-align: right; padding-bottom: 10px; width: 110px; display: inline-block; text-align: right; padding-bottom: 10px">合计:</a>
|
|||
|
<input required="required" name="NGCom" id="NG_SUM" class="easyui-numberbox" data-options="precision:4" style="text-align: right; padding-bottom: 10px; width: 90px;" />
|
|||
|
|
|||
|
<a id="Default" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="Zore()" style="text-align: center; width: 80px">全部清零</a>
|
|||
|
<a id="copyBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="copyZf()" style="text-align: center; width: 60px">复制</a>
|
|||
|
<a id="pasteBtn" href="javascript:void(0)" class="easyui-linkbutton c3" onclick="pasteZf()" style="text-align: center; width: 60px">粘贴</a>
|
|||
|
<a style="width: 80px; display: inline-block; text-align: right">常用参数:</a><input id="CYCS" class="easyui-combobox" onclick="NG_Default()" style="text-align: right; width: 140px;" />
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</form>
|
|||
|
|
|||
|
<div id="Result" class="easyui-panel" title="CNG罐车体积计算表格" style="width: 900px; height: 300px; padding: 5px;" data-options="collapsible:true">
|
|||
|
<table id="dg" style="width: 900px; height: auto" data-options="
|
|||
|
singleSelect:true">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
</table>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div id="south" data-options="region:'south',split:false" style="height: 30px;">
|
|||
|
<label id="buyMessage" style="color: red"></label>
|
|||
|
<label id="message" style="color: red"></label>
|
|||
|
|
|||
|
</div>
|
|||
|
|
|||
|
<script>
|
|||
|
|
|||
|
var boolEnableTime = false;
|
|||
|
|
|||
|
var timers = setInterval(function () {
|
|||
|
//if (boolEnableTime) {
|
|||
|
var value = $('#pp').progressbar('getValue');
|
|||
|
if (value < 100) {
|
|||
|
value += 0.1;
|
|||
|
//alert(value);
|
|||
|
$('#pp').progressbar('setValue', value);
|
|||
|
}
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
// //clearInterval(times);
|
|||
|
//}
|
|||
|
}, 200);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
$("#CYCS").combobox({
|
|||
|
onSelect: function (rec) {
|
|||
|
$('#formPar').form('load', JSON.parse(NGComCon[rec.ID].NGCom));
|
|||
|
$('#NG_SUM').numberbox('setValue', sumZf());
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
|
|||
|
function SavePar() {
|
|||
|
saveStr = JSON.stringify(getFormJson('#formPar')); // json对象;
|
|||
|
// alert(JSON.stringify(saveStr));
|
|||
|
|
|||
|
var node = $('#treeWest').tree('getSelected');
|
|||
|
var jldID = node.ID;
|
|||
|
if (jldID == "") {
|
|||
|
$.messager.alert("提示", "请选择计量点后再保存!")
|
|||
|
return;
|
|||
|
}
|
|||
|
if (confirm("确定将计量点参数保存到计量点:" + node.text + "")) {
|
|||
|
|
|||
|
$.ajax({
|
|||
|
type: "post",
|
|||
|
url: '../../ASHX/getTreeCombox.ashx?action=saveJldPar&' + "t=" + Date.parse(new Date()),
|
|||
|
dataType: "json",
|
|||
|
data: { jldid: node.id, Par: saveStr, gnmk: "GVT" },
|
|||
|
traditional: true,
|
|||
|
success: function (data) {
|
|||
|
|
|||
|
//alert(JSON.stringify(data));
|
|||
|
|
|||
|
//$('#formPar').form('load', data);
|
|||
|
$.messager.alert("提示", data);
|
|||
|
|
|||
|
}
|
|||
|
})
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
$('#treeWest').tree({
|
|||
|
formatter: function (node) {
|
|||
|
|
|||
|
return '<span title=双击调取计量点数据" class="easyui-tooltip" >' + node.text + '</span>'
|
|||
|
},
|
|||
|
onDblClick: function (node) {
|
|||
|
clearForm();
|
|||
|
initialCom();
|
|||
|
|
|||
|
$.ajax({
|
|||
|
type: "post",
|
|||
|
url: '../../ASHX/getTreeCombox.ashx?action=getJldPar&' + "t=" + Date.parse(new Date()),
|
|||
|
dataType: "json",
|
|||
|
data: { jldid: node.id, gnmk: "GVT" },
|
|||
|
traditional: true,
|
|||
|
success: function (data) {
|
|||
|
|
|||
|
//alert(JSON.stringify(data));
|
|||
|
|
|||
|
$('#formPar').form('load', data);
|
|||
|
|
|||
|
}
|
|||
|
})
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
})
|
|||
|
|
|||
|
$('#treeWest2').tree({
|
|||
|
onDblClick: function (node) {
|
|||
|
$('#gscsrj').numberbox('setValue', node.id);
|
|||
|
}
|
|||
|
})
|
|||
|
|
|||
|
function FlowCal() {
|
|||
|
|
|||
|
if ($("#formPar").form('validate')) {
|
|||
|
|
|||
|
|
|||
|
try {
|
|||
|
$('#dg').datagrid('loadData', []);
|
|||
|
} catch (e) {
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
var NG_par = "";
|
|||
|
if ($('#inP').numberbox('getValue') == "") {
|
|||
|
alert("请输入表压力!");
|
|||
|
return;
|
|||
|
}
|
|||
|
if ($('#inWd').numberbox('getValue') == "") {
|
|||
|
alert("请输入温度!");
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
if (Math.abs(sumZf() - 100) > 0.001) { $.messager.alert("提示", "组分和不为100%,请检查!"); return; }
|
|||
|
NG_par = "0";//流量计类别
|
|||
|
NG_par = NG_par + "," + "0";//节流装置类型
|
|||
|
NG_par = NG_par + "," + "0";//流量计算标准
|
|||
|
NG_par = NG_par + "," + "0";//压缩因子计算标准
|
|||
|
NG_par = NG_par + "," + $('#CBTJ').combobox('getValue');//'计量参比条件
|
|||
|
NG_par = NG_par + "," + "101325";//计量参比条件压力
|
|||
|
NG_par = NG_par + "," + "293.15";//计量参比条件温度
|
|||
|
NG_par = NG_par + "," + "101325";//燃烧参比条件压力
|
|||
|
NG_par = NG_par + "," + "293.15";//燃烧参比条件温度
|
|||
|
NG_par = NG_par + "," + $('#DDDQY').numberbox('getValue');//当地大气压
|
|||
|
NG_par = NG_par + "," + "2";//当地大气压单位
|
|||
|
NG_par = NG_par + "," + strZf();//天然气组分
|
|||
|
NG_par = NG_par + "," + "0";//取压方式
|
|||
|
NG_par = NG_par + "," + "0";//管道类型
|
|||
|
NG_par = NG_par + "," + "150";//管道内径
|
|||
|
NG_par = NG_par + "," + "3";//长度单位
|
|||
|
NG_par = NG_par + "," + "20";//管道内径参考温度
|
|||
|
NG_par = NG_par + "," + "0";//温度单位
|
|||
|
NG_par = NG_par + "," + "0";//管道材料
|
|||
|
NG_par = NG_par + "," + "50";//孔板孔径
|
|||
|
NG_par = NG_par + "," + "3";//长度单位
|
|||
|
NG_par = NG_par + "," + "20";//孔板内径参考温度
|
|||
|
NG_par = NG_par + "," + "0";//温度单位
|
|||
|
NG_par = NG_par + "," + "0";//孔板材料
|
|||
|
NG_par = NG_par + "," + "0";//锐利度系数计算方法
|
|||
|
NG_par = NG_par + "," + "0";//孔板入口圆弧半径
|
|||
|
NG_par = NG_par + "," + "3";//长度单位
|
|||
|
NG_par = NG_par + "," + $('#inP').numberbox('getValue');//输入压力
|
|||
|
NG_par = NG_par + "," + "2";//压力单位
|
|||
|
NG_par = NG_par + "," + "0";//压力类型
|
|||
|
NG_par = NG_par + "," + $('#inWd').numberbox('getValue');//输入温度
|
|||
|
NG_par = NG_par + "," + "0";//温度单位
|
|||
|
NG_par = NG_par + "," + "0";//输入差压
|
|||
|
NG_par = NG_par + "," + "1";//压力单位
|
|||
|
NG_par = NG_par + "," + "1";//体积流量单位
|
|||
|
NG_par = NG_par + "," + "2";//质量流量单位
|
|||
|
NG_par = NG_par + "," + "1";//能量流量单位
|
|||
|
NG_par = NG_par + "," + $('#yljg').numberbox('getValue');//压力步长
|
|||
|
NG_par = NG_par + "," + $('#wdjg').numberbox('getValue');//温度步长
|
|||
|
NG_par = NG_par + "," + $('#inPe').numberbox('getValue');//终止压力
|
|||
|
NG_par = NG_par + "," + $('#inWde').numberbox('getValue');//终止温度
|
|||
|
NG_par = NG_par + "," + $('#gscsrj').numberbox('getValue');//终止温度
|
|||
|
|
|||
|
$('#CalFlow').linkbutton('disable');
|
|||
|
|
|||
|
$('#pp').progressbar('setValue', 0);
|
|||
|
|
|||
|
//boolEnableTime = true;
|
|||
|
|
|||
|
$.ajax({
|
|||
|
type: "post",
|
|||
|
url: '../../ASHX/FlowCal.ashx?action=GSCVTCal&' + "t=" + Date.parse(new Date()),
|
|||
|
dataType: "json",
|
|||
|
data: { Par: NG_par },
|
|||
|
traditional: true,
|
|||
|
success: function (data) {
|
|||
|
$('#dg').datagrid({
|
|||
|
loadMsg: '正在计算中...',
|
|||
|
pageSize: 20,
|
|||
|
pageList: [20, 30, 40, 50, 100],
|
|||
|
pagination: true,
|
|||
|
striped: true, //奇偶行是否区分
|
|||
|
singleSelect: true,//单选模式
|
|||
|
rownumbers: true,//行号
|
|||
|
fitColumns: false,
|
|||
|
autoRowHeight: false,
|
|||
|
//height: window.innerHeight - 45 - 58,
|
|||
|
//toolbar: toolbar,
|
|||
|
fit: true,
|
|||
|
columns: [data.title] //动态取标题
|
|||
|
});
|
|||
|
$('#dg').datagrid({ loadFilter: pagerFilter }).datagrid('loadData', data.rows); //动态取数据
|
|||
|
$('#CalFlow').linkbutton('enable');
|
|||
|
$('#pp').progressbar('setValue', 100);
|
|||
|
|
|||
|
var blEn = setremainTimes('<%=Session ["userAccount"]%>', getQueryString("GNID"));
|
|||
|
if (blEn == "0") {
|
|||
|
try {
|
|||
|
$('#saveBtn').linkbutton('disable');
|
|||
|
|
|||
|
} catch (e) {
|
|||
|
|
|||
|
}
|
|||
|
try {
|
|||
|
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
|||
|
|
|||
|
} catch (e) {
|
|||
|
|
|||
|
}
|
|||
|
try {
|
|||
|
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
|||
|
|
|||
|
} catch (e) {
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
})
|
|||
|
}
|
|||
|
else {
|
|||
|
$.messager.alert('操作提示', '存在必填项为空,请检查!', "warning");
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//为网格添加分页
|
|||
|
function pagerFilter(data) {
|
|||
|
//$.messager.alert("提示",JSON.stringify(data));
|
|||
|
if (typeof data.length == 'number' && typeof data.splice == 'function') { // 判断数据是否是数组
|
|||
|
data = {
|
|||
|
total: data.length,
|
|||
|
rows: data
|
|||
|
}
|
|||
|
}
|
|||
|
var dg = $(this);
|
|||
|
var opts = dg.datagrid('options');
|
|||
|
var pager = dg.datagrid('getPager');
|
|||
|
pager.pagination({
|
|||
|
onSelectPage: function (pageNum, pageSize) {
|
|||
|
opts.pageNumber = pageNum;
|
|||
|
opts.pageSize = pageSize;
|
|||
|
pager.pagination('refresh', {
|
|||
|
pageNumber: pageNum,
|
|||
|
pageSize: pageSize
|
|||
|
});
|
|||
|
dg.datagrid('loadData', data);
|
|||
|
}
|
|||
|
});
|
|||
|
if (!data.originalRows) {
|
|||
|
data.originalRows = (data.rows);
|
|||
|
}
|
|||
|
var start = (opts.pageNumber - 1) * parseInt(opts.pageSize);
|
|||
|
var end = start + parseInt(opts.pageSize);
|
|||
|
data.rows = (data.originalRows.slice(start, end));
|
|||
|
return data;
|
|||
|
};
|
|||
|
|
|||
|
|
|||
|
$(function () {
|
|||
|
|
|||
|
$('#DDDQY').numberbox('setValue', 0.101325);
|
|||
|
|
|||
|
$("#GDLX").combobox({
|
|||
|
data: GDLX,
|
|||
|
valueField: 'ID',
|
|||
|
textField: 'text'
|
|||
|
});
|
|||
|
$("#CBTJ").combobox({ data: CBTJ, valueField: 'ID', textField: 'text' });
|
|||
|
$('#CBTJ').combobox('select', CBTJ[0].ID);
|
|||
|
|
|||
|
$("#CYCS").combobox({ data: CycsCom, valueField: 'ID', textField: 'text' });
|
|||
|
$('#CYCS').combobox('select', CycsCom[0].ID);
|
|||
|
|
|||
|
var url = '../../ASHX/getTreeCombox.ashx?action=getJld';
|
|||
|
getTree($('#treeWest'), url);
|
|||
|
url = '../../ASHX/getTreeCombox.ashx?action=getGSC';
|
|||
|
getTree($('#treeWest2'), url);
|
|||
|
|
|||
|
$('#NG_C1').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_N2').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_CO2').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C2').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C3').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_H2O').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_H2S').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_H2').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_CO').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_O2').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_iC4').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_nC4').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_iC5').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_nC5').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C6').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C7').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C8').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C9').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_C10').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
$('#NG_He').numberbox({ onChange: function () { sumZf(); } });
|
|||
|
|
|||
|
if (getQueryString("enable").toString() == "False") {document.getElementById("message").innerHTML = "试用期已过,如有需要请点系统设置->开通功能";
|
|||
|
$('#saveBtn').linkbutton('disable');
|
|||
|
$('#NG_C1').numberbox('disable', true); //设置输入框为禁用
|
|||
|
$('#inP').numberbox('disable', true); //设置输入框为禁用
|
|||
|
$('#inPe').numberbox('disable', true); //设置输入框为禁用
|
|||
|
}
|
|||
|
});
|
|||
|
|
|||
|
/*
|
|||
|
作 用:将EasyUI的DataGrid表格,直接导出Excle
|
|||
|
例 子: EasyUIDataGridToExcle('SalaryReport', $('#dg'), 'getRows');
|
|||
|
说 明:文档名字,避免汉字,容易乱码 ,可能造成文档打不开的情况
|
|||
|
*/
|
|||
|
// strXlsName :文檔名字 exportGrid:$('#dg') H:getData:所有數據 getRows:當前頁的數據
|
|||
|
function EasyUIDataGridToExcle() {
|
|||
|
var f = $('<form action="../../ashx/ExportXls.ashx?ActionType=EasyUIDataGridToExcle" method="post" id="fm1"></form>');
|
|||
|
var i = $('<input type="hidden" id="txtContent" name="txtContent" />');
|
|||
|
var l = $('<input type="hidden" id="txtName" name="txtName" />');
|
|||
|
|
|||
|
i.val(ChangeToTable($("#dg"), "getData"));
|
|||
|
|
|||
|
i.appendTo(f);
|
|||
|
l.val("管束车体积表格");
|
|||
|
l.appendTo(f);
|
|||
|
f.appendTo(document.body).submit();
|
|||
|
var newf = document.getElementById("fm1");
|
|||
|
document.body.removeChild(newf);
|
|||
|
};
|
|||
|
function ChangeToTable(printDatagrid, H) {
|
|||
|
var tableString = '<table cellspacing="0" class="pb">';
|
|||
|
var frozenColumns = printDatagrid.datagrid("options").frozenColumns; // 得到frozenColumns对象
|
|||
|
var columns = printDatagrid.datagrid("options").columns; // 得到columns对象
|
|||
|
var nameList = new Array();
|
|||
|
|
|||
|
// 载入title
|
|||
|
if (typeof columns != 'undefined' && columns != '') {
|
|||
|
$(columns).each(function (index) {
|
|||
|
tableString += '\n<tr>';
|
|||
|
if (typeof frozenColumns != 'undefined' && typeof frozenColumns[index] != 'undefined') {
|
|||
|
for (var i = 0; i < frozenColumns[index].length; ++i) {
|
|||
|
if (!frozenColumns[index][i].hidden) {
|
|||
|
tableString += '\n<th width="' + frozenColumns[index][i].width + '"';
|
|||
|
if (typeof frozenColumns[index][i].rowspan != 'undefined' && frozenColumns[index][i].rowspan > 1) {
|
|||
|
tableString += ' rowspan="' + frozenColumns[index][i].rowspan + '"';
|
|||
|
}
|
|||
|
if (typeof frozenColumns[index][i].colspan != 'undefined' && frozenColumns[index][i].colspan > 1) {
|
|||
|
tableString += ' colspan="' + frozenColumns[index][i].colspan + '"';
|
|||
|
}
|
|||
|
if (typeof frozenColumns[index][i].field != 'undefined' && frozenColumns[index][i].field != '') {
|
|||
|
nameList.push(frozenColumns[index][i]);
|
|||
|
}
|
|||
|
tableString += '>' + frozenColumns[index][i].title + '</th>';
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
for (var i = 0; i < columns[index].length; ++i) {
|
|||
|
if (!columns[index][i].hidden) {
|
|||
|
tableString += '\n<th width="' + columns[index][i].width + '"';
|
|||
|
if (typeof columns[index][i].rowspan != 'undefined' && columns[index][i].rowspan > 1) {
|
|||
|
tableString += ' rowspan="' + columns[index][i].rowspan + '"';
|
|||
|
}
|
|||
|
if (typeof columns[index][i].colspan != 'undefined' && columns[index][i].colspan > 1) {
|
|||
|
tableString += ' colspan="' + columns[index][i].colspan + '"';
|
|||
|
}
|
|||
|
if (typeof columns[index][i].field != 'undefined' && columns[index][i].field != '') {
|
|||
|
nameList.push(columns[index][i]);
|
|||
|
}
|
|||
|
tableString += '>' + columns[index][i].title + '</th>';
|
|||
|
}
|
|||
|
}
|
|||
|
tableString += '\n</tr>';
|
|||
|
});
|
|||
|
}
|
|||
|
//alert(tableString);
|
|||
|
////获取表格数据内容
|
|||
|
//alert("nr");
|
|||
|
//alert(printDatagrid);
|
|||
|
var data = printDatagrid.datagrid("getData");
|
|||
|
var rows = data.originalRows;
|
|||
|
for (var i = 0; i < rows.length; ++i) {
|
|||
|
tableString += '\n<tr>';
|
|||
|
for (var j = 0; j < nameList.length; ++j) {
|
|||
|
var e = nameList[j].field.lastIndexOf('_0');
|
|||
|
tableString += '\n<td';
|
|||
|
if (nameList[j].align != 'undefined' && nameList[j].align != '') {
|
|||
|
tableString += ' style="text-align:' + nameList[j].align + ';"';
|
|||
|
}
|
|||
|
tableString += '>';
|
|||
|
if (e + 2 == nameList[j].field.length) {
|
|||
|
tableString += rows[i][nameList[j].field.substring(0, e)];
|
|||
|
}
|
|||
|
else
|
|||
|
tableString += rows[i][nameList[j].field];
|
|||
|
tableString += '</td>';
|
|||
|
}
|
|||
|
tableString += '\n</tr>';
|
|||
|
}
|
|||
|
tableString += '\n</table>';
|
|||
|
|
|||
|
//alert(tableString);
|
|||
|
return tableString;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
</script>
|
|||
|
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|
|||
|
|