提交 92520c61 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 新增提示语

上级 9523e61d
<template> <template>
<div class="h5-pay-list"> <div class="h5-pay-list">
<p class="h5-pay-list__tips">
<i class="el-icon-info"></i> 可开具三个月之内的发票,如已超过三个月,请联系招生办公室。
</p>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list <van-list v-model="loading" class="pay-list" :finished="finished" finished-text="没有更多了" @load="fetchList">
v-model="loading"
class="pay-list"
:finished="finished"
finished-text="没有更多了"
@load="fetchList"
>
<div class="pay-item" v-for="(item, index) in list" :key="index" @click="handleDetials(item)"> <div class="pay-item" v-for="(item, index) in list" :key="index" @click="handleDetials(item)">
<div class="left"> <div class="left">
<h5 class="project">{{item.project_name}}</h5> <h5 class="project">{{ item.project_name }}</h5>
<p class="status">{{item | statusFilter}}</p> <p class="status">{{ item | statusFilter }}</p>
<p class="status">{{item.final_payment_time}}</p> <p class="status">{{ item.final_payment_time }}</p>
</div> </div>
<div class="right"> <div class="right">
<p><span></span>{{parseFloat(item.amount_received) + parseFloat(item.service_charge) | toFixed}}</p> <p><span></span>{{ (parseFloat(item.amount_received) + parseFloat(item.service_charge)) | toFixed }}</p>
</div> </div>
<template v-if="item.project_id == '5005' && item.type == '60'"> <template v-if="item.project_id == '5005' && item.type == '60'">
<van-button v-if="item.real_invoice_status === 1" class="invoice-btn" plain round type="primary" size="mini" color="#C01540" @click.stop="handleInvoice(item)">{{ item.invoice_status == 6 ? '重开发票' : '开具发票' }}</van-button> <van-button
<van-button v-if="item.invoice_status == 4" class="invoice-btn" plain round type="primary" size="mini" color="#C01540" @click.stop="handleDeleteInvoice(item)">作废发票</van-button> v-if="item.real_invoice_status === 1"
class="invoice-btn"
plain
round
type="primary"
size="mini"
color="#C01540"
@click.stop="handleInvoice(item)"
>{{ item.invoice_status == 6 ? '重开发票' : '开具发票' }}</van-button
>
<van-button
v-if="item.invoice_status == 4"
class="invoice-btn"
plain
round
type="primary"
size="mini"
color="#C01540"
@click.stop="handleDeleteInvoice(item)"
>作废发票</van-button
>
</template> </template>
<template v-else> <template v-else>
<van-button v-if="item.real_invoice_status === 1" class="invoice-btn" plain round type="primary" size="mini" color="#C01540" @click.stop="handleInvoice(item)">开具发票</van-button> <van-button
v-if="item.real_invoice_status === 1"
class="invoice-btn"
plain
round
type="primary"
size="mini"
color="#C01540"
@click.stop="handleInvoice(item)"
>开具发票</van-button
>
</template> </template>
</div> </div>
<template slot="finished">{{list.length > 8 ? '没有更多了': ''}}</template> <template slot="finished">{{ list.length > 8 ? '没有更多了' : '' }}</template>
</van-list> </van-list>
</van-pull-refresh> </van-pull-refresh>
<van-empty v-if="list.length === 0" description="暂无记录" /> <van-empty v-if="list.length === 0" description="暂无记录" />
...@@ -97,10 +124,18 @@ export default { ...@@ -97,10 +124,18 @@ export default {
}, },
handleInvoice(val) { handleInvoice(val) {
const query = { id: val.id, name: val.sales_rep_user_id_name, remark: val.payer_name, project_id: val.project_id, type: val.type } const query = {
id: val.id,
name: val.sales_rep_user_id_name,
remark: val.payer_name,
project_id: val.project_id,
type: val.type
}
if (val.project_id === '5005' && val.type === '60') { if (val.project_id === '5005' && val.type === '60') {
if (val.invoices.length) { if (val.invoices.length) {
const item = val.invoices.find(item => parseInt(item.invoice_status) === 4 || parseInt(item.invoice_status) === 6) const item = val.invoices.find(
item => parseInt(item.invoice_status) === 4 || parseInt(item.invoice_status) === 6
)
if (item) { if (item) {
query.taxpayer_info = JSON.stringify({ query.taxpayer_info = JSON.stringify({
taxpayer_address: item.taxpayer_address || '', taxpayer_address: item.taxpayer_address || '',
...@@ -144,73 +179,78 @@ export default { ...@@ -144,73 +179,78 @@ export default {
page_size: this.page_size, page_size: this.page_size,
page: this.page page: this.page
} }
getPayList(params).then(res => { getPayList(params)
if (this.refreshing) { .then(res => {
this.list = [] if (this.refreshing) {
this.finished = false this.list = []
this.refreshing = false this.finished = false
} this.refreshing = false
if (res.code === 0 && res.data && res.data.list) { }
this.list = this.list.concat(res.data.list) if (res.code === 0 && res.data && res.data.list) {
this.total = res.data.total this.list = this.list.concat(res.data.list)
if (this.page * this.page_size >= this.total) { this.total = res.data.total
this.finished = true if (this.page * this.page_size >= this.total) {
this.finished = true
} else {
this.page++
}
} else { } else {
this.page++ this.list = []
this.finished = true
} }
} else { this.loading = false
})
.catch(() => {
this.list = [] this.list = []
this.finished = true this.finished = true
} this.loading = false
this.loading = false })
}).catch(() => {
this.list = []
this.finished = true
this.loading = false
})
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pay-item{ .h5-pay-list__tips {
background:#fff; padding: 10px;
border-bottom:1px solid #f0f0f0; }
display:flex; .pay-item {
position:relative; background: #fff;
padding:0 12px; border-bottom: 1px solid #f0f0f0;
.left{ display: flex;
width:65%; position: relative;
.project{ padding: 0 12px;
font-size:16px; .left {
line-height:32px; width: 65%;
.project {
font-size: 16px;
line-height: 32px;
color: #464646; color: #464646;
font-weight:400; font-weight: 400;
} }
p{ p {
font-size:13px; font-size: 13px;
line-height:26px; line-height: 26px;
color:#999; color: #999;
} }
} }
.right{ .right {
width:35%; width: 35%;
p{ p {
font-size:18px; font-size: 18px;
line-height:36px; line-height: 36px;
text-align: right; text-align: right;
span{ span {
font-size:14px; font-size: 14px;
color:#C01540; color: #c01540;
} }
} }
} }
.invoice-btn{ .invoice-btn {
position:absolute; position: absolute;
right:12px; right: 12px;
bottom: 5px; bottom: 5px;
padding:0 15px; padding: 0 15px;
} }
} }
</style> </style>
<template> <template>
<div class="pc-pay-list"> <div class="pc-pay-list">
<app-list v-bind="tableOptions" ref="appList" @selection-change="handleSelectionChange"> <p class="pc-pay-list__tips">
<template #footer> <i class="el-icon-info"></i> 可开具三个月之内的发票,如已超过三个月,请联系招生办公室。
<div class="selection_bar"></div> </p>
</template> <div class="pc-pay-list__table">
<!-- 操作 --> <app-list v-bind="tableOptions" ref="appList" @selection-change="handleSelectionChange">
<template v-slot:table-operate="{ row }"> <template #footer>
<template v-if="row.real_invoice_status === 1"> <div class="selection_bar"></div>
<el-button type="text" @click="handleInvoice(row)" size="mini">开具发票</el-button>
<el-button type="text" @click="handleInvoiceQR(row)" size="mini">开票二维码</el-button>
</template> </template>
</template> <!-- 操作 -->
</app-list> <template v-slot:table-operate="{ row }">
<el-drawer title="开具发票" :visible.sync="drawerVisible" :close-on-click-modal="false" :destroy-on-close="true" size="600px" top="15px" @close="handleClose"> <template v-if="row.real_invoice_status === 1">
<invoice-form :history="history" :initData="initData" @history="handleHistory" @dialogClose="drawerVisible = false" @submit="fetchCreateInvoice"/> <el-button type="text" @click="handleInvoice(row)" size="mini">开具发票</el-button>
<el-dialog title="选择历史开票信息" :visible.sync="dialogVisible" width="460px" top="15px" append-to-body :destroy-on-close="true" center> <el-button type="text" @click="handleInvoiceQR(row)" size="mini">开票二维码</el-button>
<history-invoice-list v-if="dialogVisible" :hasSearch="true" @select="handleSelect"/> </template>
</template>
</app-list>
</div>
<el-drawer
title="开具发票"
:visible.sync="drawerVisible"
:close-on-click-modal="false"
:destroy-on-close="true"
size="600px"
top="15px"
@close="handleClose"
>
<invoice-form
:history="history"
:initData="initData"
@history="handleHistory"
@dialogClose="drawerVisible = false"
@submit="fetchCreateInvoice"
/>
<el-dialog
title="选择历史开票信息"
:visible.sync="dialogVisible"
width="460px"
top="15px"
append-to-body
:destroy-on-close="true"
center
>
<history-invoice-list v-if="dialogVisible" :hasSearch="true" @select="handleSelect" />
</el-dialog> </el-dialog>
</el-drawer> </el-drawer>
<share-qrcode :visible.sync="shareDialogVisible" :value="shareUrl" /> <share-qrcode :visible.sync="shareDialogVisible" :value="shareUrl" />
...@@ -114,32 +141,42 @@ export default { ...@@ -114,32 +141,42 @@ export default {
}, },
fetchCreateInvoice(val) { fetchCreateInvoice(val) {
val.payment_id = this.payment_id val.payment_id = this.payment_id
createInvoice(val).then(res => { createInvoice(val)
this.$message.success('开具发票成功') .then(res => {
// this.$refs.appList.refetch() this.$message.success('开具发票成功')
this.$refs.appList.refetch() // this.$refs.appList.refetch()
this.drawerVisible = false this.$refs.appList.refetch()
}).catch(err => { this.drawerVisible = false
console.log(err) })
this.$message.error((err.data && err.data.message) || '开具发票失败') .catch(err => {
}) console.log(err)
this.$message.error((err.data && err.data.message) || '开具发票失败')
})
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.pc-pay-list{ .pc-pay-list {
padding:14px; display: flex;
background:#f7f7f7; flex-direction: column;
box-sizing:border-box; padding: 14px;
height:calc(100vh - 64px); background: #f7f7f7;
box-sizing: border-box;
height: calc(100vh - 64px);
}
.pc-pay-list__tips {
padding: 10px 0;
}
.pc-pay-list__table {
flex: 1;
} }
.table-list{ .table-list {
background:#fff; background: #fff;
border-radius:6px; border-radius: 6px;
} }
.el-dialog__wrapper ::v-deep .el-dialog__body{ .el-dialog__wrapper ::v-deep .el-dialog__body {
padding:10px 0; padding: 10px 0;
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论