|
@@ -129,7 +129,6 @@ export default {
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.search();
|
|
this.search();
|
|
- this.searchQuestion();
|
|
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
@@ -157,10 +156,12 @@ export default {
|
|
async detailBtn(item) {
|
|
async detailBtn(item) {
|
|
this.dialogFormVisible = true;
|
|
this.dialogFormVisible = true;
|
|
this.form = item;
|
|
this.form = item;
|
|
|
|
+ this.searchQuestion();
|
|
this.$nextTick(function() {
|
|
this.$nextTick(function() {
|
|
item.question.forEach(row => {
|
|
item.question.forEach(row => {
|
|
|
|
+ let r = this.questions.find(f => f._id == row._id);
|
|
//this.multipleSelection.push(row);
|
|
//this.multipleSelection.push(row);
|
|
- this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(r);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
console.log(this.multipleSelection);
|
|
console.log(this.multipleSelection);
|
|
@@ -177,7 +178,9 @@ export default {
|
|
//提交问卷
|
|
//提交问卷
|
|
async submitFrom() {
|
|
async submitFrom() {
|
|
this.form.question = this.multipleSelection;
|
|
this.form.question = this.multipleSelection;
|
|
- let res = await this.create(this.form);
|
|
|
|
|
|
+ let res;
|
|
|
|
+ if (this.form.id) res = await this.update(this.form);
|
|
|
|
+ else res = await this.create(this.form);
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
this.search();
|
|
this.search();
|
|
@@ -189,6 +192,7 @@ export default {
|
|
this.qstatus = null;
|
|
this.qstatus = null;
|
|
this.qtype = null;
|
|
this.qtype = null;
|
|
this.form = {};
|
|
this.form = {};
|
|
|
|
+ this.searchQuestion();
|
|
this.multipleSelection = [];
|
|
this.multipleSelection = [];
|
|
},
|
|
},
|
|
//选中问题时触发
|
|
//选中问题时触发
|
|
@@ -200,8 +204,6 @@ export default {
|
|
this.searchQuestion({ skip: (val - 1) * 10, limit: val * 10 });
|
|
this.searchQuestion({ skip: (val - 1) * 10, limit: val * 10 });
|
|
},
|
|
},
|
|
getRowKey(row) {
|
|
getRowKey(row) {
|
|
- console.log(row);
|
|
|
|
-
|
|
|
|
return row._id;
|
|
return row._id;
|
|
},
|
|
},
|
|
},
|
|
},
|