新增下载桌码

This commit is contained in:
gyq
2024-06-12 18:22:15 +08:00
parent 49569e348f
commit 313ec6e6f9
2 changed files with 66 additions and 3 deletions

View File

@@ -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>