暫無描述

Timesq.html 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 class="startTime" id="startTime" style="width: 150px; height: 30px; line-height: 30px;">
  18. <!--<option value="0">选择</option>-->
  19. <option value="1">一天</option>
  20. <option value="2">两天</option>
  21. <option value="4">四天</option>
  22. <option value="5" selected="true">五天</option>
  23. <option value="9">九天</option>
  24. <!-- <option value="7">七天</option> -->
  25. </select>
  26. </td>
  27. </tr>
  28. <tr>
  29. <th class="Importent">申请延时原因:</th>
  30. <td colspan="2">
  31. <textarea
  32. data-adaptheight
  33. id="reason"
  34. name=""
  35. rows=""
  36. cols=""
  37. ></textarea>
  38. </td>
  39. </tr>
  40. </table>
  41. <div class="btn_box">
  42. <button class="btns">保存</button>
  43. </div>
  44. </div>
  45. <script src="../css/laydate/laydate.js"></script>
  46. <script src="../js/adjustHeight.js"></script>
  47. <script>
  48. var nowTime=new Date();
  49. var wid = helper.request.queryString("wid");
  50. var level = helper.request.queryString("level");
  51. var roleCode = $.cookie("code")
  52. var apiUrl
  53. // laydate.skin("blue");
  54. // if (roleCode == "GLY" || roleCode == "ZXLD") {
  55. // laydate({
  56. // elem: "#startTime",
  57. // event: "focus",
  58. // min: getNowDate(),
  59. // });
  60. // } else {
  61. // laydate({
  62. // elem: "#startTime",
  63. // event: "focus",
  64. // min: getNowDate(),
  65. // max: getFiveDate(),
  66. // });
  67. // }
  68. $(document).ready(function () {
  69. if (level==="3") {
  70. apiUrl = 'WorkOrder/EJDelayWorkOrder'
  71. }else{
  72. apiUrl = 'WorkOrder/DelayWorkOrder'
  73. }
  74. $(".btns").click(function () {
  75. if ($("#reason").val() == "") {
  76. layer.msg("申请原因不为空");
  77. } else {
  78. JA();
  79. }
  80. });
  81. });
  82. //批示
  83. function JA() {
  84. $.post(
  85. huayi.config.callcenter_url + apiUrl,
  86. {
  87. workorderid: wid,
  88. reason: $("#reason").val(),
  89. newlimittime: $("#startTime").val(),
  90. token: $.cookie("token"),
  91. },
  92. function (result) {
  93. result = JSON.parse(result);
  94. if (result.state.toLowerCase() == "success") {
  95. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  96. parent.layer.close(index); //再执行关闭
  97. parent.$("#orderlist").bootstrapTable("refresh");
  98. parent.layer.msg("申请延时成功");
  99. parent.closePage();
  100. if (parent.parentLoad) {
  101. parent.parentLoad()
  102. }
  103. }
  104. }
  105. );
  106. }
  107. function getNowDate() {
  108. var date = new Date();
  109. var year = date.getFullYear(); //当前年份
  110. var month = date.getMonth(); //当前月份
  111. var day = date.getDate(); //天
  112. month = month + 1
  113. var time = year + "-" + month + "-" + day
  114. return time
  115. }
  116. function getFiveDate() {
  117. var date = new Date();
  118. date.setTime(date.getTime() + 5*24*60*60*1000);
  119. var year = date.getFullYear(); //当前年份
  120. var month = date.getMonth(); //当前月份
  121. var day = date.getDate(); //天
  122. month = month + 1
  123. var time = year + "-" + month + "-" + day
  124. return time
  125. }
  126. </script>
  127. </body>
  128. </html>