This commit is contained in:
ylj20011123 2025-10-17 18:25:04 +08:00
parent 4c04dff48e
commit 87ec1f9508
10 changed files with 2576 additions and 83 deletions

View File

@ -12,18 +12,19 @@ const proxy = {
proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
}
},
'/kaipiao': {
target: 'https://cosmic-sandbox.piaozone.com/xhcamzchwbgonerr/',
changeOrigin: true,
secure: false,
pathRewrite: { '^/kaipiao': '' },
onProxyRes: function (proxyRes) {
proxyRes.headers['Access-Control-Allow-Origin'] = '*';
proxyRes.headers['Access-Control-Allow-Methods'] = 'GET,PUT,POST,DELETE,OPTIONS';
proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization, X-Requested-With';
proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
}
}
// '/kaipiao': {
// // target: 'https://cosmic-sandbox.piaozone.com/xhcamzchwbgonerr/',
// target: 'https://cosmic.piaozone.com/ynjtjtjykf/',
// changeOrigin: true,
// secure: false,
// pathRewrite: { '^/kaipiao': '' },
// onProxyRes: function (proxyRes) {
// proxyRes.headers['Access-Control-Allow-Origin'] = '*';
// proxyRes.headers['Access-Control-Allow-Methods'] = 'GET,PUT,POST,DELETE,OPTIONS';
// proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization, X-Requested-With';
// proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
// }
// }
}
export default proxy;

View File

