huibing.xie | 3ead5ea | 2018-08-30 10:19:49 +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"> |
| 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"> |
| 8 | </el-option> |
| 9 | </el-select> |
| 10 | </el-col> |
| 11 | <el-col :span="4"> |
| 12 | <el-select clearable class="filter-item" v-model="listQuery.auditNode" placeholder="审核环节"> |
| 13 | <el-option v-for="item in auditNodeList" :key="item.value" :label="item.label" :value="item.value"> |
| 14 | </el-option> |
| 15 | </el-select> |
| 16 | </el-col> |
| 17 | <el-col :span="4"> |
| 18 | <el-select clearable class="filter-item" v-model="listQuery.studentType" placeholder="学生类别"> |
| 19 | <el-option v-for="item in pagedata.studentTypeList" :key="item.value" :label="item.label" :value="item.value"> |
| 20 | </el-option> |
| 21 | </el-select> |
| 22 | </el-col> |
| 23 | <el-col :span="4"> |
| 24 | <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="学号" v-model="listQuery.studentNumber"> |
| 25 | </el-input> |
| 26 | </el-col> |
| 27 | <el-col :span="4"> |
| 28 | <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查询</el-button> |
| 29 | <el-button class="filter-item" style="margin-left: 10px;" @click="handleReset" type="primary" icon="el-icon-edit">重置</el-button> |
| 30 | </el-col> |
| 31 | </el-row> |
| 32 | <el-row :gutter="20"> |
| 33 | <el-col :span="4"> |
| 34 | <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="姓名" v-model="listQuery.name"> |
| 35 | </el-input> |
| 36 | </el-col> |
| 37 | <el-col :span="4"> |
| 38 | <el-select clearable @change="initMajorList" class="filter-item" v-model="listQuery.department" placeholder="院系"> |
| 39 | <el-option v-for="item in pagedata.departmentList" :key="item.id" :label="item.name" :value="item.id"> |
| 40 | </el-option> |
| 41 | </el-select> |
| 42 | </el-col> |
| 43 | <el-col :span="4"> |
| 44 | <el-select clearable @change="initBjList" class="filter-item" v-model="listQuery.major" placeholder="专业"> |
| 45 | <el-option v-for="item in majorList" :key="item.id" :label="item.zymc" :value="item.id"> |
| 46 | </el-option> |
| 47 | </el-select> |
| 48 | </el-col> |
| 49 | <el-col :span="4"> |
| 50 | <el-select clearable class="filter-item" v-model="listQuery.clazz" placeholder="班级"> |
| 51 | <el-option v-for="item in clazzList" :key="item.id" :label="item.bjmc" :value="item.id"> |
| 52 | </el-option> |
| 53 | </el-select> |
| 54 | </el-col> |
| 55 | <el-col :span="4"> |
| 56 | <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="showBatchAudit">批量审核</el-button> |
| 57 | </el-col> |
| 58 | </el-row> |
| 59 | <el-row :gutter="20"> |
| 60 | <el-col :span="4"> |
| 61 | <el-select clearable class="filter-item" v-model="listQuery.allowedLeave" placeholder="是否准予离校"> |
| 62 | <el-option label="准予" value="1"></el-option> |
| 63 | <el-option label="不准予" value="0"></el-option> |
| 64 | </el-select> |
| 65 | </el-col> |
| 66 | <el-col :span="4"> |
| 67 | <el-select clearable class="filter-item" v-model="listQuery.auditResult" placeholder="审核环节状态"> |
| 68 | <el-option v-for="item in pagedata.auditResultList" :key="item.value" :label="item.label" :value="item.value"> |
| 69 | </el-option> |
| 70 | </el-select> |
| 71 | </el-col> |
| 72 | <el-col :span="4"> |
| 73 | <el-select clearable class="filter-item" v-model="listQuery.graduateYear" placeholder="毕业年份"> |
| 74 | <el-option v-for="n in 10" :key="year-n" :label="year-n" :value="year-n"> |
| 75 | </el-option> |
| 76 | </el-select> |
| 77 | </el-col> |
| 78 | <el-col :span="4"> |
| 79 | <el-select clearable class="filter-item" v-model="listQuery.graduateMonth" placeholder="毕业月份"> |
| 80 | <el-option v-for="n in 12" :key="n" :label="n" :value="n"> |
| 81 | </el-option> |
| 82 | </el-select> |
| 83 | </el-col> |
| 84 | </el-row> |
| 85 | </div> |
| 86 | <el-table :height="height" :data="items" v-loading="listLoading" @selection-change="handleSelectionChange" element-loading-text="Loading" border fit highlight-current-row> |
| 87 | <el-table-column type="selection" align="center"></el-table-column> |
| 88 | <el-table-column fixed align="center" label='序号' width="95"> |
| 89 | <template slot-scope="scope"> |
| 90 | {{scope.row.rownum}} |
| 91 | </template> |
| 92 | </el-table-column> |
| 93 | <el-table-column label="学号" align="center"> |
| 94 | <template slot-scope="scope"> |
| 95 | {{scope.row.studentNumber}} |
| 96 | </template> |
| 97 | </el-table-column> |
| 98 | <el-table-column label="姓名" align="center"> |
| 99 | <template slot-scope="scope"> |
| 100 | {{scope.row.name}} |
| 101 | </template> |
| 102 | </el-table-column> |
| 103 | <el-table-column label="院系" align="center"> |
| 104 | <template slot-scope="scope"> |
| 105 | {{scope.row.department}} |
| 106 | </template> |
| 107 | </el-table-column> |
| 108 | <el-table-column label="专业" align="center"> |
| 109 | <template slot-scope="scope"> |
| 110 | {{scope.row.major}} |
| 111 | </template> |
| 112 | </el-table-column> |
| 113 | <el-table-column label="班级" align="center"> |
| 114 | <template slot-scope="scope"> |
| 115 | {{scope.row.clazz}} |
| 116 | </template> |
| 117 | </el-table-column> |
| 118 | <el-table-column label="学生类别" align="center"> |
| 119 | <template slot-scope="scope"> |
| 120 | {{scope.row.studentType}} |
| 121 | </template> |
| 122 | </el-table-column> |
| 123 | <el-table-column v-for="auditNode in colList" :label="auditNode" :key="auditNode" :prop="auditNode" align="center"> |
| 124 | </el-table-column> |
| 125 | <el-table-column label="是否准予离校" align="center"> |
| 126 | <template slot-scope="scope"> |
| 127 | {{scope.row.allowedLeave}} |
| 128 | </template> |
| 129 | </el-table-column> |
| 130 | <el-table-column |
| 131 | fixed="right" |
| 132 | header-align="center" |
| 133 | align="center" |
| 134 | width="150" |
| 135 | label="操作"> |
| 136 | <template slot-scope="scope"> |
| 137 | <el-button type="text" size="small" @click="showSingleAudit(scope.row, false)">审核</el-button> |
| 138 | <el-button type="text" size="small" @click="showTrace(scope.row, false)">办理轨迹</el-button> |
| 139 | </template> |
| 140 | </el-table-column> |
| 141 | </el-table> |
| 142 | <div class="pagination-container"> |
| 143 | <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.pageIndex" |
| 144 | :page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="recordCount"> |
| 145 | </el-pagination> |
| 146 | </div> |
| 147 | <el-dialog title="审核意见" :visible.sync="dialogFormVisible" width="80%" top="10vh"> |
| 148 | <div class="J_conWarp g-lr-mg"> |
| 149 | <div id="dcMain"> |
| 150 | <div id="index" class="mainBox" style=" height: auto;"> |
| 151 | <table width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo"> |
| 152 | <tbody> |
| 153 | <tr> |
| 154 | <td width="85%" valign="top" class="pr"> |
| 155 | <div class="indexBox"> |
| 156 | <div class="boxTitle">基本信息</div> |
| 157 | <ul> |
| 158 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 159 | <tbody> |
| 160 | <tr> |
| 161 | <td width="120">学号:</td> |
| 162 | <td><b>{{ stuInfo.studentNumber }}</b></td> |
| 163 | <td width="100">姓名:</td> |
| 164 | <td><b>{{ stuInfo.name }}</b></td> |
| 165 | </tr> |
| 166 | <tr> |
| 167 | <td>院系:</td> |
| 168 | <td><b>{{ stuInfo.department }}</b></td> |
| 169 | <td>专业:</td> |
| 170 | <td><b>{{ stuInfo.major }}</b></td> |
| 171 | </tr> |
| 172 | <tr> |
| 173 | <td>班级:</td> |
| 174 | <td><b>{{ stuInfo.clazz }}</b></td> |
| 175 | <td>学生类别:</td> |
| 176 | <td><b>{{ stuInfo.studentType }}</b></td> |
| 177 | </tr> |
| 178 | </tbody> |
| 179 | </table> |
| 180 | </ul> |
| 181 | </div> |
| 182 | </td> |
| 183 | <td valign="top" class="pl"> |
| 184 | </td> |
| 185 | </tr> |
| 186 | </tbody> |
| 187 | </table> |
| 188 | |
| 189 | <div class="indexBox"> |
| 190 | <div class="boxTitle">审核记录</div> |
| 191 | <ul> |
| 192 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 193 | <tbody> |
| 194 | <tr> |
| 195 | <th width="35%">审核环节</th> |
| 196 | <th>审核意见</th> |
| 197 | </tr> |
| 198 | <tr v-for="auditLog in auditLogList" :key="auditLog.auditTime"> |
| 199 | <td align="center"> |
| 200 | {{auditLog.auditNode}} |
| 201 | [<font color="green" v-if="auditLog.auditResult == '通过'">{{auditLog.auditResult}}</font> |
| 202 | <font color="red" v-else>{{auditLog.auditResult}}</font>] |
| 203 | </td> |
| 204 | <td align="left"> |
| 205 | <template v-for="opinion in auditLog.auditOpinionList"> |
| 206 | [<font color="green" v-if="opinion.auditResult == '通过'">{{opinion.auditResult}}</font> |
| 207 | <font color="red" v-else>{{opinion.auditResult}}</font> {{opinion.auditTime}}] |
| 208 | 【{{auditLog.auditNode}}】 |
| 209 | 审核意见:{{opinion.auditOpinion}} |
| 210 | <br> |
| 211 | </template> |
| 212 | </td> |
| 213 | </tr> |
| 214 | </tbody> |
| 215 | </table> |
| 216 | </ul> |
| 217 | </div> |
| 218 | |
| 219 | </div> |
| 220 | </div> |
| 221 | </div> |
| 222 | <div slot="footer" class="dialog-footer" style="text-align:center"> |
| 223 | <el-button @click="dialogFormVisible = false">关闭</el-button> |
| 224 | </div> |
| 225 | </el-dialog> |
| 226 | <el-dialog title="审核" :visible.sync="auditFormVisible" width="80%" top="10vh"> |
| 227 | <div class="J_conWarp g-lr-mg"> |
| 228 | <div id="dcMain"> |
| 229 | <div id="index" class="mainBox" style=" height: auto;"> |
| 230 | <table v-show="stuInfoVisible" width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo"> |
| 231 | <tbody> |
| 232 | <tr> |
| 233 | <td width="65%" valign="top" class="pr"> |
| 234 | <div class="indexBox"> |
| 235 | <div class="boxTitle">基本信息</div> |
| 236 | <ul> |
| 237 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 238 | <tbody> |
| 239 | <tr> |
| 240 | <td width="120">学号:</td> |
| 241 | <td><b>{{ stuInfo.studentNumber }}</b></td> |
| 242 | <td width="100">姓名:</td> |
| 243 | <td><b>{{ stuInfo.name }}</b></td> |
| 244 | </tr> |
| 245 | <tr> |
| 246 | <td>院系:</td> |
| 247 | <td><b>{{ stuInfo.department }}</b></td> |
| 248 | <td>专业:</td> |
| 249 | <td><b>{{ stuInfo.major }}</b></td> |
| 250 | </tr> |
| 251 | <tr> |
| 252 | <td>班级:</td> |
| 253 | <td><b>{{ stuInfo.clazz }}</b></td> |
| 254 | <td>学生类别:</td> |
| 255 | <td><b>{{ stuInfo.studentType }}</b></td> |
| 256 | </tr> |
| 257 | </tbody> |
| 258 | </table> |
| 259 | </ul> |
| 260 | </div> |
| 261 | </td> |
| 262 | <td valign="top" class="pl"> |
| 263 | <div class="indexBox"> |
| 264 | <div class="boxTitle">审核记录</div> |
| 265 | <ul> |
| 266 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 267 | <tbody> |
| 268 | <tr> |
| 269 | <th width="15%">结果</th> |
| 270 | <th width="55%">审核意见</th> |
| 271 | <th width="35%">操作时间</th> |
| 272 | </tr> |
| 273 | <tr v-for="item in currentNodeLogList"> |
| 274 | <td align="center"> |
| 275 | <font color="green" v-if="item.auditResult == '通过'">{{item.auditResult}}</font> |
| 276 | <font color="red" v-else>{{item.auditResult}}</font> |
| 277 | </td> |
| 278 | <td align="center"> |
| 279 | {{item.auditOpinion}} |
| 280 | </td> |
| 281 | <td align="center"> |
| 282 | {{item.auditTime}} |
| 283 | </td> |
| 284 | </tr> |
| 285 | </tbody> |
| 286 | </table> |
| 287 | </ul> |
| 288 | </div> |
| 289 | </td> |
| 290 | </td> |
| 291 | </tr> |
| 292 | </tbody> |
| 293 | </table> |
| 294 | <div class="indexBox"> |
| 295 | <ul> |
| 296 | <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic"> |
| 297 | <tbody> |
| 298 | <tr> |
| 299 | <td align="center"><b>审核意见:</b></td> |
| 300 | <td> |
| 301 | <textarea cols="80" rows="5" v-model="auditMsg.auditOpinion" class="textArea"></textarea></td> |
| 302 | </tr> |
| 303 | </tbody> |
| 304 | </table> |
| 305 | </ul> |
| 306 | </div> |
| 307 | </div> |
| 308 | </div> |
| 309 | </div> |
| 310 | <div slot="footer" class="dialog-footer" style="text-align:center"> |
| 311 | <el-button type="primary" @click="auditPass()">审核通过</el-button> |
| 312 | <el-button type="primary" @click="auditReject()">审核不通过</el-button> |
| 313 | <el-button @click="auditFormVisible = false">关闭</el-button> |
| 314 | </div> |
| 315 | </el-dialog> |
| 316 | </div> |
| 317 | </template> |
| 318 | |
| 319 | <script> |
| 320 | import { getBjListByZy } from '@/api/class-api' |
| 321 | import { getPage, saveAudit } from '@/api/leavestudent-api' |
| 322 | import { getZyListByYx } from '@/api/major-api' |
| 323 | import waves from '@/directive/waves' // 水波纹指令 |
| 324 | import { resetForm } from '@/utils' |
| 325 | import { crudPageList } from '@/utils/crud' |
| 326 | import mixindata from '@/utils/crud' |
| 327 | |
| 328 | export default { |
| 329 | name: 'class', |
| 330 | directives: { |
| 331 | waves |
| 332 | }, |
| 333 | mixins: [mixindata], |
| 334 | data() { |
| 335 | return { |
| 336 | auditNodeList: [{ |
| 337 | 'value': '1', |
| 338 | 'label': '后勤处' |
| 339 | }, |
| 340 | { |
| 341 | 'value': '2', |
| 342 | 'label': '财务处' |
| 343 | }, |
| 344 | { |
| 345 | 'value': '3', |
| 346 | 'label': '学生处' |
| 347 | }, |
| 348 | { |
| 349 | 'value': '4', |
| 350 | 'label': '图书馆' |
| 351 | }], |
| 352 | auditMsg: {}, |
| 353 | stuInfoVisible: true, |
| 354 | auditFormVisible: false, |
| 355 | year: (new Date()).getFullYear() + 2, |
| 356 | majorList: [], |
| 357 | clazzList: [], |
| 358 | colList: [], |
| 359 | stuInfo: {}, |
| 360 | auditLogList: [], |
| 361 | currentNodeLogList: [], |
| 362 | multipleSelection: [] |
| 363 | } |
| 364 | }, |
| 365 | filters: { |
| 366 | statusFilter(status) { |
| 367 | const statusMap = { |
| 368 | '1': 'success', |
| 369 | '0': 'danger' |
| 370 | } |
| 371 | return statusMap[status] |
| 372 | } |
| 373 | }, |
| 374 | created() { |
| 375 | // this.handlePageList() |
| 376 | this.listLoading = false |
| 377 | this.height = window.innerHeight - 316 |
| 378 | }, |
| 379 | methods: { |
| 380 | handleSelectionChange(val) { |
| 381 | this.multipleSelection = val |
| 382 | }, |
| 383 | initMajorList() { |
| 384 | getZyListByYx({ yx: this.listQuery.department }).then(response => { |
| 385 | this.majorList = response.items |
| 386 | // TODO 坑,this.listQuery.zy == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知 |
| 387 | for (const attr in this.listQuery) { |
| 388 | if (attr === 'zy') { |
| 389 | this.listQuery['zy'] = null |
| 390 | } |
| 391 | } |
| 392 | }) |
| 393 | }, |
| 394 | initBjList(cleanable = true) { |
| 395 | getBjListByZy({ zy: this.listQuery.major }).then(response => { |
| 396 | this.clazzList = response.items |
| 397 | if (cleanable) { |
| 398 | // TODO 坑,this.listQuery.bj == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知 |
| 399 | for (const attr in this.listQuery) { |
| 400 | if (attr === 'clazz') { |
| 401 | this.listQuery['clazz'] = null |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | }) |
| 406 | }, |
| 407 | parseItems() { |
| 408 | // 重新组织列表,动态生成列 |
| 409 | for (let i = 0; i < this.items.length; i++) { |
| 410 | const item = this.items[i] |
| 411 | if (i === 0) { |
| 412 | for (const node of item.nodelist) { |
| 413 | if (this.colList.indexOf(node.auditNode) === -1) { |
| 414 | this.colList.push(node.auditNode) |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | for (const node of item.nodelist) { |
| 419 | item[node.auditNode] = node.auditResult |
| 420 | } |
| 421 | } |
| 422 | }, |
| 423 | handlePageList() { |
| 424 | crudPageList(this, getPage, this.parseItems) |
| 425 | }, |
| 426 | handleReset() { |
| 427 | resetForm(this.listQuery) |
| 428 | }, |
| 429 | handleFilter() { |
| 430 | this.listQuery.pageIndex = 1 |
| 431 | this.handlePageList() |
| 432 | }, |
| 433 | handleSizeChange(val) { |
| 434 | this.listQuery.pageSize = val |
| 435 | this.handlePageList() |
| 436 | }, |
| 437 | handleCurrentChange(val) { |
| 438 | this.listQuery.pageIndex = val |
| 439 | this.handlePageList() |
| 440 | }, |
| 441 | showTrace(item) { |
| 442 | this.stuInfo = item |
| 443 | this.auditLogList = item.auditLogList |
| 444 | this.dialogFormVisible = true |
| 445 | }, |
| 446 | showSingleAudit(item, isBatch) { |
| 447 | this.stuInfo = item |
| 448 | this.auditMsg = { |
| 449 | 'leaveSchoolBatch': this.listQuery.leaveSchoolBatch, |
| 450 | 'leaveSchoolProcess': this.listQuery.auditNode, |
| 451 | 'leaveSchoolStrudent': item.id |
| 452 | } |
| 453 | const that = this |
| 454 | for (const auditLog of item.auditLogList) { |
| 455 | if (auditLog.auditNode === this.auditNodeList.find(obj => obj.value + '' === that.listQuery.auditNode + '')['label']) { |
| 456 | this.currentNodeLogList = auditLog.auditOpinionList |
| 457 | break |
| 458 | } |
| 459 | } |
| 460 | this.auditFormVisible = true |
| 461 | this.stuInfoVisible = true |
| 462 | }, |
| 463 | showBatchAudit() { |
| 464 | let ids = '' |
| 465 | if (this.multipleSelection.length) { |
| 466 | for (const row of this.multipleSelection) { |
| 467 | ids += row.id + ',' |
| 468 | } |
| 469 | } |
| 470 | if (!ids) { |
| 471 | this.$notify({ |
| 472 | title: '通知', |
| 473 | message: '请先选择待审核学生!', |
| 474 | type: 'info', |
| 475 | duration: 2000 |
| 476 | }) |
| 477 | return |
| 478 | } |
| 479 | this.auditMsg = { |
| 480 | 'leaveSchoolBatch': this.listQuery.leaveSchoolBatch, |
| 481 | 'leaveSchoolProcess': this.listQuery.auditNode, |
| 482 | 'leaveSchoolStrudent': ids |
| 483 | } |
| 484 | this.auditFormVisible = true |
| 485 | this.stuInfoVisible = false |
| 486 | }, |
| 487 | savePageAudit(page) { |
| 488 | saveAudit(page.auditMsg).then(response => { |
| 489 | page.auditFormVisible = false |
| 490 | page.$notify({ |
| 491 | title: '成功', |
| 492 | message: '审核成功', |
| 493 | type: 'success', |
| 494 | duration: 2000 |
| 495 | }) |
| 496 | }) |
| 497 | }, |
| 498 | auditPass() { |
| 499 | this.auditMsg['auditResult'] = 'APPROVED' |
| 500 | this.savePageAudit(this) |
| 501 | }, |
| 502 | auditReject() { |
| 503 | this.auditMsg['auditResult'] = 'NOT_PASSED' |
| 504 | this.savePageAudit(this) |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | </script> |