No Description

Timesq.html 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>延时申请</title>
  10. </head>
  11. <body>
  12. <div class="Common">
  13. <table>
  14. <tr>
  15. <th class="Importent">延时类型:</th>
  16. <td>
  17. <select id="delayType" disabled="disabled" class="" style="width: 192px; height: 32px;">
  18. <option value="1" selected="selected">办理时限</option>
  19. <option value="2">扫描件时效</option>
  20. </select>
  21. </td>
  22. </tr>
  23. <tr>
  24. <th class="Importent">申请延时时间:</th>
  25. <td> <input type="text" id="startTime" class="laydate-icon" style="height: 32px;" autocomplete="off">
  26. </td>
  27. </tr>
  28. <tr>
  29. <th class="Importent">申请延时原因:</th>
  30. <td colspan="2">
  31. <textarea data-adaptheight id="reason" name="" rows="" cols=""></textarea>
  32. </td>
  33. </tr>
  34. </table>
  35. <div class="btn_box">
  36. <button class="btns">保存</button>
  37. </div>
  38. </div>
  39. <script src="../css/laydate/laydate.js"></script>
  40. <script src="../js/adjustHeight.js"></script>
  41. <script>
  42. var wid = helper.request.queryString("wid");
  43. // var limitTime = "";
  44. $(document).ready(function () {
  45. getDetail()
  46. $(".btns").click(function () {
  47. if ($("#reason").val() == '') {
  48. layer.msg("申请原因不为空");
  49. } else {
  50. if ($("#delayType").val() == '1') {
  51. JA();
  52. } else if ($("#delayType").val() == '2') {
  53. scanningDelay()
  54. }
  55. }
  56. })
  57. })
  58. //批示
  59. function JA() {
  60. // $("#startTime").val()
  61. $.post(huayi.config.callcenter_url + 'WorkOrder/DelayWorkOrder', {
  62. workorderid: wid,
  63. reason: $("#reason").val(),
  64. newlimittime: $("#startTime").val(),
  65. "token": $.cookie("token")
  66. }, function (result) {
  67. result = JSON.parse(result);
  68. if (result.state.toLowerCase() == "success") {
  69. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  70. parent.layer.close(index); //再执行关闭
  71. parent.$('#orderlist').bootstrapTable('refresh');
  72. parent.layer.msg("申请延时成功");
  73. }
  74. })
  75. }
  76. // 扫描件延时
  77. function scanningDelay() {
  78. $.post(huayi.config.callcenter_url + 'WorkOrder/DelayScanning', {
  79. workorderid: wid,
  80. reason: $("#reason").val(),
  81. newlimittime: $("#startTime").val(),
  82. "token": $.cookie("token")
  83. }, function (result) {
  84. result = JSON.parse(result);
  85. if (result.state.toLowerCase() == "success") {
  86. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  87. parent.layer.close(index); //再执行关闭
  88. parent.$('#orderlist').bootstrapTable('refresh');
  89. parent.layer.msg("申请延时成功");
  90. }
  91. })
  92. }
  93. // 时间组件
  94. function timeComponent(limitTime) {
  95. var oneDate = (new Date(limitTime)).getTime();
  96. oneDate = oneDate + (1 * 3600 * 24 * 1000);
  97. oneDate = new Date(oneDate)
  98. var oneYear = oneDate.getFullYear();
  99. var oneMonth = oneDate.getMonth();
  100. var oneDay = oneDate.getDate();
  101. var oneHour = oneDate.getHours();
  102. var oneMinutes = oneDate.getMinutes();
  103. var oneSeconds = oneDate.getSeconds();
  104. oneMonth = oneMonth + 1;
  105. if (oneMonth >= 1 && oneMonth <= 9) {
  106. oneMonth = "0" + oneMonth
  107. }
  108. if (oneDay >= 1 && oneDay <= 9) {
  109. oneDay = "0" + oneDay
  110. }
  111. if (oneHour >= 1 && oneHour <= 9) {
  112. oneHour = "0" + oneHour
  113. }
  114. if (oneMinutes >= 0 && oneMinutes <= 9) {
  115. oneMinutes = "0" + oneMinutes
  116. }
  117. if (oneSeconds >= 0 && oneSeconds <= 9) {
  118. oneSeconds = "0" + oneSeconds
  119. }
  120. var oneDaysTime = oneYear + "-" + oneMonth + "-" + oneDay + " " + oneHour + ":" + oneMinutes + ":" + oneSeconds
  121. console.log(oneDaysTime)
  122. var date = (new Date(limitTime)).getTime();
  123. date = date + (3 * 3600 * 24 * 1000);
  124. date = new Date(date)
  125. var year = date.getFullYear();
  126. var month = date.getMonth();
  127. var day = date.getDate();
  128. var hour = date.getHours();
  129. var minutes = date.getMinutes();
  130. var seconds = date.getSeconds();
  131. month = month + 1;
  132. if (month >= 1 && month <= 9) {
  133. month = "0" + month
  134. }
  135. if (day >= 1 && day <= 9) {
  136. day = "0" + day
  137. }
  138. if (hour >= 1 && hour <= 9) {
  139. hour = "0" + hour
  140. }
  141. if (minutes >= 0 && minutes <= 9) {
  142. minutes = "0" + minutes
  143. }
  144. if (seconds >= 0 && seconds <= 9) {
  145. seconds = "0" + seconds
  146. }
  147. var threeDaysTime = year + "-" + month + "-" + day + " " + hour + ":" + minutes + ":" + seconds
  148. console.log("threeDaysTime", threeDaysTime)
  149. laydate.skin('blue');
  150. laydate({
  151. elem: '#startTime',
  152. event: 'focus',
  153. min: oneDaysTime,
  154. max: threeDaysTime,
  155. });
  156. }
  157. // 获取详情
  158. function getDetail() {
  159. $.ajax({
  160. type: "get",
  161. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrder",
  162. async: true,
  163. dataType: 'json',
  164. data: {
  165. token: $.cookie("token"),
  166. workorderid: wid,
  167. },
  168. success: function (data) {
  169. if (data.state.toLowerCase() == "success") {
  170. var data = data.data.data[0]
  171. var limitTime = data.F_LimitTime
  172. console.log("limitTime", limitTime)
  173. timeComponent(limitTime)
  174. }
  175. }
  176. });
  177. }
  178. </script>
  179. </body>
  180. </html>