From 22e3a5aeef29150ef81d4d8b4f902c5fc8e2cca8 Mon Sep 17 00:00:00 2001 From: houjie <714924425@qq.com> Date: 星期五, 18 八月 2023 20:06:26 +0800 Subject: [PATCH] 添加 公共函数(提交 驳回) --- src/mixins/JeecgListMixin.js | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 151 insertions(+), 0 deletions(-) diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index eb70391..64399b4 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -379,6 +379,157 @@ let url = getFileAccessHttpUrl(text) window.open(url); }, + + /** + * 鍗曟嵁鎵归噺鎻愪氦 + */ + handleSubmitBatch: function() { + if (!this.url.submitBatch) { + this.$message.error('璇疯缃畊rl.submitBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + let httpurl = this.url.submitBatch + let method = 'post' + var params = { ids: ids } + + const that = this + httpAction(httpurl, params, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + + }) + + } + }, + /** + * 鎵归噺鎾ゅ洖宸叉彁浜ょ殑璁板綍 + */ + handleRevocationBatch: function() { + if (!this.url.revocationBatch) { + this.$message.error('璇疯缃畊rl.revocationBatch灞炴��!') + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + let httpurl = this.url.revocationBatch + let method = 'post' + var params = { ids: ids } + + const that = this + httpAction(httpurl, params, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + }) + + } + }, + /** + * 鍗曟嵁鎻愪氦 + */ + handleSubmit: function() { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + if (this.selectedRowKeys.length != 1) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + return + } else { + var id = this.selectedRowKeys[0] + let httpurl = this.url.submit + let method = 'post' + var params = { id: id } + + const that = this + + this.$confirm({ + title: '纭鎻愪氦锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + httpAction(httpurl, params, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + + }) + } + }) + + + } + }, + /** + * 鎾ゅ洖宸叉彁浜ょ殑璁板綍 + */ + handleRevocation: function() { + if (!this.url.revocation) { + this.$message.error('璇疯缃畊rl.revocation灞炴��!') + return + } + if (this.selectedRowKeys.length != 1) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + return + } else { + var id = this.selectedRowKeys[0] + let httpurl = this.url.revocation + let method = 'post' + var params = { id: id } + + const that = this + this.$confirm({ + title: '纭鎾ゅ洖锛�', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + + httpAction(httpurl, params, method).then((res) => { + if (res.success) { + that.$message.success(res.message) + that.loadData() + } else { + that.$message.warning(res.message) + } + }).finally(() => { + that.loading = false + }) + } + }) + } + } + + } } \ No newline at end of file -- Gitblit v1.9.3