MeterForm-bak.cshtml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. @{
  2. ViewBag.Title = "表设备管理";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. $(function () {
  8. initControl();
  9. })
  10. //初始化控件
  11. function initControl() {
  12. //电池电压状态
  13. $("#BatteryVoltageState").ComboBox({
  14. description: "==请选择电池电压状态==",
  15. height: "170px"
  16. });
  17. //箱门报警
  18. $("#BoxDoorAlarm").ComboBox({
  19. description: "==请选择箱门报警==",
  20. height: "170px"
  21. });
  22. //流量计故障
  23. $("#MeterFault").ComboBox({
  24. description: "==请选择箱门报警==",
  25. height: "170px"
  26. });
  27. //换表组标记
  28. $("#MeterTag").ComboBox({
  29. description: "==请选择换表组标记==",
  30. height: "170px"
  31. });
  32. //表类型
  33. $("#MeterTypeId").ComboBoxTree({
  34. url: "/PipeNetworkManage/Meter/GetTreeJson",
  35. id: "ItemValue",
  36. text: "ItemName",
  37. description: "==请选择==",
  38. height: "200px"
  39. });
  40. $("#MeterAssessmentType").val(keyValue == "" ? "0" : keyValue);
  41. //获取表单
  42. if (!!keyValue) {
  43. $.SetForm({
  44. url: "/PipeNetworkManage/Meter/GetMeterTypeFormJson",
  45. param: { keyValue: keyValue },
  46. success: function (data) {
  47. $("#form1").SetWebControls(data);
  48. }
  49. });
  50. }
  51. }
  52. //保存表单
  53. function AcceptClick() {
  54. if (!$('#form1').Validform()) {
  55. return false;
  56. }
  57. var postData = $("#form1").GetWebControls(keyValue);
  58. //postData 格式化 将&nbsp; 替换为 ""
  59. for (var i in postData) {
  60. if (postData[i] == "&nbsp;") {
  61. postData[i] = "";
  62. }
  63. }
  64. $.SaveForm({
  65. url: "/PipeNetworkManage/Meter/SaveMeterTypeForm?keyValue=" + keyValue,
  66. param: { "keyValue": keyValue, "strMeterType": JSON.stringify(postData) },
  67. loading: "正在保存数据...",
  68. success: function () {
  69. $.currentIframe().$("#gridTable").resetSelection();
  70. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  71. }
  72. })
  73. }
  74. </script>
  75. <style type="text/css">
  76. .form .formTitle {
  77. width: 150px;
  78. }
  79. </style>
  80. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  81. <table class="form">
  82. <tr>
  83. <th class="formTitle">考核表名称<font face="宋体">*</font></th>
  84. <td class="formValue">
  85. <input id="MeterAssessmentName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入表名称" placeholder="请输入表名称" />
  86. </td>
  87. <input id="MeterAssessmentId" class="form-control" type="hidden" />
  88. <th class="formTitle">考核表类型<font face="宋体">*</font></th>
  89. <td class="formValue">
  90. <div id="MeterTypeId" type="select" class="ui-select" isvalid="yes" checkexpession="NotNull" errormsg="请选择表类型">
  91. </div>
  92. </td>
  93. </tr>
  94. <tr>
  95. <th class="formTitle">厂商编码<font face="宋体">*</font></th>
  96. <td class="formValue">
  97. <input id="ManufacturerCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="厂商编码不能为空" placeholder="请输入厂商编码" />
  98. </td>
  99. <th class="formTitle">考核表编号<font face="宋体">*</font></th>
  100. <td class="formValue">
  101. <input id="MeterAssessmentCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="考核表编号不能为空" placeholder="请输入考核表编号" />
  102. </td>
  103. </tr>
  104. <tr>
  105. <th class="formTitle">换表时间</th>
  106. <td class="formValue">
  107. <input id="ChangeMeterTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" isvalid="yes" checkexpession="NotNull"/>
  108. </td>
  109. <th class="formTitle">采集时间</th>
  110. <td class="formValue">
  111. <input id="GetDateTime" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
  112. </td>
  113. </tr>
  114. <tr>
  115. <th class="formTitle">净累计流量(m³/h)</th>
  116. <td class="formValue">
  117. <input id="NetCumulativeFlow" type="text" class="form-control" />
  118. </td>
  119. <th class="formTitle">正累计流量(m³/h)</th>
  120. <td class="formValue">
  121. <input id="PositiveCumulativeFlow" type="text" class="form-control" />
  122. </td>
  123. </tr>
  124. <tr>
  125. <th class="formTitle">负累计流量(m³/h)</th>
  126. <td class="formValue">
  127. <input id="NegativeCumulativeFlow" type="text" class="form-control" />
  128. </td>
  129. <th class="formTitle">瞬时流量(m³/h)</th>
  130. <td class="formValue">
  131. <input id="InstantaneousFlow" type="text" class="form-control" />
  132. </td>
  133. </tr>
  134. <tr>
  135. <th class="formTitle">瞬时流量上限报警值(m³/h)</th>
  136. <td class="formValue">
  137. <input id="InstantaneousFlowUpAlarm" type="text" class="form-control" />
  138. </td>
  139. <th class="formTitle">瞬时流量下限报警值(m³/h)</th>
  140. <td class="formValue">
  141. <input id="InstantaneousFlowDownAlarm" type="text" class="form-control" />
  142. </td>
  143. </tr>
  144. <tr>
  145. <th class="formTitle">压力</th>
  146. <td class="formValue">
  147. <input id="Pressure" type="text" class="form-control" />
  148. </td>
  149. <th class="formTitle">压力上限报警值</th>
  150. <td class="formValue">
  151. <input id="PressureUpAlarm" type="text" class="form-control" />
  152. </td>
  153. </tr>
  154. <tr>
  155. <th class="formTitle">压力下限报警值</th>
  156. <td class="formValue">
  157. <input id="PressureDownAlarm" type="text" class="form-control" />
  158. </td>
  159. <th class="formTitle">电池电压值</th>
  160. <td class="formValue">
  161. <input id="BatteryVoltageValue" type="text" class="form-control" />
  162. </td>
  163. </tr>
  164. <tr>
  165. <th class="formTitle">电池电压状态</th>
  166. <td class="formValue">
  167. <div id="BatteryVoltageState" type="select" class="ui-select">
  168. <ul>
  169. <li data-value="0">正常</li>
  170. <li data-value="1">欠压</li>
  171. </ul>
  172. </div>
  173. </td>
  174. <th class="formTitle">箱门报警</th>
  175. <td class="formValue">
  176. <div id="BoxDoorAlarm" type="select" class="ui-select">
  177. <ul>
  178. <li data-value="0">正常</li>
  179. <li data-value="1">报警</li>
  180. </ul>
  181. </div>
  182. </td>
  183. </tr>
  184. <tr>
  185. <th class="formTitle">流量计故障</th>
  186. <td class="formValue">
  187. <div id="MeterFault" type="select" class="ui-select">
  188. <ul>
  189. <li data-value="0">正常</li>
  190. <li data-value="1">故障</li>
  191. </ul>
  192. </div>
  193. </td>
  194. <th class="formTitle">换表组标记</th>
  195. <td class="formValue">
  196. <div id="MeterTag" type="select" class="ui-select">
  197. <ul>
  198. <li data-value="0">正常</li>
  199. <li data-value="1">故障</li>
  200. </ul>
  201. </div>
  202. </td>
  203. </tr>
  204. </table>
  205. </div>