visiList.vue 6.5 KB

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