| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <!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/OA-style.css" rel="stylesheet" />
- <link href="../../../css/mui.picker.css" rel="stylesheet" />
- <link href="../../../css/mui.picker.all.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="../../../css/mui.picker.min.css" />
-
- </head>
- <body>
-
- <header class="mui-bar mui-bar-nav" id="login">
- <a href="" class="mui-action-back back mui-pull-left"><img src="../../../images/back.png"></a>
- <h1 class="mui-title" id="title">订单管理</h1>
- <a id="menu" class="mui-action-menu mui-icon mui-pull-right" href="#topPopover"><img src="../../../images/dd_search.png" style="width: 25px;margin-top: -2px;"></a>
- </header>
- <div class="mui-content" >
- <!--<div id="search" style="display: none;">
- <div class="mui-input-row" style="margin:0px 0 0px 10px;position: relative; top: 15px;">
- <input type="text" id="searchname" style="width: 80%;" placeholder="账户名称"/> <input type="button" style="width: 15%;" id="namesearch" value="搜索"/><br />
- </div>
- <div class="mui-content-padded">
- <h5 class="mui-content-padded"></h5>
- <button id='demo6' data-options='{"type":"date"}' class="btn mui-btn mui-btn-block">选择日期 ...</button>
- <div id='result' class="ui-alert"></div>
- </div>
- </div>-->
-
- <div id="topPopover" class="mui-popover">
- <div class="mui-popover-arrow"></div>
- <div class="mui-scroll-wrapper">
- <div class="mui-scroll">
- <ul class="mui-table-view">
- <li class="mui-table-view-cell">
- <a href="#"><div class="mui-input-row mui-search">
- <input type="search" id="searchname" class="mui-input-clear" placeholder="账户名称">
- </div></a>
- </li>
- <li class="mui-table-view-cell">
- <div class="mui-content-padded">
- <h5 class="mui-content-padded"></h5>
- <button id='demo6' class="btn mui-btn mui-btn-block" onclick="searchtime()">
- <span id="riqi">选择日期 ...</span>
- </button>
- <div id='result' class="ui-alert"></div>
- </div>
- </li>
- <li class="mui-button-row">
- <button type="button" class="mui-btn mui-btn-primary" id="save">查找</button>
- <button type="button" class="mui-btn mui-btn-primary" id="saveall">查找全部</button>
- </li>
- </ul>
- </div>
- </div>
- </div>
-
- <div id="pullrefresh" class="mui-content mui-scroll-wrapper" style="">
- <div style="background-color: #FFFFFF;margin-top: 12px;padding: 10px 20px;">
- <div class="mui-row" >
- <div class="mui-col-sm-4">
- <span style="font-size: 12px;">早餐共 :</span>
- <h3 style="color: #2FA8EC;" id="zaocantotal"> <span style="font-size: 15px;">份</span></h3>
- </div>
- <div class="mui-col-sm-4">
- <span style="font-size: 12px;">午餐共 :</span>
- <h3 style="color: #2FA8EC;" id="wucantotal"> <span style="font-size: 15px;">份</span></h3>
- </div>
- <div class="mui-col-sm-4">
- <span style="font-size: 12px;">晚餐共 :</span>
- <h3 style="color: #2FA8EC;" id="wancantotal"> <span style="font-size: 15px;">份</span></h3>
- </div>
- </div>
- </div>
-
- <div class="mydd_div" v-for="item in items" style="position: relative ;">
- <div class="mydd_div8">
- <div class="mydd_div1">{{item.name}} > </div>
- <div class="mydd_div2">已花费</div>
- </div>
- <div class="mydd_div3">
- <div class="mydd_div4"><img src="../../../images/dd_img2.png" width="40px"></div>
- <div class="mydd_div5">订单内容:{{item.content}}
- </div>
- <div class="mydd_div6">¥{{item.cost}}
- </div>
- </div>
- <div class="mydd_div7" style="position: absolute;bottom: 10px;right: 16px; ">{{item.date}}</div>
- </div>
- <div></div>
- <!--右上角弹出菜单-->
- <!--<div id="topPopover" class="mui-popover">
- <div class="mui-popover-arrow"></div>
- <div class="mui-scroll-wrapper">
- <div class="mui-scroll">
- <ul class="mui-table-view">
- <li class="mui-table-view-cell">
- <a href="#"><div class="mui-input-row mui-search">
- <input type="search" id="searchname" class="mui-input-clear" placeholder="账户名称">
- </div></a>
- </li>
- <li class="mui-table-view-cell">
- <div class="mui-content-padded">
- <h5 class="mui-content-padded"></h5>
- <button id='demo6' data-options='{"type":"date"}' class="btn mui-btn mui-btn-block">选择日期 ...</button>
- <div id='result' class="ui-alert"></div>
- </div>
- </li>
-
- </ul>
- </div>
- </div>
- </div>-->
- </div>
- </div>
- <script type="text/javascript" src="../../../js/jquery-1.11.2.min.js"></script>
- <script src="../../../js/mui.min.js"></script>
- <script src="../../../js/config.js"></script>
- <script src="../../../js/app.js"></script>
- <script src="../../../js/dj/article/list.js"></script>
- <script src="../../../js/vue.min.js"></script>
- <script>
-
- //选取时间
- function searchtime() {
- var dDate = new Date();
- dDate.setFullYear(2014, 7, 16);
- var minDate = new Date();
- minDate.setFullYear(2010, 0, 1);
- var maxDate = new Date();
- maxDate.setFullYear(2016, 11, 31);
- plus.nativeUI.pickDate(function(e) {
- var d = e.date;
- var month=d.getMonth() + 1;
- if(month < 10){
- month= "0"+ month;
- }
- var day=d.getDate();
- if(day < 10){
- day= "0"+ day;
- }
- var a = d.getFullYear() + "-" + month + "-" + day;
- document.getElementById("riqi").innerHTML=a;
- }, {
- title: "请选择日期",
- date: dDate,
- minDate: minDate,
- maxDate: maxDate
- });
- }
-
- var pageDetail = null;
- mui.init({
- pullRefresh: {
- container: '#pullrefresh',
- down: {
- style: 'circle', //必选,下拉刷新样式,目前支持原生5+ ‘circle’ 样式
- color: '#2BD009', //可选,默认“#2BD009” 下拉刷新控件颜色
- height: '50px', //可选,默认50px.下拉刷新控件的高度,
- range: '100px', //可选 默认100px,控件可下拉拖拽的范围
- offset: '0px', //可选 默认0px,下拉刷新控件的起始位置
- // auto: true, //可选,默认false.首次加载自动上拉刷新一次
- callback: reloadNews //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
- },
- up: {
- contentrefresh: '正在加载...',
- auto: true, //可选,默认false.自动上拉加载一次
- callback: pullupRefresh
- }
- },
- statusBarBackground: '#FFFFFF', //设置状态栏颜色,仅iOS可用
- // preloadLimit:5,
- });
- var vmA = new Vue({
- el: '#pullrefresh',
- data: {
- items: [] //列表信息流数据
- }
- });
-
-
- /**
- * 下拉刷新具体业务实现
- */
- function reloadNews() {
- pageNo = 1;
- vmA.items = [];
- addData();
- }
- var pageNo = 1;
- //var type = 0;
- /**
- * 上拉加载具体业务实现
- */
- function pullupRefresh() {
- //接受上个页面传递的appliance_info_type和appliance_info_id的值
- addData();
- }
- function addData() {
- var url = API.API_URL();
- var serviceId = "oa_2017V001PHONE_orderList";
- var state = app.getState(); //获取登陆信息
- var searchname=null;
- var time=null;
- /*var staffId = state.user.useId;
- var unitId = state.user.unitId;
- var notice_title = "";*/
- var obj = {
- /*unitId: unitId,
- userId: staffId,
- notice_title: notice_title,*/
- time: time,
- searchname:searchname,
- type: 2,
- 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);
- if(totalPage == 0){
- totalPage =1;
- }
- var zaocantotal = data.zaocantotal;
- var wucantotal = data.wucantotal;
- var wancantotal = data.wancantotal;
- document.getElementById("zaocantotal").innerHTML=zaocantotal+"份";
- document.getElementById("wucantotal").innerHTML=wucantotal+"份";
- document.getElementById("wancantotal").innerHTML=wancantotal+"份";
-
- var list = data.list;
- if(list.length > 0) {
- vmA.items = vmA.items.concat(convert(list));
- }
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- if(pageNo == 1 && totalPage>1) {
- mui('#pullrefresh').pullRefresh().endPulldown();
- mui('#pullrefresh').pullRefresh().refresh(true);
- }
- if(totalPage == 1 ){
- mui('#pullrefresh').pullRefresh().endPulldown();
- }
- pageNo = pageNo + 1;
- });
- }
- /**
- * 1、将服务端返回数据,转换成前端需要的格式
- * 2、若服务端返回格式和前端所需格式相同,则不需要改功能
- *
- * @param {Array} items
- */
-
- function convert(items) {
- var newItems = [];
- items.forEach(function(item) {
- if(item.type==1){
- type="早餐";
- }
- if(item.type==2){
- type="午餐";
- }
- if(item.type==3){
- type="晚餐";
- }
- newItems.push({
- id:item.id,
- universalid: item.universalid,
- name: item.name,
- content: item.name2,
- cost: item.cost,
- type: type,
- date: item.date,
-
- });
- });
- return newItems;
- }
- mui.plusReady(function() {
-
- var self = plus.webview.currentWebview();
- type = self.type;
- var title1 = mui('#title');
- title1[0].innerHTML = self.name;
-
- //接收上个界面传递的参数
- window.addEventListener('listEvent', function(event) {
- location.reload();
- });
- // pageDetail = mui.preload({
- // url: 'detailList.html',
- // id: 'detailList.html',
- // })
- });
- window.addEventListener('refresh', function(e){//执行刷新
- location.reload();
-
- });
-
- //点击右上角搜索显示隐藏层
- document.getElementById("menu").addEventListener('tap',function(){
- var state=document.getElementById('topPopover').style.display;
- if(state == 'none'){
- document.getElementById('topPopover').style.display="";
- }else{
- document.getElementById('topPopover').style.display='none';
- }
- })
-
-
- //查询按钮
- document.getElementById("save").addEventListener('click',function(){
- var url = API.API_URL();
- var searchname=$("#searchname").val();
- var serviceId = "oa_2017V001PHONE_orderList";
- var time=document.getElementById("riqi").innerHTML;
- if(searchname == null || searchname == ""){
- searchname = null;
- }
- if(time == null || time == "" || time == "选择日期 ..."){
- time = null;
- }
- var obj = {
- time: time,
- searchname: searchname,
- pSize: APP.PageSize,
- p: 1
- };
- app.ajax(serviceId,obj, function(data) {
- //服务器返回响应
- console.log(JSON.stringify(data))
- mui.toast("查找成功");
- var result = data.returnParams;
- var totalRow = data.total;
- var totalPage = Math.ceil(totalRow / APP.PageSize);
- var zaocantotal = data.zaocantotal;
- var wucantotal = data.wucantotal;
- var wancantotal = data.wancantotal;
- document.getElementById("zaocantotal").innerHTML=zaocantotal+"份";
- document.getElementById("wucantotal").innerHTML=wucantotal+"份";
- document.getElementById("wancantotal").innerHTML=wancantotal+"份";
- var list = data.list;
- console.log(list.length);
- vmA.items = [];
- if(list.length > 0) {
- vmA.items = vmA.items.concat(convert(list));
- }
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- pageNo = endPull(totalPage, pageNo);
- mui(".mui-popover").popover("toggle");
- });
- });
-
- //查找全部
- document.getElementById("saveall").addEventListener('click',function(){
- vmA.items = [];
- var url = API.API_URL();
- var serviceId = "oa_2017V001PHONE_orderList";
- var state = app.getState(); //获取登陆信息
- var searchname=null;
- var time=null;
- /*var staffId = state.user.useId;
- var unitId = state.user.unitId;
- var notice_title = "";*/
- var obj = {
- /*unitId: unitId,
- userId: staffId,
- notice_title: notice_title,*/
- time: time,
- searchname:searchname,
- type: 2,
- pSize: APP.PageSize,
- p: 1
- };
- 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) {
- vmA.items = vmA.items.concat(convert(list));
- }
- mui('#pullrefresh').pullRefresh().endPullupToRefresh(totalPage == pageNo); //参数为true代表没有更多数据了。
- pageNo = endPull(totalPage, pageNo);
- mui(".mui-popover").popover("toggle");
- });
- });
-
- //删除
- function del(item) {
-
- var btnArray = ['取消', '确认'];
- mui.confirm('确定要删除吗', '警告', btnArray, function(e) {
- if (e.index == 1) {
-
- var url = API.API_URL();
- var serviceId = "oa_2017V001PHONE_orderDel";
- var state = app.getState(); //获取登陆信息
- var id=item.id;
-
- var obj = {
- id:id,
- };
- app.ajax(serviceId,obj, function(data) {
- //服务器返回响应
- console.log(JSON.stringify(data))
- if(data.boo == true) {
- alert('删除成功');
- location.reload();
- } else {
- alert('删除失败:' + data.msg);
- }
- });
- } else {
-
- }
- })
-
- }
- </script>
- </body>
- </html>
|