MarkPaperCheck.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <div>
  3. <section class="content">
  4. <div class="box box-info">
  5. <div class="box-body">
  6. <el-form
  7. :inline="true"
  8. :model="formSearch"
  9. ref="formSearch"
  10. label-width="70px"
  11. >
  12. <el-form-item label="评卷名称" prop="workId">
  13. <el-select
  14. clearable
  15. filterable
  16. class="input"
  17. v-model="formSearch.workId"
  18. placeholder="请选择"
  19. style="width:150px;"
  20. @change="changeMarkWork"
  21. >
  22. <el-option
  23. v-for="item in markWorkSelect"
  24. :label="item.markName"
  25. :value="item.workId"
  26. :key="item.workId"
  27. ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item label="学习中心" prop="orgCode">
  31. <el-select
  32. :remote-method="getOrgs"
  33. remote
  34. :loading="getOrgsSearchLoading"
  35. class="input"
  36. clearable
  37. v-model="formSearch.orgCode"
  38. placeholder="请选择"
  39. filterable
  40. style="width:150px;"
  41. @focus="e => getOrgs(e.target.value)"
  42. >
  43. <el-option
  44. v-for="item in orgList"
  45. :label="item.name"
  46. :value="item.code"
  47. :key="item.code"
  48. ></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="姓名" prop="studentName">
  52. <el-input
  53. placeholder="请输入姓名"
  54. v-model="formSearch.studentName"
  55. style="width:150px;"
  56. ></el-input>
  57. </el-form-item>
  58. <el-form-item label="学号" prop="studentCode">
  59. <el-input
  60. placeholder="请输入学号"
  61. v-model="formSearch.studentCode"
  62. style="width:150px;"
  63. ></el-input>
  64. </el-form-item>
  65. <el-form-item label="标记卷" prop="tag">
  66. <el-select
  67. clearable
  68. v-model="formSearch.tag"
  69. placeholder="请选择"
  70. filterable
  71. style="width:150px;"
  72. >
  73. <el-option
  74. v-for="item in tags"
  75. :label="item.name"
  76. :value="item.code"
  77. :key="item.code"
  78. ></el-option>
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item label="课程" prop="courseCode">
  82. <el-select
  83. clearable
  84. @change="getUserList"
  85. filterable
  86. class="input"
  87. v-model="formSearch.courseCode"
  88. placeholder="请选择"
  89. style="width:150px;"
  90. >
  91. <el-option
  92. v-for="item in courseAllListSelect"
  93. :label="item.courseInfo"
  94. :value="item.code"
  95. :key="item.code"
  96. ></el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item label="评委" prop="userId">
  100. <el-select
  101. clearable
  102. class="input"
  103. filterable
  104. v-model="formSearch.userId"
  105. placeholder="请选择"
  106. style="width:150px;"
  107. >
  108. <el-option
  109. v-for="item in userList"
  110. :label="item.name"
  111. :value="item.userId"
  112. :key="item.userId"
  113. ></el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="评卷备注" prop="markRemark">
  117. <el-input
  118. placeholder="请输入备注"
  119. v-model="formSearch.markRemark"
  120. style="width:150px;"
  121. ></el-input>
  122. </el-form-item>
  123. <div></div>
  124. <el-form-item>
  125. <el-button
  126. size="small"
  127. type="primary"
  128. icon="el-icon-search"
  129. @click="searchMarkPaperCheck"
  130. >查询</el-button
  131. >
  132. <el-button
  133. @click="resetForm()"
  134. size="small"
  135. icon="el-icon-refresh"
  136. >重置</el-button
  137. >
  138. </el-form-item>
  139. </el-form>
  140. <div class="block-seperator"></div>
  141. <!-- 页面列表 -->
  142. <el-table
  143. stripe
  144. v-loading="loading"
  145. element-loading-text="拼命加载中"
  146. :data="tableData"
  147. border
  148. style="width: 100%"
  149. >
  150. <el-table-column label="学习中心" width="150" prop="orgName" />
  151. <el-table-column
  152. label="学号"
  153. width="120"
  154. prop="studentCode"
  155. sortable
  156. />
  157. <el-table-column label="姓名" width="120" prop="studentName" />
  158. <el-table-column
  159. label="课程代码"
  160. width="120"
  161. prop="courseCode"
  162. sortable
  163. />
  164. <el-table-column label="课程" width="120" prop="courseName" />
  165. <el-table-column label="试卷类型" width="120" prop="paperType" />
  166. <el-table-column label="评卷员" width="120" prop="userName" />
  167. <el-table-column label="主观总分" width="120" prop="score" />
  168. <el-table-column
  169. label="客观总分"
  170. width="120"
  171. prop="objectiveScore"
  172. sortable
  173. />
  174. <el-table-column
  175. label="卷面总分"
  176. width="120"
  177. prop="totalScore"
  178. sortable
  179. />
  180. <el-table-column label="标记卷" width="120">
  181. <template slot-scope="scope">
  182. <div>
  183. <span>{{ scope.row.tag | tagFilter }}</span>
  184. </div>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="评卷备注" width="120">
  188. <template slot-scope="scope">
  189. <el-popover trigger="hover" name="text" placement="top">
  190. <div style="width:200px;">{{ scope.row.markRemark }}</div>
  191. <div slot="reference">
  192. <span>{{ interceptStr(scope.row.markRemark) }}</span>
  193. </div>
  194. </el-popover>
  195. </template>
  196. </el-table-column>
  197. <el-table-column fixed="right" label="操作" width="180">
  198. <template slot-scope="scope">
  199. <el-button
  200. @click="viewPaper(scope.row)"
  201. type="primary"
  202. size="mini"
  203. icon="el-icon-view"
  204. plain
  205. >原卷</el-button
  206. >
  207. <el-button
  208. @click="backRefresh(scope.row)"
  209. type="danger"
  210. icon="el-icon-arrow-left"
  211. size="mini"
  212. >打回</el-button
  213. >
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. <div class="page pull-right">
  218. <el-pagination
  219. v-if="paginationShow"
  220. @current-change="handleCurrentChange"
  221. @size-change="handleSizeChange"
  222. :current-page="currentPage"
  223. :page-size="pageSize"
  224. :page-sizes="[10, 20, 50, 100]"
  225. layout="total, sizes, prev, pager, next, jumper"
  226. :total="total"
  227. ></el-pagination>
  228. </div>
  229. </div>
  230. </div>
  231. </section>
  232. </div>
  233. </template>
  234. <script>
  235. import { mapState } from "vuex";
  236. import { CORE_API, MARKING_API, DATA_PROCESS_API } from "@/constants/constants";
  237. export default {
  238. data() {
  239. return {
  240. formSearch: {
  241. orgCode: "",
  242. studentName: "",
  243. studentCode: "",
  244. tag: "",
  245. courseCode: "",
  246. userId: "",
  247. workId: "",
  248. markRemark: ""
  249. },
  250. orgList: [],
  251. courseList: [],
  252. specialtyList: [],
  253. userList: [],
  254. tableData: [],
  255. currentPage: 1,
  256. pageSize: 10,
  257. total: 0,
  258. paginationShow: false,
  259. examId: "",
  260. tags: [],
  261. loading: false,
  262. examType: "",
  263. getOrgsSearchLoading: false,
  264. markWorkList: []
  265. };
  266. },
  267. computed: {
  268. ...mapState({ user: state => state.user }),
  269. markWorkSelect() {
  270. let markWorkNames = [];
  271. for (let markWork of this.markWorkList) {
  272. markWorkNames.push({
  273. workId: markWork.id,
  274. markName: markWork.name,
  275. examId: markWork.examId
  276. });
  277. }
  278. return markWorkNames;
  279. },
  280. courseAllListSelect() {
  281. let courseSelect = [];
  282. for (let course of this.courseList) {
  283. let courseInfo = course.name + "(" + course.code + ")";
  284. courseSelect.push({ code: course.code, courseInfo: courseInfo });
  285. }
  286. return courseSelect;
  287. }
  288. },
  289. methods: {
  290. changeMarkWork() {
  291. if (this.$route.query) {
  292. this.$router.push({ path: "/marking/mark_paper_check" });
  293. }
  294. let obj = {};
  295. for (let item of this.markWorkList) {
  296. if (item.id === this.formSearch.workId) {
  297. obj = item;
  298. break;
  299. }
  300. }
  301. this.examId = obj.examId;
  302. this.examType = obj.examType;
  303. this.getCourses();
  304. this.formSearch = Object.assign(this.formSearch, {
  305. orgCode: "",
  306. studentName: "",
  307. studentCode: "",
  308. tag: "",
  309. courseCode: "",
  310. userId: "",
  311. markRemark: ""
  312. });
  313. },
  314. getMarkWorks() {
  315. this.$http
  316. .get(DATA_PROCESS_API + "/markWorks?status=1")
  317. .then(response => {
  318. this.markWorkList = response.data;
  319. if (this.$route.query && this.$route.query.workId) {
  320. this.formSearch.workId = parseInt(this.$route.query.workId);
  321. }
  322. });
  323. },
  324. //查询学习中心
  325. getOrgs(name) {
  326. this.getOrgsSearchLoading = true;
  327. this.$http.get(CORE_API + "/org/query?name=" + name).then(response => {
  328. this.getOrgsSearchLoading = false;
  329. this.orgList = response.data;
  330. });
  331. },
  332. //查询课程
  333. getCourses() {
  334. this.$http
  335. .get(
  336. MARKING_API +
  337. "/markResults/queryExamCourseList?workId=" +
  338. this.formSearch.workId
  339. )
  340. .then(response => {
  341. this.courseList = response.data;
  342. if (this.$route.query && this.$route.query.courseCode) {
  343. this.formSearch.courseCode = this.$route.query.courseCode;
  344. this.getUserList();
  345. }
  346. });
  347. },
  348. //查询评委
  349. getUserList() {
  350. this.$http
  351. .get(
  352. DATA_PROCESS_API +
  353. "/markUsers/assign?workId=" +
  354. this.formSearch.workId +
  355. "&courseCode=" +
  356. this.formSearch.courseCode
  357. )
  358. .then(response => {
  359. this.userList = response.data;
  360. if (this.$route.query && this.$route.query.userId) {
  361. this.formSearch.userId = parseInt(this.$route.query.userId);
  362. }
  363. });
  364. },
  365. //查询标记卷
  366. getTags() {
  367. this.$http.get(MARKING_API + "/markResults/tag").then(response => {
  368. console.log("取到的标记卷:", response);
  369. this.tags = response.data;
  370. //移除科目错误
  371. for (let i = 0; i < this.tags.length; i++) {
  372. if (this.tags[i].code === "SUBJECT_ERROR") {
  373. this.tags.splice(i, 1);
  374. }
  375. }
  376. });
  377. },
  378. //查询专业
  379. getSpecialtys() {
  380. var orgId = this.user.rootOrgId;
  381. this.$http
  382. .get(CORE_API + "/specialty/all?orgId=" + orgId)
  383. .then(response => {
  384. this.specialtyList = response.data;
  385. });
  386. },
  387. //查询方法
  388. searchMarkPaperCheck() {
  389. this.currentPage = 1;
  390. this.initMarkPaperCheck();
  391. },
  392. initMarkPaperCheck() {
  393. if (!this.formSearch.workId) {
  394. this.$notify({
  395. title: "警告",
  396. message: "请选择评卷名称",
  397. type: "warning"
  398. });
  399. return false;
  400. }
  401. this.loading = true;
  402. var url =
  403. DATA_PROCESS_API +
  404. "/markResults/all/" +
  405. (this.currentPage - 1) +
  406. "/" +
  407. this.pageSize;
  408. this.$http.get(url, { params: this.formSearch }).then(response => {
  409. console.log("查询的列表集合", response);
  410. this.tableData = response.data.list;
  411. this.total = response.data.total;
  412. this.loading = false;
  413. this.$router.push({
  414. path: "/marking/mark_paper_check",
  415. query: {
  416. workId: this.formSearch.workId,
  417. orgCode: this.formSearch.orgCode,
  418. studentName: this.formSearch.studentName,
  419. studentCode: this.formSearch.studentCode,
  420. tag: this.formSearch.tag,
  421. courseCode: this.formSearch.courseCode,
  422. userId: this.formSearch.userId,
  423. markRemark: this.formSearch.markRemark,
  424. examId: this.examId,
  425. examType: this.examType,
  426. currentPage: this.currentPage,
  427. pageSize: this.pageSize
  428. }
  429. });
  430. this.$nextTick(function() {
  431. this.paginationShow = true;
  432. });
  433. });
  434. },
  435. resetForm() {
  436. this.formSearch = Object.assign(this.formSearch, {
  437. orgCode: "",
  438. studentName: "",
  439. studentCode: "",
  440. tag: "",
  441. courseCode: "",
  442. userId: "",
  443. workId: "",
  444. markRemark: ""
  445. });
  446. this.tableData = [];
  447. this.total = 0;
  448. this.$router.push({ path: "/marking/mark_paper_check" });
  449. },
  450. handleCurrentChange(val) {
  451. this.currentPage = val;
  452. this.initMarkPaperCheck();
  453. },
  454. handleSizeChange(val) {
  455. this.pageSize = val;
  456. this.currentPage = 1;
  457. this.initMarkPaperCheck();
  458. },
  459. //查看原卷
  460. viewPaper(row) {
  461. if (this.examType != "OFFLINE") {
  462. var studentPaperId = row.studentPaper.id;
  463. console.log("studentPaperId:", studentPaperId);
  464. var urls =
  465. "/marking/view_paper/" +
  466. this.formSearch.workId +
  467. "/" +
  468. this.examId +
  469. "/" +
  470. studentPaperId +
  471. "/" +
  472. this.examType;
  473. this.$router.push({
  474. path: urls
  475. });
  476. } else {
  477. var url = row.studentSubjectiveHtml;
  478. window.open(url);
  479. }
  480. },
  481. //打回
  482. backRefresh(row) {
  483. var userId = this.user.userId;
  484. var url =
  485. MARKING_API + "/markResults/" + row.id + "/reject?creatorId=" + userId;
  486. this.$http.post(url).then(response => {
  487. console.log(response);
  488. this.searchMarkPaperCheck();
  489. });
  490. },
  491. //字符串截取
  492. interceptStr(str) {
  493. if (str) {
  494. let l = str.length;
  495. if (l > 3) {
  496. return str.substring(0, 3) + "...";
  497. } else {
  498. return str;
  499. }
  500. }
  501. },
  502. operaQuery() {
  503. let formData = this.$route.query;
  504. if (formData && formData.workId) {
  505. this.formSearch.workId = formData.workId;
  506. this.formSearch.orgCode = formData.orgCode;
  507. this.formSearch.studentName = formData.studentName;
  508. this.formSearch.studentCode = formData.studentCode;
  509. this.formSearch.markRemark = formData.markRemark;
  510. this.formSearch.courseCode = formData.courseCode;
  511. this.formSearch.userId = formData.userId;
  512. this.formSearch.tag = formData.tag;
  513. this.examId = formData.examId;
  514. this.examType = formData.examType;
  515. this.currentPage = parseInt(formData.currentPage);
  516. this.pageSize = parseInt(formData.pageSize);
  517. this.getCourses();
  518. this.initMarkPaperCheck();
  519. }
  520. }
  521. },
  522. created() {
  523. //查询标记卷
  524. this.getTags();
  525. this.getMarkWorks();
  526. this.operaQuery();
  527. }
  528. };
  529. </script>