From f5a177246480702ecc3745aabdc3a9806fc8125d Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 31 Aug 2023 15:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=94=AE=E5=90=8E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E5=AE=8C=E5=96=84=E9=83=A8=E5=88=86=20TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/trade/afterSale/detail/index.vue | 114 ++++++++++++------ .../AfterSaleDisagreeForm.vue} | 3 +- src/views/mall/trade/order/detail/index.vue | 8 +- .../OrderDeliveryForm.vue | 0 .../OrderUpdateAddressForm.vue | 0 .../OrderUpdatePriceForm.vue | 0 .../OrderUpdateRemarkForm.vue | 0 src/views/mall/trade/order/index.vue | 4 +- 8 files changed, 82 insertions(+), 47 deletions(-) rename src/views/mall/trade/afterSale/{components/UpdateAuditReasonForm.vue => form/AfterSaleDisagreeForm.vue} (94%) rename src/views/mall/trade/order/{components => form}/OrderDeliveryForm.vue (100%) rename src/views/mall/trade/order/{components => form}/OrderUpdateAddressForm.vue (100%) rename src/views/mall/trade/order/{components => form}/OrderUpdatePriceForm.vue (100%) rename src/views/mall/trade/order/{components => form}/OrderUpdateRemarkForm.vue (100%) diff --git a/src/views/mall/trade/afterSale/detail/index.vue b/src/views/mall/trade/afterSale/detail/index.vue index fd989338..7802a805 100644 --- a/src/views/mall/trade/afterSale/detail/index.vue +++ b/src/views/mall/trade/afterSale/detail/index.vue @@ -6,6 +6,7 @@ + @@ -38,21 +39,28 @@ {{ formatDate(formData.auditTime) }} - - - {{ formData.refundPrice }} + + {{ floatToFixed2(formData.refundPrice) }} + {{ formData.applyReason }} {{ formData.applyDescription }} - - {{ formData.applyPicUrls }} + + + @@ -60,13 +68,16 @@ - - 同意售后 - 拒绝售后 - 确认收货 - 拒绝收货 - 确认退款 + 同意售后 + + 拒绝售后 + + + 确认收货 + + 拒绝收货 + 确认退款 @@ -123,7 +134,9 @@ import * as AfterSaleApi from '@/api/mall/trade/afterSale/index' import { floatToFixed2 } from '@/utils' import { DICT_TYPE } from '@/utils/dict' import { formatDate } from '@/utils/formatTime' -import UpdateAuditReasonForm from '@/views/mall/trade/afterSale/components/UpdateAuditReasonForm.vue' +import UpdateAuditReasonForm from '@/views/mall/trade/afterSale/form/AfterSaleDisagreeForm.vue' +import { createImageViewer } from '@/components/ImageViewer' +import { isArray } from '@/utils/is' defineOptions({ name: 'TradeOrderDetailForm' }) @@ -141,34 +154,57 @@ const getDetail = async () => { formData.value = await AfterSaleApi.getAfterSale(id) } } - -/** 各种操作 TODO @puhui999:是不是每个一个方法好点,干净点 */ -const openForm = (type: string) => { - switch (type) { - case 'agree': - message.confirm('是否同意售后?').then(() => { - AfterSaleApi.agree(formData.value.id) - }) - break - case 'disagree': - updateAuditReasonFormRef.value?.open(formData.value) - break - case 'receive': - message.confirm('是否确认收货?').then(() => { - AfterSaleApi.receive(formData.value.id) - }) - break - case 'refuse': - message.confirm('是否拒绝收货?').then(() => { - AfterSaleApi.refuse(formData.value.id) - }) - break - case 'refund': - message.confirm('是否确认退款?').then(() => { - AfterSaleApi.refund(formData.value.id) - }) - break +/** + * 同意售后 + */ +const agree = () => { + message.confirm('是否同意售后?').then(() => { + AfterSaleApi.agree(formData.value.id) + }) +} +/** + * 拒绝售后 + */ +const disagree = () => { + updateAuditReasonFormRef.value?.open(formData.value) +} +/** + * 确认收货 + */ +const receive = () => { + message.confirm('是否确认收货?').then(() => { + AfterSaleApi.receive(formData.value.id) + }) +} +/** + * 拒绝收货 + */ +const refuse = () => { + message.confirm('是否拒绝收货?').then(() => { + AfterSaleApi.refuse(formData.value.id) + }) +} +/** + * 确认退款 + */ +const refund = () => { + message.confirm('是否确认退款?').then(() => { + AfterSaleApi.refund(formData.value.id) + }) +} +/** 图片预览 */ +const imagePreview = (args) => { + const urlList = [] + if (isArray(args)) { + args.forEach((item) => { + urlList.push(item.url) + }) + } else { + urlList.push(args) } + createImageViewer({ + urlList + }) } onMounted(async () => { await getDetail() diff --git a/src/views/mall/trade/afterSale/components/UpdateAuditReasonForm.vue b/src/views/mall/trade/afterSale/form/AfterSaleDisagreeForm.vue similarity index 94% rename from src/views/mall/trade/afterSale/components/UpdateAuditReasonForm.vue rename to src/views/mall/trade/afterSale/form/AfterSaleDisagreeForm.vue index 45f5d447..1fa2b0f5 100644 --- a/src/views/mall/trade/afterSale/components/UpdateAuditReasonForm.vue +++ b/src/views/mall/trade/afterSale/form/AfterSaleDisagreeForm.vue @@ -19,8 +19,7 @@