离校批量审核管理
diff --git a/leave-school-vue/src/views/procedures/batchAudit/index.vue b/leave-school-vue/src/views/procedures/batchAudit/index.vue
new file mode 100644
index 0000000..0871186
--- /dev/null
+++ b/leave-school-vue/src/views/procedures/batchAudit/index.vue
@@ -0,0 +1,508 @@
+<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-select clearable class="filter-item" v-model="listQuery.auditNode" placeholder="审核环节">
+            <el-option v-for="item in  auditNodeList" :key="item.value" :label="item.label" :value="item.value">
+            </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-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-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-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 @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-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="showBatchAudit">批量审核</el-button>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <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-select clearable class="filter-item" v-model="listQuery.auditResult" placeholder="审核环节状态">
+            <el-option v-for="item in pagedata.auditResultList" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="4">
+          <el-select clearable class="filter-item" v-model="listQuery.graduateYear" placeholder="毕业年份">
+            <el-option v-for="n in  10" :key="year-n" :label="year-n" :value="year-n">
+            </el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="4">
+          <el-select clearable class="filter-item" v-model="listQuery.graduateMonth" placeholder="毕业月份">
+            <el-option v-for="n in  12" :key="n" :label="n" :value="n">
+            </el-option>
+          </el-select>
+        </el-col>
+      </el-row>
+    </div>
+    <el-table :height="height" :data="items" v-loading="listLoading" @selection-change="handleSelectionChange" element-loading-text="Loading" border fit highlight-current-row>
+      <el-table-column type="selection" align="center"></el-table-column>
+      <el-table-column fixed align="center" label='序号' width="95">
+        <template slot-scope="scope">
+          {{scope.row.rownum}}
+        </template>
+      </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">
+          {{scope.row.name}}
+        </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">
+          {{scope.row.allowedLeave}}
+        </template>
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        width="150"
+        label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="showSingleAudit(scope.row, false)">审核</el-button>
+          <el-button type="text" size="small" @click="showTrace(scope.row, false)">办理轨迹</el-button>
+        </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;">
+            <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>
+    <el-dialog title="审核" :visible.sync="auditFormVisible" width="80%" top="10vh">
+      <div class="J_conWarp g-lr-mg">
+          <div id="dcMain">
+          <div id="index" class="mainBox" style=" height: auto;">
+            <table v-show="stuInfoVisible" width="100%" border="0" cellspacing="0" cellpadding="0" class="indexBoxTwo">
+              <tbody>
+                <tr>
+                  <td width="65%" 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">
+                    <div class="indexBox">
+                      <div class="boxTitle">审核记录</div>
+                      <ul>
+                        <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic">
+                          <tbody>
+                            <tr>
+                              <th width="15%">结果</th>
+                              <th width="55%">审核意见</th>
+                              <th width="35%">操作时间</th>
+                            </tr>
+                            <tr v-for="item in currentNodeLogList">
+                              <td align="center">
+                                <font color="green" v-if="item.auditResult == '通过'">{{item.auditResult}}</font>
+                                <font color="red" v-else>{{item.auditResult}}</font>
+                              </td>
+                              <td align="center">
+                                {{item.auditOpinion}}
+                              </td>
+                              <td align="center">
+                                {{item.auditTime}}
+                              </td>
+                            </tr>
+                          </tbody>
+                        </table>
+                      </ul>
+                    </div>
+                  </td>
+                  </td>
+                </tr>
+              </tbody>
+            </table>
+            <div class="indexBox">
+              <ul>
+                <table width="100%" border="0" cellspacing="0" cellpadding="7" class="tableBasic">
+                  <tbody>
+                    <tr>
+                      <td align="center"><b>审核意见:</b></td>
+                      <td>
+                        <textarea cols="80" rows="5" v-model="auditMsg.auditOpinion" class="textArea"></textarea></td>
+                    </tr>
+                  </tbody>
+                </table>
+              </ul>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer" style="text-align:center">
+        <el-button type="primary" @click="auditPass()">审核通过</el-button>
+        <el-button type="primary" @click="auditReject()">审核不通过</el-button>
+        <el-button @click="auditFormVisible = false">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getBjListByZy } from '@/api/class-api'
+import { getPage, saveAudit } 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 {
+      auditNodeList: [{
+        'value': '1',
+        'label': '后勤处'
+      },
+      {
+        'value': '2',
+        'label': '财务处'
+      },
+      {
+        'value': '3',
+        'label': '学生处'
+      },
+      {
+        'value': '4',
+        'label': '图书馆'
+      }],
+      auditMsg: {},
+      stuInfoVisible: true,
+      auditFormVisible: false,
+      year: (new Date()).getFullYear() + 2,
+      majorList: [],
+      clazzList: [],
+      colList: [],
+      stuInfo: {},
+      auditLogList: [],
+      currentNodeLogList: [],
+      multipleSelection: []
+    }
+  },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        '1': 'success',
+        '0': 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  created() {
+    // this.handlePageList()
+    this.listLoading = false
+    this.height = window.innerHeight - 316
+  },
+  methods: {
+    handleSelectionChange(val) {
+      this.multipleSelection = val
+    },
+    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
+            }
+          }
+        }
+      })
+    },
+    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
+        }
+      }
+    },
+    handlePageList() {
+      crudPageList(this, getPage, this.parseItems)
+    },
+    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()
+    },
+    showTrace(item) {
+      this.stuInfo = item
+      this.auditLogList = item.auditLogList
+      this.dialogFormVisible = true
+    },
+    showSingleAudit(item, isBatch) {
+      this.stuInfo = item
+      this.auditMsg = {
+        'leaveSchoolBatch': this.listQuery.leaveSchoolBatch,
+        'leaveSchoolProcess': this.listQuery.auditNode,
+        'leaveSchoolStrudent': item.id
+      }
+      const that = this
+      for (const auditLog of item.auditLogList) {
+        if (auditLog.auditNode === this.auditNodeList.find(obj => obj.value + '' === that.listQuery.auditNode + '')['label']) {
+          this.currentNodeLogList = auditLog.auditOpinionList
+          break
+        }
+      }
+      this.auditFormVisible = true
+      this.stuInfoVisible = true
+    },
+    showBatchAudit() {
+      let ids = ''
+      if (this.multipleSelection.length) {
+        for (const row of this.multipleSelection) {
+          ids += row.id + ','
+        }
+      }
+      if (!ids) {
+        this.$notify({
+          title: '通知',
+          message: '请先选择待审核学生!',
+          type: 'info',
+          duration: 2000
+        })
+        return
+      }
+      this.auditMsg = {
+        'leaveSchoolBatch': this.listQuery.leaveSchoolBatch,
+        'leaveSchoolProcess': this.listQuery.auditNode,
+        'leaveSchoolStrudent': ids
+      }
+      this.auditFormVisible = true
+      this.stuInfoVisible = false
+    },
+    savePageAudit(page) {
+      saveAudit(page.auditMsg).then(response => {
+        page.auditFormVisible = false
+        page.$notify({
+          title: '成功',
+          message: '审核成功',
+          type: 'success',
+          duration: 2000
+        })
+      })
+    },
+    auditPass() {
+      this.auditMsg['auditResult'] = 'APPROVED'
+      this.savePageAudit(this)
+    },
+    auditReject() {
+      this.auditMsg['auditResult'] = 'NOT_PASSED'
+      this.savePageAudit(this)
+    }
+  }
+}
+</script>
diff --git a/leave-school-vue/src/views/procedures/leavestudent/index.vue b/leave-school-vue/src/views/procedures/leavestudent/index.vue
index 6d0117e..4bf80c1 100644
--- a/leave-school-vue/src/views/procedures/leavestudent/index.vue
+++ b/leave-school-vue/src/views/procedures/leavestudent/index.vue
@@ -22,13 +22,6 @@
             </el-option>
           </el-select>
         </el-col>
