Commit 51b4e13e authored by Z's avatar Z

Z: Dot: search done.

parent 8d87583b
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
<div class="pages"> <div class="pages">
<el-pagination <el-pagination
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="page.currentPage" :current-page="zcache.page.nowPage"
:page-size="page.size" :page-size="zcache.page.pageSize"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
:total="page.total" :total="zcache.page.allItem"
></el-pagination> ></el-pagination>
</div> </div>
...@@ -296,7 +296,13 @@ export default { ...@@ -296,7 +296,13 @@ export default {
zcache: { zcache: {
status: { status: {
seeDialog: false, seeDialog: false,
editDialog: false editDialog: false,
isSearch: false
},
page: {
allItem: 0,
pageSize: 10,
nowPage: 1
} }
}, },
zdata: { zdata: {
...@@ -491,6 +497,10 @@ export default { ...@@ -491,6 +497,10 @@ export default {
if ((this.$refs.addStore.addStoreDialog = false)) { if ((this.$refs.addStore.addStoreDialog = false)) {
this.storeGetMainList(); this.storeGetMainList();
} }
},
'':{
handler: function(){},
deep: true,
} }
}, },
// created() { // created() {
...@@ -498,7 +508,8 @@ export default { ...@@ -498,7 +508,8 @@ export default {
// zlog('--->Created!') // zlog('--->Created!')
// }, // },
mounted() { mounted() {
this.storeGetMainList(); // this.storeGetMainList();
this.storeSearch();
this.storeGetUnGroupManList(); this.storeGetUnGroupManList();
}, },
methods: { methods: {
...@@ -545,16 +556,19 @@ export default { ...@@ -545,16 +556,19 @@ export default {
} }
}, },
storeSearch() { storeSearch() {
let postData = {
keyWords: this.zdata.searchPost.keywords
};
if (this.zdata.searchPost.keywords == "") { if (this.zdata.searchPost.keywords == "") {
this.zcache.status.isSearch = false;
this.zcache.page.nowPage = 1;
this.storeGetMainList(); this.storeGetMainList();
} else { } else {
this.zcache.status.isSearch = true;
let postData = {
keyWords: this.zdata.searchPost.keywords,
pageNum: 1
};
ApiStoreSearch(postData) ApiStoreSearch(postData)
.then(res => { .then(res => {
let result = []; let result = [];
console.log("--->res", res);
result.push(res.data.stallInfo); result.push(res.data.stallInfo);
this.list.main = result; this.list.main = result;
}) })
...@@ -564,13 +578,17 @@ export default { ...@@ -564,13 +578,17 @@ export default {
storeGetMainList() { storeGetMainList() {
// zlog("--->In Get API!"); // zlog("--->In Get API!");
let postData = { let postData = {
pageNum: 1 pageNum: this.zcache.page.nowPage
}; };
ApiStoreGetMainList(postData).then(res => { ApiStoreGetMainList(postData).then(res => {
this.list.main = res.data.pageInfo_adminStalls.list[0]; this.list.main = res.data.pageInfo_adminStalls.list[0];
this.list.man = res.data.pageInfo_principals.list[0]; this.list.man = res.data.pageInfo_principals.list[0];
this.transManIdToManName(); this.transManIdToManName();
this.zcache.page.allItem = Number(res.data.pageInfo_adminStalls.total)
this.zcache.page.pageSize = res.data.pageInfo_adminStalls.pageSize
this.zcache.page.nowPage = res.data.pageInfo_adminStalls.pageNum
}); });
}, },
storeGetStoreDetail(inData) { storeGetStoreDetail(inData) {
...@@ -720,10 +738,10 @@ export default { ...@@ -720,10 +738,10 @@ export default {
message: "编辑成功", message: "编辑成功",
type: "success" type: "success"
}); });
this.zcache.status.editDialog = false;
this.zdata.editPost = JSON.parse( this.zdata.editPost = JSON.parse(
JSON.stringify(this.zdata.editPostDefault) JSON.stringify(this.zdata.editPostDefault)
); );
this.zcache.status.editDialog = false;
this.storeGetMainList(); this.storeGetMainList();
} else { } else {
this.$message({ this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment