|
@@ -20,7 +20,6 @@
|
|
<el-form-item prop="batchNo" label="命题任务表:">
|
|
<el-form-item prop="batchNo" label="命题任务表:">
|
|
<upload-file-view
|
|
<upload-file-view
|
|
:upload-url="uploadExamTaskUrl"
|
|
:upload-url="uploadExamTaskUrl"
|
|
- @upload-error="uplaodError"
|
|
|
|
@upload-success="uploadExamTaskSuccess"
|
|
@upload-success="uploadExamTaskSuccess"
|
|
ref="ExamTaskUploadFileView"
|
|
ref="ExamTaskUploadFileView"
|
|
v-if="modalIsShow"
|
|
v-if="modalIsShow"
|
|
@@ -106,7 +105,7 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
- <el-button type="primary" :disabled="isSubmit" @click="save"
|
|
|
|
|
|
+ <el-button type="primary" :disabled="isSubmit" @click="toSave"
|
|
>确认</el-button
|
|
>确认</el-button
|
|
>
|
|
>
|
|
<el-button type="danger" @click="cancel" plain>取消</el-button>
|
|
<el-button type="danger" @click="cancel" plain>取消</el-button>
|
|
@@ -136,6 +135,7 @@ export default {
|
|
modalForm: { ...initModalForm },
|
|
modalForm: { ...initModalForm },
|
|
createTime: [],
|
|
createTime: [],
|
|
tasks: [],
|
|
tasks: [],
|
|
|
|
+ batchConfirmMessage: "",
|
|
rules: {
|
|
rules: {
|
|
batchNo: [
|
|
batchNo: [
|
|
{
|
|
{
|
|
@@ -169,6 +169,7 @@ export default {
|
|
this.modalForm = { ...initModalForm };
|
|
this.modalForm = { ...initModalForm };
|
|
this.tasks = [];
|
|
this.tasks = [];
|
|
this.createTime = [];
|
|
this.createTime = [];
|
|
|
|
+ this.batchConfirmMessage = "";
|
|
|
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.modalFormComp.clearValidate();
|
|
this.$refs.modalFormComp.clearValidate();
|
|
@@ -189,6 +190,22 @@ export default {
|
|
this.modalForm.endTime = "";
|
|
this.modalForm.endTime = "";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ toSave() {
|
|
|
|
+ if (!this.batchConfirmMessage) {
|
|
|
|
+ this.save();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$confirm(`${this.batchConfirmMessage}, 是否继续提交?`, "提示", {
|
|
|
|
+ cancelButtonClass: "el-button--danger is-plain",
|
|
|
|
+ confirmButtonClass: "el-button--primary",
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.save();
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
async save() {
|
|
async save() {
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
if (!valid) return;
|
|
if (!valid) return;
|
|
@@ -217,12 +234,20 @@ export default {
|
|
this.cancel();
|
|
this.cancel();
|
|
},
|
|
},
|
|
// upload-handler
|
|
// upload-handler
|
|
- uplaodError(errorData) {
|
|
|
|
- this.$notify.error({ title: "错误提示", message: errorData.message });
|
|
|
|
- },
|
|
|
|
|
|
+ // uplaodError(errorData) {
|
|
|
|
+ // let message = errorData.message;
|
|
|
|
+ // try {
|
|
|
|
+ // message = JSON.parse(errorData.error);
|
|
|
|
+ // message = message.map(item => item.excelErrorType).join(",");
|
|
|
|
+ // } catch (msg) {
|
|
|
|
+ // console.error(msg);
|
|
|
|
+ // }
|
|
|
|
+ // if (message) this.$notify.error({ title: "错误提示", message });
|
|
|
|
+ // },
|
|
uploadExamTaskSuccess(data) {
|
|
uploadExamTaskSuccess(data) {
|
|
this.$message.success("上传成功!");
|
|
this.$message.success("上传成功!");
|
|
this.modalForm.batchNo = data.batchNo;
|
|
this.modalForm.batchNo = data.batchNo;
|
|
|
|
+ this.batchConfirmMessage = data.errorMsg;
|
|
this.tasks = data.tasks.map(item => {
|
|
this.tasks = data.tasks.map(item => {
|
|
item.userId = item.users.length ? item.users[0].id : "";
|
|
item.userId = item.users.length ? item.users[0].id : "";
|
|
return item;
|
|
return item;
|