feature/0423
parent
07b84fffd4
commit
95eab50c6e
@ -0,0 +1,15 @@ |
||||
import { axios } from '@/utils/request' |
||||
|
||||
// api接口列表
|
||||
const api = { |
||||
list: '/user.invoice/index' |
||||
} |
||||
|
||||
// 列表记录
|
||||
export function list (params) { |
||||
return axios({ |
||||
url: api.list, |
||||
method: 'post', |
||||
params |
||||
}) |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,205 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<div class="card-title">{{ $route.meta.title }}</div> |
||||
<div class="table-operator"> |
||||
</div> |
||||
|
||||
<a-table |
||||
:rowKey="(record) => record.id" |
||||
:columns="columns" |
||||
:data-source="list" |
||||
:scroll="{ x: 1300 }" |
||||
bordered |
||||
:pagination="false" |
||||
> |
||||
<span slot="main_info" slot-scope="item"> |
||||
<p>{{ item.user.nick_name }}</p> |
||||
<p class="c-p">{{ item.user.mobile }}</p> |
||||
</span> |
||||
<span slot="type" slot-scope="item"> |
||||
<p v-if="item.type==1">普通</p> |
||||
<p v-else>增值税</p> |
||||
</span> |
||||
<span slot="source" slot-scope="item"> |
||||
<p v-if="item.source==1">个人</p> |
||||
<p v-else>单位</p> |
||||
</span> |
||||
</a-table> |
||||
<a-pagination |
||||
v-model="queryParam.page" |
||||
:default-page-size="queryParam.pageSize" |
||||
:pageSizes="queryParam.pageSize" |
||||
:total="total" |
||||
:showSizeChanger="true" |
||||
:showQuickJumper="true" |
||||
:pageSizeOptions="pageSizeOptions" |
||||
:layout="'total, sizes, prev, pager, next, jumper'" |
||||
:showTotal="showTotal" |
||||
@showSizeChange="handleSizeChange" |
||||
@change="handlePageChange" |
||||
style="float: right" |
||||
/> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
import * as Api from '@/api/user/invoice' |
||||
import { ContentHeader, STable } from '@/components' |
||||
// 表格表头 |
||||
const columns = [ |
||||
{ |
||||
title: 'ID', |
||||
dataIndex: 'id', |
||||
|
||||
ellipsis: true |
||||
}, |
||||
{ |
||||
title: '会员昵称/手机号', |
||||
scopedSlots: { customRender: 'main_info' } |
||||
}, |
||||
{ |
||||
title: '发票类型', |
||||
dataIndex: 'type', |
||||
scopedSlots: { customRender: 'type' } |
||||
}, |
||||
{ |
||||
title: '抬头类型', |
||||
dataIndex: 'source', |
||||
scopedSlots: { customRender: 'source' } |
||||
}, |
||||
{ |
||||
title: '单位名称', |
||||
dataIndex: 'header' |
||||
}, |
||||
{ |
||||
title: '税号', |
||||
dataIndex: 'duty_no' |
||||
}, |
||||
{ |
||||
title: '开户银行', |
||||
dataIndex: 'bank_name' |
||||
}, |
||||
{ |
||||
title: '银行卡号', |
||||
dataIndex: 'bank_no' |
||||
}, |
||||
{ |
||||
title: '单位地址', |
||||
dataIndex: 'address' |
||||
}, |
||||
{ |
||||
title: '单位电话', |
||||
dataIndex: 'phone' |
||||
} |
||||
] |
||||
|
||||
export default { |
||||
name: 'Index', |
||||
components: { |
||||
ContentHeader, |
||||
STable |
||||
}, |
||||
data () { |
||||
return { |
||||
// 当前表单元素 |
||||
searchForm: this.$form.createForm(this), |
||||
// 商品分类列表 |
||||
categoryList: [], |
||||
// 订单状态 |
||||
orderStatusList: [], |
||||
// 查询参数 |
||||
queryParam: { |
||||
order_status: '0', |
||||
recovery_name: '', |
||||
category_id: '', |
||||
order_no: '', |
||||
page: 1, |
||||
pageSize: 15 |
||||
}, |
||||
pageSizeOptions: ['15', '30', '50', '100', '200', '300', '400', '500'], |
||||
showTotal: (total) => `共 ${total} 条记录`, // 显示总数 |
||||
total: 0, |
||||
// 正在加载 |
||||
isLoading: false, |
||||
// 表头 |
||||
columns, |
||||
// 选择的元素 |
||||
selectedRowKeys: [], |
||||
// 加载数据方法 必须为 Promise 对象 |
||||
list: [] |
||||
} |
||||
}, |
||||
created () { |
||||
this.fetchData() |
||||
}, |
||||
computed: { |
||||
rowSelection () { |
||||
return { |
||||
selectedRowKeys: this.selectedRowKeys, |
||||
onChange: this.onSelectChange |
||||
} |
||||
} |
||||
}, |
||||
methods: { |
||||
// 选中项发生变化时的回调 |
||||
onSelectChange (selectedRowKeys) { |
||||
this.selectedRowKeys = selectedRowKeys |
||||
}, |
||||
|
||||
// 切换tab |
||||
handleTabs (e) { |
||||
this.queryParam.page = 1 |
||||
this.queryParam.order_status = e.target.value |
||||
this.fetchData() |
||||
}, |
||||
|
||||
// 确认搜索 |
||||
handleSearch () { |
||||
this.queryParam.page = 1 |
||||
this.fetchData() |
||||
}, |
||||
// 重置搜索表单 |
||||
fetchData () { |
||||
this.isLoading = true |
||||
Api.list(this.queryParam) |
||||
.then((result) => { |
||||
this.list = result.data.list |
||||
this.total = result.data.total |
||||
}) |
||||
.finally(() => (this.isLoading = false)) |
||||
}, |
||||
// 重置搜索表单 |
||||
handleReset () { |
||||
this.searchForm.resetFields() |
||||
}, |
||||
handlePageChange (current, size) { |
||||
this.queryParam.page = current |
||||
this.queryParam.pageSize = size |
||||
this.fetchData() |
||||
}, |
||||
handleSizeChange (current, size) { |
||||
this.queryParam.page = current |
||||
this.queryParam.pageSize = size |
||||
this.fetchData() |
||||
}, |
||||
|
||||
/** |
||||
* 刷新列表 |
||||
* @param Boolean bool 强制刷新到第一页 |
||||
*/ |
||||
handleRefresh (bool = false) { |
||||
this.selectedRowKeys = [] |
||||
this.fetchData() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style lang="less" scoped> |
||||
.ant-card-body { |
||||
padding: 22px 29px 25px; |
||||
} |
||||
// 筛选tab |
||||
.tab-list { |
||||
margin-right: 20px; |
||||
} |
||||
</style> |
Loading…
Reference in new issue