From 48bfe71c6f746b62e85a144cf46de249632be22e Mon Sep 17 00:00:00 2001 From: guoyue Date: Thu, 29 Sep 2022 17:21:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8=EF=BC=9A=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=AE=BE=E6=96=BD--=E4=B8=80=E9=94=AE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=A4=A7=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/infrastructurePage.vue | 26 +++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index f766b30a..97714e61 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -752,6 +752,7 @@ setSubmit, getYuyue, getSoldierList, + getMaxApplyNum, } from '@/api/home' import mybus from '@/myplugins/mybus' import dayjs from 'dayjs' @@ -1776,15 +1777,30 @@ const dept = reactive({}) // eslint-disable-next-line no-undef if (infrastructure) { - console.log('infrastructure------------>', infrastructure) - // eslint-disable-next-line no-undef dept.deptId = infrastructure.deptId || '' // eslint-disable-next-line no-undef dept.deptName = infrastructure.deptName || '' } - const apply = () => { + + // 西海岸--判断设备最大数量个数 + const judegNumber = () => { + return new Promise((resolve, reject) => { + getMaxApplyNum(selectedRowKeys.value.length).then(res => { + resolve(res) + }).catch(err => { + reject(err) + }) + }) + } + + const apply = async () => { if (selectedRowKeys.value.length != 0) { + // 判断最大数量 + let maxNumRes = await judegNumber(); + if (maxNumRes.data.code != 0) { + return message.warning(maxNumRes.data.msg) + } console.log('一键申请', selectedList.value) let arr = [ { @@ -1921,9 +1937,9 @@ }, { title: '归属', - dataIndex: 'nodeName', + dataIndex: 'managementUnitName', width: '60%', - key: 'nodeName', + key: 'managementUnitName', }, { title: '状态',