wk
2024-06-19 581687818adbae8463f805b97ccc404ff1ded863
pages/quality-inspection-page/toc-sampling/toc-sampling-form/toc-sampling-form.vue
@@ -164,6 +164,12 @@
          required: true,
          message: '请选择采样地点',
          trigger: ['blur', 'change']
        }],
        tonnage:[{
          type: 'number',
          required: true,
          message: '请输入吨数',
          trigger: ['blur', 'change']
        }]
      }
    }
@@ -178,12 +184,13 @@
    this.$refs.uForm.setRules(this.rules)
  },
  onLoad(opt) {
    if(opt.params) {  //查看
      this.submitShow = false
      this.modelForm = Object.assign({},JSON.parse(opt.params))
      console.log(this.modelForm,'接收到上个页面传过来的参数===')
      return
      this.$nextTick(() => {
        this.modelForm = Object.assign({},JSON.parse(opt.params))
        console.log(this.modelForm,'接收到上个页面传过来的参数===')
        return
      })
    }
    this.modelForm.samplingTime = todayDate(); //当前时间
    this.modelForm.samplingPerson = uni.getStorageSync('name')
@@ -255,9 +262,9 @@
    },
    inputVal(val) {
      let temp = val.replace(/[^0-9.]+/g,'')
      let temp = val.toString().replace(/[^0-9.]+/g,'')
      this.$nextTick(() => {
        this.modelForm.tonnage = temp
        this.modelForm.tonnage = Number(temp)
      })
    }
  },