diff --git a/pages/order/detail/detail.js b/pages/order/detail/detail.js index 1e03168..663ed6e 100644 --- a/pages/order/detail/detail.js +++ b/pages/order/detail/detail.js @@ -367,77 +367,6 @@ 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) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; diff --git a/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js b/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js index 8506bb8..0efc6a4 100644 --- a/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js +++ b/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js @@ -111,15 +111,21 @@ Page({ this.data.remark = e.detail.value; }, + // 获取输入框值进行保存 getInputValue: 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, - }) + + let value = e.detail.value; + let end = value.charAt(value.length - 1) + if (end != ".") { + array[itemIndex][style] = Number(value), + this.setData({ + goodsNameArr: array, + }) + } }, // 获取存货时间变化进行保存