MarkDetailMarker.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div class="mark-detail-marker">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
  5. <el-form-item label="班级">
  6. <el-select v-model="filter.className" placeholder="班级" clearable>
  7. <el-option :value="1">班级1</el-option>
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="评阅题目">
  11. <el-select
  12. v-model="filter.groupQuestion"
  13. placeholder="评阅题目"
  14. clearable
  15. >
  16. <el-option :value="1">班级1</el-option>
  17. </el-select>
  18. </el-form-item>
  19. <el-form-item label="评卷员">
  20. <el-input
  21. v-model.trim="filter.loginName"
  22. placeholder="评卷员"
  23. clearable
  24. >
  25. </el-input>
  26. </el-form-item>
  27. <el-form-item label-width="0px">
  28. <el-button type="primary" @click="search">查询</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <div class="part-box-action">
  32. <el-button type="primary" @click="toBind"> 绑定评卷员 </el-button>
  33. <el-button
  34. type="primary"
  35. :disabled="!multipleSelection.length"
  36. @click="toBatchRecycle"
  37. >
  38. 回收
  39. </el-button>
  40. <el-button
  41. type="primary"
  42. :disabled="!multipleSelection.length"
  43. @click="toSetTaskCount(multipleSelection)"
  44. >
  45. 设置评卷数
  46. </el-button>
  47. </div>
  48. </div>
  49. <div class="part-box part-box-pad">
  50. <el-table
  51. ref="TableList"
  52. :data="dataList"
  53. @selection-change="handleSelectionChange"
  54. >
  55. <el-table-column
  56. type="selection"
  57. width="55"
  58. align="center"
  59. ></el-table-column>
  60. <el-table-column prop="courseName" label="评卷员" min-width="100">
  61. <template slot-scope="scope">
  62. <el-tag size="medium" type="info">
  63. {{ scope.row.name }}({{ scope.row.orgName }})
  64. </el-tag>
  65. </template>
  66. </el-table-column>
  67. <el-table-column
  68. prop="groupQuestions"
  69. label="评阅题目"
  70. min-width="200"
  71. ></el-table-column>
  72. <el-table-column
  73. prop="markedCount"
  74. label="已评数量"
  75. width="100"
  76. ></el-table-column>
  77. <el-table-column
  78. prop="currentCount"
  79. label="正在评卷"
  80. width="100"
  81. ></el-table-column>
  82. <el-table-column
  83. prop="taskCount"
  84. label="任务数"
  85. width="100"
  86. ></el-table-column>
  87. <el-table-column
  88. class-name="action-column"
  89. label="操作"
  90. width="200"
  91. fixed="right"
  92. >
  93. <template slot-scope="scope">
  94. <el-button
  95. class="btn-primary"
  96. type="text"
  97. @click="toReset(scope.row)"
  98. >重置</el-button
  99. >
  100. <el-button
  101. class="btn-primary"
  102. type="text"
  103. @click="toUnbind(scope.row)"
  104. >解绑</el-button
  105. >
  106. <el-button
  107. class="btn-primary"
  108. type="text"
  109. @click="toSimpleRecycle(scope.row)"
  110. >回收</el-button
  111. >
  112. <el-button
  113. class="btn-primary"
  114. type="text"
  115. @click="toSetTaskCount([scope.row.markUserGroupId])"
  116. >设置评卷数</el-button
  117. >
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <div class="part-page">
  122. <el-pagination
  123. background
  124. layout="total, sizes, prev, pager, next, jumper"
  125. :pager-count="5"
  126. :current-page="current"
  127. :total="total"
  128. :page-size="size"
  129. @current-change="toPage"
  130. @size-change="pageSizeChange"
  131. >
  132. </el-pagination>
  133. </div>
  134. <p class="tips-info">
  135. 说明:评卷过程发现某些试题评卷工作任务重需要增加评卷员,可以选择对应评阅题目后绑定评卷员
  136. </p>
  137. </div>
  138. <!-- ModifyMarkerTaskCount -->
  139. <modify-marker-task-count
  140. ref="ModifyMarkerTaskCount"
  141. :ids="curIds"
  142. @modified="getList"
  143. ></modify-marker-task-count>
  144. <!-- ModifyMarkerBind -->
  145. <modify-marker-bind
  146. ref="ModifyMarkerBind"
  147. :data="curData"
  148. @modified="getList"
  149. ></modify-marker-bind>
  150. </div>
  151. </template>
  152. <script>
  153. import {
  154. markMarkerListPage,
  155. markMarkerReset,
  156. markMarkerUnbind,
  157. markMarkerRecycle,
  158. } from "../api";
  159. import ModifyMarkerTaskCount from "./ModifyMarkerTaskCount.vue";
  160. import ModifyMarkerBind from "./ModifyMarkerBind.vue";
  161. export default {
  162. name: "mark-detail-marker",
  163. props: {
  164. baseInfo: {
  165. type: Object,
  166. default() {
  167. return {};
  168. },
  169. },
  170. },
  171. components: { ModifyMarkerTaskCount, ModifyMarkerBind },
  172. data() {
  173. return {
  174. filter: {
  175. groupQuestion: "",
  176. className: "",
  177. loginName: "",
  178. },
  179. current: 1,
  180. size: this.GLOBAL.pageSize,
  181. total: 0,
  182. dataList: [],
  183. curRow: {},
  184. curIds: [],
  185. curData: {},
  186. multipleSelection: [],
  187. downloading: false,
  188. };
  189. },
  190. methods: {
  191. async getList() {
  192. const datas = {
  193. ...this.filter,
  194. pageNumber: this.current,
  195. pageSize: this.size,
  196. };
  197. const data = await markMarkerListPage(datas);
  198. this.dataList = data.records;
  199. this.total = data.total;
  200. },
  201. toPage(page) {
  202. this.current = page;
  203. this.getList();
  204. },
  205. search() {
  206. this.toPage(1);
  207. },
  208. handleSelectionChange(val) {
  209. this.multipleSelection = val.map((item) => item.markUserGroupId);
  210. },
  211. toBind() {
  212. this.curData = {
  213. examId: this.baseInfo.examId,
  214. paperNumber: this.baseInfo.paperNumber,
  215. // TODO: groupNumber
  216. };
  217. this.$refs.ModifyMarkerBind.open();
  218. },
  219. // reset marker
  220. async toReset(row) {
  221. const confirm = await this.$confirm("确定要重置当前评卷员?", "提示", {
  222. type: "warning",
  223. }).catch(() => {});
  224. if (confirm !== "confirm") return;
  225. await markMarkerReset({
  226. markUserGroupId: row.markUserGroupId,
  227. });
  228. this.$message.success("操作成功!");
  229. this.getList();
  230. },
  231. // unbind marker
  232. async toUnbind(row) {
  233. const confirm = await this.$confirm("确定要解绑当前评卷员?", "提示", {
  234. type: "warning",
  235. }).catch(() => {});
  236. if (confirm !== "confirm") return;
  237. await markMarkerUnbind({
  238. markUserGroupId: row.markUserGroupId,
  239. });
  240. this.$message.success("操作成功!");
  241. this.getList();
  242. },
  243. // recycle marker
  244. async toBatchRecycle() {
  245. if (!this.multipleSelection.length) return;
  246. const confirm = await this.$confirm("确定要回收选中的评卷员?", "提示", {
  247. type: "warning",
  248. }).catch(() => {});
  249. if (confirm !== "confirm") return;
  250. this.toRecycle(this.multipleSelection);
  251. },
  252. async toSimpleRecycle(row) {
  253. const confirm = await this.$confirm("确定要回收当前评卷员?", "提示", {
  254. type: "warning",
  255. }).catch(() => {});
  256. if (confirm !== "confirm") return;
  257. this.toRecycle([row.markUserGroupId]);
  258. },
  259. async toRecycle(markUserGroupIds) {
  260. if (!markUserGroupIds.length) return;
  261. await markMarkerRecycle({
  262. markUserGroupIds,
  263. });
  264. this.$message.success("操作成功!");
  265. this.getList();
  266. },
  267. // set task count
  268. toSetTaskCount(ids) {
  269. if (!ids.length) return;
  270. this.curIds = ids;
  271. this.$refs.ModifyMarkerTaskCount.open();
  272. },
  273. },
  274. };
  275. </script>