|
|
|
@ -1,9 +1,11 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="flex"> |
|
|
|
|
<div class="page" style="width: 320px"> |
|
|
|
|
<div class="page" |
|
|
|
|
style="width: 320px"> |
|
|
|
|
<div class="m-b-20"> |
|
|
|
|
<h6 class="p-title">学生</h6> |
|
|
|
|
<el-radio-group v-model="studentType" @change="changeStudentType"> |
|
|
|
|
<el-radio-group v-model="studentType" |
|
|
|
|
@change="changeStudentType"> |
|
|
|
|
<div class="m-b-20"> |
|
|
|
|
<el-radio :label="1">所有学生</el-radio> |
|
|
|
|
</div> |
|
|
|
@ -15,13 +17,15 @@ |
|
|
|
|
<el-divider></el-divider> |
|
|
|
|
<div> |
|
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
|
<h6 class="p-title" style="margin-bottom: 0">学生组织架构</h6> |
|
|
|
|
<el-button v-auth="'学生组织架构添加'" type="text" @click="handleAdd">添加</el-button> |
|
|
|
|
<h6 class="p-title" |
|
|
|
|
style="margin-bottom: 0">学生组织架构</h6> |
|
|
|
|
<el-button v-auth="'学生组织架构添加'" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleAdd">添加</el-button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div style="height: 504px; max-height: 504px; overflow: auto"> |
|
|
|
|
<org-tree |
|
|
|
|
v-if="treeVisible" |
|
|
|
|
<org-tree v-if="treeVisible" |
|
|
|
|
default-expand-all |
|
|
|
|
ref="orgTree" |
|
|
|
|
node-key="id" |
|
|
|
@ -31,19 +35,18 @@ |
|
|
|
|
:expand-on-click-node="false" |
|
|
|
|
@node-click="handleNodeClick" |
|
|
|
|
:current-node-key="architectureId" |
|
|
|
|
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}" |
|
|
|
|
> |
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
|
<span class="name" :title="node.label">{{ node.label }}</span> |
|
|
|
|
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"> |
|
|
|
|
<span class="custom-tree-node" |
|
|
|
|
slot-scope="{ node, data }"> |
|
|
|
|
<span class="name" |
|
|
|
|
:title="node.label">{{ node.label }}</span> |
|
|
|
|
<span> |
|
|
|
|
<el-button |
|
|
|
|
v-auth="'学生组织架构编辑'" |
|
|
|
|
<el-button v-auth="'学生组织架构编辑'" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit-outline" |
|
|
|
|
@click="() => handleEdit(node, data)"> |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-auth="'学生组织架构添加'" |
|
|
|
|
<el-button v-auth="'学生组织架构添加'" |
|
|
|
|
v-if="node.level < 3" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-circle-plus-outline" |
|
|
|
@ -55,34 +58,42 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
:title="orgTitle" |
|
|
|
|
<el-dialog :title="orgTitle" |
|
|
|
|
:visible.sync="orgVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
width="50%" |
|
|
|
|
@close="handleClose" |
|
|
|
|
> |
|
|
|
|
<el-form v-if="orgVisible" ref="orgForm" :model="orgForm" :rules="rules" label-width="100px"> |
|
|
|
|
<el-form-item :label="labelName" prop="organizationName"> |
|
|
|
|
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input> |
|
|
|
|
@close="handleClose"> |
|
|
|
|
<el-form v-if="orgVisible" |
|
|
|
|
ref="orgForm" |
|
|
|
|
:model="orgForm" |
|
|
|
|
:rules="rules" |
|
|
|
|
label-width="100px"> |
|
|
|
|
<el-form-item :label="labelName" |
|
|
|
|
prop="organizationName"> |
|
|
|
|
<el-input v-model.trim="orgForm.organizationName" |
|
|
|
|
placeholder="请输入"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="上级部门"> |
|
|
|
|
<el-cascader |
|
|
|
|
v-if="showCascader" |
|
|
|
|
<el-cascader v-if="showCascader" |
|
|
|
|
v-model="cascaderValue" |
|
|
|
|
:props="cascaderProps" |
|
|
|
|
@change="handleChangeCascader" |
|
|
|
|
clearable |
|
|
|
|
style="width: 100%" |
|
|
|
|
> |
|
|
|
|
style="width: 100%"> |
|
|
|
|
</el-cascader> |
|
|
|
|
<span v-else>{{ orgForm.parentName }}</span> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button v-if="isAddOrg" @click="handleClose">取 消</el-button> |
|
|
|
|
<el-button v-if="!isAddOrg" type="danger" plain @click="handleDel">删除</el-button> |
|
|
|
|
<el-button type="primary" @click="orgSubmit">确 定</el-button> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button v-if="isAddOrg" |
|
|
|
|
@click="handleClose">取 消</el-button> |
|
|
|
|
<el-button v-if="!isAddOrg" |
|
|
|
|
type="danger" |
|
|
|
|
plain |
|
|
|
|
@click="handleDel">删除</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="orgSubmit">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
@ -92,91 +103,160 @@ |
|
|
|
|
<div class="tool"> |
|
|
|
|
<ul class="filter"> |
|
|
|
|
<li> |
|
|
|
|
<el-input style="width: 250px;" placeholder="请输入学生姓名/学号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input> |
|
|
|
|
<el-input style="width: 250px;" |
|
|
|
|
placeholder="请输入学生姓名/学号" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model="keyWord" |
|
|
|
|
clearable></el-input> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="info" v-auth @click="addStudent">新增学生</el-button> |
|
|
|
|
<el-button type="primary" v-auth @click="batchImport">批量导入</el-button> |
|
|
|
|
<el-button type="primary" v-auth @click="delAllSelection">批量删除</el-button> |
|
|
|
|
<el-button type="info" |
|
|
|
|
v-auth |
|
|
|
|
@click="addStudent">新增学生</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
v-auth |
|
|
|
|
@click="batchImport">批量导入</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
v-auth |
|
|
|
|
@click="delAllSelection">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" label="学生姓名" align="center" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" label="学生学号" align="center" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="className" label="班级" align="center" min-width="200" show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="countries" label="账号角色" align="center" width="100"> |
|
|
|
|
<el-table :data="listData" |
|
|
|
|
class="table" |
|
|
|
|
ref="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
:row-key="getRowKeys"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="55" |
|
|
|
|
align="center" |
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="userName" |
|
|
|
|
label="学生姓名" |
|
|
|
|
align="center" |
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="workNumber" |
|
|
|
|
label="学生学号" |
|
|
|
|
align="center" |
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="className" |
|
|
|
|
label="班级" |
|
|
|
|
align="center" |
|
|
|
|
min-width="200" |
|
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="countries" |
|
|
|
|
label="账号角色" |
|
|
|
|
align="center" |
|
|
|
|
width="100"> |
|
|
|
|
<template slot-scope="scope">学生</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="loginNumber" label="登录次数" align="center" width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center" width="180"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="300"> |
|
|
|
|
<el-table-column prop="loginNumber" |
|
|
|
|
label="登录次数" |
|
|
|
|
align="center" |
|
|
|
|
width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="lastLoginTime" |
|
|
|
|
label="上次登录时间" |
|
|
|
|
align="center" |
|
|
|
|
width="180"></el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="300"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button v-auth v-if="isRemove" type="text" @click="removeStudent(scope.row)">移除</el-button> |
|
|
|
|
<el-button v-auth type="text" @click="editStudent(scope.row,true)">查看</el-button> |
|
|
|
|
<el-button v-auth type="text" @click="editStudent(scope.row,false)">编辑</el-button> |
|
|
|
|
<el-button v-auth type="text" @click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
|
<el-button v-auth type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
<el-switch |
|
|
|
|
v-auth="'禁用'" |
|
|
|
|
<el-button v-auth |
|
|
|
|
v-if="isRemove" |
|
|
|
|
type="text" |
|
|
|
|
@click="removeStudent(scope.row)">移除</el-button> |
|
|
|
|
<el-button v-auth |
|
|
|
|
type="text" |
|
|
|
|
@click="editStudent(scope.row,true)">查看</el-button> |
|
|
|
|
<el-button v-auth |
|
|
|
|
type="text" |
|
|
|
|
@click="editStudent(scope.row,false)">编辑</el-button> |
|
|
|
|
<el-button v-auth |
|
|
|
|
type="text" |
|
|
|
|
@click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
|
<el-button v-auth |
|
|
|
|
type="text" |
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
<el-switch v-auth="'禁用'" |
|
|
|
|
v-model="scope.row.isEnable" |
|
|
|
|
:active-value="1" |
|
|
|
|
:inactive-value="0" |
|
|
|
|
style="margin: 0 5px" |
|
|
|
|
@change="switchOff(scope.row)" |
|
|
|
|
></el-switch> |
|
|
|
|
@change="switchOff(scope.row)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
|
<el-pagination background |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
:current-page="page" |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
:total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
class="dialog" |
|
|
|
|
<el-dialog class="dialog" |
|
|
|
|
width="60%" |
|
|
|
|
:title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" |
|
|
|
|
:visible.sync="studentVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
@close="closeStudent" |
|
|
|
|
> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" :disabled="isDetail" label-width="100px"> |
|
|
|
|
@close="closeStudent"> |
|
|
|
|
<el-form ref="form" |
|
|
|
|
:model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
:disabled="isDetail" |
|
|
|
|
label-width="100px"> |
|
|
|
|
<el-row :gutter="20"> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item prop="workNumber" label="学生学号"> |
|
|
|
|
<el-input v-model="form.workNumber" placeholder="学生学号" @blur="workNumberChange"></el-input> |
|
|
|
|
<el-form-item prop="workNumber" |
|
|
|
|
label="学生学号"> |
|
|
|
|
<el-input v-model="form.workNumber" |
|
|
|
|
placeholder="学生学号" |
|
|
|
|
@blur="workNumberChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="userName" label="学生姓名"> |
|
|
|
|
<el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input> |
|
|
|
|
<el-form-item prop="userName" |
|
|
|
|
label="学生姓名"> |
|
|
|
|
<el-input v-model="form.userName" |
|
|
|
|
placeholder="请输入学生姓名"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="roleId" label="账号角色"> |
|
|
|
|
<el-form-item prop="roleId" |
|
|
|
|
label="账号角色"> |
|
|
|
|
学生 |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item prop="phone" label="手机号"> |
|
|
|
|
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11"></el-input> |
|
|
|
|
<el-form-item prop="phone" |
|
|
|
|
label="手机号"> |
|
|
|
|
<el-input v-model="form.phone" |
|
|
|
|
placeholder="可用于登录平台,以及找回密码" |
|
|
|
|
maxlength="11"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="email" label="邮箱"> |
|
|
|
|
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码"></el-input> |
|
|
|
|
<el-form-item prop="email" |
|
|
|
|
label="邮箱"> |
|
|
|
|
<el-input v-model="form.email" |
|
|
|
|
placeholder="可用于登录平台,以及找回密码"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="uniqueIdentification" label="唯一标识"> |
|
|
|
|
<el-input disabled v-model="form.uniqueIdentification"></el-input> |
|
|
|
|
<el-form-item prop="uniqueIdentification" |
|
|
|
|
label="唯一标识"> |
|
|
|
|
<el-input disabled |
|
|
|
|
v-model="form.uniqueIdentification"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="10"> |
|
|
|
|
<el-form-item prop="classId" label="所在班级"> |
|
|
|
|
<el-input |
|
|
|
|
placeholder="输入关键字进行过滤" |
|
|
|
|
<el-form-item prop="classId" |
|
|
|
|
label="所在班级"> |
|
|
|
|
<el-input placeholder="输入关键字进行过滤" |
|
|
|
|
v-model="filterText" |
|
|
|
|
style="margin-bottom: 10px" |
|
|
|
|
> |
|
|
|
|
style="margin-bottom: 10px"> |
|
|
|
|
</el-input> |
|
|
|
|
<div style="max-height: 245px; border: 1px solid #DCDFE6; border-radius: 4px; padding: 10px 10px 10px 0px; overflow: auto"> |
|
|
|
|
<org-tree |
|
|
|
|
v-if="showTree && treeVisible" |
|
|
|
|
<org-tree v-if="showTree && treeVisible" |
|
|
|
|
ref="classTree" |
|
|
|
|
show-checkbox |
|
|
|
|
node-key="id" |
|
|
|
@ -186,13 +266,12 @@ |
|
|
|
|
:load="loadClassTree" |
|
|
|
|
:default-checked-keys="defaultCheckedKeys" |
|
|
|
|
:filter-node-method="filterNode" |
|
|
|
|
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}" |
|
|
|
|
> |
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
|
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"> |
|
|
|
|
<span class="custom-tree-node" |
|
|
|
|
slot-scope="{ node, data }"> |
|
|
|
|
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span> |
|
|
|
|
<span> |
|
|
|
|
<el-button |
|
|
|
|
v-auth="'学生组织架构添加'" |
|
|
|
|
<el-button v-auth="'学生组织架构添加'" |
|
|
|
|
v-if="node.level < 3" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-circle-plus-outline" |
|
|
|
@ -207,20 +286,31 @@ |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form> |
|
|
|
|
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
|
|
|
|
<el-button type="primary" :disabled="disableds" @click="saveData(0)">保存</el-button> |
|
|
|
|
<el-button v-if="isAdd" type="primary" :disabled="disableds" @click="saveData(1)">保存并继续添加</el-button> |
|
|
|
|
<el-button size="small" @click="closeStudent">取消</el-button> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer" |
|
|
|
|
v-if="!isDetail"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
:disabled="disableds" |
|
|
|
|
@click="saveData(0)">保存</el-button> |
|
|
|
|
<el-button v-if="isAdd" |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="disableds" |
|
|
|
|
@click="saveData(1)">保存并继续添加</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="closeStudent">取消</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog title="批量导入" |
|
|
|
|
:visible.sync="importVisible" |
|
|
|
|
width="24%" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
|
<el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-upload |
|
|
|
|
name="file" |
|
|
|
|
<el-upload name="file" |
|
|
|
|
accept=".xls,.xlsx" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-error="uploadError" |
|
|
|
@ -230,15 +320,21 @@ |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:action="this.api.importStudent" |
|
|
|
|
:file-list="uploadList" |
|
|
|
|
:headers="headers" |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
|
<el-link v-if="uploadFaild" |
|
|
|
|
type="primary" |
|
|
|
|
@click="showFaild">部分数据导入失败,查看失败原因</el-link> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button size="small" @click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
|
|
|
|
<span slot="footer" |
|
|
|
|
class="dialog-footer"> |
|
|
|
|
<el-button size="small" |
|
|
|
|
@click="importVisible = false">取 消</el-button> |
|
|
|
|
<el-button size="small" |
|
|
|
|
type="primary" |
|
|
|
|
@click="uploadSure">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
@ -252,7 +348,7 @@ import OrgTree from "@/components/org-tree/src/tree"; |
|
|
|
|
import { mapState } from "vuex"; |
|
|
|
|
export default { |
|
|
|
|
components: { OrgTree }, |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
let that = this; |
|
|
|
|
return { |
|
|
|
|
isRemove: false, // 是否可以移除 |
|
|
|
@ -275,7 +371,7 @@ export default { |
|
|
|
|
label: "organizationName", |
|
|
|
|
value: "id", |
|
|
|
|
lazy: true, |
|
|
|
|
lazyLoad(node, resolve) { |
|
|
|
|
lazyLoad (node, resolve) { |
|
|
|
|
console.log(55, that.cascaderValue) |
|
|
|
|
let level = 1; |
|
|
|
|
let parentId = ""; |
|
|
|
@ -366,7 +462,7 @@ export default { |
|
|
|
|
headers: { |
|
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
|
|
}, |
|
|
|
|
disableds:false, |
|
|
|
|
disableds: false, |
|
|
|
|
submiting: false // 新增编辑防抖标识 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
@ -375,12 +471,12 @@ export default { |
|
|
|
|
'schoolId' |
|
|
|
|
]) |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
mounted () { |
|
|
|
|
this.originForm = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
keyWord: function(val) { |
|
|
|
|
keyWord: function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
if (this.studentType) { |
|
|
|
@ -391,12 +487,12 @@ export default { |
|
|
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
}, |
|
|
|
|
filterText(val) { |
|
|
|
|
filterText (val) { |
|
|
|
|
this.$refs.classTree.filter(val); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
handleNodeClick(data) { // 点击树节点查询列表数据 |
|
|
|
|
handleNodeClick (data) { // 点击树节点查询列表数据 |
|
|
|
|
if (data.level === 3) { |
|
|
|
|
this.isRemove = true; |
|
|
|
|
this.currentClassId = data.id; |
|
|
|
@ -410,7 +506,7 @@ export default { |
|
|
|
|
this.orgLevel = data.level; |
|
|
|
|
util.debounce(this.getOrgStudentData(), 1000); |
|
|
|
|
}, |
|
|
|
|
handleAdd(node, data) { // 添加部门 |
|
|
|
|
handleAdd (node, data) { // 添加部门 |
|
|
|
|
this.orgVisible = true; |
|
|
|
|
this.orgTitle = "新增"; |
|
|
|
|
this.isAddOrg = true; |
|
|
|
@ -437,7 +533,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取一共有多少级子级 |
|
|
|
|
getDeep(data) { |
|
|
|
|
getDeep (data) { |
|
|
|
|
let list = data |
|
|
|
|
let level = 1 |
|
|
|
|
while (list.childNodes.length) { |
|
|
|
@ -446,7 +542,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
return level |
|
|
|
|
}, |
|
|
|
|
handleEdit(node, data) { // 编辑部门 |
|
|
|
|
handleEdit (node, data) { // 编辑部门 |
|
|
|
|
this.orgVisible = true; |
|
|
|
|
this.orgForm = data; |
|
|
|
|
this.orgTitle = "编辑"; |
|
|
|
@ -465,11 +561,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.cascaderLevel = this.getDeep(node) |
|
|
|
|
}, |
|
|
|
|
handleChangeCascader(value) { |
|
|
|
|
handleChangeCascader (value) { |
|
|
|
|
// console.log(JSON.stringify(value)); |
|
|
|
|
// console.log(JSON.stringify(this.cascaderValue)); |
|
|
|
|
}, |
|
|
|
|
handleDel() { // 删除部门 |
|
|
|
|
handleDel () { // 删除部门 |
|
|
|
|
let { level, id } = this.orgForm; |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
@ -483,7 +579,7 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
orgSubmit() { // 提交组织架构新增/编辑 |
|
|
|
|
orgSubmit () { // 提交组织架构新增/编辑 |
|
|
|
|
this.$refs.orgForm.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
const cas = this.cascaderValue |
|
|
|
@ -515,7 +611,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleRefresh() { // 刷新树节点 |
|
|
|
|
handleRefresh () { // 刷新树节点 |
|
|
|
|
this.treeVisible = false; |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.treeVisible = true; |
|
|
|
@ -523,7 +619,7 @@ export default { |
|
|
|
|
this.treeNode.childNodes.splice(0); |
|
|
|
|
this.loadNodeTree(this.treeNode, this.treeResolve); |
|
|
|
|
}, |
|
|
|
|
handleClose() { // 关闭 |
|
|
|
|
handleClose () { // 关闭 |
|
|
|
|
this.orgVisible = false; |
|
|
|
|
this.showCascader = true; |
|
|
|
|
this.cascaderValue = []; |
|
|
|
@ -531,7 +627,7 @@ export default { |
|
|
|
|
organizationName: "" |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
loadNodeTree(node, resolve) { // 懒加载树结构 |
|
|
|
|
loadNodeTree (node, resolve) { // 懒加载树结构 |
|
|
|
|
let level = 1; |
|
|
|
|
let parentId = ""; |
|
|
|
|
if (node.level === 0) { |
|
|
|
@ -546,7 +642,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getOrgTreeData(resolve, level, parentId, ids) { // 获取组织架构树数据 |
|
|
|
|
getOrgTreeData (resolve, level, parentId, ids) { // 获取组织架构树数据 |
|
|
|
|
this.$post(`${this.api.stuOrganizationTree}?level=${level}&parentId=${parentId}`).then(res => { |
|
|
|
|
let { status, treeList } = res; |
|
|
|
|
if (status === 200 && treeList.length) { |
|
|
|
@ -567,7 +663,7 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getOrgStudentData() { // 根据组织架构筛选学生列表 |
|
|
|
|
getOrgStudentData () { // 根据组织架构筛选学生列表 |
|
|
|
|
let params = { |
|
|
|
|
architectureId: this.architectureId, |
|
|
|
|
level: this.orgLevel, |
|
|
|
@ -581,7 +677,7 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getData() { // 学生列表 |
|
|
|
|
getData () { // 学生列表 |
|
|
|
|
let data = { |
|
|
|
|
type: this.studentType, |
|
|
|
|
keyWord: this.keyWord, |
|
|
|
@ -594,7 +690,7 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
currentChange(val) { // 切换页码 |
|
|
|
|
currentChange (val) { // 切换页码 |
|
|
|
|
this.page = val; |
|
|
|
|
if (this.studentType) { |
|
|
|
|
this.getData(); |
|
|
|
@ -602,22 +698,23 @@ export default { |
|
|
|
|
this.getOrgStudentData(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getRowKeys(row) { // 表格key |
|
|
|
|
getRowKeys (row) { // 表格key |
|
|
|
|
return row.accountId; |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val) { // 多选 |
|
|
|
|
handleSelectionChange (val) { // 多选 |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
changeStudentType() { |
|
|
|
|
changeStudentType () { |
|
|
|
|
this.$refs.orgTree.setCurrentKey(null) |
|
|
|
|
this.isRemove = false; |
|
|
|
|
this.initData(); |
|
|
|
|
}, |
|
|
|
|
initData() { |
|
|
|
|
initData () { |
|
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
delAllSelection() { // 批量删除 |
|
|
|
|
delAllSelection () { // 批量删除 |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.$confirm("确定要删除选中用户吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
@ -636,7 +733,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
if(this.multipleSelection.length === this.listData.length && this.page>1) { |
|
|
|
|
if (this.multipleSelection.length === this.listData.length && this.page > 1) { |
|
|
|
|
this.handleCurrentChange(this.page - 1) |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
@ -645,7 +742,7 @@ export default { |
|
|
|
|
util.errorMsg("请先选择数据 !"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleDelete(row) { // 删除 |
|
|
|
|
handleDelete (row) { // 删除 |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
@ -661,7 +758,7 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
removeStudent(row) { // 移除 |
|
|
|
|
removeStudent (row) { // 移除 |
|
|
|
|
this.$confirm("确定要移除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
@ -677,7 +774,7 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
resetPassword(row) { // 重置密码 |
|
|
|
|
resetPassword (row) { // 重置密码 |
|
|
|
|
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { |
|
|
|
|
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => { |
|
|
|
|
util.successMsg("重置成功"); |
|
|
|
@ -686,7 +783,7 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
switchOff(row) { // 更新状态 |
|
|
|
|
switchOff (row) { // 更新状态 |
|
|
|
|
let isEnable = row.isEnable === 0 ? 0 : 1; |
|
|
|
|
this.$get(`${this.api.updateAccountEnable}?id=${row.accountId}&isEnable=${isEnable}`).then(res => { |
|
|
|
|
util.successMsg("更新状态成功"); |
|
|
|
@ -698,12 +795,12 @@ export default { |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
addStudent() { // 添加学生 |
|
|
|
|
addStudent () { // 添加学生 |
|
|
|
|
this.isAdd = true; |
|
|
|
|
this.showTree = true; |
|
|
|
|
this.studentVisible = true; |
|
|
|
|
}, |
|
|
|
|
editStudent(row, isDetail) { // 编辑/查看 |
|
|
|
|
editStudent (row, isDetail) { // 编辑/查看 |
|
|
|
|
this.isAdd = false; |
|
|
|
|
this.isDetail = isDetail; |
|
|
|
|
this.showTree = false; |
|
|
|
@ -711,15 +808,15 @@ export default { |
|
|
|
|
this.$post(`${this.api.getStudentInfoByAccountId}?stuAccountId=${row.accountId}`).then(res => { |
|
|
|
|
this.form = res.data; |
|
|
|
|
this.showTree = true; |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}, |
|
|
|
|
// 组合账号 |
|
|
|
|
renderAccount() { |
|
|
|
|
renderAccount () { |
|
|
|
|
const form = this.form |
|
|
|
|
// 平台id-端id-schoolId-workNumber组成账号 |
|
|
|
|
form.account = `${Setting.platformId}-1-${this.schoolId}-${form.workNumber}` |
|
|
|
|
}, |
|
|
|
|
workNumberChange() { |
|
|
|
|
workNumberChange () { |
|
|
|
|
const form = this.form |
|
|
|
|
const { workNumber } = form |
|
|
|
|
// 只有输入了学号并且是新增才需要根据学号查询其他信息 |
|
|
|
@ -745,12 +842,12 @@ export default { |
|
|
|
|
this.renderAccount() |
|
|
|
|
this.$refs.classTree.setCheckedKeys([]) |
|
|
|
|
} |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else { |
|
|
|
|
this.renderAccount() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
phoneChange() { |
|
|
|
|
phoneChange () { |
|
|
|
|
let regex = /^1[3456789]\d{9}$/; |
|
|
|
|
if (regex.test(this.form.phone)) { |
|
|
|
|
let url = ""; |
|
|
|
@ -770,7 +867,7 @@ export default { |
|
|
|
|
this.phoneRepeat = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
emailChange() { |
|
|
|
|
emailChange () { |
|
|
|
|
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; |
|
|
|
|
if (regex.test(this.form.email)) { |
|
|
|
|
let url = ""; |
|
|
|
@ -790,11 +887,11 @@ export default { |
|
|
|
|
this.emailRepeat = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
filterNode(value, data) { |
|
|
|
|
filterNode (value, data) { |
|
|
|
|
if (!value) return true; |
|
|
|
|
return data.organizationName.indexOf(value) !== -1; |
|
|
|
|
}, |
|
|
|
|
loadClassTree(node, resolve) { // 懒加载所在班级树结构 |
|
|
|
|
loadClassTree (node, resolve) { // 懒加载所在班级树结构 |
|
|
|
|
let level = 1; |
|
|
|
|
let parentId = ""; |
|
|
|
|
if (node.level === 0) { |
|
|
|
@ -809,7 +906,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getClassTreeData(resolve, level, parentId) { // 获取组织架构树数据 |
|
|
|
|
getClassTreeData (resolve, level, parentId) { // 获取组织架构树数据 |
|
|
|
|
this.$post(`${this.api.stuOrganizationTree}?level=${level}&parentId=${parentId}`).then(res => { |
|
|
|
|
let { status, treeList } = res; |
|
|
|
|
if (status === 200 && treeList.length) { |
|
|
|
@ -837,7 +934,7 @@ export default { |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
saveData(type) { // 提交新增/编辑学生 |
|
|
|
|
saveData (type) { // 提交新增/编辑学生 |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.submiting) return false |
|
|
|
@ -904,12 +1001,12 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 判重重置 |
|
|
|
|
resetRepeat() { |
|
|
|
|
resetRepeat () { |
|
|
|
|
this.workNumberReapeat = false |
|
|
|
|
this.phoneRepeat = false |
|
|
|
|
this.emailRepeat = false |
|
|
|
|
}, |
|
|
|
|
resetStudent() { // 重置新增学生对话框 |
|
|
|
|
resetStudent () { // 重置新增学生对话框 |
|
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
|
this.form = { |
|
|
|
|
userName: "", |
|
|
|
@ -928,7 +1025,7 @@ export default { |
|
|
|
|
this.getOrgStudentData(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
closeStudent() { // 关闭新增学生对话框 |
|
|
|
|
closeStudent () { // 关闭新增学生对话框 |
|
|
|
|
this.$refs.form.clearValidate(); |
|
|
|
|
this.form = { |
|
|
|
|
userName: "", |
|
|
|
@ -945,23 +1042,23 @@ export default { |
|
|
|
|
this.studentVisible = false; |
|
|
|
|
this.resetRepeat() |
|
|
|
|
}, |
|
|
|
|
batchImport() { // 批量导入 |
|
|
|
|
batchImport () { // 批量导入 |
|
|
|
|
this.importVisible = true; |
|
|
|
|
this.uploadList = []; |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
}, |
|
|
|
|
downLoad() { // 模板下载 |
|
|
|
|
downLoad () { // 模板下载 |
|
|
|
|
location.href = this.api.studentTemplate; |
|
|
|
|
}, |
|
|
|
|
handleExceed(files, fileList) { // 上传文件 |
|
|
|
|
handleExceed (files, fileList) { // 上传文件 |
|
|
|
|
util.warningMsg( |
|
|
|
|
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
showFaild() { // 下载失败文件 |
|
|
|
|
showFaild () { // 下载失败文件 |
|
|
|
|
location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}`; |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
uploadSuccess (res, file, fileList) { |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
if (res.data.exportCode) { |
|
|
|
@ -972,26 +1069,26 @@ export default { |
|
|
|
|
this.handleRefresh(); |
|
|
|
|
util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`); |
|
|
|
|
|
|
|
|
|
this.getClassTreeData('','1','') |
|
|
|
|
this.getClassTreeData('', '1', '') |
|
|
|
|
} else { |
|
|
|
|
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
uploadError(err, file, fileList) { |
|
|
|
|
uploadError (err, file, fileList) { |
|
|
|
|
this.$message({ |
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
type: "error", |
|
|
|
|
center: true |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
}, |
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
handleRemove (file, fileList) { |
|
|
|
|
this.uploadList = fileList; |
|
|
|
|
this.uploadFaild = false; |
|
|
|
|
}, |
|
|
|
|
uploadSure() { |
|
|
|
|
uploadSure () { |
|
|
|
|
this.importVisible = false; |
|
|
|
|
this.studentType = 1; |
|
|
|
|
this.keyWord = ""; |
|
|
|
|