diff --git a/sgzb-ui/src/views/claimAndreturn/picking/outbound/index.vue b/sgzb-ui/src/views/claimAndreturn/picking/outbound/index.vue index 68c28f42..bce46414 100644 --- a/sgzb-ui/src/views/claimAndreturn/picking/outbound/index.vue +++ b/sgzb-ui/src/views/claimAndreturn/picking/outbound/index.vue @@ -363,10 +363,10 @@ ref="codeOutForm" size="small" :inline="true" - label-width="100px" + label-width="110px" > 待出库数量:{{ outNum }} - + - + { - let obj = { - id: this.outObj.id, - maId: item, - manageType: 0, - carCode: this.codeOutForm.carCode, - typeId: this.outObj.typeId, - parentId: this.outObj.parentId, - outNum: 1, - taskId: this.outObj.taskId, - createBy: sessionStorage.getItem('userId'), - companyId: this.outObj.companyId, - } - return obj - }) - // console.log(params) - submitOut(params).then((res) => { - this.$modal.msgSuccess('出库成功') - this.openCode = false - this.handleDialogQuery() - this.handleQuery() - }) - } else { - this.$modal.msgError('所选机具编码已超出出库数量!') - } + this.$refs.codeOutForm.validate((valid) => { + if (!valid) return + if (this.maCodeList.length <= this.outObj.outNum) { + let params = this.maCodeList.map((item) => { + let obj = { + id: this.outObj.id, + maId: item, + manageType: 0, + carCode: this.codeOutForm.carCode, + typeId: this.outObj.typeId, + parentId: this.outObj.parentId, + outNum: 1, + taskId: this.outObj.taskId, + createBy: sessionStorage.getItem('userId'), + companyId: this.outObj.companyId, + } + return obj + }) + // console.log(params) + submitOut(params).then((res) => { + this.$modal.msgSuccess('出库成功') + this.openCode = false + this.handleDialogQuery() + this.handleQuery() + }) + } else { + this.$modal.msgError('所选机具编码已超出出库数量!') + } + }) }, //数量出库保存 saveNumOut() { - this.outNumList[0].carCode = this.numOutForm.carCode - let param = this.outNumList - submitNumOut(param).then((res) => { - this.$modal.msgSuccess('出库成功') - this.openNum = false - this.handleDialogQuery() - this.handleQuery() + this.$refs.numOutForm.validate((valid) => { + if (!valid) return + this.outNumList[0].carCode = this.numOutForm.carCode + let param = this.outNumList + submitNumOut(param).then((res) => { + this.$modal.msgSuccess('出库成功') + this.openNum = false + this.handleDialogQuery() + this.handleQuery() + }) }) },