examStudent.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742
  1. <template>
  2. <section class="content">
  3. <div class="box box-info">
  4. <!-- 正文信息 -->
  5. <div class="box-body">
  6. <!-- 搜索表单 -->
  7. <el-form :inline="true" :model="formSearch" label-width="70px">
  8. <el-form-item label="考试">
  9. <el-select
  10. class="input"
  11. :remote-method="queryExams4Search"
  12. remote
  13. :loading="queryExams4SearchLoading"
  14. filterable
  15. clearable
  16. v-model="formSearch.examId"
  17. placeholder="请选择"
  18. >
  19. <el-option
  20. v-for="item in examList4Search"
  21. :label="item.name"
  22. :value="item.id"
  23. :key="item.id"
  24. >
  25. </el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="姓名">
  29. <el-input
  30. class="input"
  31. placeholder="请输入姓名"
  32. v-model="formSearch.studentName"
  33. ></el-input>
  34. </el-form-item>
  35. <el-form-item label="学号">
  36. <el-input
  37. class="input"
  38. placeholder="请输入学号"
  39. v-model="formSearch.studentCode"
  40. ></el-input>
  41. </el-form-item>
  42. <el-form-item label="专业">
  43. <el-input
  44. class="input"
  45. placeholder="请输入专业"
  46. v-model="formSearch.specialtyName"
  47. ></el-input>
  48. </el-form-item>
  49. <el-form-item label="课程">
  50. <el-select
  51. class="input"
  52. :remote-method="getCourses4Search"
  53. :loading="courseLoading4Search"
  54. remote
  55. filterable
  56. clearable
  57. v-model="formSearch.courseId"
  58. placeholder="请选择"
  59. >
  60. <el-option
  61. v-for="item in courseList4Search"
  62. :label="item.name + ' - ' + item.code"
  63. :value="item.id"
  64. :key="item.id"
  65. >
  66. </el-option>
  67. </el-select>
  68. </el-form-item>
  69. <el-form-item label="学习中心">
  70. <el-select
  71. class="input"
  72. :remote-method="getOrgList4Search"
  73. :loading="getOrgList4SearchLoading"
  74. remote
  75. filterable
  76. clearable
  77. v-model="formSearch.orgId"
  78. placeholder="请选择"
  79. :disabled="pureLC"
  80. >
  81. <el-option
  82. v-for="item in orgList4Search"
  83. :label="item.name + ' - ' + item.code"
  84. :value="item.id"
  85. :key="item.id"
  86. >
  87. </el-option>
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item label="采集人">
  91. <el-input
  92. class="input"
  93. placeholder="请输入采集人"
  94. v-model="formSearch.infoCollector"
  95. ></el-input>
  96. </el-form-item>
  97. <el-form-item label="身份证">
  98. <el-input
  99. class="input"
  100. placeholder="请输入身份证"
  101. v-model="formSearch.identityNumber"
  102. ></el-input>
  103. </el-form-item>
  104. <el-form-item label="考点">
  105. <el-input
  106. class="input"
  107. placeholder="请输入考点"
  108. v-model="formSearch.examSite"
  109. ></el-input>
  110. </el-form-item>
  111. <el-form-item class="d-block">
  112. <el-button
  113. v-if="rolePrivileges.search_examStudent"
  114. size="small"
  115. type="primary"
  116. icon="el-icon-search"
  117. @click="resetPageAndSearchForm"
  118. >查询
  119. </el-button>
  120. <el-button
  121. size="small"
  122. icon="el-icon-refresh"
  123. @click="resetSearchForm"
  124. >
  125. 重置
  126. </el-button>
  127. <el-button
  128. v-if="rolePrivileges.add_examStudent"
  129. size="small"
  130. type="primary"
  131. icon="el-icon-plus"
  132. @click="openAddingDialog"
  133. >新增
  134. </el-button>
  135. <el-button
  136. v-if="rolePrivileges.del_examStudent"
  137. size="small"
  138. type="danger"
  139. icon="el-icon-delete"
  140. @click="deleteStuByExam"
  141. >批次删除
  142. </el-button>
  143. <el-button
  144. v-if="rolePrivileges.copy_examStudent"
  145. size="small"
  146. type="primary"
  147. icon="el-icon-document"
  148. @click="copy"
  149. >复制
  150. </el-button>
  151. </el-form-item>
  152. </el-form>
  153. <div class="block-seperator"></div>
  154. <div>
  155. <span>批量操作:</span>
  156. <el-button
  157. v-if="rolePrivileges.del_examStudent"
  158. size="small"
  159. type="danger"
  160. icon="el-icon-delete"
  161. @click="deleteStuBatch"
  162. :disabled="noBatchSelected"
  163. >删除
  164. </el-button>
  165. </div>
  166. <div style="width: 100%;margin-bottom: 10px;"></div>
  167. <!-- 新增弹出窗口 -->
  168. <el-dialog
  169. @close="closeAddingStudentDialog"
  170. title="考生信息页面"
  171. :visible.sync="addingStudentDialog"
  172. width="650px"
  173. >
  174. <el-form
  175. :model="examStudentForm"
  176. :rules="rules"
  177. :inline="true"
  178. ref="addingStudentForm"
  179. label-width="85px"
  180. class="editForm"
  181. >
  182. <el-form-item label="考试" prop="examId">
  183. <el-select
  184. class="input"
  185. :remote-method="queryExams4InsertOrUpdate"
  186. :loading="queryExams4InsertOrUpdateLoading"
  187. remote
  188. filterable
  189. clearable
  190. v-model="examStudentForm.examId"
  191. placeholder="请选择"
  192. >
  193. <el-option
  194. v-for="item in examList4InsertOrUpdate"
  195. :label="item.name"
  196. :value="item.id"
  197. :key="item.id"
  198. :disabled="!item.enable"
  199. >
  200. </el-option>
  201. </el-select>
  202. </el-form-item>
  203. <el-form-item label="姓名" prop="studentName">
  204. <el-input
  205. class="input"
  206. v-model="examStudentForm.studentName"
  207. auto-complete="off"
  208. maxlength="20"
  209. ></el-input>
  210. </el-form-item>
  211. <el-form-item label="学号" prop="studentCode">
  212. <el-input
  213. class="input"
  214. v-model="examStudentForm.studentCode"
  215. auto-complete="off"
  216. maxlength="20"
  217. ></el-input>
  218. </el-form-item>
  219. <el-form-item label="身份证号" prop="identityNumber">
  220. <el-input
  221. class="input"
  222. v-model="examStudentForm.identityNumber"
  223. auto-complete="off"
  224. maxlength="20"
  225. ></el-input>
  226. </el-form-item>
  227. <el-form-item label="学习中心" prop="orgId">
  228. <el-select
  229. class="input"
  230. :remote-method="getOrgList4InsertOrUpdate"
  231. :loading="getOrgList4InsertOrUpdateLoading"
  232. remote
  233. filterable
  234. clearable
  235. v-model="examStudentForm.orgId"
  236. placeholder="请选择"
  237. :disabled="pureLC"
  238. >
  239. <el-option
  240. v-for="item in orgList4InsertOrUpdate"
  241. :label="item.name + ' - ' + item.code"
  242. :value="item.id"
  243. :key="item.id"
  244. :disabled="!item.enable"
  245. >
  246. </el-option>
  247. </el-select>
  248. </el-form-item>
  249. <el-form-item label="课程" prop="courseId">
  250. <el-select
  251. :remote-method="getCourses4InsertOrUpdate"
  252. :loading="courseLoading4InsertOrUpdate"
  253. remote
  254. filterable
  255. clearable
  256. class="input"
  257. v-model="examStudentForm.courseId"
  258. placeholder="请选择"
  259. >
  260. <el-option
  261. v-for="item in courseList4InsertOrUpdate"
  262. :label="item.name + ' - ' + item.code"
  263. :value="item.id"
  264. :key="item.id"
  265. :disabled="!item.enable"
  266. >
  267. </el-option>
  268. </el-select>
  269. </el-form-item>
  270. <el-form-item label="试卷类型" prop="paperType">
  271. <el-select
  272. class="input"
  273. v-model="examStudentForm.paperType"
  274. placeholder="请选择"
  275. >
  276. <el-option
  277. v-for="item in paperTypeList"
  278. :label="item"
  279. :value="item"
  280. :key="item"
  281. >
  282. </el-option>
  283. </el-select>
  284. </el-form-item>
  285. <el-form-item label="专业">
  286. <el-input
  287. class="input"
  288. v-model="examStudentForm.specialtyName"
  289. auto-complete="off"
  290. maxlength="20"
  291. ></el-input>
  292. </el-form-item>
  293. <el-form-item label="考点">
  294. <el-input
  295. class="input"
  296. v-model="examStudentForm.examSite"
  297. auto-complete="off"
  298. maxlength="20"
  299. ></el-input>
  300. </el-form-item>
  301. <el-form-item label="年级">
  302. <el-input
  303. class="input"
  304. v-model="examStudentForm.grade"
  305. auto-complete="off"
  306. ></el-input>
  307. </el-form-item>
  308. <el-form-item label="采集人">
  309. <el-input
  310. class="input"
  311. v-model="examStudentForm.infoCollector"
  312. maxlength="20"
  313. ></el-input>
  314. </el-form-item>
  315. <el-form-item label="电话">
  316. <el-input
  317. class="input"
  318. v-model="examStudentForm.phone"
  319. auto-complete="off"
  320. maxlength="20"
  321. ></el-input>
  322. </el-form-item>
  323. <el-form-item label="试卷袋编码">
  324. <el-input
  325. class="input"
  326. v-model="examStudentForm.ext1"
  327. maxlength="20"
  328. ></el-input>
  329. </el-form-item>
  330. </el-form>
  331. <div style="text-align: center;">
  332. <el-button type="primary" @click="addStudent">确 定</el-button>
  333. <el-button @click="closeAddingStudentDialog">取 消</el-button>
  334. </div>
  335. </el-dialog>
  336. <!-- 修改弹出窗口 -->
  337. <el-dialog
  338. width="650px"
  339. @close="closeUpdateStudentDialog"
  340. title="考生信息页面"
  341. :visible.sync="updateStudentDialog"
  342. >
  343. <el-form
  344. :model="examStudentForm"
  345. size="large"
  346. :rules="rules"
  347. :inline="true"
  348. ref="updateStudentForm"
  349. label-width="85px"
  350. class="editForm"
  351. >
  352. <el-form-item label="考试" prop="examId">
  353. <el-select
  354. class="input"
  355. :remote-method="queryExams4InsertOrUpdate"
  356. :loading="queryExams4InsertOrUpdateLoading"
  357. remote
  358. disabled
  359. filterable
  360. clearable
  361. v-model="examStudentForm.examId"
  362. placeholder="请选择"
  363. >
  364. <el-option
  365. v-for="item in examList4InsertOrUpdate"
  366. :label="item.name"
  367. :value="item.id"
  368. :key="item.id"
  369. :disabled="!item.enable"
  370. >
  371. </el-option>
  372. </el-select>
  373. </el-form-item>
  374. <el-form-item label="姓名" prop="studentName">
  375. <el-input
  376. class="input"
  377. v-model="examStudentForm.studentName"
  378. auto-complete="off"
  379. maxlength="20"
  380. ></el-input>
  381. </el-form-item>
  382. <el-form-item label="学号" prop="studentCode">
  383. <el-input
  384. class="input"
  385. v-model="examStudentForm.studentCode"
  386. maxlength="20"
  387. readonly
  388. ></el-input>
  389. </el-form-item>
  390. <el-form-item label="身份证号" prop="identityNumber">
  391. <el-input
  392. class="input"
  393. v-model="examStudentForm.identityNumber"
  394. maxlength="20"
  395. readonly
  396. ></el-input>
  397. </el-form-item>
  398. <el-form-item label="学习中心" prop="orgId">
  399. <el-select
  400. class="input"
  401. :remote-method="getOrgList4InsertOrUpdate"
  402. :loading="getOrgList4InsertOrUpdateLoading"
  403. remote
  404. filterable
  405. clearable
  406. v-model="examStudentForm.orgId"
  407. placeholder="请选择"
  408. :disabled="pureLC"
  409. @clear="clearOrg4UpdateExamStudent"
  410. >
  411. <el-option
  412. v-for="item in orgList4InsertOrUpdate"
  413. :label="item.name + ' - ' + item.code"
  414. :value="item.id"
  415. :key="item.id"
  416. :disabled="!item.enable"
  417. >
  418. </el-option>
  419. </el-select>
  420. </el-form-item>
  421. <el-form-item label="课程" prop="courseId">
  422. <el-select
  423. :remote-method="getCourses4InsertOrUpdate"
  424. :loading="courseLoading4InsertOrUpdate"
  425. remote
  426. filterable
  427. clearable
  428. disabled
  429. class="input"
  430. v-model="examStudentForm.courseId"
  431. placeholder="请选择"
  432. >
  433. <el-option
  434. v-for="item in courseList4InsertOrUpdate"
  435. :label="item.name + ' - ' + item.code"
  436. :value="item.id"
  437. :key="item.id"
  438. :disabled="!item.enable"
  439. >
  440. </el-option>
  441. </el-select>
  442. </el-form-item>
  443. <el-form-item label="试卷类型" prop="paperType">
  444. <el-select
  445. class="input"
  446. v-model="examStudentForm.paperType"
  447. placeholder="请选择"
  448. >
  449. <el-option
  450. v-for="item in paperTypeList"
  451. :label="item"
  452. :value="item"
  453. :key="item"
  454. >
  455. </el-option>
  456. </el-select>
  457. </el-form-item>
  458. <el-form-item label="专业">
  459. <el-input
  460. class="input"
  461. v-model="examStudentForm.specialtyName"
  462. auto-complete="off"
  463. maxlength="20"
  464. ></el-input>
  465. </el-form-item>
  466. <el-form-item label="考点">
  467. <el-input
  468. class="input"
  469. v-model="examStudentForm.examSite"
  470. maxlength="20"
  471. auto-complete="off"
  472. ></el-input>
  473. </el-form-item>
  474. <el-form-item label="年级">
  475. <el-input
  476. class="input"
  477. v-model="examStudentForm.grade"
  478. maxlength="20"
  479. auto-complete="off"
  480. ></el-input>
  481. </el-form-item>
  482. <el-form-item label="采集人">
  483. <el-input
  484. class="input"
  485. v-model="examStudentForm.infoCollector"
  486. maxlength="20"
  487. ></el-input>
  488. </el-form-item>
  489. <el-form-item label="电话">
  490. <el-input
  491. class="input"
  492. v-model="examStudentForm.phone"
  493. maxlength="20"
  494. auto-complete="off"
  495. ></el-input>
  496. </el-form-item>
  497. <el-form-item label="试卷袋编码">
  498. <el-input
  499. class="input"
  500. v-model="examStudentForm.ext1"
  501. maxlength="20"
  502. ></el-input>
  503. </el-form-item>
  504. </el-form>
  505. <div style="text-align: center;">
  506. <el-button type="primary" @click="updateStudent">确 定</el-button>
  507. <el-button @click="closeUpdateStudentDialog">取 消</el-button>
  508. </div>
  509. </el-dialog>
  510. <!-- 复制弹窗 -->
  511. <el-dialog
  512. title="考生信息复制"
  513. width="500px"
  514. :visible.sync="studentCopyDialog"
  515. >
  516. <el-form
  517. :model="studentCopyForm"
  518. :rules="rules"
  519. ref="studentCopyForm"
  520. class="editForm"
  521. :inline="true"
  522. label-width="120px"
  523. >
  524. <el-form-item label="源考试批次" prop="sourceExamId">
  525. <el-select
  526. class="input"
  527. :remote-method="queryExams4CopyFrom"
  528. remote
  529. :loading="queryExams4CopyFromLoading"
  530. filterable
  531. clearable
  532. v-model="studentCopyForm.sourceExamId"
  533. placeholder="请选择"
  534. >
  535. <el-option
  536. v-for="item in examList4CopyFrom"
  537. :label="item.name"
  538. :value="item.id"
  539. :key="item.id"
  540. >
  541. </el-option>
  542. </el-select>
  543. </el-form-item>
  544. <el-form-item label="目标考试批次" prop="targetExamId">
  545. <el-select
  546. class="input"
  547. :remote-method="queryExams4CopyTo"
  548. remote
  549. :loading="queryExams4CopyToLoading"
  550. filterable
  551. clearable
  552. v-model="studentCopyForm.targetExamId"
  553. placeholder="请选择"
  554. >
  555. <el-option
  556. v-for="item in examList4CopyTo"
  557. :label="item.name"
  558. :value="item.id"
  559. :key="item.id"
  560. :disabled="!item.enable"
  561. >
  562. </el-option>
  563. </el-select>
  564. </el-form-item>
  565. <div style="text-align: center;">
  566. <el-button type="primary" @click="copyStudent">确 定</el-button>
  567. <el-button @click="studentCopyDialog = false">取 消</el-button>
  568. </div>
  569. </el-form>
  570. </el-dialog>
  571. <!-- 页面列表 -->
  572. <el-table
  573. v-loading="loading"
  574. element-loading-text="拼命加载中"
  575. :data="tableData"
  576. border
  577. style="width: 100%;text-align:center;"
  578. @selection-change="selectChange"
  579. >
  580. <el-table-column
  581. type="selection"
  582. width="40"
  583. fixed="left"
  584. ></el-table-column>
  585. <el-table-column
  586. prop="id"
  587. label="ID"
  588. sortable
  589. fixed="left"
  590. ></el-table-column>
  591. <el-table-column label="考生" fixed="left">
  592. <template slot-scope="scope">
  593. <el-popover trigger="hover" placement="left">
  594. <div style="font-size: 18px;font-family: 新宋体">
  595. <tr>
  596. <td style="color: green">姓名</td>
  597. <td style="color:purple;padding-left: 20px;">
  598. {{ scope.row.studentName }}
  599. </td>
  600. </tr>
  601. <tr>
  602. <td style="color: green">身份证号</td>
  603. <td style="color:purple;padding-left: 20px;">
  604. {{ scope.row.identityNumber }}
  605. </td>
  606. </tr>
  607. <tr>
  608. <td style="color: green">学号</td>
  609. <td style="color:purple;padding-left: 20px;">
  610. {{ scope.row.studentCode }}
  611. </td>
  612. </tr>
  613. <tr>
  614. <td style="color: green">学习中心名称</td>
  615. <td style="color:purple;padding-left: 20px;">
  616. {{ scope.row.orgName }}
  617. </td>
  618. </tr>
  619. <tr>
  620. <td style="color: green">学习中心编码</td>
  621. <td style="color:purple;padding-left: 20px;">
  622. {{ scope.row.orgCode }}
  623. </td>
  624. </tr>
  625. <tr>
  626. <td style="color: green">课程名称</td>
  627. <td style="color:purple;padding-left: 20px;">
  628. {{ scope.row.courseName }}
  629. </td>
  630. </tr>
  631. <tr>
  632. <td style="color: green">课程编码</td>
  633. <td style="color:purple;padding-left: 20px;">
  634. {{ scope.row.courseCode }}
  635. </td>
  636. </tr>
  637. <tr>
  638. <td style="color: green">年级</td>
  639. <td style="color:purple;padding-left: 20px;">
  640. {{ scope.row.grade }}
  641. </td>
  642. </tr>
  643. <tr>
  644. <td style="color: green">电话</td>
  645. <td style="color:purple;padding-left: 20px;">
  646. {{ scope.row.phone }}
  647. </td>
  648. </tr>
  649. <tr>
  650. <td style="color: green">专业</td>
  651. <td style="color:purple;padding-left: 20px;">
  652. {{ scope.row.specialtyName }}
  653. </td>
  654. </tr>
  655. <tr>
  656. <td style="color: green">采集人</td>
  657. <td style="color:purple;padding-left: 20px;">
  658. {{ scope.row.infoCollector }}
  659. </td>
  660. </tr>
  661. <tr>
  662. <td style="color: green">考点</td>
  663. <td style="color:purple;padding-left: 20px;">
  664. {{ scope.row.examSite }}
  665. </td>
  666. </tr>
  667. <tr>
  668. <td style="color: green">试卷袋编码</td>
  669. <td style="color:purple;padding-left: 20px;">
  670. {{ scope.row.ext1 }}
  671. </td>
  672. </tr>
  673. </div>
  674. <div slot="reference" class="name-wrapper">
  675. <span>{{ scope.row.studentName }}</span>
  676. </div>
  677. </el-popover>
  678. </template>
  679. </el-table-column>
  680. <el-table-column prop="studentCode" label="学号" sortable>
  681. </el-table-column>
  682. <el-table-column
  683. prop="identityNumber"
  684. label="身份证号"
  685. width="120"
  686. sortable
  687. >
  688. </el-table-column>
  689. <el-table-column prop="orgName" label="学习中心" width="120" sortable>
  690. </el-table-column>
  691. <el-table-column
  692. prop="examName"
  693. label="考试名称"
  694. width="120"
  695. sortable
  696. >
  697. </el-table-column>
  698. <el-table-column
  699. prop="courseName"
  700. label="课程名称"
  701. width="120"
  702. sortable
  703. >
  704. </el-table-column>
  705. <el-table-column
  706. prop="updateTime"
  707. width="155"
  708. label="更新时间"
  709. sortable
  710. >
  711. </el-table-column>
  712. <el-table-column width="50" label="状态">
  713. <span slot-scope="scope">
  714. <span v-if="scope.row.enable">
  715. <el-tooltip
  716. class="item"
  717. effect="dark"
  718. content="启用"
  719. placement="left"
  720. >
  721. <i class="el-icon-success" style="color:green;"></i>
  722. </el-tooltip>
  723. </span>
  724. <span v-else>
  725. <el-tooltip
  726. class="item"
  727. effect="dark"
  728. content="禁用"
  729. placement="left"
  730. >
  731. <i class="el-icon-error" style="color:red;"></i>
  732. </el-tooltip>
  733. </span>
  734. </span>
  735. </el-table-column>
  736. <el-table-column width="300" label="操作" fixed="right">
  737. <template slot-scope="scope">
  738. <div v-if="scope.row.locked">锁定中,请稍后操作</div>
  739. <div v-else>
  740. <el-button
  741. size="mini"
  742. type="primary"
  743. plain
  744. :disabled="!scope.row.photoPath"
  745. icon="el-icon-picture"
  746. @click="showPhoto(scope.row)"
  747. >
  748. 查看照片
  749. </el-button>
  750. <el-button
  751. v-if="rolePrivileges.update_examStudent"
  752. size="mini"
  753. type="primary"
  754. plain
  755. icon="el-icon-edit"
  756. @click="openUpdateDialog(scope.row)"
  757. >
  758. 编辑
  759. </el-button>
  760. <el-dropdown
  761. style="margin-left: 10px;"
  762. v-if="
  763. rolePrivileges.del_examStudent ||
  764. rolePrivileges.change_exam_student_availability
  765. "
  766. >
  767. <el-button type="primary" plain size="mini">
  768. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  769. </el-button>
  770. <el-dropdown-menu slot="dropdown">
  771. <el-dropdown-item>
  772. <el-button
  773. v-if="rolePrivileges.del_examStudent"
  774. size="mini"
  775. type="danger"
  776. icon="el-icon-delete"
  777. @click="deleteExamStudent(scope.row)"
  778. >删除
  779. </el-button></el-dropdown-item
  780. >
  781. <el-dropdown-item>
  782. <el-button
  783. v-if="
  784. null != scope.row.enable &&
  785. !scope.row.enable &&
  786. rolePrivileges.change_exam_student_availability
  787. "
  788. size="mini"
  789. type="primary"
  790. plain
  791. icon="el-icon-check"
  792. @click="enableExamStudent(scope.row)"
  793. >启用
  794. </el-button>
  795. <el-button
  796. v-else-if="
  797. rolePrivileges.change_exam_student_availability
  798. "
  799. size="mini"
  800. type="danger"
  801. icon="el-icon-close"
  802. @click="disableExamStudent(scope.row)"
  803. >禁用
  804. </el-button>
  805. </el-dropdown-item>
  806. </el-dropdown-menu>
  807. </el-dropdown>
  808. </div>
  809. </template>
  810. </el-table-column>
  811. </el-table>
  812. <div class="page pull-right">
  813. <el-pagination
  814. @current-change="handleCurrentChange"
  815. :current-page="currentPage"
  816. :page-size="pageSize"
  817. :page-sizes="[10, 20, 50, 100]"
  818. @size-change="handleSizeChange"
  819. layout="total, sizes, prev, pager, next, jumper"
  820. :total="total"
  821. >
  822. </el-pagination>
  823. </div>
  824. <el-dialog title="错误提示" v-model="errDialog">
  825. <div
  826. class="text-danger"
  827. v-for="errMessage in errMessages"
  828. :key="errMessage.lineNum"
  829. >
  830. 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
  831. </div>
  832. <span slot="footer" class="dialog-footer">
  833. <el-button @click="errDialog = false">确定</el-button>
  834. </span>
  835. </el-dialog>
  836. <el-dialog
  837. @close="closePhotoDialog"
  838. title="照片"
  839. :visible.sync="photoDialog"
  840. width="300px"
  841. >
  842. <img :src="photo.url" height="100%" width="100%" />
  843. </el-dialog>
  844. </div>
  845. </div>
  846. </section>
  847. </template>
  848. <script>
  849. import {
  850. TASK_API,
  851. CORE_API,
  852. EXAM_WORK_API,
  853. PAPER_TYPE
  854. } from "@/constants/constants.js";
  855. import { mapState } from "vuex";
  856. let _this = null;
  857. let validateIdentityNumber = (rule, value, callback) => {
  858. if (
  859. !_this.examStudentForm.identityNumber ||
  860. _this.examStudentForm.identityNumber === ""
  861. ) {
  862. return callback(new Error("请输入身份证"));
  863. }
  864. if (
  865. _this.examStudentForm.identityNumber &&
  866. _this.examStudentForm.identityNumber.length < 6
  867. ) {
  868. callback(new Error("身份证至少6位"));
  869. } else {
  870. callback();
  871. }
  872. };
  873. export default {
  874. data() {
  875. return {
  876. rolePrivileges: {
  877. search_examStudent: false,
  878. add_examStudent: false,
  879. import_examStudent: false,
  880. copy_examStudent: false,
  881. del_examStudent: false,
  882. update_examStudent: false,
  883. change_exam_student_availability: false
  884. },
  885. pureLC: false,
  886. lc_id: null,
  887. lc_code: null,
  888. lc_name: null,
  889. loading: false,
  890. courseLoading4Search: false,
  891. courseLoading4InsertOrUpdate: false,
  892. photoDialog: false,
  893. photo: { url: "" },
  894. specialtyList: [],
  895. button: {},
  896. errDialog: false,
  897. errMessages: [],
  898. uploadAction: EXAM_WORK_API + "/exam_student/import",
  899. uploadData: { examId: "" },
  900. fileLoading: false,
  901. fileList: [],
  902. uploadHeaders: {},
  903. orgList4Search: [],
  904. getOrgList4SearchLoading: false,
  905. formSearch: {
  906. rootOrgId: "",
  907. examId: "",
  908. studentCode: "",
  909. studentName: "",
  910. orgId: "",
  911. specialtyName: "",
  912. courseId: "",
  913. infoCollector: "",
  914. identityNumber: "",
  915. examSite: ""
  916. },
  917. paperTypeList: PAPER_TYPE,
  918. courseList4Search: [],
  919. courseList4InsertOrUpdate: [],
  920. examList4Search: [],
  921. examList4InsertOrUpdate: [],
  922. examList4Import: [],
  923. examList4CopyFrom: [],
  924. examList4CopyTo: [],
  925. queryExams4SearchLoading: false,
  926. queryExams4InsertOrUpdateLoading: false,
  927. queryExams4ImportLoading: false,
  928. queryExams4CopyFromLoading: false,
  929. queryExams4CopyToLoading: false,
  930. selectedExamStuIds: [],
  931. addingStudentDialog: false,
  932. updateStudentDialog: false,
  933. studentPhoDialog: false,
  934. studentImportDialog: false,
  935. studentCopyDialog: false,
  936. tableData: [],
  937. currentPage: 1,
  938. pageSize: 10,
  939. total: 10,
  940. formLabelWidth: "120px",
  941. orgList4InsertOrUpdate: [],
  942. getOrgList4InsertOrUpdateLoading: false,
  943. examStudentForm: {
  944. id: null,
  945. examId: "",
  946. courseId: null,
  947. studentId: null,
  948. studentName: "",
  949. studentCode: "",
  950. identityNumber: "",
  951. specialtyName: "",
  952. orgId: "",
  953. examSite: "",
  954. grade: "",
  955. phone: "",
  956. infoCollector: "",
  957. paperType: "X",
  958. ext1: null,
  959. ext2: null,
  960. ext3: null,
  961. ext4: null,
  962. ext5: null
  963. },
  964. studentImportForm: {
  965. examId: ""
  966. },
  967. studentCopyForm: {
  968. sourceExamId: "",
  969. targetExamId: ""
  970. },
  971. result: false,
  972. rules: {
  973. examId: [
  974. {
  975. type: "number",
  976. required: true,
  977. message: "请选择考试",
  978. trigger: "change"
  979. }
  980. ],
  981. studentName: [
  982. { required: true, message: "请输入姓名", trigger: "blur" }
  983. ],
  984. identityNumber: [
  985. { required: true, validator: validateIdentityNumber, trigger: "blur" }
  986. ],
  987. courseId: [
  988. {
  989. type: "number",
  990. required: true,
  991. message: "请选择课程",
  992. trigger: "change"
  993. }
  994. ],
  995. paperType: [
  996. { required: false, message: "请输入试卷类型", trigger: "blur" }
  997. ],
  998. orgId: [
  999. {
  1000. type: "number",
  1001. required: true,
  1002. message: "请选择学习中心",
  1003. trigger: "change"
  1004. }
  1005. ],
  1006. sourceExamId: [
  1007. {
  1008. type: "number",
  1009. required: true,
  1010. message: "请选择源考试批次",
  1011. trigger: "change"
  1012. }
  1013. ],
  1014. targetExamId: [
  1015. {
  1016. type: "number",
  1017. required: true,
  1018. message: "请选择目标考试批次",
  1019. trigger: "change"
  1020. }
  1021. ]
  1022. }
  1023. };
  1024. },
  1025. computed: {
  1026. ...mapState({ user: state => state.user }),
  1027. examStuIds() {
  1028. var examStuIds = "";
  1029. for (let examStuId of this.selectedExamStuIds) {
  1030. if (!examStuIds) {
  1031. examStuIds += examStuId;
  1032. } else {
  1033. examStuIds += "," + examStuId;
  1034. }
  1035. }
  1036. return examStuIds;
  1037. },
  1038. noBatchSelected() {
  1039. return this.selectedExamStuIds.length === 0;
  1040. }
  1041. },
  1042. methods: {
  1043. clearOrg4UpdateExamStudent() {
  1044. this.getOrgList4InsertOrUpdate("");
  1045. },
  1046. queryExams4Search(name) {
  1047. this.queryExams(name, "search");
  1048. },
  1049. queryExams4InsertOrUpdate(name) {
  1050. this.queryExams(name, "insertOrUpdate");
  1051. },
  1052. queryExams4Import(name) {
  1053. this.queryExams(name, "import");
  1054. },
  1055. queryExams4CopyFrom(name) {
  1056. this.queryExams(name, "copyFrom");
  1057. },
  1058. queryExams4CopyTo(name) {
  1059. this.queryExams(name, "copyTo");
  1060. },
  1061. queryExams(name, where) {
  1062. console.log("queryExams; name: " + name);
  1063. if ("search" == where) {
  1064. this.queryExams4SearchLoading = true;
  1065. } else if ("insertOrUpdate" == where) {
  1066. this.queryExams4InsertOrUpdateLoading = true;
  1067. } else if ("import" == where) {
  1068. this.queryExams4ImportLoading = true;
  1069. } else if ("copyFrom" == where) {
  1070. this.queryExams4CopyFromLoading = true;
  1071. } else if ("copyTo" == where) {
  1072. this.queryExams4CopyToLoading = true;
  1073. }
  1074. this.$httpWithMsg
  1075. .get(EXAM_WORK_API + "/exam/queryByNameLike?name=" + name)
  1076. .then(response => {
  1077. if ("search" == where) {
  1078. this.queryExams4SearchLoading = false;
  1079. this.examList4Search = response.data;
  1080. } else if ("insertOrUpdate" == where) {
  1081. this.queryExams4InsertOrUpdateLoading = false;
  1082. this.examList4InsertOrUpdate = response.data;
  1083. } else if ("import" == where) {
  1084. this.queryExams4ImportLoading = false;
  1085. this.examList4Import = response.data;
  1086. } else if ("copyFrom" == where) {
  1087. this.queryExams4CopyFromLoading = false;
  1088. this.examList4CopyFrom = response.data;
  1089. } else if ("copyTo" == where) {
  1090. this.queryExams4CopyToLoading = false;
  1091. this.examList4CopyTo = response.data;
  1092. }
  1093. })
  1094. .catch(response => {
  1095. console.log(response);
  1096. if ("search" == where) {
  1097. this.queryExams4SearchLoading = false;
  1098. } else if ("insertOrUpdate" == where) {
  1099. this.queryExams4InsertOrUpdateLoading = false;
  1100. } else if ("import" == where) {
  1101. this.queryExams4ImportLoading = false;
  1102. } else if ("copyFrom" == where) {
  1103. this.queryExams4CopyFromLoading = false;
  1104. } else if ("copyTo" == where) {
  1105. this.queryExams4CopyToLoading = false;
  1106. }
  1107. });
  1108. },
  1109. getOrgList4Search(orgName) {
  1110. this.getOrgList(orgName, "search");
  1111. },
  1112. getOrgList4InsertOrUpdate(orgName) {
  1113. this.getOrgList(orgName, "insertOrUpdate");
  1114. },
  1115. getOrgList(orgName, where) {
  1116. if ("search" == where) {
  1117. this.getOrgList4SearchLoading = true;
  1118. } else if ("insertOrUpdate" == where) {
  1119. this.getOrgList4InsertOrUpdateLoading = true;
  1120. }
  1121. let url = CORE_API + "/org/query?name=" + orgName;
  1122. this.$httpWithMsg
  1123. .get(url)
  1124. .then(response => {
  1125. if ("search" == where) {
  1126. this.getOrgList4SearchLoading = false;
  1127. this.orgList4Search = response.data;
  1128. } else if ("insertOrUpdate" == where) {
  1129. this.getOrgList4InsertOrUpdateLoading = false;
  1130. this.orgList4InsertOrUpdate = response.data;
  1131. }
  1132. })
  1133. .catch(response => {
  1134. console.log(response);
  1135. if ("search" == where) {
  1136. this.getOrgList4SearchLoading = false;
  1137. } else if ("insertOrUpdate" == where) {
  1138. this.getOrgList4InsertOrUpdateLoading = false;
  1139. }
  1140. });
  1141. },
  1142. closePhotoDialog() {
  1143. this.photo.url = "/img/blank.png";
  1144. this.photoDialog = false;
  1145. },
  1146. showPhoto(row) {
  1147. if (row.photoPath) {
  1148. this.photo.url = row.photoPath;
  1149. this.photoDialog = true;
  1150. } else {
  1151. this.$notify({
  1152. showClose: true,
  1153. message: "未上传照片",
  1154. type: "error"
  1155. });
  1156. }
  1157. },
  1158. getExcelTitle(row) {
  1159. return "第" + row + "行";
  1160. },
  1161. getCourseName(code) {
  1162. for (let course of this.courseList) {
  1163. if (code == course.code) {
  1164. return course.name;
  1165. }
  1166. }
  1167. },
  1168. specialtySelect(code) {
  1169. console.log(code);
  1170. for (let specialty of this.specialtyList) {
  1171. if (code == specialty.code) {
  1172. return specialty.name;
  1173. }
  1174. }
  1175. },
  1176. selectChange(row) {
  1177. this.selectedExamStuIds = [];
  1178. row.forEach((element, index) => {
  1179. console.log(index);
  1180. this.selectedExamStuIds.push(element.id);
  1181. });
  1182. console.log(this.selectedExamStuIds);
  1183. },
  1184. resetSearchForm() {
  1185. this.formSearch.rootOrgId = "";
  1186. this.formSearch.examId = "";
  1187. this.formSearch.studentCode = "";
  1188. this.formSearch.studentName = "";
  1189. this.formSearch.orgId = "";
  1190. this.formSearch.specialtyName = "";
  1191. this.formSearch.courseId = "";
  1192. this.formSearch.infoCollector = "";
  1193. this.formSearch.identityNumber = "";
  1194. this.formSearch.examSite = "";
  1195. },
  1196. resetPageAndSearchForm() {
  1197. this.currentPage = 1;
  1198. this.searchForm();
  1199. },
  1200. //查询方法
  1201. searchForm() {
  1202. var param = new URLSearchParams(this.formSearch);
  1203. this.loading = true;
  1204. var url =
  1205. EXAM_WORK_API +
  1206. "/exam_student/examStudentPage/" +
  1207. (this.currentPage - 1) +
  1208. "/" +
  1209. this.pageSize +
  1210. "?" +
  1211. param;
  1212. this.$httpWithMsg.get(url).then(response => {
  1213. this.tableData = response.data.list;
  1214. this.total = response.data.total;
  1215. this.loading = false;
  1216. });
  1217. },
  1218. //查询所有课程
  1219. getSpecialtys() {
  1220. var orgId = this.user.orgId;
  1221. this.$httpWithMsg
  1222. .get(CORE_API + "/specialty/all?orgId=" + orgId)
  1223. .then(response => {
  1224. console.log(response);
  1225. this.specialtyList = response.data;
  1226. });
  1227. },
  1228. getCourses4Search(query) {
  1229. this.courseLoading4Search = true;
  1230. this.$httpWithMsg
  1231. .get(CORE_API + "/course/query?name=" + query)
  1232. .then(response => {
  1233. this.courseList4Search = response.data;
  1234. this.courseLoading4Search = false;
  1235. });
  1236. },
  1237. getCourses4InsertOrUpdate(query) {
  1238. this.courseLoading4InsertOrUpdate = true;
  1239. this.$httpWithMsg
  1240. .get(CORE_API + "/course/query?name=" + query)
  1241. .then(response => {
  1242. this.courseList4InsertOrUpdate = response.data;
  1243. this.courseLoading4InsertOrUpdate = false;
  1244. });
  1245. },
  1246. //新增信息
  1247. addStudent() {
  1248. var url = EXAM_WORK_API + "/exam_student";
  1249. this.$refs.addingStudentForm.validate(valid => {
  1250. if (valid) {
  1251. this.$httpWithMsg.put(url, this.examStudentForm).then(response => {
  1252. console.log(response);
  1253. this.$notify({
  1254. type: "success",
  1255. message: "保存成功"
  1256. });
  1257. this.addingStudentDialog = false;
  1258. this.searchForm();
  1259. });
  1260. } else {
  1261. return false;
  1262. }
  1263. });
  1264. },
  1265. //更新
  1266. updateStudent() {
  1267. var url = EXAM_WORK_API + "/exam_student";
  1268. this.$refs.updateStudentForm.validate(valid => {
  1269. if (valid) {
  1270. this.$httpWithMsg.put(url, this.examStudentForm).then(response => {
  1271. console.log(response);
  1272. this.$notify({
  1273. type: "success",
  1274. message: "更新成功"
  1275. });
  1276. this.updateStudentDialog = false;
  1277. this.searchForm();
  1278. });
  1279. } else {
  1280. return false;
  1281. }
  1282. });
  1283. },
  1284. //删除方法
  1285. deleteExamStudent(row) {
  1286. this.$confirm("是否删除考生?", "提示", {
  1287. confirmButtonText: "确定",
  1288. cancelButtonText: "取消",
  1289. type: "error"
  1290. }).then(() => {
  1291. var url = EXAM_WORK_API + "/exam_student/" + row.id;
  1292. this.$httpWithMsg.delete(url).then(response => {
  1293. console.log(response);
  1294. this.$notify({
  1295. type: "success",
  1296. message: "删除成功!"
  1297. });
  1298. this.searchForm();
  1299. });
  1300. });
  1301. },
  1302. //批量删除方法
  1303. deleteStuBatch() {
  1304. if (this.examStuIds.length == 0) {
  1305. this.$notify({
  1306. type: "warning",
  1307. message: "请选择要删除的考生"
  1308. });
  1309. return;
  1310. }
  1311. this.$confirm("是否删除考生?", "提示", {
  1312. confirmButtonText: "确定",
  1313. cancelButtonText: "取消",
  1314. type: "error"
  1315. }).then(() => {
  1316. var url = EXAM_WORK_API + "/exam_student/" + this.examStuIds;
  1317. this.$httpWithMsg.delete(url).then(response => {
  1318. console.log(response);
  1319. this.$notify({
  1320. type: "success",
  1321. message: "删除成功!"
  1322. });
  1323. this.searchForm();
  1324. });
  1325. });
  1326. },
  1327. //按批次删除方法
  1328. deleteStuByExam() {
  1329. if (!this.formSearch.examId) {
  1330. this.$notify({
  1331. type: "warning",
  1332. message: "请选择要删除的批次"
  1333. });
  1334. return;
  1335. }
  1336. this.$msgbox({
  1337. title: "提示",
  1338. message: "是否删除该批次所有考生?",
  1339. showCancelButton: false,
  1340. confirmButtonText: "确定",
  1341. beforeClose: (action, instance, done) => {
  1342. if (action === "confirm") {
  1343. instance.confirmButtonLoading = true;
  1344. instance.confirmButtonText = "执行中...";
  1345. let inst = instance;
  1346. let delExamStudentDone = done;
  1347. let url =
  1348. EXAM_WORK_API + "/exam_student/exam/" + this.formSearch.examId;
  1349. this.$httpWithMsg.delete(url).then(response => {
  1350. console.log(response);
  1351. this.$notify({
  1352. type: "success",
  1353. message: "删除成功!"
  1354. });
  1355. inst.confirmButtonLoading = false;
  1356. delExamStudentDone();
  1357. this.searchForm();
  1358. });
  1359. } else {
  1360. done();
  1361. }
  1362. }
  1363. }).then(action => {
  1364. console.log(action);
  1365. });
  1366. },
  1367. handleCurrentChange(val) {
  1368. this.currentPage = val;
  1369. this.searchForm();
  1370. },
  1371. handleSizeChange(val) {
  1372. this.pageSize = val;
  1373. this.searchForm();
  1374. },
  1375. //新增
  1376. openAddingDialog() {
  1377. if (this.$refs.addingStudentForm) {
  1378. this.$refs.addingStudentForm.resetFields();
  1379. }
  1380. this.examStudentForm.examId = null;
  1381. this.examStudentForm.studentName = null;
  1382. this.examStudentForm.studentCode = null;
  1383. this.examStudentForm.identityNumber = null;
  1384. this.examStudentForm.courseId = null;
  1385. this.examStudentForm.examSite = null;
  1386. this.examStudentForm.grade = null;
  1387. this.examStudentForm.paperType = "X";
  1388. this.examStudentForm.specialtyName = null;
  1389. this.examStudentForm.phone = null;
  1390. this.examStudentForm.infoCollector = null;
  1391. this.examStudentForm.ext1 = null;
  1392. if (this.pureLC) {
  1393. this.examStudentForm.orgId = this.lc_id;
  1394. this.orgList4InsertOrUpdate = [
  1395. { id: this.lc_id, name: this.lc_name, code: this.lc_code }
  1396. ];
  1397. } else {
  1398. this.examStudentForm.orgId = null;
  1399. this.orgList4InsertOrUpdate = null;
  1400. this.getOrgList4InsertOrUpdate("");
  1401. }
  1402. this.examList4InsertOrUpdate = [];
  1403. this.courseList4InsertOrUpdate = [];
  1404. this.queryExams4InsertOrUpdate("");
  1405. this.getCourses4InsertOrUpdate("");
  1406. this.addingStudentDialog = true;
  1407. },
  1408. //修改
  1409. openUpdateDialog(row) {
  1410. if (this.$refs.updateStudentForm) {
  1411. this.$refs.updateStudentForm.resetFields();
  1412. }
  1413. this.orgList4InsertOrUpdate = [
  1414. { id: row.orgId, name: row.orgName, code: row.orgCode }
  1415. ];
  1416. this.courseList4InsertOrUpdate = [
  1417. { id: row.courseId, name: row.courseName, code: row.courseCode }
  1418. ];
  1419. this.examList4InsertOrUpdate = [{ id: row.examId, name: row.examName }];
  1420. this.examStudentForm.id = row.id;
  1421. this.examStudentForm.examId = row.examId;
  1422. this.examStudentForm.courseId = row.courseId;
  1423. this.examStudentForm.studentId = row.studentId;
  1424. this.examStudentForm.studentName = row.studentName;
  1425. this.examStudentForm.studentCode = row.studentCode;
  1426. this.examStudentForm.identityNumber = row.identityNumber;
  1427. this.examStudentForm.specialtyName = row.specialtyName;
  1428. this.examStudentForm.orgId = row.orgId;
  1429. this.examStudentForm.examSite = row.examSite;
  1430. this.examStudentForm.grade = row.grade;
  1431. this.examStudentForm.phone = row.phone;
  1432. this.examStudentForm.infoCollector = row.infoCollector;
  1433. this.examStudentForm.paperType = row.paperType;
  1434. this.examStudentForm.ext1 = row.ext1;
  1435. this.examStudentForm.ext2 = row.ext2;
  1436. this.examStudentForm.ext3 = row.ext3;
  1437. this.examStudentForm.ext4 = row.ext4;
  1438. this.examStudentForm.ext5 = row.ext5;
  1439. this.updateStudentDialog = true;
  1440. },
  1441. //禁用
  1442. disableExamStudent(row) {
  1443. this.$confirm("是否禁用所选考生?", "提示", {
  1444. confirmButtonText: "确定",
  1445. cancelButtonText: "取消",
  1446. type: "warning"
  1447. }).then(() => {
  1448. var url = EXAM_WORK_API + "/exam_student/disable/" + row.id;
  1449. this.$httpWithMsg.put(url).then(response => {
  1450. console.log(response);
  1451. this.$notify({
  1452. type: "success",
  1453. message: "禁用成功"
  1454. });
  1455. this.searchForm();
  1456. });
  1457. });
  1458. },
  1459. //启用
  1460. enableExamStudent(row) {
  1461. this.$confirm("是否启用所选考生?", "提示", {
  1462. confirmButtonText: "确定",
  1463. cancelButtonText: "取消",
  1464. type: "warning"
  1465. }).then(() => {
  1466. var url = EXAM_WORK_API + "/exam_student/enable/" + row.id;
  1467. this.$httpWithMsg.put(url).then(response => {
  1468. console.log(response);
  1469. this.$notify({
  1470. type: "success",
  1471. message: "启用成功"
  1472. });
  1473. this.searchForm();
  1474. });
  1475. });
  1476. },
  1477. closeAddingStudentDialog() {
  1478. this.addingStudentDialog = false;
  1479. },
  1480. closeUpdateStudentDialog() {
  1481. this.updateStudentDialog = false;
  1482. },
  1483. //导入
  1484. imp() {
  1485. this.studentImportDialog = true;
  1486. this.initUpload();
  1487. },
  1488. //复制
  1489. copy() {
  1490. if (this.$refs.studentCopyForm) {
  1491. this.$refs.studentCopyForm.resetFields();
  1492. }
  1493. this.studentCopyDialog = true;
  1494. this.studentCopyForm.sourceExamId = null;
  1495. this.studentCopyForm.targetExamId = null;
  1496. this.examList4CopyFrom = [];
  1497. this.examList4CopyTo = [];
  1498. this.queryExams4CopyFrom("");
  1499. this.queryExams4CopyTo("");
  1500. },
  1501. //复制学生
  1502. copyStudent() {
  1503. this.$refs.studentCopyForm.validate(valid => {
  1504. if (valid) {
  1505. if (
  1506. this.studentCopyForm.sourceExamId ==
  1507. this.studentCopyForm.targetExamId
  1508. ) {
  1509. this.$notify({
  1510. type: "error",
  1511. message: "源批次与目标批次不能相同"
  1512. });
  1513. return;
  1514. }
  1515. let url =
  1516. TASK_API +
  1517. "/copyExamStudent/addCopyTask?" +
  1518. new URLSearchParams({
  1519. examId1: this.studentCopyForm.sourceExamId,
  1520. examId2: this.studentCopyForm.targetExamId
  1521. });
  1522. this.fileLoading = true;
  1523. this.$httpWithMsg.post(url, {}).then(response => {
  1524. console.log(response);
  1525. this.$notify({
  1526. type: "success",
  1527. message: "复制中,请稍后查看"
  1528. });
  1529. this.studentCopyDialog = false;
  1530. this.fileLoading = false;
  1531. this.searchForm();
  1532. });
  1533. } else {
  1534. return false;
  1535. }
  1536. });
  1537. },
  1538. beforeUpload(file) {
  1539. console.log(file);
  1540. },
  1541. uploadProgress(event, file, fileList) {
  1542. console.log("uploadProgress");
  1543. console.log(event);
  1544. console.log(file);
  1545. console.log(fileList);
  1546. },
  1547. uploadSuccess(response, file, fileList) {
  1548. console.log("uploadSuccess");
  1549. console.log(response);
  1550. console.log(file);
  1551. console.log(fileList);
  1552. if (response.failNum > 0) {
  1553. this.errMessages = response.failRecords;
  1554. this.errDialog = true;
  1555. } else {
  1556. this.$notify({
  1557. message: "上传成功",
  1558. type: "success"
  1559. });
  1560. }
  1561. this.fileLoading = false;
  1562. this.studentImportDialog = false;
  1563. this.searchForm();
  1564. },
  1565. uploadError(response, file, fileList) {
  1566. console.log("uploadSuccess");
  1567. console.log(response);
  1568. console.log(file);
  1569. console.log(fileList);
  1570. var json = JSON.parse(response.message);
  1571. if (response.status == 500) {
  1572. this.$notify({
  1573. message: json.desc,
  1574. type: "error"
  1575. });
  1576. }
  1577. this.fileLoading = false;
  1578. },
  1579. initUpload() {
  1580. if (this.$refs.studentImportForm) {
  1581. this.$refs.studentImportForm.resetFields();
  1582. }
  1583. this.fileList = [];
  1584. this.studentImportForm.examId = "";
  1585. this.studentImportForm.examList4Import = [];
  1586. },
  1587. checkUpload() {
  1588. if (!this.studentImportForm.examId) {
  1589. this.$notify({
  1590. message: "请选择考试批次",
  1591. type: "error"
  1592. });
  1593. return false;
  1594. } else {
  1595. this.uploadData.examId = this.studentImportForm.examId;
  1596. }
  1597. var fileList = this.$refs.upload.uploadFiles;
  1598. if (fileList.length == 0) {
  1599. this.$notify({
  1600. message: "上传文件不能为空",
  1601. type: "error"
  1602. });
  1603. return false;
  1604. }
  1605. if (fileList.length > 1) {
  1606. this.$notify({
  1607. message: "每次只能上传一个文件",
  1608. type: "error"
  1609. });
  1610. return false;
  1611. }
  1612. for (let file of fileList) {
  1613. if (!file.name.endsWith(".xlsx")) {
  1614. this.$notify({
  1615. message: "上传文件必须为xlsx格式",
  1616. type: "error"
  1617. });
  1618. this.initUpload();
  1619. return false;
  1620. }
  1621. }
  1622. return true;
  1623. },
  1624. //确定上传
  1625. submitUpload() {
  1626. if (!this.checkUpload()) {
  1627. return false;
  1628. }
  1629. this.$refs.upload.submit();
  1630. this.fileLoading = true;
  1631. },
  1632. //清空文件
  1633. removeFile() {
  1634. this.$refs.upload.clearFiles();
  1635. },
  1636. //下载模板
  1637. exportFile() {
  1638. window.location.href = "/api/ecs_exam_work/exam_student/download";
  1639. },
  1640. initPrivileges() {
  1641. let params = new URLSearchParams();
  1642. params.append(
  1643. "privilegeCodes",
  1644. Object.keys(this.rolePrivileges).toString()
  1645. );
  1646. var url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
  1647. this.$httpWithMsg.post(url).then(response => {
  1648. this.rolePrivileges = response.data;
  1649. });
  1650. },
  1651. init() {
  1652. for (let role of this.user.roleList) {
  1653. if (role.roleCode == "LC_USER") {
  1654. this.pureLC = true;
  1655. continue;
  1656. }
  1657. }
  1658. if (1 < this.user.roleList.length) {
  1659. this.pureLC = false;
  1660. }
  1661. this.getCourses4Search("");
  1662. this.getOrgList4Search("");
  1663. this.queryExams4Search("");
  1664. this.formSearch.rootOrgId = this.user.rootOrgId;
  1665. if (this.pureLC) {
  1666. var url = CORE_API + "/user/" + this.user.userId;
  1667. this.$httpWithMsg.get(url).then(response => {
  1668. var userInfo = response.data;
  1669. this.lc_id = userInfo.orgId;
  1670. this.lc_name = userInfo.orgName;
  1671. this.lc_code = userInfo.orgCode;
  1672. this.orgList4Search = [
  1673. { id: this.lc_id, name: this.lc_name, code: this.lc_code }
  1674. ];
  1675. this.orgList4InsertOrUpdate = [
  1676. { id: this.lc_id, name: this.lc_name, code: this.lc_code }
  1677. ];
  1678. this.formSearch.orgId = this.lc_id;
  1679. this.examStudentForm.orgId = this.lc_id;
  1680. this.searchForm();
  1681. });
  1682. } else {
  1683. this.searchForm();
  1684. }
  1685. }
  1686. },
  1687. created() {
  1688. _this = this;
  1689. this.initPrivileges();
  1690. this.init();
  1691. this.uploadHeaders = {
  1692. key: this.user.key,
  1693. token: this.user.token
  1694. };
  1695. }
  1696. };
  1697. </script>
  1698. <style scoped>
  1699. .input {
  1700. width: 200px;
  1701. }
  1702. .editForm .el-form-item {
  1703. margin-bottom: 12px;
  1704. }
  1705. </style>