|
@@ -1,6 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<r-layout class="subPage">
|
3
|
|
- <xm-search>
|
|
3
|
+ <xm-search @submit="search">
|
4
|
4
|
<el-form-item>
|
5
|
5
|
<el-button type="success" @click='addGoods'>新增商品</el-button>
|
6
|
6
|
</el-form-item>
|
|
@@ -47,7 +47,8 @@
|
47
|
47
|
</div>
|
48
|
48
|
<el-pagination
|
49
|
49
|
@current-change="handleCurrentChange"
|
50
|
|
- :current-page="postData.page"
|
|
50
|
+ @size-change="handleSizeChange"
|
|
51
|
+ :current-page="postData.pageNum"
|
51
|
52
|
:page-size="postData.pagesize"
|
52
|
53
|
layout="prev, pager, next, jumper"
|
53
|
54
|
:total="pageTotal">
|
|
@@ -70,7 +71,7 @@ export default {
|
70
|
71
|
postData: {
|
71
|
72
|
goodsName: '',
|
72
|
73
|
typeId: '',
|
73
|
|
- page: 1,
|
|
74
|
+ pageNum: 1,
|
74
|
75
|
pagesize: 10,
|
75
|
76
|
},
|
76
|
77
|
}
|
|
@@ -87,22 +88,27 @@ export default {
|
87
|
88
|
return (this.goodsTypes.filter(x => x.typeId === typeid)[0] || {}).typeName
|
88
|
89
|
},
|
89
|
90
|
search () { // 搜索
|
90
|
|
- this.postData.page = 1
|
|
91
|
+ this.postData.pageNum = 1
|
91
|
92
|
this.currentList = []
|
92
|
93
|
this.getList()
|
93
|
94
|
},
|
94
|
95
|
getList () {
|
95
|
96
|
this.getGoodsList({ ...this.postData }).then((dt) => {
|
96
|
97
|
this.currentList = dt.records
|
97
|
|
- this.postData.page = dt.current
|
|
98
|
+ this.postData.pageNum = dt.current
|
98
|
99
|
this.postData.pagesize = dt.size
|
99
|
100
|
this.pageTotal = dt.total
|
100
|
101
|
})
|
101
|
102
|
},
|
102
|
103
|
handleCurrentChange (val) {
|
103
|
|
- this.postData.page = val
|
|
104
|
+ this.postData.pageNum = val
|
104
|
105
|
this.getList()
|
105
|
106
|
},
|
|
107
|
+ handleSizeChange(val) {
|
|
108
|
+ this.postData.pageSize = val
|
|
109
|
+ this.getPage()
|
|
110
|
+ },
|
|
111
|
+
|
106
|
112
|
handleEdit (index, row) {
|
107
|
113
|
// 编辑
|
108
|
114
|
this.$router.push({ name: 'goodsedit', query: { id: row.goodsId } })
|
|
@@ -142,6 +148,9 @@ export default {
|
142
|
148
|
|
143
|
149
|
this.getList()
|
144
|
150
|
},
|
|
151
|
+ created (){
|
|
152
|
+ this.getList()
|
|
153
|
+ }
|
145
|
154
|
}
|
146
|
155
|
</script>
|
147
|
156
|
|