Browse Source

库存分页查询 添加序号

master
djz8236 2 years ago
parent
commit
b36944c060
  1. 15
      warehousing-system/project_web/src/components/stockManagement/stockList.vue

15
warehousing-system/project_web/src/components/stockManagement/stockList.vue

@ -8,7 +8,7 @@
</el-input>
</el-col>
</el-row>
<el-table :data="stockList.slice((queryInfo.pageNum-1)*queryInfo.pageSize,queryInfo.pageNum*queryInfo.pageSize)"
<el-table :data="stockList"
style="width: 100%" height="500"
stripe border fixed>
<el-table-column label="序号" type="index" width="60" :index="indexMethod" fixed align="center" />
@ -114,22 +114,21 @@ export default {
this.queryInfo.size = val
this.getStockList()
},
indexMethod(index) {
var pagestart = (this.queryInfo.current - 1) * this.queryInfo.size
var pageindex = index + 1 + pagestart
return pageindex
},
handleCurrentChange (val) {
this.queryInfo.current = val
this.getStockList()
},
//
indexMethod(index) {
var pagestart = (this.queryInfo.pageNum - 1) * this.queryInfo.pageSize
var pageindex = index + 1 + pagestart
return pageindex
},
async getStockList () {
const { data: result } = await this.$http.post('/stock/listPage', this.queryInfo )
if (result.code !== "200") return this.$message.error('获取列表失败')
this.total = result.data.total
this.stockList = result.data.records
console.log( this.stockList);
}
},

Loading…
Cancel
Save