浏览代码

修复取消考试的报错问题;新建考试后刷新列表数据

luoaoxuan 1 年之前
父节点
当前提交
b2823b0996
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 3 3
      src/views/platform/examination/exam/edit.vue
  2. 9 2
      src/views/platform/examination/exam/list.vue

+ 3 - 3
src/views/platform/examination/exam/edit.vue

@@ -611,12 +611,12 @@ export default {
             const params = type === 'add' ? addParams : updateParams
             this.$common.request(type, params).then(() => {
                 this.$message.success(this.id ? '修改考试成功' : '新建考试成功')
-                this.closeDialog()
+                this.closeDialog(true)
             })
         },
         // 关闭当前窗口
-        closeDialog () {
-            this.$emit('close', false)
+        closeDialog (refresh) {
+            this.$emit('close', false, refresh)
         }
     }
 }

+ 9 - 2
src/views/platform/examination/exam/list.vue

@@ -44,7 +44,7 @@
             :visible.sync="showEditDialog"
             :is-disabled="examInfo.state !== '未发布'"
             @callback="search"
-            @close="visible => showEditDialog = visible"
+            @close="dialogClose"
         />
         <exam-detail
             v-if="showDetailDialog"
@@ -213,6 +213,13 @@ export default {
         this.loadData()
     },
     methods: {
+        // 组件关闭事件
+        dialogClose (visible, refresh) {
+            this.showEditDialog = visible
+            if (refresh) {
+                this.loadData()
+            }
+        },
         // 加载数据
         loadData () {
             this.loading = true
@@ -627,7 +634,7 @@ export default {
                         id_: examId
                     },
                     param: {
-                        examState: '已取消'
+                        zhuang_tai_: '已取消'
                     }
                 }]
             }