ResetReportNumForm.cshtml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. @{
  2. ViewBag.Title = "小区管理";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var addr = request('addr');
  7. var id = request('id');
  8. var IOT_Code = request('IOT_Code');
  9. $(function () {
  10. //状态
  11. $("#MeterStata").ComboBox({
  12. description: "==请选择==",
  13. }).bind("change", function () {
  14. value = $(this).attr('data-value');
  15. if (value == "SET_REPORT_FREQ_VAL|WaterMeter") {
  16. var geth2 = document.getElementById("trTime2");
  17. geth2.style.display = "none";
  18. var geth3 = document.getElementById("trTime3");
  19. geth3.style.display = "none";
  20. //var geth4 = document.getElementById("trTime1");
  21. //geth4.style.display = "none";
  22. var geth5 = document.getElementById("trTime5");
  23. geth5.style.display = "none";
  24. var geth1 = document.getElementById("trTime4");
  25. geth1.style.display = "";
  26. }
  27. if (value == "SET_HIGHFLOW_ALARM|WaterMeterAlarm") {
  28. //var geth1 = document.getElementById("trTime1");
  29. //geth1.style.display = "none";
  30. var geth3 = document.getElementById("trTime3");
  31. geth3.style.display = "none";
  32. var geth4 = document.getElementById("trTime4");
  33. geth4.style.display = "none";
  34. var geth4 = document.getElementById("trTime5");
  35. geth4.style.display = "none";
  36. var geth2 = document.getElementById("trTime2");
  37. geth2.style.display = "";
  38. }
  39. if (value == "SET_SERVER_IP_PORT|WaterMeter") {
  40. //var geth1 = document.getElementById("trTime1");
  41. //geth1.style.display = "none";
  42. var geth2 = document.getElementById("trTime2");
  43. geth2.style.display = "none";
  44. var geth4 = document.getElementById("trTime4");
  45. geth4.style.display = "none";
  46. var geth3 = document.getElementById("trTime3");
  47. geth3.style.display = "none";
  48. var geth5 = document.getElementById("trTime5");
  49. geth5.style.display = "";
  50. }
  51. if (value == "SET_REPORT_RETRY_TIMES|WaterMeter") {
  52. //var geth1 = document.getElementById("trTime1");
  53. //geth1.style.display = "none";
  54. var geth2 = document.getElementById("trTime2");
  55. geth2.style.display = "none";
  56. var geth3 = document.getElementById("trTime4");
  57. geth3.style.display = "none";
  58. var geth4 = document.getElementById("trTime3");
  59. geth4.style.display = "";
  60. var geth5 = document.getElementById("trTime5");
  61. geth5.style.display = "none";
  62. }
  63. //获取数据
  64. if (value == "GET_CONFIG_RSP") {
  65. }
  66. });
  67. })
  68. //保存表单
  69. function AcceptClick() {
  70. if (!$('#form1').Validform()) {
  71. return false;
  72. }
  73. var value1, value2;
  74. var upTime = $("#upTime").val();
  75. var upTimeInterval = $("#upTimeInterval").val();
  76. //判断指令类型获取数据
  77. var value = $("#MeterStata").attr('data-value');//选择的类型
  78. //id, addr, metesta, IOT_Code, value1, value2
  79. if (value == "SET_REPORT_FREQ_VAL|WaterMeter") {
  80. value1 = $("#upTimeInterval").val();
  81. value2 = "";
  82. }
  83. if (value == "SET_HIGHFLOW_ALARM|WaterMeterAlarm") {
  84. value1 = $("#max_flow").val();
  85. }
  86. if (value == "SET_SERVER_IP_PORT|WaterMeter") {
  87. value1 = $("#APN").val();
  88. value2 = $("#IP").val();
  89. }
  90. if (value == "SET_REPORT_RETRY_TIMES|WaterMeter") {
  91. value1 = $("#REPORT_RETRY_TIMES").val();
  92. value2 = "";
  93. }
  94. if (value == "GET_CONFIG_RSP") {
  95. value1 = "";
  96. value2 = "";
  97. }
  98. $.SaveForm({
  99. url: "/NBManage/ReSetUpInterval/SendCommand",
  100. param: { "addr": addr, "id": id, "metesta": value, "IOT_Code": IOT_Code, "value1": value1, "value2": value2 },
  101. loading: "正在保存数据...",
  102. success: function () {
  103. $.currentIframe().$("#gridTable").resetSelection();
  104. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  105. }
  106. })
  107. }
  108. </script>
  109. <style type="text/css">
  110. .form .formTitle {
  111. width: 120px;
  112. }
  113. </style>
  114. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  115. <table id="form1" class="form">
  116. <tr>
  117. <th class="formTitle">参数类别<font face="宋体">*</font></th>
  118. <td class="formValue">
  119. @*<input id="oldAddr" type="text" class="form-control" isvalid="yes" checkexpession="Num" errormsg="请输入旧表地址" placeholder="请输入旧表地址" readonly/>*@
  120. <div id="MeterStata" type="select" class="ui-select">
  121. <ul>
  122. <li data-value="SET_REPORT_FREQ_VAL|WaterMeter">设置上报频率</li>
  123. <li data-value="SET_SERVER_IP_PORT|WaterMeter">设置IP和APN</li>
  124. <li data-value="SET_REPORT_RETRY_TIMES|WaterMeter">设置重试次数</li>
  125. <li data-value="SET_HIGHFLOW_ALARM|WaterMeterAlarm">设置大流量报警门限</li>
  126. <li data-value="GET_CONFIG_RSP">获取数据</li>
  127. </ul>
  128. </div>
  129. </td>
  130. @* <th class="formTitle">ICCID<font face="宋体">*</font></th>
  131. <td class="formValue">
  132. <input id="ICCID" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="IMEI号" placeholder="请输入ICCID" />
  133. </td>*@
  134. </tr>
  135. <tr id="trTime2" style="">
  136. <th class="formTitle">设置大流量报警门限<font face="宋体">*</font></th>
  137. <td class="formValue">
  138. <input id="max_flow" type="text" class="form-control" checkexpession="Num" placeholder="请输入大流量报警门限" />
  139. </td>
  140. @* <th class="formTitle">开始时间<font face="宋体">*</font></th>
  141. <td class="formValue">
  142. <input id="PointStartTime" type="text" value="@LeaRun.Util.Time.ShortTime" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%HH%mm',dateFmt:'HH:mm'})" >
  143. </td>
  144. <th class="formTitle">结束时间<font face="宋体">*</font></th>
  145. <td class="formValue">
  146. <input id="PointEndTime" type="text" value="@LeaRun.Util.Time.ShortTime" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%HH%mm',dateFmt:'HH:mm'})" >
  147. </td>*@
  148. </tr>
  149. @* <tr id="trTime1" style="">
  150. <th class="formTitle">设置时间<font face="宋体">*</font></th>
  151. <td class="formValue">
  152. <input id="PointTime" type="text" value="@LeaRun.Util.Time.ShortTime" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%HH%mm',dateFmt:'HH:mm'})" >
  153. </td>
  154. <th class="formTitle">开始时间<font face="宋体">*</font></th>
  155. <td class="formValue">
  156. <input id="PointEndTime" readonly type="text" value="@LeaRun.Util.Time.ShortTime" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%HH%mm',dateFmt:'HH:mm'})" >
  157. </td>
  158. </tr>*@
  159. <tr id="trTime3">
  160. <th class="formTitle">设置重试次数(0-9)<font face="宋体">*</font></th>
  161. <td class="formValue">
  162. <input id="REPORT_RETRY_TIMES" type="text" class="form-control" checkexpession="Num" placeholder="请输入0-9的数字" />
  163. </td>
  164. </tr>
  165. <tr id="trTime4" style="">
  166. <th class="formTitle">上报频率(分钟)<font face="宋体">*</font></th>
  167. <td class="formValue">
  168. <input id="upTimeInterval" type="text" class="form-control" checkexpession="Num" placeholder="请输入上报频率" />
  169. </td>
  170. @*<th class="formTitle">开始时间<font face="宋体">*</font></th>
  171. <td class="formValue">
  172. <input id="PointEndTime" readonly type="text" value="@LeaRun.Util.Time.ShortTime" class="form-control input-wdatepicker" onfocus="WdatePicker({maxDate:'%HH%mm',dateFmt:'HH:mm'})" >
  173. </td>*@
  174. </tr>
  175. <tr id="trTime5">
  176. <th class="formTitle">设置APN<font face="宋体">*</font></th>
  177. <td class="formValue">
  178. <input id="APN" type="text" class="form-control" checkexpession="Num" placeholder="请输入APN" />
  179. </td>
  180. <th class="formTitle">设置IP<font face="宋体">*</font></th>
  181. <td class="formValue">
  182. <input id="IP" type="text" class="form-control" checkexpession="Num" placeholder="请输入IP" />
  183. </td>
  184. </tr>
  185. </table>
  186. </div>