From 06026fed13315690c7745f4a426cf94dd77fcef7 Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Tue, 18 Dec 2018 11:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B8=E6=9C=BA=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E5=8C=BA=E5=88=86=E5=B7=B2=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=9C=AA=E7=A1=AE=E8=AE=A4=EF=BC=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E5=BE=85=E5=8F=98=E6=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/orderList/orderList.js | 98 ++++++++++++++++++++++++++++++++++ pages/orderList/orderList.wxml | 32 +++++++++-- pages/orderList/orderList.wxss | 13 +---- 3 files changed, 127 insertions(+), 16 deletions(-) diff --git a/pages/orderList/orderList.js b/pages/orderList/orderList.js index 41ae832..c3a9a06 100644 --- a/pages/orderList/orderList.js +++ b/pages/orderList/orderList.js @@ -2,10 +2,86 @@ const app = getApp(); var network = require("../../utils/net.js"); var timechage = require("../../utils/dateTimeUtil.js"); +var PageSize = 10 +var UnCheckPageIndex = 0 +var CheckedPageIndex = 0 var getOrderList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/CarRecordRpc/GetList' +// 未审核订单列表 +function getUnCheckOrderList(that, UnCheckPageIndex, successaction) { + let getArr = []; + let method = getListPath; + let params = [false, app.globalData.Phone, UnCheckPageIndex, PageSize]; + network.transfer_request(method, params, function (res) { + successaction(); + var array = res.result; + if (array.length <= 0) { + wx.showToast({ + title: '无数据更新', + }) + UnCheckPageIndex = UnCheckPageIndex - 1; + return; + } + for (var i = 0; i < array.length; i++) { + var dmo = { + OrderState: "未审核", + ID: array[i].ID, + Employee_Name: array[i].Employee_Name, + TotalNumber: array[i].TotalNumber, + Customer_Name: array[i].Customer_Name, + LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'), + Address: array[i].Address, + } + getArr.push(dmo); + } + let arrLast = that.data.unCheckDataArr.concat(getArr); + that.setData({ + unCheckDataArr: arrLast, + }) + }) +} + +// 已审核订单列表 +function getCheckedOrderList(that, CheckedPageIndex) { + let getArr = []; + let method = getListPath; + let params = [true, app.globalData.Phone, CheckedPageIndex, PageSize]; + network.transfer_request(method, params, function (res) { + var array = res.result; + if (array.length <= 0) { + wx.showToast({ + title: '无数据更新', + }) + CheckedPageIndex = CheckedPageIndex - 1; + return; + } + for (var i = 0; i < array.length; i++) { + var dmo = { + //添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作 + OrderState: "已审核", + ID: array[i].ID, + Employee_Name: array[i].Employee_Name, + TotalNumber: array[i].TotalNumber, + Customer_Name: array[i].Customer_Name, + LoadTime: timechage.formatTimeTwo(array[i].LoadTime.substring(6, 19), 'Y/M/D'), + Address: array[i].Address, + } + getArr.push(dmo); + } + let arrLast = that.data.checkedDataArr.concat(getArr); + // console.log(arrLast); + that.setData({ + checkedDataArr: arrLast, + }) + }) +} + Page({ data: { + checkedDataArr: [], + unCheckDataArr: [], + winHeight: app.globalData.winHeight, + currentTab: 0, orderList: [], }, @@ -45,6 +121,28 @@ Page({ url: 'orderDetail/orderDetail?id=' + itemID, }) }, + /** + * 滑动切换tab + */ + bindChange: function (e) { + var that = this; + that.setData({ + currentTab: e.detail.current + }); + }, + /** + * 点击tab切换 + */ + swichNav: function (e) { + var that = this; + if (this.data.currentTab === e.target.dataset.current) { + return false; + } else { + that.setData({ + currentTab: e.target.dataset.current + }) + } + }, }) \ No newline at end of file diff --git a/pages/orderList/orderList.wxml b/pages/orderList/orderList.wxml index 90d0da8..45088b4 100644 --- a/pages/orderList/orderList.wxml +++ b/pages/orderList/orderList.wxml @@ -1,11 +1,33 @@ - - - -