diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index 1a3e5b20..c6c95e80 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -393,7 +393,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
]
},
{
- path: '/trade/order',
+ path: '/trade',
component: Layout,
name: 'Order',
meta: {
@@ -401,13 +401,13 @@ const remainingRouter: AppRouteRecordRaw[] = [
},
children: [
{
- path: 'orderDetail/:orderId(\\d+)', // TODO @puhui999:路径合理的是 trade/order/detail
+ path: 'order/detail/:orderId(\\d+)',
component: () => import('@/views/mall/trade/order/detail/index.vue'),
- name: 'TradeOrderDetail', // TODO @puhui999:路径合理的是 trade/after-sale/detail
+ name: 'TradeOrderDetail',
meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' }
},
{
- path: 'afterSaleDetail/:orderId(\\d+)',
+ path: 'after-sale/detail/:orderId(\\d+)',
component: () => import('@/views/mall/trade/afterSale/detail/index.vue'),
name: 'TradeAfterSaleDetail',
meta: { title: '退款详情', icon: '', activeMenu: '/trade/trade/after-sale' }
diff --git a/src/views/mall/product/spu/form/ProductPropertyAddForm.vue b/src/views/mall/product/spu/form/ProductPropertyAddForm.vue
index 243cd7a0..a3e09fef 100644
--- a/src/views/mall/product/spu/form/ProductPropertyAddForm.vue
+++ b/src/views/mall/product/spu/form/ProductPropertyAddForm.vue
@@ -80,6 +80,8 @@ const submitForm = async () => {
if (res[0].values === null) {
res[0].values = []
}
+ // 不需要属性值
+ res[0].values = []
attributeList.value.push(res[0]) // 因为只用一个
}
message.success(t('common.createSuccess'))
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 @@