|
@@ -971,21 +971,20 @@ export default {
|
|
|
submitDeliverForm() {
|
|
|
this.$refs.deliverForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- for (let i = 0; i < this.goodsList.length; i++) {
|
|
|
- if (
|
|
|
- !this.goodsList[i].adjustNum &&
|
|
|
- this.goodsList[i].isDirectTransfer
|
|
|
- ) {
|
|
|
- this.$errorMsg('请输入直调数量')
|
|
|
- return
|
|
|
+ for(let i=0; i<this.goodsList.length; i++) {
|
|
|
+ console.log(this.goodsList[i].adjustNum , this.goodsList[i].isDirectTransfer);
|
|
|
+ if(this.goodsList[i].isDirectTransfer && Number(this.goodsList[i].adjustNum)<0) {
|
|
|
+ this.$errorMsg('请输入直调数量');
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- const goodsList = this.goodsList.map((item) => {
|
|
|
+
|
|
|
+ let goodsList = this.goodsList.map((item) => {
|
|
|
return {
|
|
|
itemId: item.id,
|
|
|
- qty: item.adjustNum || 0
|
|
|
+ qty: item.adjustNum || 0,
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
const params = {
|
|
|
orderNo: this.listItem.id,
|
|
|
orderDate: this.deliverForm.date + ' 00:00:00',
|
|
@@ -993,6 +992,7 @@ export default {
|
|
|
remark:this.deliverForm.remark,
|
|
|
directItems: goodsList
|
|
|
}
|
|
|
+
|
|
|
adjustDeliver(params).then((res) => {
|
|
|
this.$successMsg()
|
|
|
this.isShowDeliverDialog = false
|