efficiencyList.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  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/OA-style.css" rel="stylesheet" />
  11. <link href="../../css/myxl.css" rel="stylesheet" />
  12. <style type="text/css">
  13. html,
  14. body {
  15. background-color: #efeff4;
  16. }
  17. .mui-segmented-control .mui-control-item.mui-active {
  18. background-color: #468CF0;
  19. }
  20. .mui-segmented-control {
  21. border: 1px solid #468CF0;
  22. }
  23. .mui-segmented-control .mui-control-item {
  24. border-left: 1px solid #468CF0;
  25. color: #468CF0;
  26. }
  27. .mui-bar~.mui-content .mui-fullscreen {
  28. top: 44px;
  29. height: auto;
  30. }
  31. .mui-pull-top-tips {
  32. position: absolute;
  33. top: -20px;
  34. left: 50%;
  35. margin-left: -25px;
  36. width: 40px;
  37. height: 40px;
  38. border-radius: 100%;
  39. z-index: 1;
  40. }
  41. .mui-bar~.mui-pull-top-tips {
  42. top: 24px;
  43. }
  44. .mui-pull-top-wrapper {
  45. width: 42px;
  46. height: 42px;
  47. display: block;
  48. text-align: center;
  49. background-color: #efeff4;
  50. border: 1px solid #ddd;
  51. border-radius: 25px;
  52. background-clip: padding-box;
  53. box-shadow: 0 4px 10px #bbb;
  54. overflow: hidden;
  55. }
  56. .mui-pull-top-tips.mui-transitioning {
  57. -webkit-transition-duration: 200ms;
  58. transition-duration: 200ms;
  59. }
  60. .mui-pull-top-tips .mui-pull-loading {
  61. /*-webkit-backface-visibility: hidden;
  62. -webkit-transition-duration: 400ms;
  63. transition-duration: 400ms;*/
  64. margin: 0;
  65. }
  66. .mui-pull-top-wrapper .mui-icon,
  67. .mui-pull-top-wrapper .mui-spinner {
  68. margin-top: 7px;
  69. }
  70. .mui-pull-top-wrapper .mui-icon.mui-reverse {
  71. /*-webkit-transform: rotate(180deg) translateZ(0);*/
  72. }
  73. .mui-pull-bottom-tips {
  74. text-align: center;
  75. background-color: #efeff4;
  76. font-size: 15px;
  77. line-height: 40px;
  78. color: #777;
  79. }
  80. .mui-pull-top-canvas {
  81. overflow: hidden;
  82. background-color: #fafafa;
  83. border-radius: 40px;
  84. box-shadow: 0 4px 10px #bbb;
  85. width: 40px;
  86. height: 40px;
  87. margin: 0 auto;
  88. }
  89. .mui-pull-top-canvas canvas {
  90. width: 40px;
  91. }
  92. .mui-slider-indicator.mui-segmented-control {
  93. background-color: #efeff4;
  94. }
  95. .mui-scroll1 {
  96. z-index: 1;
  97. width: 100%;
  98. }
  99. .mui-table-view-cell {
  100. padding: 0px 0px;
  101. }
  102. .mui-bar-nav {
  103. background: #468CF0;
  104. }
  105. </style>
  106. </head>
  107. <body>
  108. <header class="mui-bar mui-bar-nav" id="login">
  109. <a class="mui-action-back back mui-pull-left"><img src="../../images/back.png"></a>
  110. <h1 class="mui-title">我的效率</h1>
  111. </header>
  112. <div class="mui-content">
  113. <div id="slider" class="mui-slider mui-fullscreen">
  114. <div style="padding: 10px 10px;">
  115. <div id="segmentedControl" class="mui-segmented-control">
  116. <div class="mui-scroll1">
  117. <a class="mui-control-item mui-active" href="#item1mobile" style="font-size: 16px;">我发起的</a>
  118. <a class="mui-control-item" href="#item2mobile" style="font-size: 16px;">进行中</a>
  119. <a class="mui-control-item" href="#item3mobile" style="font-size: 16px;">已办结</a>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="mui-slider-group">
  124. <div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
  125. <div class="mui-scroll-wrapper">
  126. <div class="mui-scroll" id="pullrefresh">
  127. <ul class="mui-table-view" id="items1">
  128. <li class="mui-table-view-cell" :data-id="item.xiaolv_id" v-for="item in item1" @tap="open_detail(item)" style="margin: 0px 10px;">
  129. <div class="list_gg">
  130. <div class="list_gg_item mui-clearfix">
  131. <h1>{{item.duban_name}}</h1>
  132. <h2 style="font-size: 16px;overflow:hidden; text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:3;" >{{item.content}}</h2>
  133. <div style="overflow: hidden;"><h2 style="font-size: 16px;float: left;" v-html="item.state"></h2>
  134. <h2 style="font-size: 16px; float: right;" v-html="item.huanji"></h2></div>
  135. <h3 class="mui-pull-right" >{{item.duban_date}}至{{item.yujing_date}}</h3>
  136. </div>
  137. </div>
  138. </li>
  139. </ul>
  140. </div>
  141. </div>
  142. </div>
  143. <div id="item2mobile" class="mui-slider-item mui-control-content ">
  144. <div class="mui-scroll-wrapper">
  145. <div class="mui-scroll" id="pullrefresh2">
  146. <ul class="mui-table-view" id="items2">
  147. <li class="mui-table-view-cell" :data-id="item.xiaolv_id" v-for="item in item2" @tap="open_detail(item)" style="margin: 0px 10px;">
  148. <div class="list_gg">
  149. <div class="list_gg_item mui-clearfix">
  150. <h1>{{item.duban_name}}</h1>
  151. <h2 style="font-size: 16px;overflow:hidden; text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:3;" >{{item.content}}</h2>
  152. <div style="overflow: hidden;"><h2 style="font-size: 16px;float: left;" v-html="item.state"></h2>
  153. <h2 style="font-size: 16px; float: right;" v-html="item.huanji"></h2></div>
  154. <h3 class="mui-pull-right" >{{item.duban_date}}至{{item.yujing_date}}</h3>
  155. </div>
  156. </div>
  157. </li>
  158. </ul>
  159. </div>
  160. </div>
  161. </div>
  162. <div id="item3mobile" class="mui-slider-item mui-control-content ">
  163. <div class="mui-scroll-wrapper">
  164. <div class="mui-scroll" id="pullrefresh3">
  165. <ul class="mui-table-view" id="items3">
  166. <li class="mui-table-view-cell" :data-id="item.xiaolv_id" v-for="item in item3" @tap="open_detail(item)"style="margin: 0px 10px;">
  167. <div class="list_gg">
  168. <div class="list_gg_item mui-clearfix">
  169. <h1>{{item.duban_name}}</h1>
  170. <h2 style="font-size: 16px;overflow:hidden; text-overflow:ellipsis;display:-webkit-box; -webkit-box-orient:vertical;-webkit-line-clamp:3;" >{{item.content}}</h2>
  171. <div style="overflow: hidden;"><h2 style="font-size: 16px;float: left;" v-html="item.state"></h2>
  172. <h2 style="font-size: 16px; float: right;" v-html="item.huanji"></h2></div>
  173. <h3 class="mui-pull-right" >{{item.duban_date}}至{{item.yujing_date}}</h3>
  174. </div>
  175. </div>
  176. </li>
  177. </ul>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <script type="text/javascript" src="../../js/jquery-1.11.2.min.js"></script>
  185. <script src="../../js/mui.min.js"></script>
  186. <script src="../../js/config.js"></script>
  187. <script src="../../js/app.js"></script>
  188. <script src="../../js/vue.min.js"></script>
  189. <script src="../../js/mui.pullToRefresh.js"></script>
  190. <script src="../../js/mui.pullToRefresh.material.js"></script>
  191. <script>
  192. mui.init();
  193. var pageNo = 1;
  194. var pageNo2 = 1;
  195. var pageNo3 = 1;
  196. (function($) {
  197. //初始化单页的区域滚动
  198. mui('.mui-scroll-wrapper').scroll();
  199. //阻尼系数
  200. var deceleration = mui.os.ios ? 0.003 : 0.0009;
  201. $('.mui-scroll-wrapper').scroll({
  202. bounce: false,
  203. indicators: true, //是否显示滚动条
  204. deceleration: deceleration
  205. });
  206. mui.plusReady(function() {
  207. var self1 = plus.webview.currentWebview();
  208. id = self1.xiaolv_id;
  209. $.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
  210. $(pullRefreshEl).pullToRefresh({
  211. //container: '.list_item',
  212. down: {
  213. // style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
  214. // color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
  215. // height: '100px', //可选,默认50px.下拉刷新控件的高度,
  216. // range: '200px', //可选 默认100px,控件可下拉拖拽的范围
  217. // offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
  218. // // auto: true, //可选,默认false.首次加载自动上拉刷新一次
  219. callback: function() {
  220. var self = this;
  221. setTimeout(function() {
  222. var ul = self.element.querySelector('.mui-table-view');
  223. reloadNews(ul, self);
  224. self.endPullDownToRefresh();
  225. }, 1000); //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
  226. }
  227. },
  228. up: {
  229. contentrefresh: '正在加载...',
  230. auto: true, //可选,默认false.自动上拉加载一次
  231. callback: function() {
  232. var self = this;
  233. setTimeout(function() {
  234. var ul = self.element.querySelector('.mui-table-view');
  235. console.log(pullRefreshEl.id);
  236. pullupRefresh(ul, self);
  237. self.endPullUpToRefresh();
  238. }, 1000);
  239. }
  240. }
  241. });
  242. //statusBarBackground: '#D20000', //设置状态栏颜色,仅iOS可用
  243. // preloadLimit:5,
  244. });
  245. });
  246. })(mui);
  247. var vmA = new Vue({
  248. el: '#pullrefresh',
  249. data: {
  250. item1: [] //列表信息流数据
  251. }
  252. });
  253. var vmB = new Vue({
  254. el: '#items2',
  255. data: {
  256. item2: [] //列表信息流数据
  257. }
  258. });
  259. var vmC = new Vue({
  260. el: '#items3',
  261. data: {
  262. item3: [] //列表信息流数据
  263. }
  264. });
  265. /**
  266. * 下拉刷新具体业务实现
  267. */
  268. function reloadNews(ul,self) {
  269. /*vmA.item1 = [];
  270. addData();*/
  271. var dataType = self.element.id;
  272. if("pullrefresh" == dataType) {
  273. pageNo = 1;
  274. vmA.item1 = [];
  275. addData(ul, self);
  276. } else if("pullrefresh2" == dataType) {
  277. pageNo2 = 1;
  278. vmB.item2 = [];
  279. addData2(ul, self);
  280. } else if("pullrefresh3" == dataType) {
  281. pageNo3 = 1;
  282. vmC.item3 = [];
  283. addData3(ul, self);
  284. }
  285. }
  286. /**
  287. * 上拉加载具体业务实现
  288. */
  289. function pullupRefresh(ul, self) {
  290. var dataType = self.element.id;
  291. if("pullrefresh" == dataType) {
  292. addData(ul, self);
  293. } else if("pullrefresh2" == dataType) {
  294. addData2(ul, self);
  295. } else if("pullrefresh3" == dataType) {
  296. addData3(ul, self);
  297. }
  298. }
  299. function addData(ul, self) {
  300. var state3= mui('#state');//状态显示
  301. var url = API.API_URL();
  302. var serviceId = "oa_efficiency_2018V0010PHONE001";
  303. var state = app.getState(); //获取登陆信息
  304. var userId = state.user.useId;
  305. var state2 = ""; //督办状态
  306. var obj = {
  307. userId: userId,
  308. pSize: APP.PageSize,
  309. p: pageNo,
  310. state:state2
  311. };
  312. app.ajax(serviceId,obj, function(data) {
  313. //服务器返回响应
  314. console.log(JSON.stringify(data))
  315. var result = data.returnParams;
  316. var totalRow = data.total;
  317. //var totalPage = data.current;
  318. var totalPage = Math.ceil(totalRow / APP.PageSize);
  319. console.log("=====总页数=====" + totalPage);
  320. var list = data.list;
  321. console.log(list.length);
  322. if(list.length > 0) {
  323. vmA.item1 = vmA.item1.concat(convert(list));
  324. }
  325. if(totalPage==0||totalPage==1){
  326. self.endPullUpToRefresh(true);
  327. }else{
  328. self.endPullUpToRefresh(totalPage == pageNo);//参数为true代表没有更多数据了。
  329. }
  330. if(pageNo == 1 && totalPage > 1)
  331. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  332. pageNo = pageNo + 1;
  333. });
  334. }
  335. function addData2(ul, self) {
  336. var url = API.API_URL();
  337. var serviceId = "oa_efficiency_2018V0010PHONE001";
  338. var state = app.getState(); //获取登陆信息
  339. var userId = state.user.useId;
  340. var state2 = "0"; //督办状态
  341. var obj = {
  342. userId: userId,
  343. pSize: APP.PageSize,
  344. p: pageNo2,
  345. state:state2
  346. };
  347. app.ajax(serviceId,obj, function(data) {
  348. //服务器返回响应
  349. console.log(JSON.stringify(data))
  350. var result = data.returnParams;
  351. var totalRow = data.total;
  352. //var totalPage = data.current;
  353. var totalPage = Math.ceil(totalRow / APP.PageSize);
  354. console.log("=====总页数=====" + totalPage);
  355. var list = data.list;
  356. console.log(list.length);
  357. if(list.length > 0) {
  358. vmB.item2 = vmB.item2.concat(convert(list));
  359. }
  360. if(totalPage==0||totalPage==1){
  361. self.endPullUpToRefresh(true);
  362. }else{
  363. self.endPullUpToRefresh(totalPage == pageNo);//参数为true代表没有更多数据了。
  364. }
  365. if(pageNo2 == 1 && totalPage > 1)
  366. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  367. pageNo2 = pageNo2 + 1;
  368. });
  369. }
  370. function addData3(ul, self) {
  371. var url = API.API_URL();
  372. var serviceId = "oa_efficiency_2018V0010PHONE001";
  373. var state = app.getState(); //获取登陆信息
  374. var userId = state.user.useId;
  375. var state2 = "2"; //督办状态
  376. var obj = {
  377. userId: userId,
  378. pSize: APP.PageSize,
  379. p: pageNo3,
  380. state:state2
  381. };
  382. app.ajax(serviceId,obj, function(data) {
  383. //服务器返回响应
  384. console.log(JSON.stringify(data))
  385. var result = data.returnParams;
  386. var totalRow = data.total;
  387. //var totalPage = data.current;
  388. var totalPage = Math.ceil(totalRow / APP.PageSize);
  389. console.log("=====总页数=====" + totalPage);
  390. var list = data.list;
  391. console.log(list.length);
  392. if(list.length > 0) {
  393. vmC.item3 = vmC.item3.concat(convert(list));
  394. }
  395. if(totalPage==0||totalPage==1){
  396. self.endPullUpToRefresh(true);
  397. }else{
  398. self.endPullUpToRefresh(totalPage == pageNo);//参数为true代表没有更多数据了。
  399. }
  400. if(pageNo3 == 1 && totalPage > 1)
  401. self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
  402. pageNo3 = pageNo3 + 1;
  403. });
  404. }
  405. /**
  406. * 1、将服务端返回数据,转换成前端需要的格式
  407. * 2、若服务端返回格式和前端所需格式相同,则不需要改功能
  408. *
  409. * @param {Array} item1
  410. */
  411. function convert(items) {
  412. var newItems = [];
  413. var state2 = "";
  414. items.forEach(function(item) {
  415. var date = item.yujing_date;
  416. var yujing = new Date(Date.parse(date .replace(/-/g,"/")));
  417. if (new Date() > yujing && "0" >= item.state) {
  418. state2 = '状态:<font color="red">预警</font>';
  419. } else if("0" ==item.state || "1" == item.state ) {
  420. state2 = '状态:<font color="#FFB400">进行中</font>';
  421. } else if("2" ==item.state ) {
  422. state2 = '状态:<font color="#008000">已办结</font>';
  423. }
  424. var huanji = item.huanji;
  425. if("1"==huanji) {
  426. huanji = '缓急:<font color="#008000">普通</font>';
  427. }
  428. if("2"==huanji) {
  429. huanji = '缓急:<font color="#f60">紧急</font>';
  430. }
  431. if("3"==huanji) {
  432. huanji = '缓急:<font color="red">特急</font>';
  433. }
  434. newItems.push({
  435. xiaolv_id: item.xiaolv_id,
  436. duban_name:item.duban_name,
  437. title: item.duban_name,
  438. duban_date:item.duban_date,
  439. yujing_date:item.yujing_date,
  440. state:state2,
  441. huanji:huanji,
  442. content: item.content == null ? "" : item.content.substr(0, 70)
  443. });
  444. });
  445. return newItems;
  446. }
  447. /**
  448. * 打开督办详情
  449. *
  450. * @param {Object} item 当前点击的督办对象
  451. */
  452. function open_detail(item) {
  453. mui.openWindow({
  454. url: '../../page/efficiency/efficiencyInfo.html',
  455. id: 'efficiencyInfo.html',
  456. extras:{'xiaolv_id':item.xiaolv_id}
  457. })
  458. }
  459. function endPull(totalPage,pageNo){
  460. if(totalPage==0||totalPage==1){
  461. mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
  462. }else{
  463. mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage==pageNo); //参数为true代表没有更多数据了。
  464. }
  465. if(pageNo==1){
  466. mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
  467. }
  468. pageNo = pageNo + 1;
  469. return pageNo;
  470. }
  471. </script>
  472. </body>
  473. </html>