819527061@qq.com
2024-05-30 497b6af6f8b9a66148625e4da5d96881a48120e5
pages/quality-inspection-page/salt-total-sampling/salt-total-sampling-form/salt-total-sampling-form.vue
@@ -167,7 +167,7 @@
          trigger: ['blur', 'change']
        }],
        tonnage:[{
          type: 'string',
          type: 'number',
          required: true,
          message: '请输入吨数',
          trigger: ['blur', 'change']
@@ -185,12 +185,13 @@
    this.$refs.uForm.setRules(this.rules)
  },
  onLoad(opt) {
    if(opt.params) {  //查看
      this.submitShow = false
      this.modelForm = Object.assign({},JSON.parse(opt.params))
      this.$nextTick(() => {
        this.modelForm = Object.assign({},JSON.parse(opt.params))
        return
      })
      console.log(this.modelForm,'接收到上个页面传过来的参数===')
      return
    }
    this.modelForm.samplingTime = todayDate(); //当前时间
    this.modelForm.samplingPerson = uni.getStorageSync('name')
@@ -262,10 +263,14 @@
    },
    inputVal(val) {
      let temp = val.replace(/[^0-9.]+/g,'')
      this.$nextTick(() => {
        this.modelForm.tonnage = temp
      })
      console.log(val,'val----')
      if(val) {
        let temp = val.toString().replace(/[^0-9.]+/g,'')
        this.$nextTick(() => {
          this.modelForm.tonnage = Number(temp)
        })
      }
    }
  },
}