Browse Source

bug-6540 考试管理:删除按钮失效,已取消考试无法删除

ZhuJiaHao 7 months ago
parent
commit
94f57fc5b1
1 changed files with 42 additions and 0 deletions
  1. 42 0
      src/views/platform/examination/exam/list.vue

+ 42 - 0
src/views/platform/examination/exam/list.vue

@@ -715,6 +715,7 @@ export default {
          * 删除考试
          */
         handleRemove (ids) {
+            /*
             if (!ids || !ids.length) {
                 return this.$message.warning('请选择要删除的考试!')
             }
@@ -742,6 +743,47 @@ export default {
                 //     this.search()
                 // })
             })
+            */
+          
+         
+          
+          if (!ids || !ids.length) {
+            return this.$message.warning('请选择要删除的考试!')
+          }
+          this.$confirm(
+            '将删除所选考试及已产生的试卷数据,数据删除后无法恢复,确定要继续吗?',
+            '提示',
+            {
+              confirmButtonText: '确认',
+              cancelButtonText: '取消',
+              type: 'warning',
+              showClose: false,
+              closeOnClickModal: false
+            }
+          ).then(() => {
+            removeFormData({
+              formKey: 'examForDelete',
+              ids: ids.join(',')
+            })
+              .then(() => {
+                Promise.all([
+                  this.$common.request('delete', {
+                    tableName: 'IBPS_PARTY_USER_CALENDAR',
+                    paramWhere: { data_source_id_: ids.join(',') }
+                  }),
+                  this.$common.request('delete', {
+                    tableName: 'IBPS_MSG_INNER',
+                    paramWhere: { wai_jian_: ids.join(',') }
+                  })
+                ]).then((res) => {
+                  this.search()
+                  this.$message.success('删除成功!')
+                })
+              })
+              .catch(() => {})
+          })
+        
+
         },
         transformUser (userId) {
             const user = this.userList.find(u => u.userId === userId) || {}