From 187d4c812b54c41856a0a7ad167c610603df4163 Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Wed, 5 Dec 2018 13:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E9=A2=84=E6=8A=A5=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E9=A1=B5=E9=9D=A2=E5=8F=98=E6=9B=B4=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerChooseTemplate.js | 2 +- pages/saleForecastList/newBill/newBill.js | 135 +++++++++++++++++- pages/saleForecastList/newBill/newBill.wxml | 91 ++++++++---- pages/saleForecastList/newBill/newBill.wxss | 51 +++++++ 4 files changed, 247 insertions(+), 32 deletions(-) diff --git a/pages/customerChooseTemplate/customerChooseTemplate.js b/pages/customerChooseTemplate/customerChooseTemplate.js index 8633a2f..28cf20a 100644 --- a/pages/customerChooseTemplate/customerChooseTemplate.js +++ b/pages/customerChooseTemplate/customerChooseTemplate.js @@ -164,7 +164,7 @@ Page({ // 新建预报页面只允许选取一位客户 if (fromPage == "newForecast" && e.detail.value.length > 0) { this.setData({ - checkBoxArray: e.detail.value, + storageCheckBoxArray: e.detail.value, }) this.storageAddCustomerArrayBack(); } diff --git a/pages/saleForecastList/newBill/newBill.js b/pages/saleForecastList/newBill/newBill.js index 1811462..fd9a582 100644 --- a/pages/saleForecastList/newBill/newBill.js +++ b/pages/saleForecastList/newBill/newBill.js @@ -91,7 +91,8 @@ Page({ Details: [], }, dateTimeArray1: null, - dateTime1: null + dateTime1: null, + backPage:'', }, onLoad: function (options) { @@ -99,6 +100,78 @@ Page({ setTime(that); }, + onShow:function (){ + var that = this; + + // 客户收藏列表选取客户调用此方法 + /* + if (this.data.backPage == "customerChoosePage") { + // 返回的用户只能是一条,所以index只能为0 + var currentCustomerArr = app.globalData.customerArray; + if (currentCustomerArr.length > 0) { + this.data.dmo.Customer_ID = currentCustomerArr[0].ID; + this.data.dmo.Customer_Name = currentCustomerArr[0].Name; + this.setData({ + //customerArr: currentCustomerArr, + dmo:this.data.dmo, + }) + // 获取客户详情 + GetCustomerInfo(that, this.data.dmo); + } + } + */ + + if (this.data.backPage == "goodsNameChoosePage") { + // 获取存货 加载完成后计算价格政策 + var goodsArr = app.globalData.goodsNameArray; + if (goodsArr.length > 0) { + // 在此添加货品价格的请求 + let backGoodsArr = []; + for (var i = 0; i < goodsArr.length; i++) { + // 存货名称 + var name = goodsArr[i].Goods_Name; + // 存货ID + var id = goodsArr[i].SaleGoods_ID; + // 获取价格 + var unit = goodsArr[i].Unit; + // 原单价 + var infoprice = goodsArr[i].Price; + if (infoprice == null) { + infoprice = ""; + } + // 特价 + var policyPrice = ""; + // 开始时间 + var infoStartTime = timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'); + // 结束时间 + var infoEndTime = timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'); + // 申请数量 + var infoNum = ""; + + let goodsNameObj = { + Goods_Name: name, + SaleGoods_ID: Number(id), + Price: infoprice, + applicationPrice: policyPrice, + applicationStartTime: infoStartTime, + applicationEndTime: infoEndTime, + applicationNum: infoNum, + applicationUnit: unit, + } + backGoodsArr.push(goodsNameObj) + + // 获取原单价 + that.GetGoodsPrice(id, unit, i); + } + + this.setData({ + goodsNameArr: backGoodsArr, + }) + } + + } + }, + /** * 滑动切换tab */ @@ -352,6 +425,32 @@ Page({ }) }, + // 添加客户 + addCustomer: function () { + wx.navigateTo({ + url: '../../customerChooseTemplate/customerChooseTemplate?fromePage=newForecast', + }) + }, + + // 添加存货 + addGoodsName: function () { + var that = this; + let unitID = that.data.unit[that.data.isUnit].ID; + var customerArr = that.data.customerArr; + if (unitID && customerArr.length > 0) { + let customerID = customerArr[0].ID; + wx.navigateTo({ + url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + unitID + '&customerID' + customerID, + }) + } else { + wx.showModal({ + title: '提示', + content: '请先选择客户及会计单位', + }) + } + }, + + // 添加存货按钮 add: function (e) { let newobj = {}; this.data.dmo.Details.push(newobj); @@ -360,6 +459,40 @@ Page({ }) }, + // 存货明细页面更多按钮 + moreBtnClick: function (e) { + var that = this; + var itemList = [ + "审核", + "撤销" + ]; + wx.showActionSheet({ + itemList: itemList, + itemColor: "#2689f8", + success: function (res) { + // res.cancel 用户是不是点击了取消按钮 + // res.tapIndex 数组元素的序号,从0开始 + that.moreBtnClickedDetailInfo(itemList[res.tapIndex]); + } + }) + }, + + // 更多 -> 撤销 -> 审核 + moreBtnClickedDetailInfo: function (item) { + if (item == "审核") { + wx.showModal({ + title: "提示", + content: "++++" + item + "++++", + }) + } else { + wx.showModal({ + title: "提示", + content: "++++" + item + "++++", + }) + } + }, + + // 保存按钮 submitForm: function () { var dmo = this.data.dmo; diff --git a/pages/saleForecastList/newBill/newBill.wxml b/pages/saleForecastList/newBill/newBill.wxml index 4ee77ad..5ea4dba 100644 --- a/pages/saleForecastList/newBill/newBill.wxml +++ b/pages/saleForecastList/newBill/newBill.wxml @@ -66,52 +66,83 @@ - + - 存货名称 - - {{item.Goods_Name?item.Goods_Name:"请选择存货"}} + 存货名称 + + {{item.Goods_Name?item.Goods_Name:"请选择存货"}} + - - + - - 报货数量 - - - + + 报货数量 + + + - - 辅 数 量 - - - + + 辅 数 量 + + + + + + 单 价 + + + + + + 政策单价 + {{item.PolicyPrice}} + + - - 单 价 - - + 删除 + + + + + - - 政策单价 - {{item.PolicyPrice}} + + + + 添加存货 - + + + + + + + + + 更多 + + - 删除 - - - + + + + 保存 + + + - + + @@ -130,4 +161,4 @@ 取消 - + \ No newline at end of file diff --git a/pages/saleForecastList/newBill/newBill.wxss b/pages/saleForecastList/newBill/newBill.wxss index 0afaf53..a5aaa89 100644 --- a/pages/saleForecastList/newBill/newBill.wxss +++ b/pages/saleForecastList/newBill/newBill.wxss @@ -226,4 +226,55 @@ page { .text3 { font-size: 18px; color: rgb(48, 48, 48); +} + +.imageView { + height: 80px; + width: 100%; + margin-top: 20rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.imageViewNoMargin{ + height: 80px; + width: 100%; + margin-top: -10rpx; + position: relative; + align-items: center; + justify-content: center; + box-sizing: content-box; +} + +.currentImage { + width: 100%; + height: 100%; +} + +.bottomGroupView{ + margin-top: -10rpx; + width: 100%; + height: 80px; + display: flex; + flex-direction: row; +} + +.btnTextView { + position: absolute; + width: 100%; + top:0; + line-height: 65px; + text-align: center; +} + +.btnText { + color: white; + font-size: 20px; +} + +.goodsNameImageToTopFar{ + height: calc(100% - 180px); + background:#EAF1F8; } \ No newline at end of file