|
|
@ -223,6 +223,18 @@ export default { |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.list.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '商品列表不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
for (var i = 0; i < this.formobj.list.length; i++) { |
|
|
|
if (this.formobj.list[i].actualInCount === '' ) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '实收数量不能为空' }) |
|
|
|
return |
|
|
|
} else if (parseFloat(this.formobj.list[i].actualInCount) < 1) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '实收数量不能为零' }) |
|
|
|
} |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|
req.save(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
@ -245,14 +257,11 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
for (var i = 0; i < this.formobj.list.length; i++) { |
|
|
|
var item = this.formobj.list[i] |
|
|
|
if (item.actualInCount == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '实收数量不能为空' |
|
|
|
}) |
|
|
|
if (this.formobj.list[i].actualInCount === '' ) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '实收数量不能为空' }) |
|
|
|
return |
|
|
|
} else if (parseFloat(this.formobj.list[i].actualInCount) < 1) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '实收数量不能为零' }) |
|
|
|
} |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|