blob: 510b42cb64e725334c50d30ee409a4ce187de9e1 [file] [log] [blame]
<template>
<div class="app-container">
<div class="filter-container">
<el-row :gutter="20">
<el-col :span="4">
<el-select clearable class="filter-item" v-model="listQuery.leaveSchoolBatch" placeholder="批次名称">
<el-option v-for="item in pagedata.leaveSchoolBatchList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="学号" v-model="listQuery.studentNumber">
</el-input>
</el-col>
<el-col :span="4">
<el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="姓名" v-model="listQuery.name">
</el-input>
</el-col>
<el-col :span="4">
<el-select clearable class="filter-item" v-model="listQuery.allowedLeave" placeholder="是否准予离校">
<el-option label="准予" value="1"></el-option>
<el-option label="不准予" value="0"></el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查询</el-button>
<el-button class="filter-item" style="margin-left: 10px;" @click="handleReset" type="primary" icon="el-icon-edit">重置</el-button>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="4">
<el-select clearable @change="initMajorList" class="filter-item" v-model="listQuery.department" placeholder="院系">
<el-option v-for="item in pagedata.departmentList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select clearable @change="initBjList" class="filter-item" v-model="listQuery.major" placeholder="专业">
<el-option v-for="item in majorList" :key="item.id" :label="item.zymc" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select clearable class="filter-item" v-model="listQuery.clazz" placeholder="班级">
<el-option v-for="item in clazzList" :key="item.id" :label="item.bjmc" :value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select clearable class="filter-item" v-model="listQuery.studentType" placeholder="学生类别">
<el-option v-for="item in pagedata.studentTypeList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-col>
</el-row>
</div>
<el-table :height="height" :data="items" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
<el-table-column align="center" type="index" label='序号' width="95">
</el-table-column>
<el-table-column label="学号" align="center">
<template slot-scope="scope">
{{scope.row.studentNumber}}
</template>
</el-table-column>
<el-table-column label="姓名" align="center">
<template slot-scope="scope">
<a href="javascript:void(0);" @click="showTrace(scope.row)">{{scope.row.name}}</a>
</template>
</el-table-column>
<el-table-column label="院系" align="center">
<template slot-scope="scope">
{{scope.row.department}}
</template>
</el-table-column>
<el-table-column label="专业" align="center">
<template slot-scope="scope">
{{scope.row.major}}
</template>
</el-table-column>
<el-table-column label="班级" align="center">
<template slot-scope="scope">
{{scope.row.clazz}}
</template>
</el-table-column>
<el-table-column label="学生类别" align="center">
<template slot-scope="scope">
{{scope.row.studentType}}
</template>
</el-table-column>
<el-table-column v-for="auditNode in colList" :label="auditNode" :key="auditNode" :prop="auditNode" align="center">
</el-table-column>
<el-table-column label="是否准予离校" align="center">
<template slot-scope="scope">
<font color="green" v-if="scope.row.allowedLeave == '准予'">{{scope.row.allowedLeave}}</font>
<font color="red" v-else>{{scope.row.allowedLeave}}</font>
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageIndex"
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordCount">
</el-pagination>
</div>
<el-dialog title="审核意见" :visible.sync="dialogFormVisible" width="80%" top="10vh">
<div class="J_conWarp g-lr-mg">
<div id="dcMain">
<div id="index" class="mainBox" style=" height: auto; min-height: 310px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo">
<tbody>
<tr>
<td width="85%" valign="top" class="pr">
<div class="indexBox">
<div class="boxTitle">基本信息</div>
<ul>
<table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic">
<tbody>
<tr>
<td width="120">学号:</td>
<td><b>{{ stuInfo.studentNumber }}</b></td>
<td width="100">姓名:</td>
<td><b>{{ stuInfo.name }}</b></td>
</tr>
<tr>
<td>院系:</td>
<td><b>{{ stuInfo.department }}</b></td>
<td>专业:</td>
<td><b>{{ stuInfo.major }}</b></td>
</tr>
<tr>
<td>班级:</td>
<td><b>{{ stuInfo.clazz }}</b></td>
<td>学生类别:</td>
<td><b>{{ stuInfo.studentType }}</b></td>
</tr>
</tbody>
</table>
</ul>
</div>
</td>
<td valign="top" class="pl">
</td>
</tr>
</tbody>
</table>
<div class="indexBox">
<div class="boxTitle">审核记录</div>
<ul>
<table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic">
<tbody>
<tr>
<th width="35%">审核环节</th>
<th>审核意见</th>
</tr>
<tr v-for="auditLog in auditLogList" :key="auditLog.auditTime">
<td align="center">
{{auditLog.auditNode}}
[<font color="green" v-if="auditLog.auditResult == '通过'">{{auditLog.auditResult}}</font>
<font color="red" v-else>{{auditLog.auditResult}}</font>]
</td>
<td align="left">
<template v-for="opinion in auditLog.auditOpinionList">
[<font color="green" v-if="opinion.auditResult == '通过'">{{opinion.auditResult}}</font>
<font color="red" v-else>{{opinion.auditResult}}</font>&nbsp;{{opinion.auditTime}}]
【{{auditLog.auditNode}}】
审核意见:{{opinion.auditOpinion}}
<br>
</template>
</td>
</tr>
</tbody>
</table>
</ul>
</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer" style="text-align:center">
<el-button @click="dialogFormVisible = false">关闭</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getBjListByZy } from '@/api/class-api'
import { getPage } from '@/api/leavestudent-api'
import { getZyListByYx } from '@/api/major-api'
import waves from '@/directive/waves' // 水波纹指令
import { resetForm } from '@/utils'
import { crudPageList } from '@/utils/crud'
import mixindata from '@/utils/crud'
export default {
name: 'class',
directives: {
waves
},
mixins: [mixindata],
data() {
return {
majorList: [],
clazzList: [],
colList: [],
stuInfo: {},
auditLogList: []
}
},
filters: {
statusFilter(status) {
const statusMap = {
'1': 'success',
'0': 'danger'
}
return statusMap[status]
}
},
created() {
this.handlePageList()
this.height = window.innerHeight - 266
},
methods: {
initMajorList() {
getZyListByYx({ yx: this.listQuery.department }).then(response => {
this.majorList = response.items
// TODO 坑,this.listQuery.zy == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知
for (const attr in this.listQuery) {
if (attr === 'zy') {
this.listQuery['zy'] = null
}
}
})
},
initBjList(cleanable = true) {
getBjListByZy({ zy: this.listQuery.major }).then(response => {
this.clazzList = response.items
if (cleanable) {
// TODO 坑,this.listQuery.bj == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知
for (const attr in this.listQuery) {
if (attr === 'clazz') {
this.listQuery['clazz'] = null
}
}
}
})
},
handlePageList() {
crudPageList(this, getPage, this.parseItems)
},
parseItems() {
// 重新组织列表,动态生成列
for (let i = 0; i < this.items.length; i++) {
const item = this.items[i]
if (i === 0) {
for (const node of item.nodelist) {
if (this.colList.indexOf(node.auditNode) === -1) {
this.colList.push(node.auditNode)
}
}
}
for (const node of item.nodelist) {
item[node.auditNode] = node.auditResult
}
}
},
handleReset() {
resetForm(this.listQuery)
},
handleFilter() {
this.listQuery.pageIndex = 1
this.handlePageList()
},
handleSizeChange(val) {
this.listQuery.pageSize = val
this.handlePageList()
},
handleCurrentChange(val) {
this.listQuery.pageIndex = val
this.handlePageList()
},
handleAudit(rowid) {
this.dialogFormVisible = true
},
showTrace(item) {
this.stuInfo = item
this.auditLogList = item.auditLogList
this.dialogFormVisible = true
}
}
}
</script>
<style scoped>
.app-container a {
color: #00a4f4;
text-decoration: none;
}
</style>