diff --git a/pages/specialOrderApplication/specialOrderApplication.js b/pages/specialOrderApplication/specialOrderApplication.js index ed3fdf7..4a27935 100644 --- a/pages/specialOrderApplication/specialOrderApplication.js +++ b/pages/specialOrderApplication/specialOrderApplication.js @@ -1,95 +1,163 @@ // pages/specialOrderApplication/specialOrderApplication.js -var app = getApp() +const app = getApp(); +var network = require("../../utils/net.js"); +var timechage = require("../../utils/dateTimeUtil.js"); +var UnCheckPageIndex = 0 +var CheckedPageIndex = 0 +var pageSize = 10 +var getList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/GetList' +var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/SaleForecastRpc/Delete" + +// 未审核订单列表 +function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, successaction) { + let getArr = []; + let method = getList; + let params = [{ + "BillState": 0, + "Customer_ID": that.data.Customer_ID, + "PageIndex": UnCheckPageIndex, + "PageSize": 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 = { + //添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作 true : 可提交 + orderState: true, + orderID: array[i].ID, + Customer_Name: array[i].Customer_Name, + time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'), + workFlowName: array[i].DepartmentWorkFlow_Detail_Name, + } + getArr.push(dmo); + } + let arrLast = that.data.unCheckDataArr.concat(getArr); + that.setData({ + unCheckDataArr: arrLast, + }) + }) +} + +// 已审核订单列表 +function getCheckedOrderList(that, CheckedPageIndex, pageSize) { + let getArr = []; + let method = getList; + let params = [{ + "BillState": 20, + "Customer_ID": that.data.Customer_ID, + "PageIndex": CheckedPageIndex, + "PageSize": 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: false, + orderID: array[i].ID, + Customer_Name: array[i].Customer_Name, + time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'), + workFlowName: array[i].DepartmentWorkFlow_Detail_Name, + + } + getArr.push(dmo); + } + let arrLast = that.data.checkedDataArr.concat(getArr); + that.setData({ + checkedDataArr: arrLast, + }) + }) +} Page({ - /** - * 页面的初始数据 - */ data: { + checkedDataArr: [], + unCheckDataArr: [], + currentTab: 0, winHeight: app.globalData.winHeight, - unCheckDataArr: [1, 2, 3, 4, 5, ], - dates: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), + searchDate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function() { + }, // 时间检索条件发生变化,重新请求数据 - bindDateChange: function (e) { + bindDateChange: function(e) { this.setData({ - dates: e.detail.value, - }) + searchDate: e.detail.value, + }) + console.log(e.detail.value) + // 装换成时间戳 + let time = timechage.formatymdERTDate(this.data.searchDate); + console.log(time) }, // 新建特价申请 - creatNew:function(){ + createNew: function() { wx.navigateTo({ url: 'creatNewSpecialOrder/creatNewSpecialOrder', }) }, - // 页面滚动到顶 - cscrollViewScrollUpper: function (){ - - }, - // 页面滚动到底 - scrollViewScrollLower: function (){ - - }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { + CheckedScrollLower: function() { }, /** - * 生命周期函数--监听页面初次渲染完成 + * 滑动切换tab */ - onReady: function () { + bindChange: function(e) { + var that = this; + that.setData({ + currentTab: e.detail.current + }); }, /** - * 生命周期函数--监听页面显示 + * 点击tab切换 */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - + swichNav: function(e) { + var that = this; + if (this.data.currentTab === e.target.dataset.current) { + return false; + } else { + that.setData({ + currentTab: e.target.dataset.current + }) + } }, /** * 生命周期函数--监听页面卸载 */ - onUnload: function () { + onUnload: function() { }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } }) \ No newline at end of file diff --git a/pages/specialOrderApplication/specialOrderApplication.json b/pages/specialOrderApplication/specialOrderApplication.json index b73d2b8..ee8c0ce 100644 --- a/pages/specialOrderApplication/specialOrderApplication.json +++ b/pages/specialOrderApplication/specialOrderApplication.json @@ -1,3 +1,5 @@ { + "navigationBarBackgroundColor": "white", + "navigationBarTextStyle": "black", "navigationBarTitleText": "特价申请" } \ No newline at end of file diff --git a/pages/specialOrderApplication/specialOrderApplication.wxml b/pages/specialOrderApplication/specialOrderApplication.wxml index 3b7d5f8..e5f5418 100644 --- a/pages/specialOrderApplication/specialOrderApplication.wxml +++ b/pages/specialOrderApplication/specialOrderApplication.wxml @@ -1,42 +1,60 @@ - - - - - {{dates}} - - - - 新建 + + 未审核 + 已审核 - - - -