提交 05a283bd authored 作者: pengxiaohui's avatar pengxiaohui

update: 开具发票测试交互优化

上级 e5efc260
......@@ -164,7 +164,7 @@ export default {
this.fetchList()
},
// 刷新
refetch(isForce) {
c(isForce) {
isForce ? this.reset() : this.fetchList()
},
// 页数改变
......
......@@ -44,8 +44,8 @@
<el-input v-model="form.taxpayer_bank_account" size="small" placeholder="请输入银行账号"/>
</el-form-item>
</template>
<el-form-item label="备注" prop="remarks" style="margin-bottom:0;">
<el-input v-model="form.remarks" size="small" placeholder="请输入备注"/>
<el-form-item label="备注" prop="invoice_remark" style="margin-bottom:0;">
<el-input v-model="form.invoice_remark" size="small" placeholder="请输入备注" disabled/>
</el-form-item>
<h5>收票信息</h5>
<el-form-item v-if="form.invoice_type === '2'" label="邮箱地址" prop="recipient_email">
......@@ -77,7 +77,7 @@ const defaultForm = {
invoice_type: '',
taxpayer_name: '',
taxpayer_identifier: '',
remarks: '',
invoice_remark: '',
recipient_email: '',
recipient_address: '',
recipient_name: '',
......
......@@ -138,11 +138,12 @@ export default {
},
fetchCreateInvoice() {
const params = Object.assign({}, this.form)
params.id = this.id
params.payment_id = this.id
createInvoice(params).then(res => {
Toast.success('开具发票成功')
}).catch(err => {
Toast.fail(err.message || '开具发票失败')
console.log(err)
Toast.fail((err.data && err.data.message) || '开具发票失败')
})
}
}
......
......@@ -17,7 +17,7 @@
<div class="right">
<p><span></span>{{item.amount_received}}</p>
</div>
<van-button v-if="['2', '6'].includes(item.invoice_status)" class="invoice-btn" plain round type="primary" size="mini" color="#C01540" @click.stop="handleInvoice(item)">开具发票</van-button>
<van-button v-if="['2', '5', '6'].includes(item.invoice_status)" class="invoice-btn" plain round type="primary" size="mini" color="#C01540" @click.stop="handleInvoice(item)">开具发票</van-button>
</div>
<template slot="finished">{{list.length > 8 ? '没有更多了': ''}}</template>
</van-list>
......
......@@ -6,7 +6,7 @@
</template>
<!-- 操作 -->
<template v-slot:table-operate="{ row }">
<el-button v-if="['1', '2', '6'].includes(row.invoice_status)" type="text" @click="handleInvoice(row)" size="mini">开具发票</el-button>
<el-button v-if="['2', '5', '6'].includes(row.invoice_status)" type="text" @click="handleInvoice(row)" size="mini">开具发票</el-button>
<el-button type="text" @click="handleInvoiceQR(row)" size="mini">开票二维码</el-button>
</template>
</app-list>
......@@ -80,6 +80,7 @@ export default {
handleInvoice(row) {
this.drawerVisible = true
this.payment_id = row.id
if (row.invoice_remark) this.history.invoice_remark = row.invoice_remark
},
handleInvoiceQR(row) {
this.shareUrl = `${import.meta.env.VITE_SHARE_URL}/h5/payment/invoice?id=${row.id}`
......@@ -98,8 +99,10 @@ export default {
val.payment_id = this.payment_id
createInvoice(val).then(res => {
this.$message.success('开具发票成功')
}).catch((err) => {
this.$message.error(err.message || '开具发票失败')
this.$refs.appList.refetch()
this.drawerVisible = false
}).catch(err => {
this.$message.error((err.data && err.data.message) || '开具发票失败')
})
}
}
......@@ -111,6 +114,7 @@ export default {
padding:14px;
background:#f7f7f7;
box-sizing:border-box;
height:calc(100vh - 64px);
}
.table-list{
background:#fff;
......
import axios from 'axios'
import queryString from 'query-string'
import { Message } from 'element-ui'
// import { Message } from 'element-ui'
const httpRequest = axios.create({
timeout: 60000,
......@@ -39,16 +39,14 @@ httpRequest.interceptors.response.use(
},
function (error) {
if (error.response) {
const { status, message } = error.response.data
const { status } = error.response.data
// 未登录
if (status === 403) {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(window.location.href)}`
} else {
Message.error(message || error.response.data)
// Message.error(message || error.response.data)
}
return Promise.reject(error.response)
} else {
console.log(error)
}
return Promise.reject(error)
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论