销项发票信息按照格式下载

This commit is contained in:
lihao 2025-04-08 15:32:21 +08:00
parent 0bbcf74bb6
commit db8a773f52
1 changed files with 107 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import React, {
Component Component
} from "react"; } from "react";
import { import {
formDownload,
createPage, createPage,
getMultiLang, getMultiLang,
base, base,
@ -56,7 +57,9 @@ class InvoiceSale extends Component {
}, // 作废 }, // 作废
[presetVar.headBtns.Download]: () => { [presetVar.headBtns.Download]: () => {
Download.call(this); this.props.modal.show('LnvoiceDownloadTypeModal');
this.props.form.setFormStatus('LnvoiceDownloadType', 'edit');
// Download.call(this);
}, // 下载 }, // 下载
[presetVar.headBtns.LinkBill]: () => { [presetVar.headBtns.LinkBill]: () => {
@ -87,6 +90,14 @@ class InvoiceSale extends Component {
handlePageInfoChange = (...params) => { handlePageInfoChange = (...params) => {
handlePageInfoChange.call(this, ...params); handlePageInfoChange.call(this, ...params);
}; };
// onAfterEditForm = (props, moduleId, key, value, oldValue) => {
// let map = {
// pdf_type: {value: key == 'pdf_type' ? value.value : false, display: key == 'pdf_type' ? value.value ? '是' : '否' : '否'},
// xml_type: {value: key == 'xml_type' ? value.value : false, display: key == 'xml_type' ? value.value ? '是' : '否' : '否'},
// ofd_type: {value: key == 'ofd_type' ? value.value : false, display: key == 'ofd_type' ? value.value ? '是' : '否' : '否'}
// }
// this.props.form.setFormItemsValue('LnvoiceDownloadType', map)
// }
//单选事件 //单选事件
onSelected = (props, moduleId, status, index, isSelect) => {//单选第五个参数为是否选中true/false onSelected = (props, moduleId, status, index, isSelect) => {//单选第五个参数为是否选中true/false
@ -121,6 +132,8 @@ class InvoiceSale extends Component {
}, },
props: { props: {
search: {NCCreateSearch,}, search: {NCCreateSearch,},
form: {createForm,},
modal: {createModal,},
table: {createSimpleTable,}, table: {createSimpleTable,},
}, },
headerBtnEventDistribute, headerBtnEventDistribute,
@ -262,6 +275,99 @@ class InvoiceSale extends Component {
this.props.modal.close('redinfomodal'); this.props.modal.close('redinfomodal');
} }
})} })}
{this.props.modal.createModal('LnvoiceDownloadTypeModal', {
title: '发票类型',
content: (
<div className="area-content">
<div className="nc-bill-form-area">
{createForm('LnvoiceDownloadType', {
onAfterEvent: this.onAfterEditForm,//表单编辑后事件
})}
</div>
</div>
),
size: '100',
beSureBtnClick: () => {
let formData = this.props.table.getCheckedRows(presetVar.tableAreaId);
let formMap = this.props.form.getAllFormValue('LnvoiceDownloadType');
let {pdf_type, xml_type, ofd_type} = formMap.rows[0].values
let invoiceType = pdf_type.value ? '1' : xml_type.value ? '2' : ofd_type.value ? '3' : '';
if (!invoiceType) {
return toast({
color: 'danger',
content: '请选择下载的文件类型'
})
}
for(let i=0;i<formData.length;i++){
// let pdf_type={}, xml_type={}, ofd_type={};
// pdf_type.value=1;
// xml_type.value=1;
// ofd_type.value=1;
// let invoiceType ='';
let pk = formData[i].data.values.pk_invoice; //当前发票pk
let arrInvoiceTypes = [];
if (pdf_type.value) {
arrInvoiceTypes.push('1');
invoiceType = '1';
let params = {pk, invoiceType};
formDownload({
params,
url: '/nccloud/sscivm/ivsale/InvoiceDownloadAction.do',
// url: '/nccloud/sscivm/ivsale/InvoiceIsDownloadAction.do',
enctype: 1
});
}
if (xml_type.value) {
arrInvoiceTypes.push('2');
invoiceType = '2';
let params = {pk, invoiceType};
formDownload({
params,
url: '/nccloud/sscivm/ivsale/InvoiceDownloadAction.do',
// url: '/nccloud/sscivm/ivsale/InvoiceIsDownloadAction.do',
enctype: 1
});
}
if (ofd_type.value) {
arrInvoiceTypes.push('3');
invoiceType = '3';
let params = {pk, invoiceType};
formDownload({
params,
url: '/nccloud/sscivm/ivsale/InvoiceDownloadAction.do',
// url: '/nccloud/sscivm/ivsale/InvoiceIsDownloadAction.do',
enctype: 1
});
}
}
this.props.modal.close('LnvoiceDownloadTypeModal')
// let params = {pk, invoiceType};
// requestApi.download({
// data: params,
// success: (res) => {
// formDownload({
// params,
// url: '/nccloud/sscivm/ivsale/InvoiceDownloadAction.do',
// enctype: 1
// });
// }
// })
// formDownload({
// params,
// url: '/nccloud/sscivm/ivsale/InvoiceDownloadAction.do',
// // url: '/nccloud/sscivm/ivsale/InvoiceIsDownloadAction.do',
// enctype: 1
// });
},
cancelBtnClick: () => {
this.props.modal.close('LnvoiceDownloadTypeModal')
},
userControl: true
})}
</BillListStyle.BodyArea> </BillListStyle.BodyArea>
</BillListStyle> </BillListStyle>
); );