|
|
|
@ -17,7 +17,8 @@ |
|
|
|
<Row> |
|
|
|
<Col span="24"> |
|
|
|
<Card> |
|
|
|
<div style="margin-right: 50px;margin-bottom: 20px;"> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div style="margin-right: 10px;margin-bottom: 20px;"> |
|
|
|
<Poptip placement="right-start"> |
|
|
|
<Button><Icon type="ios-keypad" /></Button> |
|
|
|
<template #content> |
|
|
|
@ -27,6 +28,10 @@ |
|
|
|
</template> |
|
|
|
</Poptip> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<Button @click="onshow"><Icon type="md-add" /></Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 用户列表 --> |
|
|
|
<div> |
|
|
|
<Table :loading="listLoading" :columns="columnsList1" :data="tableData" stripe disabled-hover></Table> |
|
|
|
@ -37,11 +42,40 @@ |
|
|
|
</Card> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
|
|
|
|
<Modal v-model="show" width="500" :title="showtext" :styles="{top: '30px'}" :closable="false" :mask-closable="false" @on-visible-change="doCancel"> |
|
|
|
<Form ref="myForm" :rules="ruleValidate" :model="formItem" :label-width="80"> |
|
|
|
<FormItem label="用户编号" prop="pucode"> |
|
|
|
<Input v-model="formItem.pucode" placeholder="请输入编号"></Input> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="抬头类型" prop="type"> |
|
|
|
<RadioGroup v-model="formItem.type" v-for="(item,index) in TitleType" :key="index"> |
|
|
|
<Radio :label="item.vales" border>{{item.name}}</Radio> |
|
|
|
</RadioGroup> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="抬头" prop="title"> |
|
|
|
<Input v-model="formItem.title" placeholder="请输入抬头"></Input> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="税号" prop="tax_number" v-if="formItem.type==0"> |
|
|
|
<Input v-model="formItem.tax_number" placeholder="请输入税号"></Input> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="身份证号" prop="tax_number" v-if="formItem.type==1"> |
|
|
|
<Input v-model="formItem.tax_number" placeholder="请输入身份证号"></Input> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="手机号" prop="phone"> |
|
|
|
<Input v-model="formItem.phone" placeholder="请输入手机号"></Input> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
<div slot="footer"> |
|
|
|
<Button type="text" @click="cancel" class="margin-right-10">取消</Button> |
|
|
|
<Button type="primary" @click="submit">确定</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getInvoiceHead } from '@/api/invoice' |
|
|
|
import { getInvoiceHead, InvoiceHeadsave } from '@/api/invoice' |
|
|
|
export default { |
|
|
|
name: 'reqlist', |
|
|
|
data () { |
|
|
|
@ -51,8 +85,22 @@ export default { |
|
|
|
count: 0, |
|
|
|
tableData: [], |
|
|
|
listLoading: false, |
|
|
|
show: false, |
|
|
|
showtext: '', |
|
|
|
pucode_id: '', |
|
|
|
checkAllGroup: ['id', '用户编码', '税号', '开户行', '银行账号', '创建时间'], |
|
|
|
formItem: { |
|
|
|
pucode: '', |
|
|
|
type: '0', |
|
|
|
title: '', |
|
|
|
tax_number: '', |
|
|
|
phone: '', |
|
|
|
id: '' |
|
|
|
}, |
|
|
|
TitleType: [ |
|
|
|
{ name: '单位', vales: '0' }, |
|
|
|
{ name: '个人', vales: '1' } |
|
|
|
], |
|
|
|
checkAllGroup: ['id', '用户编码', '税号', '开户行', '银行账号', '创建时间', '操作'], |
|
|
|
columnsList: [ |
|
|
|
{ title: 'id', align: 'center', key: 'id', minWidth: 80 }, |
|
|
|
{ title: '用户编码', align: 'center', key: 'pucode', minWidth: 100 }, |
|
|
|
@ -71,14 +119,43 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
{ title: '微信用户名', align: 'center', key: 'wechat_user_name', minWidth: 100 }, |
|
|
|
{ title: '电话', align: 'center', key: 'telephone', minWidth: 100 }, |
|
|
|
{ title: '电话', align: 'center', key: 'phone', minWidth: 100 }, |
|
|
|
{ title: '地址', align: 'center', key: 'address', minWidth: 100 }, |
|
|
|
{ title: '抬头类型', align: 'center', key: 'type', minWidth: 100 }, |
|
|
|
{ title: '抬头名称', align: 'center', key: 'title', minWidth: 100 }, |
|
|
|
{ title: '税号', align: 'center', key: 'tax_number', minWidth: 100 }, |
|
|
|
{ title: '税号', align: 'center', key: 'tax_number', width: 200 }, |
|
|
|
{ title: '开户行', align: 'center', key: 'bank_name', minWidth: 100 }, |
|
|
|
{ title: '银行账号', align: 'center', key: 'bank_account', minWidth: 100 }, |
|
|
|
{ title: '创建时间', align: 'center', key: 'create_time', minWidth: 80 } |
|
|
|
{ title: '银行账号', align: 'center', key: 'bank_account', minWidth: 200 }, |
|
|
|
{ title: '创建时间', align: 'center', key: 'create_time', minWidth: 80 }, |
|
|
|
{ |
|
|
|
title: '操作', |
|
|
|
key: 'action', |
|
|
|
fixed: 'right', |
|
|
|
align: 'center', |
|
|
|
minWidth: 50, |
|
|
|
render: (h, params) => { |
|
|
|
return h('div', [ |
|
|
|
h('Button', { |
|
|
|
props: { |
|
|
|
type: 'error', |
|
|
|
size: 'small' |
|
|
|
}, |
|
|
|
on: { |
|
|
|
'click': () => { |
|
|
|
this.show = true |
|
|
|
this.showtext = '编辑' |
|
|
|
this.formItem.pucode = params.row.pucode |
|
|
|
this.formItem.type = params.row.type === '单位' ? '0' : '1' |
|
|
|
this.formItem.title = params.row.title |
|
|
|
this.formItem.tax_number = params.row.tax_number |
|
|
|
this.formItem.phone = params.row.phone |
|
|
|
this.formItem.id = this.showtext === '添加' ? '' : params.row.id |
|
|
|
} |
|
|
|
} |
|
|
|
}, '编辑') |
|
|
|
]) |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -104,6 +181,60 @@ export default { |
|
|
|
this.listLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
cancel () { |
|
|
|
Object.assign(this.formItem, { |
|
|
|
pucode: '', |
|
|
|
type: '0', |
|
|
|
title: '', |
|
|
|
tax_number: '', |
|
|
|
phone: '', |
|
|
|
id: '' |
|
|
|
}) |
|
|
|
this.show = false |
|
|
|
}, |
|
|
|
onshow () { |
|
|
|
this.show = true |
|
|
|
this.showtext = '添加' |
|
|
|
}, |
|
|
|
submit () { |
|
|
|
if (this.showtext === '添加') { |
|
|
|
InvoiceHeadsave(this.formItem).then(response => { |
|
|
|
if (response.data.code === 1) { |
|
|
|
this.$Message.success('添加成功') |
|
|
|
this.show = false |
|
|
|
Object.assign(this.formItem, { |
|
|
|
pucode: '', |
|
|
|
type: '0', |
|
|
|
title: '', |
|
|
|
tax_number: '', |
|
|
|
phone: '', |
|
|
|
id: '' |
|
|
|
}) |
|
|
|
this.InvoiceHead() |
|
|
|
} else { |
|
|
|
this.$Message.error(response.data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
InvoiceHeadsave(this.formItem).then(response => { |
|
|
|
if (response.data.code === 1) { |
|
|
|
this.$Message.success('编辑成功') |
|
|
|
this.show = false |
|
|
|
Object.assign(this.formItem, { |
|
|
|
pucode: '', |
|
|
|
type: '0', |
|
|
|
title: '', |
|
|
|
tax_number: '', |
|
|
|
phone: '', |
|
|
|
id: '' |
|
|
|
}) |
|
|
|
this.InvoiceHead() |
|
|
|
} else { |
|
|
|
this.$Message.error(response.data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
search () { |
|
|
|
this.page = 1 |
|
|
|
this.InvoiceHead() |
|
|
|
|