From 573608353478b8e6687409e30c47eb7e9b00da2b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 11 Feb 2024 22:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20ERP=EF=BC=9A=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=94=80=E5=94=AE=E5=85=A5=E5=BA=93=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/erp/sale/out/SaleOutForm.vue | 19 +++++++++++++------ .../sale/out/components/SaleOutItemForm.vue | 18 ++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/views/erp/sale/out/SaleOutForm.vue b/src/views/erp/sale/out/SaleOutForm.vue index 9d71bbda..e83b8d19 100644 --- a/src/views/erp/sale/out/SaleOutForm.vue +++ b/src/views/erp/sale/out/SaleOutForm.vue @@ -210,7 +210,7 @@ const formData = ref({ discountPrice: 0, totalPrice: 0, otherPrice: 0, - payPrice: 0, + payPrice: undefined, orderNo: undefined, items: [], no: undefined // 出库单号,后端返回 @@ -242,12 +242,13 @@ watch( const discountPrice = val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0 // debugger - // TODO 芋艿:这里有问题 - const payPrice = totalPrice - discountPrice + val.otherPrice + // TODO 芋艿:payPrice 自动计算会有问题,界面上看到修改了,传递到后端还是没改过来 + // const payPrice = totalPrice - discountPrice + val.otherPrice // 赋值 formData.value.discountPrice = discountPrice formData.value.totalPrice = totalPrice - discountPrice - formData.value.payPrice = payPrice + // val.payPrice = payPrice + // formData.value.payPrice = payPrice }, { deep: true } ) @@ -297,7 +298,13 @@ const handleSaleOrderChange = (order: SaleOrderVO) => { formData.value.remark = order.remark formData.value.fileUrl = order.fileUrl // 将订单项设置到出库单项 - formData.value.items = order.items.filter((item) => item.count > item.outCount) + order.items.forEach((item) => { + item.totalCount = item.count + item.count = item.totalCount - item.outCount + item.orderItemId = item.id + item.id = undefined + }) + formData.value.items = order.items.filter((item) => item.count > 0) } /** 提交表单 */ @@ -339,7 +346,7 @@ const resetForm = () => { discountPrice: 0, totalPrice: 0, otherPrice: 0, - payPrice: 0, + payPrice: undefined, items: [] } formRef.value?.resetFields() diff --git a/src/views/erp/sale/out/components/SaleOutItemForm.vue b/src/views/erp/sale/out/components/SaleOutItemForm.vue index c12ceb2c..ccd4f161 100644 --- a/src/views/erp/sale/out/components/SaleOutItemForm.vue +++ b/src/views/erp/sale/out/components/SaleOutItemForm.vue @@ -62,14 +62,24 @@ - + - +