123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <template>
- <div class="m-core">
- <el-form :inline="true" :model="searchForm">
- <el-form-item prop="teacher">
- <el-input
- placeholder="老师姓名、编号"
- v-model.trim="searchForm.teacher"
- ></el-input>
- </el-form-item>
- <el-form-item prop="visiterType">
- <el-select
- v-model.trim="searchForm.visiterType"
- placeholder="请选择角色"
- clearable
- filterable
- >
- <el-option value="TEACHER" label="指导老师"></el-option>
- <el-option value="EDU_TEACHER" label="乐团主管"></el-option>
- </el-select>
- </el-form-item>
- <!-- @change="handleChange" -->
- <el-form-item prop="feedbackType">
- <el-select
- v-model.trim="searchForm.feedbackType"
- placeholder="请选择回访结果"
- clearable
- filterable
- >
- <el-option
- :value="item.value"
- :label="item.label"
- v-for="(item, index) in feedbackTypeList"
- :key="index"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-date-picker
- key="visiList"
- v-model.trim="searchForm.timer"
- style="width: 420px"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="回访开始日期"
- end-placeholder="回访结束日期"
- :picker-options="{
- firstDayOfWeek: 1,
- }"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="danger" @click="search">搜索</el-button>
- <el-button type="primary" @click="onReSet">重置</el-button>
- </el-form-item>
- </el-form>
- <auth auths="sysCoupon/add">
- <el-button type="primary" style="margin-bottom: 20px" @click="addVisit"
- >新增回访</el-button
- >
- </auth>
- <div class="tableWrap">
- <el-table
- :data="tableList"
- :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
- >
- <el-table-column align="center" prop="teacherName" label="老师姓名">
- <template slot-scope="scope">
- <copy-text>{{ scope.row.teacherName }}</copy-text>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="visiterType" label="角色">
- <template slot-scope="scope">
- <div>
- {{ scope.row.visiterType | visiterType }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="visitTime" label="回访时间">
- <template slot-scope="scope">
- <div>
- {{
- scope.row.visitTime ? scope.row.visitTime.split(" ")[0] : "--"
- }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="type" label="回访结果">
- <template slot-scope="scope">
- <div>
- {{ scope.row.feedbackType | feedbackTypeFilter }}
- </div>
- </template>
- </el-table-column>
- <el-table-column align="center" prop="type" label="原因">
- <template slot-scope="scope">
- <div>
- <overflow-text
- width="100%"
- :text="scope.row.feedback"
- ></overflow-text>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- sync
- :total.sync="rules.total"
- :page.sync="rules.page"
- :limit.sync="rules.limit"
- :page-sizes="rules.page_size"
- @pagination="getList"
- />
- </div>
- <el-dialog
- title="新增回访"
- width="800px"
- v-if="visitVisiable"
- :close-on-click-modal="false"
- :visible.sync="visitVisiable"
- append-to-body
- >
- <addVisit
- :detail="detail"
- :useVisitType="useVisitType"
- @close="visitVisiable = false"
- @submited="refresh"
- />
- </el-dialog>
- </div>
- </template>
- <script>
- import { feedbackTypeList } from "@/utils/searchArray";
- import { getVisitList } from "@/views/returnVisitManager/api";
- import pagination from "@/components/Pagination/index";
- import { getTimes } from "@/utils";
- import cleanDeep from "clean-deep";
- import addVisit from "./addVisit";
- export default {
- components: { pagination, addVisit },
- props: ["studentId", "studentName", "groupType"],
- data() {
- return {
- searchForm: {
- teacher: "",
- visiterType: "",
- feedbackType: "",
- timer: [],
- },
- rules: {
- // 分页规则
- limit: 10, // 限制显示条数
- page: 1, // 当前页
- total: 0, // 总条数
- page_size: [10, 20, 40, 50], // 选择限制显示条数
- },
- tableList: [],
- feedbackTypeList: feedbackTypeList,
- visitVisiable: false,
- detail: null,
- useVisitType: null,
- };
- },
- mounted() {
- if (this.groupType == "PRACTICE") {
- this.useVisitType = ["小课回访", "网管课回访"];
- } else if (this.groupType == "THEORY") {
- this.useVisitType = ["小课回访", "乐理课回访"];
- } else {
- this.useVisitType = ["小课回访", "VIP课回访"];
- }
- this.searchForm.studentId = this.studentId;
- this.getList();
- },
- methods: {
- search() {
- this.rules.page = 1;
- this.getList();
- },
- onReSet() {
- this.searchForm = {
- teacher: "",
- visiterType: "",
- feedbackType: "",
- timer: [],
- };
- this.search();
- },
- refresh(){
- this.getList()
- this.$emit('getList')
- }
- ,
- getList() {
- // cleanDeep
- let { timer, ...rest } = this.searchForm;
- let params = {
- studentId: this.studentId,
- ...rest,
- page: this.rules.page,
- rows: this.rules.limit,
- ...getTimes(timer, ["startTime", "endTime"]),
- purpose:this.useVisitType[1]?this.useVisitType[1]:null,
- type:this.useVisitType[0]?this.useVisitType[0]:null
- };
- getVisitList(cleanDeep(params)).then((res) => {
- if (res.code == 200) {
- this.tableList = res.data.rows;
- this.rules.total = res.data.total;
- }
- });
- },
- addVisit() {
- // 新增回访
- // row.userId = row.studentId;
- // detail userId userName
- // this.detail = row;
- this.detail = {
- userId: this.studentId,
- userName: this.studentName,
- };
- this.visitVisiable = true;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- </style>
|