106 lines
2.9 KiB
Vue
106 lines
2.9 KiB
Vue
<template>
|
|
<div>
|
|
<navbar title="客户管理" />
|
|
<div class="container">
|
|
<div class="flex flex-center flex-justify-start">
|
|
<add-org @ok="fetchList" />
|
|
</div>
|
|
<a-table
|
|
class="mt-20"
|
|
:columns="columns"
|
|
:data="list"
|
|
:pagination="page"
|
|
@pageChange="pageChange"
|
|
>
|
|
<template #region="{ record }">
|
|
<div>
|
|
{{ record.region.province_name }}{{ record.region.city_name }}{{ record.region.name }}
|
|
</div>
|
|
</template>
|
|
<template #menu="{ record }">
|
|
<div>
|
|
<customer-more :id="record.id" />
|
|
</div>
|
|
</template>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import navbar from '@/components/navbar/index.vue'
|
|
import addOrg from '@/views/base/components/add-org.vue'
|
|
import customerMore from '@/views/base/customer/components/customer-more.vue'
|
|
|
|
export default {
|
|
components: {
|
|
navbar,
|
|
addOrg,
|
|
customerMore
|
|
},
|
|
data() {
|
|
return {
|
|
page: {
|
|
page: 0,
|
|
size: 10,
|
|
total: 10
|
|
},
|
|
list: [],
|
|
columns: [
|
|
{
|
|
title: '单位名称',
|
|
dataIndex: 'name',
|
|
width:200
|
|
},
|
|
{
|
|
title: '类型',
|
|
dataIndex: 'typeName',
|
|
width:120
|
|
},
|
|
{
|
|
title: '地区',
|
|
slotName: 'region',
|
|
width:280
|
|
},
|
|
{
|
|
title: '详细地址',
|
|
dataIndex: 'address'
|
|
},
|
|
{
|
|
title: '操作',
|
|
slotName: 'menu',
|
|
width:200
|
|
}
|
|
]
|
|
}
|
|
},
|
|
mounted() {
|
|
this.fetchList()
|
|
},
|
|
methods: {
|
|
pageChange(page){
|
|
this.page.page = page
|
|
this.fetchList()
|
|
},
|
|
fetchList() {
|
|
this.$api.customer.page(this.page).then(res => {
|
|
if (res.code === 200) {
|
|
this.list = res.data.records.map(e => {
|
|
e.typeName = '业主单位'
|
|
if (e.type === 1) {
|
|
e.typeName = '实施单位'
|
|
} else if (e.type === 2) {
|
|
e.typeName = '其他'
|
|
}
|
|
return e
|
|
})
|
|
this.page.total = res.data.total
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|