This commit is contained in:
bb_pan 2025-05-15 17:29:13 +08:00
parent f6db2c8ba0
commit 49c911c4da
1 changed files with 7 additions and 3 deletions

View File

@ -18,7 +18,7 @@
<el-button type="primary" size="mini" @click="saveCodeOut">保存</el-button> <el-button type="primary" size="mini" @click="saveCodeOut">保存</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table ref="multipleTable" :data="outCodeList" height="500" @select="handleSelectionChange"> <el-table ref="multipleTable" :data="outCodeList" height="500" @select="handleSelectionChange" @select-all="handleSelectAll">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="80" type="index"></el-table-column> <el-table-column label="序号" align="center" width="80" type="index"></el-table-column>
<el-table-column label="类型名称" align="center" prop="materialName" :show-overflow-tooltip="true" /> <el-table-column label="类型名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
@ -74,6 +74,10 @@ export default {
console.log('🚀 ~ handleSelectionChange ~ val:', val) console.log('🚀 ~ handleSelectionChange ~ val:', val)
this.selectedCodeList = val this.selectedCodeList = val
}, },
handleSelectAll(val) {
console.log('🚀 ~ handleSelectAll ~ val:', val)
this.selectedCodeList = val
},
handleOutQuery() { handleOutQuery() {
this.outQuery.pageNum = 1 this.outQuery.pageNum = 1
this.getCodeList() this.getCodeList()
@ -86,10 +90,10 @@ export default {
getCodeList() { getCodeList() {
getDetailsByTypeId(this.outQuery).then(res => { getDetailsByTypeId(this.outQuery).then(res => {
this.outCodeList = res.data this.outCodeList = res.data
if (this.rowData.outCodeList && this.rowData.outCodeList.length > 0) { if (this.rowData.maCodeList && this.rowData.maCodeList.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.outCodeList.forEach(row => { this.outCodeList.forEach(row => {
const isSelected = this.rowData.outCodeList.some(item => item.id === row.id) const isSelected = this.rowData.maCodeList.some(item => item.maCode === row.maCode)
if (isSelected) { if (isSelected) {
this.$refs.multipleTable.toggleRowSelection(row, true) this.$refs.multipleTable.toggleRowSelection(row, true)
} }