|
|
@ -380,74 +380,53 @@ Page({ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getGoodsNum: function (e) { |
|
|
getGoodsNum: function (e) { |
|
|
var v = e.detail.value; |
|
|
|
|
|
let end = v.charAt(v.length - 1) |
|
|
|
|
|
if (end == ".") |
|
|
|
|
|
return; |
|
|
|
|
|
let idx = e.target.dataset.idx; |
|
|
let idx = e.target.dataset.idx; |
|
|
var detail = this.data.dmo.Details[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; |
|
|
var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio; |
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { |
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { |
|
|
detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); |
|
|
detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
dmo: this.data.dmo |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
|
|
|
dmo: this.data.dmo |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getSecondNum: function (e) { |
|
|
getSecondNum: function (e) { |
|
|
var v = e.detail.value; |
|
|
|
|
|
let end = v.charAt(v.length - 1) |
|
|
|
|
|
if (end == ".") |
|
|
|
|
|
return; |
|
|
|
|
|
let idx = e.target.dataset.idx; |
|
|
let idx = e.target.dataset.idx; |
|
|
var detail = this.data.dmo.Details[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; |
|
|
var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio; |
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { |
|
|
if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { |
|
|
detail.UnitNum = numberNumber / (detail.Goods_SecondUnitRatio) * (detail.Goods_MainUnitRatio); |
|
|
detail.UnitNum = numberNumber / (detail.Goods_SecondUnitRatio) * (detail.Goods_MainUnitRatio); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
dmo: this.data.dmo |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
this.setData({ |
|
|
|
|
|
dmo: this.data.dmo |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getPrice: function (e) { |
|
|
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 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) { |
|
|
deleteItem: function(e) { |
|
|
|