Няма описание

addRiskArea.html 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script src="../Script/Common/huayi.load.js"></script>
  7. <script src="../Script/Common/huayi.config.js"></script>
  8. <script src="../js/laydate/laydate.js"></script>
  9. <script src="../js/bootstrap-select/js/bootstrap-select.js"></script>
  10. <script src="../js/bootstrap-select/js/i18n/defaults-zh_CN.js"></script>
  11. <script src="../Script/Common/regexs.js"></script>
  12. <script src="../js/autosize/autosize.min.js"></script>
  13. <link href="../css/plugins/cropper/cropper.min.css" rel="stylesheet">
  14. <link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
  15. <link href="../css/init.css" rel="stylesheet" />
  16. <link rel="stylesheet" type="text/css" href="../css/Table/table1.css" />
  17. <title>新增风险等级</title>
  18. <style>
  19. .btnn {
  20. background: #2f4050;
  21. color: #fff;
  22. padding: 3px 10px;
  23. border: 0;
  24. border-radius: 3px;
  25. cursor: pointer;
  26. }
  27. .crop_left {
  28. width: 40%;
  29. float: left;
  30. }
  31. .crop_right {
  32. width: 30%;
  33. float: right;
  34. margin-right: 25px;
  35. }
  36. .time-box .dates {
  37. width: 100% !important;
  38. }
  39. i.tub {
  40. right: 25px !important;
  41. }
  42. b.text_require {
  43. color: red;
  44. }
  45. .provCity > div > div {
  46. width: 49.5% !important;
  47. display: inline-block ;
  48. vertical-align: middle !important;
  49. }
  50. .repeat-btn{
  51. width: 50px;
  52. margin: 20px auto;
  53. }
  54. </style>
  55. </head>
  56. <body class="gray-bg">
  57. <div class="container wrapper-content animated fadeInRight">
  58. <div class="form-horizontal">
  59. <div class="form-group">
  60. <label for="riskname" class="col-sm-3 control-label text-right"><b class="text_require">*</b>风险区域名称</label>
  61. <div class="col-sm-9">
  62. <input id="riskname" class="form-control" type="text" autocomplete="off" placeholder="请输入风险区域名称"/>
  63. </div>
  64. </div>
  65. <div class="form-group">
  66. <label for="Fxqyyq" class="col-sm-3 control-label text-right"><b class="text_require">*</b>风险院区</label>
  67. <div class="col-sm-9">
  68. <input id="Fxqyyq" class="form-control" type="text" autocomplete="off" placeholder="风险院区"/>
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label for="Fxqylh" class="col-sm-3 control-label text-right"><b class="text_require">*</b>风险楼号</label>
  73. <div class="col-sm-9">
  74. <input id="Fxqylh" class="form-control" type="text" autocomplete="off" placeholder="风险楼号"/>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <label for="Fxqylc" class="col-sm-3 control-label text-right"><b class="text_require">*</b>风险楼层</label>
  79. <div class="col-sm-9">
  80. <input id="Fxqylc" class="form-control" type="text" autocomplete="off" placeholder="风险楼层"/>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="repeat-btn">
  85. <button class="btns" id="HY_save">提&nbsp;交</button>
  86. </div>
  87. </div>
  88. <script>
  89. $(document).ready(function() {
  90. var ajaxUrl;
  91. var ids = helper.request.queryString("edit_id");
  92. if (ids) {
  93. ajaxUrl = "testusertypeapi/api/TestUserType/upFxqytabs";
  94. getValue(ids);
  95. } else {
  96. ajaxUrl = "testusertypeapi/api/TestUserType/AddFxqytabs";
  97. }
  98. //保存
  99. $("#HY_save").click(function() {
  100. if(!$("#riskname").val()) {
  101. layer.confirm('请输入风险区域名称!', {
  102. icon: 2,
  103. btn: ['确定'] //按钮
  104. });
  105. return;
  106. }
  107. addValue(ajaxUrl, ids);
  108. })
  109. })
  110. //获取详情
  111. function getValue(ids) {
  112. $.ajax({
  113. type: "get",
  114. url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/GetFxqytabsbyid",
  115. async: true,
  116. dataType: 'json',
  117. data: {
  118. id: ids
  119. },
  120. success: function(data) {
  121. if (data.state.toLowerCase() == 'success') {
  122. $('#riskname').val(data.data[0].Fxqyname); //风险区域名称
  123. $('#Fxqyyq').val(data.data[0].Fxqyyq); //风险院区
  124. $('#Fxqylh').val(data.data[0].Fxqylh); //风险楼号
  125. $('#Fxqylc').val(data.data[0].Fxqylc); //风险楼层
  126. }
  127. }
  128. });
  129. }
  130. //添加
  131. function addValue(ajaxUrl, ids) {
  132. $.ajax({
  133. type: "get",
  134. url: huayi.config.callcenter_url + ajaxUrl,
  135. // url: "http://192.168.1.21:28230/api/Equipment/update",
  136. async: true,
  137. dataType: 'json',
  138. data: {
  139. id: ids,
  140. Fxqyname: $('#riskname').val(), //风险等级名称
  141. Fxqyyq: $('#Fxqyyq').val(), //风险院区
  142. Fxqylh: $('#Fxqylh').val(), //风险楼号
  143. Fxqylc: $('#Fxqylc').val(), //风险楼层
  144. },
  145. success: function(data) {
  146. console.log(1)
  147. if (data.state.toLowerCase() == 'success') {
  148. debugger
  149. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  150. parent.layer.close(index); //再执行关闭
  151. layer.msg(data.message);
  152. parent.initTable();
  153. }
  154. }
  155. });
  156. }
  157. </script>
  158. </body>
  159. </html>