|
|
|
@ -2,112 +2,23 @@ |
|
|
|
const app = getApp(); |
|
|
|
var network = require("../../utils/net.js"); |
|
|
|
var timechage = require("../../utils/dateTimeUtil.js"); |
|
|
|
var UnCheckPageIndex = 0 |
|
|
|
var UnCheckPageSize = 10 |
|
|
|
var CheckedPageIndex = 0 |
|
|
|
var CheckedPageSize = 10 |
|
|
|
var outStoreMethod = '/MainSystem/B3MiniProgramRpc/Rpcs/ManagerRpc/WorkFlowApproveRecordRpc/GetList' |
|
|
|
// 未审核订单列表
|
|
|
|
function getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, successaction) { |
|
|
|
let getArr = []; |
|
|
|
let method = outStoreMethod; |
|
|
|
let params = [false, UnCheckPageIndex, UnCheckPageSize]; |
|
|
|
network.newRequestLoading(method, params, function (res) { |
|
|
|
var array = res.result; |
|
|
|
successaction(); |
|
|
|
if (array.length <= 0) { |
|
|
|
wx.showToast({ |
|
|
|
title: '无数据更新', |
|
|
|
}) |
|
|
|
if (UnCheckPageIndex > 0) { |
|
|
|
UnCheckPageIndex = UnCheckPageIndex - 1; |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
for (var i = 0; i < array.length; i++) { |
|
|
|
var dmo = { |
|
|
|
//是否显示审批按钮所在bottom
|
|
|
|
billState: true, |
|
|
|
billType: array[i].BillType_Name, |
|
|
|
billID: array[i].Bill_ID, |
|
|
|
remark: array[i].EndStateName, |
|
|
|
time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m') |
|
|
|
} |
|
|
|
getArr.push(dmo); |
|
|
|
} |
|
|
|
let arrLast = that.data.unCheckDataArr.concat(getArr); |
|
|
|
that.setData({ |
|
|
|
unCheckDataArr: arrLast, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 已审核订单列表
|
|
|
|
function getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize) { |
|
|
|
let getArr = []; |
|
|
|
let method = outStoreMethod; |
|
|
|
let params = [true, CheckedPageIndex, CheckedPageSize]; |
|
|
|
network.newRequestLoading(method, params, function (res) { |
|
|
|
var array = res.result; |
|
|
|
if (array.length <= 0) { |
|
|
|
wx.showToast({ |
|
|
|
title: '无数据更新', |
|
|
|
}) |
|
|
|
if (CheckedPageIndex > 0) { |
|
|
|
CheckedPageIndex = CheckedPageIndex - 1; |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
for (var i = 0; i < array.length; i++) { |
|
|
|
var dmo = { |
|
|
|
//是否显示审批按钮所在bottom
|
|
|
|
billState: false, |
|
|
|
billType: array[i].BillType_Name, |
|
|
|
billID: array[i].Bill_ID, |
|
|
|
remark: array[i].Remark, |
|
|
|
time: timechage.formatTimeTwo(array[i].CreateTime.substring(6, 19), 'Y/M/D h:m') |
|
|
|
} |
|
|
|
getArr.push(dmo); |
|
|
|
} |
|
|
|
let arrLast = that.data.checkedDataArr.concat(getArr); |
|
|
|
that.setData({ |
|
|
|
checkedDataArr: arrLast, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
var getOrderList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/CarRecordRpc/GetList' |
|
|
|
|
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
checkedDataArr: [1,2,3], |
|
|
|
unCheckDataArr: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3], |
|
|
|
currentTab: 0, |
|
|
|
winHeight: 0, |
|
|
|
winWidth: 0, |
|
|
|
orderList:[], |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 滑动切换tab |
|
|
|
*/ |
|
|
|
bindChange: function (e) { |
|
|
|
var that = this; |
|
|
|
that.setData({ |
|
|
|
currentTab: e.detail.current |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
/** |
|
|
|
* 点击tab切换 |
|
|
|
*/ |
|
|
|
swichNav: function (e) { |
|
|
|
onShow: function (options) { |
|
|
|
var that = this; |
|
|
|
if (this.data.currentTab === e.target.dataset.current) { |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
var method = getOrderList; |
|
|
|
network.transfer_request(method, [], function (res) { |
|
|
|
that.setData({ |
|
|
|
currentTab: e.target.dataset.current |
|
|
|
orderList: res.result, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//点击进入详情页面
|
|
|
|
transToOrderDetail: function (event) { |
|
|
|
var itemID = event.currentTarget.dataset.detailitemid; |
|
|
|
@ -116,51 +27,5 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onShow: function (options) { |
|
|
|
// this.setData({
|
|
|
|
// checkedDataArr: [],
|
|
|
|
// unCheckDataArr: [],
|
|
|
|
// })
|
|
|
|
var that = this; |
|
|
|
wx.getSystemInfo({ |
|
|
|
success: function (res) { |
|
|
|
that.setData({ |
|
|
|
winWidth: res.windowWidth, |
|
|
|
winHeight: res.windowHeight |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
// UnCheckPageIndex = 0;
|
|
|
|
// CheckedPageIndex = 0;
|
|
|
|
// getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) {
|
|
|
|
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
|
|
|
|
// });
|
|
|
|
}, |
|
|
|
|
|
|
|
//未审核订单滑动到底部加载
|
|
|
|
unCheckedScrollLower: function (event) { |
|
|
|
var that = this; |
|
|
|
UnCheckPageIndex = UnCheckPageIndex + 1; |
|
|
|
getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) { }); |
|
|
|
}, |
|
|
|
|
|
|
|
//已审核订单滑动到底部加载
|
|
|
|
CheckedScrollLower: function (event) { |
|
|
|
var that = this; |
|
|
|
CheckedPageIndex = CheckedPageIndex + 1; |
|
|
|
getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 页面上拉触底事件的处理函数 |
|
|
|
*/ |
|
|
|
// onReachBottom: function () {
|
|
|
|
// var that = this;
|
|
|
|
// if (this.data.currentTab === 0) {
|
|
|
|
// UnCheckPageIndex = UnCheckPageIndex + 1;
|
|
|
|
// getUnCheckOrderList(that, UnCheckPageIndex, UnCheckPageSize, function (res) { });
|
|
|
|
// } else {
|
|
|
|
// CheckedPageIndex = CheckedPageIndex + 1;
|
|
|
|
// getCheckedOrderList(that, CheckedPageIndex, CheckedPageSize);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
|
|
|
|
}) |