Browse Source

修改

master
liaoxinyu 2 months ago
parent
commit
0dc5c0bdd1
  1. 24
      src/api/invoice.js
  2. 161
      src/view/invoice/headlist.vue
  3. 31
      src/view/invoice/reqlist.vue

24
src/api/invoice.js

@ -47,3 +47,27 @@ export const getcancel = (params) => {
params: params
})
}
/**
* 开票失败
* @returns {wx.RequestTask | never}
*/
export const restart = (params) => {
return axios.request({
url: 'InvoiceIssuance/restart',
method: 'get',
params: params
})
}
/**
* 新增/编辑发票抬头
* @returns {wx.RequestTask | never}
*/
export const InvoiceHeadsave = (data) => {
return axios.request({
url: 'InvoiceHead/save',
method: 'post',
data
})
}

161
src/view/invoice/headlist.vue

@ -17,15 +17,20 @@
<Row>
<Col span="24">
<Card>
<div style="margin-right: 50px;margin-bottom: 20px;">
<Poptip placement="right-start">
<Button><Icon type="ios-keypad" /></Button>
<template #content>
<CheckboxGroup style="display: grid; gap: 10px" v-for="(item,index) in columnsList" :key="index" v-model="checkAllGroup">
<Checkbox :label="item.title"></Checkbox>
</CheckboxGroup>
</template>
</Poptip>
<div style="display: flex;">
<div style="margin-right: 10px;margin-bottom: 20px;">
<Poptip placement="right-start">
<Button><Icon type="ios-keypad" /></Button>
<template #content>
<CheckboxGroup style="display: grid; gap: 10px" v-for="(item,index) in columnsList" :key="index" v-model="checkAllGroup">
<Checkbox :label="item.title"></Checkbox>
</CheckboxGroup>
</template>
</Poptip>
</div>
<div>
<Button @click="onshow"><Icon type="md-add" /></Button>
</div>
</div>
<!-- 用户列表 -->
<div>
@ -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()

31
src/view/invoice/reqlist.vue

@ -71,7 +71,7 @@
</template>
<script>
import { getinvoiceList, getIndexData, getcancel } from '@/api/invoice'
import { getinvoiceList, getIndexData, getcancel, restart } from '@/api/invoice'
import config from '@/config'
export default {
name: 'reqlist',
@ -93,7 +93,7 @@ export default {
start_time: '',
end_time: '',
cityList: [{ value: '0', label: '单位' }, { value: '1', label: '个人' }, { value: 'null', label: '全部' }],
cityList1: [{ value: '3', label: '已开票' }, { value: '0', label: '未开票' }, { value: '4', label: '已作废' }, { value: 'null', label: '全部' }],
cityList1: [{ value: '3', label: '已开票' }, { value: '0', label: '未开票' }, { value: '4', label: '已作废' }, { value: '2', label: '开票失败' }, { value: 'null', label: '全部' }],
projectList: [],
checkAllGroup: ['id', '创建时间', '用户编号', '手机号码', '邮箱号', '抬头类型', '抬头名称', '合并开票', '状态', '开票金额', '开票账期', '开票时间', '作废时间', '操作'],
columnsList: [
@ -162,6 +162,8 @@ export default {
const isInvoiced = params.row.status === '已开票'
const isInvoiced1 = params.row.status === '已作废'
const isInvoiced2 = params.row.status === '开票失败'
const isInvoiced3 = params.row.status === '未开票'
const isInvoiced4 = params.row.status === '待开票'
const renderPreviewButton = () => {
if (!isInvoiced) return null
@ -183,7 +185,7 @@ export default {
}
const renderCancelButton = () => {
if (isInvoiced1 || isInvoiced2 || isInvoiced) return null
if (isInvoiced1 || isInvoiced2 || isInvoiced || isInvoiced3) return null
return h('Button', {
props: {
type: 'error',
@ -206,9 +208,30 @@ export default {
}, '作废')
}
const failureButton = () => {
if (isInvoiced1 || isInvoiced || isInvoiced3 || isInvoiced4) return null
return h('Button', {
props: {
type: 'success',
size: 'small'
},
on: {
click: () => {
restart({ id: params.row.id }).then(response => {
if (response.data.code === 1) {
this.$Message.success('重开成功')
this.getinvoiceList()
}
})
}
}
}, '重开')
}
return h('div', [
renderPreviewButton(),
renderCancelButton()
renderCancelButton(),
failureButton()
].filter(Boolean))
}
}

Loading…
Cancel
Save