@ -18,6 +18,16 @@ export default [
name: '开票管理',
component: "@/pages/DigitalElectronics/index",
},
{
path: '/redReversal/index',
name: '红冲管理',
component: "@/pages/redReversal/index",
},
{
path: '/InvoiceInquiry/index',
name: '开票查询',
component: "@/pages/InvoiceInquiry/index",
},
{
path: '/InvoiceSearch/index',
name: '开票查询',

View File

@ -233,6 +233,18 @@ const UserModel: UserModelType = {
name: '开票管理',
component: "@/pages/DigitalElectronics/index",
},
{
path: '/redReversal/index',
redirect: '',
name: '红冲管理',
component: "@/pages/redReversal/index",
},
{
path: '/InvoiceInquiry/index',
redirect: '',
name: '开票查询',
component: "@/pages/InvoiceInquiry/index",
},
{
path: '/InvoiceSearch/index',
redirect: '',
@ -310,6 +322,8 @@ const UserModel: UserModelType = {
'/cloudMenu/test/index',
"/Invoicing/index",
"/DigitalElectronics/index",
"/InvoiceInquiry/index",
"/redReversal/index",
"/InvoiceSearch/index"
// '/examine/index',
// '/examine/modal',

View File

@ -4,7 +4,7 @@ import { FormInstance, Button, message, Tag, Popconfirm, Modal } from "antd";
import { useEffect, useRef, useState } from "react";
import { connect } from "umi";
import { Datum } from "@/types/invoice";
import { handleGetAppToken, handleGetBILLDETAILList, handleGetBILLList, handleGetInvoiceSearch, handleGetKaiPiao, handleGetPassportInfoById, handleGetSDToken, handleSynchroAPPLYAPPROVE, handleSynchroBILLInterface } from "./service";
import { handleGetAppToken, handleGetBILLDETAILList, handleGetBILLList, handleGetForwardJDPJInterface, handleGetInvoiceSearch, handleGetKaiPiao, handleGetPassportInfoById, handleGetSDToken, handleSynchroAPPLYAPPROVE, handleSynchroBILLInterface } from "./service";
import moment from "moment";
import { encryptAES } from "@/utils/handleAes";
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
@ -15,6 +15,30 @@ interface ConnectState {
};
}
const publicParams: any = {
// // 沙盒环境
// baseUrl: 'https://cosmic-sandbox.piaozone.com/xhcamzchwbgonerr/',
// user: '18620126214',
// appId: 'FPY001',
// appSecret: 'FPY001fpy@2023***',
// accountId: '2280459335882518528',
// tenantId: 'xhcamzchwbgonerr',
// businessSystemCode: 'BUSINESS_YCIC',
// sellerTaxpayerId: '91530112MA7MQ2JR9U',
// sellerName: '云南交投集团经营开发有限公司彩云驿商业管理分公司',
// 正式环境
baseUrl: 'https://cosmic.piaozone.com/ynjtjtjykf',
user: '18788526867',
appId: 'FPY001',
appSecret: 'FPY001fpy@2023***',
accountId: '2311767813217320960',
tenantId: 'ynjtjtjykf',
businessSystemCode: 'BUSINESS_YCIC',
sellerTaxpayerId: '91530000336622209K',
sellerName: '云南交投集团经营开发有限公司',
}
const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
@ -29,6 +53,8 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
const [showModal, setShowModal] = useState<boolean>(false)
// 当前选择的票据信息
const [currentRow, setCurrentRow] = useState<any>()
// 红冲悬浮框点击的加载效果
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
const columns: any = [
{
title: '服务区名称',
@ -62,6 +88,19 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
ellipsis: true,
hideInSearch: true,
},
{
title: '票据类型',
dataIndex: 'BILL_TYPE',
width: 100,
align: 'center',
hideInSearch: true,
valueType: "select",
valueEnum: {
1000: { text: '专票', status: 'warning' },
2000: { text: '普票', status: 'default' },
3000: { text: '红票', status: 'error' },
}
},
{
title: '含税标识',
dataIndex: 'ACCOUNTED_TYPE',
@ -123,7 +162,14 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
hideInSearch: true,
valueType: 'select',
fieldProps: {
options: [{ label: "填写中", value: 1000 }, { label: "待审核", value: 2000 }, { label: "开票中", value: 9000 }, { label: "已开票", value: 9200 }]
options: [
{ label: "填写中", value: 1000 },
{ label: "待审核", value: 2000 },
{ label: "开票中", value: 9000 },
{ label: "已开票", value: 9200 },
{ label: "红冲申请中", value: 9990 },
{ label: "已红冲", value: 9999 }
]
}
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
},
@ -135,10 +181,10 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
align: 'center',
hideInSearch: true,
render: (text: any, record: Datum) => (
record?.BILL_STATE === 2000 ?
record?.BILL_STATE === 2000 || record?.BILL_STATE === 9000 ?
<div>
<Popconfirm
title="确认同意开票?"
title={record?.BILL_STATE === 9000 ? '确认重新开票?' : '确认同意开票?'}
onConfirm={
() => {
handleInvoice(record)
@ -149,9 +195,10 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
okText="确认"
cancelText="取消"
>
<Button type="primary" size="small"></Button >
<Button type="primary" size="small">{record?.BILL_STATE === 9000 ? '重新开票' : '同意开票'}</Button>
</Popconfirm>
{
record?.BILL_STATE === 2000 ?
<Popconfirm
title="确认退回开票?"
onConfirm={
@ -166,9 +213,10 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
cancelText="取消"
>
<Button danger style={{ marginLeft: "8px" }} type="primary" size="small">退</Button>
</Popconfirm>
</Popconfirm> : ""
}
</div>
: record?.BILL_STATE === 9200 ?
: record?.BILL_TYPE === 2000 && record?.BILL_STATE >= 9200 && record?.BILL_STATE !== 9999 ?
<div>
<Popconfirm
title="确认红冲发票?"
@ -188,15 +236,23 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
},
]
// 红冲发票
const handleRedGoBill = async (record?: any) => {
// 这个方法 比较复杂 我做一下注释
// 先拿到表单数据 里面有 红冲类型和 红冲原因
// 红冲原因是给自己的同步接口 红冲类型 是给金飘云那边的
// 然后再去查询一下 这张票在金飘云那边的数据 拿到这张票对应的蓝票id
// 因为我们自己的票据信息里面 没有票据明细的内容 所以要调用自己的票据明细拿到详细的信息之后 就可以拿到这张票子里面的商品 可以传给金飘云
// 红冲 就是 重新开一张票 然后开这张票的时候带上之前需要红冲那张票的蓝票id 即可
// 红冲申请发出去之后 按照红冲的编码 用我们自己的接口 开一张新的票据记录 其他数据保持一致 编码为红冲编码 状态为 9000 开票中
// 然后还有原的票同步 状态变为 9990 红冲中
// 最后同步开票流程变为 红冲中
// 拿到表单数据
const formData: any = modalFormRef.current?.getFieldsValue()
console.log('formData', formData);
console.log('recordrecord', record);
// 拿个票据明细
const billDetail = await handleGetBILLDETAILList({
SearchParameter: {
@ -207,12 +263,11 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
SortStr: "BILLDETAIL_ID"
})
console.log('billDetailbillDetailbillDetailbillDetail', billDetail);
// 调用金票云那里的列表接口
// 构造查询数据
const queryData = {
sellerTaxpayerId: "91530112MA7MQ2JR9U",
// sellerTaxpayerId: "91530112MA7MQ2JR9U",
sellerTaxpayerId: publicParams.sellerTaxpayerId,
serialNo: record?.BILL_NO,
};
@ -227,12 +282,16 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
requestId: Date.now().toString(),
data: encryptedDataOld
};
console.log('最终请求参数:', requestParams);
// 调用查询接口 (这里需要传入正确的code参数)
const responseOld = await handleGetInvoiceSearch(requestParams, accessToken);
console.log('responseresponseresponseresponse', responseOld);
let responseOld = await handleGetForwardJDPJInterface({
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken}`,
Access_token: accessToken,
data: JSON.stringify(requestParams)
})
responseOld = JSON.parse(responseOld as any)
// console.log('最终请求参数:', requestParams);
// // 调用查询接口 (这里需要传入正确的code参数)
// const responseOld = await handleGetInvoiceSearch(requestParams, accessToken);
// console.log('responseresponseresponseresponse', responseOld);
let result: any = []
if (responseOld && responseOld.success) {
let res = JSON.parse(decodeURIComponent(escape(atob(responseOld.data))))
@ -242,9 +301,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
}
console.log('最终请求结果:', result);
let billDetailReq: any = []
if (billDetail && billDetail.length > 0) {
billDetail.forEach((item: any) => {
@ -274,8 +330,10 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
buyerTaxpayerId: record?.TAXPAYER_IDENTIFYCODE,// 购方税号
buyerName: record?.MERCHANTS_NAME, // 购买方名称
buyerProperty: "0", // 购买方性质 0-企业1-个人2-非企业单位
sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
// sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
sellerName: publicParams.sellerName, // 销方名称 写死
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
drawer: record?.BILL_PERSON,// 开票人
@ -285,14 +343,13 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
redReason: formData?.redReasonSelect || "",
autoMerge: "0",
// blueinvoiceNo: '23249322851717775360',
blueinvoiceNo: result[0].originalInvoiceNumber,
blueinvoiceNo: result[0].invoiceNumber,
// originalIssueTime: record?.originalIssueTime,
// blueInvoiceType: record?.blueInvoiceType,
blueinvoiceCode: "",
billDetail: billDetailReq
}
// 构造原始数据
const originalData = [obj]; // 将record作为data数组的一项
// 将data字段进行base64加密
@ -316,16 +373,53 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
console.log('Base64加密后:', encryptedData);
console.log('最终请求数据:', invoiceData);
console.log('访问令牌:', accessToken);
const response = await handleGetKaiPiao(invoiceData, accessToken);
// const response = await handleGetKaiPiao(invoiceData, accessToken);
let response = await handleGetForwardJDPJInterface({
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken}`,
Access_token: accessToken,
data: JSON.stringify(invoiceData)
})
response = JSON.parse(response as any)
console.log('开票响应:', response);
setShowModal(false)
setCurrentRow(null)
if (response.success) {
message.success('红冲成功!')
// 同步流程的 加上红冲中的状态
await handleSynchroAPPLYAPPROVEFun(3, record)
let redReasonObj: any = {
"1": "销货退回",
"2": "开票有误",
"3": "开票中止",
"4": "销售折让",
}
// 同步旧票子 变为 红冲申请中
await handleSynchroBILL(2, {
...record,
billDetail: billDetail
})
// 针对这个红冲 开一张新票子 编码为新的红冲编码 状态为9000 开票中 且票据类型变为 3000 红票 BILL_TYPE
await handleUpdateOldBill({
...record,
billDetail: billDetail,
BILL_TYPE: 3000,
BILL_STATE: 9000,
BILL_NO: `HC-${record?.BILL_NO}`,
BILL_DATE: moment().format('YYYY-MM-DD'),
BILL_DESC: formData?.redReasonSelect ? redReasonObj[formData?.redReasonSelect] : "",
BILL_ID: "",
BILL_TAXAMOUNT: -record?.BILL_TAXAMOUNT,
BILL_AMOUNT: -record?.BILL_AMOUNT,
INVOICE_TAXAMOUNT: -record?.INVOICE_TAXAMOUNT,
INVOICE_AMOUNT: -record?.INVOICE_AMOUNT,
})
actionRef.current?.reload()
} else {
message.error(response.message)
}
setConfirmLoading(false)
}
// 开票处理函数
const handleInvoice = async (record: Datum) => {
@ -382,14 +476,17 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
buyerName: record?.MERCHANTS_NAME, // 购买方名称
buyerProperty: "0", // 购买方性质 0-企业1-个人2-非企业单位
sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
// sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
sellerName: publicParams.sellerName, // 销方名称 写死
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
drawer: record?.BILL_PERSON,// 开票人
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
buyerRecipientMail: record?.RECEIVE_EMAIL,// 购方收件邮箱
remark: record?.BILL_DESC,
// redReason: record?.BILL_DESC,
@ -425,7 +522,15 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
console.log('最终请求数据:', invoiceData);
console.log('访问令牌:', accessToken);
const response = await handleGetKaiPiao(invoiceData, accessToken);
// const response = await handleGetKaiPiao(invoiceData, accessToken);
let response = await handleGetForwardJDPJInterface({
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken}`,
Access_token: accessToken,
data: JSON.stringify(invoiceData)
})
response = JSON.parse(response as any)
console.log('开票响应:', response);
if (response && response.success) {
@ -435,7 +540,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
message.success({ content: `单据 ${record.BILL_NO} 开票申请已提交成功`, key: 'invoice' });
actionRef.current?.reload()
// 他们的调用成功了 再调用我们自己的 同步票据信息表 的接口
handleSynchroBILL(record)
handleSynchroBILL(1, record)
} else {
@ -464,30 +569,119 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
}
// 在这个页面获取token
const handleGetTokenInPage = async () => {
// 老
// let req: any = {
// appId: publicParams.appId,
// appSecret: publicParams.appSecret,
// accountId: publicParams.accountId,
// tenantid: publicParams.tenantId,
// language: ""
// // appId: "FPY001",
// // appSecret: "FPY001fpy@2023***",
// // accountId: "2280459335882518528",
// // tenantid: "xhcamzchwbgonerr",
// // language: ""
// }
// const token = await handleGetAppToken(req)
// 新
let req: any = {
appId: "FPY001",
appSecret: "FPY001fpy@2023***",
accountId: "2280459335882518528",
tenantid: "xhcamzchwbgonerr",
ReqUrl: "https://cosmic.piaozone.com/ynjtjtjykf/api/getAppToken.do",
Access_token: "",
data: JSON.stringify({
appId: publicParams.appId,
appSecret: publicParams.appSecret,
accountId: publicParams.accountId,
tenantid: publicParams.tenantId,
language: ""
})
}
const token = await handleGetAppToken(req)
let token = await handleGetForwardJDPJInterface(req)
let tokenData = token ? JSON.parse(token as any) : ""
console.log('tokenDatatokenDatatokenDatatokenDatadasdsa', tokenData);
let appToken: any = token.data.app_token
let appToken: any = tokenData.data.app_token
// 老
// let tokenReq: any = {
// // user: "18620126214",
// user: publicParams.user,
// apptoken: appToken,
// tenantid: publicParams.tenantId,
// accountId: publicParams.accountId,
// usertype: ""
// // apptoken: appToken,
// // tenantid: "xhcamzchwbgonerr",
// // accountId: "2280459335882518528",
// // usertype: ""
// }
// const accessToken: any = await handleGetSDToken(tokenReq)
// 新
let tokenReq: any = {
user: "18620126214",
ReqUrl: "https://cosmic.piaozone.com/ynjtjtjykf/api/login.do",
Access_token: "",
data: JSON.stringify({
user: publicParams.user,
apptoken: appToken,
tenantid: "xhcamzchwbgonerr",
accountId: "2280459335882518528",
tenantid: publicParams.tenantId,
accountId: publicParams.accountId,
usertype: ""
})
}
const accessToken: any = await handleGetSDToken(tokenReq)
let accessTokenData = await handleGetForwardJDPJInterface(tokenReq)
let accessToken = JSON.parse(accessTokenData as any)
setAppToken(appToken)
setAccessToken(accessToken.data.access_token)
// const queryData = {
// // sellerTaxpayerId: "91530112MA7MQ2JR9U",
// sellerTaxpayerId: publicParams.sellerTaxpayerId,
// serialNo: '202509-401206-0014',
// };
// console.log('queryDataqueryData', queryData);
// // 将data字段进行base64加密
// const dataStringOld = JSON.stringify(queryData);
// const encryptedDataOld = btoa(unescape(encodeURIComponent(dataStringOld)));
// // 构造最终请求参数
// const requestParams = {
// businessSystemCode: "BUSINESS_YCIC",
// interfaceCode: "BILL.INVOICE.QUERY",
// requestId: Date.now().toString(),
// data: encryptedDataOld
// };
// console.log('最终请求参数:', requestParams);
// let reqResult: any = {
// ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
// Access_token: accessToken.data.access_token,
// data: JSON.stringify(requestParams)
// }
// let responseOld = await handleGetForwardJDPJInterface(reqResult)
// console.log('responseOldresponseOldresponseOld', responseOld);
// responseOld = JSON.parse(responseOld as any)
// 老
// // 调用查询接口 (这里需要传入正确的code参数)
// const responseOld = await handleGetInvoiceSearch(requestParams, accessToken.data.access_token);
// console.log('responseresponseresponseresponse', responseOld);
// let result: any = []
// if (responseOld && responseOld.success) {
// let res = JSON.parse(decodeURIComponent(escape(atob(responseOld.data))))
// result = res[0].invoiceList
// } else {
// return
// }
}
const handleSynchroBILL = async (obj: any) => {
const handleSynchroBILL = async (type: number, obj: any) => {
// type 1 开票的同步状态 即 9000 2 开票的红冲状态 即 9990
// 发票明细列表
let detailList: any = []
if (obj?.billDetail && obj?.billDetail.length > 0) {
@ -542,7 +736,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
DOWNLOAD_URL: obj?.DOWNLOAD_URL,// 下载地址
RECEIVE_PHONENUMBER: obj?.RECEIVE_PHONENUMBER,// 收票方手机
RECEIVE_EMAIL: obj?.RECEIVE_EMAIL,// 收票方邮箱
BILL_STATE: 9000,// 票据状态
BILL_STATE: type === 1 ? 9000 : type === 2 ? '9990' : '',// 票据状态
DetailList: obj?.DetailList,// 发票明细列表
}
const data = await handleSynchroBILLInterface(req)
@ -560,16 +754,16 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
}
// 同步操作的流程信息 审核通过 和 审核驳回 都要去调用一下 同步流程的方法
const handleSynchroAPPLYAPPROVEFun = async (type: number, obj: any) => {
// type 1 审核通过 2 拒绝审核
// type 1 审核通过 2 拒绝审核 3 红冲中
// obj 当前票据信息
const req: any = {
ACTINST_NAME: type === 1 ? '审核开票申请' : type === 2 ? '驳回开票申请' : "",// 状态名称 审核开票申请 || 驳回开票申请
ACTINST_NAME: type === 1 ? '审核开票申请' : type === 2 ? '驳回开票申请' : type === 3 ? "红冲发票申请" : "",// 状态名称 审核开票申请 || 驳回开票申请
APPROVE_TYPE: obj?.BILL_ID,// 票的id
APPROVE_INFO: type === 1 ? '同意开票' : type === 2 ? '驳回开票' : "",// 同意开票 || 驳回开票
APPROVE_INFO: type === 1 ? '同意开票' : type === 2 ? '驳回开票' : type === 3 ? "红冲发票" : "",// 同意开票 || 驳回开票
STAFF_ID: currentUser?.ID,
STAFF_NAME: currentUser?.Name,
APPROVE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'),
APPROVE_STATE: type === 1 ? 9000 : type === 2 ? 1000 : "",
APPROVE_STATE: type === 1 ? 9000 : type === 2 ? 1000 : type === 3 ? '9990' : "",
APPROVE_DESC: "T_BILL"
}
let reqData: any = {
@ -581,6 +775,15 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
console.log('datadatadata312321', data);
}
// 红冲的时候 同步原先的票子 传入红冲原因
const handleUpdateOldBill = async (record: any) => {
let req: any = {
...record,
}
const data = await handleSynchroBILLInterface(req)
console.log('新票子', data);
}
useEffect(async () => {
// 先调用token 后续这个页面用得到
await handleGetTokenInPage()
@ -607,12 +810,14 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
const search = window.location.search;
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
console.log('addressParamsaddressParamsaddressParams', addressParams);
const userInfo = await handleGetUserInfo(addressParams.id)
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
// 获取票据信息表列表
const req: any = {
SearchParameter: {
SERVERPART_IDS: userInfo?.ServerpartIds,
BILL_STATES: "2000,9000",
BILL_TYPES: ""
},
PageIndex: 1,
PageSize: 999999
@ -885,12 +1090,12 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
}}
/>
{/* 用来输入红冲原因的 */}
<Modal
title={"红冲原因"}
open={showModal}
destroyOnClose
confirmLoading={confirmLoading}
onCancel={() => {
setShowModal(false)
setCurrentRow(null)
@ -907,6 +1112,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
formRef={modalFormRef}
submitter={false}
onFinish={() => {
setConfirmLoading(true)
handleRedGoBill(currentRow)
}}
>
@ -928,7 +1134,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
]
}}
/>
<ProFormTextArea
{/* <ProFormTextArea
label={"红冲原因"}
name={"redReason"}
rules={[
@ -937,7 +1143,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
message: '请输入红冲原因'
}
]}
/>
/> */}
</ProForm>
</Modal>
</div>

View File

@ -108,3 +108,18 @@ export async function handleGetBILLDETAILList(params: any) {
return data.Result_Data.List
}
// 包一层的中转接口 用来解决金飘云的跨域问题
export async function handleGetForwardJDPJInterface(params: any) {
const data = await requestKaiPiao(`/Invoice/ForwardJDPJInterface`, {
method: 'POST',
data: params
})
if (data.Result_Code !== 100) {
return data
}
return data
}

File diff suppressed because it is too large Load Diff

View File

@ -264,7 +264,7 @@ const InvoiceSearch: React.FC = () => {
buyerRecipientMail: "",
autoMerge: "0",
blueinvoiceCode: "", // 红冲时 blueinvoiceCode 不传的
blueinvoiceNo: "23249322851717775360",
blueinvoiceNo: "22951444153138083840",
redReason: "2",
billDetail: [
{

View File

@ -2,6 +2,8 @@ const authority: PageAuthority = {
'/test/index': ['/test/index'],
'/Invoicing/index': ['/Invoicing/index'],
'/DigitalElectronics/index': ['/DigitalElectronics/index'],
'/InvoiceInquiry/index': ['/InvoiceInquiry/index'],
'/redReversal/index': ['/redReversal/index'],
'/InvoiceSearch/index': ['/InvoiceSearch/index'],
};

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ const { UMI_APP_BASEURL } = process.env;
// const instance = axios.create({ baseURL: 'https://cosmic-sandbox.piaozone.com/jdpjykjyxgs' });
// 改为使用代理路径
const instance = axios.create({ baseURL: '/kaipiao' });
const instance = axios.create({ baseURL: 'http://api.eshangtech.com/EShangApiMain' });