专业统计报表查询
diff --git a/leave-school-vue/src/api/majorreport-api.js b/leave-school-vue/src/api/majorreport-api.js
new file mode 100644
index 0000000..536cb1c
--- /dev/null
+++ b/leave-school-vue/src/api/majorreport-api.js
@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function getList(params) {
+ return request({
+ url: '/api/statistical/majorreport/list-api',
+ method: 'get',
+ params
+ })
+}
diff --git a/leave-school-vue/src/icons/svg/majorreport.svg b/leave-school-vue/src/icons/svg/majorreport.svg
new file mode 100644
index 0000000..0447c16
--- /dev/null
+++ b/leave-school-vue/src/icons/svg/majorreport.svg
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1535340722952" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1573" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M906.230186 217.618135 755.262939 217.618135c6.059172-8.192683 10.155513-18.348196 10.155513-29.783815L765.418452 69.04042c0-26.199517-19.030919-47.534628-42.499542-47.534628L489.256771 21.505792c-23.468622 0-42.499542 21.249771-42.499542 47.534628l227.176265 0c23.468622 0 42.499542 21.249771 42.499542 47.534628l0 118.793899c0 26.199517-19.030919 47.534628-42.499542 47.534628L667.36228 282.903575 667.36228 164.109676c0-26.199517-19.030919-47.534628-42.499542-47.534628L391.2006 116.575048c-23.468622 0-42.499542 21.249771-42.499542 47.534628L348.701058 217.618135 109.833153 217.618135C49.156096 217.618135 0 265.323444 0 324.12301l0 558.723894c0 58.884907 49.156096 106.504875 109.833153 106.504875l796.397033 0c60.677056 0 109.833153-47.705309 109.833153-106.504875L1016.063339 324.12301C1016.148679 265.323444 966.907242 217.618135 906.230186 217.618135zM554.456871 808.344695c0 0-47.705309 50.948246-215.655305 51.204267l0 0c-0.170681 0-0.341362 0-0.512043 0s-0.341362 0-0.597383 0l0 0c-168.035336-0.256021-215.655305-51.204267-215.655305-51.204267s-9.984832-99.848321 82.694891-150.711226l68.528377-28.162347c0 0 9.984832-9.984832 11.43562-23.297941l-0.512043-9.387449c-16.129344-10.582215-28.162347-26.540878-35.842987-45.230436C225.213434 550.957913 224.786732 497.108092 236.222352 491.219602 232.211351 447.354613 232.467372 372.08434 337.180098 370.974915c0 0 0-0.170681 0-0.170681 0.426702 0 0.682724 0.08534 1.024085 0.08534S338.801567 370.804234 339.228269 370.804234c0 0 0 0.170681 0 0.170681 104.627386 1.109426 104.968747 76.379698 100.957746 120.244687 11.43562 5.80315 11.008917 59.738312-12.118343 60.335695-7.68064 18.689557-19.713643 34.648221-35.842987 45.230436l-0.512043 9.387449c1.450788 13.39845 11.43562 23.297941 11.43562 23.297941l68.528377 28.162347C564.356363 708.496375 554.456871 808.344695 554.456871 808.344695zM903.755313 761.23677 704.144012 761.23677c-20.311026 0-36.781732-15.958663-36.781732-35.672306 0-19.628302 16.470706-35.672306 36.781732-35.672306l199.611301 0c20.311026 0 36.781732 15.958663 36.781732 35.672306C940.537045 745.278107 924.066339 761.23677 903.755313 761.23677zM903.755313 615.304609 679.651304 615.304609c-20.311026 0-36.781732-15.958663-36.781732-35.672306 0-19.628302 16.470706-35.672306 36.781732-35.672306l224.104009 0c20.311026 0 36.781732 15.958663 36.781732 35.672306C940.537045 599.431286 924.066339 615.304609 903.755313 615.304609zM903.755313 472.786066 581.595133 472.786066c-20.311026 0-36.781732-15.958663-36.781732-35.586966 0-19.713643 16.470706-35.672306 36.781732-35.672306l322.16018 0c20.311026 0 36.781732 15.958663 36.781732 35.672306C940.537045 456.912743 924.066339 472.786066 903.755313 472.786066z" p-id="1574" fill="#bfcbd9"></path></svg>
\ No newline at end of file
diff --git a/leave-school-vue/src/mock/index.js b/leave-school-vue/src/mock/index.js
index 475cf75..06d547e 100644
--- a/leave-school-vue/src/mock/index.js
+++ b/leave-school-vue/src/mock/index.js
@@ -17,6 +17,7 @@
import leavestudentApi from './leavestudent'
import nodereportApi from './nodereport'
import deptreportApi from './deptreport'
+import majorreportApi from './majorreport'
import leaveschoolnodeApi from './leaveschoolnode'
@@ -111,6 +112,9 @@
// 院系统计报表查询
Mock.mock(/\/api\/statistical\/deptreport\/list-api/, 'get', deptreportApi.getList)
+// 专业统计报表查询
+Mock.mock(/\/api\/statistical\/majorreport\/list-api/, 'get', majorreportApi.getList)
+
// 离校环节管理
Mock.mock(/\/api\/procedures\/node\/list-api/, 'get', leaveschoolnodeApi.getList)
Mock.mock(/\/api\/procedures\/node\/create-node/, 'post', leaveschoolnodeApi.createData)
diff --git a/leave-school-vue/src/mock/majorreport.js b/leave-school-vue/src/mock/majorreport.js
new file mode 100644
index 0000000..ad2be90
--- /dev/null
+++ b/leave-school-vue/src/mock/majorreport.js
@@ -0,0 +1,39 @@
+import Mock from 'mockjs'
+import { param2Obj } from '@/utils'
+
+const recordList = Mock.mock({
+ 'list|4': [{
+ 'id': '@increment',
+ 'zy|1': ['市场营销', '人力资源管理', '自动化'],
+ 'zyid|1': [27, 28, 29],
+ 'zylx|1-1000': 100,
+ 'bzylx|1-1000': 100
+ }]
+}).list
+
+export default{
+ getList: config => {
+ const { pcmc, yx, pageIndex = 1, pageSize = 20 } = param2Obj(config.url)
+ const mockList = recordList.filter(item => {
+ if (pcmc && item.pcmc + '' !== pcmc + '') return false
+ if (yx && item.yx && item.yx + '' !== yx + '') return false
+ return true
+ })
+
+ const pageList = mockList.filter((item, index) => index < pageSize * pageIndex && index >= pageSize * (pageIndex - 1))
+ return {
+ items: pageList,
+ recordCount: mockList.length,
+ code: 200
+ }
+ },
+ getLeaveAuditResult: config => {
+ return {
+ data: {
+ zylx: 100,
+ bzylx: 200
+ },
+ code: 200
+ }
+ }
+}
diff --git a/leave-school-vue/src/mock/menulist.js b/leave-school-vue/src/mock/menulist.js
index 4e0c3fa..a854108 100644
--- a/leave-school-vue/src/mock/menulist.js
+++ b/leave-school-vue/src/mock/menulist.js
@@ -161,6 +161,12 @@
hidden: true,
resource: '/views/statistical/deptsectionrep/index',
meta: { title: '院系各部门统计报表', icon: 'deptsectionrep' }
+ },
+ {
+ path: 'majorreport',
+ code: 'majorreport',
+ resource: '/views/statistical/majorreport/index',
+ meta: { title: '专业统计报表查询', icon: 'majorreport' }
}
]
}
diff --git a/leave-school-vue/src/views/statistical/deptreport/index.vue b/leave-school-vue/src/views/statistical/deptreport/index.vue
index 27932a2..f69e393 100644
--- a/leave-school-vue/src/views/statistical/deptreport/index.vue
+++ b/leave-school-vue/src/views/statistical/deptreport/index.vue
@@ -62,11 +62,6 @@
tableheight: 500,
year: (new Date()).getFullYear() + 2,
pcmcList: [],
- yxList: [],
- zyList: [],
- xbList: [],
- xslbList: [],
- jbxx: {},
queryparam: {}
}
},
@@ -127,7 +122,7 @@
myChart.on('click', function(params) {
that.listQuery.yx = option.xAxis.yxiddata[params.seriesIndex]
// 命名的路由
- that.$router.push({ name: 'deptsectionrep', params: that.listQuery })
+ that.$router.push({ name: 'deptsectionrep', params: Object.assign({}, that.listQuery) })
})
})
},
diff --git a/leave-school-vue/src/views/statistical/deptsectionrep/index.vue b/leave-school-vue/src/views/statistical/deptsectionrep/index.vue
index 97a015e..6484d3c 100644
--- a/leave-school-vue/src/views/statistical/deptsectionrep/index.vue
+++ b/leave-school-vue/src/views/statistical/deptsectionrep/index.vue
@@ -151,12 +151,6 @@
initZyList() {
getZyListByYx({ yx: this.listQuery.yx }).then(response => {
this.zyList = response.items
- // TODO 坑,this.listQuery.zy == null 直接赋值,专业下拉框选择出bug,无法选择,原因未知
- for (const attr in this.listQuery) {
- if (attr === 'zy') {
- this.listQuery['zy'] = null
- }
- }
})
},
initBmList() {
diff --git a/leave-school-vue/src/views/statistical/majorreport/index.vue b/leave-school-vue/src/views/statistical/majorreport/index.vue
new file mode 100644
index 0000000..460e312
--- /dev/null
+++ b/leave-school-vue/src/views/statistical/majorreport/index.vue
@@ -0,0 +1,172 @@
+<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.pcmc" placeholder="批次名称">
+ </el-select>
+ </el-col>
+ <el-col :span="4">
+ <el-select clearable class="filter-item" v-model="listQuery.yx" placeholder="院系">
+ <el-option v-for="item in yxList" :key="item.id" :label="item.dwmc" :value="item.id">
+ </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="handleReset" type="primary" icon="el-icon-edit">重置</el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <el-table :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.zy}}
+ </template>
+ </el-table-column>
+ <el-table-column label="准予离校" align="center">
+ <template slot-scope="scope">
+ {{scope.row.zylx}}
+ </template>
+ </el-table-column>
+ <el-table-column label="不准予离校" align="center">
+ <template slot-scope="scope">
+ {{scope.row.bzylx}}
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-col :span="24">
+ <el-card>
+ <div id="myChart" :style="{width: '100%', height: '300px'}"></div>
+ </el-card>
+ </el-col>
+ <el-dialog title="详情" :visible.sync="dialogFormVisible" width="80%" top="2vh">
+ <audit-student-list :tableheight="tableheight" :queryparam="queryparam"></audit-student-list>
+ </el-dialog>
+ </div>
+</template>
+
+<script>
+import { getList } from '@/api/majorreport-api'
+import { getDeptList } from '@/api/department-api'
+import waves from '@/directive/waves' // 水波纹指令
+import { resetForm } from '@/utils'
+import { crudPageList } from '@/utils/crud'
+import mixindata from '@/utils/crud'
+import AuditStudentList from '@/components/AuditStudentList'
+
+export default {
+ name: 'class',
+ components: { AuditStudentList },
+ directives: {
+ waves
+ },
+ mixins: [mixindata],
+ data() {
+ return {
+ tableheight: 500,
+ year: (new Date()).getFullYear() + 2,
+ pcmcList: [],
+ yxList: [],
+ queryparam: {}
+ }
+ },
+ created() {
+ this.initYxList()
+ this.handlePageList()
+ this.tableheight = window.innerHeight - 320
+ },
+ methods: {
+ drawLine() {
+ const that = this
+ this.$nextTick(function() {
+ const xdata = []
+ const zyiddata = []
+ const zylxdata = []
+ const bzylxdata = []
+ for (const item of this.items) {
+ xdata.push(item.zy)
+ zyiddata.push(item.zyid)
+ zylxdata.push(item.zylx)
+ bzylxdata.push(item.bzylx)
+ }
+ // 基于准备好的dom,初始化echarts实例
+ const myChart = window.echarts.init(document.getElementById('myChart'))
+ // 绘制图表
+ const option = {
+ tooltip: {
+ trigger: 'axis'
+ },
+ toolbox: {
+ feature: {
+ saveAsImage: {}
+ }
+ },
+ xAxis: {
+ type: 'category',
+ data: xdata,
+ zyiddata: zyiddata
+ },
+ yAxis: {
+ type: 'value'
+ },
+ legend: {
+ data: ['准予离校', '不准予离校']
+ },
+ series: [
+ {
+ name: '准予离校',
+ type: 'bar',
+ data: zylxdata
+ },
+ {
+ name: '不准予离校',
+ type: 'bar',
+ data: bzylxdata
+ }]
+ }
+ myChart.setOption(option)
+ myChart.on('click', function(params) {
+ that.listQuery.zy = option.xAxis.zyiddata[params.seriesIndex]
+ // 命名的路由
+ // params不能直接传递that.listQuery,否则跳转页面的级联下拉框有bug,无法选择,可传递复制对象
+ that.$router.push({ name: 'deptsectionrep', params: Object.assign({}, that.listQuery) })
+ })
+ })
+ },
+ initYxList() {
+ getDeptList().then(response => {
+ this.yxList = response.items
+ })
+ },
+ handlePageList() {
+ crudPageList(this, getList, this.drawLine)
+ },
+ handleReset() {
+ resetForm(this.listQuery)
+ },
+ handleFilter() {
+ this.listQuery.pageIndex = 1
+ this.handlePageList()
+ },
+ showDetail(hjid, shzt) {
+ this.listQuery['hjid'] = hjid
+ this.listQuery['shzt'] = shzt
+ this.queryparam = Object.assign({}, this.listQuery)
+ this.dialogFormVisible = true
+ }
+ }
+}
+</script>
+<style scoped>
+.app-container a {
+ color: #00a4f4;
+ text-decoration: none;
+}
+.el-card {
+ margin: 5px;
+}
+</style>
+