提交订单列表和详情20230619
This commit is contained in:
parent
1b5c983d1d
commit
a35fd3ec62
@ -12,7 +12,7 @@
|
|||||||
<el-select class="!w-280px" v-model="queryParams.status" clearable placeholder="全部">
|
<el-select class="!w-280px" v-model="queryParams.status" clearable placeholder="全部">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)"
|
||||||
:key="dict.value"
|
:key="(dict.value as string)"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
>
|
>
|
||||||
<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_TYPE)"
|
||||||
:key="dict.value"
|
:key="(dict.value as string)"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<el-select class="!w-280px" v-model="queryParams.terminal" clearable placeholder="全部">
|
<el-select class="!w-280px" v-model="queryParams.terminal" clearable placeholder="全部">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TERMINAL)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.TERMINAL)"
|
||||||
:key="dict.value"
|
:key="(dict.value as string)"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
<el-select class="!w-280px" v-model="queryParams.type" clearable placeholder="全部">
|
<el-select class="!w-280px" v-model="queryParams.type" clearable placeholder="全部">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)"
|
||||||
:key="dict.value"
|
:key="(dict.value as string)"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
@ -363,7 +363,6 @@ const handleDropType = (command: string) => {
|
|||||||
}
|
}
|
||||||
//所有页按钮
|
//所有页按钮
|
||||||
if (command === '2') {
|
if (command === '2') {
|
||||||
initSelect() //重置之前选中的类容清空
|
|
||||||
orderSelect.selectAllFlag = !orderSelect.selectAllFlag
|
orderSelect.selectAllFlag = !orderSelect.selectAllFlag
|
||||||
|
|
||||||
if (orderSelect.selectAllFlag) {
|
if (orderSelect.selectAllFlag) {
|
||||||
@ -379,6 +378,7 @@ const handleDropType = (command: string) => {
|
|||||||
for (i; i < list.value.length; i++) {
|
for (i; i < list.value.length; i++) {
|
||||||
list.value[i]['itemSelect'] = false
|
list.value[i]['itemSelect'] = false
|
||||||
}
|
}
|
||||||
|
initSelect() //重置之前选中的类容清空
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,54 +494,6 @@ const getList = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const getList = async () => {
|
|
||||||
// loading.value = true
|
|
||||||
// try {
|
|
||||||
// const data = await TradeOrderApi.getOrderList(queryParams)
|
|
||||||
// list.value = data.list
|
|
||||||
// total.value = data.total
|
|
||||||
// let i = 0
|
|
||||||
// //给数组添加选中属性 itemSelect 默认为false 当前状态如果时全选 则新加载的页面都为选中状态
|
|
||||||
|
|
||||||
// if (orderSelect.selectAllFlag) {
|
|
||||||
// if (orderSelect.selectData && orderSelect.selectData.has(queryParams.pageNo)) {
|
|
||||||
// //页面已经加载过了
|
|
||||||
// for (i = 0; i < list.value.length; i++) {
|
|
||||||
// if (orderSelect.selectData.get(queryParams.pageNo)!.has(list.value[i].id)) {
|
|
||||||
// list.value[i]['itemSelect'] = true //之前已经选取过了
|
|
||||||
// } else {
|
|
||||||
// list.value[i]['itemSelect'] = false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// //首次加载页面 默认全部选中
|
|
||||||
// orderSelect.selectData.set(queryParams.pageNo, new Set<string>())
|
|
||||||
// for (i = 0; i < list.value.length; i++) {
|
|
||||||
// list.value[i]['itemSelect'] = true
|
|
||||||
// orderSelect.selectData.get(queryParams.pageNo)!.add(list.value[i].id)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (orderSelect.selectData && orderSelect.selectData.has(queryParams.pageNo)) {
|
|
||||||
// //页面已经加载过了
|
|
||||||
// for (i = 0; i < list.value.length; i++) {
|
|
||||||
// if (orderSelect.selectData.get(queryParams.pageNo)!.has(list.value[i].id)) {
|
|
||||||
// list.value[i]['itemSelect'] = true //之前已经选取过了
|
|
||||||
// } else {
|
|
||||||
// list.value[i]['itemSelect'] = false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// for (i; i < list.value.length; i++) {
|
|
||||||
// list.value[i]['itemSelect'] = false //设置状态为未选中状态
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } finally {
|
|
||||||
// loading.value = false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转订单详情
|
* 跳转订单详情
|
||||||
*/
|
*/
|
||||||
|
@ -124,11 +124,14 @@
|
|||||||
parseFloat((order.adjustPrice / 100.0) as unknown as string).toFixed(2)
|
parseFloat((order.adjustPrice / 100.0) as unknown as string).toFixed(2)
|
||||||
}}</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>
|
||||||
<!-- 没理解TODO order.totalPrice - order.totalPrice -->
|
<!-- 没理解TODO order.totalPrice - order.totalPrice -->
|
||||||
¥{{
|
¥{{
|
||||||
parseFloat((order.totalPrice - order.totalPrice / 100.0) as unknown as string).toFixed(2)
|
parseFloat(((order.totalPrice - order.totalPrice) / 100.0) as unknown as string).toFixed(
|
||||||
|
2
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
@ -163,6 +166,7 @@
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
|
||||||
<!-- 物流信息 -->
|
<!-- 物流信息 -->
|
||||||
|
<!-- TODO @xiaobai:改成一个包裹哈;目前只允许发货一次 -->
|
||||||
<el-descriptions-item v-if="group.key === 'expressInfo'" labelClassName="no-colon">
|
<el-descriptions-item v-if="group.key === 'expressInfo'" labelClassName="no-colon">
|
||||||
<!-- 循环包裹物流信息 -->
|
<!-- 循环包裹物流信息 -->
|
||||||
<div v-show="(pkgInfo = detailInfo[group.key]) !== null" style="border: 1px dashed">
|
<div v-show="(pkgInfo = detailInfo[group.key]) !== null" style="border: 1px dashed">
|
||||||
@ -222,6 +226,7 @@
|
|||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" name="TradeOrderDetail" setup>
|
<script lang="ts" name="TradeOrderDetail" setup>
|
||||||
|
// TODO @xiaobai:在 order 下创建一个 order/detail,然后改名为 index.vue
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import * as TradeOrderApi from '@/api/mall/trade/order'
|
import * as TradeOrderApi from '@/api/mall/trade/order'
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@ -235,7 +240,7 @@ const loading = ref(false)
|
|||||||
const order = ref<any>({
|
const order = ref<any>({
|
||||||
items: [],
|
items: [],
|
||||||
user: {}
|
user: {}
|
||||||
}) //详情数据
|
}) // 详情数据
|
||||||
|
|
||||||
const detailGroups = ref([
|
const detailGroups = ref([
|
||||||
{
|
{
|
||||||
@ -301,7 +306,7 @@ const detailInfo = ref({
|
|||||||
],
|
],
|
||||||
goodsInfo: [] // 商品详情tableData
|
goodsInfo: [] // 商品详情tableData
|
||||||
})
|
})
|
||||||
//暂考虑一次性加载详情页面所有数据
|
// 暂考虑一次性加载详情页面所有数据 TODO
|
||||||
const getlist = async () => {
|
const getlist = async () => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@ -327,9 +332,11 @@ const clipboardSuccess = () => {
|
|||||||
&:not(:nth-child(1)) {
|
&:not(:nth-child(1)) {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-descriptions__title {
|
.el-descriptions__title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@ -339,10 +346,13 @@ const clipboardSuccess = () => {
|
|||||||
background-color: #409eff;
|
background-color: #409eff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-descriptions-item__container {
|
.el-descriptions-item__container {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
|
|
||||||
.no-colon {
|
.no-colon {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user