CourseStatistic.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. <template>
  2. <section class="content" style="margin-top: 20px;">
  3. <div class="box box-info">
  4. <!-- 正文信息 -->
  5. <div class="box-body">
  6. <el-form
  7. :model="formSearch"
  8. :inline="true"
  9. label-position="right"
  10. label-width="100px"
  11. >
  12. <el-form-item label="学校">
  13. <el-select
  14. v-model="formSearch.orgId"
  15. placeholder="请选择"
  16. clearable
  17. @change="searchExamList(formSearch.orgId);"
  18. >
  19. <el-option
  20. v-for="item in orgList"
  21. :label="item.orgName"
  22. :value="item.orgId"
  23. :key="item.orgId"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="考试">
  28. <el-select
  29. v-model="formSearch.examId"
  30. @change="searchRecords"
  31. placeholder="请选择"
  32. >
  33. <el-option
  34. v-for="item in examList"
  35. :label="item.examName"
  36. :value="item.examId"
  37. :key="item.examId"
  38. ></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="试卷状态">
  42. <el-select
  43. v-model="formSearch.paperStatus"
  44. clearable
  45. placeholder="请选择"
  46. >
  47. <el-option label="请选择" value=""></el-option>
  48. <el-option
  49. v-for="item in coursePaperStatusList"
  50. :label="item.label"
  51. :value="item.value"
  52. :key="item.value"
  53. ></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="课程名称">
  57. <el-select
  58. v-model="formSearch.courseId"
  59. placeholder="请选择"
  60. filterable
  61. clearable
  62. remote
  63. :remote-method="searchCourseList"
  64. >
  65. <el-option label="请选择" value=""></el-option>
  66. <el-option
  67. v-for="item in courseList"
  68. :label="item.name"
  69. :value="item.id"
  70. :key="item.id"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="试卷名称">
  75. <el-input
  76. v-model="formSearch.paperName"
  77. style="width: 221px"
  78. ></el-input>
  79. </el-form-item>
  80. <el-form-item style="padding-left: 30px">
  81. <el-button
  82. size="small"
  83. type="primary"
  84. icon="el-icon-search"
  85. @click="searchRecords"
  86. >查询
  87. </el-button>
  88. <el-button
  89. size="small"
  90. type="primary"
  91. icon="el-icon-menu"
  92. @click="openAllotAllDialog"
  93. :disabled="!hasPermit"
  94. >分配待指定试卷
  95. </el-button>
  96. <el-button
  97. size="small"
  98. type="primary"
  99. icon="el-icon-download"
  100. @click="openExportAllDialog"
  101. >整体导出
  102. </el-button>
  103. <el-button
  104. size="small"
  105. type="primary"
  106. icon="el-icon-download"
  107. :disabled="selectElements.length == 0"
  108. @click="openExportDialog"
  109. >批量导出
  110. </el-button>
  111. <el-button
  112. size="small"
  113. type="primary"
  114. icon="el-icon-refresh"
  115. :disabled="selectElements.length == 0"
  116. @click="refreshStatistic"
  117. >刷新
  118. </el-button>
  119. </el-form-item>
  120. </el-form>
  121. <!-- 数据列表 -->
  122. <el-table
  123. v-loading="loading"
  124. :data="tableData"
  125. element-loading-text="数据加载中"
  126. style="width:100%;"
  127. border
  128. @selection-change="handleSelection"
  129. >
  130. <el-table-column type="selection" width="55"> </el-table-column>
  131. <el-table-column label="课程名称" prop="courseName" />
  132. <el-table-column width="150" label="课程代码" prop="courseCode" />
  133. <el-table-column width="80" label="试卷类型" prop="paperType" />
  134. <el-table-column width="80" label="试卷状态">
  135. <template slot-scope="scope">
  136. <span
  137. @click="openAllotDialog(scope.row);"
  138. style="cursor: pointer"
  139. >{{ scope.row.paperStatusName }}</span
  140. >
  141. </template>
  142. </el-table-column>
  143. <el-table-column width="200" label="试卷名称" prop="paperName" />
  144. <el-table-column width="80" label="试卷P数" prop="paperP" />
  145. <el-table-column width="100" label="考生人数" prop="totalStudent" />
  146. <el-table-column width="180" label="操作" :context="_self">
  147. <template slot-scope="scope">
  148. <el-button
  149. size="mini"
  150. icon="el-icon-view"
  151. v-show="scope.row.paperStatus > 1"
  152. @click="preview(scope.row);"
  153. >预览
  154. </el-button>
  155. <el-button
  156. size="mini"
  157. icon="el-icon-download"
  158. v-show="scope.row.paperStatus > 1"
  159. @click="openExportDialog(scope.row);"
  160. >下载
  161. </el-button>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <!-- 分页 -->
  166. <div class="page pull-right">
  167. <el-pagination
  168. @current-change="handlePager"
  169. :current-page="formSearch.pageNo"
  170. :page-size="formSearch.pageSize"
  171. :total="totalElements"
  172. layout="total, prev, pager, next, jumper"
  173. ></el-pagination>
  174. </div>
  175. </div>
  176. <el-dialog
  177. title="试卷指定"
  178. width="380px"
  179. :visible.sync="allotDialog"
  180. @close="closeAllotDialog"
  181. >
  182. <el-form
  183. :model="allotForm"
  184. ref="allotForm"
  185. :rules="rules"
  186. label-position="right"
  187. label-width="80px"
  188. >
  189. <el-form-item label="课程名称" prop="courseName">
  190. <el-input
  191. v-model="allotForm.courseName"
  192. :disabled="true"
  193. class="w220"
  194. >
  195. {{ allotForm.courseName }}</el-input
  196. >
  197. </el-form-item>
  198. <el-form-item label="试卷类型" prop="paperType">
  199. <el-input
  200. v-model="allotForm.paperType"
  201. :disabled="true"
  202. class="w220"
  203. >
  204. {{ allotForm.paperType }}</el-input
  205. >
  206. </el-form-item>
  207. <el-form-item label="试卷名称" prop="coursePaperId">
  208. <el-select
  209. v-model="allotForm.coursePaperId"
  210. placeholder="请选择"
  211. class="w220"
  212. >
  213. <el-option
  214. v-for="item in coursePaperList"
  215. :value="item.coursePaperId"
  216. :key="item.coursePaperId"
  217. :label="item.paperName"
  218. ></el-option>
  219. </el-select>
  220. </el-form-item>
  221. <div style="text-align: center">
  222. <el-button type="primary" @click="saveAllot">确 定</el-button>
  223. <el-button @click="closeAllotDialog">取 消</el-button>
  224. </div>
  225. </el-form>
  226. </el-dialog>
  227. <el-dialog
  228. title="试卷整体分配"
  229. width="400px"
  230. :visible.sync="allotAllDialog"
  231. @close="closeAllotAllDialog"
  232. >
  233. <el-form
  234. :model="allotAllForm"
  235. ref="allotAllForm"
  236. :rules="rules"
  237. label-position="right"
  238. label-width="80px"
  239. >
  240. <el-form-item label="学校名称" prop="orgId">
  241. <el-select
  242. v-model="allotAllForm.orgId"
  243. @change="searchAllotExamList(allotAllForm.orgId);"
  244. placeholder="请选择"
  245. class="w220"
  246. >
  247. <el-option
  248. v-for="item in orgList"
  249. :label="item.orgName"
  250. :value="item.orgId"
  251. :key="item.orgId"
  252. ></el-option>
  253. </el-select>
  254. </el-form-item>
  255. <el-form-item label="考试名称" prop="examId">
  256. <el-select
  257. v-model="allotAllForm.examId"
  258. placeholder="请选择"
  259. class="w220"
  260. >
  261. <el-option
  262. v-for="item in allotExamList"
  263. :label="item.examName"
  264. :value="item.examId"
  265. :key="item.examId"
  266. ></el-option>
  267. </el-select>
  268. </el-form-item>
  269. <div style="text-align: center">
  270. <p style="color: red;">
  271. 警告:确定后当前考试中“未指定试卷”的课程会在已有的试卷中随机选取一套试卷分配关联,是否确定执行?
  272. </p>
  273. <el-button
  274. type="primary"
  275. @click="saveAllotAll"
  276. :disabled="allotAllForm.examId == ''"
  277. >确 定</el-button
  278. >
  279. <el-button @click="closeAllotAllDialog">取 消</el-button>
  280. </div>
  281. </el-form>
  282. </el-dialog>
  283. <el-dialog
  284. title="导出"
  285. width="450px"
  286. :visible.sync="exportDialog"
  287. @close="closeExportDialog"
  288. >
  289. <el-form
  290. :model="exportForm"
  291. ref="exportForm"
  292. :rules="rules"
  293. label-position="right"
  294. label-width="90px"
  295. >
  296. <el-form-item label="导出内容" prop="types">
  297. <el-checkbox-group v-model="exportForm.types">
  298. <el-checkbox label="1">试卷</el-checkbox>
  299. <el-checkbox label="2">答案</el-checkbox>
  300. <el-checkbox label="3">试卷结构</el-checkbox>
  301. </el-checkbox-group>
  302. </el-form-item>
  303. <div style="text-align: center">
  304. <el-button
  305. type="primary"
  306. @click="doExport"
  307. :disabled="exportForm.types.length == 0"
  308. >确定导出</el-button
  309. >
  310. <el-button @click="closeExportDialog">取 消</el-button>
  311. </div>
  312. </el-form>
  313. </el-dialog>
  314. <el-dialog
  315. title="试卷整体导出"
  316. width="450px"
  317. :visible.sync="exportAllDialog"
  318. @close="closeExportAllDialog"
  319. >
  320. <el-form
  321. :model="exportAllForm"
  322. ref="exportAllForm"
  323. :rules="rules"
  324. label-position="right"
  325. label-width="90px"
  326. >
  327. <el-form-item label="学校名称" prop="orgId">
  328. <el-select
  329. v-model="exportAllForm.orgId"
  330. @change="searchExportExamList(exportAllForm.orgId);"
  331. placeholder="请选择"
  332. class="w220"
  333. >
  334. <el-option
  335. v-for="item in orgList"
  336. :label="item.orgName"
  337. :value="item.orgId"
  338. :key="item.orgId"
  339. ></el-option>
  340. </el-select>
  341. </el-form-item>
  342. <el-form-item label="考试名称" prop="examId">
  343. <el-select
  344. v-model="exportAllForm.examId"
  345. @change="searchExamCoursePaperTotal"
  346. placeholder="请选择"
  347. class="w220"
  348. >
  349. <el-option
  350. v-for="item in exportExamList"
  351. :label="item.examName"
  352. :value="item.examId"
  353. :key="item.examId"
  354. ></el-option>
  355. </el-select>
  356. </el-form-item>
  357. <el-form-item label="导出内容" prop="types">
  358. <el-checkbox-group v-model="exportAllForm.types">
  359. <el-checkbox label="1">试卷</el-checkbox>
  360. <el-checkbox label="2">答案</el-checkbox>
  361. <el-checkbox label="3">试卷结构</el-checkbox>
  362. </el-checkbox-group>
  363. </el-form-item>
  364. <el-form-item label="试卷总数" prop="allNum">
  365. {{ exportAllForm.allNum }}
  366. </el-form-item>
  367. <el-form-item label="已有试卷数" prop="existNum">
  368. {{ exportAllForm.existNum }}
  369. </el-form-item>
  370. <el-form-item label="缺少试卷数" prop="missNum">
  371. {{ exportAllForm.missNum }}
  372. </el-form-item>
  373. <div style="text-align: center">
  374. <el-button
  375. type="primary"
  376. @click="doExportAll"
  377. :disabled="exportAllForm.existNum == 0"
  378. >确定导出</el-button
  379. >
  380. <el-button @click="closeExportAllDialog">取 消</el-button>
  381. </div>
  382. </el-form>
  383. </el-dialog>
  384. </div>
  385. </section>
  386. </template>
  387. <script>
  388. import { CORE_API, PRINT_API } from "@/constants/constants";
  389. import { userRole, coursePaperStatusList } from "../constants/constants.js";
  390. import { mapState } from "vuex";
  391. export default {
  392. data() {
  393. return {
  394. formSearch: {
  395. orgId: "",
  396. examId: "",
  397. courseId: "",
  398. paperStatus: "",
  399. paperName: "",
  400. pageNo: 1,
  401. pageSize: 10
  402. },
  403. curUserRole: userRole,
  404. hasPermit: false,
  405. totalElements: 0,
  406. loading: false,
  407. tableData: [],
  408. orgList: [],
  409. examList: [],
  410. courseList: [],
  411. coursePaperList: [],
  412. coursePaperStatusList: coursePaperStatusList,
  413. allotExamList: [],
  414. allotDialog: false,
  415. allotForm: {
  416. id: "",
  417. coursePaperId: "",
  418. courseName: "",
  419. paperType: ""
  420. },
  421. allotAllDialog: false,
  422. allotAllForm: {
  423. orgId: "",
  424. examId: ""
  425. },
  426. selectElements: [],
  427. exportExamList: [],
  428. exportDialog: false,
  429. exportForm: {
  430. ids: [],
  431. types: []
  432. },
  433. exportAllDialog: false,
  434. exportAllForm: {
  435. orgId: "",
  436. examId: "",
  437. types: [],
  438. allNum: 0,
  439. existNum: 0,
  440. missNum: 0
  441. },
  442. rules: {
  443. orgId: [
  444. { required: true, message: "学校不能为空!", trigger: "change" }
  445. ],
  446. examId: [
  447. { required: true, message: "考试不能为空!", trigger: "change" }
  448. ],
  449. coursePaperId: [
  450. { required: true, message: "试卷不能为空!", trigger: "change" }
  451. ],
  452. courseName: [
  453. { required: true, message: "课程不能为空!", trigger: "change" }
  454. ],
  455. paperType: [
  456. { required: true, message: "试卷类型不能为空!", trigger: "change" }
  457. ],
  458. types: [
  459. { required: true, message: "请选择导出内容!", trigger: "change" }
  460. ]
  461. }
  462. };
  463. },
  464. methods: {
  465. handleSelection(elements) {
  466. /* 处理选中记录 */
  467. this.selectElements = elements;
  468. },
  469. handlePager(current) {
  470. /* 处理分页 */
  471. this.formSearch.pageNo = current;
  472. this.searchRecords();
  473. },
  474. searchRecords() {
  475. /* 查询记录列表 */
  476. let orgId = this.formSearch.orgId;
  477. if (this.isEmptyNumber(orgId)) {
  478. this.$notify({
  479. message: "请选择学校!",
  480. type: "warning"
  481. });
  482. return;
  483. }
  484. let examId = this.formSearch.examId;
  485. if (this.isEmptyNumber(examId)) {
  486. this.$notify({
  487. message: "请选择考试!",
  488. type: "warning"
  489. });
  490. return;
  491. }
  492. this.loading = true;
  493. let url = PRINT_API + "/course/statistic/list";
  494. this.$http.post(url, this.formSearch).then(
  495. response => {
  496. this.tableData = response.data.content;
  497. this.totalElements = response.data.totalElements;
  498. this.loading = false;
  499. },
  500. error => {
  501. console.log(error);
  502. this.loading = false;
  503. }
  504. );
  505. },
  506. searchExamList(orgId) {
  507. /* 查询考试列表 */
  508. this.formSearch.examId = "";
  509. this.examList = [];
  510. this.tableData = [];
  511. if (!this.isEmptyNumber(orgId)) {
  512. let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
  513. this.$http.post(url).then(response => {
  514. this.examList = response.data;
  515. });
  516. }
  517. },
  518. searchAllotExamList(orgId) {
  519. /* 查询考试列表 */
  520. this.allotAllForm.examId = "";
  521. this.allotExamList = [];
  522. if (!this.isEmptyNumber(orgId)) {
  523. let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
  524. this.$http.post(url).then(response => {
  525. this.allotExamList = response.data;
  526. });
  527. }
  528. },
  529. searchExportExamList(orgId) {
  530. /* 查询考试列表 */
  531. this.exportAllForm.examId = "";
  532. this.exportExamList = [];
  533. if (!this.isEmptyNumber(orgId)) {
  534. let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
  535. this.$http.post(url).then(response => {
  536. this.exportExamList = response.data;
  537. });
  538. }
  539. },
  540. searchCourseList(query) {
  541. /* 查询课程列表 */
  542. this.courseList = [];
  543. let url = CORE_API + "/course/query?enable=true";
  544. if (!this.isEmptyStr(query)) {
  545. url += "&name=" + query;
  546. }
  547. this.$http.get(url).then(response => {
  548. this.courseList = response.data;
  549. });
  550. },
  551. refreshStatistic() {
  552. /* 刷新当前统计信息 */
  553. this.$confirm("刷新当前统计信息?", "提示", {
  554. confirmButtonText: "确定",
  555. cancelButtonText: "取消",
  556. type: "warning"
  557. })
  558. .then(() => {
  559. if (this.selectElements.length == 0) {
  560. this.$notify({
  561. message: "请选择要刷新的项!",
  562. type: "warning"
  563. });
  564. return;
  565. }
  566. let params = {};
  567. params.orgId = this.selectElements[0].orgId;
  568. params.examId = this.selectElements[0].examId;
  569. params.couses = [];
  570. this.selectElements.forEach(element => {
  571. params.couses.push({
  572. courseId: element.courseId,
  573. paperType: element.paperType
  574. });
  575. });
  576. let url = PRINT_API + "/course/statistic/refresh";
  577. this.$http.post(url, params).then(
  578. () => {
  579. this.$notify({
  580. type: "success",
  581. message: "刷新成功!"
  582. });
  583. this.searchRecords();
  584. },
  585. () => {
  586. this.$notify({
  587. type: "error",
  588. message: "刷新失败!"
  589. });
  590. }
  591. );
  592. })
  593. .catch(() => {
  594. //ignore
  595. });
  596. },
  597. preview(row) {
  598. /* 预览试卷PDF */
  599. let url = row.paperPdfUrl;
  600. if (!url) {
  601. this.$notify({
  602. message: "当前试卷不存在!",
  603. type: "warning"
  604. });
  605. return;
  606. }
  607. window.open(url);
  608. },
  609. openAllotDialog(row) {
  610. /* 试卷状态为"已有"时,打开试卷指定弹窗 */
  611. if (!this.hasPermit) {
  612. console.log("no permit.");
  613. return;
  614. }
  615. if (row.paperStatus > 0) {
  616. this.allotDialog = true;
  617. this.allotForm.id = row.id;
  618. this.allotForm.coursePaperId = row.coursePaperId;
  619. this.allotForm.courseName = row.courseName;
  620. this.allotForm.paperType = row.paperType;
  621. let params = {
  622. orgId: row.orgId,
  623. examId: row.examId,
  624. courseId: row.courseId
  625. };
  626. let url = PRINT_API + "/course/paper/list";
  627. this.$http.post(url, params).then(
  628. response => {
  629. this.coursePaperList = response.data;
  630. },
  631. error => {
  632. console.log(error);
  633. }
  634. );
  635. }
  636. },
  637. closeAllotDialog() {
  638. /* 关闭试卷指定弹窗 */
  639. this.allotDialog = false;
  640. },
  641. saveAllot() {
  642. /* 保存试卷指定 */
  643. this.$refs.allotForm.validate(valid => {
  644. if (!valid) {
  645. return false;
  646. }
  647. let url =
  648. PRINT_API +
  649. "/course/paper/allot/" +
  650. this.allotForm.id +
  651. "/" +
  652. this.allotForm.coursePaperId;
  653. this.$http.post(url).then(
  654. () => {
  655. this.$notify({
  656. message: "试卷指定成功!",
  657. type: "success"
  658. });
  659. this.allotDialog = false;
  660. this.searchRecords();
  661. },
  662. () => {
  663. this.$notify({
  664. message: "试卷指定失败!",
  665. type: "error"
  666. });
  667. }
  668. );
  669. });
  670. },
  671. openAllotAllDialog() {
  672. /* 打开试卷整体分配弹窗 */
  673. this.allotAllDialog = true;
  674. },
  675. closeAllotAllDialog() {
  676. /* 关闭试卷整体分配弹窗 */
  677. this.allotAllDialog = false;
  678. },
  679. saveAllotAll() {
  680. /* 保存试卷整体分配 */
  681. this.$refs.allotAllForm.validate(valid => {
  682. if (!valid) {
  683. return false;
  684. }
  685. let url =
  686. PRINT_API +
  687. "/course/paper/allot/all/" +
  688. this.allotAllForm.orgId +
  689. "/" +
  690. this.allotAllForm.examId;
  691. this.$http.post(url).then(
  692. () => {
  693. this.$notify({
  694. message: "试卷整体分配成功!",
  695. type: "success"
  696. });
  697. this.allotAllDialog = false;
  698. },
  699. () => {
  700. this.$notify({
  701. message: "试卷整体分配失败!",
  702. type: "error"
  703. });
  704. }
  705. );
  706. });
  707. },
  708. openExportDialog(row) {
  709. /* 打开批量导出弹窗 */
  710. this.exportDialog = true;
  711. this.exportForm.ids = [];
  712. if (row.id) {
  713. this.exportForm.ids.push(row.id);
  714. }
  715. },
  716. closeExportDialog() {
  717. /* 关闭批量导出弹窗 */
  718. this.exportDialog = false;
  719. },
  720. doExport() {
  721. /* 批量导出 */
  722. let ids = [];
  723. if (this.exportForm.ids.length > 0) {
  724. ids = this.exportForm.ids;
  725. } else {
  726. if (this.selectElements.length == 0) {
  727. this.$notify({
  728. message: "请选择要导出的项!",
  729. type: "warning"
  730. });
  731. return;
  732. }
  733. this.selectElements.forEach(element => {
  734. if (element.paperStatus > 1) {
  735. ids.push(element.id);
  736. }
  737. });
  738. }
  739. this.$refs.exportForm.validate(valid => {
  740. if (!valid) {
  741. return false;
  742. }
  743. if (ids.length == 0) {
  744. this.$notify({
  745. message: "包含未被指定试卷的课程则不可导出!",
  746. type: "warning"
  747. });
  748. return;
  749. }
  750. this.closeExportDialog();
  751. let url =
  752. PRINT_API +
  753. "/course/paper/export/batch?ids=" +
  754. ids.join(",") +
  755. "&types=" +
  756. this.exportForm.types.join(",");
  757. //console.log(url);
  758. window.location.href = url;
  759. });
  760. },
  761. openExportAllDialog() {
  762. /* 打开整体导出弹窗 */
  763. this.exportAllDialog = true;
  764. },
  765. closeExportAllDialog() {
  766. /* 关闭整体导出弹窗 */
  767. this.exportAllDialog = false;
  768. },
  769. doExportAll() {
  770. /* 整体导出 */
  771. this.$refs.exportAllForm.validate(valid => {
  772. if (!valid) {
  773. return false;
  774. }
  775. this.closeExportAllDialog();
  776. let url =
  777. PRINT_API +
  778. "/course/paper/export/all?orgId=" +
  779. this.exportAllForm.orgId +
  780. "&examId=" +
  781. this.exportAllForm.examId +
  782. "&types=" +
  783. this.exportAllForm.types.join(",");
  784. //console.log(url);
  785. window.location.href = url;
  786. });
  787. },
  788. searchExamCoursePaperTotal() {
  789. /* 查询考试的试卷数量情况 */
  790. let url =
  791. PRINT_API +
  792. "/course/paper/total/" +
  793. this.exportAllForm.orgId +
  794. "/" +
  795. this.exportAllForm.examId;
  796. this.$http.post(url).then(
  797. response => {
  798. let data = response.data;
  799. this.exportAllForm.allNum = data.allNum;
  800. this.exportAllForm.existNum = data.existNum;
  801. this.exportAllForm.missNum = data.missNum;
  802. },
  803. error => {
  804. console.log(error);
  805. }
  806. );
  807. }
  808. },
  809. computed: {
  810. ...mapState({ user: state => state.user })
  811. },
  812. created() {
  813. this.loadOrgList();
  814. this.loadUserRole(this.user);
  815. if (this.curUserRole.isSuperLeader || this.curUserRole.isPM) {
  816. this.hasPermit = true;
  817. } else {
  818. this.hasPermit = false;
  819. }
  820. }
  821. };
  822. </script>
  823. <style scoped>
  824. .page {
  825. margin-top: 10px;
  826. }
  827. .pull-right {
  828. float: right;
  829. }
  830. .pull-left {
  831. float: left;
  832. }
  833. .w220 {
  834. width: 220px;
  835. }
  836. </style>