説明なし

Timesq.html 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <input
  18. type="text"
  19. id="startTime"
  20. class="laydate-icon"
  21. style="height: 32px"
  22. autocomplete="off"
  23. />
  24. </td>
  25. </tr>
  26. <tr>
  27. <th class="Importent">申请延时原因:</th>
  28. <td colspan="2">
  29. <textarea
  30. data-adaptheight
  31. id="reason"
  32. name=""
  33. rows=""
  34. cols=""
  35. ></textarea>
  36. </td>
  37. </tr>
  38. </table>
  39. <div class="btn_box">
  40. <button class="btns">保存</button>
  41. </div>
  42. </div>
  43. <script src="../css/laydate/laydate.js"></script>
  44. <script src="../js/adjustHeight.js"></script>
  45. <script>
  46. var nowTime=new Date();
  47. var wid = helper.request.queryString("wid");
  48. var roleCode = $.cookie("code")
  49. laydate.skin("blue");
  50. if (roleCode == "GLY" || roleCode == "ZXLD") {
  51. laydate({
  52. elem: "#startTime",
  53. event: "focus",
  54. min: getNowDate(),
  55. });
  56. } else {
  57. laydate({
  58. elem: "#startTime",
  59. event: "focus",
  60. min: getNowDate(),
  61. max: getFiveDate(),
  62. });
  63. }
  64. $(document).ready(function () {
  65. $(".btns").click(function () {
  66. if ($("#reason").val() == "") {
  67. layer.msg("申请原因不为空");
  68. } else {
  69. JA();
  70. }
  71. });
  72. });
  73. //批示
  74. function JA() {
  75. $.post(
  76. huayi.config.callcenter_url + "WorkOrder/DelayWorkOrder",
  77. {
  78. workorderid: wid,
  79. reason: $("#reason").val(),
  80. newlimittime: $("#startTime").val(),
  81. token: $.cookie("token"),
  82. },
  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 getNowDate() {
  95. var date = new Date();
  96. var year = date.getFullYear(); //当前年份
  97. var month = date.getMonth(); //当前月份
  98. var day = date.getDate(); //天
  99. month = month + 1
  100. var time = year + "-" + month + "-" + day
  101. return time
  102. }
  103. function getFiveDate() {
  104. var date = new Date();
  105. date.setTime(date.getTime() + 5*24*60*60*1000);
  106. var year = date.getFullYear(); //当前年份
  107. var month = date.getMonth(); //当前月份
  108. var day = date.getDate(); //天
  109. month = month + 1
  110. var time = year + "-" + month + "-" + day
  111. return time
  112. }
  113. </script>
  114. </body>
  115. </html>