From 56364fd6866943106db4b8b6033476a31e42869f Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Tue, 4 Dec 2018 10:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=95=B0=E9=87=8F=E9=BB=98=E8=AE=A4=E7=AD=89?= =?UTF-8?q?=E4=BA=8E=E4=B8=BB=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/saleOutStore/saleOutStore.json | 2 +- .../saleOutStoreDetail/saleOutStoreDetail.js | 47 +++++++++++++++---- .../saleOutStoreDetail.wxml | 23 ++++----- 3 files changed, 51 insertions(+), 21 deletions(-) diff --git a/pages/saleOutStore/saleOutStore.json b/pages/saleOutStore/saleOutStore.json index 40e7eda..e392493 100644 --- a/pages/saleOutStore/saleOutStore.json +++ b/pages/saleOutStore/saleOutStore.json @@ -1,5 +1,5 @@ { "navigationBarBackgroundColor": "white", "navigationBarTextStyle": "black", - "navigationBarTitleText": "出库列表" + "navigationBarTitleText": "出库单列表" } \ No newline at end of file diff --git a/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.js b/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.js index f963d94..4afdbae 100644 --- a/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.js +++ b/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.js @@ -3,31 +3,29 @@ const app = getApp(); var network = require("../../../utils/net.js"); var timechage = require("../../../utils/dateTimeUtil.js"); var LoadOrder = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/SaleOutStoreRpc/LoadSaleOutStore' +var billConfirm = '/MainSystem/B3MiniProgramRpc/XuRpcs/Driver/SaleOutStoreRpc/BillConfirm' Page({ data: { currentTab: 0, - winHeight: 0, + winHeight: app.globalData.winHeight, orderInfo: {}, }, onLoad: function (options) { var that = this; let ID = Number(options.id); - wx.getSystemInfo({ - success: function (res) { - that.setData({ - winWidth: res.windowWidth, - winHeight: res.windowHeight - }); - } - }); var method = LoadOrder; var params = [ID]; network.transfer_request(method, params, function (res) { res.result.LoadTime = timechage.formatTimeTwo(res.result.LoadTime.substring(6, 19), 'Y-M-D h:m'); res.result.OrderDate = timechage.formatTimeTwo(res.result.OrderDate.substring(6, 19), 'Y-M-D h:m'); + if (res.result.Details.length > 0){ + for (var i = 0; i < res.result.Details.length; i++){ + res.result.Details[i].ConfirmNumber = res.result.Details[i].UnitNumber; + } + } that.setData({ orderInfo: res.result, }) @@ -36,7 +34,37 @@ Page({ // 点击输入的确认数量 getConfirmNumber:function(e){ + var value = e.detail.value; + var index = event.currentTarget.dataset.index; + this.data.orderInfo.Details[index].ConfirmNumber = value; + this.setData({ + orderInfo: this.data.orderInfo + }); + }, + // 保存按钮点击 + billConfirm: function () { + var detailsArray = this.data.orderInfo.Details; + let getArr = []; + for (var i = 0; i < detailsArray.length; i++) { + var dmo = { + ID: detailsArray[i].ID, + Number: detailsArray[i].ConfirmNumber, + } + getArr.push(dmo); + } + var method = billConfirm; + var params = [this.data.orderInfo.ID, getArr]; + network.transfer_request(method, params, function (res) { + wx.showToast({ + title: '信息变更操作成功', + success: function (res) { + wx.navigateBack({ + delta: 1 + }) + } + }) + }) }, /** @@ -63,4 +91,5 @@ Page({ } }, + }) \ No newline at end of file diff --git a/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.wxml b/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.wxml index 4f109ca..3c68c9e 100644 --- a/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.wxml +++ b/pages/saleOutStore/saleOutStoreDetail/saleOutStoreDetail.wxml @@ -82,14 +82,6 @@ - - @@ -116,6 +108,15 @@