diff --git a/pages/order/detail/detail.js b/pages/order/detail/detail.js index 4858c20..1e03168 100644 --- a/pages/order/detail/detail.js +++ b/pages/order/detail/detail.js @@ -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) { diff --git a/pages/order/newBill/newBill.js b/pages/order/newBill/newBill.js index e9a659e..89ed8c8 100644 --- a/pages/order/newBill/newBill.js +++ b/pages/order/newBill/newBill.js @@ -328,64 +328,55 @@ Page({ this.util(); }, - getGoodsNum: function(e) { + getGoodsNum: function (e) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { + getSecondNum: function (e) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { + getPrice: function (e) { let idx = e.target.dataset.idx; - let value = Number(e.detail.value); - 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 - }) + } + }, // 删除 diff --git a/pages/saleForecastList/Detail/Detail.js b/pages/saleForecastList/Detail/Detail.js index 233881c..231bc85 100644 --- a/pages/saleForecastList/Detail/Detail.js +++ b/pages/saleForecastList/Detail/Detail.js @@ -312,64 +312,56 @@ Page({ this.util(); }, - + getGoodsNum: function (e) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { let idx = e.target.dataset.idx; - let value = Number(e.detail.value); - 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) { diff --git a/pages/saleForecastList/newBill/newBill.js b/pages/saleForecastList/newBill/newBill.js index 36c472e..c5938e2 100644 --- a/pages/saleForecastList/newBill/newBill.js +++ b/pages/saleForecastList/newBill/newBill.js @@ -309,60 +309,53 @@ Page({ getGoodsNum: function(e) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; - let value = Number(e.detail.value); - 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) { let idx = e.target.dataset.idx; - let value = Number(e.detail.value); - 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) { diff --git a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js index ff5156a..97896f9 100644 --- a/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js +++ b/pages/specialOrderApplication/creatNewSpecialOrder/creatNewSpecialOrder.js @@ -98,7 +98,7 @@ Page({ departmentIndex: 0, department: [], //销售部门 name: "", - remark:'', + remark: '', }, // 添加名称 @@ -107,7 +107,7 @@ Page({ }, // 添加摘要 - getRemark: function (e) { + getRemark: function(e) { this.data.remark = e.detail.value; }, @@ -116,10 +116,15 @@ Page({ 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, + }) + } }, // 获取存货时间变化进行保存 @@ -167,7 +172,7 @@ Page({ }, // 存货明细页面更多按钮 - moreBtnClick:function(e){ + moreBtnClick: function(e) { var that = this; var itemList = [ "审核", @@ -176,7 +181,7 @@ Page({ wx.showActionSheet({ itemList: itemList, itemColor: "#2689f8", - success: function (res) { + success: function(res) { // res.cancel 用户是不是点击了取消按钮 // res.tapIndex 数组元素的序号,从0开始 that.moreBtnClickedDetailInfo(itemList[res.tapIndex]); @@ -185,8 +190,8 @@ Page({ }, // 更多 -> 撤销 -> 审核 - moreBtnClickedDetailInfo:function (item){ - if (item == "审核"){ + moreBtnClickedDetailInfo: function(item) { + if (item == "审核") { wx.showModal({ title: "提示", content: "++++" + item + "++++", @@ -337,7 +342,7 @@ Page({ customerDetailsArray.push(dmo) } - if (this.data.goodsNameArr.length <=0 ) { + if (this.data.goodsNameArr.length <= 0) { wx.showToast({ title: '存货不能为空', }) @@ -360,7 +365,7 @@ Page({ }) return; } - + let beginTime = timechage.formatymdERTDate(goodsNameArray[i].applicationStartTime); let endTime = timechage.formatymdERTDate(goodsNameArray[i].applicationEndTime); var dmo = { @@ -378,11 +383,11 @@ Page({ let method = insert; let params = [{ - "Name":this.data.name, + "Name": this.data.name, "MarketingActivityDate": update, "AccountingUnit_ID": unitID, "Department_ID": departmentID, - "Remark":this.data.remark, + "Remark": this.data.remark, "GoodsDetails": goodsDetailsArray, "CustomerDetails": customerDetailsArray,