| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <title></title>
- <link href="../../../css/mui.min.css" rel="stylesheet" />
- <link href="../../../css/OA-style.css" rel="stylesheet" />
- <style type="text/css">
- .mui-content>.mui-table-view:first-child {
- margin-top: -1px;
- }
-
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav" id="login">
- <a href="" class="mui-action-back back mui-pull-left"><img src="../../../images/back.png"></a>
- <h1 class="mui-title">发放补贴</h1>
- </header>
-
- <div style="background: #FFFFFF;margin: 60px auto;height: 170px;width: 90%;border-radius: 5%;">
-
- <div style="border: #FFFFFF;height: 125px;">
- <div style="float: left;">
- <center>
- <div style="margin-top: 20px;font-size: 20px;">本月工作</div>
- <div class="mui-content" style="background-color: white;">
- <div class="mui-content-padded">
- <h5 class="mui-content-padded">天数</h5>
- <div class="mui-numbox" data-numbox-min='0'>
- <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
- <input class="mui-input-numbox" type="workday" id="workday"/>
- <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
- </div>
- </div>
- </div>
- </center>
-
- </div>
- <div style="float: right;">
- <center>
- <div style="margin-top: 20px;font-size: 20px;">每日补贴</div>
- <div class="mui-content" style="background-color: white;">
- <div class="mui-content-padded">
- <h5 class="mui-content-padded">元</h5>
- <div class="mui-numbox" data-numbox-min='0'>
- <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
- <input class="mui-input-numbox" type="perdaymoney" id="perdaymoney"/>
- <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
- </div>
- </div>
- </div>
- </center>
- </div>
- </div>
- <center>
- <button type="button" class="mui-btn mui-btn-danger mui-btn-outlined" id="dakuan" style="width: 50%;">全体打款</button>
- </center>
- </div>
- <script type="text/javascript" src="../../../js/jquery-1.11.2.min.js"></script>
- <script src="../../../js/mui.min.js"></script>
- <script src="../../../js/config.js"></script>
- <script src="../../../js/app.js"></script>
- <script src="../../../js/dj/article/list.js"></script>
- <script src="../../../js/vue.min.js"></script>
- <script>
-
- //打款提交按钮
- var dakuan = document.getElementById("dakuan");
- dakuan.addEventListener("click", function() {
-
- var url = API.API_URL();
- var serviceId = "oa_2017V001PHONE_moneyOperation";
- var obj = {
- type:4,
- };
- app.ajax(serviceId,obj, function(data) {
- //服务器返回响应
- console.log(JSON.stringify(data))
- if(data.boo = true) {
- var btnArray = ['取消', '确认'];
- mui.confirm("本月已打款,确定要再次打款?","警告", btnArray, function(e) {
- if (e.index == 1) {
- allowance();
- } else {
- location.reload();
- }
- })
- }else{
- allowance();
- }
- });
- });
-
- function allowance(){
- //开启等待框
- w = plus.nativeUI.showWaiting("打款中,请等待...", {
- loading: {
- display: "inline"
- }
- });
- var url = API.API_URL();
- var perdaymoney=$("#perdaymoney").val();
-
- var workday=$("#workday").val();
- var serviceId = "oa_2017V001PHONE_moneyOperation";
- var obj = {
- type:1,
- perdaymoney: perdaymoney,
- workday:workday,
- serviceId:serviceId,
-
- };
- this.ajax(serviceId,obj, function(data) {
-
- // //关闭等待框
- // var t = setInterval(function() {
- // w.setTitle("打款中,请等待...");
- // w.close();
- // clearInterval(t);
- // }, 1000);
-
- //服务器返回响应
- console.log(JSON.stringify(data))
- if(data.boo = true) {
- mui.toast("打款成功");
- w.close();
- location.reload();
- }else{
- mui.toast("打款失败");
- w.close();
- }
-
- });
-
- }
-
- this.ajax = function(serviceId,params, callback) {
- callback = callback || $.noop;
- var url = API.API_URL();
- params = JSON.stringify(params);
- var obj = {serviceId:serviceId,params:params};
- mui.ajax(url, {
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- data: obj,
- timeout: 60000, //超时时间设置为10秒;
- headers: {
- 'Accept': 'application/json'
- },
- success: function(data) {
- //服务器返回响应
- if(data.returnCode == 0){
- return callback(data.returnParams);
- }else{
- mui.toast(data.returnMsg);
- if(mui('#pullrefresh')&&mui('#pullrefresh').pullRefresh()){
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
- mui('#pullrefresh').pullRefresh().endPulldown();
- }
- if(document.querySelector(".mui-btn")){
- document.querySelector(".mui-btn").removeAttribute("disabled");
- }
- }
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- plus.nativeUI.toast("网络异常,请稍候再试");
- if(mui('#pullrefresh')&&mui('#pullrefresh').pullRefresh()){
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
- if(mui('#pullrefresh').pullRefresh().endPulldown)
- mui('#pullrefresh').pullRefresh().endPulldown();
- }
- }
- });
- };
- </script>
- </body>
- </html>
|