diff --git a/ybf_admin/src/api/in/store.js b/ybf_admin/src/api/in/store.js index 2bb330c01addfbd4c1c7e3d4d8f71087f301c481..e3183a5164039b6e17e0409788d74d211b2724b7 100644 --- a/ybf_admin/src/api/in/store.js +++ b/ybf_admin/src/api/in/store.js @@ -57,3 +57,11 @@ export function ApiStoreGetBarList(inData) { }) } +export function ApiStoreSearch(inData) { + return request({ + url: '/admin/auth/stall/getStallByKeyWords', + method: 'get', + params: inData + }) +} + diff --git a/ybf_admin/src/pages/in/contact/counter.vue b/ybf_admin/src/pages/in/contact/counter.vue index d99ae67820735265409328e58471ec168835305a..3a6fb3af24264f5594126b7562b319cfe6d7006d 100644 --- a/ybf_admin/src/pages/in/contact/counter.vue +++ b/ybf_admin/src/pages/in/contact/counter.vue @@ -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(() => { diff --git a/ybf_admin/src/pages/in/contact/store.vue b/ybf_admin/src/pages/in/contact/store.vue index 9ba3e157cb7724d389702cd5059699992e25d599..fc769c8eb2d83ea1e8b9b25cf5e6f4ab592dd601 100644 --- a/ybf_admin/src/pages/in/contact/store.vue +++ b/ybf_admin/src/pages/in/contact/store.vue @@ -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({