|
|
|
@ -367,75 +367,126 @@ Page({ |
|
|
|
this.util(); |
|
|
|
}, |
|
|
|
|
|
|
|
// getGoodsNum: function (e) {
|
|
|
|
// var v = e.detail.value;
|
|
|
|
// let end = v.charAt(v.length - 1)
|
|
|
|
// if (end == ".")
|
|
|
|
// return;
|
|
|
|
// let idx = e.target.dataset.idx;
|
|
|
|
// var detail = this.data.dmo.Details[idx];
|
|
|
|
// let value = Number(v);
|
|
|
|
// if (isNaN(value)) {
|
|
|
|
// wx.showModal({
|
|
|
|
// title: '提示',
|
|
|
|
// content: '输入格式不正确',
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// detail.UnitNum = value;
|
|
|
|
|
|
|
|
// var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio;
|
|
|
|
// if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) {
|
|
|
|
// detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// dmo: this.data.dmo
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
|
|
|
|
// getSecondNum: function (e) {
|
|
|
|
// var v = e.detail.value;
|
|
|
|
// let end = v.charAt(v.length - 1)
|
|
|
|
// if (end == ".")
|
|
|
|
// return;
|
|
|
|
// let idx = e.target.dataset.idx;
|
|
|
|
// var detail = this.data.dmo.Details[idx];
|
|
|
|
// let value = Number(v);
|
|
|
|
// if (isNaN(value)) {
|
|
|
|
// wx.showModal({
|
|
|
|
// title: '提示',
|
|
|
|
// content: '输入格式不正确',
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// detail.SecondNumber = value;
|
|
|
|
|
|
|
|
// var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio;
|
|
|
|
// if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) {
|
|
|
|
// detail.UnitNum = numberNumber / (detail.Goods_SecondUnitRatio) * (detail.Goods_MainUnitRatio);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// this.setData({
|
|
|
|
// dmo: this.data.dmo
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
|
|
|
|
// getPrice: function (e) {
|
|
|
|
// var v = e.detail.value;
|
|
|
|
// let end = v.charAt(v.length - 1)
|
|
|
|
// if (end == ".")
|
|
|
|
// return;
|
|
|
|
// let idx = e.target.dataset.idx;
|
|
|
|
// let value = Number(v);
|
|
|
|
// if (isNaN(value)) {
|
|
|
|
// wx.showToast({
|
|
|
|
// title: '提示',
|
|
|
|
// content: '输入格式不正确',
|
|
|
|
// })
|
|
|
|
// } else
|
|
|
|
// this.data.dmo.Details[idx].Price = value;
|
|
|
|
// this.setData({
|
|
|
|
// dmo: this.data.dmo
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
|
|
|
|
getGoodsNum: function (e) { |
|
|
|
var v = e.detail.value; |
|
|
|
let end = v.charAt(v.length - 1) |
|
|
|
if (end == ".") |
|
|
|
return; |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
var detail = this.data.dmo.Details[idx]; |
|
|
|
let value = Number(v); |
|
|
|
if (isNaN(value)) { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '输入格式不正确', |
|
|
|
}); |
|
|
|
} else { |
|
|
|
detail.UnitNum = value; |
|
|
|
let value = e.detail.value; |
|
|
|
let end = value.charAt(value.length - 1) |
|
|
|
if (end != ".") { |
|
|
|
detail.UnitNum = Number(value); |
|
|
|
|
|
|
|
var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio; |
|
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { |
|
|
|
detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); |
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getSecondNum: function (e) { |
|
|
|
var v = e.detail.value; |
|
|
|
let end = v.charAt(v.length - 1) |
|
|
|
if (end == ".") |
|
|
|
return; |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
var detail = this.data.dmo.Details[idx]; |
|
|
|
let value = Number(v); |
|
|
|
if (isNaN(value)) { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '输入格式不正确', |
|
|
|
}); |
|
|
|
} else { |
|
|
|
detail.SecondNumber = value; |
|
|
|
let value = e.detail.value; |
|
|
|
let end = value.charAt(value.length - 1) |
|
|
|
if (end != ".") { |
|
|
|
detail.SecondNumber = Number(value); |
|
|
|
|
|
|
|
var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio; |
|
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { |
|
|
|
detail.UnitNum = numberNumber / (detail.Goods_SecondUnitRatio) * (detail.Goods_MainUnitRatio); |
|
|
|
} |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getPrice: function (e) { |
|
|
|
var v = e.detail.value; |
|
|
|
let end = v.charAt(v.length - 1) |
|
|
|
if (end == ".") |
|
|
|
return; |
|
|
|
let idx = e.target.dataset.idx; |
|
|
|
let value = Number(v); |
|
|
|
if (isNaN(value)) { |
|
|
|
wx.showToast({ |
|
|
|
title: '提示', |
|
|
|
content: '输入格式不正确', |
|
|
|
let value = e.detail.value; |
|
|
|
let end = value.charAt(value.length - 1) |
|
|
|
if (end != ".") { |
|
|
|
this.data.dmo.Details[idx].Price = Number(value); |
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
} else |
|
|
|
this.data.dmo.Details[idx].Price = value; |
|
|
|
this.setData({ |
|
|
|
dmo: this.data.dmo |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
deleteItem: function(e) { |
|
|
|
|