<template>
|
<div class="finance-del">
|
<v-header
|
title="预约处理"
|
></v-header>
|
|
<el-form :inline="true" class="demo-form-inline">
|
<el-form-item label="关键字" >
|
<el-input style="width:400px" size="small" v-model="bar.keyWord" placeholder="请输入预约登记主题、预约人、用户昵称进行关键词查找"></el-input>
|
</el-form-item>
|
<el-form-item label="状态">
|
<el-checkbox-group v-model="bar.status">
|
<el-checkbox-button v-for="type in statusList" :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.reserveId" placeholder="请选择">
|
<el-option
|
v-for="item in themeList"
|
: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"
|
value-format="yyyy-MM-dd"
|
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">
|
<button class="m_btn bgc_primary" @click="exports()">导出</button>
|
<button class="m_btn bgc_primary" @click="gohandle()">批量处理</button>
|
<button class="m_btn bgc_primary" plain @click="cancelY()">取消预约</button>
|
</div>
|
|
<div
|
class="Tips"
|
v-show="Change"
|
>
|
<i
|
style="color: #409EFF"
|
class="el-icon-info"
|
></i>
|
<div class="Tips-cont">已选择<span>{{ids.length}}</span>项</div>
|
<el-button
|
type="text"
|
@click="cancel"
|
>取消</el-button>
|
</div>
|
|
<div class="tab">
|
<v-tool-table
|
:trs="trs"
|
:tds="tds"
|
first
|
firstWidth="50px"
|
>
|
<template v-slot:first-th>
|
<div>
|
<el-checkbox @change="cheAll" v-model="alls"></el-checkbox>
|
</div>
|
</template>
|
<template v-slot:first-td="item">
|
<div>
|
<el-checkbox @change="change" v-model="item.scope.che"></el-checkbox>
|
</div>
|
</template>
|
<template v-slot:data="{scope}">
|
{{scope.reserveTime.substring(0,10)}}
|
</template>
|
<template v-slot:status="{scope}">
|
<div class="table_flex">
|
<span v-if="scope.status == '1'">待处理</span>
|
<span v-if="scope.status == '2'">预约成功</span>
|
<span v-if="scope.status == '3'">预约失败</span>
|
<span v-if="scope.status == '4'">已取消</span>
|
</div>
|
</template>
|
<template v-slot:btn="{scope}">
|
<div class="table_flex">
|
<!-- <span @click="exports(scope.id)">导出</span> -->
|
<span @click="seeDetails(scope.id)">查看</span>
|
<!-- <span v-if="scope.status == '1'" @click="gohandle(scope.id)">去处理</span> -->
|
<span v-if="scope.status == '2'" @click="cancelY(scope.id)">取消预约</span>
|
</div>
|
</template>
|
</v-tool-table>
|
</div>
|
<!-- 分页 -->
|
<div class="page">
|
<el-pagination
|
:current-page="paginationParams.currentPage"
|
:page-size="paginationParams.pageSize"
|
:page-sizes="[5, 10, 20, 50, 100]"
|
background
|
layout="total,prev,pager,next,sizes,jumper"
|
:total="paginationParams.total"
|
@size-change="onPageSizeChange"
|
@current-change="onPaginationChange">
|
</el-pagination>
|
</div>
|
<!-- 新增弹窗 -->
|
<handleModel v-model="isShow" @change="isShow = false" :checkIds="ids" @success="onEditSuccess" />
|
</div>
|
</template>
|
<script>
|
import handleModel from "./components/handleModel.vue"
|
export default {
|
props: [],
|
components: {handleModel},
|
data() {
|
return {
|
bar: {
|
keyWord:'',
|
status:[],
|
time:'',
|
reserveId:''
|
},
|
os: {},
|
themeList:[],
|
statusList:[
|
{
|
label:"待处理",
|
value:1,
|
},
|
{
|
label:"预约成功",
|
value:2,
|
},
|
{
|
label:"预约失败",
|
value:3,
|
},
|
{
|
label:"已取消",
|
value:4
|
},
|
],
|
trs: [
|
{ text: "序号", val: "index" },
|
{ text: "用户昵称", val: "nickName" },
|
{ text: "预约主题", val: "title"},
|
{ text: "预约人", val: "name" },
|
{ text: "联系电话", val: "phone" ,width:"100px"},
|
{ text: "预约日期", val: "btn" ,slot:"data"},
|
{ text: "预约时间", val: "reserveTime" },
|
{ text: "预约内容", val: "content" },
|
{ text: "处理人", val: "remark" },
|
{ text: "社区备注", val: "actRemark" },
|
{ text: "提交时间", val: "createAt" },
|
{ text: "状态", val: "btn" ,slot:"status" },
|
{ text: "操作", val: "btn",slot:"btn" },
|
],
|
tds: [],
|
/** 分页参数 */
|
paginationParams: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0
|
},
|
search: {},
|
Overview:{},
|
Change:false,
|
ids:[], //选中的id集合
|
alls: false, //全选状态
|
isShow:false,
|
};
|
},
|
|
mounted() {
|
this.theme();
|
this.init();
|
},
|
|
methods: {
|
/** pageSize 改变时会触发 */
|
onPageSizeChange (pageSize) {
|
this.paginationParams.pageSize = pageSize;
|
this.init();
|
},
|
/** 分页 */
|
onPaginationChange (page) {
|
this.paginationParams.currentPage = page;
|
this.init();
|
},
|
|
seeDetails(id) {
|
this.$router.push("/act_appointviewDetails/" + id);
|
},
|
|
onEditSuccess() {
|
this.init();
|
},
|
|
onSearch(v) {
|
this.paginationParams.currentPage = 1;
|
this.init();
|
},
|
|
Reset() {
|
this.bar.keyWord = '',
|
this.bar.status = [],
|
this.bar.time = '',
|
this.bar.reserveId = ''
|
},
|
|
theme() {
|
this.$api.get("reserve/list", {}, e => {
|
this.themeList = e.map(d=> {
|
return {
|
label:d.title,
|
value:d.id
|
}
|
})
|
});
|
},
|
|
init() {
|
let params = {
|
keyWord:this.bar.keyWord,
|
status:this.bar.status,
|
type:1,
|
advertType:0,
|
startTime:this.bar.time[0] || '',
|
endTime:this.bar.time[1] || '',
|
reserveId:this.bar.reserveId,
|
ids:[],
|
pageNum: this.paginationParams.currentPage,
|
pageSize: this.paginationParams.pageSize,
|
}
|
this.$api.post("reserve/make/handle/page", params, (e) => {
|
this.paginationParams.total = e.total;
|
// this.pageds.r++;
|
|
e.records.map((item,index) => {
|
item.index = (this.paginationParams.currentPage-1) * this.paginationParams.pageSize + index + 1
|
})
|
this.tds = (e.records || []).map((v) => {
|
this.$set(v, 'che', false)
|
return v;
|
});
|
});
|
},
|
|
//导出
|
exports(v) {
|
if(!this.ids.length) {
|
demo.toast("请勾选需要导出的内容");
|
return
|
}
|
let t = this
|
let params = {
|
keyWord:this.bar.keyWord,
|
status:this.bar.status,
|
type:1,
|
advertType:0,
|
startTime:this.bar.time[0] || '',
|
endTime:this.bar.time[1] || '',
|
pageNum: this.paginationParams.currentPage,
|
pageSize: this.paginationParams.pageSize,
|
reserveId:'',
|
ids:t.ids
|
|
}
|
this.$api.post("reserve/make/handle/export", params, (e) => {
|
window.location.href = e;
|
});
|
},
|
|
cancelY() {
|
if(!this.ids.length) {
|
demo.toast("请勾选需要取消预约的内容");
|
return
|
}
|
this.$prompt('取消原因', '确认取消该预约吗?', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
}).then(({ value }) => {
|
let t = this
|
let params = {
|
remark:value,
|
ids:t.ids
|
}
|
this.$api.post("reserve/make/cancel", params, (e) => {
|
this.init();
|
demo.toast("取消预约成功")
|
});
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '取消输入'
|
});
|
});
|
|
|
|
},
|
|
gohandle(v) {
|
if(!this.ids.length) {
|
demo.toast("请勾选需要处理的内容");
|
return
|
}
|
this.isShow = true;
|
},
|
|
cheAll () {
|
this.Change = !this.Change
|
//全选
|
this.tds.map(item => {
|
item.che = this.alls
|
})
|
this.change()
|
},
|
|
change () {
|
//单个选择
|
this.ids = []
|
this.tds.map(item => {
|
if (item.che) {
|
this.ids.push(item.id)
|
} else {
|
this.alls = false
|
}
|
})
|
},
|
|
cancel() {
|
//取消
|
this.Change = false;
|
this.alls = false
|
this.tds.map(item=>{
|
item.che = false
|
})
|
},
|
|
},
|
};
|
</script>
|
<style scoped lang="less">
|
.page {
|
padding: 20px 0;
|
text-align: center;
|
}
|
.finance-del {
|
overflow: scroll;
|
}
|
.add {
|
text-align: right;
|
}
|
.Tips {
|
margin: 10px 0;
|
box-sizing: border-box;
|
width: 100%;
|
display: flex;
|
align-items: center;
|
background: #e6f7ff;
|
border: #bae7ff 1px solid;
|
border-radius: 6px;
|
height: 40px;
|
padding: 0 20px;
|
}
|
.Tips-cont {
|
padding: 0 10px;
|
font-size: 16px;
|
color: #606266;
|
}
|
.Tips-cont > span {
|
padding: 0 4px;
|
color: #409eff;
|
font-weight: 600;
|
}
|
.bgc_primary {
|
margin-bottom: 15px;
|
}
|
</style>
|