| | |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.ruleForm, "保存内容处理", this.tableData) |
| | | let deliveryList = this.tableData.map((item) => { |
| | | return { |
| | | outsourcingOrderProductID: item.id, |
| | | sendAmount: item.deliveryAmount |
| | | let isDeliveryCount = false |
| | | this.tableData.map((item) => { |
| | | if (item.deliveryAmount == 0) { |
| | | isDeliveryCount = true |
| | | return |
| | | } |
| | | }) |
| | | let params = { |
| | | carrier: this.ruleForm.carrier, |
| | | deliveryList: deliveryList, |
| | | number: this.ruleForm.number, |
| | | outsourcingOrderID: this.editRow.infomation.id, |
| | | waybillNumber: this.ruleForm.waybillNumber |
| | | if (isDeliveryCount) { |
| | | this.$message.error("发货数量必须大于0") |
| | | } else { |
| | | let deliveryList = this.tableData.map((item) => { |
| | | return { |
| | | outsourcingOrderProductID: item.id, |
| | | sendAmount: item.deliveryAmount |
| | | } |
| | | }) |
| | | let params = { |
| | | carrier: this.ruleForm.carrier, |
| | | deliveryList: deliveryList, |
| | | number: this.ruleForm.number, |
| | | outsourcingOrderID: this.editRow.infomation.id, |
| | | waybillNumber: this.ruleForm.waybillNumber |
| | | } |
| | | saveDelivery(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.handleClose() |
| | | this.$message.success("发货成功") |
| | | this.$emit("reRreshData") |
| | | } |
| | | }) |
| | | } |
| | | saveDelivery(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.handleClose() |
| | | this.$message.success("发货成功") |
| | | this.$emit("reRreshData") |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |