弹框单选问题
This commit is contained in:
parent
ae449377a3
commit
979bd2c4a2
@ -22,7 +22,9 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table ref="multipleTableRef" v-loading="loading" :data="list" :stripe="true" highlight-current-row @current-change="handleCurrentChange" :show-overflow-tooltip="true" class="hl-table">
|
||||
<el-table
|
||||
ref="multipleTableRef" v-loading="loading" :data="list" :stripe="true"
|
||||
@row-click="clickRow" @selection-change="handleCurrentChange" :show-overflow-tooltip="true" class="hl-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"/>
|
||||
@ -114,12 +116,28 @@ const getList = async () => {
|
||||
}
|
||||
const clickItem = ref([])
|
||||
const handleCurrentChange = (val) => {
|
||||
multipleTableRef.value!.clearSelection()
|
||||
|
||||
clickItem.value = val;
|
||||
if(val.length > 1){
|
||||
multipleTableRef.value!.clearSelection()
|
||||
multipleTableRef.value!.toggleRowSelection(val.pop())
|
||||
}
|
||||
|
||||
}
|
||||
const clickRow = (row) => {
|
||||
// 单选选中行
|
||||
if ( clickItem.value[0] == row) {
|
||||
// 取消
|
||||
clickItem.value = [];
|
||||
multipleTableRef.value!.clearSelection()
|
||||
} else {
|
||||
// 选择
|
||||
clickItem.value.push(row);
|
||||
multipleTableRef.value!.clearSelection()
|
||||
multipleTableRef.value!.toggleRowSelection(row, true);
|
||||
}
|
||||
}
|
||||
|
||||
multipleTableRef.value!.toggleRowSelection(val, undefined)
|
||||
};
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
@ -162,7 +180,8 @@ const emit = defineEmits(['success'])
|
||||
// emit('success', multipleSelection.value)
|
||||
const success = () =>{
|
||||
dialogVisible.value = false;
|
||||
emit('success',rowid.value,clickItem.value.storageOkQty,clickItem.value.id,clickItem.value.matCode)
|
||||
console.log(clickItem.value)
|
||||
emit('success',rowid.value,clickItem.value[0].storageOkQty,clickItem.value[0].id,clickItem.value[0].matCode)
|
||||
}
|
||||
const handleRg = async (rgid) => {
|
||||
pnCurrentList.value =[]
|
||||
|
Loading…
Reference in New Issue
Block a user