Commit 3e5c8148 authored by Z's avatar Z

Z: Dot: store's done.

parents fd3573d5 6a6a624b
<template>
<div class="main">
<div class="title">全部柜组( 共5个 )</div>
<div class="title">全部柜组( 共<span>{{page.total}}</span>个 )</div>
<div class="searchs">
<div class="buttons">
<el-button class="button buttonlight" size="small" @click="addCounter">添加柜组</el-button>
......@@ -37,7 +37,7 @@
align="center"
></el-table-column>
<el-table-column
prop="principal"
prop="principalName"
label="柜组负责人"
align="center"
></el-table-column>
......@@ -60,18 +60,9 @@
<el-table-column label="创建时间" width="120" align="center" prop="createDate"/>
<el-table-column label="操作" align="center" fixed="right" width="200">
<template slot-scope="scope">
<el-button type="text" class="btn" @click="handleDetail(scope.row.id)"
>详情</el-button
>
<el-button type="text" class="btn" @click="handleEdit(scope.row.id)"
>编辑</el-button
>
<el-button
type="text"
@click="handleDelete(scope.row.id)"
class="listButtonRed"
>删除</el-button
>
<el-button type="text" class="btn" @click="handleDetail(scope.row.id)" >详情</el-button>
<el-button type="text" class="btn" @click="handleEdit(scope.row.id)" >编辑</el-button >
<el-button type="text" @click="handleDelete(scope.row.id)" class="listButtonRed">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -160,8 +151,16 @@ export default {
_this.tableData = []
}
if(res.result == 'success'){
_this.tableData = res.data.adminShops.list
_this.page.total = Number(res.data.adminShops.total)
let data = res.data.pageInfo.list
_this.tableData = data.map((v,i)=>{
let obj = {}
for(let key in v.adminShop){
obj[key] = v.adminShop[key]
obj.principalName = v.principal
}
return obj
})
_this.page.total = Number(res.data.pageInfo.total)
}
})
},
......@@ -179,7 +178,12 @@ export default {
this.$confirm('确定删除该柜组吗?', {
}).then(() => {
stallDel({shopIds:id}).then(res=>{
_this.$message(res.data)
if(res.result == 'fail'){
_this.$message.error(res.errorMsg)
}
if(res.result == 'success'){
_this.getListData()
}
})
}).catch(() => {
this.$message.info("取消删除")
......@@ -194,7 +198,12 @@ export default {
this.$confirm('确定批量删除柜组吗?', {
}).then(() => {
stallDel({shopIds:delIds}).then(res=>{
_this.$message(res.data)
if(res.result == 'fail'){
_this.$message.error(res.errorMsg)
}
if(res.result == 'success'){
_this.getListData()
}
})
}).catch(() => {
this.$message.info("取消删除")
......
......@@ -10,7 +10,7 @@
<span class="number">{{ allNumber }}</span>
</div>
</div>
<div class="ty" style="margin:15px 0;" @click="getNoGroupMember(1,1)">
<div class="ty" style="margin:12px 0;" @click="getNoGroupMember(1,1)">
<div>
<span>未分组</span>
<span class="number">{{ wNumber }}</span>
......@@ -26,9 +26,6 @@
expand-on-click-node
@node-click="handleTreeClick"
>
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
</span> -->
</el-tree>
</div>
</div>
......@@ -549,6 +546,7 @@ export default {
id: "id"
},
type: 1,
sType: 1,
idList: [],
storeId: "",
groupId: "",
......@@ -589,7 +587,7 @@ export default {
},
getGroupMember(page,ctPage) {
this.page.currentPage = ctPage
this.type = 3
this.type = this.sType = 3
let params = {
pageNum: page,
shopId: this.groupId
......@@ -601,7 +599,7 @@ export default {
},
getStoreMember(page,ctPage) {
this.page.currentPage = ctPage
this.type = 4
this.type = this.sType = 5
let params = {
pageNum: page,
stallId: this.storeId
......@@ -625,12 +623,12 @@ export default {
},
handleCurrentChange(val) {
let ctPage = val
this.handleTypeChange(val,ctPage)
this.handleTypeChange(val,ctPage)
},
getMailList(page,ctPage) {
this.formData.keywords = ''
this.title = "全部"
this.type = 1;
this.type = this.sType = 1;
this.page.currentPage = ctPage
let params = {
pageNum: page
......@@ -643,10 +641,10 @@ export default {
},
handleShopowner() {},
getNoGroupMember(page,ctPage) {
this.formData.keywords = ''
this.page.currentPage = ctPage
this.formData.keywords = ''
this.page.currentPage = ctPage
this.title = "未分组"
this.type = 2;
this.type = this.sType = 2;
let params = {
pageNum: page
};
......@@ -660,20 +658,20 @@ export default {
let ids = []
val.map(function(item) {
ids.push(item.id)
ids.push(item.id)
});
this.idList = ids
this.idList = ids
console.log(this.idList,",");
},
handleTypeChange(val,ctPage) {
if(this.type == 1) {
this.getMailList(val,ctPage)
}else if (this.type == 2) {
this.getMailList(val,ctPage)
}else if (this.type == 2) {
this.getNoGroupMember(val,ctPage)
}else if (this.type == 3) {
}else if (this.type == 3) {
this.getGroupMember(val,ctPage)
}else if (this.type == 4) {
}else if (this.type == 4) {
this.handleSearch(val,ctPage)
}
else {
......@@ -683,7 +681,7 @@ export default {
handleSearch(page,ctPage) {
this.type = 4
this.page.currentPage = ctPage
switch (this.type) {
switch (this.sType) {
case 1:
this.counterId = 0;
break
......@@ -693,16 +691,18 @@ export default {
case 3:
this.counterId = this.groupId;
break
case 5:
this.counterId = this.groupId;
}
let params = {
keyWords: this.formData.keywords,
stallId: this.counterId,
pageNum: page
}
search(params).then(res=>{
search(params).then(res=>{
this.tableData = res.data.list
this.page.total = Number(res.data.total);
})
})
}
}
};
......@@ -710,12 +710,12 @@ export default {
<style scoped>
.trees >>> .el-tree-node__content {
padding: 10px;
border-bottom: 1px solid #fff;
padding: 5px;
/*border-bottom: 1px solid #fff;*/
}
.trees >>> .el-tree-node__children .el-tree-node__content {
background-color: #dadad97a;
/*background-color: #dadad97a;*/
}
.btn >>> .el-button + .el-button {
margin-left: 5px;
......
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