butie.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!doctype html>
  2. <html>
  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. <meta name="apple-mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  8. <title></title>
  9. <link href="../../../css/mui.min.css" rel="stylesheet" />
  10. <link href="../../../css/OA-style.css" rel="stylesheet" />
  11. <style type="text/css">
  12. .mui-content>.mui-table-view:first-child {
  13. margin-top: -1px;
  14. }
  15. </style>
  16. </head>
  17. <body>
  18. <header class="mui-bar mui-bar-nav" id="login">
  19. <a href="" class="mui-action-back back mui-pull-left"><img src="../../../images/back.png"></a>
  20. <h1 class="mui-title">发放补贴</h1>
  21. </header>
  22. <div style="background: #FFFFFF;margin: 60px auto;height: 170px;width: 90%;border-radius: 5%;">
  23. <div style="border: #FFFFFF;height: 125px;">
  24. <div style="float: left;">
  25. <center>
  26. <div style="margin-top: 20px;font-size: 20px;">本月工作</div>
  27. <div class="mui-content" style="background-color: white;">
  28. <div class="mui-content-padded">
  29. <h5 class="mui-content-padded">天数</h5>
  30. <div class="mui-numbox" data-numbox-min='0'>
  31. <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
  32. <input class="mui-input-numbox" type="workday" id="workday"/>
  33. <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  34. </div>
  35. </div>
  36. </div>
  37. </center>
  38. </div>
  39. <div style="float: right;">
  40. <center>
  41. <div style="margin-top: 20px;font-size: 20px;">每日补贴</div>
  42. <div class="mui-content" style="background-color: white;">
  43. <div class="mui-content-padded">
  44. <h5 class="mui-content-padded">元</h5>
  45. <div class="mui-numbox" data-numbox-min='0'>
  46. <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
  47. <input class="mui-input-numbox" type="perdaymoney" id="perdaymoney"/>
  48. <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  49. </div>
  50. </div>
  51. </div>
  52. </center>
  53. </div>
  54. </div>
  55. <center>
  56. <button type="button" class="mui-btn mui-btn-danger mui-btn-outlined" id="dakuan" style="width: 50%;">全体打款</button>
  57. </center>
  58. </div>
  59. <script type="text/javascript" src="../../../js/jquery-1.11.2.min.js"></script>
  60. <script src="../../../js/mui.min.js"></script>
  61. <script src="../../../js/config.js"></script>
  62. <script src="../../../js/app.js"></script>
  63. <script src="../../../js/dj/article/list.js"></script>
  64. <script src="../../../js/vue.min.js"></script>
  65. <script>
  66. //打款提交按钮
  67. var dakuan = document.getElementById("dakuan");
  68. dakuan.addEventListener("click", function() {
  69. var url = API.API_URL();
  70. var serviceId = "oa_2017V001PHONE_moneyOperation";
  71. var obj = {
  72. type:4,
  73. };
  74. app.ajax(serviceId,obj, function(data) {
  75. //服务器返回响应
  76. console.log(JSON.stringify(data))
  77. if(data.boo = true) {
  78. var btnArray = ['取消', '确认'];
  79. mui.confirm("本月已打款,确定要再次打款?","警告", btnArray, function(e) {
  80. if (e.index == 1) {
  81. allowance();
  82. } else {
  83. location.reload();
  84. }
  85. })
  86. }else{
  87. allowance();
  88. }
  89. });
  90. });
  91. function allowance(){
  92. //开启等待框
  93. w = plus.nativeUI.showWaiting("打款中,请等待...", {
  94. loading: {
  95. display: "inline"
  96. }
  97. });
  98. var url = API.API_URL();
  99. var perdaymoney=$("#perdaymoney").val();
  100. var workday=$("#workday").val();
  101. var serviceId = "oa_2017V001PHONE_moneyOperation";
  102. var obj = {
  103. type:1,
  104. perdaymoney: perdaymoney,
  105. workday:workday,
  106. serviceId:serviceId,
  107. };
  108. this.ajax(serviceId,obj, function(data) {
  109. // //关闭等待框
  110. // var t = setInterval(function() {
  111. // w.setTitle("打款中,请等待...");
  112. // w.close();
  113. // clearInterval(t);
  114. // }, 1000);
  115. //服务器返回响应
  116. console.log(JSON.stringify(data))
  117. if(data.boo = true) {
  118. mui.toast("打款成功");
  119. w.close();
  120. location.reload();
  121. }else{
  122. mui.toast("打款失败");
  123. w.close();
  124. }
  125. });
  126. }
  127. this.ajax = function(serviceId,params, callback) {
  128. callback = callback || $.noop;
  129. var url = API.API_URL();
  130. params = JSON.stringify(params);
  131. var obj = {serviceId:serviceId,params:params};
  132. mui.ajax(url, {
  133. dataType: 'json', //服务器返回json格式数据
  134. type: 'post', //HTTP请求类型
  135. data: obj,
  136. timeout: 60000, //超时时间设置为10秒;
  137. headers: {
  138. 'Accept': 'application/json'
  139. },
  140. success: function(data) {
  141. //服务器返回响应
  142. if(data.returnCode == 0){
  143. return callback(data.returnParams);
  144. }else{
  145. mui.toast(data.returnMsg);
  146. if(mui('#pullrefresh')&&mui('#pullrefresh').pullRefresh()){
  147. mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
  148. mui('#pullrefresh').pullRefresh().endPulldown();
  149. }
  150. if(document.querySelector(".mui-btn")){
  151. document.querySelector(".mui-btn").removeAttribute("disabled");
  152. }
  153. }
  154. },
  155. error: function(xhr, type, errorThrown) {
  156. //异常处理;
  157. plus.nativeUI.toast("网络异常,请稍候再试");
  158. if(mui('#pullrefresh')&&mui('#pullrefresh').pullRefresh()){
  159. mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
  160. if(mui('#pullrefresh').pullRefresh().endPulldown)
  161. mui('#pullrefresh').pullRefresh().endPulldown();
  162. }
  163. }
  164. });
  165. };
  166. </script>
  167. </body>
  168. </html>