优惠券详情修改

This commit is contained in:
GaoHao
2024-10-31 09:30:18 +08:00
parent 7ea49cbab8
commit f68cf9fab0

View File

@@ -38,8 +38,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div> <div class="head-container">
<el-table v-loading="loading" :data="tableData"> <el-table v-loading="loading" :data="tableData.data">
<el-table-column label="用户ID" prop="id" /> <el-table-column label="用户ID" prop="id" />
<el-table-column label="用户名" prop="name" /> <el-table-column label="用户名" prop="name" />
@@ -71,6 +71,16 @@
</el-table> </el-table>
</div> </div>
<div class="head-container">
<el-pagination
:total="tableData.total"
:current-page="tableData.page + 1"
:page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChange"
@size-change="sizeChange"
/>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -101,7 +111,13 @@ export default {
size: 10 size: 10
}, },
resetQuery: null, resetQuery: null,
tableData: null tableData: {
data: [],
page: 0,
size: 10,
loading: false,
total: 0
}
} }
}, },
mounted() { mounted() {
@@ -126,6 +142,9 @@ export default {
page: this.query.page, page: this.query.page,
size: this.query.size size: this.query.size
}) })
this.tableData.loading = false
this.tableData.data = res.content
this.tableData.total = res.totalElements
}, },
/** /**
@@ -157,7 +176,16 @@ export default {
this.query.couponId = obj.id this.query.couponId = obj.id
this.getTableData() this.getTableData()
}, },
// 分页大小改变
sizeChange(e) {
this.tableData.size = e
this.getTableData()
},
// 分页回调
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
},
/** /**
* 关闭详情 * 关闭详情
*/ */