evaluateList.vue 8.0 KB

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