examStudent.vue 60 KB

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