This commit is contained in:
parent
f6db2c8ba0
commit
49c911c4da
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue