You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.1 KiB

3 years ago
<template>
<div style="padding: 0px 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="商户管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
3 years ago
<Button type="primary" @click="getMerchant"></Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addMerchant'].isShow = true,$refs['addMerchant'].type = 'add'">新增商户</Button>
3 years ago
</div>
</slot>
</lx-header>
</div>
3 years ago
<xy-table :list="list" :table-item="tableItem" @editor="editorShow" @delete="deleteMerchant"></xy-table>
3 years ago
<div style="display: flex;justify-content: flex-end;">
3 years ago
<Page :total="total" show-elevator @on-change="pageChange"/>
3 years ago
</div>
3 years ago
<!-- 新增商户-->
<addMerchant ref="addMerchant" @refresh="getMerchant"></addMerchant>
3 years ago
</div>
</template>
<script>
3 years ago
import {index,destroy} from "@/api/merchant"
import addMerchant from './component/addMerchant'
import { Message } from 'element-ui'
3 years ago
export default {
3 years ago
components:{
addMerchant
},
3 years ago
data() {
return {
3 years ago
select:{
pageSize:10,
pageIndex:1,
3 years ago
},
3 years ago
total:0,
list:[],
3 years ago
tableItem:[
{
prop:'username',
label:'简称/用户名',
3 years ago
width:150,
sortable:false
3 years ago
},
{
prop:'name',
label:'全名',
3 years ago
width: 200,
sortable:false,
align:'left'
3 years ago
},
{
prop:'business_number',
label:'营业执照号码',
width: 180
},
{
prop:"address",
label:"地址",
3 years ago
width: 300,
align:'left'
3 years ago
},
{
prop:"boss",
label:"法人/老板",
width:110
},
{
prop:"boss_phone",
label:"法人/老板电话",
width:150
},
{
prop:"contact",
label:"联系人",
width: 110
},
{
prop:"phone",
label:"联系电话",
width: 150
},
{
prop:"shops_count",
label:"门店数",
width: 100
},
{
prop:"state",
label: "状态"
}
]
}
},
3 years ago
methods: {
3 years ago
pageChange(e){
this.select.pageIndex = e
this.getMerchant()
},
async getMerchant(){
const res = await index({
page_size:this.select.pageSize,
page:this.select.pageIndex
})
this.list = res.data
this.total = res.total
},
deleteMerchant(row){
console.log(row.id)
destroy({ id: row.id }).then(res => {
Message({
type:'success',
message:'删除成功'
})
this.getMerchant()
})
},
3 years ago
3 years ago
editorShow(row){
this.$refs['addMerchant'].id = row.id
this.$refs['addMerchant'].type = 'editor'
this.$refs['addMerchant'].isShow = true
}
},
mounted() {
this.getMerchant()
3 years ago
}
3 years ago
}
</script>
<style scoped lang="scss">
</style>