From ecda21d2557e3f3df26acd09c61bd5819c92340b Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Thu, 25 Apr 2024 09:08:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=87=87=E8=B4=AD=E6=B8=A0?= =?UTF-8?q?=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchasingchannels/purchasingchannels.js | 9 +++++++ .../caigouqudaoselected.vue | 4 +-- .../caigouqudaotobeselected.vue | 27 ++++++++++++++++--- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js b/anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js index 144c74b9f7..c184bb1e49 100644 --- a/anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js +++ b/anrui-scm/anrui-scm-ui/src/api/purchasingchannels/purchasingchannels.js @@ -18,5 +18,14 @@ export default { data: data, headers: { 'Content-Type': 'application/json' } }) + }, + // 作废 + cancel: function(data) { + return request({ + url: '/scm/v1/scmpurchasechannel/cancel', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) } } diff --git a/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue b/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue index bd539946d9..f82ed211f5 100644 --- a/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue +++ b/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaoselected.vue @@ -356,10 +356,10 @@ export default { this.init() }, tobeSelect() { - if (this.sids.length === 1) { + if (this.sids.length > 0) { this.dialogVisible = true } else { - this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) + this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行操作' }) return } }, diff --git a/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue b/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue index 69aca88d1a..f828303f52 100644 --- a/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue +++ b/anrui-scm/anrui-scm-ui/src/views/purchasingchannels/caigouqudaotobeselected.vue @@ -185,6 +185,13 @@ export default { btnKey: 'tobeSelect', btnLabel: '选择' }, + { + type: 'danger', + size: 'small', + icon: '', + btnKey: 'doCancellation', + btnLabel: '作废' + }, { type: 'info', size: 'small', @@ -284,6 +291,9 @@ export default { case 'tobeSelect': this.tobeSelect() break + case 'doCancellation': + this.doCancellation() + break case 'doClose': this.doClose() break @@ -353,11 +363,22 @@ export default { }) }, tobeSelect() { - if (this.sids.length === 1) { + if (this.sids.length > 0) { this.dialogVisible = true } else { - this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) - return + this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行操作' }) + } + }, + doCancellation() { + if (this.sids.length > 0) { + req.cancel(this.sids).then((res) => { + if (res.success) { + this.$message({ showClose: true, type: 'success', message: '作废成功' }) + this.getList() + } + }) + } else { + this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行操作' }) } }, changeOrgDept(value) {