From fd35b5b4ce7b4f0f716539cdc7a0629d81e9794f Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Fri, 20 Sep 2024 13:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=92=E6=89=A3=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=A2=9E=E5=8A=A0=E9=87=8D=E6=8E=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- anrui-riskcenter-ui/src/api/deduct/deduct.js | 7 +++ .../src/views/deduct/deduct.vue | 51 +++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/anrui-riskcenter-ui/src/api/deduct/deduct.js b/anrui-riskcenter-ui/src/api/deduct/deduct.js index c68950aea3..a933f9323e 100644 --- a/anrui-riskcenter-ui/src/api/deduct/deduct.js +++ b/anrui-riskcenter-ui/src/api/deduct/deduct.js @@ -57,6 +57,13 @@ export default { headers: { 'Content-Type': 'application/json' } }) }, + buckleVoucherRePush: function(data) { + return request({ + url: '/riskcenter/v1/loanbuckleapply/buckleVoucherRePush', + method: 'post', + params: data + }) + }, // 提交流程 submit: function(params) { return request({ diff --git a/anrui-riskcenter-ui/src/views/deduct/deduct.vue b/anrui-riskcenter-ui/src/views/deduct/deduct.vue index 05caa774aa..f03dab754f 100644 --- a/anrui-riskcenter-ui/src/views/deduct/deduct.vue +++ b/anrui-riskcenter-ui/src/views/deduct/deduct.vue @@ -122,6 +122,7 @@ import req from '@/api/deduct/deduct' import { getStorage } from '@/utils/auth' import deductAdd from './deductAdd' import deductInfo from './deductInfo' +import { getButtonPermissions } from '@/api/Common/dictcommons' export default { name: 'Deduct', @@ -139,6 +140,13 @@ export default { centerDialogVisible: false, btndisabled: false, btnList: [ + { + type: 'primary', + size: 'small', + icon: '', + btnKey: 'toPush', + btnLabel: '重推' + }, { type: 'danger', size: 'small', @@ -165,7 +173,7 @@ export default { // 翻页 listQuery: { current: 1, - size: 10, + size: 5, total: 0, params: { applyName: '', @@ -189,7 +197,18 @@ export default { mounted() { // 在外部vue的window上添加postMessage的监听,而且绑定处理函数handleMessage window.addEventListener('message', this.handleMessage) - this.$refs['btnbar'].setButtonList(this.btnList) + getButtonPermissions({ userSid: window.sessionStorage.getItem('userSid'), url: this.$route.path, type: 0 }).then((res) => { + if (res.success) { + for (var i = 0; i < res.data.length; i++) { + for (var k = 0; k < this.btnList.length; k++) { + if (res.data[i].buttonId === this.btnList[k].btnKey) { + this.btnList.splice(k, 1) + } + } + } + this.$refs['btnbar'].setButtonList(this.btnList) + } + }) }, methods: { async handleMessage(event) { @@ -232,6 +251,9 @@ export default { btnHandle(btnKey) { console.log('XXXXXXXXXXXXXXX ' + btnKey) switch (btnKey) { + case 'toPush': + this.toPush() + break case 'doDel': this.doDel() break @@ -282,7 +304,7 @@ export default { handleReset() { this.listQuery = { current: 1, - size: 10, + size: 5, total: 0, params: { applyName: '', @@ -307,6 +329,29 @@ export default { this.viewState = 4 this.$refs['divInfo'].showInfo(row) }, + toPush() { + if (this.sids.length === 1) { + const loading = this.$loading({ + lock: true, + text: '数据推送中', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }) + req.buckleVoucherRePush({ sid: this.sids[0] }).then((resp) => { + if (resp.success) { + loading.close() + this.$message({ showClose: true, type: 'success', message: '重推成功' }) + this.getList() + } else { + loading.close() + } + }).catch(() => { + loading.close() + }) + } else { + this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行重推操作' }) + } + }, // 删除 doDel() { if (this.sids.length === 0) {