feat(finance): 新增收票与红冲发票审批功能
- 在路由中新增发票红冲和收票审批相关页面路径 - 新增红冲发票审批页面及详情展示组件 - 修改收票单据字段显示,统一使用 ticketBillCode 字段 - 调整收票和红冲发票的审批流程跳转逻辑 - 更新附件上传人字段为 createByName - 后端区分不同类型票据启动不同的审批流程 - 优化前端接口请求增加 loading 状态控制 - 移除付款明细中的冗余附件获取逻辑 - 新增收票相关 API 接口文件并实现基本功能方法dev_1.0.0
parent
7c46ae5db4
commit
af12674d7b
|
|
@ -82,7 +82,8 @@ export function applyPaymentApi(data) {
|
|||
return request({
|
||||
url: '/finance/payment/applyPayment',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +91,8 @@ export function applyPaymentApi(data) {
|
|||
export function applyRefund(id) {
|
||||
return request({
|
||||
url: '/finance/payment/applyRefund/'+id,
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +100,8 @@ export function applyRefundApprove(id) {
|
|||
return request({
|
||||
url: '/finance/payment/applyRefundApprove',
|
||||
method: 'post',
|
||||
data: {id: id}
|
||||
data: {id: id},
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
import request from '@/utils/request'
|
||||
import {tansParams} from "@/utils/ruoyi"
|
||||
|
||||
// 查询收票单列表
|
||||
export function listReceipt(query) {
|
||||
return request({
|
||||
url: '/finance/ticket/list',
|
||||
method: 'get',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded'
|
||||
// },
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票单详细
|
||||
export function getReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票单附件
|
||||
export function getReceiptAttachments(id, params) {
|
||||
return request({
|
||||
url: `/finance/ticket/attachment/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 上传收票单附件
|
||||
export function uploadReceiptAttachment(data) {
|
||||
return request({
|
||||
url: '/finance/ticket/uploadReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
});
|
||||
}
|
||||
|
||||
// 退回收票单
|
||||
export function redRush(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/applyRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function returnReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/return/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收票单
|
||||
export function addReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/payable/mergeAndInitiateReceipt',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
|
@ -99,6 +99,16 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/approve/finance/payment/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'invoiceRedLog',
|
||||
component: () => import('@/views/approve/finance/invoiceRed/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'invoiceLog',
|
||||
component: () => import('@/views/approve/finance/invoiceReceipt/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@
|
|||
|
||||
<el-table v-loading="loading" :data="invoiceReceiptList">
|
||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||
<el-table-column label="收票编号" align="center" prop="receiptBillCode" />
|
||||
<el-table-column label="收票编号" align="center" prop="ticketBillCode" />
|
||||
<el-table-column label="供应商" align="center" prop="vendorName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="金额" align="center" prop="totalPriceWithTax" />
|
||||
<el-table-column label="登记人" align="center" prop="createUserName" />
|
||||
<el-table-column label="审批节点" align="center" prop="approveNode" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
<div class="el-descriptions__title">附件信息</div>
|
||||
<el-table :data="attachments" border style="width: 100%; margin-top: 10px;">
|
||||
<el-table-column prop="fileName" label="附件名称" align="center"></el-table-column>
|
||||
<el-table-column prop="createUserName" label="上传人" align="center"></el-table-column>
|
||||
<el-table-column prop="createByName" label="上传人" align="center"></el-table-column>
|
||||
<el-table-column prop="createTime" label="上传时间" align="center"></el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ export default {
|
|||
this.handleQuery();
|
||||
},
|
||||
toApproved() {
|
||||
this.$router.push( '/approve/invoiceReceiptLog' )
|
||||
this.$router.push( '/approve/invoiceLog' )
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.resetDetailForm();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,151 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item label="收票编号" prop="receiptNo">
|
||||
<el-input v-model="queryParams.receiptNo" placeholder="请输入收票编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="vendorName">
|
||||
<el-input v-model="queryParams.vendorName" placeholder="请输入供应商" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="invoiceReceiptList">
|
||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||
<el-table-column label="收票编号" align="center" prop="ticketBillCode" />
|
||||
<el-table-column label="供应商" align="center" prop="vendorName" />
|
||||
|
||||
<el-table-column label="金额" align="center" prop="totalPriceWithTax" />
|
||||
|
||||
<el-table-column label="审批节点" align="center" prop="approveNode" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<el-dialog title="红冲发票详情" :visible.sync="detailDialogVisible" width="80%" append-to-body>
|
||||
<div v-loading="detailLoading" style="max-height: 70vh; overflow-y: auto; padding: 20px;">
|
||||
<ApproveLayout title="红冲发票详情">
|
||||
<invoice-red-detail :data="form"></invoice-red-detail>
|
||||
<template #footer>
|
||||
<span>收票编号: {{ form.receiptBillCode }}</span>
|
||||
</template>
|
||||
</ApproveLayout>
|
||||
|
||||
<el-divider content-position="left">流转意见</el-divider>
|
||||
<div class="process-container">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(log, index) in approveLogs" :key="index" :timestamp="log.approveTime" placement="top">
|
||||
<el-card>
|
||||
<h4>{{ log.approveOpinion }}</h4>
|
||||
<p><b>操作人:</b> {{ log.approveUserName }} </p>
|
||||
<p><b>审批状态:</b> <el-tag size="small">{{ getStatusText(log.approveStatus) }}</el-tag></p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div v-if="!approveLogs || approveLogs.length === 0">暂无流转过程数据。</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInvoiceReceiptApproved, getInvoiceReceipt } from "@/api/finance/invoiceReceipt";
|
||||
import { listCompletedFlows } from "@/api/flow";
|
||||
import InvoiceRedDetail from "../components/InvoiceRedDetail";
|
||||
import ApproveLayout from "@/views/approve/ApproveLayout";
|
||||
|
||||
export default {
|
||||
name: "InvoiceRedApproved",
|
||||
components: { InvoiceRedDetail, ApproveLayout },
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
invoiceReceiptList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
receiptNo: null,
|
||||
vendorName: null,
|
||||
processKey: 'finance_ticket_refound',
|
||||
projectName: null
|
||||
},
|
||||
detailDialogVisible: false,
|
||||
detailLoading: false,
|
||||
form: {},
|
||||
approveLogs: [],
|
||||
currentInvoiceReceiptId: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInvoiceReceiptApproved(this.queryParams).then(response => {
|
||||
this.invoiceReceiptList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleView(row) {
|
||||
this.form = {};
|
||||
this.approveLogs = [];
|
||||
this.currentInvoiceReceiptId = row.id;
|
||||
this.detailLoading = true;
|
||||
this.detailDialogVisible = true;
|
||||
|
||||
getInvoiceReceipt(this.currentInvoiceReceiptId).then(response => {
|
||||
this.form = response.data;
|
||||
this.loadApproveHistory(this.form.receiptBillCode);
|
||||
this.detailLoading = false;
|
||||
}).catch(() => {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
loadApproveHistory(businessKey) {
|
||||
if (businessKey) {
|
||||
listCompletedFlows({ businessKey: businessKey }).then(response => {
|
||||
this.approveLogs = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
getStatusText(status) {
|
||||
const map = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||
return map[status] || '提交审批';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.process-container {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<template>
|
||||
<div class="invoice-red-detail">
|
||||
<el-descriptions title="红冲发票信息" :column="3" border>
|
||||
<el-descriptions-item label="收票单编号">{{ data.ticketBillCode }}</el-descriptions-item>
|
||||
<el-descriptions-item label="供应商名称">{{ data.vendorName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="发票类型">
|
||||
<dict-tag :options="dict.type.finance_invoice_type" :value="data.ticketType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="含税总价">{{ data.totalPriceWithTax }}</el-descriptions-item>
|
||||
<el-descriptions-item label="未税总价">{{ data.totalPriceWithoutTax }}</el-descriptions-item>
|
||||
<el-descriptions-item label="税额">{{ data.taxAmount }}</el-descriptions-item>
|
||||
<el-descriptions-item label="制造商开票时间">{{ data.vendorTicketTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="3">{{ data.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div class="section" style="margin-top: 20px;" v-show="data.detailList && data.detailList.length>0">
|
||||
<div class="el-descriptions__title">发票明细列表</div>
|
||||
<el-table :data="data.detailList" border style="width: 100%; margin-top: 10px;">
|
||||
<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
||||
<el-table-column prop="payableBillCode" label="采购-应付单编号" align="center"></el-table-column>
|
||||
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
|
||||
<el-table-column prop="productType" label="产品类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.product_type" :value="scope.row.productType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalPriceWithTax" label="含税总价" align="center"></el-table-column>
|
||||
<el-table-column prop="paymentAmount" label="本次收票金额" align="center"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="section" style="margin-top: 20px;" v-if="attachments && attachments.length > 0">
|
||||
<div class="el-descriptions__title">附件信息</div>
|
||||
<el-table :data="attachments" border style="width: 100%; margin-top: 10px;">
|
||||
<el-table-column prop="fileName" label="附件名称" align="center"></el-table-column>
|
||||
<el-table-column prop="createByName" label="上传人" align="center"></el-table-column>
|
||||
<el-table-column prop="createTime" label="上传时间" align="center"></el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreview(scope.row)">预览</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-download" @click="handleDownload(scope.row)">下载</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="pdfPreviewVisible" width="80%" append-to-body top="5vh" title="PDF预览">
|
||||
<iframe :src="currentPdfUrl" width="100%" height="600px" frameborder="0"></iframe>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="imagePreviewVisible" width="60%" append-to-body top="5vh" title="图片预览">
|
||||
<img :src="currentImageUrl" style="width: 100%;" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getInvoiceReceiptAttachments } from "@/api/finance/invoiceReceipt";
|
||||
import request from '@/utils/request';
|
||||
|
||||
export default {
|
||||
name: "InvoiceRedDetail",
|
||||
props: {
|
||||
data: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
dicts: ['finance_invoice_type', 'product_type'],
|
||||
data() {
|
||||
return {
|
||||
attachments: [],
|
||||
pdfPreviewVisible: false,
|
||||
currentPdfUrl: '',
|
||||
imagePreviewVisible: false,
|
||||
currentImageUrl: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'data.id': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.fetchAttachments(val);
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchAttachments(id) {
|
||||
// 保持调用 invoiceReceipt 的附件接口,因为接口一致
|
||||
getInvoiceReceiptAttachments(id,{ type: 'ticket' }).then(response => {
|
||||
this.attachments = (response.data || []).filter(item => item.delFlag !== '2');
|
||||
});
|
||||
},
|
||||
isPdf(filePath) {
|
||||
return filePath && filePath.toLowerCase().endsWith('.pdf');
|
||||
},
|
||||
getImageUrl(resource) {
|
||||
return process.env.VUE_APP_BASE_API + "/common/download/resource?resource=" + resource;
|
||||
},
|
||||
handlePreview(row) {
|
||||
if (this.isPdf(row.filePath)) {
|
||||
request({
|
||||
url: '/common/download/resource',
|
||||
method: 'get',
|
||||
params: { resource: row.filePath },
|
||||
responseType: 'blob'
|
||||
}).then(res => {
|
||||
const blob = new Blob([res.data], { type: 'application/pdf' });
|
||||
this.currentPdfUrl = URL.createObjectURL(blob);
|
||||
this.pdfPreviewVisible = true;
|
||||
});
|
||||
} else {
|
||||
this.currentImageUrl = this.getImageUrl(row.filePath);
|
||||
this.imagePreviewVisible = true;
|
||||
}
|
||||
},
|
||||
handleDownload(row) {
|
||||
const link = document.createElement('a');
|
||||
link.href = this.getImageUrl(row.filePath);
|
||||
link.download = row.fileName || 'attachment';
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.invoice-red-detail {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,238 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<el-form-item label="收票编号" prop="receiptNo">
|
||||
<el-input v-model="queryParams.receiptNo" placeholder="请输入收票编号" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="vendorName">
|
||||
<el-input v-model="queryParams.vendorName" placeholder="请输入供应商" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
size="mini"
|
||||
@click="toApproved()"
|
||||
>审批历史</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="invoiceReceiptList">
|
||||
<el-table-column label="序号" type="index" width="50" align="center" />
|
||||
<el-table-column label="收票编号" align="center" prop="ticketBillCode" />
|
||||
<el-table-column label="供应商" align="center" prop="vendorName" />
|
||||
<!-- <el-table-column label="项目名称" align="center" prop="projectName" />-->
|
||||
<el-table-column label="金额" align="center" prop="totalPriceWithTax" />
|
||||
<!-- <el-table-column label="登记人" align="center" prop="createUserName" />-->
|
||||
<el-table-column label="审批节点" align="center" prop="approveNode" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleApprove(scope.row)">审批</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
||||
|
||||
<!-- 审批详情主对话框 -->
|
||||
<el-dialog title="红冲发票审批" :visible.sync="detailDialogVisible" width="80%" append-to-body>
|
||||
<div v-loading="detailLoading" style="max-height: 70vh; overflow-y: auto; padding: 20px;">
|
||||
<ApproveLayout title="红冲发票详情">
|
||||
<invoice-red-detail :data="form"></invoice-red-detail>
|
||||
<template #footer>
|
||||
<span>收票编号: {{ form.ticketBillCode }}</span>
|
||||
</template>
|
||||
</ApproveLayout>
|
||||
|
||||
<el-divider content-position="left">流转意见</el-divider>
|
||||
<div class="process-container">
|
||||
<el-timeline>
|
||||
<el-timeline-item v-for="(log, index) in approveLogs" :key="index" :timestamp="log.approveTime" placement="top">
|
||||
<el-card>
|
||||
<h4>{{ log.approveOpinion }}</h4>
|
||||
<p><b>操作人:</b> {{ log.approveUserName }} </p>
|
||||
<p><b>审批状态:</b> <el-tag size="small">{{ getStatusText(log.approveStatus) }}</el-tag></p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<div v-if="!approveLogs || approveLogs.length === 0">暂无流转过程数据。</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openOpinionDialog('approve')">同意</el-button>
|
||||
<el-button type="danger" @click="openOpinionDialog('reject')">驳回</el-button>
|
||||
<el-button @click="detailDialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 审批意见对话框 -->
|
||||
<el-dialog :title="confirmDialogTitle" :visible.sync="opinionDialogVisible" width="30%" append-to-body>
|
||||
<el-form ref="opinionForm" :model="opinionForm" :rules="opinionRules" label-width="100px">
|
||||
<el-form-item label="审批意见" prop="approveOpinion">
|
||||
<el-input v-model="opinionForm.approveOpinion" type="textarea" :rows="4" placeholder="请输入审批意见"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="opinionDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="showConfirmDialog()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInvoiceReceiptApprove, getInvoiceReceipt } from "@/api/finance/invoiceReceipt";
|
||||
import { approveTask, listCompletedFlows } from "@/api/flow";
|
||||
import InvoiceRedDetail from "./components/InvoiceRedDetail";
|
||||
import ApproveLayout from "@/views/approve/ApproveLayout";
|
||||
|
||||
export default {
|
||||
name: "InvoiceRedApprove",
|
||||
components: { InvoiceRedDetail, ApproveLayout },
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
invoiceReceiptList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
receiptNo: null,
|
||||
vendorName: null,
|
||||
processKey: 'finance_ticket_refound',
|
||||
projectName: null
|
||||
},
|
||||
detailDialogVisible: false,
|
||||
detailLoading: false,
|
||||
form: {},
|
||||
approveLogs: [],
|
||||
opinionDialogVisible: false,
|
||||
confirmDialogTitle: '',
|
||||
currentApproveType: '',
|
||||
opinionForm: {
|
||||
approveOpinion: ''
|
||||
},
|
||||
opinionRules: {
|
||||
approveOpinion: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
||||
},
|
||||
processKey: 'finance_ticket_refound',
|
||||
taskId: null,
|
||||
currentInvoiceReceiptId: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listInvoiceReceiptApprove(this.queryParams).then(response => {
|
||||
this.invoiceReceiptList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
toApproved() {
|
||||
this.$router.push( '/approve/invoiceRedLog' )
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.resetDetailForm();
|
||||
this.currentInvoiceReceiptId = row.id;
|
||||
this.taskId = row.taskId;
|
||||
this.detailLoading = true;
|
||||
this.detailDialogVisible = true;
|
||||
|
||||
getInvoiceReceipt(this.currentInvoiceReceiptId).then(response => {
|
||||
this.form = response.data;
|
||||
this.loadApproveHistory(this.form.receiptBillCode);
|
||||
this.detailLoading = false;
|
||||
}).catch(() => {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
resetDetailForm() {
|
||||
this.form = {};
|
||||
this.approveLogs = [];
|
||||
this.opinionForm.approveOpinion = '';
|
||||
},
|
||||
loadApproveHistory(businessKey) {
|
||||
if (businessKey) {
|
||||
let keys = [];
|
||||
if(this.processKey) keys.push(this.processKey);
|
||||
|
||||
listCompletedFlows({ businessKey: businessKey, processKeyList: keys }).then(response => {
|
||||
this.approveLogs = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
openOpinionDialog(type) {
|
||||
this.currentApproveType = type;
|
||||
this.confirmDialogTitle = type === 'approve' ? '同意审批' : '驳回审批';
|
||||
this.opinionDialogVisible = true;
|
||||
this.opinionForm.approveOpinion = '';
|
||||
this.$nextTick(() => {
|
||||
if(this.$refs.opinionForm) this.$refs.opinionForm.clearValidate();
|
||||
});
|
||||
},
|
||||
showConfirmDialog() {
|
||||
this.$refs.opinionForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.opinionDialogVisible = false;
|
||||
this.submitApproval();
|
||||
}
|
||||
});
|
||||
},
|
||||
submitApproval() {
|
||||
const approveBtn = this.currentApproveType === 'approve' ? 1 : 0;
|
||||
const params = {
|
||||
businessKey: this.form.ticketBillCode,
|
||||
processKey: this.processKey,
|
||||
taskId: this.taskId,
|
||||
variables: {
|
||||
comment: this.opinionForm.approveOpinion,
|
||||
approveBtn: approveBtn
|
||||
}
|
||||
};
|
||||
|
||||
approveTask(params).then(() => {
|
||||
this.$modal.msgSuccess(this.confirmDialogTitle + "成功");
|
||||
this.detailDialogVisible = false;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
getStatusText(status) {
|
||||
if (!status) {
|
||||
return '提交审批'
|
||||
}
|
||||
const map = { '1': '提交审批', '2': '驳回', '3': '批准' };
|
||||
return map[status] || '提交审批';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.process-container {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getPaymentAttachments } from "@/api/finance/payment";
|
||||
|
||||
import request from '@/utils/request';
|
||||
|
||||
export default {
|
||||
|
|
@ -79,22 +79,10 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
'data.id': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
this.fetchAttachments(val);
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
fetchAttachments(id) {
|
||||
getPaymentAttachments(id).then(response => {
|
||||
// Filter out voided (delFlag == '2')
|
||||
this.attachments = (response.data || []).filter(item => item.delFlag !== '2');
|
||||
});
|
||||
},
|
||||
|
||||
isPdf(filePath) {
|
||||
return filePath && filePath.toLowerCase().endsWith('.pdf');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -192,11 +192,20 @@ public class OmsTicketBillServiceImpl implements IOmsTicketBillService, TodoComm
|
|||
omsTicketBill.setTicketPriceWithoutTax(bill.getTicketPriceWithoutTax());
|
||||
omsTicketBill.setTicketType(bill.getTicketType());
|
||||
updateOmsTicketBill(omsTicketBill);
|
||||
|
||||
if (omsTicketBill.getTicketBillType().equals(OmsTicketBill.TicketBillTypeEnum.FROM_PAYABLE.getCode())) {
|
||||
todoService.startProcessDeleteBefore(omsTicketBill.getTicketBillCode(), omsTicketBill.getTicketBillCode(),
|
||||
new HashMap<String, Object>() {{
|
||||
put("applyUserName", ShiroUtils.getSysUser().getUserName());
|
||||
put("applyUser", ShiroUtils.getUserId());
|
||||
}}, processConfig.getDefinition().getFiananceTicket());
|
||||
} else {
|
||||
todoService.startProcessDeleteBefore(omsTicketBill.getTicketBillCode(), omsTicketBill.getTicketBillCode(),
|
||||
new HashMap<String, Object>() {{
|
||||
put("applyUserName", ShiroUtils.getSysUser().getUserName());
|
||||
put("applyUser", ShiroUtils.getUserId());
|
||||
}}, processConfig.getDefinition().getFinanceTicketRefound());
|
||||
}
|
||||
return AjaxResult.success(attachment);
|
||||
}
|
||||
|
||||
|
|
@ -231,7 +240,7 @@ public class OmsTicketBillServiceImpl implements IOmsTicketBillService, TodoComm
|
|||
refundBill.setTicketBillType(OmsTicketBill.TicketBillTypeEnum.RED_RUSH.getCode());
|
||||
refundBill.setTicketStatus(OmsTicketBill.TicketStatusEnum.TICKET.getCode());
|
||||
refundBill.setRefundStatus(OmsTicketBill.RefundStatusEnum.REFUNDED.getCode());
|
||||
refundBill.setApproveStatus(ApproveStatusEnum.WAIT_APPROVE.getCode());
|
||||
refundBill.setApproveStatus(ApproveStatusEnum.WAIT_COMMIT.getCode());
|
||||
refundBill.setOriginalBillId(originalBill.getId());
|
||||
refundBill.setActualTicketTime(null);
|
||||
refundBill.setApproveTime(null);
|
||||
|
|
@ -245,12 +254,6 @@ public class OmsTicketBillServiceImpl implements IOmsTicketBillService, TodoComm
|
|||
updateOmsTicketBill(originalBill);
|
||||
//4 创建付款明细
|
||||
payableTicketDetailService.applyRefund(originalBill.getTicketBillCode(),refundBill.getTicketBillCode());
|
||||
//5. 开始退款审批流程
|
||||
todoService.startProcessDeleteBefore(originalBill.getTicketBillCode(), originalBill.getTicketBillCode(),
|
||||
new HashMap<String, Object>() {{
|
||||
put("applyUserName", ShiroUtils.getSysUser().getUserName());
|
||||
put("applyUser", ShiroUtils.getUserId());
|
||||
}}, processConfig.getDefinition().getFinanceTicketRefound());
|
||||
|
||||
return AjaxResult.success("退款申请已提交,新的退款单号为:" + refundBill.getTicketBillCode());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue