procurementMixins.js 628 B

1234567891011121314151617181920
  1. export default {
  2. methods: {
  3. // 校验 只能输入数字和小数点
  4. fpNumInput(e, str) {
  5. const o = e.target
  6. const inputRule = /[^\d.]/g //修改inputRule 的值
  7. this.$nextTick(() => {
  8. this[str].price = o.value.replace(inputRule, '')
  9. })
  10. },
  11. // 校验 只能输入数字
  12. NumberInput(e, str) {
  13. const o = e.target
  14. const inputRule = /[^\d]/g //修改inputRule 的值
  15. this.$nextTick(() => {
  16. this[str].number = o.value.replace(inputRule, '')
  17. })
  18. },
  19. }
  20. }