新增下载桌码
This commit is contained in:
parent
49569e348f
commit
313ec6e6f9
|
|
@ -0,0 +1,57 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="下载桌码" width="400px" :visible.sync="dialogVisible" @close="reset">
|
||||||
|
<el-form ref="form" :model="form" label-position="left">
|
||||||
|
<el-form-item label="下载数量">
|
||||||
|
<el-input-number v-model="form.number" :min="1"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" :loading="loading" @click="onSubmitHandle">下 载</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { downloadTableCode } from '@/api/table'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
loading: false,
|
||||||
|
form: {
|
||||||
|
number: 1
|
||||||
|
},
|
||||||
|
resetForm: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.resetForm = { ...this.form }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async onSubmitHandle() {
|
||||||
|
try {
|
||||||
|
this.loading = true
|
||||||
|
const res = await downloadTableCode({ number: this.form.number })
|
||||||
|
this.loading = false
|
||||||
|
window.location.href = res.url
|
||||||
|
} catch (error) {
|
||||||
|
this.loading = false
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show(obj) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
// if (obj && obj.id) {
|
||||||
|
// this.form = JSON.parse(JSON.stringify(obj))
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.dialogVisible = false
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.form = { ...this.resetForm }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -16,7 +16,9 @@
|
||||||
<div class="filter_wrap">
|
<div class="filter_wrap">
|
||||||
<el-button icon="el-icon-plus" @click="$refs.addEara.show()">添加区域</el-button>
|
<el-button icon="el-icon-plus" @click="$refs.addEara.show()">添加区域</el-button>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addTable.show()">添加台桌</el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="$refs.addTable.show()">添加台桌</el-button>
|
||||||
<el-button type="primary" icon="el-icon-download">下载台桌码</el-button>
|
<el-button type="primary" icon="el-icon-download" @click="$refs.downloadTableCode.show()">
|
||||||
|
下载台桌码
|
||||||
|
</el-button>
|
||||||
<el-button type="primary" icon="el-icon-download">下载店铺码</el-button>
|
<el-button type="primary" icon="el-icon-download">下载店铺码</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -33,7 +35,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-tag type="warning" size="mini">{{ item.type == 0 ? '低消' : '计时' }}</el-tag>
|
<el-tag type="warning" size="mini">{{ item.type == 0 ? '低消' : '计时' }}</el-tag>
|
||||||
<el-tag :type="item.isPredate == 1 ? '' : 'info'" size="mini">{{ item.isPredate == 1 ? '可预约' : '不可预约' }}</el-tag>
|
<el-tag :type="item.isPredate == 1 ? '' : 'info'" size="mini">{{ item.isPredate == 1 ? '可预约'
|
||||||
|
: '不可预约' }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
||||||
|
|
@ -60,17 +63,20 @@
|
||||||
</div>
|
</div>
|
||||||
<addEara ref="addEara" @success="tbShopAreaGet" />
|
<addEara ref="addEara" @success="tbShopAreaGet" />
|
||||||
<addTable ref="addTable" @success="tbShopTableGet" />
|
<addTable ref="addTable" @success="tbShopTableGet" />
|
||||||
|
<downloadTableCode ref="downloadTableCode" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import addEara from './components/addEara'
|
import addEara from './components/addEara'
|
||||||
import addTable from './components/addTable'
|
import addTable from './components/addTable'
|
||||||
|
import downloadTableCode from './components/downloadTableCode'
|
||||||
import { tbShopTableGet, tbShopAreaGet, tbShopAreaDelete, tbShopTableDelete } from '@/api/table'
|
import { tbShopTableGet, tbShopAreaGet, tbShopAreaDelete, tbShopTableDelete } from '@/api/table'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
addEara,
|
addEara,
|
||||||
addTable
|
addTable,
|
||||||
|
downloadTableCode
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue