灾害人员管理弹窗修改

This commit is contained in:
遥望-倪浩天 2024-07-17 16:43:02 +08:00
parent 1099c3322a
commit 7a5f8e39d1
1 changed files with 25 additions and 18 deletions

View File

@ -41,7 +41,7 @@
<el-tag type="info" v-if="scope.row.roleId == '1123598816738675203'">B2</el-tag>
</template>
</el-table-column>
<el-table-column fixed="left" label="Operations" min-width="120">
<!-- <el-table-column fixed="left" label="Operations" min-width="120">
<template #default="scope">
<el-button
link
@ -53,7 +53,7 @@
<el-icon><ele-Back /></el-icon>
</el-button>
</template>
</el-table-column>
</el-table-column>-->
</el-table>
</el-card>
</div>
@ -187,24 +187,31 @@ const sendToLeft = (index,row) => {
};
const sendToRight = (index,row) => {
if (row.roleId == '1793193529859244033') {
if (chiefCount>0) {
ElMessage.error('Please select only one B1 user');
return;
}else {
chiefCount=chiefCount+1
}
}else {
if (adminCount>0) {
ElMessage.error('Please select only one B2 user');
return;
}else {
adminCount=adminCount+1
if (state.selectData.length>0){
if (state.selectData.length==1){
if (state.selectData[0].roleId==row.roleId){
state.tableData.data.splice(index, 1)
state.tableData.data.splice(index,0,state.selectData[0])
state.selectData[0] =row
}else {
state.tableData.data.splice(index, 1)
state.selectData[state.selectData.length] =row
}
}else if (state.selectData.length==2){
if (state.selectData[0].roleId==row.roleId){
state.tableData.data.splice(index, 1)
state.tableData.data.splice(index,0,state.selectData[0])
state.selectData[0] =row
}else if (state.selectData[1].roleId==row.roleId){
state.tableData.data.splice(index, 1)
state.tableData.data.splice(index,0,state.selectData[1])
state.selectData[1] =row
}
}
} else {
state.tableData.data.splice(index, 1)
state.selectData[state.selectData.length] =row
}
dataIndex[dataIndex.length]=index
state.tableData.data.splice(index, 1)
state.selectData[state.selectData.length] =row
};
const selectRow = (row) => {
state.selectData = row;