From 957fa63e5b03afa42a1f44531669b65f6cffe10e Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 25 Mar 2024 23:03:26 +0800 Subject: [PATCH] 11 --- pages/index/orderDetail.vue | 49 ++++++++++++++++++------------------ pages/inventory/addGoods.vue | 23 ++++++++++++----- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/pages/index/orderDetail.vue b/pages/index/orderDetail.vue index 6e47bab..4d6c900 100644 --- a/pages/index/orderDetail.vue +++ b/pages/index/orderDetail.vue @@ -810,29 +810,30 @@ this.list[i].stockLogList.push(this.list[i].stockLogList1[m]) } } - } + } + console.log(this.list) for (var i = 0; i < this.list.length; i++) { - if(this.list[i].stockLogList.length == 0){ - this.tui.toast("请选择退货商品") - return; - } - for (var m = 0; m < this.list[i].stockLogList.length; m++) { - if(this.list[i].stockLogList[m].returnCount <= 0){ - this.tui.toast("退货数量不能为零") - return; - } - this.list[i].stockLogList[m].productCount = this.list[i].stockLogList[m].returnCount - if(this.list[i].stockLogList.length >0){ - if (m == 0) { - this.list[i].productCount = this.list[i].stockLogList[m].productCount - } else { - this.list[i].productCount += this.list[i].stockLogList[m].productCount + if(this.list[i].stockLogList.length != 0){ + for (var m = 0; m < this.list[i].stockLogList.length; m++) { + if(this.list[i].stockLogList[m].returnCount <= 0){ + this.tui.toast("退货数量不能为零") + return; } - } - } - this.list[i].stockLogList1 = this.list[i].stockLogList - if(this.list[i].stockLogList1.length <= 0){ - this.list[i].productCount = 0 + this.list[i].stockLogList[m].productCount = this.list[i].stockLogList[m].returnCount + if(this.list[i].stockLogList.length >0){ + if (m == 0) { + this.list[i].productCount = this.list[i].stockLogList[m].productCount + } else { + this.list[i].productCount += this.list[i].stockLogList[m].productCount + } + } + } + this.list[i].stockLogList1 = this.list[i].stockLogList + if(this.list[i].stockLogList1.length <= 0){ + this.list[i].productCount = 0 + } + }else{ + } } for (var i = 0; i < this.list.length; i++) { @@ -896,11 +897,9 @@ }, // 取消订单 cancelOrder(type) { - this.tui.modal("提示", "您确定要取消该订单吗?", true, (res) => { + this.tui.modal("提示", "您确定要取消吗?", true, (res) => { if (res) { - var data={},url - - + var data={},url if (type == 'qxdd') { data = { status: 2, diff --git a/pages/inventory/addGoods.vue b/pages/inventory/addGoods.vue index 8a3ad3b..c44e51e 100644 --- a/pages/inventory/addGoods.vue +++ b/pages/inventory/addGoods.vue @@ -51,12 +51,13 @@ trim="all" /> - - 删除商品 - 保存 + + + + + + - - @@ -85,7 +86,8 @@ typeItem:{}, arrtChange: [], categoryId:'', - dataList:[], + dataList:[], + type:'add', rules: { categoryId: { rules: [{ @@ -141,6 +143,7 @@ }, onLoad(option) { if(option.dataList){ + this.type = 'edit' this.dataList = JSON.parse(option.dataList) this.formData.productName = this.dataList.productName this.formData.barcode = this.dataList.barcode @@ -371,5 +374,13 @@ .content-list { height: 70rpx; border: 1px solid #eee; + } + button{ + height: 90rpx; + line-height: 90rpx; + font-size: 36rpx; + color: #fff; + background: #5fd9ee; + border-radius: 10px; } \ No newline at end of file