设备回显

master
A0010407 1 year ago
parent a2636786da
commit 33084428bc

@ -212,11 +212,14 @@ export default {
const len = obj.split(',').length; const len = obj.split(',').length;
console.log('切割的数组',obj.split(',')); console.log('切割的数组',obj.split(','));
a.forEach(item => { a.forEach(item => {
const b = this.form.device.split(',');
const size = b.length;
console.log("size",size,b[size-1])
const item1 = item+','; const item1 = item+',';
console.log("打印item1",item1); console.log("打印item1",item1);
this.checkDevice = this.form.device.search(item1) != -1; this.checkDevice = this.form.device.search(item1) != -1;
console.log("check的值",this.checkDevice); console.log("check的值",this.checkDevice);
if(this.checkDevice == true){ if(this.checkDevice == true || b[size-1] == item){
console.log("重复添加",true); console.log("重复添加",true);
Message.warning('您已经添加过该设备,请勿重复添加!!!'); Message.warning('您已经添加过该设备,请勿重复添加!!!');
}else if(this.checkDevice == false){ }else if(this.checkDevice == false){

@ -836,10 +836,13 @@ export default {
const len = obj.split(",").length; const len = obj.split(",").length;
console.log("切割的数组", obj.split(",")); console.log("切割的数组", obj.split(","));
a.forEach((item) => { a.forEach((item) => {
const b = this.form.equipment.split(',');
const size = b.length;
console.log("size",size,b[size-1])
const item1 = item+','; const item1 = item+',';
console.log("打印item1",item1); console.log("打印item1",item1);
this.checkEquipment = this.form.equipment.search(item1) != -1; this.checkEquipment = this.form.equipment.search(item1) != -1;
if (this.checkEquipment == true) { if (this.checkEquipment == true ||b[size-1] == item) {
console.log("重复添加", true); console.log("重复添加", true);
Message.warning("您已经添加过该设备,请勿重复添加!!!"); Message.warning("您已经添加过该设备,请勿重复添加!!!");
} else if (this.checkEquipment == false) { } else if (this.checkEquipment == false) {

@ -320,14 +320,16 @@ export default {
}else{ }else{
if(obj != undefined && obj != null){ if(obj != undefined && obj != null){
const a = obj.split(','); const a = obj.split(',');
const len = obj.split(',').length;
console.log('切割的数组',obj.split(',')); console.log('切割的数组',obj.split(','));
a.forEach(item => { a.forEach(item => {
const b = this.form.device.split(',');
const size = b.length;
console.log("size",size,b[size-1])
const item1 = item+','; const item1 = item+',';
console.log("打印item1",item1); console.log("打印item1",item1);
this.checkDevice = this.form.device.search(item1) != -1; this.checkDevice = this.form.device.search(item1) != -1;
console.log("check的值",this.checkDevice); console.log("check的值",this.checkDevice);
if(this.checkDevice == true){ if(this.checkDevice == true ||b[size-1] == item){
console.log("重复添加",true); console.log("重复添加",true);
Message.warning('您已经添加过该设备,请勿重复添加!!!'); Message.warning('您已经添加过该设备,请勿重复添加!!!');
}else if(this.checkDevice == false){ }else if(this.checkDevice == false){

Loading…
Cancel
Save