|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div id="deal-list">
|
|
|
<detail-frame :title="pageTitle">
|
|
|
- <data-table :fields="fields" :data="list" :total="total" :opera="opera" @edit="toEdit" @download="toDownLoad"></data-table>
|
|
|
+ <data-table :fields="fields" :data="list" :total="total" :opera="opera" @edit="toEdit" @download="toDownLoad" :toFormat="toFormat"></data-table>
|
|
|
<!-- @edit="toEdit" @delete="toDelete" -->
|
|
|
</detail-frame>
|
|
|
<el-dialog title="学校上传人数与规定不符" width="30%" :visible.sync="dialog" @close="toClose">
|
|
@@ -10,9 +10,9 @@
|
|
|
<el-col :span="24">原因:{{ form.reason }}</el-col>
|
|
|
</el-row>
|
|
|
<template #footer>
|
|
|
- <el-row type="flex" align="middle" justify="center">
|
|
|
- <el-col :span="4"><el-button type="primary" plain size="mini">同意入库</el-button></el-col>
|
|
|
- <el-col :span="4"><el-button type="danger" plain size="mini">拒绝入库</el-button></el-col>
|
|
|
+ <el-row type="flex" align="middle" justify="center" v-if="form.isstore == '0'">
|
|
|
+ <el-col :span="4"><el-button type="primary" plain size="mini" @click="toUpdate('1')">同意入库</el-button></el-col>
|
|
|
+ <el-col :span="4"><el-button type="danger" plain size="mini" @click="toUpdate('2')">拒绝入库</el-button></el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -24,6 +24,8 @@ import detailFrame from '@frame/layout/admin/detail-frame';
|
|
|
import _ from 'lodash';
|
|
|
import dataTable from '@frame/components/filter-page-table';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: school } = createNamespacedHelpers('school');
|
|
|
+const { mapActions: classtype } = createNamespacedHelpers('classtype');
|
|
|
export default {
|
|
|
name: 'deal-list',
|
|
|
props: {},
|
|
@@ -46,28 +48,60 @@ export default {
|
|
|
fields: [
|
|
|
{ label: '学校', prop: 'name' },
|
|
|
{ label: '期数', prop: 'term' },
|
|
|
+ { label: '班级类型', prop: 'type', format: true },
|
|
|
+ { label: '入库状态', prop: 'isstore', format: i => (i == '0' ? '未入库' : i == '1' ? '已入库' : '已拒绝') },
|
|
|
{ label: '未入库原因', prop: 'reason' },
|
|
|
],
|
|
|
- list: [{ name: '吉林大学', term: 336, reason: '上报人数超过范围' }],
|
|
|
+ list: [],
|
|
|
form: {},
|
|
|
total: 0,
|
|
|
- options: {},
|
|
|
+ options: undefined,
|
|
|
+ classTypeList: [],
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ this.getOtherList();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ ...classtype({ getClassType: 'query' }),
|
|
|
+ ...school(['getNoticeList', 'updateNoticeStatus']),
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let planid = _.get(this.options, 'planid');
|
|
|
+ const res = await this.getNoticeList({ skip, limit, ...info, planid: planid });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
+ },
|
|
|
toEdit({ data }) {
|
|
|
- // TODO处理有问题的名单,是保留,还是删除,保留就直接导入数据库
|
|
|
this.$set(this, `form`, data);
|
|
|
this.dialog = true;
|
|
|
},
|
|
|
+ async toUpdate(type) {
|
|
|
+ const res = await this.updateNoticeStatus({ id: this.form._id, isstore: type });
|
|
|
+ if (this.$checkRes(res, '保存成功', res.errmsg || '保存失败')) {
|
|
|
+ this.toClose();
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
toDownLoad({ data }) {
|
|
|
- // TODO下载学校上传的名单
|
|
|
+ window.open(data.filepath);
|
|
|
},
|
|
|
toClose() {
|
|
|
this.dialog = false;
|
|
|
this.form = {};
|
|
|
},
|
|
|
+ async getOtherList() {
|
|
|
+ const res = await this.getClassType();
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `classTypeList`, res.data);
|
|
|
+ },
|
|
|
+ toFormat({ model, value }) {
|
|
|
+ if (model == 'type') {
|
|
|
+ console.log('in function:');
|
|
|
+ const res = this.classTypeList.find(f => f.code == value);
|
|
|
+ if (res) return res.name;
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|