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) { ...@@ -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 { ...@@ -134,7 +134,7 @@ export default {
tableHeight: window.innerHeight * 0.5 , tableHeight: window.innerHeight * 0.5 ,
page:{ page:{
currentPage:1, currentPage:1,
size:20, size:10,
total:0 total:0
}, },
form:{ form:{
...@@ -146,13 +146,13 @@ export default { ...@@ -146,13 +146,13 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getList() this.getListData()
}, },
methods: { methods: {
getList() { getListData() {
let param = {} let param = {}
let _this = this 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 param.pageNum = this.page.currentPage
getList(param).then(res => { getList(param).then(res => {
if(res.result == 'fail'){ if(res.result == 'fail'){
...@@ -160,7 +160,8 @@ export default { ...@@ -160,7 +160,8 @@ export default {
_this.tableData = [] _this.tableData = []
} }
if(res.result == 'success'){ 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 { ...@@ -219,15 +220,13 @@ export default {
this.counterDialog = false this.counterDialog = false
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`); this.page.currentPage = val
this.getListData()
}, },
//搜索 根据搜索条件查询 //搜索 根据搜索条件查询
handleSearch(){ handleSearch(){
this.getList() this.getListData()
}, },
}, },
/* mounted() { /* mounted() {
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -12,12 +12,17 @@ ...@@ -12,12 +12,17 @@
<el-form-item label="关键词"> <el-form-item label="关键词">
<el-input <el-input
size="small" size="small"
v-model="data.search.keys" v-model="zdata.searchPost.keywords"
style="width:160px" style="width:160px"
placeholder="请输入关键词" placeholder="请输入关键词"
/> />
</el-form-item> </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> </el-form>
</div> </div>
<!-- 列表区 --> <!-- 列表区 -->
...@@ -52,10 +57,10 @@ ...@@ -52,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>
...@@ -274,7 +279,9 @@ import { ...@@ -274,7 +279,9 @@ import {
ApiStoreGetStoreDetail, ApiStoreGetStoreDetail,
ApiStoreDelStore, ApiStoreDelStore,
ApiStoreGetUnGroupManList, ApiStoreGetUnGroupManList,
ApiStoreEditStore ApiStoreEditStore,
ApiStoreGetBarList,
ApiStoreSearch
} from "@api/in/store"; } from "@api/in/store";
import axios from "axios"; import axios from "axios";
const zlog = console.log.bind(console); const zlog = console.log.bind(console);
...@@ -289,10 +296,19 @@ export default { ...@@ -289,10 +296,19 @@ 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: {
searchPost: {
keywords: ""
},
see: { see: {
storeName: "storeName", storeName: "storeName",
storeType: "storeType", storeType: "storeType",
...@@ -365,7 +381,8 @@ export default { ...@@ -365,7 +381,8 @@ export default {
name: "柜组二号" name: "柜组二号"
} }
], ],
unGroupMan: [] unGroupMan: [],
bar: []
}, },
page: { page: {
...@@ -480,6 +497,10 @@ export default { ...@@ -480,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() {
...@@ -487,7 +508,8 @@ export default { ...@@ -487,7 +508,8 @@ export default {
// zlog('--->Created!') // zlog('--->Created!')
// }, // },
mounted() { mounted() {
this.storeGetMainList(); // this.storeGetMainList();
this.storeSearch();
this.storeGetUnGroupManList(); this.storeGetUnGroupManList();
}, },
methods: { methods: {
...@@ -500,6 +522,7 @@ export default { ...@@ -500,6 +522,7 @@ export default {
}) })
.catch(err => {}); .catch(err => {});
}, },
storeGetBarList() {},
matchManIdAndManName(inId) { matchManIdAndManName(inId) {
let manList = this.list.man; let manList = this.list.man;
let manName = "未知"; let manName = "未知";
...@@ -532,16 +555,41 @@ export default { ...@@ -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() { 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) {
...@@ -691,10 +739,10 @@ export default { ...@@ -691,10 +739,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