|
|
|
|
@ -22,9 +22,13 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="exportExcel">导出</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="resetSelect">重置</el-button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="exportExcel">导出</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="editBook('add')">手动预约</el-button>
|
|
|
|
|
@ -40,8 +44,8 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<xy-table :list="list" :showIndexFixed="'left'" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
|
|
|
|
:table-item="table_item">
|
|
|
|
|
<xy-table :list="list" :showIndexFixed="'left'" :total="total" @pageIndexChange="pageIndexChange"
|
|
|
|
|
@pageSizeChange="pageSizeChange" :table-item="table_item">
|
|
|
|
|
<template v-slot:status>
|
|
|
|
|
<el-table-column align='center' label="状态" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
@ -61,15 +65,15 @@
|
|
|
|
|
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column align='center' fixed="right" label="操作" width="220" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="primary" size="small" v-if="scope.row.status>0"
|
|
|
|
|
@click="checkBook('show',scope.row.id)">查看</el-button>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button type="primary" size="small" v-if="scope.row.status>0"
|
|
|
|
|
@click="checkBook('show',scope.row.id)">查看</el-button>
|
|
|
|
|
<el-button type="primary" size="small" v-if="scope.row.status===0"
|
|
|
|
|
@click="checkBook('check',scope.row.id)">审核</el-button>
|
|
|
|
|
<el-button type="primary" size="small" v-if="scope.row.status===3"
|
|
|
|
|
@click="editBook('editor',scope.row.id,)">编辑</el-button>
|
|
|
|
|
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
|
|
|
|
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
|
|
|
|
<el-button type="primary" size="small" v-if="scope.row.status===3"
|
|
|
|
|
@click="editBook('editor',scope.row.id,)">编辑</el-button>
|
|
|
|
|
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
|
|
|
|
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
|
|
|
|
</el-popconfirm>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
@ -88,14 +92,14 @@
|
|
|
|
|
import checkBook from './components/checkBook.vue';
|
|
|
|
|
import addBook from './components/addBook.vue';
|
|
|
|
|
import {
|
|
|
|
|
index,
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/book/index.js"
|
|
|
|
|
import {
|
|
|
|
|
index as getAppointment
|
|
|
|
|
} from "@/api/book/appointment.js"
|
|
|
|
|
import {
|
|
|
|
|
download
|
|
|
|
|
} from "@/api/book/appointment.js"
|
|
|
|
|
import {
|
|
|
|
|
download
|
|
|
|
|
} from "@/utils/downloadRequest";
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [myMixins],
|
|
|
|
|
@ -173,6 +177,14 @@
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
resetSelect() {
|
|
|
|
|
|
|
|
|
|
this.select.date = ''
|
|
|
|
|
this.select.site = ''
|
|
|
|
|
this.select.user_name = ''
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page: this.select.page,
|
|
|
|
|
@ -225,59 +237,59 @@
|
|
|
|
|
this.$refs.checkBook.type = type
|
|
|
|
|
this.$refs.checkBook.isShow = true
|
|
|
|
|
},
|
|
|
|
|
editBook(type, id,status) {
|
|
|
|
|
editBook(type, id, status) {
|
|
|
|
|
if (id) {
|
|
|
|
|
this.$refs.addBook.id = id
|
|
|
|
|
}
|
|
|
|
|
this.$refs.addBook.type = type
|
|
|
|
|
this.$refs.addBook.type = type
|
|
|
|
|
this.$refs.addBook.site_options = this.site_options
|
|
|
|
|
this.$refs.addBook.isShow = true
|
|
|
|
|
},
|
|
|
|
|
exportExcel() {
|
|
|
|
|
let _export = {}
|
|
|
|
|
this.table_item.map(item => {
|
|
|
|
|
if (item.prop === 'status') {
|
|
|
|
|
_export['status_text'] = item.label
|
|
|
|
|
}else if (item.prop === 'date') {
|
|
|
|
|
_export['start_time'] = '预约开始时间'
|
|
|
|
|
}else if (item.prop === 'timerange') {
|
|
|
|
|
_export['end_time'] = '预约结束时间'
|
|
|
|
|
} else {
|
|
|
|
|
_export[item.prop] = item.label
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
download(
|
|
|
|
|
'/api/admin/appointments/index',
|
|
|
|
|
'get', {
|
|
|
|
|
user_name: this.select.user_name,
|
|
|
|
|
export_fields: _export,
|
|
|
|
|
show_relation: ['user', 'appointmentConfig'],
|
|
|
|
|
filter: [{
|
|
|
|
|
key: 'date',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.date ? this.select.date : ''
|
|
|
|
|
}, {
|
|
|
|
|
key: 'site',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.site
|
|
|
|
|
}],
|
|
|
|
|
is_export: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999
|
|
|
|
|
},
|
|
|
|
|
`预约信息.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
deleteList(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
destroy({
|
|
|
|
|
id: id,
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.$Message.success('删除成功');
|
|
|
|
|
this.getList()
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
exportExcel() {
|
|
|
|
|
let _export = {}
|
|
|
|
|
this.table_item.map(item => {
|
|
|
|
|
if (item.prop === 'status') {
|
|
|
|
|
_export['status_text'] = item.label
|
|
|
|
|
} else if (item.prop === 'date') {
|
|
|
|
|
_export['start_time'] = '预约开始时间'
|
|
|
|
|
} else if (item.prop === 'timerange') {
|
|
|
|
|
_export['end_time'] = '预约结束时间'
|
|
|
|
|
} else {
|
|
|
|
|
_export[item.prop] = item.label
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
download(
|
|
|
|
|
'/api/admin/appointments/index',
|
|
|
|
|
'get', {
|
|
|
|
|
user_name: this.select.user_name,
|
|
|
|
|
export_fields: _export,
|
|
|
|
|
show_relation: ['user', 'appointmentConfig'],
|
|
|
|
|
filter: [{
|
|
|
|
|
key: 'date',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.date ? this.select.date : ''
|
|
|
|
|
}, {
|
|
|
|
|
key: 'site',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.site
|
|
|
|
|
}],
|
|
|
|
|
is_export: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 999
|
|
|
|
|
},
|
|
|
|
|
`预约信息.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
deleteList(id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
destroy({
|
|
|
|
|
id: id,
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.$Message.success('删除成功');
|
|
|
|
|
this.getList()
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|