huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 1 | <template> |
| 2 | <div class="app-container"> |
| 3 | <div class="filter-container"> |
| 4 | <el-row :gutter="20"> |
| 5 | <el-col :span="4"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 6 | <el-select clearable class="filter-item" v-model="listQuery.leaveSchoolBatch" placeholder="批次名称"> |
| 7 | <el-option v-for="item in pagedata.leaveSchoolBatchList" :key="item.value" :label="item.label" :value="item.value"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 8 | </el-option> |
| 9 | </el-select> |
| 10 | </el-col> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 11 | <el-col :span="4"> |
| 12 | <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="学号" v-model="listQuery.studentNumber"> |
| 13 | </el-input> |
| 14 | </el-col> |
| 15 | <el-col :span="4"> |
| 16 | <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="姓名" v-model="listQuery.name"> |
| 17 | </el-input> |
| 18 | </el-col> |
| 19 | <el-col :span="4"> |
| 20 | <el-select clearable class="filter-item" v-model="listQuery.allowedLeave" placeholder="是否准予离校"> |
| 21 | <el-option label="准予" value="1"></el-option> |
| 22 | <el-option label="不准予" value="0"></el-option> |
| 23 | </el-select> |
| 24 | </el-col> |
| 25 | <el-col :span="4"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 26 | <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查询</el-button> |
| 27 | <el-button class="filter-item" style="margin-left: 10px;" @click="handleReset" type="primary" icon="el-icon-edit">重置</el-button> |
| 28 | </el-col> |
| 29 | </el-row> |
| 30 | <el-row :gutter="20"> |
| 31 | <el-col :span="4"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 32 | <el-select clearable @change="initMajorList" class="filter-item" v-model="listQuery.department" placeholder="院系"> |
| 33 | <el-option v-for="item in pagedata.departmentList" :key="item.id" :label="item.name" :value="item.id"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 34 | </el-option> |
| 35 | </el-select> |
| 36 | </el-col> |
| 37 | <el-col :span="4"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 38 | <el-select clearable @change="initBjList" class="filter-item" v-model="listQuery.major" placeholder="专业"> |
| 39 | <el-option v-for="item in majorList" :key="item.id" :label="item.zymc" :value="item.id"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 40 | </el-option> |
| 41 | </el-select> |
| 42 | </el-col> |
| 43 | <el-col :span="4"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 44 | <el-select clearable class="filter-item" v-model="listQuery.clazz" placeholder="班级"> |
| 45 | <el-option v-for="item in clazzList" :key="item.id" :label="item.bjmc" :value="item.id"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 46 | </el-option> |
| 47 | </el-select> |
| 48 | </el-col> |
| 49 | <el-col :span="4"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 50 | <el-select clearable class="filter-item" v-model="listQuery.studentType" placeholder="学生类别"> |
| 51 | <el-option v-for="item in pagedata.studentTypeList" :key="item.value" :label="item.label" :value="item.value"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 52 | </el-option> |
| 53 | </el-select> |
| 54 | </el-col> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 55 | </el-row> |
| 56 | </div> |
| 57 | <el-table :height="height" :data="items" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row> |
| 58 | <el-table-column align="center" type="index" label='序号' width="95"> |
| 59 | </el-table-column> |
| 60 | <el-table-column label="学号" align="center"> |
| 61 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 62 | {{scope.row.studentNumber}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 63 | </template> |
| 64 | </el-table-column> |
| 65 | <el-table-column label="姓名" align="center"> |
| 66 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 67 | <a href="javascript:void(0);" @click="showTrace(scope.row)">{{scope.row.name}}</a> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 68 | </template> |
| 69 | </el-table-column> |
| 70 | <el-table-column label="院系" align="center"> |
| 71 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 72 | {{scope.row.department}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 73 | </template> |
| 74 | </el-table-column> |
| 75 | <el-table-column label="专业" align="center"> |
| 76 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 77 | {{scope.row.major}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 78 | </template> |
| 79 | </el-table-column> |
| 80 | <el-table-column label="班级" align="center"> |
| 81 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 82 | {{scope.row.clazz}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 83 | </template> |
| 84 | </el-table-column> |
| 85 | <el-table-column label="学生类别" align="center"> |
| 86 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 87 | {{scope.row.studentType}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 88 | </template> |
| 89 | </el-table-column> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 90 | <el-table-column v-for="auditNode in colList" :label="auditNode" :key="auditNode" :prop="auditNode" align="center"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 91 | </el-table-column> |
| 92 | <el-table-column label="是否准予离校" align="center"> |
| 93 | <template slot-scope="scope"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 94 | <font color="green" v-if="scope.row.allowedLeave == '准予'">{{scope.row.allowedLeave}}</font> |
| 95 | <font color="red" v-else>{{scope.row.allowedLeave}}</font> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 96 | </template> |
| 97 | </el-table-column> |
| 98 | </el-table> |
| 99 | <div class="pagination-container"> |
| 100 | <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageIndex" |
| 101 | :page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordCount"> |
| 102 | </el-pagination> |
| 103 | </div> |
| 104 | <el-dialog title="审核意见" :visible.sync="dialogFormVisible" width="80%" top="10vh"> |
| 105 | <div class="J_conWarp g-lr-mg"> |
| 106 | <div id="dcMain"> |
| 107 | <div id="index" class="mainBox" style=" height: auto; min-height: 310px;"> |
| 108 | <table width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo"> |
| 109 | <tbody> |
| 110 | <tr> |
| 111 | <td width="85%" valign="top" class="pr"> |
| 112 | <div class="indexBox"> |
| 113 | <div class="boxTitle">基本信息</div> |
| 114 | <ul> |
| 115 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 116 | <tbody> |
| 117 | <tr> |
| 118 | <td width="120">学号:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 119 | <td><b>{{ stuInfo.studentNumber }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 120 | <td width="100">姓名:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 121 | <td><b>{{ stuInfo.name }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 122 | </tr> |
| 123 | <tr> |
| 124 | <td>院系:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 125 | <td><b>{{ stuInfo.department }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 126 | <td>专业:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 127 | <td><b>{{ stuInfo.major }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 128 | </tr> |
| 129 | <tr> |
| 130 | <td>班级:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 131 | <td><b>{{ stuInfo.clazz }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 132 | <td>学生类别:</td> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 133 | <td><b>{{ stuInfo.studentType }}</b></td> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 134 | </tr> |
| 135 | </tbody> |
| 136 | </table> |
| 137 | </ul> |
| 138 | </div> |
| 139 | </td> |
| 140 | <td valign="top" class="pl"> |
| 141 | </td> |
| 142 | </tr> |
| 143 | </tbody> |
| 144 | </table> |
| 145 | |
| 146 | <div class="indexBox"> |
| 147 | <div class="boxTitle">审核记录</div> |
| 148 | <ul> |
| 149 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 150 | <tbody> |
| 151 | <tr> |
| 152 | <th width="35%">审核环节</th> |
| 153 | <th>审核意见</th> |
| 154 | </tr> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 155 | <tr v-for="auditLog in auditLogList" :key="auditLog.auditTime"> |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 156 | <td align="center"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 157 | {{auditLog.auditNode}} |
| 158 | [<font color="green" v-if="auditLog.auditResult == '通过'">{{auditLog.auditResult}}</font> |
| 159 | <font color="red" v-else>{{auditLog.auditResult}}</font>] |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 160 | </td> |
| 161 | <td align="left"> |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 162 | <template v-for="opinion in auditLog.auditOpinionList"> |
| 163 | [<font color="green" v-if="opinion.auditResult == '通过'">{{opinion.auditResult}}</font> |
| 164 | <font color="red" v-else>{{opinion.auditResult}}</font> {{opinion.auditTime}}] |
| 165 | 【{{auditLog.auditNode}}】 |
| 166 | 审核意见:{{opinion.auditOpinion}} |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 167 | <br> |
| 168 | </template> |
| 169 | </td> |
| 170 | </tr> |
| 171 | </tbody> |
| 172 | </table> |
| 173 | </ul> |
| 174 | </div> |
| 175 | |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | <div slot="footer" class="dialog-footer" style="text-align:center"> |
| 180 | <el-button @click="dialogFormVisible = false">关闭</el-button> |
| 181 | </div> |
| 182 | </el-dialog> |
| 183 | </div> |
| 184 | </template> |
| 185 | |
| 186 | <script> |
huibing.xie | 1718f36 | 2018-08-24 14:50:58 +0800 | [diff] [blame] | 187 | import { getBjListByZy } from '@/api/class-api' |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 188 | import { getPage } from '@/api/leavestudent-api' |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 189 | import { getZyListByYx } from '@/api/major-api' |
| 190 | import waves from '@/directive/waves' // 水波纹指令 |
| 191 | import { resetForm } from '@/utils' |
| 192 | import { crudPageList } from '@/utils/crud' |
| 193 | import mixindata from '@/utils/crud' |
| 194 | |
| 195 | export default { |
| 196 | name: 'class', |
| 197 | directives: { |
| 198 | waves |
| 199 | }, |
| 200 | mixins: [mixindata], |
| 201 | data() { |
| 202 | return { |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 203 | majorList: [], |
| 204 | clazzList: [], |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 205 | colList: [], |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 206 | stuInfo: {}, |
| 207 | auditLogList: [] |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 208 | } |
| 209 | }, |
| 210 | filters: { |
| 211 | statusFilter(status) { |
| 212 | const statusMap = { |
| 213 | '1': 'success', |
| 214 | '0': 'danger' |
| 215 | } |
| 216 | return statusMap[status] |
| 217 | } |
| 218 | }, |
| 219 | created() { |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 220 | this.handlePageList() |
| 221 | this.height = window.innerHeight - 266 |
| 222 | }, |
| 223 | methods: { |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 224 | initMajorList() { |
| 225 | getZyListByYx({ yx: this.listQuery.department }).then(response => { |
| 226 | this.majorList = response.items |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 227 | // TODO 坑,this.listQuery.zy == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知 |
| 228 | for (const attr in this.listQuery) { |
| 229 | if (attr === 'zy') { |
| 230 | this.listQuery['zy'] = null |
| 231 | } |
| 232 | } |
| 233 | }) |
| 234 | }, |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 235 | initBjList(cleanable = true) { |
| 236 | getBjListByZy({ zy: this.listQuery.major }).then(response => { |
| 237 | this.clazzList = response.items |
| 238 | if (cleanable) { |
| 239 | // TODO 坑,this.listQuery.bj == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知 |
| 240 | for (const attr in this.listQuery) { |
| 241 | if (attr === 'clazz') { |
| 242 | this.listQuery['clazz'] = null |
| 243 | } |
| 244 | } |
| 245 | } |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 246 | }) |
| 247 | }, |
| 248 | handlePageList() { |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 249 | crudPageList(this, getPage, this.parseItems) |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 250 | }, |
| 251 | parseItems() { |
| 252 | // 重新组织列表,动态生成列 |
| 253 | for (let i = 0; i < this.items.length; i++) { |
| 254 | const item = this.items[i] |
| 255 | if (i === 0) { |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 256 | for (const node of item.nodelist) { |
| 257 | if (this.colList.indexOf(node.auditNode) === -1) { |
| 258 | this.colList.push(node.auditNode) |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 259 | } |
| 260 | } |
| 261 | } |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 262 | for (const node of item.nodelist) { |
| 263 | item[node.auditNode] = node.auditResult |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 264 | } |
| 265 | } |
| 266 | }, |
| 267 | handleReset() { |
| 268 | resetForm(this.listQuery) |
| 269 | }, |
| 270 | handleFilter() { |
| 271 | this.listQuery.pageIndex = 1 |
| 272 | this.handlePageList() |
| 273 | }, |
| 274 | handleSizeChange(val) { |
| 275 | this.listQuery.pageSize = val |
| 276 | this.handlePageList() |
| 277 | }, |
| 278 | handleCurrentChange(val) { |
| 279 | this.listQuery.pageIndex = val |
| 280 | this.handlePageList() |
| 281 | }, |
| 282 | handleAudit(rowid) { |
| 283 | this.dialogFormVisible = true |
| 284 | }, |
| 285 | showTrace(item) { |
huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +0800 | [diff] [blame^] | 286 | this.stuInfo = item |
| 287 | this.auditLogList = item.auditLogList |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 288 | this.dialogFormVisible = true |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | </script> |
| 293 | <style scoped> |
huibing.xie | 1718f36 | 2018-08-24 14:50:58 +0800 | [diff] [blame] | 294 | .app-container a { |
huibing.xie | f40b2b9 | 2018-08-22 17:12:47 +0800 | [diff] [blame] | 295 | color: #00a4f4; |
| 296 | text-decoration: none; |
| 297 | } |
| 298 | </style> |
| 299 | |