| | |
| | | </div> |
| | | </div> |
| | | <template> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @tableRowClick="tableRowClick" |
| | | <el-table |
| | | ref="tableSupplier" |
| | | border |
| | | :data="tableList.tableInfomation" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | :lazy="tableList.lazy" |
| | | highlight-current-row |
| | | @row-click="tableRowClick" |
| | | :header-cell-style="{ background: '#ECF4FF', color: '#666' }" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120"> |
| | | <el-table-column type="index" label="序号" width="50"> </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | | :prop="item.prop" |
| | | :label="item.label" |
| | | :width="item.width" |
| | | :min-width="item.min" |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.status === 0" |
| | | @click="enableClick(scope.row, '启用')" |
| | | type="text" |
| | | size="small" |
| | | <div v-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div> |
| | | <span |
| | | v-else-if="item.isCommonClick && scope.row[item.prop]" |
| | | class="sel-name" |
| | | @click="selCommonClick(scope.row)" |
| | | >{{ scope.row[item.prop] }}</span |
| | | > |
| | | <span v-else>{{ scope.row[item.prop] ? scope.row[item.prop] : "--" }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button v-if="scope.row.status === 0" @click="enableClick(scope.row, '启用')" type="text" size="small" |
| | | >启用</el-button |
| | | > |
| | | <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button> |
| | | <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </TableCommonView> |
| | | </el-table> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | |
| | | } else { |
| | | this.supplierId = 0 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.tableSupplier.setCurrentRow(this.tableList.tableInfomation[0]) |
| | | }) |
| | | this.getProductList() |
| | | } |
| | | }) |
| | |
| | | }, |
| | | // 修改供应商 |
| | | modifyClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "修改" |
| | | this.editConfig.infomation = { ...row } |
| | |
| | | addNewProductClick() { |
| | | this.newProductConfig.visible = true |
| | | this.newProductConfig.title = "添加" |
| | | this.newProductConfig.infomation = { supplierId: this.supplierId } |
| | | }, |
| | | // 修改产品 |
| | | editClick(row) { |
| | | console.log(row) |
| | | this.newProductConfig.visible = true |
| | | // this.newProductConfig.title = "修改" |
| | | this.newProductConfig.title = "修改" |
| | | this.newProductConfig.infomation = { ...row } |
| | | }, |
| | | // 删除 |
| | | delClick(row) { |
| | |
| | | margin-right: 20px; |
| | | } |
| | | } |
| | | .sel-name { |
| | | color: $color-primary; |
| | | cursor: pointer; |
| | | } |
| | | .btn-pager { |
| | | display: flex; |
| | | .page { |