| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>工单列表</title>
- <meta name="viewport" content="width=device-width, initial-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">
- <link href="../css/mui.min.css" rel="stylesheet" />
- <link rel="stylesheet" href="../css/iconfont.css" />
- <!-- <link rel="stylesheet" href="../css/inits.css" />-->
- <style>
- .mui-bar-popover {
- width: 30%;
- }
-
- .mui-popover.mui-bar-popover .mui-table-view {
- width: 100%;
- }
-
- .san {
- font-size: 14px;
- margin-right: 5px
- }
-
- .nav_a {
- border-right: 1px solid #ccc;
- }
-
- .time {
- text-align: right;
- }
-
- .mui-table-view .mui-media-object {
- /* line-height: 71px; */
- max-width: 80px;
- height: 80px;
- }
-
- input[type=search] {
- border: 1px solid #ccc;
- border-radius: 18px;
- background-color: rgb(255, 255, 255);
- }
- </style>
- </head>
- <body>
- <div class="mui-content mui-content mui-scroll-wrapper" id="pullrefresh">
- <div class="mui-scroll">
- <ul class="mui-table-view" id="OA_task_2">
- <li class="mui-table-view-cell mui-media">
- <div class="mui-slider-right mui-disabled">
- <a class="mui-btn mui-btn-grey">处理</a>
- </div>
- <div class="mui-slider-handle">
- <div class="mui-table-cell mui-col-xs-10">
- <h4 class="mui-ellipsis">信息化推进办公室张彦合同付款信息化</h4>
- <h5>申请人:李四</h5>
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
- <script src="../js/mui.min.js"></script>
- <script src="../js/zepto.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <script src="../Script/Common/huayi.http.js"></script>
- <script type="text/javascript">
- var page = 1; //页数
- var pageSize = 10; //每页显示条目
- var total; //数据总条数
- mui.init({
- swipeBack: false,
- pullRefresh: {
- container: '#pullrefresh',
- up: {
- contentrefresh: "正在加载...", //可选,正在加载状态时,上拉加载控件上显示的标题内容
- contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
- callback: pullupRefresh
- }
- }
- });
- Ajax();
- //下拉刷新
- function pullupRefresh() {
- setTimeout(function() {
- mui('#pullrefresh').pullRefresh().endPullupToRefresh((page++ >= Math.ceil(total / 10)));
- $.ajax({
- url: huayi.config.callcenter_url + 'WxLogin/GetList',
- data: {
- openid: helper.cookies.get("openid"), //微信openid
- page:page,
- pagesize:pageSize
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- console.log(data);
- $('<li class="mui-table-view-cell mui-media order" data-index="'+n.WorkOrderID+'">' +
- '<div class = "mui-slider-right mui-disabled" >' +
- '<a class = "mui-btn mui-btn-grey" > 处理 </a></div >' +
- '<div class = "mui-slider-handle" >' +
- '<div class = "mui-table-cell mui-col-xs-10" > ' +
- '<h4 class = "mui-ellipsis" > 信息化推进办公室张彦合同付款信息化 </h4> ' +
- '<h5 > 申请人: 李四 </h5>' +
- '</div >' +
- '</div> ' +
- '</li > ').appendTo('#OA_task_2 ');
- //工单跳转
- $('.order').on('tap', function() {
- var index = $(this).attr('data-index');
- window.location.href = "Schedule.html?id="+index;
- });
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }, 1000);
- }
- //获取数据
- function Ajax() {
- $.ajax({
- url: huayi.config.callcenter_url + 'WxLogin/GetList',
- data: {
- openid: helper.cookies.get("openid"), //微信openid ,
- page:page,
- pagesize:pageSize
- },
- async: true,
- dataType: 'json',
- type: 'get', //HTTP请求类型
- success: function(data) {
- // var con=JSON.parse(data);
- // total=con.total;
- total = data.total;
- console.log(data);
- $(data.rows).each(function(i,n){
- $('<li class="mui-table-view-cell order" data-index="'+n.ID+'">' +
- '<div class = "mui-slider-right mui-disabled" >' +
- '<a class = "mui-btn mui-btn-grey" > 处理 </a></div >' +
- '<div class = "mui-slider-handle" >' +
- '<div class = "mui-table-cell mui-col-xs-10" > ' +
- '<h4 class = "mui-ellipsis" > 信息化推进办公室张彦合同付款信息化 </h4> ' +
- '<h5 > 申请人: 李四 </h5>' +
- '</div >' +
- '</div> ' +
- '</li > ').appendTo('#OA_task_2 ');
- })
-
- //工单跳转
- $('.order').on('tap', function() {
- var index = $(this).attr('data-index');
- window.location.href = "Schedule.html?id="+index;
- });
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- })
- }
- //右滑动效果
- var btnArray = ['确认', '取消'];
- //第二个demo,向左拖拽后显示操作图标,释放后自动触发的业务逻辑
- $('#OA_task_2').on('slideright', '.mui-table-view-cell', function(event) {
- var elem = this;
- var li = elem.parentNode.parentNode;
- mui.confirm('确认删除该条记录?', 'Hello MUI', btnArray, function(e) {
- if(e.index == 0) {
- li.parentNode.removeChild(li);
- } else {
- setTimeout(function() {
- $.swipeoutClose(li);
- }, 0);
- }
- });;
- });
- </script>
- </body>
- </html>
|