-        <el-col :span="8">
-          <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="handleCreate(null, 'create')" type="primary" icon="el-icon-edit">添加</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 class="filter-item" v-model="listQuery.leaveSchoolType" placeholder="离校类型">
             <el-option v-for="item in  pagedata.leaveSchoolTypeList" :key="item.value" :label="item.label" :value="item.value">
@@ -36,13 +29,19 @@
           </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 class="filter-item" v-model="listQuery.major" placeholder="专业">
+          <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>
@@ -53,8 +52,6 @@
             </el-option>
           </el-select>
         </el-col>
-      </el-row>
-      <el-row :gutter="20">
         <el-col :span="4">
           <el-select clearable class="filter-item" v-model="listQuery.graduateYear" placeholder="毕业年份">
             <el-option v-for="n in  10" :key="year-n" :label="year-n" :value="year-n">
@@ -136,7 +133,7 @@
 
 <script>
 import { getBjListByZy } from '@/api/class-api'
-import { getAuditList } from '@/api/leavestudent-api'
+import { getPage } from '@/api/leavestudent-api'
 import { getZyListByYx } from '@/api/major-api'
 import waves from '@/directive/waves' // 水波纹指令
 import { resetForm } from '@/utils'
@@ -167,7 +164,7 @@
   },
   created() {
     this.handlePageList()
-    this.height = window.innerHeight - 316
+    this.height = window.innerHeight - 266
   },
   methods: {
     initMajorList() {
@@ -195,7 +192,7 @@
       })
     },
     handlePageList() {
-      crudPageList(this, getAuditList)
+      crudPageList(this, getPage)
     },
     handleReset() {
       resetForm(this.listQuery)