123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>审批</title>
- <meta name="viewport" content="width=device-width, initial-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">
- <link rel="stylesheet" type="text/css" href="../../../css/common/mui.min.css" />
- <link rel="stylesheet" href="../../../css/common/common.css">
- <link rel="stylesheet" type="text/css" href="../../../css/index/index-menu/approve.css" />
- </head>
- <body>
- <header id="header" class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-arrowleft">
- <span class="back">返回</span>
- </a>
- <h1 class="mui-title">审批</h1>
- </header>
- <div class="mui-content mui-slider mui-fullscreen">
- <header class="mui-bar mui-bar-nav">
- <div class="tabs">
- <div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
- <a class="mui-control-item sm-mo-word mui-active" href="#item1mobile">
- 我发起的
- </a>
- <a class="mui-control-item sm-mo-word" href="#item2mobile">
- 我审批的
- </a>
- <a class="mui-control-item sm-mo-word" href="#item3mobile">
- 历史记录
- </a>
- </div>
- </div>
- </header>
- <div class="mui-slider-group">
- <div id="item1mobile" class="mui-slider-item mui-control-content mui-active mui-scroll-wrapper">
- <div id="scroll1" class="mui-scroll">
- </div>
- </div>
- <div id="item2mobile" class="mui-slider-item mui-control-content mui-scroll-wrapper">
- <div id="scroll2" class="mui-scroll">
- </div>
- </div>
- <div id="item3mobile" class="mui-slider-item mui-control-content mui-scroll-wrapper">
- <div id="scroll3" class="mui-scroll">
- </div>
- </div>
- </div>
- <div class="fixed-box">
- <div>
- <a id="../home-index-approve/add-app.html" onclick="hrefTo(this.id)">发起审批</a>
- </div>
- <div class="mo-word xx">
- <img src="../../../img/home-index/add.png" />
- </div>
- </div>
- </div>
- <script src="../../../libs/mui.min.js"></script>
- <script src="../../../libs/href.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- window.onload = function() {
- mui('.mui-scroll-wrapper').scroll({
- deceleration: 0.0006 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
- });
- //获取页面
- getById();
- //固定菜单
- var count = 0;
- mui(document.body).on('tap', '.xx', function() {
- if(count % 2 == 0) {
- mui('.fixed-box')[0].childNodes[1].className = 'move1';
- mui('.fixed-box')[0].childNodes[3].className = 'mo-word xx move7';
- } else {
- mui('.fixed-box')[0].childNodes[1].className = 'move4';
- mui('.fixed-box')[0].childNodes[3].className = 'mo-word xx move8';
- }
- count++
- });
- //发起审批
- mui(document.body).on('tap', '.add-app', function() {
- hrefTo('../home-index-approve/add-app.html')
- });
- //立即处理跳转
- mui(document.body).on('tap', '.immediate-processing', function() {
- hrefTo('../home-index-approve/immediate-processing.html')
- });
- };
- //获取
- function getById() {
- mui.plusReady(function() {
- var str = plus.storage.getItem('user');
- var user = JSON.parse(str);
- var token = user.Data.Token;
- //我发起的
- var postdata = {
- exist: 1, //类型1我发起、2我审核、3历史
- exist_1: '',
- exist_2: -1,
- pageIndex: 1, //页码
- pageSize: 100 //页码大小
- }
- mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
- headers: {
- authorization: token
- },
- type: "post",
- data: postdata,
- success: function(data) {
- var data = data.Data.list
- var html = '';
- for(var i = 0; i < data.length; i++) {
- html += '<div class="app">'
- html += '<ul class="mui-table-view">'
- html += '<li class="mui-table-view-cell mui-media">'
- html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
- html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
- if(data[i].ApprovalStatus == 3) {
- html += '<span>待审批</span>';
- } else if(data[i].ApprovalStatus == 2) {
- html += '<span>已审批(未同意)</span>';
- } else {
- html += '<span>已审批(已同意)</span>';
- }
- html += '</div>'
- html += '</li>'
- html += '</ul>'
- html += '<div class="app-box">'
- html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
- html += '<div class="app-name">'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人:</span>'
- html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
- html += '</div>'
- html += '<div class="app-value">'
- html += '<div>'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人意见:</span>'
- html += '</div>'
- html += '<div>'
- if(data[i].ApprovalAdvice == null) {
- html += '';
- } else {
- html += data[i].ApprovalAdvice.substring(3, data[i].ApprovalAdvice.length);
- }
- html += '</div>'
- html += '</div>'
- html += '<div class="app-btn"></div>'
- html += '</div>'
- html += '</div>'
- }
- mui('#scroll1')[0].innerHTML = html
- }
- });
- //我审批的
- var postdatas = {
- exist: 2, //类型1我发起、2我审核、3历史
- exist_1: '',
- exist_2: -1,
- pageIndex: 1, //页码
- pageSize: 100 //页码大小
- }
- mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
- headers: {
- authorization: token
- },
- type: "post",
- data: postdatas,
- success: function(data) {
- var data = data.Data.list
- var html = '';
- for(var i = 0; i < data.length; i++) {
- html += '<div class="app">'
- html += '<ul class="mui-table-view">'
- html += '<li class="mui-table-view-cell mui-media">'
- html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
- html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
- if(data[i].ApprovalStatus == 3) {
- html += '<span class="mui-btn" onclick="openDetails(' + data[i].Code + ')">立即处理</span>';
- } else if(data[i].ApprovalStatus == 2) {
- html += '<span>已审批(未同意)</span>';
- } else {
- html += '<span>已审批(已同意)</span>';
- }
- html += '</div>'
- html += '</li>'
- html += '</ul>'
- html += '<div class="app-box">'
- html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
- html += '<div class="app-name">'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人:</span>'
- html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
- html += '</div>'
- html += '<div class="app-value">'
- html += '<div>'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人意见:</span>'
- html += '</div>'
- html += '<div>'
- if(data[i].ApprovalAdvice == null) {
- html += '';
- } else {
- html += data[i].ApprovalAdvice;
- }
- html += '</div>'
- html += '</div>'
- html += '<div class="app-btn"></div>'
- html += '</div>'
- html += '</div>'
- }
- mui('#scroll2')[0].innerHTML = html
- }
- });
- //我发起的
- var postdatass = {
- exist: 3, //类型1我发起、2我审核、3历史
- exist_1: '',
- exist_2: -1,
- pageIndex: 1, //页码
- pageSize: 100 //页码大小
- }
- mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
- headers: {
- authorization: token
- },
- type: "post",
- data: postdatass,
- success: function(data) {
- var data = data.Data.list
- var html = '';
- for(var i = 0; i < data.length; i++) {
- html += '<div class="app">'
- html += '<ul class="mui-table-view">'
- html += '<li class="mui-table-view-cell mui-media">'
- html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
- html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
- if(data[i].ApprovalStatus == 3) {
- html += '<span>待审批</span>';
- } else if(data[i].ApprovalStatus == 2) {
- html += '<span>已审批(未同意)</span>';
- } else {
- html += '<span>已审批(已同意)</span>';
- }
- html += '</div>'
- html += '</li>'
- html += '</ul>'
- html += '<div class="app-box">'
- html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
- html += '<div class="app-name">'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人:</span>'
- html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
- html += '</div>'
- html += '<div class="app-value">'
- html += '<div>'
- html += '<span></span>'
- html += '<span class="sm-mo-word word-color">审批人意见:</span>'
- html += '</div>'
- html += '<div>'
- if(data[i].ApprovalAdvice == null) {
- html += '';
- } else {
- html += data[i].ApprovalAdvice;
- }
- html += '</div>'
- html += '</div>'
- html += '<div class="app-btn"></div>'
- html += '</div>'
- html += '</div>'
- }
- mui('#scroll3')[0].innerHTML = html
- }
- });
- })
- }
- //详情跳转
- function openDetails(code) {
- mui.openWindow({
- url: '../home-index-approve/immediate-processing.html',
- extras: {
- code: code
- },
- createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
- show: {
- autoShow: true, //页面loaded事件发生后自动显示,默认为true
- },
- waiting: {
- autoShow: false, //自动显示等待框,默认为true
- }
- })
- }
- //时间修改
- function getLocalDate(now) {
- var date = now.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
- var arr = date.split(' ');
- //日期
- var arrDate = arr[0].split('-');
- //时间
- var arrTime = arr[1].split(':');
- return arrDate[0] + '年' + arrDate[1] + '月' + arrDate[2] + '日' + ' ' + arrTime[0] + ':' + arrTime[1];
- }
- </script>
- </body>
- </html>
|