|
@@ -8,7 +8,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <to-export></to-export>
|
|
|
|
|
|
+ <export-range @getStudent="toGetStudent" :studentList="studentList" @toExport="toExport"></export-range>
|
|
<data-table :fields="fields" :data="list" :opera="opera" @view="toView" @delete="toDelete"></data-table>
|
|
<data-table :fields="fields" :data="list" :opera="opera" @view="toView" @delete="toDelete"></data-table>
|
|
</list-frame>
|
|
</list-frame>
|
|
<el-dialog :visible.sync="dialog" title="培训心得" @close="toClose" width="30%">
|
|
<el-dialog :visible.sync="dialog" title="培训心得" @close="toClose" width="30%">
|
|
@@ -25,7 +25,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
-import toExport from './parts/experience-export.vue';
|
|
|
|
|
|
+import exportRange from '@/components/export-range.vue';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import listFrame from '@frame/layout/admin/list-frame';
|
|
import dataForm from '@frame/components/form';
|
|
import dataForm from '@frame/components/form';
|
|
import dataTable from '@frame/components/data-table';
|
|
import dataTable from '@frame/components/data-table';
|
|
@@ -33,6 +33,7 @@ import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions: experience } = createNamespacedHelpers('experience');
|
|
const { mapActions: experience } = createNamespacedHelpers('experience');
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
const { mapActions: trainplan } = createNamespacedHelpers('trainplan');
|
|
|
|
+const { mapActions: student } = createNamespacedHelpers('student');
|
|
export default {
|
|
export default {
|
|
metaInfo: { title: '培训心得' },
|
|
metaInfo: { title: '培训心得' },
|
|
name: 'experience',
|
|
name: 'experience',
|
|
@@ -41,7 +42,7 @@ export default {
|
|
listFrame,
|
|
listFrame,
|
|
dataTable,
|
|
dataTable,
|
|
dataForm,
|
|
dataForm,
|
|
- toExport,
|
|
|
|
|
|
+ exportRange,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
opera: [
|
|
opera: [
|
|
@@ -62,6 +63,7 @@ export default {
|
|
],
|
|
],
|
|
list: [],
|
|
list: [],
|
|
classList: [],
|
|
classList: [],
|
|
|
|
+ studentList: [],
|
|
searchInfo: {},
|
|
searchInfo: {},
|
|
total: 0,
|
|
total: 0,
|
|
dialog: false,
|
|
dialog: false,
|
|
@@ -79,7 +81,8 @@ export default {
|
|
computed: { ...mapState(['user', 'defaultOption']) },
|
|
computed: { ...mapState(['user', 'defaultOption']) },
|
|
methods: {
|
|
methods: {
|
|
...classes({ getClass: 'query' }),
|
|
...classes({ getClass: 'query' }),
|
|
- ...experience(['query']),
|
|
|
|
|
|
+ ...student({ getStudent: 'query' }),
|
|
|
|
+ ...experience(['query', 'export']),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
this.$set(this, `total`, 0);
|
|
this.$set(this, `total`, 0);
|
|
const res = await this.query({ ...this.searchInfo, skip, limit });
|
|
const res = await this.query({ ...this.searchInfo, skip, limit });
|
|
@@ -106,6 +109,20 @@ export default {
|
|
this.$set(this, `classList`, duplicate);
|
|
this.$set(this, `classList`, duplicate);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async toGetStudent(classid) {
|
|
|
|
+ const bzres = await this.getStudent({ classid, job: '班长' });
|
|
|
|
+ const xwres = await this.getStudent({ classid, job: '学委' });
|
|
|
|
+ let arr = [];
|
|
|
|
+ if (this.$checkRes(bzres)) arr = [...arr, ...bzres.data];
|
|
|
|
+ if (this.$checkRes(xwres)) arr = [...arr, ...xwres.data];
|
|
|
|
+ this.$set(this, `studentList`, arr);
|
|
|
|
+ },
|
|
|
|
+ async toExport(data) {
|
|
|
|
+ const res = await this.export(this.form);
|
|
|
|
+ if (this.$checkRes(res, '导出成功', res.errmsg || '导出失败')) {
|
|
|
|
+ window.open(res.data);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 查看
|
|
// 查看
|
|
toView({ data }) {
|
|
toView({ data }) {
|
|
this.$set(this, `form`, data);
|
|
this.$set(this, `form`, data);
|
|
@@ -124,6 +141,12 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ defaultOption: {
|
|
|
|
+ deep: true,
|
|
|
|
+ handler(val, oval) {
|
|
|
|
+ this.getOtherList();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
searchInfo: {
|
|
searchInfo: {
|
|
deep: true,
|
|
deep: true,
|
|
handler(val) {
|
|
handler(val) {
|