349 lines
22 KiB
Plaintext
349 lines
22 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Htl_cal.aspx.cs" Inherits="NGTools.Pages.C_CSJS.Htl_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: 200px;">
|
||
<div id="treeWest" style="width: 300px;"></div>
|
||
</div>
|
||
<div id="center" data-options="region:'center', split:true" title="">
|
||
<div>
|
||
<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: 130px">含烃量计算</a>
|
||
<a id="saveBtn" href="javascript:void(0)" class="easyui-linkbutton c1" onclick=" SavePar()" style="width: 130px">保存计量点参数</a>
|
||
</div>
|
||
|
||
|
||
<div id="NGPar" class="easyui-panel" title="天然气组成" style="width: 900px; height: 240px; 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>
|
||
|
||
<div id="Result" class="easyui-panel" title="天然气含烃量" style="width: 900px; height: 155px; padding: 5px;" data-options="collapsible:true">
|
||
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">总炭含量(kg/m³):</a><input id="TotalC" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C2(kg/m³):</a><input id="C2" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C2+(kg/m³):</a><input id="C2j" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C3+(kg/m³):</a><input id="C3j" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C4+(kg/m³):</a><input id="C4j" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C3+C4(kg/m³):</a><input id="C3C4" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C5+(kg/m³):</a><input id="C5j" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
<a style="width: 155px; display: inline-block; text-align: right; padding-bottom: 8px; padding-top: 8px">C6+(kg/m³):</a><input id="C6j" class="easyui-numberbox" data-options="precision:4" style="text-align: right; width: 120px;" />
|
||
|
||
|
||
</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>
|
||
|
||
|
||
$("#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: "HTL" },
|
||
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: "HTL" },
|
||
traditional: true,
|
||
success: function (data) {
|
||
|
||
//alert(JSON.stringify(data));
|
||
|
||
$('#formPar').form('load', data);
|
||
|
||
}
|
||
})
|
||
|
||
|
||
|
||
}
|
||
})
|
||
|
||
function FlowCal() {
|
||
if ($("#formPar").form('validate')) {
|
||
|
||
var NG_par = "";
|
||
|
||
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 + "," + "0";//'计量参比条件
|
||
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 + "," + "0.1";//当地大气压
|
||
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 + "," + "0";//输入压力
|
||
NG_par = NG_par + "," + "2";//压力单位
|
||
NG_par = NG_par + "," + "0";//压力类型
|
||
NG_par = NG_par + "," + "0";//输入温度
|
||
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";//能量流量单位
|
||
|
||
|
||
$.ajax({
|
||
type: "post",
|
||
url: '../../ASHX/FlowCal.ashx?action=PARCal&' + "t=" + Date.parse(new Date()),
|
||
dataType: "json",
|
||
data: { Par: NG_par },
|
||
traditional: true,
|
||
success: function (data) {
|
||
//alert(JSON.stringify(data));
|
||
|
||
|
||
$('#TotalC').numberbox('setValue', data[99]);
|
||
$('#C2').numberbox('setValue', data[100]);
|
||
$('#C2j').numberbox('setValue', data[101]);
|
||
$('#C3j').numberbox('setValue', data[102]);
|
||
$('#C4j').numberbox('setValue', data[103]);
|
||
$('#C5j').numberbox('setValue', data[104]);
|
||
$('#C6j').numberbox('setValue', data[105]);
|
||
$('#C3C4').numberbox('setValue', data[106]);
|
||
|
||
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 () {
|
||
|
||
//$('#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);
|
||
|
||
$('#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); //设置输入框为禁用
|
||
}
|
||
});
|
||
|
||
|
||
|
||
</script>
|
||
|
||
|
||
</body>
|
||
</html>
|