<template>
|
<div class="finance-del">
|
<v-header title="预约管理登记"></v-header>
|
|
<el-form :inline="true" class="demo-form-inline">
|
<el-form-item label="关键字" style="width: 350px">
|
<el-input
|
style="width: 280px"
|
size="small"
|
v-model="bar.keyWord"
|
placeholder="请输入预约主题关键词进行查找"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="类型">
|
<el-checkbox-group v-model="bar.type">
|
<el-checkbox-button
|
v-for="type in typeList"
|
:label="type.value"
|
:key="type.value"
|
>{{ type.label }}</el-checkbox-button>
|
</el-checkbox-group>
|
</el-form-item>
|
<el-form-item label="状态">
|
<el-select v-model="bar.status" placeholder="请选择">
|
<el-option
|
v-for="item in statusList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="广告">
|
<el-select v-model="bar.advertType" placeholder="请选择">
|
<el-option
|
v-for="item in advertTypeList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item>
|
<div class="block">
|
<span class="demonstration">创建时间</span>
|
<el-date-picker
|
v-model="bar.time"
|
type="daterange"
|
range-separator="至"
|
format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
></el-date-picker>
|
</div>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="small" type="primary" @click="onSearch">查询</el-button>
|
<el-button @click="Reset" size="small">重置</el-button>
|
</el-form-item>
|
</el-form>
|
|
<div class="add">
|
<el-button class="add-btn" type="primary" plain @click="add">新 增</el-button>
|
<button class="m_btn bgc_primary" @click="exportsregisterall()">导出所有类别登记的统计</button>
|
<button class="m_btn bgc_primary" @click="exportsmakerall()">导出所有类别预约的统计</button>
|
<button class="m_btn bgc_primary" @click="registerT()">查看所有类别登记的统计</button>
|
<button class="m_btn bgc_primary" @click="appointmentT()">查看所有类别预约的统计</button>
|
</div>
|
|
<div class="tab">
|
<v-tool-table :trs="trs" :tds="tds">
|
<template v-slot:remark="{ scope }">
|
<span class="remark1" v-if="scope.type == '1'">预约类</span>
|
<span class="remark2" v-else>登记类</span>
|
</template>
|
<template v-slot:num="{ scope }">
|
<span v-if="!scope.joinAllCount">不限制</span>
|
<span v-else>{{ scope.joinAllCount - scope.joinCount }}</span>
|
</template>
|
<template v-slot:status="{ scope }">
|
<span class="remark1" v-if="scope.status == '1'">待发布</span>
|
<span class="remark2" v-if="scope.status == '2'">进行中</span>
|
<span class="remark3" v-if="scope.status == '3'">已停止</span>
|
</template>
|
<template v-slot:btn="{ scope }">
|
<div class="table_flex">
|
<div v-if="scope.status == '2'">
|
<span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
|
<span v-if="scope.type == '1'" @click="viewDetails(scope.id)">查看预约明细</span>
|
<br />
|
<span v-if="scope.type == '2'" @click="viewregistrationDetails(scope)">查看登记明细</span>
|
<br />
|
<span v-if="scope.type == '1'" @click="exports(scope.id)">导出预约明细</span>
|
<span v-else @click="exportsRegister(scope.id)">导出登记明细</span>
|
<span v-if="scope.type == '1'" @click="release(scope.id, 1)">停止预约</span>
|
<span v-else @click="release(scope.id, 1)">停止登记</span>
|
</div>
|
<div v-if="scope.status == '3'">
|
<span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
|
<span v-if="scope.type == '2'" @click="viewregistrationDetails(scope)">查看登记明细</span>
|
<br />
|
<span v-if="scope.type == '1'" @click="viewDetails(scope.id)">查看预约明细</span>
|
<br />
|
<span v-if="scope.type == '1'" @click="exports(scope.id)">导出预约明细</span>
|
<span v-else @click="exportsRegister(scope.id)">导出登记明细</span>
|
<span
|
@click="
|
$router.push('act_addregister/' + scope.id + '/continue')
|
"
|
>
|
<span v-if="scope.type == '1'">继续预约</span>
|
<span v-else>继续登记</span>
|
</span>
|
</div>
|
<div v-if="scope.status == '1'">
|
<span @click="$router.push('act_addregister/' + scope.id + '/c')">复制</span>
|
<span @click="release(scope.id, 2)">发布</span>
|
<br />
|
<span @click="edit(scope.id)">编辑</span>
|
<span @click="deleteMsg(scope.id)">删除</span>
|
</div>
|
</div>
|
</template>
|
</v-tool-table>
|
</div>
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
props: [],
|
components: {},
|
|
data() {
|
return {
|
bar: {
|
keyWord: "",
|
status: "",
|
type: [],
|
advertType: "",
|
time: "",
|
},
|
statusList: [
|
{
|
label: "待发布",
|
value: 1,
|
},
|
{
|
label: "进行中",
|
value: 2,
|
},
|
{
|
label: "已停止",
|
value: 3,
|
},
|
],
|
advertTypeList: [
|
{
|
label: "无",
|
value: 1,
|
},
|
{
|
label: "首页顶部",
|
value: 2,
|
},
|
{
|
label: "首页应用",
|
value: 3,
|
},
|
],
|
typeList: [
|
{
|
label: "预约类",
|
value: 1,
|
},
|
{
|
label: "登记类",
|
value: 2,
|
},
|
],
|
os: {},
|
trs: [
|
{ text: "序号", val: "index" },
|
{ text: "ID", val: "id" },
|
{ text: "预约登记主题", val: "title" },
|
{ text: "类型", val: "btn", slot: "remark" },
|
{ text: "浏览量", val: "viewNum" },
|
{ text: "提交量", val: "joinCount" },
|
{ text: "内容显示位置设置", val: "advertPosition", width: "120px" },
|
{ text: "剩余预约数量", val: "btn", slot: "num" },
|
{ text: "发布时间", val: "publishTime", width: "80px" },
|
{ text: "结束时间", val: "endTime", width: "80px" },
|
{ text: "创建时间", val: "createAt", width: "80px" },
|
{ text: "状态", val: "btn", slot: "status" },
|
{ text: "操作", val: "btn", width: "200px" },
|
],
|
tds: [],
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
};
|
},
|
|
mounted() { },
|
|
methods: {
|
/**
|
* 新增预约登记
|
* type 2:登记类 1 预约类
|
*/
|
add() {
|
this.$router.push("/act_addregister/");
|
},
|
|
edit(id) {
|
this.$router.push("/act_addregister/" + id);
|
},
|
|
deleteMsg(id) {
|
this.$confirm("确定要进行删除吗?", "温馨提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
var url = `reserve/delete?reserveId=${id}`;
|
this.$api.post(url, {}, (e) => {
|
demo.toast("删除成功");
|
this.init();
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消发布",
|
});
|
});
|
},
|
|
//预约明细导出
|
exports(id) {
|
this.$api.post("reserve/make/list/export", { reserveId: id }, (e) => {
|
window.location.href = e;
|
});
|
},
|
//登记明细导出
|
exportsRegister(id) {
|
const loading = this.$loading({
|
lock: true,
|
text: "正在导出中,请耐心等待....",
|
spinner: "el-icon-loading",
|
background: "rgba(0, 0, 0, 0.7)",
|
});
|
this.$api.post(
|
"reserve/register/list/export",
|
{
|
reserveId: id,
|
beginTime: "",
|
endTime: "",
|
keyword: "",
|
startTime: "",
|
stopTime: "",
|
},
|
(e) => {
|
window.location.href = e;
|
loading.close();
|
},
|
(err) => {
|
loading.close();
|
}
|
);
|
},
|
|
//导出登记统计
|
exportsregisterall() {
|
let params = {
|
endTime: "",
|
pageNum: 1,
|
pageSize: 10,
|
startTime: "",
|
};
|
this.$api.post("reserve/register/statistics/export", params, (e) => {
|
window.location.href = e;
|
});
|
},
|
|
//导出预约统计
|
exportsmakerall() {
|
let params = {
|
endTime: "",
|
startTime: "",
|
};
|
this.$api.post("reserve/make/statistics/export", params, (e) => {
|
window.location.href = e;
|
});
|
},
|
|
release(id, type) {
|
let params = {
|
id: id,
|
type: type,
|
};
|
if (type == 2) {
|
this.$confirm("确认要发布吗?发布后将无法进行修改?", "温馨提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
this.$api.post("reserve/edit/status", params, (e) => {
|
demo.toast("发布成功");
|
this.init();
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消发布",
|
});
|
});
|
} else {
|
this.$api.post("reserve/edit/status", params, (e) => {
|
if (type === 1) {
|
demo.toast("停止成功");
|
}
|
this.init();
|
});
|
}
|
},
|
|
viewDetails(id) {
|
this.$router.push("/act_detailed/" + id);
|
},
|
|
viewregistrationDetails(row) {
|
this.$router.push("/act_registrationDetails/" + JSON.stringify(row));
|
},
|
|
onSearch(v) {
|
this.paged.page = 1;
|
this.init();
|
},
|
|
registerT() {
|
this.$router.push("/act_registrationStatistics");
|
},
|
|
appointmentT() {
|
this.$router.push("/act_appointmentStatistics");
|
},
|
|
Reset() {
|
(this.bar.communityId = ""),
|
(this.bar.keyWord = ""),
|
(this.bar.status = ""),
|
(this.bar.type = []),
|
(this.bar.advertType = ""),
|
(this.bar.time = "");
|
this.paged.page = 1;
|
this.paged.limit = 10;
|
this.init();
|
},
|
|
// 分页点击
|
onPage(v) {
|
if (v.page === this.paged.page && v.page && !v.reset) {
|
return 0;
|
}
|
this.paged.page = v.page;
|
this.paged.limit = v.limit;
|
this.init();
|
},
|
|
init() {
|
let params = {
|
keyWord: this.bar.keyWord,
|
status: this.bar.status,
|
type: this.bar.type,
|
advertType: this.bar.advertType,
|
startTime: this.bar.time[0] || "",
|
endTime: this.bar.time[1] || "",
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
reserveId: "",
|
};
|
this.$api.post("reserve/page", params, (e) => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
this.tds.map((item, index) => {
|
item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
|
});
|
// this.tds = (e.records || []).map((v) => {
|
// this.$set(v, 'che', false)
|
// return v;
|
// });
|
});
|
},
|
//导出
|
// exports(v) {
|
// if(!v) {
|
// if(!this.ids.length) {
|
// demo.toast("请勾选需要下载的内容");
|
// return
|
// }
|
// }
|
// let t = this
|
// let params = {
|
// tradeIds:t.ids,
|
// keyWord:this.bar.keyWord,
|
// sort:this.bar.sort,
|
// endTime:this.bar.time[1],
|
// startTime:this.bar.time[0],
|
// changeType:"1"
|
|
// }
|
// this.$api.post("user/wallet/trade/export", params, (e) => {
|
// window.location.href = e;
|
// });
|
// },
|
},
|
};
|
</script>
|
<style scoped lang="less">
|
.finance-del {
|
overflow: scroll;
|
}
|
.add {
|
text-align: right;
|
}
|
.add-btn {
|
position: relative;
|
top: 2px;
|
}
|
.remark1 {
|
color: #2593fc;
|
}
|
.remark2 {
|
color: #67c23a;
|
}
|
.remark3 {
|
color: #f56c6c;
|
}
|
.bgc_primary {
|
margin-bottom: 15px;
|
}
|
</style>
|