approve.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>审批</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="../../../css/common/mui.min.css" />
  10. <link rel="stylesheet" href="../../../css/common/common.css">
  11. <link rel="stylesheet" type="text/css" href="../../../css/index/index-menu/approve.css" />
  12. </head>
  13. <body>
  14. <header id="header" class="mui-bar mui-bar-nav">
  15. <a class="mui-action-back mui-icon mui-icon-arrowleft">
  16. <span class="back">返回</span>
  17. </a>
  18. <h1 class="mui-title">审批</h1>
  19. </header>
  20. <div class="mui-content mui-slider mui-fullscreen">
  21. <header class="mui-bar mui-bar-nav">
  22. <div class="tabs">
  23. <div id="sliderSegmentedControl" class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
  24. <a class="mui-control-item sm-mo-word mui-active" href="#item1mobile">
  25. 我发起的
  26. </a>
  27. <a class="mui-control-item sm-mo-word" href="#item2mobile">
  28. 我审批的
  29. </a>
  30. <a class="mui-control-item sm-mo-word" href="#item3mobile">
  31. 历史记录
  32. </a>
  33. </div>
  34. </div>
  35. </header>
  36. <div class="mui-slider-group">
  37. <div id="item1mobile" class="mui-slider-item mui-control-content mui-active mui-scroll-wrapper">
  38. <div id="scroll1" class="mui-scroll">
  39. </div>
  40. </div>
  41. <div id="item2mobile" class="mui-slider-item mui-control-content mui-scroll-wrapper">
  42. <div id="scroll2" class="mui-scroll">
  43. </div>
  44. </div>
  45. <div id="item3mobile" class="mui-slider-item mui-control-content mui-scroll-wrapper">
  46. <div id="scroll3" class="mui-scroll">
  47. </div>
  48. </div>
  49. </div>
  50. <div class="fixed-box">
  51. <div>
  52. <a id="../home-index-approve/add-app.html" onclick="hrefTo(this.id)">发起审批</a>
  53. </div>
  54. <div class="mo-word xx">
  55. <img src="../../../img/home-index/add.png" />
  56. </div>
  57. </div>
  58. </div>
  59. <script src="../../../libs/mui.min.js"></script>
  60. <script src="../../../libs/href.js" type="text/javascript" charset="utf-8"></script>
  61. <script type="text/javascript">
  62. window.onload = function() {
  63. mui('.mui-scroll-wrapper').scroll({
  64. deceleration: 0.0006 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
  65. });
  66. //获取页面
  67. getById();
  68. //固定菜单
  69. var count = 0;
  70. mui(document.body).on('tap', '.xx', function() {
  71. if(count % 2 == 0) {
  72. mui('.fixed-box')[0].childNodes[1].className = 'move1';
  73. mui('.fixed-box')[0].childNodes[3].className = 'mo-word xx move7';
  74. } else {
  75. mui('.fixed-box')[0].childNodes[1].className = 'move4';
  76. mui('.fixed-box')[0].childNodes[3].className = 'mo-word xx move8';
  77. }
  78. count++
  79. });
  80. //发起审批
  81. mui(document.body).on('tap', '.add-app', function() {
  82. hrefTo('../home-index-approve/add-app.html')
  83. });
  84. //立即处理跳转
  85. mui(document.body).on('tap', '.immediate-processing', function() {
  86. hrefTo('../home-index-approve/immediate-processing.html')
  87. });
  88. };
  89. //获取
  90. function getById() {
  91. mui.plusReady(function() {
  92. var str = plus.storage.getItem('user');
  93. var user = JSON.parse(str);
  94. var token = user.Data.Token;
  95. //我发起的
  96. var postdata = {
  97. exist: 1, //类型1我发起、2我审核、3历史
  98. exist_1: '',
  99. exist_2: -1,
  100. pageIndex: 1, //页码
  101. pageSize: 100 //页码大小
  102. }
  103. mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
  104. headers: {
  105. authorization: token
  106. },
  107. type: "post",
  108. data: postdata,
  109. success: function(data) {
  110. var data = data.Data.list
  111. var html = '';
  112. for(var i = 0; i < data.length; i++) {
  113. html += '<div class="app">'
  114. html += '<ul class="mui-table-view">'
  115. html += '<li class="mui-table-view-cell mui-media">'
  116. html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
  117. html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
  118. if(data[i].ApprovalStatus == 3) {
  119. html += '<span>待审批</span>';
  120. } else if(data[i].ApprovalStatus == 2) {
  121. html += '<span>已审批(未同意)</span>';
  122. } else {
  123. html += '<span>已审批(已同意)</span>';
  124. }
  125. html += '</div>'
  126. html += '</li>'
  127. html += '</ul>'
  128. html += '<div class="app-box">'
  129. html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
  130. html += '<div class="app-name">'
  131. html += '<span></span>'
  132. html += '<span class="sm-mo-word word-color">审批人:</span>'
  133. html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
  134. html += '</div>'
  135. html += '<div class="app-value">'
  136. html += '<div>'
  137. html += '<span></span>'
  138. html += '<span class="sm-mo-word word-color">审批人意见:</span>'
  139. html += '</div>'
  140. html += '<div>'
  141. if(data[i].ApprovalAdvice == null) {
  142. html += '';
  143. } else {
  144. html += data[i].ApprovalAdvice.substring(3, data[i].ApprovalAdvice.length);
  145. }
  146. html += '</div>'
  147. html += '</div>'
  148. html += '<div class="app-btn"></div>'
  149. html += '</div>'
  150. html += '</div>'
  151. }
  152. mui('#scroll1')[0].innerHTML = html
  153. }
  154. });
  155. //我审批的
  156. var postdatas = {
  157. exist: 2, //类型1我发起、2我审核、3历史
  158. exist_1: '',
  159. exist_2: -1,
  160. pageIndex: 1, //页码
  161. pageSize: 100 //页码大小
  162. }
  163. mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
  164. headers: {
  165. authorization: token
  166. },
  167. type: "post",
  168. data: postdatas,
  169. success: function(data) {
  170. var data = data.Data.list
  171. var html = '';
  172. for(var i = 0; i < data.length; i++) {
  173. html += '<div class="app">'
  174. html += '<ul class="mui-table-view">'
  175. html += '<li class="mui-table-view-cell mui-media">'
  176. html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
  177. html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
  178. if(data[i].ApprovalStatus == 3) {
  179. html += '<span class="mui-btn" onclick="openDetails(' + data[i].Code + ')">立即处理</span>';
  180. } else if(data[i].ApprovalStatus == 2) {
  181. html += '<span>已审批(未同意)</span>';
  182. } else {
  183. html += '<span>已审批(已同意)</span>';
  184. }
  185. html += '</div>'
  186. html += '</li>'
  187. html += '</ul>'
  188. html += '<div class="app-box">'
  189. html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
  190. html += '<div class="app-name">'
  191. html += '<span></span>'
  192. html += '<span class="sm-mo-word word-color">审批人:</span>'
  193. html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
  194. html += '</div>'
  195. html += '<div class="app-value">'
  196. html += '<div>'
  197. html += '<span></span>'
  198. html += '<span class="sm-mo-word word-color">审批人意见:</span>'
  199. html += '</div>'
  200. html += '<div>'
  201. if(data[i].ApprovalAdvice == null) {
  202. html += '';
  203. } else {
  204. html += data[i].ApprovalAdvice;
  205. }
  206. html += '</div>'
  207. html += '</div>'
  208. html += '<div class="app-btn"></div>'
  209. html += '</div>'
  210. html += '</div>'
  211. }
  212. mui('#scroll2')[0].innerHTML = html
  213. }
  214. });
  215. //我发起的
  216. var postdatass = {
  217. exist: 3, //类型1我发起、2我审核、3历史
  218. exist_1: '',
  219. exist_2: -1,
  220. pageIndex: 1, //页码
  221. pageSize: 100 //页码大小
  222. }
  223. mui.ajax("http://www.bosshand.cn/api/Customer/GetApprovalPageList", {
  224. headers: {
  225. authorization: token
  226. },
  227. type: "post",
  228. data: postdatass,
  229. success: function(data) {
  230. var data = data.Data.list
  231. var html = '';
  232. for(var i = 0; i < data.length; i++) {
  233. html += '<div class="app">'
  234. html += '<ul class="mui-table-view">'
  235. html += '<li class="mui-table-view-cell mui-media">'
  236. html += '<img class="mui-media-object mui-pull-left" src="http://www.bosshand.cn/' + data[i].Picture + '">'
  237. html += '<div class="mui-media-body">' + data[i].CreateUser + '<p class="mui-ellipsis">' + getLocalDate(data[i].ApplyTime) + '</p>'
  238. if(data[i].ApprovalStatus == 3) {
  239. html += '<span>待审批</span>';
  240. } else if(data[i].ApprovalStatus == 2) {
  241. html += '<span>已审批(未同意)</span>';
  242. } else {
  243. html += '<span>已审批(已同意)</span>';
  244. }
  245. html += '</div>'
  246. html += '</li>'
  247. html += '</ul>'
  248. html += '<div class="app-box">'
  249. html += '<div class="app-content sm-mo-word">' + data[i].ApplyReason + '</div>'
  250. html += '<div class="app-name">'
  251. html += '<span></span>'
  252. html += '<span class="sm-mo-word word-color">审批人:</span>'
  253. html += '<span class="sm-mo-word">' + data[i].ApprovalPeople + '</span>'
  254. html += '</div>'
  255. html += '<div class="app-value">'
  256. html += '<div>'
  257. html += '<span></span>'
  258. html += '<span class="sm-mo-word word-color">审批人意见:</span>'
  259. html += '</div>'
  260. html += '<div>'
  261. if(data[i].ApprovalAdvice == null) {
  262. html += '';
  263. } else {
  264. html += data[i].ApprovalAdvice;
  265. }
  266. html += '</div>'
  267. html += '</div>'
  268. html += '<div class="app-btn"></div>'
  269. html += '</div>'
  270. html += '</div>'
  271. }
  272. mui('#scroll3')[0].innerHTML = html
  273. }
  274. });
  275. })
  276. }
  277. //详情跳转
  278. function openDetails(code) {
  279. mui.openWindow({
  280. url: '../home-index-approve/immediate-processing.html',
  281. extras: {
  282. code: code
  283. },
  284. createNew: true, //是否重复创建同样id的webview,默认为false:不重复创建,直接显示
  285. show: {
  286. autoShow: true, //页面loaded事件发生后自动显示,默认为true
  287. },
  288. waiting: {
  289. autoShow: false, //自动显示等待框,默认为true
  290. }
  291. })
  292. }
  293. //时间修改
  294. function getLocalDate(now) {
  295. var date = now.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
  296. var arr = date.split(' ');
  297. //日期
  298. var arrDate = arr[0].split('-');
  299. //时间
  300. var arrTime = arr[1].split(':');
  301. return arrDate[0] + '年' + arrDate[1] + '月' + arrDate[2] + '日' + ' ' + arrTime[0] + ':' + arrTime[1];
  302. }
  303. </script>
  304. </body>
  305. </html>