|
@@ -559,7 +559,6 @@ import {
|
|
paperDetailDeleteApi,
|
|
paperDetailDeleteApi,
|
|
paperQuestionMoveApi,
|
|
paperQuestionMoveApi,
|
|
paperQuestionDeleteApi,
|
|
paperQuestionDeleteApi,
|
|
- paperQuestionUnitDeleteApi,
|
|
|
|
paperQuestionSaveApi,
|
|
paperQuestionSaveApi,
|
|
paperDetailAddQuestionApi,
|
|
paperDetailAddQuestionApi,
|
|
} from "../api";
|
|
} from "../api";
|
|
@@ -621,9 +620,7 @@ export default {
|
|
return this.$store.state.user;
|
|
return this.$store.state.user;
|
|
},
|
|
},
|
|
enableCardEdit() {
|
|
enableCardEdit() {
|
|
- return (
|
|
|
|
- this.paper.auditStatus === "PASS" && this.paper.paperType === "GENERATE"
|
|
|
|
- );
|
|
|
|
|
|
+ return this.paper.auditStatus === "PASS";
|
|
},
|
|
},
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -693,7 +690,7 @@ export default {
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
if (confirm !== "confirm") return;
|
|
if (confirm !== "confirm") return;
|
|
|
|
|
|
- const res = await paperDeleteApi(this.paper).catch((error) => {
|
|
|
|
|
|
+ const res = await paperDeleteApi(this.paper.id).catch((error) => {
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "error",
|
|
type: "error",
|
|
message: error.response.data.desc,
|
|
message: error.response.data.desc,
|
|
@@ -702,7 +699,6 @@ export default {
|
|
|
|
|
|
if (!res) return;
|
|
if (!res) return;
|
|
this.$message.success("删除成功!");
|
|
this.$message.success("删除成功!");
|
|
- window.history.go(-1);
|
|
|
|
this.toBack();
|
|
this.toBack();
|
|
},
|
|
},
|
|
// 导入答案
|
|
// 导入答案
|
|
@@ -968,29 +964,15 @@ export default {
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
if (confirm !== "confirm") return;
|
|
if (confirm !== "confirm") return;
|
|
|
|
|
|
- if (this.paper.paperType == "GENERATE") {
|
|
|
|
- const res = await paperQuestionDeleteApi(paperDetailUnit.id).catch(
|
|
|
|
- (error) => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: error.response.data.desc,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- if (!res) return;
|
|
|
|
- } else {
|
|
|
|
- let questionId = paperDetailUnit.question.id;
|
|
|
|
- const res = await paperQuestionUnitDeleteApi({
|
|
|
|
- unitid: paperDetailUnit.id,
|
|
|
|
- questionId,
|
|
|
|
- }).catch((error) => {
|
|
|
|
|
|
+ const res = await paperQuestionDeleteApi(paperDetailUnit.id).catch(
|
|
|
|
+ (error) => {
|
|
this.$notify({
|
|
this.$notify({
|
|
type: "error",
|
|
type: "error",
|
|
message: error.response.data.desc,
|
|
message: error.response.data.desc,
|
|
});
|
|
});
|
|
- });
|
|
|
|
- if (!res) return;
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (!res) return;
|
|
|
|
|
|
this.$message.success("操作成功!");
|
|
this.$message.success("操作成功!");
|
|
this.initPaper();
|
|
this.initPaper();
|