code review:订单列表、订单详情

(cherry picked from commit cfbc2ed74c)
This commit is contained in:
YunaiV 2023-08-23 00:43:40 +08:00 committed by shizhong
parent 6556feed21
commit 46ab58ddf0
11 changed files with 140 additions and 90 deletions

View File

@ -20,7 +20,7 @@ export interface BargainActivityVO {
successCount?: number // 砍价成功数量 successCount?: number // 砍价成功数量
} }
// 砍价活动所需属性。 选择的商品和属性的时候使用方便使用活动的通用封装 // 砍价活动所需属性。选择的商品和属性的时候使用方便使用活动的通用封装
export interface BargainProductVO { export interface BargainProductVO {
spuId: number spuId: number
skuId: number skuId: number

View File

@ -90,6 +90,7 @@ export enum DICT_TYPE {
USER_TYPE = 'user_type', USER_TYPE = 'user_type',
COMMON_STATUS = 'common_status', COMMON_STATUS = 'common_status',
SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id', SYSTEM_TENANT_PACKAGE_ID = 'system_tenant_package_id',
TERMINAL = 'terminal', // 终端
// ========== SYSTEM 模块 ========== // ========== SYSTEM 模块 ==========
SYSTEM_USER_SEX = 'system_user_sex', SYSTEM_USER_SEX = 'system_user_sex',
@ -131,7 +132,7 @@ export enum DICT_TYPE {
BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type', BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type',
// ========== PAY 模块 ========== // ========== PAY 模块 ==========
PAY_CHANNEL_CODE_TYPE = 'pay_channel_code_type', // 支付渠道编码类型 PAY_CHANNEL_CODE = 'pay_channel_code', // 支付渠道编码类型
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态 PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态 PAY_REFUND_STATUS = 'pay_refund_status', // 退款订单状态
PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态 PAY_NOTIFY_STATUS = 'pay_notify_status', // 商户支付回调状态
@ -156,7 +157,7 @@ export enum DICT_TYPE {
TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型 TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型
TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态 TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态
TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态 TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态
TERMINAL = 'terminal', // 终端 TRADE_DELIVERY_TYPE = 'trade_delivery_type', // 配送方式
// ========== MALL - 营销模块 ========== // ========== MALL - 营销模块 ==========
PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型 PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型
@ -165,8 +166,5 @@ export enum DICT_TYPE {
PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态 PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态
PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式 PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式
PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态 PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_CONDITION_TYPE = 'promotion_condition_type' // 营销的条件类型枚举
// ========== MALL - 物流模块 ==========
DELIVERY_TYPE = 'delivery_type' // 配送方式
} }

View File

@ -83,17 +83,17 @@ const ruleConfig: RuleConfig[] = [
{ {
name: 'productConfig.bargainFirstPrice', name: 'productConfig.bargainFirstPrice',
rule: (arg) => arg > 0, rule: (arg) => arg > 0,
message: '商品砍价起始价格不能小于0 ' message: '商品砍价起始价格不能小于 0 '
}, },
{ {
name: 'productConfig.bargainPrice', name: 'productConfig.bargainPrice',
rule: (arg) => arg >= 0, rule: (arg) => arg >= 0,
message: '商品砍价底价不能小于0 ' message: '商品砍价底价不能小于 0 '
}, },
{ {
name: 'productConfig.stock', name: 'productConfig.stock',
rule: (arg) => arg >= 1, rule: (arg) => arg >= 1,
message: '商品活动库存不能小于1 ' message: '商品活动库存不能小于 1 '
} }
] ]
const selectSpu = (spuId: number, skuIds: number[]) => { const selectSpu = (spuId: number, skuIds: number[]) => {

View File

@ -33,6 +33,7 @@
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express' 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'
// TODO @puhui999 OrderDeliveryForm
defineOptions({ name: 'DeliveryOrderForm' }) defineOptions({ name: 'DeliveryOrderForm' })
const { t } = useI18n() // const { t } = useI18n() //
@ -40,7 +41,7 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const radio = ref('1') const radio = ref('1') // TODO @puhui999 radio expressType expressnone
const formData = ref<TradeOrderApi.DeliveryVO>({ const formData = ref<TradeOrderApi.DeliveryVO>({
id: 0, // id: 0, //
logisticsId: null, // logisticsId: null, //
@ -48,6 +49,7 @@ const formData = ref<TradeOrderApi.DeliveryVO>({
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
// TODO @puhui999
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (orderId: number) => { const open = async (orderId: number) => {
resetForm() resetForm()
@ -65,6 +67,7 @@ const submitForm = async () => {
try { try {
const data = unref(formData) const data = unref(formData)
if (radio.value === '2') { if (radio.value === '2') {
//
data.logisticsId = 0 data.logisticsId = 0
data.logisticsNo = '' data.logisticsNo = ''
} }

View File

@ -7,6 +7,7 @@
<el-form-item label="收件人手机"> <el-form-item label="收件人手机">
<el-input v-model="formData.receiverMobile" /> <el-input v-model="formData.receiverMobile" />
</el-form-item> </el-form-item>
<!-- TODO @puhui999应该是个地区下拉框可以看下 UserForm 所在地 -->
<el-form-item label="收件人地区编号"> <el-form-item label="收件人地区编号">
<el-input v-model="formData.receiverAreaId" /> <el-input v-model="formData.receiverAreaId" />
</el-form-item> </el-form-item>
@ -24,6 +25,7 @@
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 @puhui999OrderAdjustAddressForm OrderUpdateAddressForm
defineOptions({ name: 'OrderAdjustAddressForm' }) defineOptions({ name: 'OrderAdjustAddressForm' })
const { t } = useI18n() // const { t } = useI18n() //

View File

@ -23,6 +23,7 @@ import * as TradeOrderApi from '@/api/mall/trade/order'
import { convertToInteger, formatToFraction } from '@/utils' import { convertToInteger, formatToFraction } from '@/utils'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
// TODO @puhui999OrderAdjustPriceForm OrderUpdatePriceForm
defineOptions({ name: 'OrderAdjustPriceForm' }) defineOptions({ name: 'OrderAdjustPriceForm' })
const { t } = useI18n() // const { t } = useI18n() //

View File

@ -4,7 +4,7 @@
<el-descriptions title="订单信息"> <el-descriptions title="订单信息">
<el-descriptions-item label="订单号: ">{{ orderInfo.no }}</el-descriptions-item> <el-descriptions-item label="订单号: ">{{ orderInfo.no }}</el-descriptions-item>
<el-descriptions-item label="配送方式: "> <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> </el-descriptions-item>
<!-- TODO 营销活动待实现 --> <!-- TODO 营销活动待实现 -->
<el-descriptions-item label="营销活动: ">秒杀活动</el-descriptions-item> <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.remark }}</el-descriptions-item>
<el-descriptions-item label="支付单号: ">{{ orderInfo.payOrderId }}</el-descriptions-item> <el-descriptions-item label="支付单号: ">{{ orderInfo.payOrderId }}</el-descriptions-item>
<el-descriptions-item label="付款方式: "> <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>
<!-- <el-descriptions-item label="买家: ">{{ orderInfo.user.nickname }}</el-descriptions-item> --> <!-- <el-descriptions-item label="买家: ">{{ orderInfo.user.nickname }}</el-descriptions-item> -->
<!-- TODO 芋艿待实现跳转会员 --> <!-- TODO 芋艿待实现跳转会员 -->
@ -41,14 +41,10 @@
<dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="orderInfo.status" /> <dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="orderInfo.status" />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="no-colon"> <el-descriptions-item label-class-name="no-colon">
<el-button size="small" type="primary" @click="openForm('adjustPrice')">调整价格</el-button> <el-button type="primary" @click="openForm('adjustPrice')">调整价格</el-button>
<el-button size="small" type="primary" @click="openForm('remark')">备注</el-button> <el-button type="primary" @click="openForm('remark')">备注</el-button>
<el-button size="small" type="primary" @click="openForm('delivery')">发货</el-button> <el-button type="primary" @click="openForm('delivery')">发货</el-button>
<el-button size="small" type="primary" @click="openForm('adjustAddress')"> <el-button type="primary" @click="openForm('adjustAddress')">修改地址</el-button>
修改地址
</el-button>
<!-- TODO 后台商家也需要收货功能吗 -->
<el-button size="small" type="primary">确认收货</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>
@ -201,6 +197,8 @@
</el-descriptions> </el-descriptions>
</div> </div>
</ContentWrap> </ContentWrap>
<!-- 各种操作的弹窗 -->
<DeliveryOrderForm ref="deliveryFormRef" @success="getDetail" /> <DeliveryOrderForm ref="deliveryFormRef" @success="getDetail" />
<OrderRemarksForm ref="remarksFormRef" @success="getDetail" /> <OrderRemarksForm ref="remarksFormRef" @success="getDetail" />
<OrderAdjustAddressForm ref="adjustAddressFormRef" @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 OrderAdjustAddressForm from '@/views/mall/trade/order/components/OrderAdjustAddressForm.vue'
import OrderAdjustPriceForm from '@/views/mall/trade/order/components/OrderAdjustPriceForm.vue' import OrderAdjustPriceForm from '@/views/mall/trade/order/components/OrderAdjustPriceForm.vue'
// TODO @puhui999TradeOrderDetailForm order/detail/index.vue vue
defineOptions({ name: 'TradeOrderDetailForm' }) defineOptions({ name: 'TradeOrderDetailForm' })
const message = useMessage() // const message = useMessage() //
const { params } = useRoute() // const { params } = useRoute() //
// TODO @puhui999orderInfo
const orderInfo = ref<TradeOrderApi.OrderVO>({ const orderInfo = ref<TradeOrderApi.OrderVO>({
no: '', no: '',
createTime: null, createTime: null,
@ -263,6 +263,7 @@ const orderInfo = ref<TradeOrderApi.OrderVO>({
user: {} user: {}
}) })
// TODO @puhui999
const detailGroups = ref([ const detailGroups = ref([
{ {
title: '物流信息', title: '物流信息',
@ -281,6 +282,7 @@ const detailGroups = ref([
} }
]) ])
// TODO @puhui999
const detailInfo = ref({ const detailInfo = ref({
// //
expressInfo: { expressInfo: {

View File

@ -14,6 +14,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import * as TradeOrderApi from '@/api/mall/trade/order' import * as TradeOrderApi from '@/api/mall/trade/order'
// TODO @puhui999OrderRemarksForm OrderUpdateRemarkForm
defineOptions({ name: 'OrderRemarksForm' }) defineOptions({ name: 'OrderRemarksForm' })
const { t } = useI18n() // const { t } = useI18n() //

View File

@ -11,8 +11,8 @@
<el-form-item label="订单状态" prop="status"> <el-form-item label="订单状态" prop="status">
<el-select v-model="queryParams.status" class="!w-280px" clearable placeholder="全部"> <el-select v-model="queryParams.status" class="!w-280px" clearable placeholder="全部">
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)"
:key="dict.value as string" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -26,8 +26,8 @@
placeholder="全部" placeholder="全部"
> >
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE)"
:key="dict.value as string" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -47,8 +47,8 @@
<el-form-item label="订单来源" prop="terminal"> <el-form-item label="订单来源" prop="terminal">
<el-select v-model="queryParams.terminal" class="!w-280px" clearable placeholder="全部"> <el-select v-model="queryParams.terminal" class="!w-280px" clearable placeholder="全部">
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TERMINAL)" v-for="dict in getIntDictOptions(DICT_TYPE.TERMINAL)"
:key="dict.value as string" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -57,8 +57,8 @@
<el-form-item label="订单类型" prop="type"> <el-form-item label="订单类型" prop="type">
<el-select v-model="queryParams.type" class="!w-280px" clearable placeholder="全部"> <el-select v-model="queryParams.type" class="!w-280px" clearable placeholder="全部">
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)" v-for="dict in getIntDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)"
:key="dict.value as string" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
@ -68,7 +68,7 @@
<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"
:key="item.id as string" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
/> />
@ -84,13 +84,13 @@
> >
<el-option <el-option
v-for="item in pickUpStoreList" v-for="item in pickUpStoreList"
:key="item.id as string" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- TODO 考虑是否移除或重构--> <!-- TODO 考虑是否移除或重构这个还是需要的哈-->
<el-form-item label="聚合搜索"> <el-form-item label="聚合搜索">
<el-input <el-input
v-show="true" v-show="true"
@ -100,7 +100,7 @@
placeholder="请输入" placeholder="请输入"
> >
<template #prepend> <template #prepend>
<el-select v-model="queryType.k" clearable placeholder="全部" style="width: 110px"> <el-select v-model="queryType.k" clearable placeholder="全部" class="!w-110px">
<el-option <el-option
v-for="dict in searchList" v-for="dict in searchList"
:key="dict.value" :key="dict.value"
@ -125,6 +125,12 @@
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<!-- TODO @puhui999列表有可能尽量对齐 https://gitee.com/niushop_team/niushop_b2c_v5_stand/raw/master/image/back_end5.png
1订单号订单类型订单来源支付时间那一行直接做到订单项的数据中
2商品信息商品原价那一行应该是在最顶上一行不用每个订单项都写一条
3然后点击展开和收拢订单项可以不做哈
-->
<ContentWrap> <ContentWrap>
<el-table <el-table
v-loading="loading" v-loading="loading"
@ -157,7 +163,8 @@
</el-table-column> </el-table-column>
<el-table-column label="商品原价*数量" prop="price" width="150"> <el-table-column label="商品原价*数量" prop="price" width="150">
<template #default="{ row }"> <template #default="{ row }">
{{ formatToFraction(row.price) }} * {{ row.count }} <!-- TODO @puhui999价格要有 xxx.00 这种格式 -->
{{ formatToFraction(row.price) }} * {{ row.count }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合计" prop="payPrice" width="150"> <el-table-column label="合计" prop="payPrice" width="150">
@ -173,6 +180,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="实际支付" min-width="120" prop="payPrice"> <el-table-column align="center" label="实际支付" min-width="120" prop="payPrice">
<template #default> <template #default>
<!-- TODO @puhui999价格要有 xxx.00 这种格式 -->
{{ formatToFraction(scope.row.payPrice) + '元' }} {{ formatToFraction(scope.row.payPrice) + '元' }}
</template> </template>
</el-table-column> </el-table-column>
@ -207,7 +215,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="配送方式" width="120"> <el-table-column align="center" label="配送方式" width="120">
<template #default> <template #default>
<dict-tag :type="DICT_TYPE.DELIVERY_TYPE" :value="scope.row.deliveryType" /> <dict-tag :type="DICT_TYPE.TRADE_DELIVERY_TYPE" :value="scope.row.deliveryType" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="160"> <el-table-column align="center" fixed="right" label="操作" width="160">
@ -225,6 +233,7 @@
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<!-- TODO puhui999可以判断下状态 + 物流类型展示发货按钮 -->
<el-dropdown-item command="delivery"> <el-dropdown-item command="delivery">
<Icon icon="ep:takeaway-box" /> <Icon icon="ep:takeaway-box" />
发货 发货
@ -265,7 +274,7 @@
<template #default="{ row }"> <template #default="{ row }">
<dict-tag <dict-tag
v-if="row.payChannelCode" v-if="row.payChannelCode"
:type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :type="DICT_TYPE.PAY_CHANNEL_CODE"
:value="row.payChannelCode" :value="row.payChannelCode"
/> />
</template> </template>
@ -296,6 +305,8 @@
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 各种操作的弹窗 -->
<DeliveryOrderForm ref="deliveryOrderFormRef" @success="getList" /> <DeliveryOrderForm ref="deliveryOrderFormRef" @success="getList" />
<OrderRemarksForm ref="orderRemarksFormRef" @success="getList" /> <OrderRemarksForm ref="orderRemarksFormRef" @success="getList" />
</template> </template>
@ -306,9 +317,11 @@ import DeliveryOrderForm from './components/DeliveryOrderForm.vue'
import OrderRemarksForm from './components/OrderRemarksForm.vue' import OrderRemarksForm from './components/OrderRemarksForm.vue'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as TradeOrderApi from '@/api/mall/trade/order' import * as TradeOrderApi from '@/api/mall/trade/order'
// @puhui999 TradeOrderApi VO
import { OrderItemRespVO, OrderVO } from '@/api/mall/trade/order' import { OrderItemRespVO, OrderVO } from '@/api/mall/trade/order'
// @puhui999使 XXXApi
import { getListAllSimple } from '@/api/mall/trade/delivery/pickUpStore' import { getListAllSimple } from '@/api/mall/trade/delivery/pickUpStore'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict'
import { formatToFraction } from '@/utils' import { formatToFraction } from '@/utils'
import { createImageViewer } from '@/components/ImageViewer' import { createImageViewer } from '@/components/ImageViewer'
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express' import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
@ -318,55 +331,8 @@ const { currentRoute, push } = useRouter() // 路由跳转
const loading = ref(true) // const loading = ref(true) //
const total = ref(2) // const total = ref(2) //
const list = ref<OrderVO[]>([]) // const list = ref<OrderVO[]>([]) //
const deliveryOrderFormRef = ref()
const orderRemarksFormRef = ref()
const openForm = (id: number) => {
push('/trade/order/detail/' + id)
}
/** 商品图预览 */
const imagePreview = (imgUrl: string) => {
createImageViewer({
urlList: [imgUrl]
})
}
interface SpanMethodProps {
row: OrderItemRespVO
column: TableColumnCtx<OrderItemRespVO>
rowIndex: number
columnIndex: number
}
const spanMethod = ({ rowIndex, columnIndex }: SpanMethodProps) => {
const colIndex = [4, 5, 6, 7]
//
if (colIndex.includes(columnIndex)) {
//
if (rowIndex !== 0) {
return {
rowspan: 0,
colspan: 0
}
}
return {
rowspan: 2,
colspan: 1
}
}
}
/** 操作分发 */
const handleCommand = (command: string, row: OrderVO) => {
switch (command) {
case 'orderRemarks':
orderRemarksFormRef.value?.open(row)
break
case 'delivery':
deliveryOrderFormRef.value?.open(row.id)
break
}
}
const queryFormRef = ref<FormInstance>() // const queryFormRef = ref<FormInstance>() //
// //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, // pageNo: 1, //
pageSize: 10, // pageSize: 10, //
@ -387,11 +353,12 @@ const queryParams = reactive({
logisticsId: null, logisticsId: null,
all: '' all: ''
}) })
const queryType = reactive({ k: '', v: '' }) // kv const queryType = reactive({ k: '', v: '' }) // kv
/* /**
* 订单聚合搜索 * 订单聚合搜索
* 商品名称 商品件数 全部 需要后端支持TODO * 商品名称商品件数全部
*
* 需要后端支持 TODO
*/ */
const searchList = ref([ const searchList = ref([
{ value: 'no', label: '订单号' }, { value: 'no', label: '订单号' },
@ -399,6 +366,31 @@ const searchList = ref([
{ value: 'userNickname', label: '用户昵称' }, { value: 'userNickname', label: '用户昵称' },
{ value: 'userMobile', label: '用户电话' } { value: 'userMobile', label: '用户电话' }
]) ])
interface SpanMethodProps {
row: OrderItemRespVO
column: TableColumnCtx<OrderItemRespVO>
rowIndex: number
columnIndex: number
}
const spanMethod = ({ rowIndex, columnIndex }: SpanMethodProps) => {
const colIndex = [4, 5, 6, 7]
//
if (colIndex.includes(columnIndex)) {
//
if (rowIndex !== 0) {
return {
rowspan: 0,
colspan: 0
}
}
return {
rowspan: 2,
colspan: 1
}
}
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -423,6 +415,33 @@ const resetQuery = () => {
handleQuery() handleQuery()
} }
/** 商品图预览 */
const imagePreview = (imgUrl: string) => {
createImageViewer({
urlList: [imgUrl]
})
}
/** 查看商品详情 */
const openForm = (id: number) => {
// TODO @puhui999 name url
push('/trade/order/detail/' + id)
}
/** 操作分发 */
const deliveryOrderFormRef = ref()
const orderRemarksFormRef = ref()
const handleCommand = (command: string, row: OrderVO) => {
switch (command) {
case 'orderRemarks': // TODO @puhui999orderRemarks remark
orderRemarksFormRef.value?.open(row)
break
case 'delivery':
deliveryOrderFormRef.value?.open(row.id)
break
}
}
// //
watch( watch(
() => currentRoute.value, () => currentRoute.value,

View File

@ -60,6 +60,22 @@
<el-form-item label="用户标签" prop="tagIds"> <el-form-item label="用户标签" prop="tagIds">
<MemberTagSelect v-model="formData.tagIds" show-add /> <MemberTagSelect v-model="formData.tagIds" show-add />
</el-form-item> </el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="用户等级" prop="levelId">
<MemberLevelSelect v-model="formData.levelId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="修改原因"
prop="levelReason"
v-if="formData.levelId !== originLevelId"
>
<el-input type="text" v-model="formData.levelReason" placeholder="请输入修改原因" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="用户分组" prop="groupId"> <el-form-item label="用户分组" prop="groupId">
<MemberGroupSelect v-model="formData.groupId" /> <MemberGroupSelect v-model="formData.groupId" />
</el-form-item> </el-form-item>
@ -79,6 +95,7 @@ import * as UserApi from '@/api/member/user'
import * as AreaApi from '@/api/system/area' import * as AreaApi from '@/api/system/area'
import { defaultProps } from '@/utils/tree' import { defaultProps } from '@/utils/tree'
import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue' import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue'
import MemberLevelSelect from '@/views/member/level/components/MemberLevelSelect.vue'
import MemberGroupSelect from '@/views/member/group/components/MemberGroupSelect.vue' import MemberGroupSelect from '@/views/member/group/components/MemberGroupSelect.vue'
const { t } = useI18n() // const { t } = useI18n() //
@ -101,14 +118,18 @@ const formData = ref({
birthday: undefined, birthday: undefined,
mark: undefined, mark: undefined,
tagIds: [], tagIds: [],
levelId: undefined,
levelReason: undefined,
groupId: undefined groupId: undefined
}) })
const formRules = reactive({ const formRules = reactive({
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
levelReason: [{ required: true, message: '修改原因不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
const areaList = ref([]) // const areaList = ref([]) //
const originLevelId = ref() //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
@ -121,6 +142,7 @@ const open = async (type: string, id?: number) => {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await UserApi.getUser(id) formData.value = await UserApi.getUser(id)
originLevelId.value = formData.value.levelId
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -172,6 +194,8 @@ const resetForm = () => {
birthday: undefined, birthday: undefined,
mark: undefined, mark: undefined,
tagIds: [], tagIds: [],
levelId: undefined,
levelReason: undefined,
groupId: undefined groupId: undefined
} }
formRef.value?.resetFields() formRef.value?.resetFields()

View File

@ -29,7 +29,7 @@
class="!w-240px" class="!w-240px"
> >
<el-option <el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)" v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE)"
:key="dict.value" :key="dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"