From ae9cbc5b8512fd4e2a1e1f70e4cda425089fe24f Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Wed, 28 Nov 2018 15:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E4=BB=B7=E7=94=B3=E8=AF=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E6=95=B0=E6=8D=AE=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creatNewSpecialOrder.js | 4 -- .../specialOrderApplication.js | 56 ++++++++++++------- .../specialOrderApplication.wxml | 1 - 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js index 3a193ff..18aaab1 100644 --- a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js +++ b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js @@ -67,20 +67,16 @@ Page({ data: { currentTab: 0, winHeight: app.globalData.winHeight, - // 从哪个页面返回当前页面 backPage: "", - dateTimeArray: null, dateTime: null, startYear: 2018, endYear: 2030, - // 用户数组 customerArr:[], // 存货数组 goodsNameArr:[], - which: "", idx: 0, currency: [], diff --git a/pages/specialOrderApplication/specialOrderApplication.js b/pages/specialOrderApplication/specialOrderApplication.js index 4a27935..570085b 100644 --- a/pages/specialOrderApplication/specialOrderApplication.js +++ b/pages/specialOrderApplication/specialOrderApplication.js @@ -6,21 +6,21 @@ 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" +var getList = '/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/MarketingActivityRpc/GetList' +var deleteItem = "/MainSystem/B3MiniProgramRpc/XuRpcs/Employee/MarketingActivityRpc/Delete" // 未审核订单列表 -function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, successaction) { +function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, activityDate, successaction) { let getArr = []; let method = getList; let params = [{ "BillState": 0, - "Customer_ID": that.data.Customer_ID, + "MarketingActivityDate": activityDate, "PageIndex": UnCheckPageIndex, - "PageSize": pageSize, + "PageIndex": pageSize, }]; - network.transfer_request(method, params, function (res) { + network.transfer_request(method, params, function(res) { successaction(); var array = res.result; if (array.length <= 0) { @@ -35,8 +35,8 @@ function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, successaction) { //添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作 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'), + Customer_Name: array[i].Name, + time: timechage.formatTimeTwo(array[i].MarketingActivityDate.substring(6, 19), 'Y/M/D'), workFlowName: array[i].DepartmentWorkFlow_Detail_Name, } getArr.push(dmo); @@ -49,16 +49,16 @@ function getUnCheckOrderList(that, UnCheckPageIndex, pageSize, successaction) { } // 已审核订单列表 -function getCheckedOrderList(that, CheckedPageIndex, pageSize) { +function getCheckedOrderList(that, CheckedPageIndex, pageSize, activityDate) { let getArr = []; let method = getList; let params = [{ "BillState": 20, - "Customer_ID": that.data.Customer_ID, + "MarketingActivityDate": activityDate, "PageIndex": CheckedPageIndex, "PageSize": pageSize, }]; - network.transfer_request(method, params, function (res) { + network.transfer_request(method, params, function(res) { var array = res.result; if (array.length <= 0) { wx.showToast({ @@ -72,8 +72,8 @@ function getCheckedOrderList(that, CheckedPageIndex, pageSize) { //添加单据状态的传递,在详情页面判断此值,进行是否允许提交的操作 orderState: false, orderID: array[i].ID, - Customer_Name: array[i].Customer_Name, - time: timechage.formatTimeTwo(array[i].Date.substring(6, 19), 'Y/M/D'), + Customer_Name: array[i].Name, + time: timechage.formatTimeTwo(array[i].MarketingActivityDate.substring(6, 19), 'Y/M/D'), workFlowName: array[i].DepartmentWorkFlow_Detail_Name, } @@ -93,26 +93,40 @@ Page({ unCheckDataArr: [], currentTab: 0, winHeight: app.globalData.winHeight, - searchDate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), - + // searchDate: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), + searchDate: '', }, - /** - * 生命周期函数--监听页面显示 - */ onShow: function() { + this.setData({ + checkedDataArr: [], + unCheckDataArr: [], + }) + var that = this; + UnCheckPageIndex = 0; + CheckedPageIndex = 0; + getUnCheckOrderList(that, UnCheckPageIndex, pageSize, null, function(res) { + getCheckedOrderList(that, CheckedPageIndex, pageSize, null); + }); }, // 时间检索条件发生变化,重新请求数据 bindDateChange: function(e) { this.setData({ searchDate: e.detail.value, + checkedDataArr: [], + unCheckDataArr: [], }) - console.log(e.detail.value) // 装换成时间戳 - let time = timechage.formatymdERTDate(this.data.searchDate); - console.log(time) + let time = timechage.formatymdERTDate(e.detail.value); + var that = this; + UnCheckPageIndex = 0; + CheckedPageIndex = 0; + getUnCheckOrderList(that, UnCheckPageIndex, pageSize, time, function(res) { + getCheckedOrderList(that, CheckedPageIndex, pageSize, time); + + }); }, // 新建特价申请 diff --git a/pages/specialOrderApplication/specialOrderApplication.wxml b/pages/specialOrderApplication/specialOrderApplication.wxml index e5f5418..1c6d9a0 100644 --- a/pages/specialOrderApplication/specialOrderApplication.wxml +++ b/pages/specialOrderApplication/specialOrderApplication.wxml @@ -30,7 +30,6 @@ - 筛选