|
@@ -1,7 +1,18 @@
|
|
|
<template>
|
|
|
- <!-- 搜索 -->
|
|
|
- <ContentWrap>
|
|
|
- <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px" label-width="68px">
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <ContentWrap class="order-div">
|
|
|
+ <!-- 搜索 -->
|
|
|
+ <div style="position: relative;">
|
|
|
+ <div style="text-align: right;background: #fafbfc;padding: 10px;">
|
|
|
+
|
|
|
+ <el-button :icon="Operation" @click="showSearchMore" />
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="searchMore" v-if="searchMoreShow">
|
|
|
+ <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px" label-width="68px">
|
|
|
<el-form-item label="订单状态" prop="status">
|
|
|
<el-select v-model="queryParams.status" class="!w-280px" clearable placeholder="全部">
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)" :key="dict.value"
|
|
@@ -68,27 +79,33 @@
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="handleQuery">
|
|
|
- <Icon class="mr-5px" icon="ep:search" />
|
|
|
- 搜索
|
|
|
- </el-button>
|
|
|
- <el-button @click="resetQuery">
|
|
|
- <Icon class="mr-5px" icon="ep:refresh" />
|
|
|
- 重置
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
+ <el-row>
|
|
|
+ <el-col>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="hideSearchMore">
|
|
|
+ 收起
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="resetQuery">
|
|
|
+ <!-- <Icon class="mr-5px" icon="ep:refresh" /> -->
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="handleQuery" plain type="primary">
|
|
|
+ <Icon class="mr-5px" icon="ep:search" />
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
</el-form>
|
|
|
- </ContentWrap>
|
|
|
-
|
|
|
- <!-- 列表 -->
|
|
|
- <ContentWrap>
|
|
|
- <!-- 添加 row-key="id" 解决列数据中的 table#header 数据不刷新的问题 -->
|
|
|
- <el-table v-loading="loading" :data="list" row-key="id">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <!-- <el-table v-loading="loading" :data="list" row-key="id">
|
|
|
<OrderTableColumn :list="list" :pick-up-store-list="pickUpStoreList">
|
|
|
<template #default="{ row }">
|
|
|
<div class="flex items-center justify-center">
|
|
|
- <el-button v-hasPermi="['trade:order:query']" link type="primary" @click="openDetail(row.id)">
|
|
|
+ <el-button v-hasPermi="['trade:order:query']" link type="primary" >
|
|
|
<Icon icon="ep:notification" />
|
|
|
详情
|
|
|
</el-button>
|
|
@@ -100,7 +117,7 @@
|
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
|
- <!-- 如果是【快递】,并且【未发货】,则展示【发货】按钮 -->
|
|
|
+ 如果是【快递】,并且【未发货】,则展示【发货】按钮
|
|
|
<el-dropdown-item v-if="
|
|
|
row.deliveryType === DeliveryTypeEnum.EXPRESS.type &&
|
|
|
row.status === TradeOrderStatusEnum.UNDELIVERED.status
|
|
@@ -118,7 +135,41 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</OrderTableColumn>
|
|
|
- </el-table>
|
|
|
+ </el-table> -->
|
|
|
+ <el-row>
|
|
|
+ <el-col v-for="(o, index) in list" class="product-card" :key="index" :span="7" @mouseover="handleMouseOver(index)" @mouseout="handleMouseOut(index)">
|
|
|
+ <el-card @click="openDetail('view',o.id,o.no)">
|
|
|
+ <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 5px;">
|
|
|
+ <p style="width: 100%;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;font-size: 16px;color:#000"
|
|
|
+ title="">{{o.no}}
|
|
|
+ </p>
|
|
|
+ <div
|
|
|
+ class="setting" v-show="o.showSetting" >
|
|
|
+ <el-icon size="20" color="rgb(220 223 231)">
|
|
|
+ <Setting />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="display:flex;align-items: center;">
|
|
|
+ <div style="width: 178px;height: 100px;margin-right:10px;border:1px solid rgb(220 223 231);border-radius: 5px;display: flex;align-items: center;justify-content: center;"
|
|
|
+ >
|
|
|
+ <img src="" style="width: auto;height: auto;max-width: 100%;max-height: 100%;" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style='line-height: 25px;'>
|
|
|
+ <p>¥{{ o.payPrice }}</p>
|
|
|
+ <p> {{ getDictObj(DICT_TYPE.TRADE_ORDER_STATUS, o.status)?.label }}</p>
|
|
|
+ <p>{{o.user.nickname}}</p>
|
|
|
+ <p>{{formatDate(o.createTime)}}</p>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div v-if="list.length == 0">
|
|
|
+ <p style="text-align: center;margin-top: 100px;">暂无商品</p>
|
|
|
+ </div>
|
|
|
<!-- 分页 -->
|
|
|
<Pagination v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNo" :total="total"
|
|
|
@pagination="getList" />
|
|
@@ -127,6 +178,8 @@
|
|
|
<!-- 各种操作的弹窗 -->
|
|
|
<OrderDeliveryForm ref="deliveryFormRef" @success="getList" />
|
|
|
<OrderUpdateRemarkForm ref="updateRemarkForm" @success="getList" />
|
|
|
+ <OrderIndex ref="formRef" @success="getList" />
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
@@ -135,13 +188,38 @@
|
|
|
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
|
|
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
|
|
import * as PickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
|
|
- import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
|
|
+ import { DICT_TYPE, getIntDictOptions, getStrDictOptions,getDictObj } from '@/utils/dict'
|
|
|
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
|
|
|
import { DeliveryTypeEnum, TradeOrderStatusEnum } from '@/utils/constants'
|
|
|
+ import { Setting, Search, Operation } from '@element-plus/icons-vue'
|
|
|
+
|
|
|
import { OrderTableColumn } from './components'
|
|
|
+ import { formatDate } from '@/utils/formatTime'
|
|
|
|
|
|
- defineOptions({ name: 'TradeOrder' })
|
|
|
+ import OrderIndex from "./components/OrderIndex.vue"
|
|
|
+
|
|
|
+ const searchMoreShow = ref(false)
|
|
|
+ // 鼠标移入显示变动图标
|
|
|
+ function handleMouseOver(index) {
|
|
|
+ list.value[index].showSetting = true;
|
|
|
+ }
|
|
|
+ // 鼠标移出不显示图标
|
|
|
+ function handleMouseOut(index) {
|
|
|
+ list.value[index].showSetting = false;
|
|
|
+ }
|
|
|
+ // 打开更多搜索条件
|
|
|
+ const showSearchMore = () => {
|
|
|
+ searchMoreShow.value = !searchMoreShow.value
|
|
|
+ }
|
|
|
+ const hideSearchMore = () => {
|
|
|
+ searchMoreShow.value = false
|
|
|
+ }
|
|
|
+ const formRef = ref()
|
|
|
+ const openDetail = (type:string,id : number,no:string) => {
|
|
|
+ formRef.value.open(type,id,no)
|
|
|
+ }
|
|
|
|
|
|
+ defineOptions({ name: 'TradeOrder' })
|
|
|
const { currentRoute, push } = useRouter() // 路由跳转
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
const total = ref(2) // 列表的总页数
|
|
@@ -190,10 +268,15 @@
|
|
|
loading.value = true
|
|
|
try {
|
|
|
const data = await TradeOrderApi.getOrderPage(unref(queryParams))
|
|
|
+ data.list.forEach(obj => {
|
|
|
+ obj.showSetting = false;
|
|
|
+ });
|
|
|
list.value = data.list
|
|
|
total.value = data.total
|
|
|
} finally {
|
|
|
loading.value = false
|
|
|
+ searchMoreShow.value = false
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -222,10 +305,10 @@
|
|
|
handleQuery()
|
|
|
}
|
|
|
|
|
|
- /** 查看订单详情 */
|
|
|
- const openDetail = (id : number) => {
|
|
|
- push({ name: 'TradeOrderDetail', params: { id } })
|
|
|
- }
|
|
|
+ // /** 查看订单详情 */
|
|
|
+ // const openDetail = (id : number) => {
|
|
|
+ // push({ name: 'TradeOrderDetail', params: { id } })
|
|
|
+ // }
|
|
|
|
|
|
/** 操作分发 */
|
|
|
const deliveryFormRef = ref()
|
|
@@ -257,4 +340,90 @@
|
|
|
pickUpStoreList.value = await PickUpStoreApi.getListAllSimple()
|
|
|
deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList()
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .order-div {
|
|
|
+ position: relative;
|
|
|
+ min-height: 400px;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ ::v-deep .parent-tabs .el-tabs__nav-wrap::after {
|
|
|
+ position: static !important;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .parent-tabs .el-tabs__active-bar {
|
|
|
+
|
|
|
+ background-color: unset;
|
|
|
+ }
|
|
|
+
|
|
|
+ .searchMore {
|
|
|
+ text-align: right;
|
|
|
+ background: #f3f5f8;
|
|
|
+ padding: 10px;
|
|
|
+ position: absolute;
|
|
|
+ // height: 100px;
|
|
|
+ width: calc(100% - 20px);
|
|
|
+ z-index: 111;
|
|
|
+ box-shadow: 0px 9px 6px rgba(0, 0, 0, 0.2);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tabs {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 111;
|
|
|
+ top: 25px;
|
|
|
+ left: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .product-card {
|
|
|
+
|
|
|
+ font-size: 14px;
|
|
|
+ margin: 10px;
|
|
|
+
|
|
|
+ .el-card {
|
|
|
+ padding: 15px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ :deep(.el-card__body) {
|
|
|
+ padding: unset;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .setting {
|
|
|
+ width: 30px;
|
|
|
+ top: 0px;
|
|
|
+ right: 0px;
|
|
|
+ position: absolute;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ text-align: center;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .setting:hover {
|
|
|
+ background: #666
|
|
|
+ }
|
|
|
+
|
|
|
+ p,
|
|
|
+ div {
|
|
|
+ margin: unset;
|
|
|
+ padding: unset;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .spu-table-expand {
|
|
|
+ padding-left: 42px;
|
|
|
+
|
|
|
+ :deep(.el-form-item__label) {
|
|
|
+ width: 82px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #99a9bf;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|