|
@@ -125,7 +125,8 @@ import {
|
|
areaList,
|
|
areaList,
|
|
markTaskInfo,
|
|
markTaskInfo,
|
|
checkMarkTaskCanSubmit,
|
|
checkMarkTaskCanSubmit,
|
|
- publishScoreTask
|
|
|
|
|
|
+ publishScoreTask,
|
|
|
|
+ checkMarkTaskSubmitType
|
|
} from "@/api";
|
|
} from "@/api";
|
|
import { calcSum } from "@/plugins/utils";
|
|
import { calcSum } from "@/plugins/utils";
|
|
import { SORT_ORDER_TYPE, BOOLEAN_TYPE } from "@/constants/enumerate";
|
|
import { SORT_ORDER_TYPE, BOOLEAN_TYPE } from "@/constants/enumerate";
|
|
@@ -140,6 +141,7 @@ export default {
|
|
questionId: "",
|
|
questionId: "",
|
|
SORT_ORDER_TYPE,
|
|
SORT_ORDER_TYPE,
|
|
BOOLEAN_TYPE,
|
|
BOOLEAN_TYPE,
|
|
|
|
+ taskHasSubmitAll: false,
|
|
canSubmitTask: true,
|
|
canSubmitTask: true,
|
|
isSubmit: false,
|
|
isSubmit: false,
|
|
taskList: [],
|
|
taskList: [],
|
|
@@ -203,10 +205,14 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async initData() {
|
|
async initData() {
|
|
|
|
+ await this.checkSubmitType();
|
|
await this.getAreaList();
|
|
await this.getAreaList();
|
|
this.questionId = this.areas[0].id;
|
|
this.questionId = this.areas[0].id;
|
|
this.areaChange();
|
|
this.areaChange();
|
|
},
|
|
},
|
|
|
|
+ async checkSubmitType() {
|
|
|
|
+ this.taskCanSubmitAll = await checkMarkTaskSubmitType(this.subjectId);
|
|
|
|
+ },
|
|
async getAreaList() {
|
|
async getAreaList() {
|
|
const data = await areaList({
|
|
const data = await areaList({
|
|
workId: this.workId,
|
|
workId: this.workId,
|
|
@@ -219,6 +225,13 @@ export default {
|
|
areaCode: item.areaCode
|
|
areaCode: item.areaCode
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ if (this.areas.length > 1 && this.taskCanSubmitAll) {
|
|
|
|
+ this.areas.push({
|
|
|
|
+ id: 0,
|
|
|
|
+ areaName: "全部",
|
|
|
|
+ areaCode: "all"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async checkCanSubmitTask() {
|
|
async checkCanSubmitTask() {
|
|
this.canSubmitTask = await checkMarkTaskCanSubmit(
|
|
this.canSubmitTask = await checkMarkTaskCanSubmit(
|
|
@@ -267,7 +280,7 @@ export default {
|
|
let result = true;
|
|
let result = true;
|
|
await publishScoreTask({
|
|
await publishScoreTask({
|
|
subjectId: this.subjectId,
|
|
subjectId: this.subjectId,
|
|
- questionId: this.questionId,
|
|
|
|
|
|
+ questionId: this.questionId || null,
|
|
taskList: this.taskList
|
|
taskList: this.taskList
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
result = false;
|
|
result = false;
|
|
@@ -276,7 +289,7 @@ export default {
|
|
if (!result) return;
|
|
if (!result) return;
|
|
this.$Message.success("任务创建成功!");
|
|
this.$Message.success("任务创建成功!");
|
|
this.cancel();
|
|
this.cancel();
|
|
- this.areaChange();
|
|
|
|
|
|
+ this.initData();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|