虞城12345_前端

Work-YSsq.html 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!doctype html>
  2. <html lang="en" class="feedback">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  6. <title>延时申请</title>
  7. <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
  8. <link rel="stylesheet" type="text/css" href="../css/feedback.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
  10. <style>
  11. p {
  12. font-size: 16px;
  13. color: #fe6604;
  14. }
  15. .mui-bar-nav {
  16. background-color: #00a1cb;
  17. color: #fff!important;
  18. }
  19. </style>
  20. </head>
  21. <body>
  22. <header class="mui-bar mui-bar-nav" style="">
  23. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: #fff;"></a>
  24. <h1 class="mui-title" style="color: #fff;">申请延时</h1>
  25. </header>
  26. <div class="mui-content">
  27. <p>申请超时时间(必填)</p>
  28. <div class="mui-input-row">
  29. <input id='demo1' data-options='{"type":"datetime","beginYear":year,"beginMonth":month,"beginDay":day}' type="text" class="mui-input-clear btn contact" />
  30. </div>
  31. <p>申请延时原因(必填)</p>
  32. <div class="row mui-input-row">
  33. <textarea id='question' class="mui-input-clear question" placeholder="请详细描述你的问题和意见..."></textarea>
  34. </div>
  35. <div class="" style="padding: 10px;">
  36. <br />
  37. <button id="submit" type="button" class="mui-btn mui-btn-block mui-btn-primary submit">办理</button>
  38. </div>
  39. </div>
  40. <script src="../js/huayi.config.js"></script>
  41. <script src="../js/zepto.js"></script>
  42. <script src="../js/mui.min.js"></script>
  43. <script src="../js/mui.picker.min.js"></script>
  44. <script type="text/javascript">
  45. mui.init();
  46. mui.plusReady(function() {
  47. var year=new Date().getFullYear();
  48. var month=new Date().getMonth();
  49. var day=new Date().getDate();
  50. var wv = plus.webview.currentWebview();
  51. var vText = wv.name;
  52. var token = wv.token; 
  53. var btns = mui('.btn'); 
  54. btns.each(function(i, btn) {  
  55. btn.addEventListener('tap', function() {   
  56. var dtPicker = new mui.DtPicker({    
  57. type: "date", //设置日历初始视图模式
  58. beginDate: new Date(year, month, day),//设置开始日期
  59. //endDate: new Date(2016, 04, 25),//设置结束日期
  60.   
  61. });  
  62. dtPicker.show(function(e) {
  63. $("#demo1").val(e)
  64. }); 
  65. }, false);
  66. document.getElementById("submit").addEventListener('tap', function() {
  67. var username = $("#demo1").val();
  68. var question = $("#question").val();
  69. if(!username) {
  70. plus.nativeUI.toast('输入时间');
  71. } else if(!question) {
  72. plus.nativeUI.toast('输入申请原因');
  73. } else {
  74. var btnArray = ['取消', '确定'];
  75. mui.confirm('是否申请延时', '提示', btnArray, function(e) {
  76. if(e.index == 1) {
  77. mui.ajax(huayi.config.callcenter_url + 'WorkOrder/DelayWorkOrder', {
  78. data: {
  79. workorderid: vText,
  80. reason: question, //办理人
  81. newlimittime: username, //办理内容
  82. token: token
  83. },
  84. dataType: 'json', //服务器返回json格式数据
  85. type: 'post', //HTTP请求类型
  86. timeout: 10000, //超时时间设置为10秒;
  87. success: function(data) {
  88. plus.nativeUI.toast('申请成功');
  89. var wobj = plus.webview.getWebviewById("Work-list");
  90. wobj.reload(true);
  91. },
  92. error: function(xhr, type, errorThrown) {
  93. plus.nativeUI.toast('失败');
  94. }
  95. });
  96. } else {
  97. plus.nativeUI.toast('取消申请');
  98. }
  99. })
  100. }
  101. })
  102. })
  103. })
  104. </script>
  105. </body>
  106. </html>