|
@@ -23,6 +23,8 @@ const { mapActions: completion } = createNamespacedHelpers('completion');
|
|
|
const { mapActions: classes } = createNamespacedHelpers('classes');
|
|
|
const { mapActions: termquest } = createNamespacedHelpers('termquest');
|
|
|
const { mapActions: questionnaire } = createNamespacedHelpers('questionnaire');
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
+
|
|
|
export default {
|
|
|
metaInfo: { title: '问卷进度查看' },
|
|
|
name: 'completion',
|
|
@@ -35,7 +37,10 @@ export default {
|
|
|
{ label: '进度', prop: 'completion' },
|
|
|
],
|
|
|
classes: {},
|
|
|
- questFields: [{ label: '标题', prop: 'name' }],
|
|
|
+ questFields: [
|
|
|
+ { label: '标题', prop: 'name' },
|
|
|
+ { label: '类型', prop: 'type', format: i => (i == 0 ? '常用问卷' : '非常用问卷') },
|
|
|
+ ],
|
|
|
questList: [],
|
|
|
quest: [],
|
|
|
opera: [
|
|
@@ -57,23 +62,31 @@ export default {
|
|
|
...completion({ getCompletion: 'query' }),
|
|
|
...classes({ getClass: 'fetch' }),
|
|
|
...termquest({ getTermQuestList: 'query' }),
|
|
|
- ...questionnaire({ getQuestionnaireList: 'query' }),
|
|
|
+ ...questionnaire({ getQuestionnaireList: 'query', allFetch: 'mergeRequest' }),
|
|
|
+ ...util({ modelFetch: 'fetch' }),
|
|
|
async search() {
|
|
|
//查询班级信息,获得期,批次
|
|
|
let res = await this.getClass(this.id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `classes`, res.data);
|
|
|
}
|
|
|
+ let ql = [];
|
|
|
//查询所有问卷
|
|
|
- const quest = await this.getQuestionnaireList();
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `quest`, quest.data);
|
|
|
+ const quest = await this.getQuestionnaireList({ type: 0 });
|
|
|
+ if (this.$checkRes(quest)) {
|
|
|
+ ql = ql.concat(quest.data);
|
|
|
+ // this.$set(this, `quest`, quest.data);
|
|
|
}
|
|
|
//查询这期的所有问卷,id=>数据
|
|
|
- res = await this.getTermQuestList({ termid: this.classes.termid });
|
|
|
- let { questionnaireid, termid, ...othrers } = res.data[0];
|
|
|
- let newArr = this.quest.filter(q => (_.find(questionnaireid, sq => sq === q.id) ? q : ''));
|
|
|
- this.$set(this, `questList`, newArr);
|
|
|
+ let rql = await this.modelFetch({ model: 'termquest', termid: this.classes.termid });
|
|
|
+ if (this.$checkRes(rql)) {
|
|
|
+ let ids = _.get(rql.data, `questionnaireid`);
|
|
|
+ if (ids) {
|
|
|
+ let questList = await this.allFetch({ method: 'fetch', data: ids });
|
|
|
+ ql = ql.concat(questList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this, `questList`, ql);
|
|
|
},
|
|
|
async toView({ data }, type) {
|
|
|
this.views = type;
|