AddDMAForm.cshtml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. @{
  2. ViewBag.Title = "分区管理";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. var DMAID = request('DMAID');
  8. $(document).ready(function () {
  9. InitialColor();
  10. });
  11. //保存表单
  12. function AcceptClick() {
  13. if (!$('#form1').Validform()) {
  14. return false;
  15. }
  16. $("#ParentId").val(DMAID == "" ? "0" : DMAID);
  17. var postData = $("#form1").GetWebControls(keyValue);
  18. //postData 格式化 将&nbsp; 替换为 ""
  19. for (var i in postData) {
  20. if (postData[i] == "&nbsp;") {
  21. postData[i] = "";
  22. }
  23. }
  24. $.SaveForm({
  25. url: '/DMAManage/PartitionManage/AddDMAData',
  26. param: {"keyValue": keyValue, "data": JSON.stringify(postData) },
  27. loading: "正在保存数据...",
  28. success: function () {
  29. $.currentIframe().GetTree();
  30. }
  31. })
  32. }
  33. // 初始化颜色
  34. function InitialColor() {
  35. $('.fill_Color').each(function () {
  36. $(this).minicolors({
  37. control: $(this).attr('data-control') || 'hue',
  38. defaultValue: $(this).attr('data-defaultValue') || '',
  39. inline: $(this).attr('data-inline') === 'true',
  40. letterCase: $(this).attr('data-letterCase') || 'lowercase',
  41. opacity: $(this).attr('data-opacity'),
  42. position: $(this).attr('data-position') || 'bottom left',
  43. change: function (hex, opacity) {
  44. if (!hex) return;
  45. if (opacity) hex += ', ' + opacity;
  46. try {
  47. console.log(hex);
  48. } catch (e) { }
  49. },
  50. theme: 'bootstrap'
  51. });
  52. });
  53. }
  54. </script>
  55. <style type="text/css">
  56. .formTitle {
  57. width: 130px !important;
  58. margin-left: 40px;
  59. }
  60. </style>
  61. <div style="margin-left: 10px; margin-top: 20px; margin-right: 30px;">
  62. <table id="form1" class="form" style="width: 95%">
  63. <tr>
  64. <th class="formTitle">分区名称<font face="宋体">*</font></th>
  65. <td class="formValue">
  66. <input id="DMAName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" errormsg="请输入分区名称" placeholder="请输入分区名称"/>
  67. </td>
  68. </tr>
  69. <input type="hidden" id="ParentId" />
  70. <tr>
  71. <th class="formTitle">填充颜色</th>
  72. <td class="formValue" >
  73. <input type="text" style="height: 35px" id="FillColor" class="form-control fill_Color">
  74. </td>
  75. </tr>
  76. <tr>
  77. <th class="formTitle">管道连接点数(个)</th>
  78. <td class="formValue">
  79. <input id="PipeConnectionPoint" type="text" checkexpession="NumOrNull" class="form-control" isvalid="yes" placeholder="请输入管道连接点数"/>
  80. </td>
  81. </tr>
  82. <tr>
  83. <th class="formTitle">主供水管道长度(KM)</th>
  84. <td class="formValue" >
  85. <input id="MainPipeLength" type="text" checkexpession="DoubleOrNull" class="form-control" isvalid="yes" placeholder="请输入主供水管道长度" />
  86. </td>
  87. </tr>
  88. <tr>
  89. <th class="formTitle">支供水管道长度(KM)</th>
  90. <td class="formValue" >
  91. <input id="BranchPipeLength" type="text" checkexpession="DoubleOrNull" class="form-control" isvalid="yes" placeholder="请输入支供水管道长度" />
  92. </td>
  93. </tr>
  94. <tr>
  95. <th class="formTitle">管道设施状况因子</th>
  96. <td class="formValue" >
  97. <input id="PipeFactor" type="text" checkexpession="DoubleOrNull" class="form-control" isvalid="yes" placeholder="请输入管道设施状况因子" />
  98. </td>
  99. </tr>
  100. <tr>
  101. <th class="formTitle">渗透幂指数 N1</th>
  102. <td class="formValue" >
  103. <input id="N1" type="text" checkexpession="DoubleOrNull" class="form-control" isvalid="yes" placeholder="请输入渗透幂指数" />
  104. </td>
  105. </tr>
  106. <tr>
  107. <th class="formTitle">干管用户管道容积(M3)</th>
  108. <td class="formValue" >
  109. <input id="PipeVolume" type="text" class="form-control" checkexpession="DoubleOrNull" isvalid="yes" placeholder="请输入干管用户管道容积" />
  110. </td>
  111. </tr>
  112. </table>
  113. </div>