Brak opisu

add9.html 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. <link href="../css/init.css" rel="stylesheet" />
  7. <script src="../Script/Common/huayi.load.js"></script>
  8. <script src="../Script/Common/huayi.config.js"></script>
  9. <link rel="stylesheet" href="../css/WorkOrder/jquery.editable-select.css" />
  10. <!-- <link rel="stylesheet" href="../js/comboSelect/combo.select.css" /> -->
  11. <link rel="stylesheet" href="../css/init.css" />
  12. <link rel="stylesheet" href="../css/WorkOrder/NewAddWorkOrder.css" />
  13. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  14. <link href="../css/WorkOrder/Search.css" rel="stylesheet">
  15. <!-- <link rel="stylesheet" href="../js/comboSelect/combo.select.css" /> -->
  16. <link href="../css/init.css" rel="stylesheet" />
  17. <title></title>
  18. <style>
  19. ul li {
  20. float: initial;
  21. list-style: none;
  22. }
  23. .repeat-btn{
  24. width: 100%;
  25. margin: 30px 0 0 0;
  26. text-align: center;
  27. }
  28. .ckxq .gdxq ul li{
  29. width: 100%;
  30. overflow: hidden;
  31. }
  32. .ckxq .gdxq ul li .left{
  33. width: 40%;
  34. float: left;
  35. }
  36. .ckxq .gdxq ul li .right{
  37. width: 60%;
  38. float: left;
  39. }
  40. </style>
  41. </head>
  42. <body class="gray-bg">
  43. <div class="ckxq">
  44. <div class="gdxq">
  45. <div style="width: 100%;">
  46. <ul>
  47. <li>
  48. <div class="left">项目:</div>
  49. <div class="right"><input id="Gzlrbxm" type="text" value=""></input></div>
  50. </li>
  51. <li>
  52. <div class="left">分类:</div>
  53. <div class="right"><input id="Gztype" type="text" value=""></input></div>
  54. </li>
  55. <li>
  56. <div class="left">人次:</div>
  57. <div class="right"><input id="Gzrc" type="text" value=""></input></div>
  58. </li>
  59. <li>
  60. <div class="left">备注:</div>
  61. <div class="right"><input id="Gzmemo" type="text" value=""></input></div>
  62. </li>
  63. </ul>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="repeat-btn">
  68. <button class="btns" id="HY_save">提&nbsp;交</button>
  69. </div>
  70. <script src="../js/download/download.js"></script>
  71. <script>
  72. $(document).ready(function() {
  73. var ajaxUrl;
  74. var ids = helper.request.queryString("edit_id");
  75. if (ids) {
  76. ajaxUrl = "testusertypeapi/api/TestUserType/upGzlrbs";
  77. getValue(ids);
  78. } else {
  79. ajaxUrl = "testusertypeapi/api/TestUserType/AddGzlrbs";
  80. }
  81. //保存
  82. $("#HY_save").click(function() {
  83. // if(!$("#projectid").val()) {
  84. // layer.confirm('请选择设备状态!', {
  85. // icon: 2,
  86. // btn: ['确定'] //按钮
  87. // });
  88. // return;
  89. // }
  90. // if(!$("#equipname").val()) {
  91. // layer.confirm('请输入设备名称!', {
  92. // icon: 2,
  93. // btn: ['确定'] //按钮
  94. // });
  95. // return;
  96. // }
  97. addValue(ajaxUrl, ids);
  98. })
  99. })
  100. //获取详情
  101. function getValue(ids) {
  102. $.ajax({
  103. type: "get",
  104. url: huayi.config.callcenter_url + "testusertypeapi/api/TestUserType/GetGzlrbsbyid",
  105. async: true,
  106. dataType: 'json',
  107. data: {
  108. id: ids
  109. },
  110. success: function(data) {
  111. if (data.state.toLowerCase() == 'success') {
  112. $('#Gzlrbxm').val(data.data[0].Gzlrbxm); //
  113. $('#Gztype').val(data.data[0].Gztype); //
  114. $('#Gzrc').val(data.data[0].Gzrc); //
  115. $('#Gzmemo').val(data.data[0].Gzmemo); //
  116. }
  117. }
  118. });
  119. }
  120. //添加
  121. function addValue(ajaxUrl, ids) {
  122. $.ajax({
  123. type: "get",
  124. url: huayi.config.callcenter_url + ajaxUrl,
  125. // url: "http://192.168.1.21:28230/api/Equipment/update",
  126. async: true,
  127. dataType: 'json',
  128. data: {
  129. id: ids,
  130. Gzlrbxm: $('#Gzlrbxm').val(), //项目
  131. Gztype: $('#Gztype').val(), //分类
  132. Gzrc: $('#Gzrc').val(), //人次
  133. Gzmemo: $('#Gzmemo').val(), //备注
  134. },
  135. success: function(data) {
  136. console.log(1)
  137. if (data.state.toLowerCase() == 'success') {
  138. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  139. parent.layer.close(index); //再执行关闭
  140. layer.msg(data.message);
  141. parent.initTable();
  142. }
  143. }
  144. });
  145. }
  146. </script>
  147. </body>
  148. </html>
  149. </body>
  150. </html>