Changes
This commit is contained in:
parent
7573b01ab4
commit
aa098ee9bb
1
package-lock.json
generated
1
package-lock.json
generated
|
@ -10,6 +10,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
"element-plus": "^2.9.0",
|
"element-plus": "^2.9.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"pinia": "^2.2.4",
|
"pinia": "^2.2.4",
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
"element-plus": "^2.9.0",
|
"element-plus": "^2.9.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"pinia": "^2.2.4",
|
"pinia": "^2.2.4",
|
||||||
|
|
|
@ -103,6 +103,12 @@
|
||||||
<el-icon><Menu /></el-icon>
|
<el-icon><Menu /></el-icon>
|
||||||
<span slot="title">服务类商品订单列表</span>
|
<span slot="title">服务类商品订单列表</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
|
|
||||||
|
<el-menu-item index="/PendingServiceOrderList">
|
||||||
|
<el-icon><Menu /></el-icon>
|
||||||
|
<span slot="title">服务类商品待处理订单列表</span>
|
||||||
|
</el-menu-item>
|
||||||
|
|
||||||
</el-sub-menu>
|
</el-sub-menu>
|
||||||
<el-sub-menu index="6">
|
<el-sub-menu index="6">
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -166,7 +172,6 @@
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
import { defineProps } from 'vue';
|
import { defineProps } from 'vue';
|
||||||
import emitter from '@/utils/emitter'
|
import emitter from '@/utils/emitter'
|
||||||
import router from '@/router';
|
|
||||||
import {List} from "@element-plus/icons-vue";
|
import {List} from "@element-plus/icons-vue";
|
||||||
defineProps(['send-data'])
|
defineProps(['send-data'])
|
||||||
|
|
||||||
|
@ -174,9 +179,9 @@ const showLog = ref(true)
|
||||||
|
|
||||||
const isCollapse = ref(false)
|
const isCollapse = ref(false)
|
||||||
const isShow = ref(true)
|
const isShow = ref(true)
|
||||||
const sideWidth = ref(200)
|
const sideWidth = ref(250)
|
||||||
const AsideObj = ref({
|
const AsideObj = ref({
|
||||||
width: '200px'
|
width: '250px'
|
||||||
})
|
})
|
||||||
|
|
||||||
emitter.on('Aside', (value:any) => {
|
emitter.on('Aside', (value:any) => {
|
||||||
|
@ -187,10 +192,10 @@ emitter.on('Aside', (value:any) => {
|
||||||
isShow.value = false
|
isShow.value = false
|
||||||
sideWidth.value = 64
|
sideWidth.value = 64
|
||||||
}else{
|
}else{
|
||||||
AsideObj.value.width = '200px'
|
AsideObj.value.width = '250px'
|
||||||
isCollapse.value = false
|
isCollapse.value = false
|
||||||
isShow.value = true
|
isShow.value = true
|
||||||
sideWidth.value = 200
|
sideWidth.value = 250
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
63
src/layout/components/DatePicker.vue
Normal file
63
src/layout/components/DatePicker.vue
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
<template>
|
||||||
|
<div class="demo-date-picker" style="display: flex; align-items: center">
|
||||||
|
<span>预约日期:</span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="value"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择预约日期"
|
||||||
|
:size="size"
|
||||||
|
style="width: 150px"
|
||||||
|
@change="handleChangeDate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import {onMounted, ref} from 'vue'
|
||||||
|
|
||||||
|
const size = ref<'default' | 'large' | 'small'>('default')
|
||||||
|
|
||||||
|
const value = ref('')
|
||||||
|
let val = ''
|
||||||
|
import dayjs from "dayjs"
|
||||||
|
import emitter from "@/utils/emitter";
|
||||||
|
const handleChangeDate = (e:any) => {
|
||||||
|
val = dayjs(e).format('YYYY-MM-DD')
|
||||||
|
emitter.emit('getReservationDate', val)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
emitter.on('clearReservationDate', () => {
|
||||||
|
value.value = ''
|
||||||
|
console.log(value.value)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.demo-date-picker {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-date-picker .block {
|
||||||
|
padding: 30px 0;
|
||||||
|
text-align: center;
|
||||||
|
border-right: solid 1px var(--el-border-color);
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-date-picker .block:last-child {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-date-picker .demonstration {
|
||||||
|
display: block;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
59
src/layout/components/TimePicker.vue
Normal file
59
src/layout/components/TimePicker.vue
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<template>
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<span>预约时间段:</span>
|
||||||
|
<!-- <el-form-item label="" prop="time">-->
|
||||||
|
<!-- 开始时间选择 -->
|
||||||
|
<el-time-picker
|
||||||
|
v-model="startTime"
|
||||||
|
format="HH:mm"
|
||||||
|
placeholder="开始时间"
|
||||||
|
@change="onTimeChange"
|
||||||
|
:minute-step="1"
|
||||||
|
:hour-step="1"
|
||||||
|
size="default"
|
||||||
|
style="width: 100px; margin-right: 10px"
|
||||||
|
/>
|
||||||
|
<!-- 结束时间选择 -->
|
||||||
|
<el-time-picker
|
||||||
|
v-model="endTime"
|
||||||
|
format="HH:mm"
|
||||||
|
placeholder="结束时间"
|
||||||
|
@change="onTimeChange"
|
||||||
|
:minute-step="1"
|
||||||
|
:hour-step="1"
|
||||||
|
size="default"
|
||||||
|
style="width: 100px"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import {onMounted, ref} from 'vue'
|
||||||
|
import emitter from "@/utils/emitter";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
const startTime = ref('')
|
||||||
|
const endTime = ref('')
|
||||||
|
|
||||||
|
// 处理时间选择变化
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
emitter.on('clearTimeSlot', () => {
|
||||||
|
startTime.value = ''
|
||||||
|
endTime.value = ''
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const onTimeChange = (e:any) => {
|
||||||
|
if (startTime.value && endTime.value) {
|
||||||
|
const time = dayjs(startTime.value).format('HH:mm') + "-" + dayjs(endTime.value).format('HH:mm')
|
||||||
|
emitter.emit('getTimeSlot', time)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
10
src/layout/js/validUtils.js
Normal file
10
src/layout/js/validUtils.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
export const checkObjectProperties = (obj) => {
|
||||||
|
for (let prop in obj) {
|
||||||
|
// 检查属性值是否为空
|
||||||
|
if (obj[prop] === null || obj[prop] === undefined || obj[prop] === '') {
|
||||||
|
console.log(`属性 "${prop}" 值为空`);
|
||||||
|
return true; // 如果找到一个属性为空,返回 true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // 如果所有属性都非空,返回 false
|
||||||
|
}
|
|
@ -55,6 +55,11 @@ export const routes = [
|
||||||
name: '服务类订单列表',
|
name: '服务类订单列表',
|
||||||
component: ()=> import("../views/Orders/ServiceOrderList.vue")
|
component: ()=> import("../views/Orders/ServiceOrderList.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/PendingServiceOrderList',
|
||||||
|
name: '服务类商品待处理订单',
|
||||||
|
component: ()=> import("../views/Orders/PendingServiceOrderList.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/AddCoupons',
|
path: '/AddCoupons',
|
||||||
name:'添加优惠券',
|
name:'添加优惠券',
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="margin-bottom: 20px">
|
||||||
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入订单编号"
|
<el-input style="width: 250px; height: 30px; margin-right: 10px; font-size: 14px" suffix-icon="Search" placeholder="请输入订单编号"
|
||||||
v-model="name"></el-input>
|
v-model="orderNumber" ></el-input>
|
||||||
<el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button>
|
<el-button class="ml-5" type="primary" @click="load" style="height: 30px;">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
|
<el-button type="warning" @click="reset" style="height:30px">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 数据展示层 -->
|
<!-- 数据展示层 -->
|
||||||
<el-table v-loading="loading" :data="tableData" border stripe header-cell-class-name="headerBg"
|
<el-table v-loading="loading" :data="tableData" border stripe header-cell-class-name="headerBg"
|
||||||
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
|
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
|
||||||
:header-cell-style="{ 'text-align': 'center' }">
|
:header-cell-style="{ 'text-align': 'center' }" :row-style="{ height: '70px' }">
|
||||||
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
||||||
<el-table-column prop="id" label="订单序号" width="80">
|
<el-table-column prop="id" label="订单序号" width="80">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<el-table-column label="所购买的商品" width="100">
|
<el-table-column label="所购买的商品" width="100">
|
||||||
<el-table-column label="展开所有商品" type="expand" width="100">
|
<el-table-column label="展开所有商品" type="expand" width="100">
|
||||||
<template #default="props">
|
<template #default="props">
|
||||||
<el-table :data="props.row.orderItemList">
|
<el-table :data="props.row.orderItemList" border :cell-style="{ 'text-align': 'center', 'font-size': '14px'}">
|
||||||
<el-table-column label="商品名称" prop="goodSnapshot.name" width="200"/>
|
<el-table-column label="商品名称" prop="goodSnapshot.name" width="200"/>
|
||||||
<el-table-column label="商品图片" prop="goodSnapshot.goodImg" width="200">
|
<el-table-column label="商品图片" prop="goodSnapshot.goodImg" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<el-table-column prop="addressSnapshot.region" label="地区" width="180"/>
|
<el-table-column prop="addressSnapshot.region" label="地区" width="180"/>
|
||||||
<el-table-column prop="addressSnapshot.detailAddress" label="详细地址" width="180"/>
|
<el-table-column prop="addressSnapshot.detailAddress" label="详细地址" width="180"/>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="优惠卷信息" width="50">
|
<el-table-column label="优惠券信息" width="50">
|
||||||
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
||||||
<el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
|
<el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -60,9 +60,9 @@
|
||||||
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="openShipmentDialog(scope.row.id)" > <!-- @click="deliverGoods(scope.row)"-->
|
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="openShipmentDialog(scope.row.id)" > <!-- @click="deliverGoods(scope.row)"-->
|
||||||
发货
|
发货
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>
|
<!-- <el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>-->
|
||||||
取消订单
|
<!-- 取消订单-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="deleteOrder(scope.row)" type="danger" plain>
|
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="deleteOrder(scope.row)" type="danger" plain>
|
||||||
退款
|
退款
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -175,7 +175,7 @@ const shipment:any = ref({
|
||||||
})//物流单号
|
})//物流单号
|
||||||
const DialogVisible = ref(false); //详情展示
|
const DialogVisible = ref(false); //详情展示
|
||||||
const shipments = ref(false)
|
const shipments = ref(false)
|
||||||
const name = ref('')
|
const orderNumber = ref('')
|
||||||
const searchParams: any = ref({ //封装分页
|
const searchParams: any = ref({ //封装分页
|
||||||
current: 1, //当前页码
|
current: 1, //当前页码
|
||||||
pageSize: 5, //每页显示条数
|
pageSize: 5, //每页显示条数
|
||||||
|
@ -201,6 +201,7 @@ const handleSelectionChange = (row: any) => {
|
||||||
//获取订单列表
|
//获取订单列表
|
||||||
const getOrderList = async () => {
|
const getOrderList = async () => {
|
||||||
try {
|
try {
|
||||||
|
searchParams.value.orderNumber = orderNumber.value
|
||||||
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
||||||
// console.log('订单信息--->', res.data.data);
|
// console.log('订单信息--->', res.data.data);
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
|
@ -269,7 +270,7 @@ const deleteOrder = async (row : any) => { //微信退款
|
||||||
},10000)
|
},10000)
|
||||||
}
|
}
|
||||||
const reset = () => { //重置搜索框
|
const reset = () => { //重置搜索框
|
||||||
name.value = '';
|
orderNumber.value = '';
|
||||||
};
|
};
|
||||||
const load = () => { } //搜索的方法
|
const load = () => { } //搜索的方法
|
||||||
const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取消)
|
const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取消)
|
||||||
|
@ -284,4 +285,12 @@ const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
/* 使用 ::v-deep 来修改表头的对齐方式 */
|
||||||
|
::v-deep .el-table__header th {
|
||||||
|
text-align: center; /* 表头居中 */
|
||||||
|
font-size: 14px; /* 设置字体大小 */
|
||||||
|
font-weight: bold; /* 设置字体加粗 */
|
||||||
|
font-family: 'Arial', sans-serif; /* 设置字体 */
|
||||||
|
}
|
||||||
|
</style>
|
315
src/views/Orders/PendingServiceOrderList.vue
Normal file
315
src/views/Orders/PendingServiceOrderList.vue
Normal file
|
@ -0,0 +1,315 @@
|
||||||
|
<template>
|
||||||
|
<div style="margin-bottom: 20px;">
|
||||||
|
<div style="display: flex; justify-content: space-around; align-items: center">
|
||||||
|
<div>
|
||||||
|
<span>商品编号:</span><el-input style=" width: 150px; height: 30px; margin-right: 20px; font-size: 14px" suffix-icon="Search"
|
||||||
|
placeholder="请输入商品id" v-model="goodId"></el-input>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<DatePicker/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<TimePicker/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<el-button class="ml-5" type="primary" @click="load" style="height: 30px;">搜索</el-button>
|
||||||
|
<el-button type="warning" @click="reset" style="height:30px">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 数据展示层 -->
|
||||||
|
<el-table v-loading="loading" :data="tableData" border stripe header-cell-class-name="headerBg"
|
||||||
|
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :row-style="{ height: '70px' }">
|
||||||
|
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
||||||
|
<el-table-column prop="id" label="待处理订单序号" width="80">
|
||||||
|
<template #default="{ $index }">
|
||||||
|
{{ $index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodId" label="商品编号" width="100"></el-table-column>
|
||||||
|
<el-table-column prop="goodImg" label="商品图片" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<img :src="scope.row.goodImg.split(';')[0]" alt="" style="height: 50px;">
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" label="价格" width="120"></el-table-column>
|
||||||
|
<el-table-column prop="reservationDate" label="预约日期" width="200"></el-table-column>
|
||||||
|
<el-table-column prop="timeSlot" label="预约时间段" width="200"></el-table-column>
|
||||||
|
<el-table-column prop="isAvailable" label="是否可预约" width="200"></el-table-column>
|
||||||
|
<el-table-column prop="minNumber" label="最小预约人数" width="150"></el-table-column>
|
||||||
|
<el-table-column prop="currentNumber" label="当前预约人数" width="150"></el-table-column>
|
||||||
|
<el-table-column prop="maxNumber" label="最大预约人数" width="150"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="商品当前时间段的预约情况" width="300">
|
||||||
|
<el-table-column label="展开进行查看" type="expand" width="300">
|
||||||
|
<template #default="props">
|
||||||
|
<el-table :data="props.row.pendingServiceOrderVOList" border :row-style="{ height: '50px' }"
|
||||||
|
:cell-style="{ 'text-align': 'center', 'font-size': '14px'}">
|
||||||
|
<el-table-column label="订单明细id" prop="orderItemId" width="200"/>
|
||||||
|
<el-table-column label="订单编号" prop="orderNumber" width="300"></el-table-column>
|
||||||
|
<el-table-column label="联系人姓名" prop="name" width="200"/>
|
||||||
|
<el-table-column label="联系人手机号" prop="phone" width="200" />
|
||||||
|
<el-table-column label="购买数量" prop="quantity" width="200"/>
|
||||||
|
<el-table-column label="预估支付金额" prop="itemTotalAmount" width="200"/>
|
||||||
|
<el-table-column label="订单明细状态" prop="orderItemStatus" width="200"></el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="300px" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button size="small" @click="showDetail(scope.$index, scope.row)">
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
|
<el-button :disabled="!['待发货'].includes(scope.row.orderItemStatus)" size="small" @click="refundOrder(scope.row)" type="danger" plain>
|
||||||
|
退款
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页器 -->
|
||||||
|
<div style="padding: 10px 0">
|
||||||
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||||
|
:current-page="searchParams.current" :page-size="searchParams.pageSize" :page-sizes="[5, 10, 15, 20]"
|
||||||
|
:small="null" :disabled="null" :background="null" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total" />
|
||||||
|
</div>
|
||||||
|
<!-- 弹窗-->
|
||||||
|
<el-dialog title="待处理订单详情信息" v-model="DialogVisible" width="60%">
|
||||||
|
<el-form label-width="100px" size="default" :model="editForm" :disabled="disabled">
|
||||||
|
<div style="display: flex">
|
||||||
|
<el-form-item label="订单明细编号" style="width: 350px">
|
||||||
|
<el-input v-model="editForm.orderItemId" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单编号" style="width: 350px">
|
||||||
|
<el-input v-model="editForm.orderNumber" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex">
|
||||||
|
<el-form-item label="联系人姓名" style="width: 350px">
|
||||||
|
<el-input v-model="editForm.name" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系人手机号" style="width: 350px">
|
||||||
|
<el-input v-model="editForm.phone" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-form-item label="预估支付金额" style="width: 250px">
|
||||||
|
<el-input v-model="editForm.itemTotalAmount" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单明细状态" style="width: 250px">
|
||||||
|
<el-input v-model="editForm.orderItemStatus" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <div style="display: flex">-->
|
||||||
|
<!-- <el-form-item label="下单时间" style="width: 300px;">-->
|
||||||
|
<!-- <el-input v-model="editForm.createTime" autocomplete="off"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="更新时间" style="width: 300px;">-->
|
||||||
|
<!-- <el-input v-model="editForm.updateTime" autocomplete="off"></el-input>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button style="height: 30px;" @click="DialogVisible = false">取消</el-button>
|
||||||
|
<el-button style="height: 30px" type="primary" @click="DialogVisible = false" >确认</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 发货弹窗-->
|
||||||
|
<el-dialog title="发货" v-model="shipments" width="60%">
|
||||||
|
<el-form label-width="100px" size="default" >
|
||||||
|
<el-form-item label="快递单号" style="width: 300px;">
|
||||||
|
<el-input v-model="shipment.trackingNumber"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button style="height: 30px;" @click=" shipments = false">取消</el-button>
|
||||||
|
<el-button style="height: 30px" type="primary" @click="deliverGoods ">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import myAxios from "@/api/myAxios";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { SuccessInfo , ErrorInfo } from "@/utils/messageInfo";
|
||||||
|
import DatePicker from "@/layout/components/DatePicker.vue";
|
||||||
|
import TimePicker from "@/layout/components/TimePicker.vue";
|
||||||
|
import emitter from "@/utils/emitter";
|
||||||
|
import {checkObjectProperties} from "@/layout/js/validUtils";
|
||||||
|
const tableData: any = ref([]); //表单展示数据
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref('')
|
||||||
|
const disabled = ref(true)
|
||||||
|
const editForm: any = ref({});//编辑表单
|
||||||
|
const shipment:any = ref({
|
||||||
|
trackingNumber: null
|
||||||
|
})//物流单号
|
||||||
|
const DialogVisible = ref(false); //详情展示
|
||||||
|
const shipments = ref(false)
|
||||||
|
|
||||||
|
const goodId = ref('')
|
||||||
|
const reservationDate = ref('')
|
||||||
|
const timeSlot = ref('')
|
||||||
|
const searchParams: any = ref({ //封装分页
|
||||||
|
current: 1, //当前页码
|
||||||
|
pageSize: 5, //每页显示条数
|
||||||
|
sortField: "id", //根据ID分类
|
||||||
|
sortOrder: "descend", //降序
|
||||||
|
goodId: goodId.value,
|
||||||
|
reservationDate: reservationDate.value,
|
||||||
|
timeSlot: timeSlot.value
|
||||||
|
})
|
||||||
|
const loading = ref(false)
|
||||||
|
onMounted(() => {
|
||||||
|
emitter.on('getReservationDate', (val:any) => {
|
||||||
|
reservationDate.value = val
|
||||||
|
searchParams.value.reservationDate = val
|
||||||
|
})
|
||||||
|
emitter.on('getTimeSlot', (val:any) => {
|
||||||
|
timeSlot.value = val
|
||||||
|
searchParams.value.timeSlot = val
|
||||||
|
})
|
||||||
|
getOrderList() //页面加载获取订单列表
|
||||||
|
})
|
||||||
|
const handleSizeChange = (newSize: any) => {
|
||||||
|
searchParams.value.pageSize = newSize //新的页面数
|
||||||
|
getOrderList()
|
||||||
|
}
|
||||||
|
const handleCurrentChange = (Current: any) => {
|
||||||
|
searchParams.value.current = Current
|
||||||
|
getOrderList()
|
||||||
|
}
|
||||||
|
const handleSelectionChange = (row: any) => {
|
||||||
|
// id.value = JSON.parse(JSON.stringify(row));
|
||||||
|
}
|
||||||
|
//获取待处理订单列表
|
||||||
|
const getOrderList = async () => {
|
||||||
|
console.log(searchParams.value)
|
||||||
|
try {
|
||||||
|
searchParams.value.goodId = goodId.value
|
||||||
|
const res = await myAxios.post('pending/list/advance/detail', { ...searchParams.value });
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
tableData.value = res.data.data.records;
|
||||||
|
console.log(tableData.value)
|
||||||
|
tableData.value.forEach((item:any) => {
|
||||||
|
let total = 0;
|
||||||
|
for (var i = 0; i < item.pendingServiceOrderVOList.length; i ++ ) {
|
||||||
|
total += item.pendingServiceOrderVOList[i].quantity;
|
||||||
|
}
|
||||||
|
item.currentNumber = total
|
||||||
|
})
|
||||||
|
console.log('表单信息--->', tableData.value);
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: '获取数据失败',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage({
|
||||||
|
message: '发生错误',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//查看订单详情
|
||||||
|
const showDetail = (index: number, row: any) => {
|
||||||
|
title.value = "订单详情"
|
||||||
|
DialogVisible.value = true;
|
||||||
|
editForm.value = row;
|
||||||
|
console.log('editForm--->',editForm.value);
|
||||||
|
};
|
||||||
|
//发货方法
|
||||||
|
const currentId = ref<number | null>(null);
|
||||||
|
const openShipmentDialog = (id: number) => {
|
||||||
|
shipments.value = true;
|
||||||
|
currentId.value = id;
|
||||||
|
}
|
||||||
|
const deliverGoods = async () => { //发货方法
|
||||||
|
if (currentId.value) {
|
||||||
|
const res = await myAxios.post('/order/update', {
|
||||||
|
id: currentId.value,
|
||||||
|
trackingNumber: shipment.value.trackingNumber
|
||||||
|
})
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '发货成功'
|
||||||
|
})
|
||||||
|
getOrderList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.error('更新失败,请检查字段')
|
||||||
|
}
|
||||||
|
shipments.value = false;
|
||||||
|
}
|
||||||
|
const refundOrder = async (row : any) => { //微信退款
|
||||||
|
loading.value = true
|
||||||
|
console.log('row-->',row)
|
||||||
|
const res = await myAxios.post('/wechat/refund/create', { id: row.orderItemId }) //传入订单号取消订单并退款
|
||||||
|
console.log(res)
|
||||||
|
setTimeout(()=>{
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
SuccessInfo('退款成功')
|
||||||
|
getOrderList()
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
},10000)
|
||||||
|
}
|
||||||
|
const reset = () => { //重置搜索框
|
||||||
|
goodId.value = ''
|
||||||
|
reservationDate.value = ''
|
||||||
|
timeSlot.value = ''
|
||||||
|
|
||||||
|
searchParams.value.goodId = ''
|
||||||
|
searchParams.value.reservationDate = ''
|
||||||
|
searchParams.value.timeSlot = ''
|
||||||
|
|
||||||
|
emitter.emit('clearReservationDate')
|
||||||
|
emitter.emit('clearTimeSlot')
|
||||||
|
getOrderList()
|
||||||
|
};
|
||||||
|
const load = () => {
|
||||||
|
getOrderList()
|
||||||
|
} //搜索的方法
|
||||||
|
const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取消)
|
||||||
|
console.log('点击的这一行--->',row);
|
||||||
|
const res = await myAxios.post('/order/cancel/id',{ id: row.id })
|
||||||
|
if(res.data.code === 1) {
|
||||||
|
getOrderList()
|
||||||
|
SuccessInfo('取消订单成功')
|
||||||
|
} else {
|
||||||
|
ErrorInfo('请求错误')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/* 使用 ::v-deep 来修改表头的对齐方式 */
|
||||||
|
::v-deep .el-table__header th {
|
||||||
|
text-align: center; /* 表头居中 */
|
||||||
|
font-size: 14px; /* 设置字体大小 */
|
||||||
|
font-weight: bold; /* 设置字体加粗 */
|
||||||
|
font-family: 'Arial', sans-serif; /* 设置字体 */
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="margin-bottom: 20px">
|
||||||
<el-input style="width: 200px; height: 30px; margin-right: 10px;" suffix-icon="Search" placeholder="请输入订单编号"
|
<el-input style="width: 250px; height: 30px; margin-right: 10px; font-size: 14px" suffix-icon="Search" placeholder="请输入订单编号"
|
||||||
v-model="name"></el-input>
|
v-model="orderNumber"></el-input>
|
||||||
<el-button class="ml-5" type="primary" @click="load" style="height: 25px;">搜索</el-button>
|
<el-button class="ml-5" type="primary" @click="load" style="height: 30px;">搜索</el-button>
|
||||||
<el-button type="warning" @click="reset" style="height:25px">重置</el-button>
|
<el-button type="warning" @click="reset" style="height:30px">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 数据展示层 -->
|
<!-- 数据展示层 -->
|
||||||
<el-table v-loading="loading" :data="tableData" border stripe header-cell-class-name="headerBg"
|
<el-table v-loading="loading" :data="tableData" border stripe header-cell-class-name="headerBg"
|
||||||
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
|
:cell-style="{ 'text-align': 'center', 'font-size': '16px' }" @selection-change="handleSelectionChange"
|
||||||
:header-cell-style="{ 'text-align': 'center' }">
|
:header-cell-style="{ 'text-align': 'center' }" :row-style="{ height: '70px' }">
|
||||||
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
||||||
<el-table-column prop="id" label="订单序号" width="80">
|
<el-table-column prop="id" label="订单序号" width="80">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
<el-table-column label="所购买的商品" width="100">
|
<el-table-column label="所购买的商品" width="100">
|
||||||
<el-table-column label="展开所有商品" type="expand" width="100">
|
<el-table-column label="展开所有商品" type="expand" width="100">
|
||||||
<template #default="props">
|
<template #default="props">
|
||||||
<el-table :data="props.row.orderItemList">
|
<el-table :data="props.row.orderItemList" border :cell-style="{ 'text-align': 'center', 'font-size': '14px'}">
|
||||||
<el-table-column label="商品名称" prop="goodSnapshot.name" width="200"/>
|
<el-table-column label="商品名称" prop="goodSnapshot.name" width="200"/>
|
||||||
<el-table-column label="商品图片" prop="goodSnapshot.goodImg" width="200">
|
<el-table-column label="商品图片" prop="goodSnapshot.goodImg" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<el-table-column prop="contactsSnapshot.name" label="姓名" />
|
<el-table-column prop="contactsSnapshot.name" label="姓名" />
|
||||||
<el-table-column prop="contactsSnapshot.phone" label="手机号" width="180"/>
|
<el-table-column prop="contactsSnapshot.phone" label="手机号" width="180"/>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="优惠卷信息" width="50">
|
<el-table-column label="优惠券信息" width="50">
|
||||||
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
<el-table-column prop="couponSnapshot.name" label="优惠卷名称" />
|
||||||
<el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
|
<el-table-column prop="couponSnapshot.conditionAmount" label="优惠金额" />
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -56,12 +56,12 @@
|
||||||
<el-button size="small" @click="showDetail(scope.$index, scope.row)">
|
<el-button size="small" @click="showDetail(scope.$index, scope.row)">
|
||||||
详情
|
详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="openShipmentDialog(scope.row.id)" > <!-- @click="deliverGoods(scope.row)"-->
|
<!-- <el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="openShipmentDialog(scope.row.id)" > <!– @click="deliverGoods(scope.row)"–>-->
|
||||||
发货
|
<!-- 发货-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>
|
<!-- <el-button :disabled="!['待支付'].includes(scope.row.orderStatus)" size="small" @click="cancelOrder(scope.row)" type="warning" plain>-->
|
||||||
取消订单
|
<!-- 取消订单-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="deleteOrder(scope.row)" type="danger" plain>
|
<el-button :disabled="!['待发货'].includes(scope.row.orderStatus)" size="small" @click="deleteOrder(scope.row)" type="danger" plain>
|
||||||
退款
|
退款
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -148,6 +148,7 @@ import { onMounted, ref } from "vue";
|
||||||
import myAxios from "@/api/myAxios";
|
import myAxios from "@/api/myAxios";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { SuccessInfo , ErrorInfo } from "@/utils/messageInfo";
|
import { SuccessInfo , ErrorInfo } from "@/utils/messageInfo";
|
||||||
|
import emitter from "@/utils/emitter";
|
||||||
const tableData: any = ref([]); //表单展示数据
|
const tableData: any = ref([]); //表单展示数据
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
@ -158,7 +159,7 @@ const shipment:any = ref({
|
||||||
})//物流单号
|
})//物流单号
|
||||||
const DialogVisible = ref(false); //详情展示
|
const DialogVisible = ref(false); //详情展示
|
||||||
const shipments = ref(false)
|
const shipments = ref(false)
|
||||||
const name = ref('')
|
const orderNumber = ref('')
|
||||||
const searchParams: any = ref({ //封装分页
|
const searchParams: any = ref({ //封装分页
|
||||||
current: 1, //当前页码
|
current: 1, //当前页码
|
||||||
pageSize: 5, //每页显示条数
|
pageSize: 5, //每页显示条数
|
||||||
|
@ -184,6 +185,7 @@ const handleSelectionChange = (row: any) => {
|
||||||
//获取订单列表
|
//获取订单列表
|
||||||
const getOrderList = async () => {
|
const getOrderList = async () => {
|
||||||
try {
|
try {
|
||||||
|
searchParams.value.orderNumber = orderNumber.value
|
||||||
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
const res = await myAxios.post('/order/list/page', { ...searchParams.value });
|
||||||
// console.log('订单信息--->', res.data.data);
|
// console.log('订单信息--->', res.data.data);
|
||||||
if (res.data.code === 1) {
|
if (res.data.code === 1) {
|
||||||
|
@ -253,9 +255,11 @@ const deleteOrder = async (row : any) => { //微信退款
|
||||||
},10000)
|
},10000)
|
||||||
}
|
}
|
||||||
const reset = () => { //重置搜索框
|
const reset = () => { //重置搜索框
|
||||||
name.value = '';
|
orderNumber.value = ''
|
||||||
};
|
};
|
||||||
const load = () => { } //搜索的方法
|
const load = () => {
|
||||||
|
getOrderList()
|
||||||
|
} //搜索的方法
|
||||||
const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取消)
|
const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取消)
|
||||||
console.log('点击的这一行--->',row);
|
console.log('点击的这一行--->',row);
|
||||||
const res = await myAxios.post('/order/cancel/id',{ id: row.id })
|
const res = await myAxios.post('/order/cancel/id',{ id: row.id })
|
||||||
|
@ -268,4 +272,12 @@ const cancelOrder = async (row:any)=>{ //取消订单的方法(未支付能取
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
/* 使用 ::v-deep 来修改表头的对齐方式 */
|
||||||
|
::v-deep .el-table__header th {
|
||||||
|
text-align: center; /* 表头居中 */
|
||||||
|
font-size: 14px; /* 设置字体大小 */
|
||||||
|
font-weight: bold; /* 设置字体加粗 */
|
||||||
|
font-family: 'Arial', sans-serif; /* 设置字体 */
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user