From c8a89691c11e576edbde01ea51ee6787418ac717 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Tue, 18 Feb 2025 10:41:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E8=B0=83=E4=BB=A4bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/component/quickCreate.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/order/component/quickCreate.vue b/src/views/order/component/quickCreate.vue index 22380fe..3e7ef86 100644 --- a/src/views/order/component/quickCreate.vue +++ b/src/views/order/component/quickCreate.vue @@ -179,9 +179,10 @@ export default { if (action === 'confirm') { let value = instance._data.inputValue; try { - let group = value.split(/,|,/).map(i => i.replace(/\n/g,'')); + let group = value.split(/,|,/)?.filter(i => i)?.map(i => i.replace(/\n/g,'')); group.forEach((item,index) => { let dataArr = item.split(/\s+/); + console.log(dataArr[0], this.equipments.find(i => i.name === dataArr[0])) if (!this.equipments.find(i => i.name === dataArr[0])) { throw new Error('未找到该点位'); } @@ -203,7 +204,7 @@ export default { }).then(({ value, action }) => { if (action === 'confirm') { let uid = uuid(); - let group = value.split(',').map(i => i.replace(/\n/g,'')); + let group = value.split(/,|,/)?.filter(i => i)?.map(i => i.replace(/\n/g,'')); group.forEach((item,index) => { let dataArr = item.split(/\s+/); this.data.push({