This commit is contained in:
ylj20011123 2025-11-21 09:36:50 +08:00
parent 6e7362b75e
commit a1a2fe867f
4 changed files with 142 additions and 9 deletions

View File

@ -128,6 +128,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
{ label: "填写中", value: 1000 }, { label: "填写中", value: 1000 },
{ label: "待审核", value: 2000 }, { label: "待审核", value: 2000 },
{ label: "开票中", value: 9000 }, { label: "开票中", value: 9000 },
{ label: "手动开票", value: 9100 },
{ label: "已开票", value: 9200 }, { label: "已开票", value: 9200 },
{ label: "红冲申请中", value: 9990 }, { label: "红冲申请中", value: 9990 },
{ label: "已红冲", value: 9999 } { label: "已红冲", value: 9999 }
@ -193,7 +194,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
width: 200, width: 300,
fixed: 'left', fixed: 'left',
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
@ -246,7 +247,28 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
<Button danger style={{ marginLeft: "8px" }} type="primary" size="small">退</Button> <Button danger style={{ marginLeft: "8px" }} type="primary" size="small">退</Button>
</Popconfirm> : "" </Popconfirm> : ""
} }
</div> {
record?.BILL_STATE === 2000 ?
<Popconfirm
title="确认手动开票?"
onConfirm={async () => {
await handleSynchroBILLInterface({
...record,
BILL_STATE: 9100
})
// 通知金蝶 手动开票!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
hanleManualInvoicing(record)
actionRef.current?.reload()
}}
onCancel={() => { }}
okText="确认"
cancelText="取消"
>
<Button danger style={{ marginLeft: "8px" }} type="primary" size="small"></Button>
</Popconfirm> : ""
}
</div >
: record?.BILL_TYPE === 2000 && record?.BILL_STATE >= 9200 && record?.BILL_STATE !== 9999 ? : record?.BILL_TYPE === 2000 && record?.BILL_STATE >= 9200 && record?.BILL_STATE !== 9999 ?
<div> <div>
<Popconfirm <Popconfirm
@ -399,7 +421,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
}) })
} }
let obj: any = { let obj: any = {
billNo: record?.BILL_NO ? `HC-${record?.BILL_NO}` : "", // 单据编号 billNo: record?.BILL_NO ? `HC-${record?.BILL_NO}` : "", // 单据编号
@ -427,6 +449,10 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
buyerBankAndAccount: `${record?.BANK_NAME}${record?.BANK_ACCOUNT}`,// 购方银行、账号 buyerBankAndAccount: `${record?.BANK_NAME}${record?.BANK_ACCOUNT}`,// 购方银行、账号
redReason: formData?.redReasonSelect || "", redReason: formData?.redReasonSelect || "",
autoMerge: "0", autoMerge: "0",
showBuyerAddressTel: "Y",// 是否展示购方地址电话标识
showBuyerBank: "Y",// 是否展示购方银行账号标识
showSalerBank: "Y",// 是否展示销方银行账号标识
showSalerAddressTel: "Y",// 是否展示销方地址电话标识
// blueinvoiceNo: '23249322851717775360', // blueinvoiceNo: '23249322851717775360',
blueinvoiceNo: result[0].invoiceNumber, blueinvoiceNo: result[0].invoiceNumber,
// originalIssueTime: record?.originalIssueTime, // originalIssueTime: record?.originalIssueTime,
@ -562,7 +588,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号 buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱 buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱
remark: record?.BILL_DESC, // remark: record?.BILL_DESC,
buyerAddressAndTel: `${record?.MERCHANTS_ADDRESS}${record?.MERCHANTS_TEL}`,// 购方地址、电话 buyerAddressAndTel: `${record?.MERCHANTS_ADDRESS}${record?.MERCHANTS_TEL}`,// 购方地址、电话
buyerBankAndAccount: `${record?.BANK_NAME}${record?.BANK_ACCOUNT}`,// 购方银行、账号 buyerBankAndAccount: `${record?.BANK_NAME}${record?.BANK_ACCOUNT}`,// 购方银行、账号
@ -570,6 +596,11 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
reviewer: "杨尚涛",// 复核人 reviewer: "杨尚涛",// 复核人
drawer: "杨木青",// 开票人 drawer: "杨木青",// 开票人
showBuyerAddressTel: "Y",// 是否展示购方地址电话标识
showBuyerBank: "Y",// 是否展示购方银行账号标识
showSalerBank: "Y",// 是否展示销方银行账号标识
showSalerAddressTel: "Y",// 是否展示销方地址电话标识
// redReason: record?.BILL_DESC, // redReason: record?.BILL_DESC,
// blueinvoiceNo: record?.blueinvoiceNo, // blueinvoiceNo: record?.blueinvoiceNo,
@ -622,6 +653,96 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
message.error({ content: '开票申请失败,请重试', key: 'invoice' }); message.error({ content: '开票申请失败,请重试', key: 'invoice' });
} }
}; };
// 手动开票方法 由于区分一下 是异步调用 不要任何提示内容的 所以就加个方法
const hanleManualInvoicing = async (record: any) => {
// 拿个票据明细
const billDetail = await handleGetBILLDETAILList({
SearchParameter: {
BILL_ID: record?.BILL_ID
},
PageIndex: 1,
PageSize: 999999,
SortStr: "BILLDETAIL_ID"
})
console.log('billDetailbillDetail', billDetail);
let billDetailReq: any = []
if (billDetail && billDetail.length > 0) {
billDetail.forEach((item: any) => {
billDetailReq.push({
amount: item.INVOICE_AMOUNT, // 明细金额
detailId: item.BILLDETAIL_ID, // 业务系统明细id
goodsName: item.ITEM_NAME,// 商品名称
lineProperty: 2, // 行性质
price: item.INVOICE_PRICE,// 单价
quantity: item.INVOICE_COUNT,// 数量
revenueCode: item.TABLE_NAME,// 税收分类编码
taxRate: (item.DUTY_PARAGRAPH / 100).toFixed(2),// 税率
units: item.ITEM_UNIT,// 计量单位
})
})
}
let obj: any = {
billNo: record?.BILL_NO, // 单据编号
billDate: moment(record?.BILL_DATE).format('YYYY-MM-DD'), // 单据日期
totalAmount: record?.INVOICE_TAXAMOUNT, // 单据金额
includeTaxFlag: record?.ACCOUNTED_TYPE,// 判断是否含税
autoInvoice: "0",// 自动开票标记
invoiceType: record?.BILL_TYPE == 1000 ? '08xdp' : record?.BILL_TYPE == 2000 ? '10xdp' : '', //发票种类
buyerTaxpayerId: cleanString(record?.TAXPAYER_IDENTIFYCODE),// 购方税号
buyerName: record?.MERCHANTS_NAME, // 购买方名称
buyerProperty: "0", // 购买方性质 0-企业1-个人2-非企业单位
// sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
sellerName: publicParams.sellerName, // 销方名称 写死
sellerBankAndAccount: "", // 销方银行和账号 写死
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱
buyerAddressAndTel: `${record?.MERCHANTS_ADDRESS}${record?.MERCHANTS_TEL}`,// 购方地址、电话
buyerBankAndAccount: `${record?.BANK_NAME}${record?.BANK_ACCOUNT}`,// 购方银行、账号
payee: "周洁萍", // 收款人
reviewer: "杨尚涛",// 复核人
drawer: "杨木青",// 开票人
showBuyerAddressTel: "Y",// 是否展示购方地址电话标识
showBuyerBank: "Y",// 是否展示购方银行账号标识
showSalerBank: "Y",// 是否展示销方银行账号标识
showSalerAddressTel: "Y",// 是否展示销方地址电话标识
billDetail: billDetailReq
}
// 构造原始数据
const originalData = [obj]; // 将record作为data数组的一项
// 将data字段进行base64加密
const dataString = JSON.stringify(originalData);
const encryptedData = btoa(unescape(encodeURIComponent(dataString))); // base64编码支持中文
// 构造开票请求数据
const invoiceData = {
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
interfaceCode: "BILL.PUSH", // 接口业务编码
requestId: Date.now().toString(), // 时间戳作为请求ID
data: encryptedData // 加密后的data字符串
};
let newreq: any = {
name: "",
value: encryptAES(JSON.stringify({
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken}`,
Access_token: accessToken,
data: JSON.stringify(invoiceData)
}))
}
let response = await handleGetForwardJDPJInterface(newreq)
console.log('responseresponseresponseresponse', response);
}
// 退回开票 // 退回开票
const handleReturnInvoice = async (record: any) => { const handleReturnInvoice = async (record: any) => {
let req: any = { let req: any = {

View File

@ -125,6 +125,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
{ label: "填写中", value: 1000 }, { label: "填写中", value: 1000 },
{ label: "待审核", value: 2000 }, { label: "待审核", value: 2000 },
{ label: "开票中", value: 9000 }, { label: "开票中", value: 9000 },
{ label: "手动开票", value: 9100 },
{ label: "已开票", value: 9200 }, { label: "已开票", value: 9200 },
{ label: "红冲申请中", value: 9990 }, { label: "红冲申请中", value: 9990 },
{ label: "已红冲", value: 9999 } { label: "已红冲", value: 9999 }

View File

@ -205,7 +205,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
width: 200, width: 300,
fixed: 'left', fixed: 'left',
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
@ -386,7 +386,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
width: 200, width: 300,
fixed: 'left', fixed: 'left',
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
@ -560,6 +560,11 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号 buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱 buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱
showBuyerAddressTel: "Y",// 是否展示购方地址电话标识
showBuyerBank: "Y",// 是否展示购方银行账号标识
showSalerBank: "Y",// 是否展示销方银行账号标识
showSalerAddressTel: "Y",// 是否展示销方地址电话标识
redReason: formData?.redReasonSelect || "", redReason: formData?.redReasonSelect || "",
autoMerge: "0", autoMerge: "0",
// blueinvoiceNo: '23249322851717775360', // blueinvoiceNo: '23249322851717775360',
@ -568,7 +573,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
// blueInvoiceType: record?.blueInvoiceType, // blueInvoiceType: record?.blueInvoiceType,
blueinvoiceCode: "", blueinvoiceCode: "",
billDetail: billDetailReq, billDetail: billDetailReq,
remark: newDesc || "", remark: record?.BILL_DESC,
} }
// 构造原始数据 // 构造原始数据
@ -702,6 +707,12 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号 buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱 buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱
showBuyerAddressTel: "Y",// 是否展示购方地址电话标识
showBuyerBank: "Y",// 是否展示购方银行账号标识
showSalerBank: "Y",// 是否展示销方银行账号标识
showSalerAddressTel: "Y",// 是否展示销方地址电话标识
// redReason: record?.BILL_DESC, // redReason: record?.BILL_DESC,
// blueinvoiceNo: record?.blueinvoiceNo, // blueinvoiceNo: record?.blueinvoiceNo,

View File

@ -7,8 +7,8 @@ import CryptoJS from "crypto-js";
const { UMI_APP_BASEURL } = process.env; const { UMI_APP_BASEURL } = process.env;
// const instance = axios.create({ baseURL: UMI_APP_BASEURL }); // const instance = axios.create({ baseURL: UMI_APP_BASEURL });
const instance = axios.create({ baseURL: 'https://api.eshangtech.com/EShangApiMain' }); // const instance = axios.create({ baseURL: 'https://api.eshangtech.com/EShangApiMain' });
// const instance = axios.create({ baseURL: 'https://samember.yciccloud.com:8999/EShangApiMain' }); const instance = axios.create({ baseURL: 'https://samember.yciccloud.com:8999/EShangApiMain' });
// const instance = axios.create({ baseURL: '/auth' }); // const instance = axios.create({ baseURL: '/auth' });