visiList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="m-core">
  3. <el-form :inline="true" :model="searchForm">
  4. <el-form-item prop="teacher">
  5. <el-input
  6. placeholder="老师姓名/编号"
  7. v-model.trim="searchForm.teacher"
  8. ></el-input>
  9. </el-form-item>
  10. <el-form-item prop="visiterType">
  11. <el-select
  12. v-model.trim="searchForm.visiterType"
  13. placeholder="请选择角色"
  14. clearable
  15. filterable
  16. >
  17. <el-option value="TEACHER" label="指导老师"></el-option>
  18. <el-option value="EDU_TEACHER" label="乐团主管"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <!-- @change="handleChange" -->
  22. <el-form-item prop="feedbackType">
  23. <el-select
  24. v-model.trim="searchForm.feedbackType"
  25. placeholder="请选择回访结果"
  26. clearable
  27. filterable
  28. >
  29. <el-option
  30. :value="item.value"
  31. :label="item.label"
  32. v-for="(item, index) in feedbackTypeList"
  33. :key="index"
  34. ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item prop="feedbackTypeDesc">
  38. <el-select
  39. v-model.trim="searchForm.feedbackTypeDesc"
  40. placeholder="请选择反馈详情"
  41. clearable
  42. filterable
  43. >
  44. <el-option
  45. :value="item.value"
  46. :label="item.label"
  47. v-for="(item, index) in feedbackTypeDescList"
  48. :key="index"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-date-picker
  54. key="visiList"
  55. v-model.trim="searchForm.timer"
  56. style="width: 420px"
  57. type="daterange"
  58. value-format="yyyy-MM-dd"
  59. range-separator="至"
  60. start-placeholder="回访开始日期"
  61. end-placeholder="回访结束日期"
  62. :picker-options="{
  63. firstDayOfWeek: 1,
  64. }"
  65. >
  66. </el-date-picker>
  67. </el-form-item>
  68. <el-form-item>
  69. <el-button type="danger" @click="search">搜索</el-button>
  70. <el-button type="primary" @click="onReSet">重置</el-button>
  71. </el-form-item>
  72. </el-form>
  73. <auth auths="visit/add">
  74. <el-button type="primary" style="margin-bottom: 20px" @click="addVisit"
  75. >新增回访</el-button
  76. >
  77. </auth>
  78. <div class="tableWrap">
  79. <el-table
  80. :data="tableList"
  81. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  82. >
  83. <el-table-column align="center" prop="teacherName" label="老师姓名">
  84. <template slot-scope="scope">
  85. <copy-text>{{ scope.row.teacherName }}</copy-text>
  86. </template>
  87. </el-table-column>
  88. <el-table-column align="center" prop="visiterType" label="角色">
  89. <template slot-scope="scope">
  90. <div>
  91. {{ scope.row.visiterType | visiterType }}
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" prop="visitTime" label="回访时间">
  96. <template slot-scope="scope">
  97. <div>
  98. {{
  99. scope.row.visitTime ? scope.row.visitTime.split(" ")[0] : "--"
  100. }}
  101. </div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="center" prop="overview" label="学员情况">
  105. <template slot-scope="scope">
  106. <overflow-text :text="scope.row.overview"></overflow-text>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" prop="type" label="回访结果">
  110. <template slot-scope="scope">
  111. <div>
  112. {{ scope.row.feedbackType | feedbackTypeFilter }}
  113. </div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" prop="type" label="反馈详情">
  117. <template slot-scope="scope">
  118. <div v-if="scope.row.feedbackTypeDesc">
  119. {{ scope.row.feedbackTypeDesc | feedbackTypeDescFilter }}
  120. </div>
  121. <div v-else>--</div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column align="center" prop="type" label="原因">
  125. <template slot-scope="scope">
  126. <div>
  127. <overflow-text
  128. width="100%"
  129. :text="scope.row.feedback"
  130. ></overflow-text>
  131. </div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <pagination
  136. sync
  137. :total.sync="rules.total"
  138. :page.sync="rules.page"
  139. :limit.sync="rules.limit"
  140. :page-sizes="rules.page_size"
  141. @pagination="getList"
  142. />
  143. </div>
  144. <el-dialog
  145. title="新增回访"
  146. width="800px"
  147. v-if="visitVisiable"
  148. :close-on-click-modal="false"
  149. :visible.sync="visitVisiable"
  150. append-to-body
  151. >
  152. <addVisit
  153. :detail="detail"
  154. :useVisitType="useVisitType"
  155. @close="visitVisiable = false"
  156. @submited="refresh"
  157. />
  158. </el-dialog>
  159. </div>
  160. </template>
  161. <script>
  162. import { feedbackTypeList, feedbackTypeDescList } from "@/utils/searchArray";
  163. import { getVisitList } from "@/views/returnVisitManager/api";
  164. import pagination from "@/components/Pagination/index";
  165. import { getTimes } from "@/utils";
  166. import cleanDeep from "clean-deep";
  167. import addVisit from "./addVisit";
  168. export default {
  169. components: { pagination, addVisit },
  170. props: ["studentId", "studentName", "groupType"],
  171. data() {
  172. return {
  173. searchForm: {
  174. teacher: "",
  175. visiterType: "",
  176. feedbackType: "",
  177. timer: [],
  178. },
  179. rules: {
  180. // 分页规则
  181. limit: 10, // 限制显示条数
  182. page: 1, // 当前页
  183. total: 0, // 总条数
  184. page_size: [10, 20, 40, 50], // 选择限制显示条数
  185. },
  186. tableList: [],
  187. feedbackTypeList: feedbackTypeList,
  188. feedbackTypeDescList,
  189. visitVisiable: false,
  190. detail: null,
  191. useVisitType: null,
  192. };
  193. },
  194. mounted() {
  195. if (this.groupType == "PRACTICE") {
  196. this.useVisitType = ["小课回访", "网管课回访"];
  197. } else if (this.groupType == "THEORY") {
  198. this.useVisitType = ["小课回访", "乐理课回访"];
  199. } else {
  200. this.useVisitType = ["小课回访", "VIP课回访"];
  201. }
  202. this.searchForm.studentId = this.studentId;
  203. this.getList();
  204. },
  205. methods: {
  206. search() {
  207. this.rules.page = 1;
  208. this.getList();
  209. },
  210. onReSet() {
  211. this.searchForm = {
  212. teacher: "",
  213. visiterType: "",
  214. feedbackType: "",
  215. timer: [],
  216. };
  217. this.search();
  218. },
  219. refresh() {
  220. this.getList();
  221. this.$emit("getList");
  222. },
  223. getList() {
  224. // cleanDeep
  225. let { timer, ...rest } = this.searchForm;
  226. let params = {
  227. studentId: this.studentId,
  228. ...rest,
  229. page: this.rules.page,
  230. rows: this.rules.limit,
  231. ...getTimes(timer, ["startTime", "endTime"]),
  232. purpose: this.useVisitType[1] ? this.useVisitType[1] : null,
  233. type: this.useVisitType[0] ? this.useVisitType[0] : null,
  234. };
  235. getVisitList(cleanDeep(params)).then((res) => {
  236. if (res.code == 200) {
  237. this.tableList = res.data.rows;
  238. this.rules.total = res.data.total;
  239. }
  240. });
  241. },
  242. addVisit() {
  243. // 新增回访
  244. // row.userId = row.studentId;
  245. // detail userId userName
  246. // this.detail = row;
  247. this.detail = {
  248. userId: this.studentId,
  249. userName: this.studentName,
  250. };
  251. this.visitVisiable = true;
  252. },
  253. },
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. </style>