Commit b74c9667 by zhangxw

bug修复

1 parent b7e05923
......@@ -147,6 +147,7 @@ export default {
methods: {
changePrice(value, item, key) {
const decimal = ['standardShelfCost', 'standardSalesCost', 'minPrice', 'maxPrice'].includes(key) ? 2 : 16
const maxNum = ['minPrice', 'maxPrice'].includes(key) ? 200 : null
item[key] = value
? value
.replace(/^0\d/g, '0')
......@@ -158,6 +159,15 @@ export default {
.replace(/\./g, '')
.replace('$#$', '.')
.replace(new RegExp(`^(\\-)*(\\d+)\\.(\\d{${decimal}}).*`, 'g'), '$1$2.$3')
.replace(new RegExp(`^(-?\\d+(?:\\.\\d{0,${decimal}})?).*`), (match) => {
if (maxNum !== null) {
const num = parseFloat(match)
if (num > maxNum) {
return maxNum.toString()
}
}
return match
})
: ''
},
changeComputeFlag(e, item) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!