From 33084428bc630a8405a8b5d5518f4ad1e88aa177 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Tue, 19 Sep 2023 16:40:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/technology/process/content.vue | 5 ++++- src/views/technology/process/index.vue | 5 ++++- src/views/technology/recipe/content.vue | 6 ++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/views/technology/process/content.vue b/src/views/technology/process/content.vue index 8dfc1159..3ec3735a 100644 --- a/src/views/technology/process/content.vue +++ b/src/views/technology/process/content.vue @@ -212,11 +212,14 @@ export default { const len = obj.split(',').length; console.log('切割的数组',obj.split(',')); a.forEach(item => { + const b = this.form.device.split(','); + const size = b.length; + console.log("size",size,b[size-1]) const item1 = item+','; console.log("打印item1",item1); this.checkDevice = this.form.device.search(item1) != -1; console.log("check的值",this.checkDevice); - if(this.checkDevice == true){ + if(this.checkDevice == true || b[size-1] == item){ console.log("重复添加",true); Message.warning('您已经添加过该设备,请勿重复添加!!!'); }else if(this.checkDevice == false){ diff --git a/src/views/technology/process/index.vue b/src/views/technology/process/index.vue index 3297075d..bba54635 100644 --- a/src/views/technology/process/index.vue +++ b/src/views/technology/process/index.vue @@ -836,10 +836,13 @@ export default { const len = obj.split(",").length; console.log("切割的数组", obj.split(",")); a.forEach((item) => { + const b = this.form.equipment.split(','); + const size = b.length; + console.log("size",size,b[size-1]) const item1 = item+','; console.log("打印item1",item1); this.checkEquipment = this.form.equipment.search(item1) != -1; - if (this.checkEquipment == true) { + if (this.checkEquipment == true ||b[size-1] == item) { console.log("重复添加", true); Message.warning("您已经添加过该设备,请勿重复添加!!!"); } else if (this.checkEquipment == false) { diff --git a/src/views/technology/recipe/content.vue b/src/views/technology/recipe/content.vue index f026ba80..36f274c9 100644 --- a/src/views/technology/recipe/content.vue +++ b/src/views/technology/recipe/content.vue @@ -320,14 +320,16 @@ export default { }else{ if(obj != undefined && obj != null){ const a = obj.split(','); - const len = obj.split(',').length; console.log('切割的数组',obj.split(',')); a.forEach(item => { + const b = this.form.device.split(','); + const size = b.length; + console.log("size",size,b[size-1]) const item1 = item+','; console.log("打印item1",item1); this.checkDevice = this.form.device.search(item1) != -1; console.log("check的值",this.checkDevice); - if(this.checkDevice == true){ + if(this.checkDevice == true ||b[size-1] == item){ console.log("重复添加",true); Message.warning('您已经添加过该设备,请勿重复添加!!!'); }else if(this.checkDevice == false){