| | |
| | | return
|
| | | }
|
| | | var tmp = parseFloat(this.dto.price)
|
| | | if (isNaN(tmp) || ('' + tmp.toFixed(2)) !== ('' + this.dto.price)) {
|
| | | if (isNaN(tmp) || ('' + tmp) !== ('' + this.dto.price)) {
|
| | | this.$message.showToast('商品价格格式错误,精确到分')
|
| | | return
|
| | | }
|
| | |
|
| | | if ((tmp.toFixed(2) + '' + '0') !== tmp.toFixed(3)) {
|
| | | this.$message.showToast('商品价格至多精确到分')
|
| | | // console.log('tmp.toFixed(2)',tmp.toFixed(2),tmp.toFixed(3))
|
| | | return
|
| | | } else {
|
| | | this.dto.price = this.dto.price.toFixed(2)
|
| | | }
|
| | | if (this.dto.price <= 0) {
|
| | | this.$message.showToast('商品价格不能小于等于0')
|
| | | return
|