trip_approve_list.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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: #00c4cb;
  42. }
  43. .mui-segmented-control {
  44. border: 1px solid #00c4cb;
  45. }
  46. .mui-segmented-control .mui-control-item {
  47. border-left: 1px solid #00c4cb;
  48. color: #00C4CB;
  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: #00c4cb;
  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. //statusBarBackground: '#FFFFFF', //设置状态栏颜色,仅iOS可用
  268. // preloadLimit:5,
  269. });
  270. });
  271. })(mui);
  272. var vmA = new Vue({
  273. el: '#pullrefresh',
  274. data: {
  275. items: [] //列表信息流数据
  276. }
  277. });
  278. var vmC = new Vue({
  279. el: '#items3',
  280. data: {
  281. item3: [] //列表信息流数据
  282. }
  283. });
  284. /**
  285. * 下拉刷新具体业务实现
  286. */
  287. function reloadNews(ul, self) {
  288. var dataType = self.element.id;
  289. if("pullrefresh" == dataType) {
  290. pageNo = 1;
  291. vmA.items = [];
  292. addData(ul, self);
  293. } else if("pullrefresh3" == dataType) {
  294. pageNo3 = 1;
  295. vmC.item3 = [];
  296. addData3(ul, self);
  297. }
  298. }
  299. var type = "get";
  300. /**
  301. * 上拉加载具体业务实现
  302. */
  303. function pullupRefresh(ul, self) {
  304. var dataType = self.element.id;
  305. //console.log(dataType + "======");
  306. if("pullrefresh" == dataType) {
  307. addData(ul, self);
  308. } else if("pullrefresh3" == dataType) {
  309. addData3(ul, self);
  310. }
  311. }
  312. function addData(ul, self) {
  313. var url = API.API_URL();
  314. var serviceId = "oa_2018V001PHONE_tripList";
  315. var state = app.getState(); //获取登陆信息
  316. var staffId = state.user.useId; //获取登录id
  317. /*var staffId = state.user.useId;
  318. var unitId = state.user.unitId;*/
  319. var state = "1";
  320. var obj = {
  321. /*unitId: unitId,
  322. userId: staffId,
  323. notice_title: notice_title,*/
  324. universalid: staffId,
  325. type: type,
  326. state: state,
  327. pSize: APP.PageSize,
  328. p: pageNo
  329. };
  330. app.ajax(serviceId, obj, function(data) {
  331. //服务器返回响应
  332. console.log(JSON.stringify(data))
  333. var result = data.returnParams;
  334. var totalRow = data.total;
  335. var totalPage = Math.ceil(totalRow / APP.PageSize);
  336. var list = data.list;
  337. console.log(list.length + "===========" + totalPage);
  338. if(list.length > 0) {
  339. vmA.items = vmA.items.concat(convert(list));
  340. }
  341. if(totalPage == 0 || totalPage == 1) {
  342. self.endPullUpToRefresh(true);
  343. } else {
  344. self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
  345. }
  346. if(pageNo == 1 && totalPage > 1)
  347. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  348. pageNo = pageNo + 1;
  349. });
  350. }
  351. function addData3(ul, self) {
  352. var url = API.API_URL();
  353. var serviceId = "oa_2018V001PHONE_tripList";
  354. var state = app.getState(); //获取登陆信息
  355. var staffId = state.user.useId; //获取登录id
  356. /*var staffId = state.user.useId;
  357. var unitId = state.user.unitId;*/
  358. var state = "3";
  359. var date = null;
  360. var obj = {
  361. /*unitId: unitId,
  362. userId: staffId,
  363. notice_title: notice_title,*/
  364. universalid: staffId,
  365. type: type,
  366. state: state,
  367. pSize: APP.PageSize,
  368. p: pageNo3
  369. };
  370. app.ajax(serviceId, obj, function(data) {
  371. //服务器返回响应
  372. console.log(JSON.stringify(data))
  373. var result = data.returnParams;
  374. var totalRow = data.total;
  375. var totalPage = Math.ceil(totalRow / APP.PageSize);
  376. var list = data.list;
  377. console.log(list.length);
  378. if(list.length > 0) {
  379. vmC.item3 = vmC.item3.concat(convert(list));
  380. }
  381. if(totalPage == 0 || totalPage == 1) {
  382. self.endPullUpToRefresh(true);
  383. } else {
  384. self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
  385. }
  386. if(pageNo == 1 && totalPage > 1)
  387. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  388. pageNo3 = pageNo3 + 1;
  389. });
  390. }
  391. function convert(items) {
  392. var newItems = [];
  393. items.forEach(function(item) {
  394. if(item.state == 1) {
  395. state = "正常";
  396. }
  397. if(item.state == 2) {
  398. state = "撤销";
  399. }
  400. if(item.state == 3) {
  401. state = "完结";
  402. }
  403. if(item.wheacar == 1) {
  404. wheacar = "是";
  405. }
  406. if(item.wheacar == 2) {
  407. wheacar = "否";
  408. }
  409. var date = new Date();
  410. var mon = date.getMonth() + 1;
  411. var day = date.getDate();
  412. var nowDay = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
  413. newItems.push({
  414. tripid: item.tripid,
  415. address: item.address,
  416. wheacar: wheacar,
  417. name2: item.name2,
  418. state: state,
  419. bengintime: item.bengintime,
  420. endtime: item.endtime,
  421. triptotalday: item.triptotalday,
  422. });
  423. });
  424. return newItems;
  425. }
  426. // window.addEventListener('refresh', function(e) { //执行刷新
  427. // location.reload();
  428. //
  429. // });
  430. function open_detail(item) {
  431. mui.openWindow({
  432. url: 'getdetail.html',
  433. id: 'getdetail.html',
  434. extras:{'tripid':item.tripid,'state':item.state}
  435. })
  436. }
  437. </script>
  438. </body>
  439. </html>