trip_approve_list.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  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/mui.picker.css" rel="stylesheet" />
  11. <link href="../../css/mui.poppicker.css" rel="stylesheet" />
  12. <link href="../../css/OA-style.css" rel="stylesheet" />
  13. <style type="text/css">
  14. .mui-bar-nav {
  15. box-shadow: 0 0px 0px #ccc;
  16. }
  17. .mui-table-view:after {
  18. height: 0
  19. }
  20. .mui-table-view:before {
  21. height: 0
  22. }
  23. .mui-table-view-cell {
  24. position: static;
  25. }
  26. .mui-table-view {
  27. position: static;
  28. }
  29. .mui-btn,
  30. button,
  31. input[type=button],
  32. input[type=reset],
  33. input[type=submit] {
  34. padding: 5px 10px;
  35. margin-top: 10px;
  36. }
  37. body {
  38. background-color: #efeff4;
  39. }
  40. .mui-segmented-control .mui-control-item.mui-active {
  41. background-color: #468CF0;
  42. }
  43. .mui-segmented-control {
  44. border: 1px solid #468CF0;
  45. }
  46. .mui-segmented-control .mui-control-item {
  47. border-left: 1px solid #468CF0;
  48. color: #468CF0;
  49. }
  50. .mui-bar~.mui-content .mui-fullscreen {
  51. top: 44px;
  52. height: auto;
  53. }
  54. .mui-pull-top-tips {
  55. position: absolute;
  56. top: -20px;
  57. left: 50%;
  58. margin-left: -25px;
  59. width: 40px;
  60. height: 40px;
  61. border-radius: 100%;
  62. z-index: 1;
  63. }
  64. .mui-bar~.mui-pull-top-tips {
  65. top: 24px;
  66. }
  67. .mui-pull-top-wrapper {
  68. width: 42px;
  69. height: 42px;
  70. display: block;
  71. text-align: center;
  72. background-color: #efeff4;
  73. border: 1px solid #ddd;
  74. border-radius: 25px;
  75. background-clip: padding-box;
  76. box-shadow: 0 4px 10px #bbb;
  77. overflow: hidden;
  78. }
  79. .mui-pull-top-tips.mui-transitioning {
  80. -webkit-transition-duration: 200ms;
  81. transition-duration: 200ms;
  82. }
  83. .mui-pull-top-tips .mui-pull-loading {
  84. /*-webkit-backface-visibility: hidden;
  85. -webkit-transition-duration: 400ms;
  86. transition-duration: 400ms;*/
  87. margin: 0;
  88. }
  89. .mui-pull-top-wrapper .mui-icon,
  90. .mui-pull-top-wrapper .mui-spinner {
  91. margin-top: 7px;
  92. }
  93. .mui-pull-top-wrapper .mui-icon.mui-reverse {
  94. /*-webkit-transform: rotate(180deg) translateZ(0);*/
  95. }
  96. .mui-pull-bottom-tips {
  97. text-align: center;
  98. background-color: #efeff4;
  99. font-size: 15px;
  100. line-height: 40px;
  101. color: #777;
  102. }
  103. .mui-pull-top-canvas {
  104. overflow: hidden;
  105. background-color: #fafafa;
  106. border-radius: 40px;
  107. box-shadow: 0 4px 10px #bbb;
  108. width: 40px;
  109. height: 40px;
  110. margin: 0 auto;
  111. }
  112. .mui-pull-top-canvas canvas {
  113. width: 40px;
  114. }
  115. .mui-slider-indicator.mui-segmented-control {
  116. background-color: #efeff4;
  117. }
  118. .mui-scroll1 {
  119. z-index: 1;
  120. width: 100%;
  121. }
  122. .mui-table-view-cell {
  123. padding: 0px 0px;
  124. }
  125. .mui-bar-nav {
  126. background: #468CF0;
  127. }
  128. </style>
  129. </head>
  130. <body>
  131. <header class="mui-bar mui-bar-nav" id="login">
  132. <a class="mui-action-back back mui-pull-left"><img src="../../images/back.png"></a>
  133. <h1 class="mui-title">我收到的出差审批</h1>
  134. </header>
  135. <div class="mui-content">
  136. <div id="slider" class="mui-slider mui-fullscreen">
  137. <div style="padding: 10px 10px;">
  138. <div id="segmentedControl" class="mui-segmented-control">
  139. <div class="mui-scroll1">
  140. <a class="mui-control-item mui-active" href="#item1mobile" style="font-size: 16px;">未审批</a>
  141. <a class="mui-control-item" href="#item3mobile" style="font-size: 16px;">已审批</a>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="mui-slider-group">
  146. <div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
  147. <div class="mui-scroll-wrapper">
  148. <div id="pullrefresh" class="mui-scroll">
  149. <ul class="mui-table-view trip_ul tri_top1" id="items1" style="margin-top: 5px;padding: 0px 10px;">
  150. <li class="mui-table-view-cell tri_li_top" v-for="item in items">
  151. <!--左边蓝色部分-->
  152. <div class="tri_li_left right">
  153. <div class="mui-pull-left tri_li_div1">
  154. <p class="mui-pull-left tri_li_p">审核批号</p><br/><br/>
  155. <div class="tri_li_span tri_li_top">{{item.tripid}}</div><br/>
  156. <div class="iconfont icon-jt_gaotie mui-pull-left tri_li_div2">
  157. <span>状态:</span><span>{{item.state}}</span>
  158. </div>
  159. </div>
  160. <!--右边边白色部分-->
  161. <div class="tri_li_right">
  162. <span class="tri_li_p1"><span style="color: #0EA0A6;">➢ </span>{{item.bengintime}}至{{item.endtime}} 共{{item.triptotalday}}天 </span>
  163. <hr class="tri_li_hr" />
  164. <span class="tri_li_p1"><span style="color: #0EA0A6;">♂</span>{{item.name2}}</span>
  165. <div class="tri_li_cardzh">
  166. <p class="tri_li_cardzh_p">出差地址:{{item.address}}</p>
  167. </div>
  168. <div>
  169. <button type="button" id="check" class="mui-btn mui-btn-outlined mui-pull-right" @tap="open_detail(item)">查看</button>
  170. </div>
  171. </div>
  172. </div>
  173. </li>
  174. </ul>
  175. <div></div>
  176. </div>
  177. </div>
  178. </div>
  179. <div id="item3mobile" class="mui-slider-item mui-control-content">
  180. <div class="mui-scroll-wrapper">
  181. <div id="pullrefresh3" class="mui-scroll">
  182. <ul class="mui-table-view trip_ul tri_top1" id="items3" style="margin-top: 5px;padding: 0px 10px;">
  183. <li class="mui-table-view-cell tri_li_top" v-for="item in item3">
  184. <!--左边蓝色部分-->
  185. <div class="tri_li_left right">
  186. <div class="mui-pull-left tri_li_div1">
  187. <p class="mui-pull-left tri_li_p">审核批号</p><br/><br/>
  188. <div class="tri_li_span tri_li_top">{{item.tripid}}</div><br/>
  189. <div class="iconfont icon-jt_gaotie mui-pull-left tri_li_div2">
  190. <span>状态:</span><span>{{item.state}}</span>
  191. </div>
  192. </div>
  193. <!--右边边白色部分-->
  194. <div class="tri_li_right">
  195. <span class="tri_li_p1"><span style="color: #0EA0A6;">➢ </span>{{item.bengintime}}至{{item.endtime}} 共{{item.triptotalday}}天 </span>
  196. <hr class="tri_li_hr" />
  197. <span class="tri_li_p1"><span style="color: #0EA0A6;">♂</span>{{item.name2}}</span>
  198. <div class="tri_li_cardzh">
  199. <p class="tri_li_cardzh_p">出差地址:{{item.address}}</p>
  200. </div>
  201. <div>
  202. <button type="button" id="check" class="mui-btn mui-btn-outlined mui-pull-right" @tap="open_detail(item)">查看</button>
  203. </div>
  204. </div>
  205. </div>
  206. </li>
  207. </ul>
  208. <div></div>
  209. </div>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <script src="../../js/mui.min.js"></script>
  216. <script src="../../js/config.js"></script>
  217. <script src="../../js/app.js"></script>
  218. <script src="../../js/jquery-1.11.2.min.js"></script>
  219. <script src="../../js/vue.min.js"></script>
  220. <script src="../../js/mui.pullToRefresh.js"></script>
  221. <script src="../../js/mui.pullToRefresh.material.js"></script>
  222. <script type="text/javascript">
  223. mui.init();
  224. var pageNo = 1;
  225. var pageNo3 = 1;
  226. (function($) {
  227. //初始化单页的区域滚动
  228. // mui('.mui-scroll-wrapper').scroll();
  229. //阻尼系数
  230. // var deceleration = mui.os.ios ? 0.003 : 0.0009;
  231. // $('.mui-scroll-wrapper').scroll({
  232. // bounce: false,
  233. // indicators: true, //是否显示滚动条
  234. // deceleration: deceleration
  235. // });
  236. mui.plusReady(function() {
  237. var self1 = plus.webview.currentWebview();
  238. //id = self1.xiaolv_id;
  239. $.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
  240. $(pullRefreshEl).pullToRefresh({
  241. //container: '.list_item',
  242. down: {
  243. callback: function() {
  244. var self = this;
  245. setTimeout(function() {
  246. var ul = self.element.querySelector('.mui-table-view');
  247. reloadNews(ul, self);
  248. self.endPullDownToRefresh();
  249. }, 1000); //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
  250. }
  251. },
  252. up: {
  253. contentrefresh: '正在加载...',
  254. auto: true, //可选,默认false.自动上拉加载一次
  255. callback: function() {
  256. var self = this;
  257. //console.log(self+"----------");
  258. // setTimeout(function() {
  259. var ul = self.element.querySelector('.mui-table-view');
  260. console.log(pullRefreshEl.id);
  261. pullupRefresh(ul, self);
  262. // self.endPullUpToRefresh();
  263. // }, 1000);
  264. }
  265. }
  266. });
  267. });
  268. });
  269. })(mui);
  270. var vmA = new Vue({
  271. el: '#pullrefresh',
  272. data: {
  273. items: [] //列表信息流数据
  274. }
  275. });
  276. var vmC = new Vue({
  277. el: '#items3',
  278. data: {
  279. item3: [] //列表信息流数据
  280. }
  281. });
  282. /**
  283. * 下拉刷新具体业务实现
  284. */
  285. function reloadNews(ul, self) {
  286. var dataType = self.element.id;
  287. if("pullrefresh" == dataType) {
  288. pageNo = 1;
  289. vmA.items = [];
  290. addData(ul, self);
  291. } else if("pullrefresh3" == dataType) {
  292. pageNo3 = 1;
  293. vmC.item3 = [];
  294. addData3(ul, self);
  295. }
  296. }
  297. var type = "get";
  298. /**
  299. * 上拉加载具体业务实现
  300. */
  301. function pullupRefresh(ul, self) {
  302. var dataType = self.element.id;
  303. //console.log(dataType + "======");
  304. if("pullrefresh" == dataType) {
  305. addData(ul, self);
  306. } else if("pullrefresh3" == dataType) {
  307. addData3(ul, self);
  308. }
  309. }
  310. function addData(ul, self) {
  311. var url = API.API_URL();
  312. var serviceId = "oa_2018V001PHONE_tripList";
  313. var state = app.getState(); //获取登陆信息
  314. var staffId = state.user.useId; //获取登录id
  315. /*var staffId = state.user.useId;
  316. var unitId = state.user.unitId;*/
  317. var state = "1";
  318. var obj = {
  319. /*unitId: unitId,
  320. userId: staffId,
  321. notice_title: notice_title,*/
  322. universalid: staffId,
  323. type: type,
  324. state: state,
  325. pSize: APP.PageSize,
  326. p: pageNo
  327. };
  328. app.ajax(serviceId, obj, function(data) {
  329. //服务器返回响应
  330. console.log(JSON.stringify(data))
  331. var result = data.returnParams;
  332. var totalRow = data.total;
  333. var totalPage = Math.ceil(totalRow / APP.PageSize);
  334. var list = data.list;
  335. console.log(list.length + "===========" + totalPage);
  336. if(list.length > 0) {
  337. vmA.items = vmA.items.concat(convert(list));
  338. }
  339. if(totalPage == 0 || totalPage == 1) {
  340. self.endPullUpToRefresh(true);
  341. } else {
  342. self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
  343. }
  344. if(pageNo == 1 && totalPage > 1)
  345. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  346. pageNo = pageNo + 1;
  347. });
  348. }
  349. function addData3(ul, self) {
  350. var url = API.API_URL();
  351. var serviceId = "oa_2018V001PHONE_tripList";
  352. var state = app.getState(); //获取登陆信息
  353. var staffId = state.user.useId; //获取登录id
  354. /*var staffId = state.user.useId;
  355. var unitId = state.user.unitId;*/
  356. var state = "3";
  357. var date = null;
  358. var obj = {
  359. /*unitId: unitId,
  360. userId: staffId,
  361. notice_title: notice_title,*/
  362. universalid: staffId,
  363. type: type,
  364. state: state,
  365. pSize: APP.PageSize,
  366. p: pageNo3
  367. };
  368. app.ajax(serviceId, obj, function(data) {
  369. //服务器返回响应
  370. console.log(JSON.stringify(data))
  371. var result = data.returnParams;
  372. var totalRow = data.total;
  373. var totalPage = Math.ceil(totalRow / APP.PageSize);
  374. var list = data.list;
  375. console.log(list.length);
  376. if(list.length > 0) {
  377. vmC.item3 = vmC.item3.concat(convert(list));
  378. }
  379. if(totalPage == 0 || totalPage == 1) {
  380. self.endPullUpToRefresh(true);
  381. } else {
  382. self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
  383. }
  384. if(pageNo == 1 && totalPage > 1)
  385. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  386. pageNo3 = pageNo3 + 1;
  387. });
  388. }
  389. function convert(items) {
  390. var newItems = [];
  391. items.forEach(function(item) {
  392. if(item.state == 1) {
  393. state = "正常";
  394. }
  395. if(item.state == 2) {
  396. state = "撤销";
  397. }
  398. if(item.state == 3) {
  399. state = "完结";
  400. }
  401. if(item.wheacar == 1) {
  402. wheacar = "是";
  403. }
  404. if(item.wheacar == 2) {
  405. wheacar = "否";
  406. }
  407. var date = new Date();
  408. var mon = date.getMonth() + 1;
  409. var day = date.getDate();
  410. var nowDay = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
  411. newItems.push({
  412. tripid: item.tripid,
  413. address: item.address,
  414. wheacar: wheacar,
  415. name2: item.name2,
  416. state: state,
  417. bengintime: item.bengintime,
  418. endtime: item.endtime,
  419. triptotalday: item.triptotalday,
  420. });
  421. });
  422. return newItems;
  423. }
  424. // window.addEventListener('refresh', function(e) { //执行刷新
  425. // location.reload();
  426. //
  427. // });
  428. function open_detail(item) {
  429. mui.openWindow({
  430. url: 'getdetail.html',
  431. id: 'getdetail.html',
  432. extras:{'tripid':item.tripid,'state':item.state}
  433. })
  434. }
  435. </script>
  436. </body>
  437. </html>