瀏覽代碼

修复课程清空问题

wolyshaw 4 年之前
父節點
當前提交
6dd2a8707d
共有 1 個文件被更改,包括 7 次插入4 次删除
  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,