手环管理单选框点击后优先勾选最后一行bug修复

This commit is contained in:
jjLv 2024-08-09 16:09:35 +08:00
parent fdef1308e5
commit 118a935096
1 changed files with 34 additions and 19 deletions

View File

@ -172,7 +172,7 @@
</el-table-column>
<el-table-column label="选择" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<input type="radio" name="radioOne" value="1" v-model="radioOne" @click="getShboxBindName($event,scope.row)"/>
<input type="radio" name="radioOne" :checked="shboxIdOne==scope.row.shboxId" @click="getShboxName($event,scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -218,7 +218,7 @@
</el-table-column>
<el-table-column label="选择" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<input type="radio" name="radioTwo" value="1" v-model="radioTwo" @click="getShboxBindName($event,scope.row)"/>
<input type="radio" name="radioTwo" :checked="shboxIdTwo==scope.row.shboxId" @click="getShboxBindName($event,scope.row)"/>
</template>
</el-table-column>
</el-table>
@ -672,7 +672,8 @@
},
data() {
return {
shboxIdOne:null,
shboxIdTwo:null,
radioOne:null,
radioTwo:null,
activeName: 'first',
@ -1351,12 +1352,14 @@
getShboxName(e,row){
this.queryshCode.shboxId = row.shboxId;
this.queryshCode.shboxName = row.shboxName;
if(e.target.value == this[e.target.name]){
e.target.checked = false
if(this.shboxIdOne == row.shboxId){
this.shboxIdOne = null
e.target.checked = false;
this.queryshCode.shboxId = null;
this.queryshCode.shboxName =null;
this[e.target.name] = ''
}
}else{
this.shboxIdOne = row.shboxId;
}
},
getShboxNameEdit(e,row){
@ -1379,26 +1382,35 @@
this.queryshCodeBind.shboxName = row.shboxName;
this.queryshCodeBind.shboxCapacity = row.shboxCapacity;
this.queryshCodeBind.shboxBindNum = row.shboxBindNum;
// if(e.target.value == this[e.target.name]){
// e.target.checked = false
// this.queryshCodeBind.shboxId = null;
// this.queryshCodeBind.shboxName =null;
// this.queryshCodeBind.shboxCapacity = null;
// this.queryshCodeBind.shboxBindNum = null;
// this[e.target.name] = ''
// }
if(this.shboxId == row.shboxId){
this.shboxId = 0
if(this.shboxIdTwo == row.shboxId){
this.shboxIdTwo = null
e.target.checked = false;
this.queryshCodeBind.shboxId = null;
this.queryshCodeBind.shboxName =null;
this.queryshCodeBind.shboxCapacity = null;
this.queryshCodeBind.shboxBindNum = null;
}else{
this.shboxId = row.shboxId;
this.shboxIdTwo = row.shboxId;
}
},
// getShboxBindNameAdd(e,row){
// this.queryshCodeBind.shboxId = row.shboxId;
// this.queryshCodeBind.shboxName = row.shboxName;
// this.queryshCodeBind.shboxCapacity = row.shboxCapacity;
// this.queryshCodeBind.shboxBindNum = row.shboxBindNum;
// if(this.shboxIdOne == row.shboxId){
// this.shboxIdOne = null
// e.target.checked = false;
// this.queryshCodeBind.shboxId = null;
// this.queryshCodeBind.shboxName =null;
// this.queryshCodeBind.shboxCapacity = null;
// this.queryshCodeBind.shboxBindNum = null;
// }else{
// this.shboxIdOne = row.shboxId;
// }
// },
@ -1620,10 +1632,11 @@
//
openShbox(row){
// this.sidebandId = row.sidebandId;
this.shboxIdOne = null;
this.title = "新增手环"
this.showsh = true;
this.getListTemp();
this.radioOne=null;
// this.radioOne=null;
this.queryshCode.pageNum = 1;
this.queryshCode.shCode = undefined;
},
@ -1631,6 +1644,8 @@
//
openShboxTemp(row){
// this.sidebandId = row.sidebandId;
this.queryshCodeBind = {};
this.shboxIdTwo = null;
this.title = "选择"
this.showshBind = true;
this.getListBind();