Commit b3df9f32 authored by xd's avatar xd

Merge branch 'master' of http://114.67.93.201/xulili/ybf

parents d32a9f30 099aada9
......@@ -57,3 +57,11 @@ export function ApiStoreGetBarList(inData) {
})
}
export function ApiStoreSearch(inData) {
return request({
url: '/admin/auth/stall/getStallByKeyWords',
method: 'get',
params: inData
})
}
......@@ -134,7 +134,7 @@ export default {
tableHeight: window.innerHeight * 0.5 ,
page:{
currentPage:1,
size:20,
size:10,
total:0
},
form:{
......@@ -146,13 +146,13 @@ export default {
};
},
mounted() {
this.getList()
this.getListData()
},
methods: {
getList() {
getListData() {
let param = {}
let _this = this
param.keyWords = this.form.keyWords? this.form.keywords : 0
param.keyWords = this.form.keyWords? this.form.keyWords : 0
param.pageNum = this.page.currentPage
getList(param).then(res => {
if(res.result == 'fail'){
......@@ -160,7 +160,8 @@ export default {
_this.tableData = []
}
if(res.result == 'success'){
_this.tableData = res.data.adminShops
_this.tableData = res.data.adminShops.list
_this.page.total = Number(res.data.adminShops.total)
}
})
},
......@@ -219,15 +220,13 @@ export default {
this.counterDialog = false
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.page.currentPage = val
this.getListData()
},
//搜索 根据搜索条件查询
handleSearch(){
this.getList()
this.getListData()
},
},
/* mounted() {
this.$nextTick(() => {
......
......@@ -12,12 +12,17 @@
<el-form-item label="关键词">
<el-input
size="small"
v-model="data.search.keys"
v-model="zdata.searchPost.keywords"
style="width:160px"
placeholder="请输入关键词"
/>
</el-form-item>
<el-button class="button buttondark" size="small" style="margin-top:4px;">搜索</el-button>
<el-button
class="button buttondark"
size="small"
@click="storeSearch"
style="margin-top:4px;"
>搜索</el-button>
</el-form>
</div>
<!-- 列表区 -->
......@@ -52,10 +57,10 @@
<div class="pages">
<el-pagination
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-size="page.size"
:current-page="zcache.page.nowPage"
:page-size="zcache.page.pageSize"
layout="total, prev, pager, next, jumper"
:total="page.total"
:total="zcache.page.allItem"
></el-pagination>
</div>
......@@ -274,7 +279,9 @@ import {
ApiStoreGetStoreDetail,
ApiStoreDelStore,
ApiStoreGetUnGroupManList,
ApiStoreEditStore
ApiStoreEditStore,
ApiStoreGetBarList,
ApiStoreSearch
} from "@api/in/store";
import axios from "axios";
const zlog = console.log.bind(console);
......@@ -289,10 +296,19 @@ export default {
zcache: {
status: {
seeDialog: false,
editDialog: false
editDialog: false,
isSearch: false
},
page: {
allItem: 0,
pageSize: 10,
nowPage: 1
}
},
zdata: {
searchPost: {
keywords: ""
},
see: {
storeName: "storeName",
storeType: "storeType",
......@@ -365,7 +381,8 @@ export default {
name: "柜组二号"
}
],
unGroupMan: []
unGroupMan: [],
bar: []
},
page: {
......@@ -480,6 +497,10 @@ export default {
if ((this.$refs.addStore.addStoreDialog = false)) {
this.storeGetMainList();
}
},
'':{
handler: function(){},
deep: true,
}
},
// created() {
......@@ -487,7 +508,8 @@ export default {
// zlog('--->Created!')
// },
mounted() {
this.storeGetMainList();
// this.storeGetMainList();
this.storeSearch();
this.storeGetUnGroupManList();
},
methods: {
......@@ -500,6 +522,7 @@ export default {
})
.catch(err => {});
},
storeGetBarList() {},
matchManIdAndManName(inId) {
let manList = this.list.man;
let manName = "未知";
......@@ -532,16 +555,41 @@ export default {
}
}
},
storeSearch() {
if (this.zdata.searchPost.keywords == "") {
this.zcache.status.isSearch = false;
this.zcache.page.nowPage = 1;
this.storeGetMainList();
} else {
this.zcache.status.isSearch = true;
let postData = {
keyWords: this.zdata.searchPost.keywords,
pageNum: 1
};
ApiStoreSearch(postData)
.then(res => {
// let result = [];
// result.push(res.data.stallInfo);
// this.list.main = result;
this.list.main = res.data.list
})
.catch(err => {});
}
},
storeGetMainList() {
// zlog("--->In Get API!");
let postData = {
pageNum: 1
pageNum: this.zcache.page.nowPage
};
ApiStoreGetMainList(postData).then(res => {
this.list.main = res.data.pageInfo_adminStalls.list[0];
this.list.man = res.data.pageInfo_principals.list[0];
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) {
......@@ -691,10 +739,10 @@ export default {
message: "编辑成功",
type: "success"
});
this.zcache.status.editDialog = false;
this.zdata.editPost = JSON.parse(
JSON.stringify(this.zdata.editPostDefault)
);
this.zcache.status.editDialog = false;
this.storeGetMainList();
} else {
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