diff --git a/src/views/security_commitment/promise_book/components/list.vue b/src/views/security_commitment/promise_book/components/list.vue index 1c80b01..97b0068 100644 --- a/src/views/security_commitment/promise_book/components/list.vue +++ b/src/views/security_commitment/promise_book/components/list.vue @@ -241,18 +241,37 @@ export default { this.$confirm(`确定要删除当前承诺书吗?`, { type: 'warning' }).then(() => { + const loading = this.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) requestFN( - '/corppromise/delete', - { - PROMISE_ID - } + '/corppromise/peopledetails?showCount=10¤tPage=1', + { PROMISE_ID: PROMISE_ID } ).then((data) => { - this.listQuery.limit = this.listQuery.limit - this.listQuery.page = this.listQuery.page - this.$message.success('操作成功') - this.getList() + if ((!data.varList) || data.varList.length > 0) { + this.$message.error('当前承诺书已经被使用,不能删除') + loading.close() + return + } + requestFN( + '/corppromise/delete', + { + PROMISE_ID + } + ).then((data) => { + this.listQuery.limit = this.listQuery.limit + this.listQuery.page = this.listQuery.page + this.$message.success('操作成功') + this.getList() + }).catch((e) => { + this.$message.success('操作失败') + }) + loading.close() }).catch((e) => { - this.$message.success('操作失败') + loading.close() }) }).catch(() => {}) }