En route 1 рік тому
батько
коміт
994fe7b0b2

+ 6 - 0
src/pages/person-center/my-course/components/dialogForm.vue

@@ -144,6 +144,9 @@ export default {
                   this.$message.warning(res.msg || "预约失败,请重新预约");
                 }
               })
+              .catch(err => {
+                this.$message.warning(err.msg || "预约失败,请重新预约");
+              })
               .finally(() => {
                 this.loading = false;
               });
@@ -206,6 +209,9 @@ export default {
                   })
                   .catch(_ => {});
               })
+              .catch(err => {
+                this.$message.warning(err.msg);
+              })
               .finally(() => {
                 this.loading = false;
               });

+ 46 - 36
src/pages/person-center/my-examination/appointment-add-kp/index.vue

@@ -42,16 +42,16 @@
               <el-option
                 :label="
                   item.dataTime +
-                  ' ' +
-                  item.startTime +
-                  ' ~ ' +
-                  item.endTime +
-                  `已报:${item.registration}/ ${item.num} ` +
-                  (item.status === 2
-                    ? '预约名额已满'
-                    : item.status === 1
-                    ? '此时段您已经有其他考试预约'
-                    : '')
+                    ' ' +
+                    item.startTime +
+                    ' ~ ' +
+                    item.endTime +
+                    `已报:${item.registration}/ ${item.num} ` +
+                    (item.status === 2
+                      ? '预约名额已满'
+                      : item.status === 1
+                      ? '此时段您已经有其他考试预约'
+                      : '')
                 "
                 :value="index"
                 :disabled="item.status !== 0"
@@ -121,11 +121,11 @@ export default {
       dataId: "",
       orderGoodsId: "",
       addressName: "",
-      applyDs: {},
+      applyDs: {}
     };
   },
   computed: {
-    ...mapGetters(["getApplyData"]),
+    ...mapGetters(["getApplyData"])
   },
   mounted() {
     this.applyId = this.$route.query.applyId;
@@ -144,11 +144,11 @@ export default {
         closeOnPressEscape: false,
         showCancelButton: false,
         distinguishCancelAndClose: false,
-        showClose: false,
+        showClose: false
       }
     )
-      .then((_) => {})
-      .catch((_) => {});
+      .then(_ => {})
+      .catch(_ => {});
     this.getApplysubscribeApplySiteTrain();
   },
   methods: {
@@ -157,14 +157,12 @@ export default {
     },
     viewAppointment() {
       this.$router.push({
-        path: "/person-center/my-examination",
+        path: "/person-center/my-examination"
       });
     },
     addressChange() {
       var self = this;
-      const index = this.listData.findIndex(
-        (item) => item.id == this.addressId
-      );
+      const index = this.listData.findIndex(item => item.id == this.addressId);
       if (index === -1) {
         // uni.showToast({
         // 	title: '请选择考前培训地点',
@@ -176,9 +174,9 @@ export default {
       this.addressName = this.listData[index].siteAddress;
       this.addressId = this.listData[index].id;
       var arrays = [];
-      this.listData[index].examUserApplySiteTime.forEach((item) => {
+      this.listData[index].examUserApplySiteTime.forEach(item => {
         if (item.examTime < self.applyDs.applySiteExamTime) {
-          item.examApplySiteTimeTwoVo.forEach((items) => {
+          item.examApplySiteTimeTwoVo.forEach(items => {
             arrays.push({
               examTime: item.examTime,
               startTimeC: items.startTime,
@@ -196,7 +194,7 @@ export default {
                   ? items.status
                   : items.registration >= items.num
                   ? 2
-                  : items.status,
+                  : items.status
             });
           });
         }
@@ -218,7 +216,7 @@ export default {
     getApplysubscribeApplySiteTrain() {
       this.$request
         .getApplysubscribeApplySiteTrain({ applyId: this.applyId })
-        .then((res) => {
+        .then(res => {
           res.data.forEach((item, index) => {
             item.checked = false;
           });
@@ -239,43 +237,55 @@ export default {
             applySiteAddressTrain: self.addressName,
             applySiteExamTrainTime: copyData[index].examTime,
             applySiteStartTrainTime: copyData[index].startTimeC,
-            applySiteEndTrainTime: copyData[index].endTimeC,
+            applySiteEndTrainTime: copyData[index].endTimeC
           };
           let newObj = {};
           Object.assign(newObj, data, self.applyDs);
           self.$request
             .addApply(newObj)
-            .then((res) => {
-              this.showDetailModal = true;
+            .then(res => {
+              if (res.code == 200) {
+                this.showDetailModal = true;
+              } else {
+                this.$message.warning(res.msg || "预约失败,请重新预约");
+              }
             })
-            .catch((err) => {
+            .catch(err => {
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             });
         } else {
           var data = JSON.parse(JSON.stringify(self.applyDs));
           self.$request
             .addApply(data)
-            .then((res) => {
-              this.showDetailModal = true;
+            .then(res => {
+              if (res.code == 200) {
+                this.showDetailModal = true;
+              } else {
+                this.$message.warning(res.msg || "预约失败,请重新预约");
+              }
             })
-            .catch((err) => {
+            .catch(err => {
               this.$message({
                 type: "warning",
-                message: err.msg,
+                message: err.msg
               });
             });
         }
       } else {
         var data = JSON.parse(JSON.stringify(self.applyDs));
-        self.$request.addApply(data).then((res) => {
-          this.showDetailModal = true;
+        self.$request.addApply(data).then(res => {
+          if (res.code == 200) {
+            this.showDetailModal = true;
+          } else {
+            this.$message.warning(res.msg || "预约失败,请重新预约");
+          }
         });
       }
-    },
-  },
+    }
+  }
 };
 </script>