12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457 |
- <template>
- <section class="content">
- <div class="box box-info">
- <!-- 正文信息 -->
- <div class="box-body">
- <el-form
- ref="formSearch"
- :model="formSearch"
- :inline="true"
- label-width="70px"
- >
- <el-form-item v-if="isSuperAdmin" label="学校">
- <el-select
- v-model="formSearch.rootOrgId"
- placeholder="请选择"
- class="input"
- @change="rootOrgChanged"
- >
- <el-option
- v-for="item in rootOrgList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="姓名">
- <el-input
- v-model="formSearch.name"
- placeholder="请输入姓名"
- class="input"
- ></el-input>
- </el-form-item>
- <el-form-item label="学号">
- <el-input
- v-model="formSearch.studentCode"
- placeholder="请输入学号"
- class="input"
- ></el-input>
- </el-form-item>
- <el-form-item label="身份证">
- <el-input
- v-model="formSearch.identityNumber"
- placeholder="请输入身份证"
- class="input"
- ></el-input>
- </el-form-item>
- <el-form-item label="学习中心">
- <el-select
- v-model="formSearch.orgId"
- class="input"
- :remote-method="getOrgList4Search"
- :loading="getOrgList4SearchLoading"
- remote
- filterable
- clearable
- placeholder="请选择"
- >
- <el-option
- v-for="item in orgList4Search"
- :key="item.id"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="照片状态">
- <el-select v-model="formSearch.hasPhoto" class="input">
- <el-option label="未选择" value="UNDEFINED"></el-option>
- <el-option label="已上传" value="TRUE"></el-option>
- <el-option label="未上传" value="FALSE"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="状态">
- <el-select v-model="formSearch.enable" class="input">
- <el-option label="未选择" value="UNDEFINED"></el-option>
- <el-option label="已启用" value="TRUE"></el-option>
- <el-option label="已禁用" value="FALSE"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="d-block">
- <el-button
- v-if="rolePrivileges.search_student"
- 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.upload_student_photo"
- size="small"
- type="primary"
- icon="el-icon-upload2"
- @click="uploadPhoto"
- >上传照片</el-button
- >
- <el-button
- size="small"
- type="primary"
- icon="el-icon-download"
- @click="exportStudent"
- >导出</el-button
- >
- </el-form-item>
- </el-form>
- <div class="block-seperator"></div>
- <span>批量操作:</span>
- <el-button
- v-if="rolePrivileges.reset_student_password"
- size="small"
- type="danger"
- icon="el-icon-refresh"
- :disabled="noBatchSelected"
- @click="resetPassword('')"
- >重置密码</el-button
- >
- <el-button
- v-if="rolePrivileges.change_student_availability"
- size="small"
- type="success"
- icon="el-icon-check"
- :disabled="noBatchSelected"
- @click="enableStudent('')"
- >启用</el-button
- >
- <el-button
- v-if="rolePrivileges.change_student_availability"
- size="small"
- type="danger"
- icon="el-icon-close"
- :disabled="noBatchSelected"
- @click="disableStudent('')"
- >禁用</el-button
- >
- <el-button
- v-if="rolePrivileges.reset_student_password"
- size="small"
- type="danger"
- icon="el-icon-refresh"
- @click="resetPasswordByOrgId()"
- >重置学习中心所有学生密码</el-button
- >
- <div style="width: 100%; margin-bottom: 10px"></div>
- <!-- 重置学习中心所有学生密码-->
- <el-dialog
- title="重置学习中心所有学生密码"
- width="500px"
- :visible.sync="resetPasswordByOrgIdDialog"
- >
- <el-form
- ref="resetPasswordByOrgIdForm"
- :model="resetPasswordByOrgIdForm"
- :inline="true"
- label-width="80px"
- :rules="resetPasswordByOrgIdRules"
- >
- <el-form-item label="学习中心" prop="orgId">
- <el-select
- v-model="resetPasswordByOrgIdForm.orgId"
- class="input"
- :remote-method="getOrgList4RestPassword"
- :loading="getOrgList4RestPasswordLoading"
- remote
- filterable
- clearable
- placeholder="请选择"
- >
- <el-option
- v-for="item in orgList4RestPassword"
- :key="item.id"
- :label="item.name + ' - ' + item.code"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div style="text-align: center; margin-top: 20px">
- <el-button type="primary" @click="submitResetPasswordByOrgId"
- >确 定</el-button
- >
- <el-button @click="resetPasswordByOrgIdDialog = false"
- >取 消</el-button
- >
- </div>
- </el-dialog>
- <!-- 页面列表 -->
- <el-table
- :data="tableData"
- border
- style="width: 100%; text-align: center"
- @selection-change="selectChange"
- >
- <el-table-column type="selection" width="50"></el-table-column>
- <el-table-column
- prop="id"
- width="100"
- label="ID"
- sortable
- ></el-table-column>
- <el-table-column label="考生" width="100">
- <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.name }}
- </td>
- </tr>
- <tr>
- <td style="color: green">身份证号</td>
- <td style="color: purple; padding-left: 20px">
- {{ scope.row.privateIdentityNumber }}
- </td>
- </tr>
- <tr>
- <td style="color: green">学号</td>
- <td style="color: purple; padding-left: 20px">
- {{ scope.row.studentCodeList }}
- </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.phoneNumber }}
- </td>
- </tr>
- <tr>
- <td style="color: green">安全手机号</td>
- <td style="color: purple; padding-left: 20px">
- {{ scope.row.securityPhone }}
- </td>
- </tr>
- <tr>
- <td style="color: green">创建时间</td>
- <td style="color: purple; padding-left: 20px">
- {{ scope.row.creationTime }}
- </td>
- </tr>
- </div>
- <div slot="reference" class="name-wrapper">
- <span>{{ scope.row.name }}</span>
- </div>
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="学号">
- <span slot-scope="scope" v-html="scope.row.studentCodesStr"></span>
- </el-table-column>
- <el-table-column
- prop="privateIdentityNumber"
- width
- label="身份证"
- sortable
- ></el-table-column>
- <el-table-column
- prop="orgName"
- width
- label="学习中心"
- sortable
- ></el-table-column>
- <el-table-column width="168" label="更新时间" sortable>
- <template slot-scope="scope">
- <el-button type="text" @click="gotoOperateLog(scope.row.id)">{{
- scope.row.updateTime
- }}</el-button>
- </template>
- </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 label="操作" width="300">
- <div slot-scope="scope">
- <el-button
- :disabled="!scope.row.photoPath"
- size="mini"
- type="primary"
- plain
- icon="el-icon-picture"
- @click="showPhoto(scope.row)"
- >查看照片</el-button
- >
- <el-button
- v-if="
- null != scope.row.enable &&
- !scope.row.enable &&
- rolePrivileges.change_student_availability
- "
- size="mini"
- type="primary"
- plain
- icon="el-icon-check"
- @click="enableStudent(scope.row)"
- >启用</el-button
- >
- <el-button
- v-else-if="rolePrivileges.change_student_availability"
- size="mini"
- type="danger"
- icon="el-icon-close"
- @click="disableStudent(scope.row)"
- >禁用</el-button
- >
- <el-dropdown style="margin-left: 10px">
- <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
- v-if="rolePrivileges.reset_student_password"
- >
- <el-button
- size="mini"
- type="danger"
- icon="el-icon-refresh"
- @click="resetPassword(scope.row)"
- >重置密码</el-button
- >
- </el-dropdown-item>
- <el-dropdown-item>
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-document"
- @click="showStuExamDialog(scope.row)"
- >考试记录</el-button
- >
- </el-dropdown-item>
- <el-dropdown-item v-if="rolePrivileges.unbind_student_code">
- <el-button
- size="mini"
- type="danger"
- icon="el-icon-refresh"
- @click="showUnbindStudentCode(scope.row)"
- >解绑学号</el-button
- >
- </el-dropdown-item>
- <el-dropdown-item v-if="rolePrivileges.unbind_security_phone">
- <el-button
- size="mini"
- type="danger"
- icon="el-icon-refresh"
- @click="unbindSecurityPhone(scope.row)"
- >解绑安全手机</el-button
- >
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </el-table-column>
- </el-table>
- <div class="page pull-right">
- <el-pagination
- :current-page="currentPage"
- :page-size="pageSize"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- @current-change="handleCurrentChange"
- @size-change="handleSizeChange"
- ></el-pagination>
- </div>
- <!-- 解绑学号-->
- <el-dialog
- title="解绑学号"
- width="50%"
- :visible.sync="unbindStudentCodeDialog"
- >
- <el-table
- :data="unbindStudentCodeData.tableData"
- border
- style="width: 100%; text-align: center"
- >
- <el-table-column prop="name" label="姓名" />
- <el-table-column prop="identityNumber" label="身份证" />
- <el-table-column prop="studentCode" label="学号" />
- <el-table-column label="操作" width="100">
- <div slot-scope="scope">
- <el-button
- size="mini"
- type="danger"
- icon="el-icon-delete"
- @click="unbindStudentCode(scope.row)"
- >解绑</el-button
- >
- </div>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 考试记录 -->
- <el-dialog
- v-loading="stuExamLoading"
- title="学生考试记录"
- width="60%"
- :visible.sync="stuExamDialog"
- element-loading-text="拼命加载中"
- >
- <el-form
- :inline="true"
- :model="stuExamSearch"
- label-position="right"
- label-width="50px"
- >
- <el-form-item label="考试" class="pull-left">
- <el-select
- v-model="stuExamSearch.examId"
- class="input"
- :remote-method="queryExams4Search"
- remote
- :loading="queryExams4SearchLoading"
- filterable
- clearable
- placeholder="请选择"
- @change="handleExamChange4Search"
- >
- <el-option
- v-for="item in examList4Search"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="场次" class="pull-left">
- <el-select
- v-model="stuExamSearch.examStageId"
- clearable
- :disabled="examStageDisabled4Search"
- class="input"
- :remote-method="queryExamStages4Search"
- remote
- :loading="queryExamStages4SearchLoading"
- :filterable="true"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examStageList4Search"
- :key="item.id"
- :label="item.stageOrder"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item class="pull-left">
- <el-button
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="searchExamRecord"
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- <el-table
- :data="stuExamList"
- border
- style="width: 100%; text-align: center"
- >
- <el-table-column
- prop="studentName"
- label="学生姓名"
- ></el-table-column>
- <el-table-column prop="studentCode" label="学号"></el-table-column>
- <el-table-column prop="ext2" label="身份证"></el-table-column>
- <el-table-column
- prop="examName"
- label="考试"
- sortable
- ></el-table-column>
- <el-table-column
- v-if="!examStageDisabled4Search"
- prop="examStageOrder"
- label="场次"
- width="120"
- sortable
- ></el-table-column>
- <el-table-column
- prop="courseName"
- label="课程"
- sortable
- ></el-table-column>
- <el-table-column width="130" label="考试状态">
- <div slot-scope="scope">
- <span v-if="null == scope.row.started"></span>
- <span v-else-if="scope.row.started">已考</span>
- <span v-else>未考</span>
- </div>
- </el-table-column>
- </el-table>
- <div class="page pull-right">
- <el-pagination
- :current-page="stuExamCurPage"
- :page-size="stuExamPageSize"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- layout="total, sizes, prev, pager, next, jumper"
- :total="stuExamTotal"
- @current-change="stuExamCurChange"
- @size-change="handleStuExamSizeChange"
- ></el-pagination>
- </div>
- <div style="margin-top: 10px"></div>
- </el-dialog>
- <!-- 导入照片弹窗 -->
- <el-dialog
- title="学生照片导入"
- width="350px"
- :visible.sync="photoUploadDialog"
- >
- <el-form>
- <el-row>
- <el-form-item style="margin-left: 30px">
- <el-upload
- ref="upload"
- class="form_left"
- list-type="picture"
- :action="uploadAction"
- :headers="uploadHeaders"
- :data="uploadData"
- :before-upload="beforeUpload"
- :on-progress="uploadProgress"
- :on-success="uploadSuccess"
- :on-error="uploadError"
- :file-list="fileList"
- :auto-upload="false"
- :multiple="false"
- >
- <el-button
- slot="trigger"
- size="small"
- type="primary"
- icon="el-icon-search"
- >选择文件</el-button
- >
- <el-button
- size="small"
- style="margin-left: 10px"
- type="primary"
- icon="el-icon-check"
- @click="submitUpload"
- >确认上传</el-button
- >
- <div slot="tip" class="el-upload__tip">
- 只能上传jpg,png文件
- </div>
- </el-upload>
- </el-form-item>
- </el-row>
- </el-form>
- </el-dialog>
- <!--查看照片-->
- <el-dialog
- title="照片"
- :visible.sync="photoDialog"
- width="300px"
- :center="true"
- @close="closePhotoDialog"
- >
- <img :src="photo.url" height="100%" width="100%" />
- </el-dialog>
- <el-dialog
- v-loading="studentLog.loading"
- title="学生日志"
- width="60%"
- :visible.sync="stuLogDialog"
- :close-on-click-modal="false"
- element-loading-text="拼命加载中"
- >
- <!-- 表单 -->
- <el-form inline :model="studentLog.formSearch">
- <el-form-item label="操作内容">
- <el-input
- v-model="studentLog.formSearch.operate"
- placeholder="请输入操作内容"
- style="width: 180px"
- />
- </el-form-item>
- <el-form-item label="操作时间">
- <el-date-picker
- v-model="studentLog.timeRange"
- class="input"
- type="datetimerange"
- start-placeholder="开始日期"
- range-separator="至"
- end-placeholder="结束日期"
- value-format="yyyy/MM/dd HH:mm:ss"
- :clearable="false"
- size="small"
- @change="changeTimeRange"
- ></el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="loghandleSearchBtn"
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- <div class="block-seperator"></div>
- <!-- 页面列表 -->
- <el-table
- :data="studentLog.tableData"
- border
- resizable
- stripe
- style="width: 100%"
- >
- <el-table-column
- width="200"
- prop="operateTime"
- label="操作时间"
- ></el-table-column>
- <el-table-column
- width="200"
- prop="operateIp"
- label="IP"
- ></el-table-column>
- <el-table-column
- width="200"
- prop="operateClient"
- label="操作端"
- ></el-table-column>
- <el-table-column prop="operate" label="操作内容"></el-table-column>
- </el-table>
- <div class="page pull-right">
- <el-pagination
- v-if="studentLog.paginationShow"
- :current-page="studentLog.currentPage"
- :page-size="studentLog.pageSize"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- layout="total, sizes, prev, pager, next, jumper"
- :total="studentLog.total"
- @current-change="loghandleCurrentChange"
- @size-change="loghandleSizeChange"
- />
- </div>
- </el-dialog>
- </div>
- </div>
- </section>
- </template>
- <script>
- import {
- CORE_API,
- EXAM_WORK_API,
- EXCHANGE_API,
- REPORTS_API,
- } from "@/constants/constants.js";
- import { mapState } from "vuex";
- export default {
- data() {
- return {
- rolePrivileges: {
- search_student: false,
- upload_student_photo: false,
- reset_student_password: false,
- change_student_availability: false,
- unbind_student_code: false,
- unbind_security_phone: false,
- },
- rootOrgList: null,
- stuExamLoading: false,
- button: {},
- pureLC: false,
- lc_id: null,
- lc_code: null,
- lc_name: null,
- orgList4Search: [],
- orgList4RestPassword: [],
- getOrgList4SearchLoading: false,
- getOrgList4RestPasswordLoading: false,
- resetPasswordByOrgIdDialog: false,
- resetPasswordByOrgIdForm: {
- orgId: "",
- },
- formSearch: {
- orgId: "",
- rootOrgId: null,
- name: "",
- studentCode: "",
- identityNumber: "",
- enable: "UNDEFINED",
- hasPhoto: "UNDEFINED",
- },
- selectedStuIds: [],
- statusList: [
- {
- value: true,
- label: "启用",
- },
- {
- value: false,
- label: "禁用",
- },
- ],
- tableData: [],
- currentPage: 1,
- pageSize: 10,
- total: 10,
- photoDialog: false,
- stuLogDialog: false,
- photo: { url: "" },
- unbindStudentCodeDialog: false,
- unbindStudentCodeData: {
- tableData: [],
- },
- errMessages: [],
- uploadAction: EXCHANGE_API + "/facepp/add",
- uploadData: {},
- fileLoading: false,
- fileList: [],
- uploadHeaders: {},
- photoUploadDialog: false,
- stuExamCurPage: 1,
- stuExamPageSize: 10,
- stuExamTotal: 10,
- stuExamDialog: false,
- stuExamList: [],
- examList4Search: [],
- queryExams4SearchLoading: false,
- stuExamSearch: {
- rootOrgId: "",
- examId: "",
- examStageId: "",
- studentCode: "",
- studentName: "",
- orgId: "",
- specialtyName: "",
- courseCode: "",
- courseName: "",
- infoCollector: "",
- identityNumber: "",
- identityNumberLike: false,
- },
- resetPasswordByOrgIdRules: {
- orgId: [
- {
- type: "number",
- required: true,
- message: "请选择学习中心",
- trigger: "change",
- },
- ],
- },
- examStageDisabled4Search: true,
- queryExamStages4SearchLoading: false,
- examStageList4Search: [],
- studentLog: {
- loading: false,
- timeRange: [],
- paginationShow: false,
- formSearch: {
- operate: null,
- studentId: "",
- startTime: null,
- endTime: null,
- },
- tableData: [],
- currentPage: 1,
- pageSize: 10,
- total: 10,
- },
- };
- },
- computed: {
- ...mapState({ user: (state) => state.user }),
- stuIds() {
- var stuIds = "";
- for (let stuId of this.selectedStuIds) {
- if (!stuIds) {
- stuIds += stuId;
- } else {
- stuIds += "," + stuId;
- }
- }
- return stuIds;
- },
- noBatchSelected() {
- return this.selectedStuIds.length === 0;
- },
- isSuperAdmin() {
- return this.user.roleList.some((role) => role.roleCode == "SUPER_ADMIN");
- },
- },
- created() {
- this.init();
- this.uploadHeaders = {
- key: this.user.key,
- token: this.user.token,
- };
- },
- methods: {
- gotoOperateLog(studentId) {
- this.studentLog.formSearch.operate = null;
- this.studentLog.timeRange = [];
- this.studentLog.formSearch.startTime = null;
- this.studentLog.formSearch.endTime = null;
- this.studentLog.formSearch.studentId = studentId;
- this.studentLog.tableData = [];
- this.studentLog.total = 0;
- this.studentLog.currentPage = 1;
- this.stuLogDialog = true;
- this.logsearchForm();
- },
- changeTimeRange(e) {
- if (e && e.length > 0) {
- this.studentLog.formSearch.startTime = e[0];
- this.studentLog.formSearch.endTime = e[1];
- } else {
- this.studentLog.formSearch.startTime = "";
- this.studentLog.formSearch.endTime = "";
- }
- },
- loghandleSearchBtn() {
- this.studentLog.currentPage = 1;
- this.logsearchForm();
- },
- loghandleSizeChange(val) {
- this.studentLog.pageSize = val;
- this.studentLog.currentPage = 1;
- this.logsearchForm();
- },
- loghandleCurrentChange(val) {
- this.studentLog.currentPage = val;
- this.logsearchForm();
- },
- //查询
- logsearchForm() {
- this.studentLog.loading = true;
- var url =
- REPORTS_API +
- "/studentOperate/page/" +
- this.studentLog.currentPage +
- "/" +
- this.studentLog.pageSize;
- this.$httpWithMsg
- .get(url, { params: this.studentLog.formSearch })
- .then((response) => {
- this.studentLog.tableData = response.data.list;
- this.studentLog.total = response.data.total;
- this.studentLog.loading = false;
- this.$nextTick(function () {
- this.studentLog.paginationShow = true;
- });
- })
- .finally(() => (this.studentLog.loading = false));
- },
- resetPasswordByOrgId() {
- this.orgList4RestPassword = [];
- this.resetPasswordByOrgIdForm.orgId = null;
- this.getOrgList4RestPassword("");
- if (this.pureLC) {
- // this.orgList4RestPassword = [
- // { id: this.lc_id, name: this.lc_name, code: this.lc_code },
- // ];
- // this.resetPasswordByOrgIdForm.orgId = this.lc_id;
- }
- this.resetPasswordByOrgIdDialog = true;
- },
- submitResetPasswordByOrgId() {
- this.$refs.resetPasswordByOrgIdForm.validate((valid) => {
- if (valid) {
- var url =
- CORE_API +
- "/student/resetPasswordByOrgId/" +
- this.resetPasswordByOrgIdForm.orgId;
- this.$httpWithMsg.put(url).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "重置密码成功",
- });
- this.searchForm();
- this.resetPasswordByOrgIdDialog = false;
- });
- } else {
- return false;
- }
- });
- },
- rootOrgChanged() {
- this.getOrgList4Search("");
- },
- getOrgList4Search(orgName) {
- this.getOrgList4SearchLoading = true;
- let url =
- CORE_API +
- "/org/query?rootOrgId=" +
- this.formSearch.rootOrgId +
- "&name=" +
- orgName;
- this.$httpWithMsg
- .get(url)
- .then((response) => {
- this.getOrgList4SearchLoading = false;
- this.orgList4Search = response.data;
- })
- .catch((response) => {
- console.log(response);
- this.getOrgList4SearchLoading = false;
- });
- },
- getOrgList4RestPassword(orgName) {
- this.getOrgList4RestPasswordLoading = true;
- let url =
- CORE_API +
- "/org/query?rootOrgId=" +
- this.formSearch.rootOrgId +
- "&name=" +
- orgName;
- this.$httpWithMsg
- .get(url)
- .then((response) => {
- this.getOrgList4RestPasswordLoading = false;
- this.orgList4RestPassword = response.data;
- })
- .catch((response) => {
- console.log(response);
- this.getOrgList4RestPasswordLoading = false;
- });
- },
- queryExams4Search(name) {
- this.queryExams(name, "search");
- },
- queryExams(name, where) {
- console.log("queryExams; name: " + name);
- if ("search" == where) {
- this.queryExams4SearchLoading = true;
- }
- this.$httpWithMsg
- .get(EXAM_WORK_API + "/exam/queryByNameLike?enable=true&name=" + name)
- .then((response) => {
- if ("search" == where) {
- this.queryExams4SearchLoading = false;
- this.examList4Search = response.data;
- }
- })
- .catch(() => {
- if ("search" == where) {
- this.queryExams4SearchLoading = false;
- }
- });
- },
- showStuExamDialog(row) {
- this.stuExamSearch.identityNumber = row.identityNumber;
- this.stuExamSearch.rootOrgId = row.rootOrgId;
- this.stuExamList = [];
- this.stuExamTotal = 0;
- this.queryExams4Search("");
- this.stuExamCurPage = 1;
- this.searchStuExam(this.stuExamCurPage);
- this.stuExamDialog = true;
- },
- searchExamRecord() {
- this.stuExamCurPage = 1;
- this.searchStuExam(this.stuExamCurPage);
- },
- searchStuExam(curPage) {
- this.stuExamSearch.skipRule = true;
- var param = new URLSearchParams(this.stuExamSearch);
- this.stuExamLoading = true;
- var url =
- EXAM_WORK_API +
- "/exam_student/examStudentPage/" +
- (curPage - 1) +
- "/" +
- this.stuExamPageSize +
- "?" +
- param;
- this.$httpWithMsg
- .get(url)
- .then((response) => {
- this.stuExamList = response.data.list;
- this.stuExamTotal = response.data.total;
- this.stuExamLoading = false;
- })
- .catch(function (response) {
- console.log(response);
- this.stuExamLoading = false;
- });
- },
- stuExamCurChange(val) {
- this.stuExamCurPage = val;
- this.searchStuExam(val);
- },
- handleStuExamSizeChange(val) {
- this.stuExamPageSize = val;
- this.searchStuExam(val);
- },
- 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",
- });
- }
- },
- uploadPhoto() {
- this.photoUploadDialog = true;
- this.initUpload();
- },
- selectChange(row) {
- this.selectedStuIds = [];
- row.forEach((element, index) => {
- console.log(index);
- this.selectedStuIds.push(element.id);
- });
- console.log(this.selectedStuIds);
- },
- handleCurrentChange(val) {
- this.currentPage = val;
- this.searchForm();
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.searchForm();
- },
- resetSearchForm() {
- this.formSearch.name = "";
- this.formSearch.studentCode = "";
- this.formSearch.identityNumber = "";
- this.formSearch.enable = "UNDEFINED";
- this.formSearch.hasPhoto = "UNDEFINED";
- if (!this.pureLC) {
- this.formSearch.orgId = "";
- }
- },
- resetPageAndSearchForm() {
- this.currentPage = 1;
- this.searchForm();
- },
- //查询方法
- searchForm() {
- var param = new URLSearchParams(this.formSearch);
- var url =
- CORE_API +
- "/student/studentPage/" +
- (this.currentPage - 1) +
- "/" +
- this.pageSize +
- "?" +
- param;
- this.$httpWithMsg.get(url).then((response) => {
- this.tableData = response.data.list;
- this.total = response.data.total;
- });
- },
- exportStudent() {
- var param = new URLSearchParams(this.formSearch);
- window.open(
- CORE_API +
- "/student/export?$key=" +
- this.user.key +
- "&$token=" +
- this.user.token +
- "&" +
- param
- );
- },
- checkIds(row) {
- if (row) {
- return row.id;
- } else {
- if (this.stuIds.length == 0) {
- this.$notify({
- type: "warning",
- message: "请选择学生",
- });
- return "";
- } else {
- return this.stuIds;
- }
- }
- },
- showUnbindStudentCode(row) {
- this.unbindStudentCodeData.tableData = [];
- for (let cur of row.studentCodeList) {
- this.unbindStudentCodeData.tableData.push({
- studentCode: cur,
- rootOrgId: row.rootOrgId,
- name: row.name,
- identityNumber: row.identityNumber,
- });
- }
- this.unbindStudentCodeDialog = true;
- },
- unbindStudentCode(row) {
- var params = new URLSearchParams({
- studentCode: row.studentCode,
- rootOrgId: row.rootOrgId,
- });
- this.$confirm("是否解绑学号?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- var url = CORE_API + "/student/unbindStudentCode?" + params;
- this.$httpWithMsg.post(url).then((response) => {
- console.log(response);
- let newTableData = [];
- for (let cur of this.unbindStudentCodeData.tableData) {
- if (row.studentCode != cur.studentCode) {
- newTableData.push(cur);
- }
- }
- this.unbindStudentCodeData.tableData = newTableData;
- this.$notify({
- type: "success",
- message: "解绑成功",
- });
- this.searchForm();
- });
- });
- },
- unbindSecurityPhone(row) {
- var stuIds = this.checkIds(row);
- if (!stuIds) return;
- this.$confirm("是否解绑安全手机号?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- var url = CORE_API + "/student/unbindSecurityPhone/" + stuIds;
- this.$httpWithMsg.put(url).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "解绑成功",
- });
- this.searchForm();
- });
- });
- },
- //重置密码方法
- resetPassword(row) {
- var stuIds = this.checkIds(row);
- if (!stuIds) return;
- this.$confirm("是否重置所选学生的密码?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- var url = CORE_API + "/student/resetPass/" + stuIds;
- this.$httpWithMsg.put(url).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "重置密码成功",
- });
- this.searchForm();
- });
- });
- },
- //禁用
- disableStudent(row) {
- var stuIds = this.checkIds(row);
- if (!stuIds) return;
- this.$confirm("是否禁用所选学生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- var url = CORE_API + "/student/disable/" + stuIds;
- this.$httpWithMsg.put(url).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "禁用成功",
- });
- this.searchForm();
- });
- });
- },
- //启用
- enableStudent(row) {
- var stuIds = this.checkIds(row);
- if (!stuIds) return;
- this.$confirm("是否启用所选学生?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }).then(() => {
- var url = CORE_API + "/student/enable/" + stuIds;
- this.$httpWithMsg.put(url).then((response) => {
- console.log(response);
- this.$notify({
- type: "success",
- message: "启用成功",
- });
- this.searchForm();
- });
- });
- },
- 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(response);
- console.log(file);
- console.log(fileList);
- this.$notify({
- message: "上传成功",
- type: "success",
- });
- this.fileLoading = false;
- this.photoUploadDialog = false;
- this.searchForm();
- },
- uploadError(response, file, fileList) {
- 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() {
- this.fileList = [];
- },
- checkUpload() {
- 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) {
- let f = file.name.toLowerCase();
- if (!f.endsWith(".jpg") && !f.endsWith(".png")) {
- this.$notify({
- message: "上传文件必须为jpg或者png格式",
- 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();
- },
- initPrivileges() {
- let params = new URLSearchParams();
- params.append(
- "privilegeCodes",
- Object.keys(this.rolePrivileges).toString()
- );
- let url = CORE_API + "/rolePrivilege/checkPrivileges?" + params;
- this.$httpWithMsg.post(url).then((response) => {
- this.rolePrivileges = response.data;
- });
- },
- async init() {
- this.initPrivileges();
- 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.formSearch.rootOrgId = this.user.rootOrgId;
- this.getOrgList4Search("");
- if (this.pureLC) {
- let url = CORE_API + "/user/" + this.user.userId;
- await 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.formSearch.orgId = this.lc_id;
- });
- }
- let url = CORE_API + "/org/getRootOrgList";
- this.$httpWithMsg.get(url).then((response) => {
- this.rootOrgList = response.data;
- });
- this.searchForm();
- },
- handleExamChange4Search(value) {
- this.stuExamSearch.examStageId = "";
- if (this.examList4Search.length > 0) {
- let examArr = this.examList4Search.filter((p) => p.id == value);
- if (examArr && examArr.length > 0) {
- let exam = examArr[0];
- if (
- exam.specialSettingsEnabled &&
- exam.specialSettingsType == "STAGE_BASED"
- ) {
- this.examStageDisabled4Search = false;
- this.queryExamStages4Search("");
- } else {
- this.examStageList4Search = [];
- this.examStageDisabled4Search = true;
- }
- }
- }
- },
- queryExamStages4Search(name) {
- this.queryExamStages(this.stuExamSearch.examId, name, "search");
- },
- queryExamStages(examId, name, where) {
- console.log("queryExams; name: " + name);
- this.$httpWithMsg
- .get(
- EXAM_WORK_API +
- "/examStage/queryByNameLike?examId=" +
- examId +
- "&enable=true&name=" +
- name
- )
- .then((response) => {
- if ("search" == where) {
- this.queryExamStages4SearchLoading = false;
- this.examStageList4Search = response.data;
- } else if ("insertOrUpdate" == where) {
- this.queryExamStages4InsertOrUpdateLoading = false;
- this.examStageList4InsertOrUpdate = response.data;
- }
- })
- .catch((response) => {
- console.log(response);
- if ("search" == where) {
- this.queryExamStages4SearchLoading = false;
- } else if ("insertOrUpdate" == where) {
- this.queryExamStages4InsertOrUpdateLoading = false;
- }
- });
- },
- },
- };
- </script>
- <style scoped>
- .input {
- width: 180px;
- }
- </style>
|