|
|
|
@ -99,7 +99,8 @@ Page({ |
|
|
|
rowIdx: -1, |
|
|
|
dmo: {}, |
|
|
|
dateTimeArray1: null, |
|
|
|
dateTime1: null |
|
|
|
dateTime1: null, |
|
|
|
backPage:'', |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad: function(options) { |
|
|
|
@ -114,6 +115,26 @@ Page({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onShow: function () { |
|
|
|
var that = this; |
|
|
|
if (this.data.backPage == "goodsNameChoosePage") { |
|
|
|
var goodsArr = app.globalData.goodsNameArray; |
|
|
|
app.globalData.goodsNameArray = []; |
|
|
|
if (goodsArr.length > 0) { |
|
|
|
// 在此添加货品价格的请求
|
|
|
|
for (var i = 0; i < goodsArr.length; i++) { |
|
|
|
let newobj = {}; |
|
|
|
this.data.dmo.Details.push(newobj); |
|
|
|
var itemIndex = this.data.dmo.Details.length - 1; |
|
|
|
var detail = this.data.dmo.Details[itemIndex]; |
|
|
|
detail.SaleGoods_ID = goodsArr[i].SaleGoods_ID; |
|
|
|
detail.Goods_Name = goodsArr[i].Goods_Name; |
|
|
|
GetGoodsInfo(this, this.data.dmo, detail); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 滑动切换tab |
|
|
|
*/ |
|
|
|
@ -409,13 +430,63 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
add: function(e) { |
|
|
|
let newobj = {}; |
|
|
|
this.data.dmo.Details.push(newobj); |
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
// let newobj = {};
|
|
|
|
// this.data.dmo.Details.push(newobj);
|
|
|
|
// this.setData({
|
|
|
|
// dmo: this.data.dmo
|
|
|
|
// })
|
|
|
|
var dmo = this.data.dmo; |
|
|
|
if (dmo.Customer_ID == null) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择购货客户' |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
if (dmo.AccountingUnit_ID == null) { |
|
|
|
wx.showToast({ |
|
|
|
title: '请选择会计单位' |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
wx.navigateTo({ |
|
|
|
url: '../../goodaNameChooseTemplate/goodaNameChooseTemplate?unitID=' + dmo.AccountingUnit_ID + '&customerID' + dmo.Customer_ID, |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 存货明细页面更多按钮
|
|
|
|
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; |
|
|
|
|
|
|
|
|