更新订单管理模块,增加订单详情跳转用户订单
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
</view>
|
||||
<view class="bg-gray u-p-20 u-m-t-20">
|
||||
<view>备注</view>
|
||||
<view class="u-m-t-10">无</view>
|
||||
<view class="u-m-t-10">{{orderInfo.remark}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
})
|
||||
const recoders = reactive({
|
||||
list:[
|
||||
{title:'2024-09-15 11:20:30',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15 ',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15 ',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'}
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'},
|
||||
{title:'2024-09-15',content:'[东风(id:124413)]使用代客下单提交。(未打印预结单)'}
|
||||
],
|
||||
active:0
|
||||
})
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
</template>
|
||||
<view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-20">
|
||||
<view class="u-flex">
|
||||
<up-avatar :size="30"></up-avatar>
|
||||
<view class="color-666 u-m-l-30">未绑定手机号</view>
|
||||
<up-avatar :size="30" :src="user.headImg"></up-avatar>
|
||||
<view class="color-666 u-m-l-30">{{user.telephone||'未绑定手机号'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<my-button :height="60" plain shape="circle">他的订单</my-button>
|
||||
<my-button @click="toOrder" :height="60" plain shape="circle">他的订单</my-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-m-t-20 u-row-between">
|
||||
<view class="">
|
||||
<view class="font-bold">0.00</view>
|
||||
<view class="font-bold">{{user.amount}}</view>
|
||||
<view class="color-666 u-m-t-10">余额</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold">0.00</view>
|
||||
<view class="font-bold">{{user.totalScore}}</view>
|
||||
<view class="color-666 u-m-t-10">积分</view>
|
||||
</view>
|
||||
<view class="">
|
||||
@@ -34,13 +34,30 @@
|
||||
const props = defineProps({
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
status:''
|
||||
}
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
return {
|
||||
id:'',
|
||||
headImg:'',
|
||||
telephone:'',
|
||||
amount:'0.00',
|
||||
totalScore:'0.00'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function toOrder(){
|
||||
go.to('PAGES_ORDER_INDEX',{
|
||||
userId:props.user.id||'',
|
||||
type:'user'
|
||||
})
|
||||
}
|
||||
|
||||
function chooseUser() {
|
||||
go.to('PAGES_CHOOSE_USER')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="min-page bg-gray u-font-28 u-p-30">
|
||||
<user-vue :orderInfo="orderDetail.info"></user-vue>
|
||||
<user-vue :orderInfo="orderDetail.info" :user="user"></user-vue>
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
|
||||
<text class="color-666">桌位号:</text>
|
||||
<text class="font-bold">{{orderDetail.info.tableName}}</text>
|
||||
@@ -8,7 +8,8 @@
|
||||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee.totalAmount" @tuicai="onTuiCai"></goods-list>
|
||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info" :data="orderDetail.seatFee"></extra-vue>
|
||||
<extra-vue @tuicai="onSeatFeeTuicai" @tuikuan="onSeatFeeTuiKuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.seatFee"></extra-vue>
|
||||
</template>
|
||||
<order-vue :data="orderDetail.info" :table="options" :seatFee="orderDetail.seatFee"></order-vue>
|
||||
<step-vue></step-vue>
|
||||
@@ -36,6 +37,7 @@
|
||||
<script setup>
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import * as orderApi from '@/http/yskApi/order.js'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
import {
|
||||
objToArrary
|
||||
} from '@/commons/utils/returrn-data.js'
|
||||
@@ -59,20 +61,43 @@
|
||||
import OrderDetail from './page.js'
|
||||
const tuicai = reactive({
|
||||
show: false,
|
||||
isSeatFee:false,
|
||||
isSeatFee: false,
|
||||
selGoods: {}
|
||||
})
|
||||
|
||||
function onSeatFeeTuicai(seatFee){
|
||||
|
||||
function onSeatFeeTuicai(seatFee) {
|
||||
tuicai.show = true
|
||||
tuicai.isSeatFee = seatFee
|
||||
tuicai.selGoods = seatFee
|
||||
}
|
||||
function onSeatFeeTuiKuan(seatFee){
|
||||
|
||||
function onSeatFeeTuiKuan(seatFee) {
|
||||
console.log(seatFee);
|
||||
const {
|
||||
id,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
productSkuName,
|
||||
cartId,
|
||||
num,
|
||||
priceAmount,
|
||||
price
|
||||
} = seatFee
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
|
||||
id,
|
||||
cartId,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
num,
|
||||
number: 0,
|
||||
productSkuName: productSkuName || '',
|
||||
priceAmount,
|
||||
price
|
||||
})
|
||||
}
|
||||
|
||||
function onTuiCai(goods, index) {
|
||||
console.log(goods);
|
||||
tuicai.show = true
|
||||
@@ -87,8 +112,8 @@
|
||||
tuicai.selGoods.status = 'return'
|
||||
tuicai.show = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function printDishes() {
|
||||
try {
|
||||
const res = await Api.$printDishes({
|
||||
@@ -115,7 +140,17 @@
|
||||
}
|
||||
|
||||
function onTuikuan(goods, index) {
|
||||
const {id,productId,productSkuId,productName,productSkuName,cartId,num,priceAmount,price}=goods
|
||||
const {
|
||||
id,
|
||||
productId,
|
||||
productSkuId,
|
||||
productName,
|
||||
productSkuName,
|
||||
cartId,
|
||||
num,
|
||||
priceAmount,
|
||||
price
|
||||
} = goods
|
||||
go.to('PAGES_ORDER_TUIKUAN', {
|
||||
id,
|
||||
cartId,
|
||||
@@ -123,14 +158,15 @@
|
||||
productSkuId,
|
||||
productName,
|
||||
num,
|
||||
number:0,
|
||||
productSkuName:productSkuName||'',
|
||||
priceAmount,price
|
||||
number: 0,
|
||||
productSkuName: productSkuName || '',
|
||||
priceAmount,
|
||||
price
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const uiPage = new OrderDetail()
|
||||
setTimeout(() => {
|
||||
uiPage.setVal('user', {
|
||||
@@ -148,7 +184,7 @@
|
||||
|
||||
function toPay() {
|
||||
go.to('PAGES_ORDER_PAY', {
|
||||
tableId: options.tableId,
|
||||
tableId: options.tableId|| orderDetail.info.tableId,
|
||||
tableName: options.name,
|
||||
masterId: options.masterId,
|
||||
orderId: orderDetail.info.id,
|
||||
@@ -166,6 +202,15 @@
|
||||
const options = reactive({})
|
||||
async function init() {
|
||||
const res = await orderApi.tbOrderInfoDetail(options.id)
|
||||
if(res.userId){
|
||||
queryAllShopUser({id:res.userId}).then(res=>{
|
||||
if(res.content[0]){
|
||||
user.value=res.content[0]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (res.detailList.length) {
|
||||
uni.setStorageSync('useType', res.detailList[0].useType)
|
||||
}
|
||||
@@ -222,12 +267,17 @@
|
||||
}
|
||||
|
||||
// 监听选择用户事件
|
||||
let user = ref(null)
|
||||
let user = ref({
|
||||
headImg:'',
|
||||
telephone:'',
|
||||
amount:'0.00',
|
||||
totalScore:'0.00'
|
||||
})
|
||||
//更新选择用户
|
||||
function setUser(par) {
|
||||
const submitPar = {
|
||||
masterId: options.masterId,
|
||||
tableId: options.tableId,
|
||||
tableId: options.tableId|| orderDetail.info.tableId,
|
||||
vipUserId: user.value.id ? user.value.id : '',
|
||||
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<view class="u-rela time-item tranistion-2" @click="changeTimeDataSel(-1)"
|
||||
:class="{active:timeData.sel==-1}">自定义</view>
|
||||
</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}"
|
||||
v-for="(item,index) in statusData.list" :key="index">
|
||||
@@ -18,6 +19,29 @@
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="type&&userShow">
|
||||
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="userShow">
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<up-avatar :size="22" :src="user.headImg"></up-avatar>
|
||||
<view class="u-m-l-10 u-m-r-10">
|
||||
<text v-if="user.id">{{user.telephone||user.nickName}}</text>
|
||||
<text v-else>服务员下单</text>
|
||||
</view>
|
||||
<up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-else>
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<up-avatar :size="22" ></up-avatar>
|
||||
<view class="u-m-l-10 u-m-r-10">
|
||||
服务员下单
|
||||
</view>
|
||||
<up-icon name="close-circle-fill" :color="color.ColorMain" @click="userShowClose"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<view class="u-p-l-28 u-flex u-p-r-28 u-p-t-10 bg-gray" v-if="time.length">
|
||||
<view class="time-area u-font-24 color-main u-flex">
|
||||
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="time[0]"></uni-dateformat>
|
||||
@@ -31,7 +55,9 @@
|
||||
<view class="u-text-center font-bold u-font-32 u-p-t-30">选择状态</view>
|
||||
<view style="height: 20rpx;"></view>
|
||||
<view class="u-p-30 all-list u-flex u-flex-wrap gap-20">
|
||||
<view class="all-list-item" :class="{active:statusItemIndex==statusData.allListSel}" @click="changeAllListSel(statusItemIndex)" v-for="(statusItem,statusItemIndex) in statusData.allList" :key="statusItemIndex">
|
||||
<view class="all-list-item" :class="{active:statusItemIndex==statusData.allListSel}"
|
||||
@click="changeAllListSel(statusItemIndex)"
|
||||
v-for="(statusItem,statusItemIndex) in statusData.allList" :key="statusItemIndex">
|
||||
{{statusItem.label}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -47,11 +73,20 @@
|
||||
<script setup>
|
||||
import orderEnum from '@/commons/orderEnum.js'
|
||||
import * as $time from '@/commons/utils/dayjs-time.js';
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
|
||||
const emits = defineEmits(['update:time', 'update:status','clearUser'])
|
||||
|
||||
function userShowClose() {
|
||||
userShow.value = false
|
||||
emits('clearUser')
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
time: {
|
||||
type: Array,
|
||||
@@ -60,10 +95,31 @@
|
||||
status: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
userId: ''
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
type:{
|
||||
type:String,
|
||||
default:''//user 查看具体用户订单
|
||||
}
|
||||
})
|
||||
let userShow = ref(props.type? true : false)
|
||||
console.log(props.type);
|
||||
watch(() => props.type, (newval) => {
|
||||
console.log(newval);
|
||||
if (newval) {
|
||||
userShow.value = true
|
||||
}
|
||||
})
|
||||
|
||||
let datePicker = ref(null)
|
||||
const emits = defineEmits(['update:time', 'update:status'])
|
||||
// 示例使用
|
||||
const today = $time.getTodayTimestamps();
|
||||
const yesterday = $time.getYesterdayTimestamps();
|
||||
@@ -90,7 +146,7 @@
|
||||
|
||||
const statusData = reactive({
|
||||
allList: orderEnum.status,
|
||||
moreShow:false,
|
||||
moreShow: false,
|
||||
allListSel: -1,
|
||||
list: [{
|
||||
label: '全部',
|
||||
@@ -115,12 +171,15 @@
|
||||
],
|
||||
sel: 0
|
||||
})
|
||||
function moreShowHide(){
|
||||
statusData.moreShow=false
|
||||
|
||||
function moreShowHide() {
|
||||
statusData.moreShow = false
|
||||
}
|
||||
function moreShowOpen(){
|
||||
statusData.moreShow=true
|
||||
|
||||
function moreShowOpen() {
|
||||
statusData.moreShow = true
|
||||
}
|
||||
|
||||
function changeStatusSel(i) {
|
||||
statusData.sel = i
|
||||
}
|
||||
@@ -129,8 +188,9 @@
|
||||
console.log(e);
|
||||
emits('update:time', [e.start, e.end])
|
||||
}
|
||||
function changeAllListSel(i){
|
||||
statusData.allListSel=i
|
||||
|
||||
function changeAllListSel(i) {
|
||||
statusData.allListSel = i
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -144,7 +204,8 @@
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
.all-list-item{
|
||||
|
||||
.all-list-item {
|
||||
text-align: center;
|
||||
width: 156rpx;
|
||||
white-space: nowrap;
|
||||
@@ -153,11 +214,13 @@
|
||||
border-radius: 8rpx;
|
||||
transition: all .2s ease-in-out;
|
||||
border: 1px solid #eee;
|
||||
|
||||
&.active {
|
||||
color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
}
|
||||
|
||||
.time-item {
|
||||
color: #666;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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 v-model:time="order.data.query.createdAt"></filter-vue>
|
||||
<filter-vue @clearUser="clearQueryUser" 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>
|
||||
@@ -15,13 +15,16 @@
|
||||
<script setup>
|
||||
import {onLoad,onShow,onPullDownRefresh} from '@dcloudio/uni-app'
|
||||
import * as Api from '@/http/yskApi/order.js'
|
||||
import {queryAllShopUser} from '@/http/yskApi/shop-user.js'
|
||||
|
||||
|
||||
import LIST from '@/commons/class/list.js'
|
||||
import {$printOrder} from '@/http/yskApi/Instead.js'
|
||||
import filterVue from './compoents/filter.vue';
|
||||
import orderList from './compoents/order-list.vue';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import {
|
||||
reactive, watch
|
||||
reactive, ref, watch
|
||||
} from 'vue';
|
||||
|
||||
const search = reactive({
|
||||
@@ -47,9 +50,13 @@
|
||||
pageSize: 10,
|
||||
payType: "",
|
||||
productName: "",
|
||||
status: ""
|
||||
status: "",
|
||||
userId:''
|
||||
}
|
||||
})
|
||||
function clearQueryUser(){
|
||||
order.setQuery('userId','')
|
||||
}
|
||||
function pageChange(e){
|
||||
order.setVal('page',e)
|
||||
console.log(e);
|
||||
@@ -62,6 +69,9 @@
|
||||
watch(()=>order.data.query.createdAt,(newval)=>{
|
||||
init()
|
||||
})
|
||||
watch(()=>order.data.query.userId,(newval)=>{
|
||||
init()
|
||||
})
|
||||
async function init() {
|
||||
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.page})
|
||||
uni.stopPullDownRefresh()
|
||||
@@ -75,6 +85,21 @@
|
||||
init()
|
||||
})
|
||||
|
||||
let user=ref({
|
||||
userId:''
|
||||
})
|
||||
const option=reactive({type:''})
|
||||
onLoad((opt)=>{
|
||||
Object.assign(option,opt)
|
||||
if(opt&&JSON.stringify(opt)!='{}'){
|
||||
order.setQuery('userId',opt.userId?opt.userId:'')
|
||||
if(opt.userId){
|
||||
queryAllShopUser({id:opt.userId}).then(res=>{
|
||||
user.value=res.content[0]||opt
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onShow(init)
|
||||
async function printOrder(item){
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import * as orderApi from '@/http/yskApi/order.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import editDiscount from '@/pagesCreateOrder/components/edit-discount.vue'
|
||||
import editDiscount from '@/components/my-components/edit-discount.vue'
|
||||
|
||||
let payStatus = ref(null) //loading success
|
||||
|
||||
@@ -247,18 +247,18 @@
|
||||
});
|
||||
}
|
||||
watch(() => pays.payTypes.selIndex, (newval) => {
|
||||
const item = pays.payTypes.list[newval]
|
||||
if (item.payType == "vipPay") {
|
||||
return
|
||||
}
|
||||
if (item.payType == "deposit") {
|
||||
//储值卡支付
|
||||
return saomaPay('deposit')
|
||||
}
|
||||
if (item.payType == "scanCode") {
|
||||
//扫码支付
|
||||
return saomaPay('scanCode')
|
||||
}
|
||||
// const item = pays.payTypes.list[newval]
|
||||
// if (item.payType == "vipPay") {
|
||||
// return
|
||||
// }
|
||||
// if (item.payType == "deposit") {
|
||||
// //储值卡支付
|
||||
// return saomaPay('deposit')
|
||||
// }
|
||||
// if (item.payType == "scanCode") {
|
||||
// //扫码支付
|
||||
// return saomaPay('scanCode')
|
||||
// }
|
||||
})
|
||||
let payCodeUrl = ref('')
|
||||
async function init() {
|
||||
|
||||
Reference in New Issue
Block a user