feature/0423
wanghousheng 10 months ago
parent 07b84fffd4
commit 95eab50c6e
  1. 15
      src/api/user/invoice.js
  2. 459
      src/config/router.config.js
  3. 205
      src/views/user/Invoice.vue
  4. 34
      src/views/user/modules/GradeForm.vue

@ -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>

@ -30,6 +30,9 @@
<a-form-item label="有效时间" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="show_date">
<a-date-picker valueFormat="YYYY-MM-DD" v-decorator="['effective_time', { rules: [{message: '请输入有效时间',required: true }] }]"/>
</a-form-item>
<a-form-item label="有效时间" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="show_date_fx">
<a-date-picker valueFormat="YYYY-MM-DD" v-decorator="['fx_effective_time', { rules: [{message: '请输入有效时间',required: true }] }]"/>
</a-form-item>
<!-- <a-form-item label="会员等级" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择会员等级"
@ -72,6 +75,7 @@ export default {
data () {
return {
show_date: false,
show_date_fx: false,
//
title: '设置会员等级',
//
@ -82,6 +86,8 @@ export default {
visible: false,
// modal() loading
confirmLoading: false,
fx_effective_time: '',
effective_time: '',
//
form: this.$form.createForm(this),
//
@ -115,31 +121,43 @@ export default {
this.visible = true
//
this.record = record
if (record.user_type === 30) {
record.effective_time = record.fx_effective_time
}
if (record.user_type !== 10 && record.effective_time || record.fx_effective_time) {
this.fx_effective_time = record.fx_effective_time
this.effective_time = record.effective_time
if (record.user_type === 30 && record.fx_effective_time) {
this.show_date = false
this.show_date_fx = true
} else if (record.user_type === 20 || record.user_type === 40 && record.effective_time) {
this.show_date = true
this.show_date_fx = false
} else {
this.show_date = false
this.show_date_fx = false
}
//
this.setFieldsValue()
},
setUserType (val) {
console.log(val)
if (val === 20 || val === 30 || val === 40) {
this.show_date = true
if (val === 30) {
this.show_date = false
this.show_date_fx = true
this.record.fx_effective_time = this.fx_effective_time
} else if (val === 20 || val === 40) {
this.show_date = true
this.show_date_fx = false
this.record.effective_time = this.effective_time
} else {
this.show_date = false
this.show_date_fx = false
}
this.record.user_type = val
this.setFieldsValue()
},
//
setFieldsValue () {
const { record, form: { setFieldsValue } } = this
this.$nextTick(() => {
// setFieldsValue(pick(record, ['grade_id', 'user_type']))
setFieldsValue(pick(record, ['user_type', 'effective_time']))
setFieldsValue(pick(record, ['user_type', 'effective_time', 'fx_effective_time']))
})
this.form.getFieldDecorator('grade_id', { initialValue: 0, preserve: true })

Loading…
Cancel
Save