MarkDetailMarker.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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
  7. v-model="filter.groupNumber"
  8. placeholder="评阅题目"
  9. clearable
  10. >
  11. <el-option
  12. v-for="group in questions"
  13. :key="group.groupNumber"
  14. :value="group.groupNumber"
  15. :label="group.groupQuestions"
  16. ></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="班级">
  28. <el-input
  29. v-model.trim="filter.className"
  30. placeholder="班级"
  31. clearable
  32. >
  33. </el-input>
  34. </el-form-item>
  35. <el-form-item label-width="0px">
  36. <el-button type="primary" @click="search">查询</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <div class="part-box-action">
  40. <el-button type="primary" @click="toBind"> 绑定评卷员 </el-button>
  41. <el-button
  42. type="primary"
  43. :disabled="!multipleSelection.length"
  44. @click="toBatchRecycle"
  45. >
  46. 回收
  47. </el-button>
  48. <el-button
  49. type="primary"
  50. :disabled="!multipleSelection.length"
  51. @click="toSetTaskCount(multipleSelection, {})"
  52. >
  53. 设置评卷数
  54. </el-button>
  55. </div>
  56. </div>
  57. <div class="part-box part-box-pad">
  58. <el-table
  59. ref="TableList"
  60. :data="dataList"
  61. @selection-change="handleSelectionChange"
  62. >
  63. <el-table-column
  64. type="selection"
  65. width="55"
  66. align="center"
  67. ></el-table-column>
  68. <el-table-column prop="courseName" label="评卷员" min-width="100">
  69. <template slot-scope="scope">
  70. <el-tag size="medium" type="info">
  71. {{ scope.row.name }}({{ scope.row.orgName }})
  72. </el-tag>
  73. </template>
  74. </el-table-column>
  75. <el-table-column
  76. prop="groupQuestions"
  77. label="评阅题目"
  78. min-width="200"
  79. ></el-table-column>
  80. <el-table-column prop="markedCount" label="已评数量" width="100">
  81. <span slot-scope="scope">
  82. {{ scope.row.resetting ? "--" : scope.row.markedCount }}
  83. </span>
  84. </el-table-column>
  85. <el-table-column prop="currentCount" label="正在评卷" width="100">
  86. <span slot-scope="scope">
  87. {{ scope.row.resetting ? "--" : scope.row.currentCount }}
  88. </span>
  89. </el-table-column>
  90. <el-table-column
  91. prop="topCount"
  92. label="设置评卷数"
  93. width="100"
  94. ></el-table-column>
  95. <el-table-column
  96. class-name="action-column"
  97. label="操作"
  98. width="140"
  99. fixed="right"
  100. >
  101. <template slot-scope="scope">
  102. <el-button
  103. class="btn-primary"
  104. type="text"
  105. :disabled="scope.row.resetting"
  106. @click="toReset(scope.row)"
  107. >{{ scope.row.resetting ? "重置中" : "重置" }}</el-button
  108. >
  109. <el-button
  110. class="btn-primary"
  111. type="text"
  112. @click="toUnbind(scope.row)"
  113. >解绑</el-button
  114. >
  115. <el-button
  116. class="btn-primary"
  117. type="text"
  118. @click="toSimpleRecycle(scope.row)"
  119. >回收</el-button
  120. >
  121. <el-button
  122. class="btn-primary"
  123. type="text"
  124. @click="toSetTaskCount([scope.row.markUserGroupId], scope.row)"
  125. >设置评卷数</el-button
  126. >
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <div class="part-page">
  131. <el-pagination
  132. background
  133. layout="total, sizes, prev, pager, next, jumper"
  134. :pager-count="5"
  135. :current-page="current"
  136. :total="total"
  137. :page-size="size"
  138. @current-change="toPage"
  139. @size-change="pageSizeChange"
  140. >
  141. </el-pagination>
  142. </div>
  143. <p class="tips-info">
  144. 说明:<br />
  145. 1.评卷过程发现某些试题评卷工作任务重需要增加评卷员,可以选择对应评阅题目后绑定评卷员;<br />
  146. 2.重置 - 将评卷员已评任务删除; <br />
  147. 3.解绑 - 将该评卷员与这个分组关系解除绑定,他不能评这个分组; <br />
  148. 4.回收 - 将评卷员已领未评的任务,放到未评池中。
  149. </p>
  150. </div>
  151. <!-- ModifyMarkerTaskCount -->
  152. <modify-marker-task-count
  153. ref="ModifyMarkerTaskCount"
  154. :ids="curIds"
  155. :top-count="curRow.topCount"
  156. @modified="getList"
  157. ></modify-marker-task-count>
  158. <!-- ModifyMarkerBind -->
  159. <modify-marker-bind
  160. ref="ModifyMarkerBind"
  161. :courseCode="baseInfo.courseCode"
  162. :data="curData"
  163. @modified="markerSelected"
  164. ></modify-marker-bind>
  165. </div>
  166. </template>
  167. <script>
  168. import {
  169. markMarkerListPage,
  170. markMarkerReset,
  171. markMarkerUnbind,
  172. markMarkerRecycle,
  173. markGroupQuestions,
  174. markMarkerBind,
  175. } from "../../api";
  176. import ModifyMarkerTaskCount from "./ModifyMarkerTaskCount.vue";
  177. import ModifyMarkerBind from "./ModifyMarkerBind.vue";
  178. export default {
  179. name: "mark-detail-marker",
  180. props: {
  181. baseInfo: {
  182. type: Object,
  183. default() {
  184. return {};
  185. },
  186. },
  187. },
  188. components: { ModifyMarkerTaskCount, ModifyMarkerBind },
  189. data() {
  190. return {
  191. filter: {
  192. groupNumber: "",
  193. loginName: "",
  194. className: "",
  195. },
  196. current: 1,
  197. size: this.GLOBAL.pageSize,
  198. total: 0,
  199. dataList: [],
  200. curRow: {},
  201. curIds: [],
  202. curData: {},
  203. questions: [],
  204. multipleSelection: [],
  205. downloading: false,
  206. userParams: {},
  207. };
  208. },
  209. mounted() {
  210. this.filter.className = this.$ls.get("preset-className", "");
  211. this.filter.groupNumber = this.$ls.get("preset-groupNumber", "");
  212. this.$ls.remove("preset-className");
  213. this.$ls.remove("preset-groupNumber");
  214. this.getQuestions();
  215. this.toPage(1);
  216. },
  217. methods: {
  218. async getQuestions() {
  219. const res = await markGroupQuestions({
  220. examId: this.baseInfo.examId,
  221. paperNumber: this.baseInfo.paperNumber,
  222. });
  223. this.questions = res || [];
  224. },
  225. async getList() {
  226. const datas = {
  227. ...this.filter,
  228. examId: this.baseInfo.examId,
  229. paperNumber: this.baseInfo.paperNumber,
  230. pageNumber: this.current,
  231. pageSize: this.size,
  232. };
  233. const data = await markMarkerListPage(datas);
  234. this.dataList = data.records;
  235. this.total = data.total;
  236. },
  237. toPage(page) {
  238. this.current = page;
  239. this.getList();
  240. },
  241. search() {
  242. this.toPage(1);
  243. },
  244. handleSelectionChange(val) {
  245. this.multipleSelection = val.map((item) => item.markUserGroupId);
  246. },
  247. toBind() {
  248. if (!this.filter.groupNumber) {
  249. this.$message.error("请选择评阅题目");
  250. return;
  251. }
  252. this.curData = {
  253. examId: this.baseInfo.examId,
  254. paperNumber: this.baseInfo.paperNumber,
  255. groupNumber: this.filter.groupNumber,
  256. };
  257. this.$refs.ModifyMarkerBind.open();
  258. },
  259. async markerSelected(users) {
  260. if (!users.length) return;
  261. const datas = { ...this.curData, userIds: users.map((item) => item.id) };
  262. const res = await markMarkerBind(datas).catch(() => {});
  263. if (!res) return;
  264. this.$message.success("绑定成功!");
  265. this.getList();
  266. },
  267. // reset marker
  268. async toReset(row) {
  269. const confirm = await this.$confirm("确定要重置当前评卷员?", "提示", {
  270. type: "warning",
  271. }).catch(() => {});
  272. if (confirm !== "confirm") return;
  273. await markMarkerReset({
  274. markUserGroupId: row.markUserGroupId,
  275. });
  276. this.$message.success("操作成功!");
  277. this.getList();
  278. },
  279. // unbind marker
  280. async toUnbind(row) {
  281. const confirm = await this.$confirm("确定要解绑当前评卷员?", "提示", {
  282. type: "warning",
  283. }).catch(() => {});
  284. if (confirm !== "confirm") return;
  285. await markMarkerUnbind({
  286. markUserGroupId: row.markUserGroupId,
  287. });
  288. this.$message.success("操作成功!");
  289. this.getList();
  290. },
  291. // recycle marker
  292. async toBatchRecycle() {
  293. if (!this.multipleSelection.length) return;
  294. const confirm = await this.$confirm("确定要回收选中的评卷员?", "提示", {
  295. type: "warning",
  296. }).catch(() => {});
  297. if (confirm !== "confirm") return;
  298. this.toRecycle(this.multipleSelection);
  299. },
  300. async toSimpleRecycle(row) {
  301. const confirm = await this.$confirm("确定要回收当前评卷员?", "提示", {
  302. type: "warning",
  303. }).catch(() => {});
  304. if (confirm !== "confirm") return;
  305. this.toRecycle([row.markUserGroupId]);
  306. },
  307. async toRecycle(markUserGroupIds) {
  308. if (!markUserGroupIds.length) return;
  309. await markMarkerRecycle({
  310. markUserGroupIds,
  311. });
  312. this.$message.success("操作成功!");
  313. this.getList();
  314. },
  315. // set task count
  316. toSetTaskCount(ids, row) {
  317. if (!ids.length) return;
  318. this.curIds = ids;
  319. this.curRow = row;
  320. this.$refs.ModifyMarkerTaskCount.open();
  321. },
  322. },
  323. };
  324. </script>