|
@@ -45,11 +45,13 @@ const { mapActions: schPlan } = createNamespacedHelpers('schPlan');
|
|
|
const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
const { mapActions: imports } = createNamespacedHelpers('schimport');
|
|
|
const { mapActions: classtype } = createNamespacedHelpers('classtype');
|
|
|
+const { mapActions: student } = createNamespacedHelpers('student');
|
|
|
export default {
|
|
|
name: 'detail',
|
|
|
props: {},
|
|
|
components: { listFrame, dataTable },
|
|
|
data: function() {
|
|
|
+ var _this = this;
|
|
|
return {
|
|
|
dialog: false,
|
|
|
info: {},
|
|
@@ -67,6 +69,7 @@ export default {
|
|
|
label: '上报名单',
|
|
|
icon: 'el-icon-document',
|
|
|
method: 'namelist',
|
|
|
+ display: i => !i.is_upload,
|
|
|
},
|
|
|
{
|
|
|
label: '查看名单',
|
|
@@ -88,6 +91,7 @@ export default {
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...student({ getStudent: 'query' }),
|
|
|
...classtype({ getClasstype: 'query' }),
|
|
|
...trainplan({ getTrainplan: 'fetch' }),
|
|
|
...imports(['create']),
|
|
@@ -107,6 +111,7 @@ export default {
|
|
|
return wbout;
|
|
|
},
|
|
|
async search() {
|
|
|
+ const msg = this.$message({ message: '正在加载中', duration: 0 });
|
|
|
let tp = await this.getTrainplan(this.id);
|
|
|
if (this.$checkRes(tp)) {
|
|
|
this.$set(this, `plan`, tp.data);
|
|
@@ -131,11 +136,15 @@ export default {
|
|
|
resArr.push({ ...obj, ...arr });
|
|
|
}
|
|
|
resArr = _.orderBy(resArr, ['term', 'batch'], ['asc', 'asc']);
|
|
|
+ resArr = await this.checkUpload(resArr);
|
|
|
+ console.log(resArr);
|
|
|
this.$set(this, `info`, res.data);
|
|
|
this.$set(this, `list`, resArr);
|
|
|
+ msg.close();
|
|
|
+ this.$message.success('加载完成!');
|
|
|
}
|
|
|
},
|
|
|
- toNamelist({ data }) {
|
|
|
+ async toNamelist({ data }) {
|
|
|
this.$set(this, `form`, JSON.parse(JSON.stringify(data)));
|
|
|
this.dialog = true;
|
|
|
},
|
|
@@ -156,7 +165,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
toView({ data }) {
|
|
|
- this.$router.push({ path: './student', query: { termid: data.termid } });
|
|
|
+ this.$router.push({ path: './student', query: { termid: data.termid, batchid: data.batchid } });
|
|
|
},
|
|
|
async getOtherList() {
|
|
|
const res = await this.getClasstype();
|
|
@@ -168,6 +177,20 @@ export default {
|
|
|
if (res) return res.name;
|
|
|
}
|
|
|
},
|
|
|
+ async checkUpload(list) {
|
|
|
+ for (const i of list) {
|
|
|
+ const { termid, batchid } = i;
|
|
|
+ const r = await this.getStudent({ termid, batchid, schid: this.user.code, skip: 0, limit: 1 });
|
|
|
+ if (this.$checkRes(r)) {
|
|
|
+ const { total } = r;
|
|
|
+ console.log(total);
|
|
|
+ i.is_upload = total > 0;
|
|
|
+ } else {
|
|
|
+ i.is_upload = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|