evaluateList.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <!-- <h2>
  3. <div class="squrt"></div>评论列表
  4. </h2> -->
  5. <div class="m-core">
  6. <save-form
  7. :inline="true"
  8. class="searchForm"
  9. :model="searchForm"
  10. save-key="commentManager-evaluateList"
  11. @submit="search"
  12. @reset="onReSet"
  13. >
  14. <!-- 状态 指导老师 活动方案-->
  15. <el-form-item>
  16. <el-input
  17. v-model.trim="searchForm.search"
  18. clearable
  19. placeholder="请输入课程组名称 ID"
  20. ></el-input>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-select
  24. placeholder="请选择分部"
  25. v-model="searchForm.organId"
  26. clearable
  27. >
  28. <el-option
  29. v-for="(item, index) in selects.branchs"
  30. :label="item.name"
  31. :value="item.id"
  32. :key="index"
  33. ></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-select
  38. placeholder="请选择状态"
  39. v-model="searchForm.isOver"
  40. clearable
  41. >
  42. <el-option label="已完成" value="1"></el-option>
  43. <el-option label="进行中" value="0"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <remote-search :commit="'setTeachers'" v-model="searchForm.teacherId" />
  48. </el-form-item>
  49. <el-form-item>
  50. <el-select
  51. placeholder="是否完成评价"
  52. v-model="searchForm.hasReport"
  53. clearable
  54. >
  55. <el-option label="是" value="1"></el-option>
  56. <el-option label="否" value="0"></el-option>
  57. </el-select>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-date-picker
  61. :clearable="false"
  62. v-model="searchForm.month"
  63. type="month"
  64. value-format="yyyy-MM"
  65. placeholder="选择年月"
  66. ></el-date-picker>
  67. </el-form-item>
  68. <el-form-item>
  69. <el-button native-type="submit" type="danger">搜索</el-button>
  70. <el-button native-type="reset" type="primary">重置</el-button>
  71. </el-form-item>
  72. </save-form>
  73. <div class="tableWrap">
  74. <el-table
  75. style="width: 100%"
  76. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  77. :data="tableData"
  78. >
  79. <el-table-column align="center" prop="id" label="课程组编号">
  80. <template slot-scope="scope">
  81. <copy-text>
  82. {{ scope.row.id }}
  83. </copy-text>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="name"
  89. label="课程组名称"
  90. >
  91. <template slot-scope="scope">
  92. <copy-text>
  93. {{ scope.row.name }}
  94. </copy-text>
  95. </template>
  96. </el-table-column>
  97. <el-table-column
  98. align="center"
  99. prop="organName"
  100. label="分部名称"
  101. >
  102. <template slot-scope="scope">
  103. <copy-text>
  104. {{ scope.row.organName }}
  105. </copy-text>
  106. </template>
  107. </el-table-column>
  108. <!-- <el-table-column align="center" prop="id" label="类型"></el-table-column> -->
  109. <el-table-column align="center" prop="id" label="收费类型">
  110. <template slot-scope="scope">
  111. <div>{{ scope.row.buyMonths > 0 ? "付费" : "免费" }}</div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column align="center" label="状态">
  115. <template slot-scope="scope">
  116. <div>{{ scope.row.coursesExpireDate | coursesStatus }}</div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column
  120. align="center"
  121. prop="teacherName"
  122. label="指导老师"
  123. ></el-table-column>
  124. <el-table-column align="center" label="课次">
  125. <template slot-scope="scope">
  126. <div>
  127. {{
  128. scope.row.currentClassTimes + "/" + scope.row.totalClassTimes
  129. }}
  130. </div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column align="center" prop="id" label="是否评价">
  134. <template slot-scope="scope">
  135. <div>{{ scope.row.evaluateStatus ? "是" : "否" }}</div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column align="center" label="操作">
  139. <template slot-scope="scope">
  140. <div>
  141. <el-button
  142. type="text"
  143. v-permission="'evaluateList/look'"
  144. v-show="scope.row.evaluateStatus"
  145. @click="gotoEvakuateDetail(scope.row)"
  146. >查看</el-button
  147. >
  148. </div>
  149. </template>
  150. </el-table-column>
  151. </el-table>
  152. <pagination
  153. sync
  154. :total.sync="rules.total"
  155. :page.sync="rules.page"
  156. :limit.sync="rules.limit"
  157. :page-sizes="rules.page_size"
  158. @pagination="getList"
  159. />
  160. </div>
  161. </div>
  162. </template>
  163. <script>
  164. import pagination from "@/components/Pagination/index";
  165. import { getReviews, getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
  166. export default {
  167. components: { pagination },
  168. data() {
  169. return {
  170. searchForm: {
  171. organId: null,
  172. isOver: "",
  173. teacherId: null,
  174. hasReport: "",
  175. month: null,
  176. search: null,
  177. },
  178. rules: {
  179. // 分页规则
  180. limit: 10, // 限制显示条数
  181. page: 1, // 当前页
  182. total: 0, // 总条数
  183. page_size: [10, 20, 40, 50], // 选择限制显示条数
  184. },
  185. tableData: [],
  186. teacherList: [],
  187. subjectList: [],
  188. organList: [],
  189. };
  190. },
  191. created() {
  192. this.init();
  193. },
  194. activated() {
  195. this.init();
  196. },
  197. mounted() {
  198. this.$store.dispatch("setBranchs");
  199. },
  200. methods: {
  201. init() {
  202. if (!this.searchForm.month) {
  203. var now = new Date();
  204. this.searchForm.month = new Date(
  205. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  206. )
  207. .toISOString()
  208. .slice(0, 7);
  209. }
  210. // 获取指导老师
  211. // getTeacher({}).then(res => {
  212. // if (res.code == 200) {
  213. // this.teacherList = res.data;
  214. // }
  215. // });
  216. // 获取分部
  217. getEmployeeOrgan().then((res) => {
  218. if (res.code == 200) {
  219. this.organList = res.data;
  220. }
  221. });
  222. this.getList();
  223. // getReviews()
  224. },
  225. getList() {
  226. // 数据效验
  227. let obj = {};
  228. obj.hasReport = this.searchForm.hasReport || null;
  229. obj.isOver = this.searchForm.isOver || null;
  230. obj.month = this.searchForm.month || null;
  231. obj.organId = this.searchForm.organId || null;
  232. obj.page = this.rules.page;
  233. obj.rows = this.rules.limit;
  234. obj.search = this.searchForm.search || null;
  235. obj.teacherId = this.searchForm.teacherId || null;
  236. getReviews(obj).then((res) => {
  237. if (res.code == 200) {
  238. this.tableData = res.data.rows;
  239. this.rules.total = res.data.total;
  240. }
  241. });
  242. },
  243. search() {
  244. this.rules.page = 1;
  245. this.getList();
  246. },
  247. onReSet() {
  248. this.searchForm = {
  249. organId: null,
  250. isOver: "",
  251. teacherId: null,
  252. hasReport: "",
  253. month: null,
  254. search: null,
  255. };
  256. var now = new Date();
  257. this.searchForm.month = new Date(
  258. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  259. )
  260. .toISOString()
  261. .slice(0, 7);
  262. },
  263. gotoEvakuateDetail(row) {
  264. let id = row.id;
  265. let evaluateId = row.evaluateId;
  266. let search = JSON.stringify(this.searchForm);
  267. let rules = JSON.stringify(this.rules);
  268. this.$router.push({
  269. path: "/operateManager/evaluateDetail",
  270. query: { id, evaluateId, search, rules },
  271. });
  272. },
  273. },
  274. filters: {
  275. coursesStatus(val) {
  276. return new Date().getTime() - new Date(val) > 0 ? "已完成" : "进行中";
  277. },
  278. },
  279. };
  280. </script>