Browse Source

修复课程清空问题

wolyshaw 4 years ago
parent
commit
6dd2a8707d
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/views/categroyManager/specialSetup/modals/chargesForm.vue

+ 7 - 4
src/views/categroyManager/specialSetup/modals/chargesForm.vue

@@ -229,8 +229,11 @@ export default {
     }
   },
   watch: {
-    rowDetail() {
-      this.updateForm()
+    rowDetail: {
+      deep: true,
+      handler() {
+        this.updateForm()
+      },
     },
     async 'form.organId'() {
       this.FetchOrganizationCourseUnitPriceSettings()
@@ -246,6 +249,7 @@ export default {
     async FetchOrganizationCourseUnitPriceSettings() {
       try {
         if (this.form.organId && this.form.chargeTypeId) {
+          this.$set(this.form, 'details', [{}])
           const res = await getOrganizationCourseUnitPriceSettings({
             chargeTypeId: this.form.chargeTypeId,
             organId: this.form.organId,
@@ -257,7 +261,6 @@ export default {
             d[item.courseType] = item
           }
           this.courseTypesByType = d
-          this.$set(this.form, 'details', [{}])
         }
       } catch (error) {}
     },
@@ -275,7 +278,7 @@ export default {
     },
     async updateForm() {
       if (this.rowDetail) {
-        const { organId, classTimeList, chargeTypeId, name, details } = this.rowDetail
+        const { organId, classTimeList, chargeTypeId, name } = this.rowDetail
         this.form = {
           organId,
           classTimeList,