!227 商品列表:修复添加属性时会返回已存在属性值的问题
Merge pull request !227 from puhui999/dev-to-dev
This commit is contained in:
commit
2e945d29cc
@ -393,7 +393,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/trade/order',
|
path: '/trade',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
name: 'Order',
|
name: 'Order',
|
||||||
meta: {
|
meta: {
|
||||||
@ -401,13 +401,13 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'orderDetail/:orderId(\\d+)', // TODO @puhui999:路径合理的是 trade/order/detail
|
path: 'order/detail/:orderId(\\d+)',
|
||||||
component: () => import('@/views/mall/trade/order/detail/index.vue'),
|
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' }
|
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'),
|
component: () => import('@/views/mall/trade/afterSale/detail/index.vue'),
|
||||||
name: 'TradeAfterSaleDetail',
|
name: 'TradeAfterSaleDetail',
|
||||||
meta: { title: '退款详情', icon: '', activeMenu: '/trade/trade/after-sale' }
|
meta: { title: '退款详情', icon: '', activeMenu: '/trade/trade/after-sale' }
|
||||||
|
@ -80,6 +80,8 @@ const submitForm = async () => {
|
|||||||
if (res[0].values === null) {
|
if (res[0].values === null) {
|
||||||
res[0].values = []
|
res[0].values = []
|
||||||
}
|
}
|
||||||
|
// 不需要属性值
|
||||||
|
res[0].values = []
|
||||||
attributeList.value.push(res[0]) // 因为只用一个
|
attributeList.value.push(res[0]) // 因为只用一个
|
||||||
}
|
}
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<el-descriptions-item label="配送方式: ">
|
<el-descriptions-item label="配送方式: ">
|
||||||
<dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.order.deliveryType" />
|
<dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="formData.order.deliveryType" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
<!-- TODO 营销活动待实现 -->
|
||||||
<el-descriptions-item label="订单类型: ">
|
<el-descriptions-item label="订单类型: ">
|
||||||
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.order.type" />
|
<dict-tag :type="DICT_TYPE.TRADE_ORDER_TYPE" :value="formData.order.type" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@ -38,21 +39,28 @@
|
|||||||
<el-descriptions-item label="申请时间: ">
|
<el-descriptions-item label="申请时间: ">
|
||||||
{{ formatDate(formData.auditTime) }}
|
{{ formatDate(formData.auditTime) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- TODO 营销活动待实现 -->
|
|
||||||
<el-descriptions-item label="售后类型: ">
|
<el-descriptions-item label="售后类型: ">
|
||||||
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_TYPE" :value="formData.type" />
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_TYPE" :value="formData.type" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="售后方式: ">
|
<el-descriptions-item label="售后方式: ">
|
||||||
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_WAY" :value="formData.way" />
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_WAY" :value="formData.way" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- TODO @puhui999:金额的格式化 -->
|
<el-descriptions-item label="退款金额: ">
|
||||||
<el-descriptions-item label="退款金额: ">{{ formData.refundPrice }}</el-descriptions-item>
|
{{ floatToFixed2(formData.refundPrice) }}
|
||||||
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="退款原因: ">{{ formData.applyReason }}</el-descriptions-item>
|
<el-descriptions-item label="退款原因: ">{{ formData.applyReason }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="补充描述: ">
|
<el-descriptions-item label="补充描述: ">
|
||||||
{{ formData.applyDescription }}
|
{{ formData.applyDescription }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- TODO @puhui999:数组,图片 -->
|
<el-descriptions-item label="凭证图片: ">
|
||||||
<el-descriptions-item label="凭证图片: "> {{ formData.applyPicUrls }}</el-descriptions-item>
|
<el-image
|
||||||
|
v-for="(item, index) in formData.applyPicUrls"
|
||||||
|
:key="index"
|
||||||
|
:src="item.url"
|
||||||
|
class="w-60px h-60px mr-10px"
|
||||||
|
@click="imagePreview(formData.applyPicUrls)"
|
||||||
|
/>
|
||||||
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
<!-- 退款状态 -->
|
<!-- 退款状态 -->
|
||||||
@ -60,13 +68,16 @@
|
|||||||
<el-descriptions-item label="退款状态: ">
|
<el-descriptions-item label="退款状态: ">
|
||||||
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_STATUS" :value="formData.status" />
|
<dict-tag :type="DICT_TYPE.TRADE_AFTER_SALE_STATUS" :value="formData.status" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<!-- TODO @puhui999:不同状态,展示不同按钮 -->
|
|
||||||
<el-descriptions-item label-class-name="no-colon">
|
<el-descriptions-item label-class-name="no-colon">
|
||||||
<el-button type="primary" @click="openForm('agree')">同意售后</el-button>
|
<el-button v-if="formData.status === 10" type="primary" @click="agree">同意售后</el-button>
|
||||||
<el-button type="primary" @click="openForm('disagree')">拒绝售后</el-button>
|
<el-button v-if="formData.status === 10" type="primary" @click="disagree">
|
||||||
<el-button type="primary" @click="openForm('receive')">确认收货</el-button>
|
拒绝售后
|
||||||
<el-button type="primary" @click="openForm('refuse')">拒绝收货</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="openForm('refund')">确认退款</el-button>
|
<el-button v-if="formData.status === 30" type="primary" @click="receive">
|
||||||
|
确认收货
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="formData.status === 30" type="primary" @click="refuse">拒绝收货</el-button>
|
||||||
|
<el-button v-if="formData.status === 40" type="primary" @click="refund">确认退款</el-button>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template #label><span style="color: red">提醒: </span></template>
|
<template #label><span style="color: red">提醒: </span></template>
|
||||||
@ -123,7 +134,9 @@ import * as AfterSaleApi from '@/api/mall/trade/afterSale/index'
|
|||||||
import { floatToFixed2 } from '@/utils'
|
import { floatToFixed2 } from '@/utils'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
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' })
|
defineOptions({ name: 'TradeOrderDetailForm' })
|
||||||
|
|
||||||
@ -141,34 +154,57 @@ const getDetail = async () => {
|
|||||||
formData.value = await AfterSaleApi.getAfterSale(id)
|
formData.value = await AfterSaleApi.getAfterSale(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
/** 各种操作 TODO @puhui999:是不是每个一个方法好点,干净点 */
|
* 同意售后
|
||||||
const openForm = (type: string) => {
|
*/
|
||||||
switch (type) {
|
const agree = () => {
|
||||||
case 'agree':
|
message.confirm('是否同意售后?').then(() => {
|
||||||
message.confirm('是否同意售后?').then(() => {
|
AfterSaleApi.agree(formData.value.id)
|
||||||
AfterSaleApi.agree(formData.value.id)
|
})
|
||||||
})
|
}
|
||||||
break
|
/**
|
||||||
case 'disagree':
|
* 拒绝售后
|
||||||
updateAuditReasonFormRef.value?.open(formData.value)
|
*/
|
||||||
break
|
const disagree = () => {
|
||||||
case 'receive':
|
updateAuditReasonFormRef.value?.open(formData.value)
|
||||||
message.confirm('是否确认收货?').then(() => {
|
}
|
||||||
AfterSaleApi.receive(formData.value.id)
|
/**
|
||||||
})
|
* 确认收货
|
||||||
break
|
*/
|
||||||
case 'refuse':
|
const receive = () => {
|
||||||
message.confirm('是否拒绝收货?').then(() => {
|
message.confirm('是否确认收货?').then(() => {
|
||||||
AfterSaleApi.refuse(formData.value.id)
|
AfterSaleApi.receive(formData.value.id)
|
||||||
})
|
})
|
||||||
break
|
}
|
||||||
case 'refund':
|
/**
|
||||||
message.confirm('是否确认退款?').then(() => {
|
* 拒绝收货
|
||||||
AfterSaleApi.refund(formData.value.id)
|
*/
|
||||||
})
|
const refuse = () => {
|
||||||
break
|
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 () => {
|
onMounted(async () => {
|
||||||
await getDetail()
|
await getDetail()
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as AfterSaleApi from '@/api/mall/trade/afterSale/index'
|
import * as AfterSaleApi from '@/api/mall/trade/afterSale/index'
|
||||||
|
|
||||||
// TODO @puhui999:是不是改成 AfterSaleDisagreeForm ,更明确
|
defineOptions({ name: 'AfterSaleDisagreeForm' })
|
||||||
defineOptions({ name: 'UpdateAuditReasonForm' })
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
@ -208,10 +208,10 @@
|
|||||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||||
import { floatToFixed2 } from '@/utils'
|
import { floatToFixed2 } from '@/utils'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import OrderUpdateRemarkForm from '@/views/mall/trade/order/components/OrderUpdateRemarkForm.vue'
|
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
|
||||||
import OrderDeliveryForm from '@/views/mall/trade/order/components/OrderDeliveryForm.vue'
|
import OrderDeliveryForm from '@/views/mall/trade/order/form/OrderDeliveryForm.vue'
|
||||||
import OrderUpdateAddressForm from '@/views/mall/trade/order/components/OrderUpdateAddressForm.vue'
|
import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAddressForm.vue'
|
||||||
import OrderUpdatePriceForm from '@/views/mall/trade/order/components/OrderUpdatePriceForm.vue'
|
import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'TradeOrderDetailForm' })
|
defineOptions({ name: 'TradeOrderDetailForm' })
|
||||||
|
|
||||||
|
@ -34,7 +34,6 @@ import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
|||||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||||
import { copyValueToTarget } from '@/utils'
|
import { copyValueToTarget } from '@/utils'
|
||||||
|
|
||||||
// TODO @puhui999:要不 Form 保持和别的模块一样,和 index.vue 放在一个目录下,不作为 components;components 更多要支持给多个模块使用哈。
|
|
||||||
defineOptions({ name: 'OrderDeliveryForm' })
|
defineOptions({ name: 'OrderDeliveryForm' })
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
@ -64,10 +64,17 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- TODO @puhui999:要不加个 deliveryType 筛选;配送方式;然后如果选了快递,就有【快递公司】筛选;如果选了自提,就有【自提门店】;然后把他们这 3 个,坐在一个 el-form-item 里;
|
<el-form-item label="配送方式" prop="deliveryType">
|
||||||
目的是;有的时候,会筛选门店,然后做核销;这个时候,就需要筛选自提门店;
|
<el-select v-model="queryParams.deliveryType" class="!w-280px" clearable placeholder="全部">
|
||||||
-->
|
<el-option
|
||||||
<el-form-item label="快递公司" prop="type">
|
v-for="dict in getIntDictOptions(DICT_TYPE.TRADE_DELIVERY_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="queryParams.deliveryType === 1" label="快递公司">
|
||||||
<el-select v-model="queryParams.logisticsId" class="!w-280px" clearable placeholder="全部">
|
<el-select v-model="queryParams.logisticsId" class="!w-280px" clearable placeholder="全部">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in deliveryExpressList"
|
v-for="item in deliveryExpressList"
|
||||||
@ -77,7 +84,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="自提门店" prop="type">
|
<el-form-item v-if="queryParams.deliveryType === 2" label="自提门店">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.pickUpStoreId"
|
v-model="queryParams.pickUpStoreId"
|
||||||
class="!w-280px"
|
class="!w-280px"
|
||||||
@ -309,8 +316,8 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { FormInstance, TableColumnCtx } from 'element-plus'
|
import type { FormInstance, TableColumnCtx } from 'element-plus'
|
||||||
import OrderDeliveryForm from './components/OrderDeliveryForm.vue'
|
import OrderDeliveryForm from '@/views/mall/trade/order/form/OrderDeliveryForm.vue'
|
||||||
import OrderUpdateRemarkForm from './components/OrderUpdateRemarkForm.vue'
|
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
|
||||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||||
import * as PickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
import * as PickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
||||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
||||||
@ -337,11 +344,13 @@ const queryParams = reactive({
|
|||||||
userMobile: '',
|
userMobile: '',
|
||||||
receiverName: '',
|
receiverName: '',
|
||||||
receiverMobile: '',
|
receiverMobile: '',
|
||||||
|
|
||||||
terminal: '',
|
terminal: '',
|
||||||
type: null,
|
type: null,
|
||||||
status: null,
|
status: null,
|
||||||
payChannelCode: '',
|
payChannelCode: '',
|
||||||
createTime: [],
|
createTime: [],
|
||||||
|
deliveryType: null,
|
||||||
spuName: '',
|
spuName: '',
|
||||||
itemCount: '',
|
itemCount: '',
|
||||||
pickUpStoreId: [],
|
pickUpStoreId: [],
|
||||||
|
Loading…
Reference in New Issue
Block a user