| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-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">
- <title>我收到的审批</title>
- <link href="../../css/mui.min.css" rel="stylesheet" />
- <link href="../../css/mui.picker.css" rel="stylesheet" />
- <link href="../../css/mui.poppicker.css" rel="stylesheet" />
- <link href="../../css/OA-style.css" rel="stylesheet" />
- <style type="text/css">
- .mui-bar-nav {
- box-shadow: 0 0px 0px #ccc;
- }
-
- .mui-table-view:after {
- height: 0
- }
-
- .mui-table-view:before {
- height: 0
- }
-
- .mui-table-view-cell {
- position: static;
- }
-
- .mui-table-view {
- position: static;
- }
-
- .mui-btn,
- button,
- input[type=button],
- input[type=reset],
- input[type=submit] {
- padding: 5px 10px;
- margin-top: 10px;
- }
-
- body {
- background-color: #efeff4;
- }
-
- .mui-segmented-control .mui-control-item.mui-active {
- background-color: #00c4cb;
- }
-
- .mui-segmented-control {
- border: 1px solid #00c4cb;
- }
-
- .mui-segmented-control .mui-control-item {
- border-left: 1px solid #00c4cb;
- color: #00C4CB;
- }
-
- .mui-bar~.mui-content .mui-fullscreen {
- top: 44px;
- height: auto;
- }
-
- .mui-pull-top-tips {
- position: absolute;
- top: -20px;
- left: 50%;
- margin-left: -25px;
- width: 40px;
- height: 40px;
- border-radius: 100%;
- z-index: 1;
- }
-
- .mui-bar~.mui-pull-top-tips {
- top: 24px;
- }
-
- .mui-pull-top-wrapper {
- width: 42px;
- height: 42px;
- display: block;
- text-align: center;
- background-color: #efeff4;
- border: 1px solid #ddd;
- border-radius: 25px;
- background-clip: padding-box;
- box-shadow: 0 4px 10px #bbb;
- overflow: hidden;
- }
-
- .mui-pull-top-tips.mui-transitioning {
- -webkit-transition-duration: 200ms;
- transition-duration: 200ms;
- }
-
- .mui-pull-top-tips .mui-pull-loading {
- /*-webkit-backface-visibility: hidden;
- -webkit-transition-duration: 400ms;
- transition-duration: 400ms;*/
- margin: 0;
- }
-
- .mui-pull-top-wrapper .mui-icon,
- .mui-pull-top-wrapper .mui-spinner {
- margin-top: 7px;
- }
-
- .mui-pull-top-wrapper .mui-icon.mui-reverse {
- /*-webkit-transform: rotate(180deg) translateZ(0);*/
- }
-
- .mui-pull-bottom-tips {
- text-align: center;
- background-color: #efeff4;
- font-size: 15px;
- line-height: 40px;
- color: #777;
- }
-
- .mui-pull-top-canvas {
- overflow: hidden;
- background-color: #fafafa;
- border-radius: 40px;
- box-shadow: 0 4px 10px #bbb;
- width: 40px;
- height: 40px;
- margin: 0 auto;
- }
-
- .mui-pull-top-canvas canvas {
- width: 40px;
- }
-
- .mui-slider-indicator.mui-segmented-control {
- background-color: #efeff4;
- }
-
- .mui-scroll1 {
- z-index: 1;
- width: 100%;
- }
-
- .mui-table-view-cell {
- padding: 0px 0px;
- }
-
- .mui-bar-nav {
- background: #00c4cb;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav" id="login">
- <a class="mui-action-back back mui-pull-left"><img src="../../images/back.png"></a>
- <h1 class="mui-title">我收到的出差审批</h1>
- </header>
- <div class="mui-content">
- <div id="slider" class="mui-slider mui-fullscreen">
- <div style="padding: 10px 10px;">
- <div id="segmentedControl" class="mui-segmented-control">
- <div class="mui-scroll1">
- <a class="mui-control-item mui-active" href="#item1mobile" style="font-size: 16px;">未审批</a>
- <a class="mui-control-item" href="#item3mobile" style="font-size: 16px;">已审批</a>
- </div>
- </div>
- </div>
- <div class="mui-slider-group">
- <div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
- <div class="mui-scroll-wrapper">
- <div id="pullrefresh" class="mui-scroll">
- <ul class="mui-table-view trip_ul tri_top1" id="items1" style="margin-top: 5px;padding: 0px 10px;">
- <li class="mui-table-view-cell tri_li_top" v-for="item in items">
- <!--左边蓝色部分-->
- <div class="tri_li_left right">
- <div class="mui-pull-left tri_li_div1">
- <p class="mui-pull-left tri_li_p">审核批号</p><br/><br/>
- <div class="tri_li_span tri_li_top">{{item.tripid}}</div><br/>
- <div class="iconfont icon-jt_gaotie mui-pull-left tri_li_div2">
- <span>状态:</span><span>{{item.state}}</span>
- </div>
- </div>
- <!--右边边白色部分-->
- <div class="tri_li_right">
- <span class="tri_li_p1"><span style="color: #0EA0A6;">➢ </span>{{item.bengintime}}至{{item.endtime}} 共{{item.triptotalday}}天 </span>
- <hr class="tri_li_hr" />
- <span class="tri_li_p1"><span style="color: #0EA0A6;">♂</span>{{item.name2}}</span>
- <div class="tri_li_cardzh">
- <p class="tri_li_cardzh_p">出差地址:{{item.address}}</p>
- </div>
- <div>
- <button type="button" id="check" class="mui-btn mui-btn-outlined mui-pull-right" @tap="open_detail(item)">查看</button>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <div></div>
- </div>
- </div>
- </div>
- <div id="item3mobile" class="mui-slider-item mui-control-content">
- <div class="mui-scroll-wrapper">
- <div id="pullrefresh3" class="mui-scroll">
- <ul class="mui-table-view trip_ul tri_top1" id="items3" style="margin-top: 5px;padding: 0px 10px;">
- <li class="mui-table-view-cell tri_li_top" v-for="item in item3">
- <!--左边蓝色部分-->
- <div class="tri_li_left right">
- <div class="mui-pull-left tri_li_div1">
- <p class="mui-pull-left tri_li_p">审核批号</p><br/><br/>
- <div class="tri_li_span tri_li_top">{{item.tripid}}</div><br/>
- <div class="iconfont icon-jt_gaotie mui-pull-left tri_li_div2">
- <span>状态:</span><span>{{item.state}}</span>
- </div>
- </div>
- <!--右边边白色部分-->
- <div class="tri_li_right">
- <span class="tri_li_p1"><span style="color: #0EA0A6;">➢ </span>{{item.bengintime}}至{{item.endtime}} 共{{item.triptotalday}}天 </span>
- <hr class="tri_li_hr" />
- <span class="tri_li_p1"><span style="color: #0EA0A6;">♂</span>{{item.name2}}</span>
- <div class="tri_li_cardzh">
- <p class="tri_li_cardzh_p">出差地址:{{item.address}}</p>
- </div>
- <div>
- <button type="button" id="check" class="mui-btn mui-btn-outlined mui-pull-right" @tap="open_detail(item)">查看</button>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <div></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="../../js/mui.min.js"></script>
- <script src="../../js/config.js"></script>
- <script src="../../js/app.js"></script>
- <script src="../../js/jquery-1.11.2.min.js"></script>
- <script src="../../js/vue.min.js"></script>
- <script src="../../js/mui.pullToRefresh.js"></script>
- <script src="../../js/mui.pullToRefresh.material.js"></script>
- <script type="text/javascript">
- mui.init();
- var pageNo = 1;
- var pageNo3 = 1;
- (function($) {
- //初始化单页的区域滚动
- // mui('.mui-scroll-wrapper').scroll();
- //阻尼系数
- // var deceleration = mui.os.ios ? 0.003 : 0.0009;
- // $('.mui-scroll-wrapper').scroll({
- // bounce: false,
- // indicators: true, //是否显示滚动条
- // deceleration: deceleration
- // });
- mui.plusReady(function() {
- var self1 = plus.webview.currentWebview();
- //id = self1.xiaolv_id;
- $.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
- $(pullRefreshEl).pullToRefresh({
- //container: '.list_item',
- down: {
- callback: function() {
- var self = this;
- setTimeout(function() {
- var ul = self.element.querySelector('.mui-table-view');
- reloadNews(ul, self);
- self.endPullDownToRefresh();
- }, 1000); //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
- }
- },
- up: {
- contentrefresh: '正在加载...',
- auto: true, //可选,默认false.自动上拉加载一次
- callback: function() {
- var self = this;
- //console.log(self+"----------");
- // setTimeout(function() {
- var ul = self.element.querySelector('.mui-table-view');
- console.log(pullRefreshEl.id);
- pullupRefresh(ul, self);
- // self.endPullUpToRefresh();
- // }, 1000);
- }
- }
- });
- //statusBarBackground: '#FFFFFF', //设置状态栏颜色,仅iOS可用
- // preloadLimit:5,
- });
- });
- })(mui);
- var vmA = new Vue({
- el: '#pullrefresh',
- data: {
- items: [] //列表信息流数据
- }
- });
- var vmC = new Vue({
- el: '#items3',
- data: {
- item3: [] //列表信息流数据
- }
- });
- /**
- * 下拉刷新具体业务实现
- */
- function reloadNews(ul, self) {
- var dataType = self.element.id;
- if("pullrefresh" == dataType) {
- pageNo = 1;
- vmA.items = [];
- addData(ul, self);
- } else if("pullrefresh3" == dataType) {
- pageNo3 = 1;
- vmC.item3 = [];
- addData3(ul, self);
- }
- }
- var type = "get";
- /**
- * 上拉加载具体业务实现
- */
- function pullupRefresh(ul, self) {
- var dataType = self.element.id;
- //console.log(dataType + "======");
- if("pullrefresh" == dataType) {
- addData(ul, self);
- } else if("pullrefresh3" == dataType) {
- addData3(ul, self);
- }
- }
- function addData(ul, self) {
- var url = API.API_URL();
- var serviceId = "oa_2018V001PHONE_tripList";
- var state = app.getState(); //获取登陆信息
- var staffId = state.user.useId; //获取登录id
- /*var staffId = state.user.useId;
- var unitId = state.user.unitId;*/
- var state = "1";
- var obj = {
- /*unitId: unitId,
- userId: staffId,
- notice_title: notice_title,*/
- universalid: staffId,
- type: type,
- state: state,
- pSize: APP.PageSize,
- p: pageNo
- };
- app.ajax(serviceId, obj, function(data) {
- //服务器返回响应
- console.log(JSON.stringify(data))
- var result = data.returnParams;
- var totalRow = data.total;
- var totalPage = Math.ceil(totalRow / APP.PageSize);
- var list = data.list;
- console.log(list.length + "===========" + totalPage);
- if(list.length > 0) {
- vmA.items = vmA.items.concat(convert(list));
- }
- if(totalPage == 0 || totalPage == 1) {
- self.endPullUpToRefresh(true);
- } else {
- self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- }
- if(pageNo == 1 && totalPage > 1)
- self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
- pageNo = pageNo + 1;
- });
- }
- function addData3(ul, self) {
- var url = API.API_URL();
- var serviceId = "oa_2018V001PHONE_tripList";
- var state = app.getState(); //获取登陆信息
- var staffId = state.user.useId; //获取登录id
- /*var staffId = state.user.useId;
- var unitId = state.user.unitId;*/
- var state = "3";
- var date = null;
- var obj = {
- /*unitId: unitId,
- userId: staffId,
- notice_title: notice_title,*/
- universalid: staffId,
- type: type,
- state: state,
- pSize: APP.PageSize,
- p: pageNo3
- };
- app.ajax(serviceId, obj, function(data) {
- //服务器返回响应
- console.log(JSON.stringify(data))
- var result = data.returnParams;
- var totalRow = data.total;
- var totalPage = Math.ceil(totalRow / APP.PageSize);
- var list = data.list;
- console.log(list.length);
- if(list.length > 0) {
- vmC.item3 = vmC.item3.concat(convert(list));
- }
- if(totalPage == 0 || totalPage == 1) {
- self.endPullUpToRefresh(true);
- } else {
- self.endPullUpToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- }
- if(pageNo == 1 && totalPage > 1)
- self.refresh(true); //调用.refresh(true)方法,可重置上拉加载控件,注意:refresh()中需传入true
- pageNo3 = pageNo3 + 1;
- });
- }
- function convert(items) {
- var newItems = [];
- items.forEach(function(item) {
- if(item.state == 1) {
- state = "正常";
- }
- if(item.state == 2) {
- state = "撤销";
- }
- if(item.state == 3) {
- state = "完结";
- }
- if(item.wheacar == 1) {
- wheacar = "是";
- }
- if(item.wheacar == 2) {
- wheacar = "否";
- }
- var date = new Date();
- var mon = date.getMonth() + 1;
- var day = date.getDate();
- var nowDay = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0" + day : day);
- newItems.push({
- tripid: item.tripid,
- address: item.address,
- wheacar: wheacar,
- name2: item.name2,
- state: state,
- bengintime: item.bengintime,
- endtime: item.endtime,
- triptotalday: item.triptotalday,
- });
- });
- return newItems;
- }
-
- // window.addEventListener('refresh', function(e) { //执行刷新
- // location.reload();
- //
- // });
-
- function open_detail(item) {
- mui.openWindow({
- url: 'getdetail.html',
- id: 'getdetail.html',
- extras:{'tripid':item.tripid,'state':item.state}
- })
- }
- </script>
- </body>
- </html>
|