12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739 |
- <template>
- <section class="content">
- <div class="box box-info">
- <!-- 正文信息 -->
- <div class="box-body">
- <!-- 搜索表单 -->
- <el-form :inline="true" :model="formSearch" label-width="70px">
- <el-form-item label="考试">
- <el-select
- class="input"
- :remote-method="queryExams4Search"
- remote
- :loading="queryExams4SearchLoading"
- filterable
- clearable
- v-model="formSearch.examId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList4Search"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="姓名">
- <el-input
- class="input"
- placeholder="请输入姓名"
- v-model="formSearch.studentName"
- ></el-input>
- </el-form-item>
- <el-form-item label="学号">
- <el-input
- class="input"
- placeholder="请输入学号"
- v-model="formSearch.studentCode"
- ></el-input>
- </el-form-item>
- <el-form-item label="专业">
- <el-input
- class="input"
- placeholder="请输入专业"
- v-model="formSearch.specialtyName"
- ></el-input>
- </el-form-item>
- <el-form-item label="课程">
- <el-select
- class="input"
- :remote-method="getCourses4Search"
- :loading="courseLoading4Search"
- remote
- filterable
- clearable
- v-model="formSearch.courseId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in courseList4Search"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="学习中心">
- <el-select
- class="input"
- :remote-method="getOrgList4Search"
- :loading="getOrgList4SearchLoading"
- remote
- filterable
- clearable
- v-model="formSearch.orgId"
- placeholder="请选择"
- :disabled="pureLC"
- >
- <el-option
- v-for="item in orgList4Search"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="采集人">
- <el-input
- class="input"
- placeholder="请输入采集人"
- v-model="formSearch.infoCollector"
- ></el-input>
- </el-form-item>
- <el-form-item label="身份证">
- <el-input
- class="input"
- placeholder="请输入身份证"
- v-model="formSearch.identityNumber"
- ></el-input>
- </el-form-item>
- <el-form-item label="考点">
- <el-input
- class="input"
- placeholder="请输入考点"
- v-model="formSearch.examSite"
- ></el-input>
- </el-form-item>
- <el-form-item class="d-block">
- <el-button
- v-if="rolePrivileges.search_examStudent"
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="resetPageAndSearchForm"
- >查询
- </el-button>
- <el-button
- size="small"
- icon="el-icon-refresh"
- @click="resetSearchForm"
- >
- 重置
- </el-button>
- <el-button
- v-if="rolePrivileges.add_examStudent"
- size="small"
- type="primary"
- icon="el-icon-plus"
- @click="openAddingDialog"
- >新增
- </el-button>
- <el-button
- v-if="rolePrivileges.del_examStudent"
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="deleteStuByExam"
- >批次删除
- </el-button>
- <el-button
- v-if="rolePrivileges.copy_examStudent"
- size="small"
- type="primary"
- icon="el-icon-document"
- @click="copy"
- >复制
- </el-button>
- </el-form-item>
- </el-form>
- <div class="block-seperator"></div>
- <div>
- <span>批量操作:</span>
- <el-button
- v-if="rolePrivileges.del_examStudent"
- size="small"
- type="danger"
- icon="el-icon-delete"
- @click="deleteStuBatch"
- :disabled="noBatchSelected"
- >删除
- </el-button>
- </div>
- <div style="width: 100%;margin-bottom: 10px;"></div>
- <!-- 新增弹出窗口 -->
- <el-dialog
- @close="closeAddingStudentDialog"
- title="考生信息页面"
- :visible.sync="addingStudentDialog"
- width="650px"
- >
- <el-form
- :model="examStudentForm"
- :rules="rules"
- :inline="true"
- ref="addingStudentForm"
- label-width="85px"
- class="editForm"
- >
- <el-form-item label="考试" prop="examId">
- <el-select
- class="input"
- :remote-method="queryExams4InsertOrUpdate"
- :loading="queryExams4InsertOrUpdateLoading"
- remote
- filterable
- clearable
- v-model="examStudentForm.examId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList4InsertOrUpdate"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="姓名" prop="studentName">
- <el-input
- class="input"
- v-model="examStudentForm.studentName"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="学号" prop="studentCode">
- <el-input
- class="input"
- v-model="examStudentForm.studentCode"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="身份证号" prop="identityNumber">
- <el-input
- class="input"
- v-model="examStudentForm.identityNumber"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="学习中心" prop="orgId">
- <el-select
- class="input"
- :remote-method="getOrgList4InsertOrUpdate"
- :loading="getOrgList4InsertOrUpdateLoading"
- remote
- filterable
- clearable
- v-model="examStudentForm.orgId"
- placeholder="请选择"
- :disabled="pureLC"
- >
- <el-option
- v-for="item in orgList4InsertOrUpdate"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="课程" prop="courseId">
- <el-select
- :remote-method="getCourses4InsertOrUpdate"
- :loading="courseLoading4InsertOrUpdate"
- remote
- filterable
- clearable
- class="input"
- v-model="examStudentForm.courseId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in courseList4InsertOrUpdate"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="试卷类型" prop="paperType">
- <el-select
- class="input"
- v-model="examStudentForm.paperType"
- placeholder="请选择"
- >
- <el-option
- v-for="item in paperTypeList"
- :label="item"
- :value="item"
- :key="item"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="专业">
- <el-input
- class="input"
- v-model="examStudentForm.specialtyName"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="考点">
- <el-input
- class="input"
- v-model="examStudentForm.examSite"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="年级">
- <el-input
- class="input"
- v-model="examStudentForm.grade"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="采集人">
- <el-input
- class="input"
- v-model="examStudentForm.infoCollector"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="电话">
- <el-input
- class="input"
- v-model="examStudentForm.phone"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="试卷袋编码">
- <el-input
- class="input"
- v-model="examStudentForm.ext1"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-form>
- <div style="text-align: center;">
- <el-button type="primary" @click="addStudent">确 定</el-button>
- <el-button @click="closeAddingStudentDialog">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 修改弹出窗口 -->
- <el-dialog
- width="650px"
- @close="closeUpdateStudentDialog"
- title="考生信息页面"
- :visible.sync="updateStudentDialog"
- >
- <el-form
- :model="examStudentForm"
- size="large"
- :rules="rules"
- :inline="true"
- ref="updateStudentForm"
- label-width="85px"
- class="editForm"
- >
- <el-form-item label="考试" prop="examId">
- <el-select
- class="input"
- :remote-method="queryExams4InsertOrUpdate"
- :loading="queryExams4InsertOrUpdateLoading"
- remote
- disabled
- filterable
- clearable
- v-model="examStudentForm.examId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList4InsertOrUpdate"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="姓名" prop="studentName">
- <el-input
- class="input"
- v-model="examStudentForm.studentName"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="学号" prop="studentCode">
- <el-input
- class="input"
- v-model="examStudentForm.studentCode"
- maxlength="20"
- readonly
- ></el-input>
- </el-form-item>
- <el-form-item label="身份证号" prop="identityNumber">
- <el-input
- class="input"
- v-model="examStudentForm.identityNumber"
- maxlength="20"
- readonly
- ></el-input>
- </el-form-item>
- <el-form-item label="学习中心" prop="orgId">
- <el-select
- class="input"
- :remote-method="getOrgList4InsertOrUpdate"
- :loading="getOrgList4InsertOrUpdateLoading"
- remote
- filterable
- clearable
- v-model="examStudentForm.orgId"
- placeholder="请选择"
- :disabled="pureLC"
- >
- <el-option
- v-for="item in orgList4InsertOrUpdate"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="课程" prop="courseId">
- <el-select
- :remote-method="getCourses4InsertOrUpdate"
- :loading="courseLoading4InsertOrUpdate"
- remote
- filterable
- clearable
- disabled
- class="input"
- v-model="examStudentForm.courseId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in courseList4InsertOrUpdate"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="试卷类型" prop="paperType">
- <el-select
- class="input"
- v-model="examStudentForm.paperType"
- placeholder="请选择"
- >
- <el-option
- v-for="item in paperTypeList"
- :label="item"
- :value="item"
- :key="item"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="专业">
- <el-input
- class="input"
- v-model="examStudentForm.specialtyName"
- auto-complete="off"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="考点">
- <el-input
- class="input"
- v-model="examStudentForm.examSite"
- maxlength="20"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="年级">
- <el-input
- class="input"
- v-model="examStudentForm.grade"
- maxlength="20"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="采集人">
- <el-input
- class="input"
- v-model="examStudentForm.infoCollector"
- maxlength="20"
- ></el-input>
- </el-form-item>
- <el-form-item label="电话">
- <el-input
- class="input"
- v-model="examStudentForm.phone"
- maxlength="20"
- auto-complete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="试卷袋编码">
- <el-input
- class="input"
- v-model="examStudentForm.ext1"
- maxlength="20"
- ></el-input>
- </el-form-item>
- </el-form>
- <div style="text-align: center;">
- <el-button type="primary" @click="updateStudent">确 定</el-button>
- <el-button @click="closeUpdateStudentDialog">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 复制弹窗 -->
- <el-dialog
- title="考生信息复制"
- width="500px"
- :visible.sync="studentCopyDialog"
- >
- <el-form
- :model="studentCopyForm"
- :rules="rules"
- ref="studentCopyForm"
- class="editForm"
- :inline="true"
- label-width="120px"
- >
- <el-form-item label="源考试批次" prop="sourceExamId">
- <el-select
- class="input"
- :remote-method="queryExams4CopyFrom"
- remote
- :loading="queryExams4CopyFromLoading"
- filterable
- clearable
- v-model="studentCopyForm.sourceExamId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList4CopyFrom"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="目标考试批次" prop="targetExamId">
- <el-select
- class="input"
- :remote-method="queryExams4CopyTo"
- remote
- :loading="queryExams4CopyToLoading"
- filterable
- clearable
- v-model="studentCopyForm.targetExamId"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList4CopyTo"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- :disabled="!item.enable"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <div style="text-align: center;">
- <el-button type="primary" @click="copyStudent">确 定</el-button>
- <el-button @click="studentCopyDialog = false">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- <!-- 页面列表 -->
- <el-table
- v-loading="loading"
- element-loading-text="拼命加载中"
- :data="tableData"
- border
- style="width: 100%;text-align:center;"
- @selection-change="selectChange"
- >
- <el-table-column
- type="selection"
- width="40"
- fixed="left"
- ></el-table-column>
- <el-table-column
- prop="id"
- label="ID"
- sortable
- fixed="left"
- ></el-table-column>
- <el-table-column label="考生" fixed="left">
- <template slot-scope="scope">
- <el-popover trigger="hover" placement="left">
- <div style="font-size: 18px;font-family: 新宋体">
- <tr>
- <td style="color: green">姓名</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.studentName }}
- </td>
- </tr>
- <tr>
- <td style="color: green">身份证号</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.identityNumber }}
- </td>
- </tr>
- <tr>
- <td style="color: green">学号</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.studentCode }}
- </td>
- </tr>
- <tr>
- <td style="color: green">学习中心名称</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.orgName }}
- </td>
- </tr>
- <tr>
- <td style="color: green">学习中心编码</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.orgCode }}
- </td>
- </tr>
- <tr>
- <td style="color: green">课程名称</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.courseName }}
- </td>
- </tr>
- <tr>
- <td style="color: green">课程编码</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.courseCode }}
- </td>
- </tr>
- <tr>
- <td style="color: green">年级</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.grade }}
- </td>
- </tr>
- <tr>
- <td style="color: green">电话</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.phone }}
- </td>
- </tr>
- <tr>
- <td style="color: green">专业</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.specialtyName }}
- </td>
- </tr>
- <tr>
- <td style="color: green">采集人</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.infoCollector }}
- </td>
- </tr>
- <tr>
- <td style="color: green">考点</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.examSite }}
- </td>
- </tr>
- <tr>
- <td style="color: green">试卷袋编码</td>
- <td style="color:purple;padding-left: 20px;">
- {{ scope.row.ext1 }}
- </td>
- </tr>
- </div>
- <div slot="reference" class="name-wrapper">
- <span>{{ scope.row.studentName }}</span>
- </div>
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column prop="studentCode" label="学号" sortable>
- </el-table-column>
- <el-table-column
- prop="identityNumber"
- label="身份证号"
- width="120"
- sortable
- >
- </el-table-column>
- <el-table-column prop="orgName" label="学习中心" width="120" sortable>
- </el-table-column>
- <el-table-column
- prop="examName"
- label="考试名称"
- width="120"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="courseName"
- label="课程名称"
- width="120"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="updateTime"
- width="155"
- label="更新时间"
- sortable
- >
- </el-table-column>
- <el-table-column width="50" label="状态">
- <span slot-scope="scope">
- <span v-if="scope.row.enable">
- <el-tooltip
- class="item"
- effect="dark"
- content="启用"
- placement="left"
- >
- <i class="el-icon-success" style="color:green;"></i>
- </el-tooltip>
- </span>
- <span v-else>
- <el-tooltip
- class="item"
- effect="dark"
- content="禁用"
- placement="left"
- >
- <i class="el-icon-error" style="color:red;"></i>
- </el-tooltip>
- </span>
- </span>
- </el-table-column>
- <el-table-column width="300" label="操作" fixed="right">
- <template slot-scope="scope">
- <div v-if="scope.row.locked">锁定中,请稍后操作</div>
- <div v-else>
- <el-button
- size="mini"
- type="primary"
- plain
- :disabled="!scope.row.photoPath"
- icon="el-icon-picture"
- @click="showPhoto(scope.row)"
- >
- 查看照片
- </el-button>
- <el-button
- v-if="rolePrivileges.update_examStudent"
- size="mini"
- type="primary"
- plain
- icon="el-icon-edit"
- @click="openUpdateDialog(scope.row)"
- >
- 编辑
- </el-button>
- <el-dropdown
- style="margin-left: 10px;"
- v-if="
- rolePrivileges.del_examStudent ||
- rolePrivileges.change_exam_student_availability
- "
- >
- <el-button type="primary" plain size="mini">
- 更多<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item>
- <el-button
- v-if="rolePrivileges.del_examStudent"
- size="mini"
- type="danger"
- icon="el-icon-delete"
- @click="deleteExamStudent(scope.row)"
- >删除
- </el-button></el-dropdown-item
- >
- <el-dropdown-item>
- <el-button
- v-if="
- null != scope.row.enable &&
- !scope.row.enable &&
- rolePrivileges.change_exam_student_availability
- "
- size="mini"
- type="primary"
- plain
- icon="el-icon-check"
- @click="enableExamStudent(scope.row)"
- >启用
- </el-button>
- <el-button
- v-else-if="
- rolePrivileges.change_exam_student_availability
- "
- size="mini"
- type="danger"
- icon="el-icon-close"
- @click="disableExamStudent(scope.row)"
- >禁用
- </el-button>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div class="page pull-right">
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-size="pageSize"
- :page-sizes="[10, 20, 50, 100]"
- @size-change="handleSizeChange"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
- <el-dialog title="错误提示" v-model="errDialog">
- <div
- class="text-danger"
- v-for="errMessage in errMessages"
- :key="errMessage.lineNum"
- >
- 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="errDialog = false">确定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- @close="closePhotoDialog"
- title="照片"
- :visible.sync="photoDialog"
- width="300px"
- >
- <img :src="photo.url" height="100%" width="100%" />
- </el-dialog>
- </div>
- </div>
- </section>
- </template>
- <script>
- import {
- TASK_API,
- CORE_API,
- EXAM_WORK_API,
- PAPER_TYPE
- } from "@/constants/constants.js";
- import { mapState } from "vuex";
- let _this = null;
- let validateIdentityNumber = (rule, value, callback) => {
- if (
- !_this.examStudentForm.identityNumber ||
- _this.examStudentForm.identityNumber === ""
- ) {
- return callback(new Error("请输入身份证"));
- }
- if (
- _this.examStudentForm.identityNumber &&
- _this.examStudentForm.identityNumber.length < 6
- ) {
- callback(new Error("身份证至少6位"));
- } else {
- callback();
- }
- };
- export default {
- data() {
- return {
- rolePrivileges: {
- search_examStudent: false,
- add_examStudent: false,
- import_examStudent: false,
- copy_examStudent: false,
- del_examStudent: false,
- update_examStudent: false,
- change_exam_student_availability: false
- },
- pureLC: false,
- lc_id: null,
- lc_code: null,
- lc_name: null,
- loading: false,
- courseLoading4Search: false,
- courseLoading4InsertOrUpdate: false,
- photoDialog: false,
- photo: { url: "" },
- specialtyList: [],
- button: {},
- errDialog: false,
- errMessages: [],
- uploadAction: EXAM_WORK_API + "/exam_student/import",
- uploadData: { examId: "" },
- fileLoading: false,
- fileList: [],
- uploadHeaders: {},
- orgList4Search: [],
- getOrgList4SearchLoading: false,
- formSearch: {
- rootOrgId: "",
- examId: "",
- studentCode: "",
- studentName: "",
- orgId: "",
- specialtyName: "",
- courseId: "",
- infoCollector: "",
- identityNumber: "",
- examSite: ""
- },
- paperTypeList: PAPER_TYPE,
- courseList4Search: [],
- courseList4InsertOrUpdate: [],
- examList4Search: [],
- examList4InsertOrUpdate: [],
- examList4Import: [],
- examList4CopyFrom: [],
- examList4CopyTo: [],
- queryExams4SearchLoading: false,
- queryExams4InsertOrUpdateLoading: false,
- queryExams4ImportLoading: false,
- queryExams4CopyFromLoading: false,
- queryExams4CopyToLoading: false,
- selectedExamStuIds: [],
- addingStudentDialog: false,
- updateStudentDialog: false,
- studentPhoDialog: false,
- studentImportDialog: false,
- studentCopyDialog: false,
- tableData: [],
- currentPage: 1,
- pageSize: 10,
- total: 10,
- formLabelWidth: "120px",
- orgList4InsertOrUpdate: [],
- getOrgList4InsertOrUpdateLoading: false,
- examStudentForm: {
- id: null,
- examId: "",
- courseId: null,
- studentId: null,
- studentName: "",
- studentCode: "",
- identityNumber: "",
- specialtyName: "",
- orgId: "",
- examSite: "",
- grade: "",
- phone: "",
- infoCollector: "",
- paperType: "X",
- ext1: null,
- ext2: null,
- ext3: null,
- ext4: null,
- ext5: null
- },
- studentImportForm: {
- examId: ""
- },
- studentCopyForm: {
- sourceExamId: "",
- targetExamId: ""
- },
- result: false,
- rules: {
- examId: [
- {
- type: "number",
- required: true,
- message: "请选择考试",
- trigger: "change"
- }
- ],
- studentName: [
- { required: true, message: "请输入姓名", trigger: "blur" }
- ],
- identityNumber: [
- { required: true, validator: validateIdentityNumber, trigger: "blur" }
- ],
- courseId: [
- {
- type: "number",
- required: true,
- message: "请选择课程",
- trigger: "change"
- }
- ],
- paperType: [
- { required: false, message: "请输入试卷类型", trigger: "blur" }
- ],
- orgId: [
- {
- type: "number",
- required: true,
- message: "请选择学习中心",
- trigger: "change"
- }
- ],
- sourceExamId: [
- {
- type: "number",
- required: true,
- message: "请选择源考试批次",
- trigger: "change"
- }
- ],
- targetExamId: [
- {
- type: "number",
- required: true,
- message: "请选择目标考试批次",
- trigger: "change"
- }
- ]
- }
- };
- },
- computed: {
- ...mapState({ user: state => state.user }),
- examStuIds() {
- var examStuIds = "";
- for (let examStuId of this.selectedExamStuIds) {
- if (!examStuIds) {
- examStuIds += examStuId;
- } else {
- examStuIds += "," + examStuId;
- }
- }
- return examStuIds;
- },
- noBatchSelected() {
- return this.selectedExamStuIds.length === 0;
- }
- },
- methods: {
- queryExams4Search(name) {
- this.queryExams(name, "search");
- },
- queryExams4InsertOrUpdate(name) {
- this.queryExams(name, "insertOrUpdate");
- },
- queryExams4Import(name) {
- this.queryExams(name, "import");
- },
- queryExams4CopyFrom(name) {
- this.queryExams(name, "copyFrom");
- },
- queryExams4CopyTo(name) {
- this.queryExams(name, "copyTo");
- },
- queryExams(name, where) {
- console.log("queryExams; name: " + name);
- if ("search" == where) {
- this.queryExams4SearchLoading = true;
- } else if ("insertOrUpdate" == where) {
- this.queryExams4InsertOrUpdateLoading = true;
- } else if ("import" == where) {
- this.queryExams4ImportLoading = true;
- } else if ("copyFrom" == where) {
- this.queryExams4CopyFromLoading = true;
- } else if ("copyTo" == where) {
- this.queryExams4CopyToLoading = true;
- }
- this.$httpWithMsg
- .get(EXAM_WORK_API + "/exam/queryByNameLike?name=" + name)
- .then(response => {
- if ("search" == where) {
- this.queryExams4SearchLoading = false;
- this.examList4Search = response.data;
- } else if ("insertOrUpdate" == where) {
- this.queryExams4InsertOrUpdateLoading = false;
- this.examList4InsertOrUpdate = response.data;
- } else if ("import" == where) {
- this.queryExams4ImportLoading = false;
- this.examList4Import = response.data;
- } else if ("copyFrom" == where) {
- this.queryExams4CopyFromLoading = false;
- this.examList4CopyFrom = response.data;
- } else if ("copyTo" == where) {
- this.queryExams4CopyToLoading = false;
- this.examList4CopyTo = response.data;
- }
- })
- .catch(response => {
- console.log(response);
- if ("search" == where) {
- this.queryExams4SearchLoading = false;
- } else if ("insertOrUpdate" == where) {
- this.queryExams4InsertOrUpdateLoading = false;
- } else if ("import" == where) {
- this.queryExams4ImportLoading = false;
- } else if ("copyFrom" == where) {
- this.queryExams4CopyFromLoading = false;
- } else if ("copyTo" == where) {
- this.queryExams4CopyToLoading = false;
- }
- });
- },
- getOrgList4Search(orgName) {
- this.getOrgList(orgName, "search");
- },
- getOrgList4InsertOrUpdate(orgName) {
- this.getOrgList(orgName, "insertOrUpdate");
- },
- getOrgList(orgName, where) {
- if ("search" == where) {
- this.getOrgList4SearchLoading = true;
- } else if ("insertOrUpdate" == where) {
- this.getOrgList4InsertOrUpdateLoading = true;
- }
- let url = CORE_API + "/org/query?name=" + orgName;
- this.$httpWithMsg
- .get(url)
- .then(response => {
- if ("search" == where) {
- this.getOrgList4SearchLoading = false;
- this.orgList4Search = response.data;
- } else if ("insertOrUpdate" == where) {
- this.getOrgList4InsertOrUpdateLoading = false;
- this.orgList4InsertOrUpdate = response.data;
- }
- })
- .catch(response => {
- console.log(response);
- if ("search" == where) {
- this.getOrgList4SearchLoading = false;
- } else if ("insertOrUpdate" == where) {
- this.getOrgList4InsertOrUpdateLoading = false;
- }
- });
- },
- closePhotoDialog() {
- this.photo.url = "/img/blank.png";
- this.photoDialog = false;
- },
- showPhoto(row) {
- if (row.photoPath) {
- this.photo.url = row.photoPath;
- this.photoDialog = true;
- } else {
- this.$notify({
- showClose: true,
- message: "未上传照片",
- type: "error"
- });
- }
- },
- getExcelTitle(row) {
- return "第" + row + "行";
- },
- getCourseName(code) {
- for (let course of this.courseList) {
- if (code == course.code) {
- return course.name;
- }
- }
- },
- specialtySelect(code) {
- console.log(code);
- for (let specialty of this.specialtyList) {
- if (code == specialty.code) {
- return specialty.name;
- }
- }
- },
- selectChange(row) {
- this.selectedExamStuIds = [];
- row.forEach((element, index) => {
- console.log(index);
- this.selectedExamStuIds.push(element.id);
- });
- console.log(this.selectedExamStuIds);
- },
- resetSearchForm() {
- this.formSearch.rootOrgId = "";
- this.formSearch.examId = "";
- this.formSearch.studentCode = "";
- this.formSearch.studentName = "";
- this.formSearch.orgId = "";
- this.formSearch.specialtyName = "";
- this.formSearch.courseId = "";
- this.formSearch.infoCollector = "";
- this.formSearch.identityNumber = "";
- this.formSearch.examSite = "";
- },
- resetPageAndSearchForm() {
- this.currentPage = 1;
- this.searchForm();
- },
- //查询方法
- searchForm() {
- var param = new URLSearchParams(this.formSearch);
- this.loading = true;
- var url =
- EXAM_WORK_API +
- "/exam_student/examStudentPage/" +
- (this.currentPage - 1) +
- "/" +
- this.pageSize +
- "?" +
- param;
- this.$httpWithMsg.get(url).then(response => {
- this.tableData = response.data.list;
- this.total = response.data.total;
- this.loading = false;
- });
- },
- //查询所有课程
- getSpecialtys() {
- var orgId = this.user.orgId;
- this.$httpWithMsg
- .get(CORE_API + "/specialty/all?orgId=" + orgId)
- .then(response => {
- console.log(response);
- this.specialtyList = response.data;
- });
- },
- getCourses4Search(query) {
- this.courseLoading4Search = true;
- this.$httpWithMsg
- .get(CORE_API + "/course/query?name=" + query)
- .then(response => {
- this.courseList4Search = response.data;
- this.courseLoading4Search = false;
- });
- },
- getCourses4InsertOrUpdate(query) {
- this.courseLoading4InsertOrUpdate = true;
- this.$httpWithMsg
- .get(CORE_API + "/course/query?name=" + query)
- .then(response => {
- this.courseList4InsertOrUpdate = response.data;
- this.courseLoading4InsertOrUpdate = false;
- });
- },
- //新增信息
- addStudent() {
- var url = EXAM_WORK_API + "/exam_student";
- this.$refs.addingStudentForm.validate(valid => {
- if (valid) {
- this.$httpWithMsg.put(url, this.examStudentForm).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "保存成功"
- });
- this.addingStudentDialog = false;
- this.searchForm();
- });
- } else {
- return false;
- }
- });
- },
- //更新
- updateStudent() {
- var url = EXAM_WORK_API + "/exam_student";
- this.$refs.updateStudentForm.validate(valid => {
- if (valid) {
- this.$httpWithMsg.put(url, this.examStudentForm).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "更新成功"
- });
- this.updateStudentDialog = false;
- this.searchForm();
- });
- } else {
- return false;
- }
- });
- },
- //删除方法
- deleteExamStudent(row) {
- this.$confirm("是否删除考生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "error"
- }).then(() => {
- var url = EXAM_WORK_API + "/exam_student/" + row.id;
- this.$httpWithMsg.delete(url).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "删除成功!"
- });
- this.searchForm();
- });
- });
- },
- //批量删除方法
- deleteStuBatch() {
- if (this.examStuIds.length == 0) {
- this.$notify({
- type: "warning",
- message: "请选择要删除的考生"
- });
- return;
- }
- this.$confirm("是否删除考生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "error"
- }).then(() => {
- var url = EXAM_WORK_API + "/exam_student/" + this.examStuIds;
- this.$httpWithMsg.delete(url).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "删除成功!"
- });
- this.searchForm();
- });
- });
- },
- //按批次删除方法
- deleteStuByExam() {
- if (!this.formSearch.examId) {
- this.$notify({
- type: "warning",
- message: "请选择要删除的批次"
- });
- return;
- }
- this.$msgbox({
- title: "提示",
- message: "是否删除该批次所有考生?",
- showCancelButton: false,
- confirmButtonText: "确定",
- beforeClose: (action, instance, done) => {
- if (action === "confirm") {
- instance.confirmButtonLoading = true;
- instance.confirmButtonText = "执行中...";
- let inst = instance;
- let delExamStudentDone = done;
- let url =
- EXAM_WORK_API + "/exam_student/exam/" + this.formSearch.examId;
- this.$httpWithMsg.delete(url).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "删除成功!"
- });
- inst.confirmButtonLoading = false;
- delExamStudentDone();
- this.searchForm();
- });
- } else {
- done();
- }
- }
- }).then(action => {
- console.log(action);
- });
- },
- handleCurrentChange(val) {
- this.currentPage = val;
- this.searchForm();
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.searchForm();
- },
- //新增
- openAddingDialog() {
- if (this.$refs.addingStudentForm) {
- this.$refs.addingStudentForm.resetFields();
- }
- this.examStudentForm.examId = null;
- this.examStudentForm.studentName = null;
- this.examStudentForm.studentCode = null;
- this.examStudentForm.identityNumber = null;
- this.examStudentForm.courseId = null;
- this.examStudentForm.examSite = null;
- this.examStudentForm.grade = null;
- this.examStudentForm.paperType = "X";
- this.examStudentForm.specialtyName = null;
- this.examStudentForm.phone = null;
- this.examStudentForm.infoCollector = null;
- this.examStudentForm.ext1 = null;
- if (this.pureLC) {
- this.examStudentForm.orgId = this.lc_id;
- this.orgList4InsertOrUpdate = [
- { id: this.lc_id, name: this.lc_name, code: this.lc_code }
- ];
- } else {
- this.examStudentForm.orgId = null;
- this.orgList4InsertOrUpdate = null;
- this.getOrgList4InsertOrUpdate("");
- }
- this.examList4InsertOrUpdate = [];
- this.courseList4InsertOrUpdate = [];
- this.queryExams4InsertOrUpdate("");
- this.getCourses4InsertOrUpdate("");
- this.addingStudentDialog = true;
- },
- //修改
- openUpdateDialog(row) {
- if (this.$refs.updateStudentForm) {
- this.$refs.updateStudentForm.resetFields();
- }
- this.orgList4InsertOrUpdate = [
- { id: row.orgId, name: row.orgName, code: row.orgCode }
- ];
- this.courseList4InsertOrUpdate = [
- { id: row.courseId, name: row.courseName, code: row.courseCode }
- ];
- this.examList4InsertOrUpdate = [{ id: row.examId, name: row.examName }];
- this.examStudentForm.id = row.id;
- this.examStudentForm.examId = row.examId;
- this.examStudentForm.courseId = row.courseId;
- this.examStudentForm.studentId = row.studentId;
- this.examStudentForm.studentName = row.studentName;
- this.examStudentForm.studentCode = row.studentCode;
- this.examStudentForm.identityNumber = row.identityNumber;
- this.examStudentForm.specialtyName = row.specialtyName;
- this.examStudentForm.orgId = row.orgId;
- this.examStudentForm.examSite = row.examSite;
- this.examStudentForm.grade = row.grade;
- this.examStudentForm.phone = row.phone;
- this.examStudentForm.infoCollector = row.infoCollector;
- this.examStudentForm.paperType = row.paperType;
- this.examStudentForm.ext1 = row.ext1;
- this.examStudentForm.ext2 = row.ext2;
- this.examStudentForm.ext3 = row.ext3;
- this.examStudentForm.ext4 = row.ext4;
- this.examStudentForm.ext5 = row.ext5;
- this.updateStudentDialog = true;
- },
- //禁用
- disableExamStudent(row) {
- this.$confirm("是否禁用所选考生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- var url = EXAM_WORK_API + "/exam_student/disable/" + row.id;
- this.$httpWithMsg.put(url).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "禁用成功"
- });
- this.searchForm();
- });
- });
- },
- //启用
- enableExamStudent(row) {
- this.$confirm("是否启用所选考生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- var url = EXAM_WORK_API + "/exam_student/enable/" + row.id;
- this.$httpWithMsg.put(url).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "启用成功"
- });
- this.searchForm();
- });
- });
- },
- closeAddingStudentDialog() {
- this.addingStudentDialog = false;
- },
- closeUpdateStudentDialog() {
- this.updateStudentDialog = false;
- },
- //导入
- imp() {
- this.studentImportDialog = true;
- this.initUpload();
- },
- //复制
- copy() {
- if (this.$refs.studentCopyForm) {
- this.$refs.studentCopyForm.resetFields();
- }
- this.studentCopyDialog = true;
- this.studentCopyForm.sourceExamId = null;
- this.studentCopyForm.targetExamId = null;
- this.examList4CopyFrom = [];
- this.examList4CopyTo = [];
- this.queryExams4CopyFrom("");
- this.queryExams4CopyTo("");
- },
- //复制学生
- copyStudent() {
- this.$refs.studentCopyForm.validate(valid => {
- if (valid) {
- if (
- this.studentCopyForm.sourceExamId ==
- this.studentCopyForm.targetExamId
- ) {
- this.$notify({
- type: "error",
- message: "源批次与目标批次不能相同"
- });
- return;
- }
- let url =
- TASK_API +
- "/copyExamStudent/addCopyTask?" +
- new URLSearchParams({
- examId1: this.studentCopyForm.sourceExamId,
- examId2: this.studentCopyForm.targetExamId
- });
- this.fileLoading = true;
- this.$httpWithMsg.post(url, {}).then(response => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "复制中,请稍后查看"
- });
- this.studentCopyDialog = false;
- this.fileLoading = false;
- this.searchForm();
- });
- } else {
- return false;
- }
- });
- },
- beforeUpload(file) {
- console.log(file);
- },
- uploadProgress(event, file, fileList) {
- console.log("uploadProgress");
- console.log(event);
- console.log(file);
- console.log(fileList);
- },
- uploadSuccess(response, file, fileList) {
- console.log("uploadSuccess");
- console.log(response);
- console.log(file);
- console.log(fileList);
- if (response.failNum > 0) {
- this.errMessages = response.failRecords;
- this.errDialog = true;
- } else {
- this.$notify({
- message: "上传成功",
- type: "success"
- });
- }
- this.fileLoading = false;
- this.studentImportDialog = false;
- this.searchForm();
- },
- uploadError(response, file, fileList) {
- console.log("uploadSuccess");
- console.log(response);
- console.log(file);
- console.log(fileList);
- var json = JSON.parse(response.message);
- if (response.status == 500) {
- this.$notify({
- message: json.desc,
- type: "error"
- });
- }
- this.fileLoading = false;
- },
- initUpload() {
- if (this.$refs.studentImportForm) {
- this.$refs.studentImportForm.resetFields();
- }
- this.fileList = [];
- this.studentImportForm.examId = "";
- this.studentImportForm.examList4Import = [];
- },
- checkUpload() {
- if (!this.studentImportForm.examId) {
- this.$notify({
- message: "请选择考试批次",
- type: "error"
- });
- return false;
- } else {
- this.uploadData.examId = this.studentImportForm.examId;
- }
- var fileList = this.$refs.upload.uploadFiles;
- if (fileList.length == 0) {
- this.$notify({
- message: "上传文件不能为空",
- type: "error"
- });
- return false;
- }
- if (fileList.length > 1) {
- this.$notify({
- message: "每次只能上传一个文件",
- type: "error"
- });
- return false;
- }
- for (let file of fileList) {
- if (!file.name.endsWith(".xlsx")) {
- this.$notify({
- message: "上传文件必须为xlsx格式",
- type: "error"
- });
- this.initUpload();
- return false;
- }
- }
- return true;
- },
- //确定上传
- submitUpload() {
- if (!this.checkUpload()) {
- return false;
- }
- this.$refs.upload.submit();
- this.fileLoading = true;
- },
- //清空文件
- removeFile() {
- this.$refs.upload.clearFiles();
- },
- //下载模板
- exportFile() {
- window.location.href = "/api/ecs_exam_work/exam_student/download";
- },
- initPrivileges() {
- var params = {
- privilegeCodes: Object.keys(this.rolePrivileges).toString()
- };
- var url =
- CORE_API +
- "/rolePrivilege/checkPrivileges?" +
- new URLSearchParams(params);
- this.$httpWithMsg.post(url).then(response => {
- this.rolePrivileges = response.data;
- });
- },
- init() {
- for (let role of this.user.roleList) {
- if (role.roleCode == "LC_USER") {
- this.pureLC = true;
- continue;
- }
- }
- if (1 < this.user.roleList.length) {
- this.pureLC = false;
- }
- this.getCourses4Search("");
- this.getOrgList4Search("");
- this.queryExams4Search("");
- this.formSearch.rootOrgId = this.user.rootOrgId;
- if (this.pureLC) {
- var url = CORE_API + "/user/" + this.user.userId;
- this.$httpWithMsg.get(url).then(response => {
- var userInfo = response.data;
- this.lc_id = userInfo.orgId;
- this.lc_name = userInfo.orgName;
- this.lc_code = userInfo.orgCode;
- this.orgList4Search = [
- { id: this.lc_id, name: this.lc_name, code: this.lc_code }
- ];
- this.orgList4InsertOrUpdate = [
- { id: this.lc_id, name: this.lc_name, code: this.lc_code }
- ];
- this.formSearch.orgId = this.lc_id;
- this.examStudentForm.orgId = this.lc_id;
- this.searchForm();
- });
- } else {
- this.searchForm();
- }
- }
- },
- created() {
- _this = this;
- this.initPrivileges();
- this.init();
- this.uploadHeaders = {
- key: this.user.key,
- token: this.user.token
- };
- }
- };
- </script>
- <style scoped>
- .input {
- width: 200px;
- }
- .editForm .el-form-item {
- margin-bottom: 12px;
- }
- </style>
|