evaluateList.vue 8.0 KB

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