Explorar el Código

update notify

deason hace 6 años
padre
commit
eb5cf50d8f

+ 25 - 9
src/modules/print/view/CourseStatistic.vue

@@ -518,6 +518,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -527,6 +528,7 @@ export default {
       let examId = this.formSearch.examId;
       if (checkEmptyNumber(examId)) {
         this.$notify({
+          title: "提示",
           message: "请选择考试!",
           type: "warning"
         });
@@ -563,7 +565,8 @@ export default {
           this.selectDefault();
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -632,6 +635,7 @@ export default {
         .then(() => {
           if (this.selectElements.length == 0) {
             this.$notify({
+              title: "提示",
               message: "请选择要刷新的项!",
               type: "warning"
             });
@@ -653,15 +657,18 @@ export default {
           this.$http.post(url, params).then(
             () => {
               this.$notify({
+                title: "提示",
                 type: "success",
                 message: "刷新成功!"
               });
               this.searchRecords(this.formSearch.pageNo);
             },
-            () => {
+            error => {
+              console.log(error.response);
               this.$notify({
+                title: "错误",
                 type: "error",
-                message: "刷新失败!"
+                message: error.response.data.desc
               });
             }
           );
@@ -675,6 +682,7 @@ export default {
       let url = row.paperPdfUrl;
       if (!url) {
         this.$notify({
+          title: "提示",
           message: "当前试卷不存在!",
           type: "warning"
         });
@@ -730,16 +738,19 @@ export default {
         this.$http.post(url).then(
           () => {
             this.$notify({
+              title: "提示",
               message: "试卷指定成功!",
               type: "success"
             });
             this.allotDialog = false;
             this.searchRecords(this.formSearch.pageNo);
           },
-          () => {
+          error => {
+            console.log(error.response);
             this.$notify({
-              message: "试卷指定失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -770,16 +781,19 @@ export default {
         this.$http.post(url).then(
           () => {
             this.$notify({
+              title: "提示",
               message: "试卷整体分配成功!",
               type: "success"
             });
             this.allotAllDialog = false;
             this.searchRecords(this.formSearch.pageNo);
           },
-          () => {
+          error => {
+            console.log(error.response);
             this.$notify({
-              message: "试卷整体分配失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -805,6 +819,7 @@ export default {
       } else {
         if (this.selectElements.length == 0) {
           this.$notify({
+            title: "提示",
             message: "请选择要导出的项!",
             type: "warning"
           });
@@ -825,6 +840,7 @@ export default {
 
         if (ids.length == 0) {
           this.$notify({
+            title: "提示",
             message: "包含未被指定试卷的课程则不可导出!",
             type: "warning"
           });

+ 20 - 9
src/modules/print/view/ExamStructure.vue

@@ -425,6 +425,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -461,7 +462,8 @@ export default {
           this.selectDefault();
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -543,16 +545,19 @@ export default {
         this.$http.post(url, this.addStructureForm).then(
           () => {
             this.$notify({
+              title: "提示",
               message: "考试结构新增成功!",
               type: "success"
             });
             this.addStructureDialog = false;
             this.searchRecords(1);
           },
-          () => {
+          error => {
+            console.log(error.response);
             this.$notify({
-              message: "考试结构新增失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -589,16 +594,19 @@ export default {
         this.$http.post(url, this.cloneStructureForm).then(
           () => {
             this.$notify({
+              title: "提示",
               message: "考试结构复用成功!",
               type: "success"
             });
             this.cloneStructureDialog = false;
             this.searchRecords(1);
           },
-          () => {
+          error => {
+            console.log(error.response);
             this.$notify({
-              message: "考试结构复用失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -616,15 +624,18 @@ export default {
           this.$http.post(url).then(
             () => {
               this.$notify({
+                title: "提示",
                 type: "success",
                 message: "删除当前结构成功!"
               });
               this.searchRecords(1);
             },
-            () => {
+            error => {
+              console.log(error.response);
               this.$notify({
+                title: "错误",
                 type: "error",
-                message: "删除当前结构失败!"
+                message: error.response.data.desc
               });
             }
           );

+ 9 - 4
src/modules/print/view/Project.vue

@@ -571,6 +571,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -580,6 +581,7 @@ export default {
       let examId = this.formSearch.examId;
       if (checkEmptyNumber(examId)) {
         this.$notify({
+          title: "提示",
           message: "请选择考试!",
           type: "warning"
         });
@@ -616,7 +618,8 @@ export default {
           this.selectDefault();
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -737,6 +740,7 @@ export default {
         this.$http.post(url, this.projectSettingForm).then(
           () => {
             this.$notify({
+              title: "提示",
               type: "success",
               message: "项目设置成功!"
             });
@@ -744,10 +748,11 @@ export default {
             this.searchRecords(1);
           },
           error => {
-            console.log(error);
+            console.log(error.response);
             this.$notify({
-              message: "项目设置失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );

+ 38 - 16
src/modules/print/view/ProjectStatistic.vue

@@ -484,6 +484,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -493,6 +494,7 @@ export default {
       let examId = this.formSearch.examId;
       if (checkEmptyNumber(examId)) {
         this.$notify({
+          title: "提示",
           message: "请选择考试!",
           type: "warning"
         });
@@ -512,8 +514,13 @@ export default {
           this.loading = false;
         },
         error => {
-          console.log(error);
           this.loading = false;
+          console.log(error.response);
+          this.$notify({
+            title: "错误",
+            type: "error",
+            message: error.response.data.desc
+          });
         }
       );
     },
@@ -568,7 +575,8 @@ export default {
           this.selectDefault();
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -599,6 +607,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -608,6 +617,7 @@ export default {
       let examId = this.formSearch.examId;
       if (checkEmptyNumber(examId)) {
         this.$notify({
+          title: "提示",
           message: "请选择考试!",
           type: "warning"
         });
@@ -629,21 +639,24 @@ export default {
           this.$http.post(url).then(
             () => {
               this.$notify({
-                type: "success",
-                message: "刷新成功!"
+                title: "提示",
+                message: "刷新成功!",
+                type: "success"
               });
               this.searchRecords();
             },
-            () => {
+            error => {
+              console.log(error.response);
               this.$notify({
+                title: "错误",
                 type: "error",
-                message: "刷新失败!"
+                message: error.response.data.desc
               });
             }
           );
         })
         .catch(() => {
-          //ignore
+          // ignore
         });
     },
     editBackupSetting() {
@@ -657,16 +670,18 @@ export default {
         this.$http.post(url, this.backupSettingForm).then(
           () => {
             this.$notify({
+              title: "提示",
               type: "success",
               message: "保存备份设置成功!"
             });
             this.backupSettingDialog = false;
           },
           error => {
-            console.log(error);
+            console.log(error.response);
             this.$notify({
-              message: "保存备份设置失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -718,7 +733,8 @@ export default {
           }
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -732,6 +748,7 @@ export default {
         this.$http.post(url, this.otherSettingForm).then(
           () => {
             this.$notify({
+              title: "提示",
               type: "success",
               message: "保存其它事项成功!"
             });
@@ -739,10 +756,11 @@ export default {
             this.searchRecords();
           },
           error => {
-            console.log(error);
+            console.log(error.response);
             this.$notify({
-              message: "保存其它事项失败!",
-              type: "error"
+              title: "错误",
+              type: "error",
+              message: error.response.data.desc
             });
           }
         );
@@ -760,15 +778,18 @@ export default {
           this.$http.post(url).then(
             () => {
               this.$notify({
+                title: "提示",
                 type: "success",
                 message: "删除当前事项成功!"
               });
               this.searchRecords();
             },
-            () => {
+            error => {
+              console.log(error.response);
               this.$notify({
+                title: "错误",
                 type: "error",
-                message: "删除当前事项失败!"
+                message: error.response.data.desc
               });
             }
           );
@@ -781,6 +802,7 @@ export default {
       /* 打开其它事项弹窗 */
       if (checkEmptyNumber(this.projectId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校和考试!",
           type: "warning"
         });

+ 17 - 4
src/modules/print/view/ProjectTemplate.vue

@@ -156,6 +156,7 @@ export default {
       let orgId = this.formSearch.orgId;
       if (checkEmptyNumber(orgId)) {
         this.$notify({
+          title: "提示",
           message: "请选择学校!",
           type: "warning"
         });
@@ -165,6 +166,7 @@ export default {
       let examId = this.formSearch.examId;
       if (checkEmptyNumber(examId)) {
         this.$notify({
+          title: "提示",
           message: "请选择考试!",
           type: "warning"
         });
@@ -200,7 +202,8 @@ export default {
           this.selectDefault();
         },
         error => {
-          console.log(error);
+          console.log(error.response);
+          // ignore
         }
       );
     },
@@ -226,6 +229,7 @@ export default {
       const isLimit = file.size / 1024 / 1024 < 50;
       if (!isLimit) {
         this.$notify({
+          title: "提示",
           message: "上传文件大小不能超过50MB!",
           type: "warning"
         });
@@ -240,6 +244,7 @@ export default {
         /* 考生数据表(1)、考场数据表(2) */
         if (!new RegExp("(.xls|.xlsx)$").test(ext)) {
           this.$notify({
+            title: "提示",
             message: "请选择后缀为.xls或.xlsx的文件!",
             type: "warning"
           });
@@ -249,6 +254,7 @@ export default {
         /* 试卷袋样式(8) */
         if (!new RegExp("(.jpg|.png)$").test(ext)) {
           this.$notify({
+            title: "提示",
             message: "请选择后缀为.jpg或.png的文件!",
             type: "warning"
           });
@@ -258,6 +264,7 @@ export default {
         /* 卷袋贴模板(3)、签到表模板(4)、常规题卡模板(5)、特殊题卡模板(6)、备份卷贴模板(7) */
         if (!new RegExp("(.pdf)$").test(ext)) {
           this.$notify({
+            title: "提示",
             message: "请选择后缀为.pdf的文件!",
             type: "warning"
           });
@@ -278,15 +285,18 @@ export default {
           .then(
             () => {
               this.$notify({
+                title: "提示",
                 message: "上传模板成功!",
                 type: "success"
               });
               this.searchRecords();
             },
-            () => {
+            error => {
+              console.log(error.response);
               this.$notify({
-                message: "上传模板失败!",
-                type: "error"
+                title: "错误",
+                type: "error",
+                message: error.response.data.desc
               });
             }
           );
@@ -295,6 +305,7 @@ export default {
     uploadError(response) {
       console.log(response);
       this.$notify({
+        title: "错误",
         message: "上传文件失败!",
         type: "error"
       });
@@ -304,6 +315,7 @@ export default {
       let url = row.fileUrl;
       if (!url) {
         this.$notify({
+          title: "提示",
           message: "当前模板不存在!",
           type: "warning"
         });
@@ -316,6 +328,7 @@ export default {
       let filePath = row.fileName;
       if (!filePath) {
         this.$notify({
+          title: "提示",
           message: "当前模板不存在!",
           type: "warning"
         });