Нет описания

Timesq.html 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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="../js/layui/css/layui.css">
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <link rel="stylesheet" href="../css/WorkOrder/WorkOrderList.css">
  11. <title>延时申请</title>
  12. </head>
  13. <body>
  14. <div class="Common">
  15. <table>
  16. <tr>
  17. <th class="Importent">申请延时时间:</th>
  18. <td>
  19. <select class="startTime" id="startTime" style="width: 150px; height: 30px; line-height: 30px;">
  20. <!--<option value="0">选择</option>-->
  21. <option value="1">一天</option>
  22. <option value="2">两天</option>
  23. <option value="4">四天</option>
  24. <option value="5" selected="true">五天</option>
  25. <!--<option value="9">九天</option>-->
  26. <!-- <option value="7">七天</option> -->
  27. </select>
  28. </td>
  29. </tr>
  30. <!--<tr>
  31. <th>申请延时时间:</th>
  32. <td>
  33. <select id="types" style="width: 150px; height: 30px; line-height: 30px;">
  34. <option value="0">常规延时</option>
  35. <option value="1">特殊延时</option>
  36. <option value="2">类别错误更正</option>
  37. </select>
  38. </td>
  39. </tr>-->
  40. <!--<tr>
  41. <th>反映类别:</th>
  42. <td class="reflectCategory-wrapper">
  43. <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
  44. <i class="CleansReactionCategory fa fa-close"></i>
  45. <input type="hidden" id="keyid" />
  46. <div class="reflectCategoryList-wrapper">
  47. <ul id="reflectCategoryList">
  48. </ul>
  49. </div>
  50. </td>
  51. </tr>-->
  52. <tr>
  53. <th class="Importent">申请延时原因:</th>
  54. <td colspan="2">
  55. <textarea
  56. data-adaptheight
  57. id="reason"
  58. name=""
  59. rows=""
  60. cols=""
  61. ></textarea>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th>附件:</th>
  66. <td colspan="5">
  67. <div class="fileBox"></div>
  68. <span class="fjnr"></span>
  69. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  70. style="display: none" />
  71. <input class="input" type="button" value="上传" id="scwj" />
  72. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  73. <input type="hidden" id="file" />
  74. <span style="color: #ff0000; border: none">
  75. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  76. </span>
  77. </td>
  78. </tr>
  79. </table>
  80. <div class="btn_box">
  81. <button class="btns">保存</button>
  82. </div>
  83. </div>
  84. <script src="../css/laydate/laydate.js"></script>
  85. <script src="../js/adjustHeight.js"></script>
  86. <script src="../js/layui/layui.js"></script>
  87. <script src="../js/WorkOrder/reflectionClass.js"></script>
  88. <script src="../Script/Common/huayi.common.js"></script>
  89. <script>
  90. var nowTime=new Date();
  91. var wid = helper.request.queryString("wid");
  92. var infoSource = ''
  93. var level = '';
  94. var roleCode = $.cookie("code")
  95. var apiUrl
  96. if (roleCode == 'WLDW') {
  97. level = '2'
  98. } else if (roleCode == 'EJWLDW') {
  99. level = '3'
  100. }
  101. // laydate.skin("blue");
  102. // if (roleCode == "GLY" || roleCode == "ZXLD") {
  103. // laydate({
  104. // elem: "#startTime",
  105. // event: "focus",
  106. // min: getNowDate(),
  107. // });
  108. // } else {
  109. // laydate({
  110. // elem: "#startTime",
  111. // event: "focus",
  112. // min: getNowDate(),
  113. // max: getFiveDate(),
  114. // });
  115. // }
  116. $(document).ready(function () {
  117. getOrderDetail()
  118. if (level==="3") {
  119. apiUrl = 'WorkOrder/EJDelayWorkOrder'
  120. }else{
  121. apiUrl = 'WorkOrder/DelayWorkOrder'
  122. }
  123. $(".btns").click(function () {
  124. if ($("#reason").val() == "") {
  125. layer.msg("申请原因不为空");
  126. } else {
  127. JA();
  128. }
  129. });
  130. });
  131. // $("#types").change(function(){
  132. // if ($(this).val() === '2') {
  133. // console.log($(this).val())
  134. //
  135. // }
  136. // })
  137. //上传附件
  138. $("#scwj").click(function () {
  139. $("#upFile").trigger("click");
  140. });
  141. $("#upFile").change(function () {
  142. upload('upFile','.fileBox',['png','jpg','mp3','mp4','pdf','doc','docx','xls','xlsx'],"#file");
  143. });
  144. // $("#scfj").click(function () {
  145. // $(".fjnr").text("");
  146. // $("#scfj").hide();
  147. // });
  148. //批示
  149. function JA() {
  150. // 判断是否上传文件,没有提示必传
  151. var files = $("#file").val();
  152. if (!files && infoSource == '2580') {
  153. layer.msg("附件不能为空");
  154. return;
  155. }
  156. $.post(
  157. huayi.config.callcenter_url + apiUrl,
  158. {
  159. workorderid: wid,
  160. // types: $("#types").val(),
  161. files: $("#file").val(),
  162. // infoType:$("#keyid").val(),
  163. reason: $("#reason").val(),
  164. newlimittime: $("#startTime").val(),
  165. token: $.cookie("token"),
  166. },
  167. function (result) {
  168. result = JSON.parse(result);
  169. if (result.state.toLowerCase() == "success") {
  170. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  171. parent.layer.close(index); //再执行关闭
  172. parent.$("#orderlist").bootstrapTable("refresh");
  173. parent.layer.msg("申请延时成功");
  174. parent.closePage();
  175. if (parent.parentLoad) {
  176. parent.parentLoad()
  177. }
  178. }
  179. }
  180. );
  181. }
  182. function getNowDate() {
  183. var date = new Date();
  184. var year = date.getFullYear(); //当前年份
  185. var month = date.getMonth(); //当前月份
  186. var day = date.getDate(); //天
  187. month = month + 1
  188. var time = year + "-" + month + "-" + day
  189. return time
  190. }
  191. function getFiveDate() {
  192. var date = new Date();
  193. date.setTime(date.getTime() + 5*24*60*60*1000);
  194. var year = date.getFullYear(); //当前年份
  195. var month = date.getMonth(); //当前月份
  196. var day = date.getDate(); //天
  197. month = month + 1
  198. var time = year + "-" + month + "-" + day
  199. return time
  200. }
  201. function getOrderDetail(){
  202. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrderNew', {
  203. workorderid: wid,
  204. type: 0,
  205. token: $.cookie("token")
  206. }, function (result) {
  207. if (result.state.toLowerCase() == "success") {
  208. console.log(result.data.data)
  209. infoSource = result.data.data[0].F_InfoSource
  210. console.log(infoSource)
  211. }
  212. })
  213. }
  214. </script>
  215. </body>
  216. </html>