| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table class="pallet-transports-material-table" :data="palletTransportsMaterialData" @current-change="handleCurrentChange" style="width: 100%;" |
| | | height="350px" border @selection-change="palletTransportsMaterialSelectionChange" stripe |
| | | <el-table class="pallet-transports-material-table" @current-change="handleCurrentChange" :data="palletTransportsMaterialData" style="width: 100%;" |
| | | height="350px" border stripe |
| | | ref="palletTransportsMaterialTable"> |
| | | <!--单选框--> |
| | | <el-table-column align="center" label="单选"> |
| | | <template slot-scope="scope"> |
| | | <el-checkbox class="table-single-checkbox" v-model="scope.row.commonChecked"></el-checkbox> |
| | | </template> |
| | | <!--单选框 @selection-change="palletTransportsMaterialSelectionChange"--> |
| | | <el-table-column align="center" width="55" label="单选"> |
| | | <template slot-scope="scope"> |
| | | <el-checkbox v-model="scope.row.commonChecked" @change="handleCurrentChange(scope.row)" ></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="partNo" label="零件号" align="center" show-overflow-tooltip> |
| | | </el-table-column> |
| | |
| | | }, |
| | | created() { }, |
| | | methods: { |
| | | // 单行选中 |
| | | handleCurrentChange(row) { |
| | | if (row != null) { |
| | | // 单行选中 |
| | | handleCurrentChange(row) { |
| | | this.palletTransportsMaterialData.forEach((item) => { |
| | | // 排他,每次选择时把其他选项都清除 |
| | | if (item.id !== row.id) { |
| | | item.commonChecked = false |
| | | } else { |
| | | item.commonChecked = true |
| | | } |
| | | }else{ |
| | | item.commonChecked = true |
| | | } |
| | | }) |
| | | } |
| | | this.palletTransportsMaterialSelectionChange([row]) |
| | | console.log(row); |
| | | }, |
| | | // 工艺类型中文格式化 |
| | | formatStateType(row, column, cellValue) { |