订单管理更新

This commit is contained in:
YeMingfei666 2024-10-15 15:23:37 +08:00
parent a5091f8f2d
commit 15626e4d33
4 changed files with 45 additions and 26 deletions

View File

@ -12,7 +12,7 @@
<view>桌位号</view>
<view>{{table.name||data.tableName}}</view>
</view>
<view class="u-flex u-row-between u-m-t-20">
<view class="u-flex u-row-between u-m-t-20" v-if="seatFee.number">
<view>就餐人数</view>
<view>{{seatFee.number||''}}</view>
</view>

View File

@ -16,17 +16,24 @@
<view style="height: 200rpx;"></view>
<view class="u-fixed bottom bg-fff ">
<view class="u-flex u-abso">
<template v-if="orderDetail.info.status=='unpaid'">
<template v-if="orderDetail.info.useType=='takeout'">
<view class="u-flex-1">
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx"
shape="circle" plain type="primary">加菜</my-button>
</view>
<view class="u-flex-1">
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle"
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
type="primary">结账</my-button>
</view>
</template>
<template v-else>
<template v-if="orderDetail.info.status=='unpaid'">
<view class="u-flex-1">
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx"
shape="circle" plain type="primary">加菜</my-button>
</view>
<view class="u-flex-1">
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle"
type="primary">结账</my-button>
</view>
</template>
</template>
</view>
</view>

View File

@ -10,7 +10,7 @@
</view>
<view class="u-m-t-2 bg-fff u-col-center u-flex u-p-l-28 u-p-r-28 u-p-t-30 u-row-between">
<view class="status-item " @click="changeStatusSel(index)" :class="{active:statusData.sel==index}"
<view class="status-item " @click="changeStatusSel(item.value)" :class="{active:statusData.sel==item.value}"
v-for="(item,index) in statusData.list" :key="index">
{{item.label}}
</view>
@ -138,6 +138,7 @@
}
watch(() => timeData.sel, (newval) => {
const data = timeData.list[newval]
if (newval != -1) {
emits('update:time', [data.start, data.end])
@ -153,23 +154,27 @@
value: ''
},
{
label: '待完成',
value: ''
},
{
label: '待退款',
value: ''
},
{
label: '未支付',
label: '待支付',
value: 'unpaid'
},
// {
// label: '',
// value: ''
// },
{
label: '已完成',
value: 'closed'
},
// {
// label: '',
// value: 'unpaid'
// },
{
label: '已退款',
value: ''
value: 'refund'
}
],
sel: 0
sel: ''
})
function moreShowHide() {
@ -182,6 +187,7 @@
function changeStatusSel(i) {
statusData.sel = i
emits('update:status', i)
}
function datePickerConfirm(e) {

View File

@ -4,10 +4,12 @@
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
<up-search v-bind="search" v-model="search.val"></up-search>
</view>
<filter-vue @clearUser="clearQueryUser" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
<filter-vue @clearUser="clearQueryUser" v-model:status="order.data.query.status" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
</view>
<order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list>
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
<template v-if="order.data.list.length>0">
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
</template>
<view style="height: 100rpx;"></view>
</view>
</template>
@ -26,7 +28,7 @@
import {
reactive, ref, watch
} from 'vue';
import {getTodayTimestamps} from '@/commons/utils/dayjs-time.js';
const search = reactive({
val: '',
placeholder: '搜索单号/昵称/姓名/手机号码/商品名称',
@ -39,14 +41,15 @@
}
})
const today = getTodayTimestamps();
const order=new LIST({
list: [],
query: {
createdAt: [],
createdAt: [today.start,today.end],
id: "",
orderNo: "",
orderType: "0",
page: 0,
page: 1,
pageSize: 10,
payType: "",
productName: "",
@ -68,12 +71,15 @@
watch(()=>order.data.query.createdAt,(newval)=>{
init()
})
watch(()=>order.data.query.status,(newval)=>{
init()
})
watch(()=>order.data.query.userId,(newval)=>{
init()
})
async function init() {
console.log(order.data.query);
const {content,totalElements}=await Api.tbOrderInfoData(order.data.query)
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.query.page-1})
uni.stopPullDownRefresh()
order.setVal('list',content)
console.log(order.data.list);