mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-08-10 16:11:53 +08:00
code review:订单列表、订单详情
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||
|
||||
// TODO @puhui999:是不是名字叫 OrderDeliveryForm 保持统一
|
||||
defineOptions({ name: 'DeliveryOrderForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
@@ -40,7 +41,7 @@ const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const radio = ref('1')
|
||||
const radio = ref('1') // TODO @puhui999:尽量不用 radio 这种命名,无业务含义。这里的话,可以考虑用 expressType,如果值是 express,则是快递;none 则是无;未来做同城配送,就比较容易拓展啦;
|
||||
const formData = ref<TradeOrderApi.DeliveryVO>({
|
||||
id: 0, // 订单编号
|
||||
logisticsId: null, // 物流公司编号
|
||||
@@ -48,6 +49,7 @@ const formData = ref<TradeOrderApi.DeliveryVO>({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
// TODO @puhui999:每次点击发货的时候,是不是可以把之前的信息带过来哈。
|
||||
/** 打开弹窗 */
|
||||
const open = async (orderId: number) => {
|
||||
resetForm()
|
||||
@@ -65,6 +67,7 @@ const submitForm = async () => {
|
||||
try {
|
||||
const data = unref(formData)
|
||||
if (radio.value === '2') {
|
||||
// 无需发货的情况
|
||||
data.logisticsId = 0
|
||||
data.logisticsNo = ''
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@
|
||||
<el-form-item label="收件人手机">
|
||||
<el-input v-model="formData.receiverMobile" />
|
||||
</el-form-item>
|
||||
<!-- TODO @puhui999:应该是个地区下拉框,可以看下 UserForm 所在地 -->
|
||||
<el-form-item label="收件人地区编号">
|
||||
<el-input v-model="formData.receiverAreaId" />
|
||||
</el-form-item>
|
||||
@@ -24,6 +25,7 @@
|
||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||
import { copyValueToTarget } from '@/utils'
|
||||
|
||||
// TODO @puhui999:OrderAdjustAddressForm 改成 OrderUpdateAddressForm 更新哈,保持统一;
|
||||
defineOptions({ name: 'OrderAdjustAddressForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
@@ -23,6 +23,7 @@ import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||
import { convertToInteger, formatToFraction } from '@/utils'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
|
||||
// TODO @puhui999:OrderAdjustPriceForm 改成 OrderUpdatePriceForm 更新哈,保持统一;
|
||||
defineOptions({ name: 'OrderAdjustPriceForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<el-descriptions title="订单信息">
|
||||
<el-descriptions-item label="订单号: ">{{ orderInfo.no }}</el-descriptions-item>
|
||||
<el-descriptions-item label="配送方式: ">
|
||||
<dict-tag :type="DICT_TYPE.DELIVERY_TYPE" :value="orderInfo.deliveryType" />
|
||||
<dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="orderInfo.deliveryType" />
|
||||
</el-descriptions-item>
|
||||
<!-- TODO 营销活动待实现 -->
|
||||
<el-descriptions-item label="营销活动: ">秒杀活动</el-descriptions-item>
|
||||
@@ -20,7 +20,7 @@
|
||||
<el-descriptions-item label="商家备注: ">{{ orderInfo.remark }}</el-descriptions-item>
|
||||
<el-descriptions-item label="支付单号: ">{{ orderInfo.payOrderId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="付款方式: ">
|
||||
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="orderInfo.payChannelCode" />
|
||||
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="orderInfo.payChannelCode" />
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="买家: ">{{ orderInfo.user.nickname }}</el-descriptions-item> -->
|
||||
<!-- TODO 芋艿:待实现:跳转会员 -->
|
||||
@@ -41,14 +41,10 @@
|
||||
<dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="orderInfo.status" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-class-name="no-colon">
|
||||
<el-button size="small" type="primary" @click="openForm('adjustPrice')">调整价格</el-button>
|
||||
<el-button size="small" type="primary" @click="openForm('remark')">备注</el-button>
|
||||
<el-button size="small" type="primary" @click="openForm('delivery')">发货</el-button>
|
||||
<el-button size="small" type="primary" @click="openForm('adjustAddress')">
|
||||
修改地址
|
||||
</el-button>
|
||||
<!-- TODO 后台商家也需要收货功能吗? -->
|
||||
<el-button size="small" type="primary">确认收货</el-button>
|
||||
<el-button type="primary" @click="openForm('adjustPrice')">调整价格</el-button>
|
||||
<el-button type="primary" @click="openForm('remark')">备注</el-button>
|
||||
<el-button type="primary" @click="openForm('delivery')">发货</el-button>
|
||||
<el-button type="primary" @click="openForm('adjustAddress')">修改地址</el-button>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label><span style="color: red">提醒: </span></template>
|
||||
@@ -201,6 +197,8 @@
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 各种操作的弹窗 -->
|
||||
<DeliveryOrderForm ref="deliveryFormRef" @success="getDetail" />
|
||||
<OrderRemarksForm ref="remarksFormRef" @success="getDetail" />
|
||||
<OrderAdjustAddressForm ref="adjustAddressFormRef" @success="getDetail" />
|
||||
@@ -215,10 +213,12 @@ import DeliveryOrderForm from '@/views/mall/trade/order/components/DeliveryOrder
|
||||
import OrderAdjustAddressForm from '@/views/mall/trade/order/components/OrderAdjustAddressForm.vue'
|
||||
import OrderAdjustPriceForm from '@/views/mall/trade/order/components/OrderAdjustPriceForm.vue'
|
||||
|
||||
// TODO @puhui999:TradeOrderDetailForm 可以挪到 order/detail/index.vue 中,它是一个 vue 界面哈。
|
||||
defineOptions({ name: 'TradeOrderDetailForm' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { params } = useRoute() // 查询参数
|
||||
// TODO @puhui999:orderInfo 应该不用把属性弄出来也;
|
||||
const orderInfo = ref<TradeOrderApi.OrderVO>({
|
||||
no: '',
|
||||
createTime: null,
|
||||
@@ -263,6 +263,7 @@ const orderInfo = ref<TradeOrderApi.OrderVO>({
|
||||
user: {}
|
||||
})
|
||||
|
||||
// TODO @puhui999:这个改成直接读属性,不用按照这种写法;
|
||||
const detailGroups = ref([
|
||||
{
|
||||
title: '物流信息',
|
||||
@@ -281,6 +282,7 @@ const detailGroups = ref([
|
||||
}
|
||||
])
|
||||
|
||||
// TODO @puhui999:从后台读数据哈。
|
||||
const detailInfo = ref({
|
||||
// 物流信息
|
||||
expressInfo: {
|
||||
|
@@ -14,6 +14,7 @@
|
||||
<script lang="ts" setup>
|
||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||
|
||||
// TODO @puhui999:OrderRemarksForm 改成 OrderUpdateRemarkForm 更新哈,保持统一;
|
||||
defineOptions({ name: 'OrderRemarksForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
|
Reference in New Issue
Block a user