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

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

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