|
|
|
@ -68,8 +68,8 @@ Page({ |
|
|
|
currentTab: 0, |
|
|
|
winHeight: app.globalData.winHeight, |
|
|
|
|
|
|
|
starTime: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), |
|
|
|
endTime: timechage.formatTimeTwo(Date.parse(new Date()), 'Y-M-D'), |
|
|
|
// 从哪个页面返回当前页面
|
|
|
|
backPage: "", |
|
|
|
|
|
|
|
dateTimeArray: null, |
|
|
|
dateTime: null, |
|
|
|
@ -107,26 +107,28 @@ Page({ |
|
|
|
this.data.addrs = e.detail.value; |
|
|
|
}, |
|
|
|
|
|
|
|
// 存货特价开始时间
|
|
|
|
bindStartTimeChange: function (e) { |
|
|
|
var itemIndex = e.currentTarget.dataset.index; |
|
|
|
var array = this.data.goodsNameArr; |
|
|
|
array[itemIndex]["applicationStartTime"]= e.detail.value, |
|
|
|
this.setData({ |
|
|
|
goodsNameArr: array, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 存货特价结束时间
|
|
|
|
bindEndTimeChange: function (e) { |
|
|
|
// 获取输入框值进行保存
|
|
|
|
getInputValue:function (e){ |
|
|
|
var style = e.currentTarget.dataset.datastyle |
|
|
|
var itemIndex = e.currentTarget.dataset.index; |
|
|
|
var array = this.data.goodsNameArr; |
|
|
|
array[itemIndex]["applicationEndTime"] = e.detail.value, |
|
|
|
array[itemIndex][style] = e.detail.value, |
|
|
|
this.setData({ |
|
|
|
goodsNameArr: array, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取存货时间变化进行保存
|
|
|
|
bindTimeChange: function (e) { |
|
|
|
var style = e.currentTarget.dataset.datastyle |
|
|
|
var itemIndex = e.currentTarget.dataset.index; |
|
|
|
var array = this.data.goodsNameArr; |
|
|
|
array[itemIndex][style]= e.detail.value, |
|
|
|
this.setData({ |
|
|
|
goodsNameArr: array, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 基本信息日期
|
|
|
|
changeDateTime(e) { |
|
|
|
this.setData({ |
|
|
|
@ -308,57 +310,60 @@ Page({ |
|
|
|
onShow: function () { |
|
|
|
var that = this; |
|
|
|
|
|
|
|
// 返回的用户只能是一条,所以index只能为0
|
|
|
|
var currentCustomerArr = app.globalData.customerArray; |
|
|
|
if (currentCustomerArr.length > 0) { |
|
|
|
this.setData({ |
|
|
|
customerArr: currentCustomerArr, |
|
|
|
}) |
|
|
|
} |
|
|
|
if (this.data.backPage == "customerChoosePage"){ |
|
|
|
// 返回的用户只能是一条,所以index只能为0
|
|
|
|
var currentCustomerArr = app.globalData.customerArray; |
|
|
|
if (currentCustomerArr.length > 0) { |
|
|
|
this.setData({ |
|
|
|
customerArr: currentCustomerArr, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
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 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, |
|
|
|
} |
|
|
|
backGoodsArr.push(goodsNameObj) |
|
|
|
|
|
|
|
// 获取存货 加载完成后计算价格政策
|
|
|
|
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 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, |
|
|
|
} |
|
|
|
backGoodsArr.push(goodsNameObj) |
|
|
|
console.log(backGoodsArr); |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
goodsNameArr: backGoodsArr, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
goodsNameArr: backGoodsArr, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|