examStudent.vue 53 KB

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