feat: 增加桌台统计跳转订单页面传参

This commit is contained in:
YeMingfei666 2025-03-19 15:53:09 +08:00
parent 6f779f19a3
commit c67424fe2c
4 changed files with 76 additions and 23 deletions

View File

@ -1,13 +1,27 @@
<template>
<el-card v-show="visible" v-hasPerm="[`${searchConfig.pageName}:query`]" shadow="never" class="mb-[10px]">
<el-card
v-show="visible"
v-hasPerm="[`${searchConfig.pageName}:query`]"
shadow="never"
class="mb-[10px]"
>
<el-form ref="queryFormRef" :model="queryParams" :inline="inline">
<template v-for="(item, index) in formItems" :key="item.prop">
<el-form-item v-show="isExpand ? true : index < showNumber" :label="item.label" :prop="item.prop">
<el-form-item
v-show="isExpand ? true : index < showNumber"
:label="item.label"
:prop="item.prop"
>
<!-- Label -->
<template v-if="item.tips" #label>
<span>
{{ item.label }}
<el-tooltip placement="bottom" effect="light" :content="item.tips" :raw-content="true">
<el-tooltip
placement="bottom"
effect="light"
:content="item.tips"
:raw-content="true"
>
<el-icon style="vertical-align: -0.15em" size="16">
<QuestionFilled />
</el-icon>
@ -16,7 +30,11 @@
</template>
<!-- Input 输入框 -->
<template v-if="item.type === 'input' || item.type === undefined">
<el-input v-model="queryParams[item.prop]" v-bind="item.attrs" @keyup.enter="handleQuery" />
<el-input
v-model="queryParams[item.prop]"
v-bind="item.attrs"
@keyup.enter="handleQuery"
/>
</template>
<!-- radio-button radio按钮组 -->
<template v-if="item.type === 'radio-button'">
@ -29,17 +47,30 @@
<!-- InputTag 标签输入框 -->
<template v-if="item.type === 'input-tag'">
<div class="flex-center">
<el-tag v-for="tag in inputTagMap[item.prop].data" :key="tag" class="mr-2" :closable="true"
v-bind="inputTagMap[item.prop].tagAttrs" @close="handleCloseTag(item.prop, tag)">
<el-tag
v-for="tag in inputTagMap[item.prop].data"
:key="tag"
class="mr-2"
:closable="true"
v-bind="inputTagMap[item.prop].tagAttrs"
@close="handleCloseTag(item.prop, tag)"
>
{{ tag }}
</el-tag>
<template v-if="inputTagMap[item.prop].inputVisible">
<el-input :ref="(el: HTMLElement) => (inputTagMap[item.prop].inputRef = el)"
v-model="inputTagMap[item.prop].inputValue" v-bind="inputTagMap[item.prop].inputAttrs"
@keyup.enter="handleInputConfirm(item.prop)" @blur="handleInputConfirm(item.prop)" />
<el-input
:ref="(el: HTMLElement) => (inputTagMap[item.prop].inputRef = el)"
v-model="inputTagMap[item.prop].inputValue"
v-bind="inputTagMap[item.prop].inputAttrs"
@keyup.enter="handleInputConfirm(item.prop)"
@blur="handleInputConfirm(item.prop)"
/>
</template>
<template v-else>
<el-button v-bind="inputTagMap[item.prop].buttonAttrs" @click="handleShowInput(item.prop)">
<el-button
v-bind="inputTagMap[item.prop].buttonAttrs"
@click="handleShowInput(item.prop)"
>
{{ inputTagMap[item.prop].buttonAttrs.btnText }}
</el-button>
</template>
@ -49,7 +80,10 @@
<template v-else-if="item.type === 'select'">
<el-select v-model="queryParams[item.prop]" v-bind="item.attrs">
<template v-for="option in item.options" :key="option.value">
<el-option :label="option.label || option.name" :value="option.value || option.id" />
<el-option
:label="option.label || option.name"
:value="option.value || option.id"
/>
</template>
</el-select>
</template>
@ -67,8 +101,13 @@
<el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>
<el-button icon="refresh" @click="handleReset">重置</el-button>
<!-- 展开/收起 -->
<el-link v-if="isExpandable && formItems.length > showNumber" class="ml-2" type="primary" :underline="false"
@click="isExpand = !isExpand">
<el-link
v-if="isExpandable && formItems.length > showNumber"
class="ml-2"
type="primary"
:underline="false"
@click="isExpand = !isExpand"
>
<template v-if="isExpand">
收起
<el-icon>
@ -207,11 +246,12 @@ function handleShowInput(prop: string) {
inputTagMap[prop].inputRef.focus();
});
}
function setQueryParams(data: object) {
queryParams.orderNo = data.orderNo
function setQueryValue(key: string, val: any) {
queryParams[key] = val;
}
//
defineExpose({ getQueryParams, toggleVisible, setQueryParams });
defineExpose({ getQueryParams, toggleVisible, setQueryValue });
</script>
<style lang="scss" scoped></style>

View File

@ -141,10 +141,9 @@ export default {
toTableOrderList(data) {
// console.log(data)
this.$router.push({
path: "/order_manage/order_list",
path: "/order/index",
query: {
tableName: data.tableName,
timeValue: this.timeValue,
},
});
},

View File

@ -39,6 +39,18 @@ const searchConfig: ISearchConfig = {
},
},
},
{
type: "input",
label: "台桌名称",
prop: "tableName",
attrs: {
placeholder: "请输入台桌名称",
clearable: true,
style: {
width: "200px",
},
},
},
{
type: "input",
label: "商品名称",

View File

@ -151,10 +151,12 @@ function returnOriginAmount(order: OrderInfoVo) {
});
return amount.toFixed(2);
}
const routeto = useRoute();
const route = useRoute();
onMounted(() => {
handleQueryClick({ orderNo: routeto.query.orderNo });
searchRef.value?.setQueryParams({ orderNo: routeto.query.orderNo });
const { orderNo, tableName } = route.query;
handleQueryClick({ orderNo, tableName });
searchRef.value?.setQueryValue("orderNo", orderNo);
searchRef.value?.setQueryValue("tableName", tableName);
});
//
@ -207,10 +209,10 @@ function returnStateType(status: string) {
}
}
const route = useRouter();
const router = useRouter();
//
function toPayOrder(order: getListResponse) {
route.push({
router.push({
path: "/tool/index",
query: {
id: order.id,