|
@@ -3,7 +3,14 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
<el-col :span="24" class="one">
|
|
<el-col :span="24" class="one">
|
|
- <c-search :is_search="true" :fields="fields" @search="btSearch"></c-search>
|
|
|
|
|
|
+ <c-search :is_search="true" :fields="fields" @search="btSearch">
|
|
|
|
+ <template #type>
|
|
|
|
+ <el-option v-for="item in typeList" :key="item.dict_value" :label="item.dict_label" :value="item.dict_value"> </el-option>
|
|
|
|
+ </template>
|
|
|
|
+ <template #table>
|
|
|
|
+ <el-option v-for="item in tableList" :key="item._id" :label="item.name" :value="item._id"> </el-option>
|
|
|
|
+ </template>
|
|
|
|
+ </c-search>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="two">
|
|
<el-col :span="24" class="two">
|
|
<data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @view="toView" @pay="toPay"> </data-table>
|
|
<data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @view="toView" @pay="toPay"> </data-table>
|
|
@@ -17,6 +24,7 @@
|
|
import { order_type } from '@common/src/layout/site';
|
|
import { order_type } from '@common/src/layout/site';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
|
|
+const { mapActions: table } = createNamespacedHelpers('table');
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
props: {},
|
|
props: {},
|
|
@@ -31,7 +39,17 @@ export default {
|
|
{ label: '序号', options: { type: 'index' } },
|
|
{ label: '序号', options: { type: 'index' } },
|
|
{ label: '订单号', model: '_id', isSearch: true },
|
|
{ label: '订单号', model: '_id', isSearch: true },
|
|
{ label: '下单时间', model: 'time' },
|
|
{ label: '下单时间', model: 'time' },
|
|
- { label: '下单桌号', model: 'table' },
|
|
|
|
|
|
+ {
|
|
|
|
+ label: '下单桌号',
|
|
|
|
+ model: 'table',
|
|
|
|
+ type: 'select',
|
|
|
|
+ format: (i) => {
|
|
|
|
+ let data = this.tableList.find((r) => r._id == i);
|
|
|
|
+ if (data) return data.name;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
|
|
+ isSearch: true,
|
|
|
|
+ },
|
|
{ label: '支付金额', model: 'money' },
|
|
{ label: '支付金额', model: 'money' },
|
|
{ label: '用餐人数', model: 'num' },
|
|
{ label: '用餐人数', model: 'num' },
|
|
{
|
|
{
|
|
@@ -53,14 +71,17 @@ export default {
|
|
],
|
|
],
|
|
// 订单类型
|
|
// 订单类型
|
|
typeList: order_type,
|
|
typeList: order_type,
|
|
|
|
+ tableList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- created() {
|
|
|
|
- this.search();
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ await this.searchOther();
|
|
|
|
+ await this.search();
|
|
},
|
|
},
|
|
mounted() {},
|
|
mounted() {},
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['query', 'fetch', 'delete']),
|
|
...mapActions(['query', 'fetch', 'delete']),
|
|
|
|
+ ...table({ tQuery: 'query' }),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
|
|
let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
@@ -80,6 +101,14 @@ export default {
|
|
toView({ data }) {
|
|
toView({ data }) {
|
|
this.$router.push({ path: '/order/add', query: { id: data._id } });
|
|
this.$router.push({ path: '/order/add', query: { id: data._id } });
|
|
},
|
|
},
|
|
|
|
+ async searchOther() {
|
|
|
|
+ let res;
|
|
|
|
+ // 桌号
|
|
|
|
+ res = await this.tQuery();
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `tableList`, res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|