智慧农业后台管理页面
guoshilong
2022-09-27 a2b823373db0235f2b42669596f69a126b722961
加工产品加工加工数量和产品数量不能为负数
1 files modified
46 ■■■■■ changed files
src/views/farmplant/process.vue 46 ●●●●● patch | view | raw | blame | history
src/views/farmplant/process.vue
@@ -293,7 +293,7 @@
                salePrice: "",
                createUser: "",
                saleBrand: "",
                processName:"",
                weight:"",
                type:"1",
@@ -761,10 +761,10 @@
                    })
                    column.dicData = data
                })
            }
        }
    },
    },
    mounted () {
    },
    created () {
@@ -786,7 +786,7 @@
                            type: "warning",
                            message: "销售数量和销售价格不能为负数!"
                        })
                        done()
                        done()
                    }else{
                        insert(this.form).then(() => {
                            this.onLoad(this.page)
@@ -813,21 +813,29 @@
            this.$refs.form.validate((vaild, done) => {
                if (vaild) {
                    this.formJG['farmId'] = this.$farmId
                    submitProcessJG(this.formJG).then(() => {
                        this.onLoad(this.page)
                        this.$message({
                            type: "success",
                            message: "操作成功!"
                        })
                        //提交完成,关闭窗口清空数据
                        that.cleanJGData()
                        done()
                    }, error => {
                        window.console.log(error)
                        //提交失败,关闭窗口清空数据
                        that.cleanJGData()
                        done()
                  if(this.formJG.saleNum <0 || this.formJG.processNum<0){
                    this.$message({
                      type: "warning",
                      message: "加工数量和产品数量不能为负数!"
                    })
                    done()
                  }else {
                    submitProcessJG(this.formJG).then(() => {
                      this.onLoad(this.page)
                      this.$message({
                        type: "success",
                        message: "操作成功!"
                      })
                      //提交完成,关闭窗口清空数据
                      that.cleanJGData()
                      done()
                    }, error => {
                      window.console.log(error)
                      //提交失败,关闭窗口清空数据
                      that.cleanJGData()
                      done()
                    })
                  }
                }
            })
        },
@@ -915,7 +923,7 @@
                this.form.processName = data.processName
                this.visible = true
            } else if (index == 1) {    //库存损耗
            } else if (index == 1) {    //库存损耗
                this.formKC.name = this.userInfo.nick_name
                this.formKC.createUser = this.userInfo.user_id
                this.formKC.weight = data.productInventoryNum