update
This commit is contained in:
parent
385c285601
commit
1a24badd8b
@ -58,6 +58,11 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||
// 显示详情抽屉
|
||||
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
BANK_NAME: { show: false },
|
||||
BANK_ACCOUNT: { show: false },
|
||||
});
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '服务区名称',
|
||||
@ -90,14 +95,14 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
}}>{record?.BILL_NO}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '流水号',
|
||||
dataIndex: 'SERIAL_NO',
|
||||
width: 180,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
// {
|
||||
// title: '流水号',
|
||||
// dataIndex: 'SERIAL_NO',
|
||||
// width: 180,
|
||||
// align: 'center',
|
||||
// ellipsis: true,
|
||||
// hideInSearch: true,
|
||||
// },
|
||||
{
|
||||
title: '票据类型',
|
||||
dataIndex: 'BILL_TYPE',
|
||||
@ -111,6 +116,25 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
3000: { text: '红票', status: 'error' },
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
{
|
||||
title: '含税标识',
|
||||
dataIndex: 'ACCOUNTED_TYPE',
|
||||
@ -133,7 +157,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票人',
|
||||
title: '开票申请人',
|
||||
dataIndex: 'BILL_PERSON',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
@ -141,12 +165,13 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票日期',
|
||||
title: '申请时间',
|
||||
dataIndex: 'BILL_DATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '开户银行',
|
||||
@ -164,30 +189,12 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
fixed: 'left',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (text: any, record: Datum) => (
|
||||
@ -196,10 +203,24 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
<Popconfirm
|
||||
title={record?.BILL_STATE === 9000 ? '确认重新开票?' : '确认同意开票?'}
|
||||
onConfirm={
|
||||
() => {
|
||||
async () => {
|
||||
let isOk: boolean = true
|
||||
// 如果是重新开票 那么要先撤回上一张的票据
|
||||
if (record?.BILL_STATE === 9000) {
|
||||
let res = await handleRevokeBill(record)
|
||||
if (res.success) {
|
||||
|
||||
} else {
|
||||
isOk = false
|
||||
message.error(res.desc)
|
||||
}
|
||||
}
|
||||
if (isOk) {
|
||||
handleInvoice(record)
|
||||
handleSynchroAPPLYAPPROVEFun(1, record)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
onCancel={() => { }}
|
||||
okText="确认"
|
||||
@ -246,6 +267,51 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
},
|
||||
]
|
||||
|
||||
// 撤回发票
|
||||
const handleRevokeBill = async (detail: any) => {
|
||||
console.log('detaildetaildetaildetail', detail);
|
||||
|
||||
let obj: any = {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId,//销方税号
|
||||
orgCode: "",// 组织编号
|
||||
serialNos: detail?.BILL_NO,//单据编号
|
||||
}
|
||||
// 将data字段进行base64加密
|
||||
const dataStringOld = JSON.stringify(obj);
|
||||
const encryptedDataOld = btoa(unescape(encodeURIComponent(dataStringOld)));
|
||||
|
||||
const requestParams = {
|
||||
businessSystemCode: "BUSINESS_YCIC",
|
||||
interfaceCode: "BILL.WITHDRAW",
|
||||
requestId: Date.now().toString(),
|
||||
data: encryptedDataOld
|
||||
};
|
||||
|
||||
let newTokenReq2: 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(requestParams)
|
||||
}))
|
||||
}
|
||||
|
||||
let responseOld = await handleGetForwardJDPJInterface(newTokenReq2)
|
||||
responseOld = JSON.parse(responseOld as any)
|
||||
console.log('responseOldresponseOld', responseOld);
|
||||
|
||||
if (responseOld && (responseOld.success || responseOld.errorCode == 10905)) {
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
desc: responseOld.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 红冲发票
|
||||
const handleRedGoBill = async (record?: any) => {
|
||||
// 这个方法 比较复杂 我做一下注释
|
||||
@ -260,8 +326,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
// 拿到表单数据
|
||||
const formData: any = modalFormRef.current?.getFieldsValue()
|
||||
console.log('formData', formData);
|
||||
console.log('recordrecord', record);
|
||||
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
@ -304,10 +368,8 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
let responseOld = await handleGetForwardJDPJInterface(newreq2)
|
||||
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))))
|
||||
@ -316,7 +378,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('最终请求结果:', result);
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
billDetail.forEach((item: any) => {
|
||||
@ -350,7 +411,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
|
||||
@ -378,17 +439,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
|
||||
let newreq: any = {
|
||||
@ -402,7 +453,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
let response = await handleGetForwardJDPJInterface(newreq)
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
setShowModal(false)
|
||||
setCurrentRow(null)
|
||||
@ -453,7 +503,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('recordrecord', record);
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
SearchParameter: {
|
||||
@ -464,8 +513,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
SortStr: "BILLDETAIL_ID"
|
||||
})
|
||||
|
||||
console.log('billDetailbillDetailbillDetailbillDetail', billDetail);
|
||||
|
||||
console.log('billDetailbillDetail', billDetail);
|
||||
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
@ -501,7 +549,7 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
@ -518,7 +566,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
billDetail: billDetailReq
|
||||
}
|
||||
|
||||
console.log('objobj', obj);
|
||||
// 构造原始数据
|
||||
const originalData = [obj]; // 将record作为data数组的一项
|
||||
// 将data字段进行base64加密
|
||||
@ -531,17 +578,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
let newreq: any = {
|
||||
@ -555,11 +591,9 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
let response = await handleGetForwardJDPJInterface(newreq)
|
||||
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
if (response && response.success) {
|
||||
let res: any = JSON.parse(decodeURIComponent(escape(atob(response.data))));
|
||||
console.log('最终结果:', res);
|
||||
|
||||
message.success({ content: `单据 ${record.BILL_NO} 开票申请已提交成功`, key: 'invoice' });
|
||||
actionRef.current?.reload()
|
||||
@ -583,7 +617,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
BILL_NO: `【退】${record?.BILL_NO}`
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('djasdahslda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success('退回成功!');
|
||||
actionRef.current?.reload()
|
||||
@ -627,9 +660,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let token = await handleGetForwardJDPJInterface(newreq)
|
||||
let tokenData = token ? JSON.parse(token as any) : ""
|
||||
console.log('tokenDatatokenDatatokenDatatokenDatadasdsa', tokenData);
|
||||
|
||||
|
||||
|
||||
let appToken: any = tokenData.data.app_token
|
||||
// 老
|
||||
@ -667,7 +697,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
let accessTokenData = await handleGetForwardJDPJInterface(newTokenReq)
|
||||
|
||||
let accessToken = JSON.parse(accessTokenData as any)
|
||||
console.log('dajksdjaksd', accessToken);
|
||||
|
||||
setAppToken(appToken)
|
||||
setAccessToken(accessToken.data.access_token)
|
||||
@ -678,7 +707,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId,
|
||||
serialNo: '20251020-5300001245-009',
|
||||
};
|
||||
console.log('queryDataqueryData', queryData);
|
||||
|
||||
// 将data字段进行base64加密
|
||||
const dataStringOld = JSON.stringify(queryData);
|
||||
@ -692,7 +720,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
data: encryptedDataOld
|
||||
};
|
||||
|
||||
console.log('最终请求参数:', requestParams);
|
||||
|
||||
let reqResult: any = {
|
||||
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
|
||||
@ -705,13 +732,11 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
value: encryptAES(JSON.stringify(reqResult))
|
||||
}
|
||||
let responseOld = await handleGetForwardJDPJInterface(newreqResult)
|
||||
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))))
|
||||
@ -780,7 +805,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
DetailList: obj?.DetailList,// 发票明细列表
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('data2222', data);
|
||||
}
|
||||
// 获取当前用户信息
|
||||
const handleGetUserInfo = async (id: string) => {
|
||||
@ -788,7 +812,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
UserIdEncrypted: id
|
||||
}
|
||||
const data = await handleGetPassportInfoById(req)
|
||||
console.log('datae2e12e1', data);
|
||||
setCurrentUser(data)
|
||||
return data
|
||||
}
|
||||
@ -812,8 +835,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
|
||||
const data = await handleSynchroAPPLYAPPROVE(reqData)
|
||||
console.log('datadatadata312321', data);
|
||||
|
||||
}
|
||||
// 红冲的时候 同步原先的票子 传入红冲原因
|
||||
const handleUpdateOldBill = async (record: any) => {
|
||||
@ -821,19 +842,16 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
...record,
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('新票子', data);
|
||||
}
|
||||
|
||||
useEffect(async () => {
|
||||
// 先调用token 后续这个页面用得到
|
||||
await handleGetTokenInPage()
|
||||
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ height: 'calc(100vh - 100px)', background: "#fff" }}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
@ -846,13 +864,17 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
return `${record?.billNo}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 350px)' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>待开票列表</span>}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>票据列表</span>}
|
||||
search={{ span: 6, labelWidth: 100 }}
|
||||
request={async (params: any) => {
|
||||
request={async (params: any, sorter: any) => {
|
||||
const search = window.location.search;
|
||||
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
||||
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
||||
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
// 获取票据信息表列表
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
@ -861,16 +883,20 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
||||
BILL_TYPES: ""
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "BILL_ID desc",
|
||||
}
|
||||
|
||||
const data = await handleGetBILLList(req)
|
||||
console.log('dsahdgasyifgdhsvs', data);
|
||||
if (data && data.length > 0) {
|
||||
return { data: data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columnsState={{
|
||||
value: columnsStateMap,
|
||||
onChange: setColumnsStateMap,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 用来输入红冲原因的 */}
|
||||
|
||||
@ -58,6 +58,10 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||
// 显示详情抽屉
|
||||
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
BANK_NAME: { show: false },
|
||||
BANK_ACCOUNT: { show: false },
|
||||
});
|
||||
const columns: any = [
|
||||
{
|
||||
title: '服务区名称',
|
||||
@ -110,6 +114,24 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
3000: { text: '红票', status: 'error' },
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
{
|
||||
title: '含税标识',
|
||||
dataIndex: 'ACCOUNTED_TYPE',
|
||||
@ -132,7 +154,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票人',
|
||||
title: '开票申请人',
|
||||
dataIndex: 'BILL_PERSON',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
@ -140,12 +162,13 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票日期',
|
||||
title: '申请时间',
|
||||
dataIndex: 'BILL_DATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '开户银行',
|
||||
@ -163,24 +186,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
// 红冲发票
|
||||
@ -197,9 +203,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
// 拿到表单数据
|
||||
const formData: any = modalFormRef.current?.getFieldsValue()
|
||||
console.log('formData', formData);
|
||||
console.log('recordrecord', record);
|
||||
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
SearchParameter: {
|
||||
@ -240,10 +243,8 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
let responseOld = await handleGetForwardJDPJInterface(newreq2)
|
||||
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))))
|
||||
@ -252,7 +253,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('最终请求结果:', result);
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
billDetail.forEach((item: any) => {
|
||||
@ -286,7 +286,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
|
||||
@ -314,17 +314,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
let newreq: any = {
|
||||
name: "",
|
||||
@ -336,7 +326,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let response = await handleGetForwardJDPJInterface(newreq)
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
setShowModal(false)
|
||||
setCurrentRow(null)
|
||||
@ -387,7 +376,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('recordrecord', record);
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
SearchParameter: {
|
||||
@ -398,9 +386,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
SortStr: "BILLDETAIL_ID"
|
||||
})
|
||||
|
||||
console.log('billDetailbillDetailbillDetailbillDetail', billDetail);
|
||||
|
||||
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
billDetail.forEach((item: any) => {
|
||||
@ -435,7 +420,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
@ -451,7 +436,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
billDetail: billDetailReq
|
||||
}
|
||||
|
||||
console.log('objobj', obj);
|
||||
// 构造原始数据
|
||||
const originalData = [obj]; // 将record作为data数组的一项
|
||||
// 将data字段进行base64加密
|
||||
@ -464,17 +448,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
|
||||
@ -489,11 +462,9 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
let response = await handleGetForwardJDPJInterface(newreq)
|
||||
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
if (response && response.success) {
|
||||
let res: any = JSON.parse(decodeURIComponent(escape(atob(response.data))));
|
||||
console.log('最终结果:', res);
|
||||
|
||||
message.success({ content: `单据 ${record.BILL_NO} 开票申请已提交成功`, key: 'invoice' });
|
||||
actionRef.current?.reload()
|
||||
@ -517,7 +488,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
BILL_NO: `【退】${record?.BILL_NO}`
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('djasdahslda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success('退回成功!');
|
||||
actionRef.current?.reload()
|
||||
@ -561,7 +531,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let token = await handleGetForwardJDPJInterface(newreq)
|
||||
let tokenData = token ? JSON.parse(token as any) : ""
|
||||
console.log('tokenDatatokenDatatokenDatatokenDatadasdsa', tokenData);
|
||||
|
||||
|
||||
|
||||
@ -609,7 +578,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// sellerTaxpayerId: publicParams.sellerTaxpayerId,
|
||||
// serialNo: '202509-401206-0014',
|
||||
// };
|
||||
// console.log('queryDataqueryData', queryData);
|
||||
|
||||
// // 将data字段进行base64加密
|
||||
// const dataStringOld = JSON.stringify(queryData);
|
||||
@ -623,7 +591,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// data: encryptedDataOld
|
||||
// };
|
||||
|
||||
// console.log('最终请求参数:', requestParams);
|
||||
|
||||
// let reqResult: any = {
|
||||
// ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
|
||||
@ -631,13 +598,11 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// 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))))
|
||||
@ -706,7 +671,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
DetailList: obj?.DetailList,// 发票明细列表
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('data2222', data);
|
||||
}
|
||||
// 获取当前用户信息
|
||||
const handleGetUserInfo = async (id: string) => {
|
||||
@ -714,7 +678,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
UserIdEncrypted: id
|
||||
}
|
||||
const data = await handleGetPassportInfoById(req)
|
||||
console.log('datae2e12e1', data);
|
||||
setCurrentUser(data)
|
||||
return data
|
||||
}
|
||||
@ -738,7 +701,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
|
||||
const data = await handleSynchroAPPLYAPPROVE(reqData)
|
||||
console.log('datadatadata312321', data);
|
||||
|
||||
}
|
||||
// 红冲的时候 同步原先的票子 传入红冲原因
|
||||
@ -747,7 +709,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
...record,
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('新票子', data);
|
||||
}
|
||||
|
||||
useEffect(async () => {
|
||||
@ -757,7 +718,7 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ height: 'calc(100vh - 100px)', background: "#fff" }}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
@ -770,14 +731,17 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
return `${record?.billNo}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 450px)' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>待开票列表</span>}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>票据列表</span>}
|
||||
search={{ span: 6, labelWidth: 100 }}
|
||||
request={async (params: any) => {
|
||||
request={async (params: any, sorter: any) => {
|
||||
const search = window.location.search;
|
||||
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
||||
console.log('addressParamsaddressParamsaddressParams', addressParams);
|
||||
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
||||
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
// 获取票据信息表列表
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
@ -786,11 +750,11 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
BILL_TYPES: params?.BILL_TYPE || "",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "BILL_ID desc",
|
||||
}
|
||||
|
||||
const data = await handleGetBILLList(req)
|
||||
console.log('dsahdgasyifgdhsvs', data);
|
||||
if (data && data.length > 0) {
|
||||
return { data: data, success: true }
|
||||
}
|
||||
@ -805,7 +769,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// language: ""
|
||||
// }
|
||||
// const token = await handleGetAppToken(req)
|
||||
// console.log('tokentokentoken', token);
|
||||
|
||||
// let appToken: any = token.data.app_token
|
||||
|
||||
@ -818,7 +781,6 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// }
|
||||
|
||||
// const accessToken: any = await handleGetSDToken(tokenReq)
|
||||
// console.log('accessTokenaccessTokenaccessToken', accessToken);
|
||||
|
||||
// setAppToken(appToken)
|
||||
// setAccessToken(accessToken.data.access_token)
|
||||
@ -1054,6 +1016,10 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
||||
// total: mockData.length
|
||||
// }
|
||||
}}
|
||||
columnsState={{
|
||||
value: columnsStateMap,
|
||||
onChange: setColumnsStateMap,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 用来输入红冲原因的 */}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form";
|
||||
import { Col, Drawer, FormInstance, Row, Table, Typography, Space, Button, Empty } from "antd";
|
||||
import { connect } from "umi";
|
||||
@ -23,7 +23,11 @@ interface ParamsType {
|
||||
|
||||
const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: ParamsType) => {
|
||||
const formRef = useRef<FormInstance<any>>();
|
||||
|
||||
// 明细表格默认隐藏的内容
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
INVOICE_PRICE: { show: false },
|
||||
INVOICE_DISCOUNT: { show: false },
|
||||
});
|
||||
useEffect(() => {
|
||||
if (formRef.current) {
|
||||
if (parentRow) {
|
||||
@ -41,6 +45,18 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
width: 150,
|
||||
dataIndex: "ITEM_NAME"
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>税务代码</div>,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: "TABLE_NAME"
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品条码</div>,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: "ITEM_ID"
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>规格型号</div>,
|
||||
align: 'center',
|
||||
@ -78,7 +94,10 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
title: <div style={{ textAlign: 'center' }}>税率</div>,
|
||||
align: 'center',
|
||||
width: 80,
|
||||
dataIndex: "DUTY_PARAGRAPH"
|
||||
dataIndex: "DUTY_PARAGRAPH",
|
||||
render: (_, record) => {
|
||||
return record?.DUTY_PARAGRAPH ? `${record?.DUTY_PARAGRAPH}%` : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>税额</div>,
|
||||
@ -92,15 +111,15 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
width: 80,
|
||||
dataIndex: "INVOICE_DISCOUNT"
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>操作时间</div>,
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: "OPERATE_DATE",
|
||||
render: (_, record) => {
|
||||
return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : ""
|
||||
}
|
||||
},
|
||||
// {
|
||||
// title: <div style={{ textAlign: 'center' }}>操作时间</div>,
|
||||
// align: 'center',
|
||||
// width: 150,
|
||||
// dataIndex: "OPERATE_DATE",
|
||||
// render: (_, record) => {
|
||||
// return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : ""
|
||||
// }
|
||||
// },
|
||||
];
|
||||
|
||||
const approveColumns: any = [
|
||||
@ -159,6 +178,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
setShowDetail(false);
|
||||
setParentRow(undefined);
|
||||
}}
|
||||
destroyOnClose
|
||||
>
|
||||
{/* 统一 labelCol 宽度:通过 formProps 设置 */}
|
||||
<ProForm
|
||||
@ -172,8 +192,8 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
<Col span={8}>
|
||||
<ProFormText name="BILL_NO" label="票据编号" readonly />
|
||||
<ProFormText name="SERIAL_NO" label="流水号" readonly />
|
||||
<ProFormText name="BILL_PERSON" label="开票人" readonly />
|
||||
<ProFormText name="BILL_DATE" label="开票日期" readonly />
|
||||
<ProFormText name="BILL_PERSON" label="开票申请人" readonly />
|
||||
<ProFormText name="BILL_DATE" label="申请日期" readonly />
|
||||
</Col>
|
||||
|
||||
<Col span={8}>
|
||||
@ -210,7 +230,7 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
<Row gutter={16} style={{ marginTop: 12 }}>
|
||||
<Col span={8}>
|
||||
<ProFormText name="DUTY_PARAGRAPH" label="开票税率" readonly />
|
||||
<ProFormText name="ACCOUNTED_DATE" label="入账时间" readonly />
|
||||
<ProFormText name="ACCOUNTED_DATE" label="开票日期" readonly />
|
||||
<ProFormText name="BANK_NAME" label="开户银行" readonly />
|
||||
</Col>
|
||||
|
||||
@ -265,7 +285,6 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
<ProTable
|
||||
search={false}
|
||||
columns={detailColumns}
|
||||
options={false}
|
||||
bordered
|
||||
request={async () => {
|
||||
console.log('parentRowparentRowparentRow', parentRow);
|
||||
@ -284,6 +303,10 @@ const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: P
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columnsState={{
|
||||
value: columnsStateMap,
|
||||
onChange: setColumnsStateMap,
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
@ -42,7 +42,9 @@ const publicParams: any = {
|
||||
|
||||
const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const actionBottomRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const formBottomRef = useRef<FormInstance>();
|
||||
const modalFormRef = useRef<FormInstance>();
|
||||
// 当前用户信息
|
||||
const [currentUser, setCurrentUser] = useState<any>();
|
||||
@ -58,7 +60,20 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||
// 显示详情抽屉
|
||||
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||
|
||||
// 顶上表格的数据
|
||||
const [columnsStateMap, setColumnsStateMap] = useState<any>({
|
||||
SERIAL_NO: { show: false },
|
||||
BANK_NAME: { show: false },
|
||||
BILL_STATE: { show: false },
|
||||
BANK_ACCOUNT: { show: false },
|
||||
});
|
||||
// 底部表格的数据
|
||||
const [columnsStateBottomMap, setColumnsStateBottomMap] = useState<any>({
|
||||
SERIAL_NO: { show: false },
|
||||
BANK_NAME: { show: false },
|
||||
BILL_STATE: { show: false },
|
||||
BANK_ACCOUNT: { show: false },
|
||||
});
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
@ -113,6 +128,25 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
3000: { text: '红票', status: 'error' },
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
{
|
||||
title: '含税标识',
|
||||
dataIndex: 'ACCOUNTED_TYPE',
|
||||
@ -135,7 +169,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票人',
|
||||
title: '开票申请人',
|
||||
dataIndex: 'BILL_PERSON',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
@ -143,12 +177,13 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票日期',
|
||||
title: '申请时间',
|
||||
dataIndex: 'BILL_DATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '开户银行',
|
||||
@ -166,30 +201,12 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "填写中", value: 1000 },
|
||||
{ label: "待审核", value: 2000 },
|
||||
{ label: "开票中", value: 9000 },
|
||||
{ label: "已开票", value: 9200 },
|
||||
{ label: "红冲申请中", value: 9990 },
|
||||
{ label: "已红冲", value: 9999 }
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
fixed: 'left',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (text: any, record: Datum) => (
|
||||
@ -245,7 +262,187 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
),
|
||||
},
|
||||
]
|
||||
const columnsBottom: any = [
|
||||
{
|
||||
title: '服务区名称',
|
||||
dataIndex: 'SERVERPART_NAME',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '商户名称',
|
||||
dataIndex: 'MERCHANTS_NAME',
|
||||
width: 250,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '票据编号',
|
||||
dataIndex: 'BILL_NO',
|
||||
width: 180,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.BILL_NO ?
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetailModal(true)
|
||||
}}>{record?.BILL_NO}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '流水号',
|
||||
dataIndex: 'SERIAL_NO',
|
||||
width: 180,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '票据类型',
|
||||
dataIndex: 'BILL_TYPE',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: "select",
|
||||
valueEnum: {
|
||||
3000: { text: '红票', status: 'error' },
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '票据状态',
|
||||
dataIndex: 'BILL_STATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
fieldProps: {
|
||||
options: [
|
||||
{ label: "红冲申请中", value: 9000 },
|
||||
{ label: "已红冲", value: 9200 },
|
||||
]
|
||||
}
|
||||
// 申请填写 1000 2000 待审核 9000 开票中 9200 已开票
|
||||
},
|
||||
{
|
||||
title: '含税标识',
|
||||
dataIndex: 'ACCOUNTED_TYPE',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (text: number) => (
|
||||
<Tag color={text === 1 ? 'green' : 'blue'}>
|
||||
{text === 1 ? '含税' : '不含税'}
|
||||
</Tag>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>含税费用金额</div>,
|
||||
dataIndex: 'INVOICE_TAXAMOUNT',
|
||||
width: 120,
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开票申请人',
|
||||
dataIndex: 'BILL_PERSON',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
dataIndex: 'BILL_DATE',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '开户银行',
|
||||
dataIndex: 'BANK_NAME',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '银行账号',
|
||||
dataIndex: 'BANK_ACCOUNT',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: 200,
|
||||
fixed: 'left',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (text: any, record: Datum) => (
|
||||
record?.BILL_STATE === 2000 ?
|
||||
<div>
|
||||
<Popconfirm
|
||||
title="确认同意开票?"
|
||||
onConfirm={
|
||||
() => {
|
||||
handleInvoice(record)
|
||||
handleSynchroAPPLYAPPROVEFun(1, record)
|
||||
}
|
||||
}
|
||||
onCancel={() => { }}
|
||||
okText="确认"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button type="primary" size="small">同意开票</Button>
|
||||
</Popconfirm>
|
||||
|
||||
<Popconfirm
|
||||
title="确认退回开票?"
|
||||
onConfirm={
|
||||
() => {
|
||||
// handleInvoice(record)
|
||||
handleReturnInvoice(record)
|
||||
handleSynchroAPPLYAPPROVEFun(2, record)
|
||||
}
|
||||
}
|
||||
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 ?
|
||||
<div>
|
||||
<Popconfirm
|
||||
title="确认红冲发票?"
|
||||
onConfirm={() => {
|
||||
setCurrentRow(record)
|
||||
setShowModal(true)
|
||||
}}
|
||||
onCancel={() => { }}
|
||||
okText="确认"
|
||||
cancelText="取消"
|
||||
>
|
||||
<Button danger style={{ marginLeft: "8px" }} size="small">红冲发票</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
: ""
|
||||
),
|
||||
},
|
||||
]
|
||||
// 红冲发票
|
||||
const handleRedGoBill = async (record?: any) => {
|
||||
// 这个方法 比较复杂 我做一下注释
|
||||
@ -260,8 +457,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
// 拿到表单数据
|
||||
const formData: any = modalFormRef.current?.getFieldsValue()
|
||||
console.log('formData', formData);
|
||||
console.log('recordrecord', record);
|
||||
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
@ -302,10 +497,8 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let responseOld = await handleGetForwardJDPJInterface(newTokenReq2)
|
||||
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))))
|
||||
@ -314,7 +507,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('最终请求结果:', result);
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
billDetail.forEach((item: any) => {
|
||||
@ -348,7 +540,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
buyerRecipientPhone: record?.RECEIVE_PHONENUMBER,// 购方收票手机号
|
||||
@ -376,17 +568,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
let newTokenReq: any = {
|
||||
name: "",
|
||||
@ -398,7 +580,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let response = await handleGetForwardJDPJInterface(newTokenReq)
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
setShowModal(false)
|
||||
setCurrentRow(null)
|
||||
@ -433,6 +614,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
INVOICE_AMOUNT: -record?.INVOICE_AMOUNT,
|
||||
})
|
||||
actionRef.current?.reload()
|
||||
actionBottomRef.current?.reload()
|
||||
} else {
|
||||
message.error(response.message)
|
||||
}
|
||||
@ -449,7 +631,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('recordrecord', record);
|
||||
// 拿个票据明细
|
||||
const billDetail = await handleGetBILLDETAILList({
|
||||
SearchParameter: {
|
||||
@ -460,9 +641,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
SortStr: "BILLDETAIL_ID"
|
||||
})
|
||||
|
||||
console.log('billDetailbillDetailbillDetailbillDetail', billDetail);
|
||||
|
||||
|
||||
let billDetailReq: any = []
|
||||
if (billDetail && billDetail.length > 0) {
|
||||
billDetail.forEach((item: any) => {
|
||||
@ -497,7 +675,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
sellerTaxpayerId: publicParams.sellerTaxpayerId, // 销方税号 写死
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
sellerName: publicParams.sellerName, // 销方名称 写死
|
||||
sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
sellerBankAndAccount: "", // 销方银行和账号 写死
|
||||
sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
|
||||
drawer: record?.BILL_PERSON,// 开票人
|
||||
@ -513,7 +691,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
billDetail: billDetailReq
|
||||
}
|
||||
|
||||
console.log('objobj', obj);
|
||||
// 构造原始数据
|
||||
const originalData = [obj]; // 将record作为data数组的一项
|
||||
// 将data字段进行base64加密
|
||||
@ -526,17 +703,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: encryptedData // 加密后的data字符串
|
||||
};
|
||||
console.log('加密前的请求参数:', {
|
||||
businessSystemCode: "BUSINESS_YCIC", // 来源系统编码
|
||||
interfaceCode: "BILL.PUSH", // 接口业务编码
|
||||
requestId: Date.now().toString(), // 时间戳作为请求ID
|
||||
data: obj // 加密后的data字符串
|
||||
});
|
||||
console.log('原始数据:', originalData);
|
||||
console.log('JSON字符串:', dataString);
|
||||
console.log('Base64加密后:', encryptedData);
|
||||
console.log('最终请求数据:', invoiceData);
|
||||
console.log('访问令牌:', accessToken);
|
||||
|
||||
// const response = await handleGetKaiPiao(invoiceData, accessToken);
|
||||
let newTokenReq: any = {
|
||||
@ -550,11 +716,9 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
let response = await handleGetForwardJDPJInterface(newTokenReq)
|
||||
|
||||
response = JSON.parse(response as any)
|
||||
console.log('开票响应:', response);
|
||||
|
||||
if (response && response.success) {
|
||||
let res: any = JSON.parse(decodeURIComponent(escape(atob(response.data))));
|
||||
console.log('最终结果:', res);
|
||||
|
||||
message.success({ content: `单据 ${record.BILL_NO} 开票申请已提交成功`, key: 'invoice' });
|
||||
actionRef.current?.reload()
|
||||
@ -578,7 +742,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
BILL_NO: `【退】${record?.BILL_NO}`
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('djasdahslda', data);
|
||||
if (data.Result_Code === 100) {
|
||||
message.success('退回成功!');
|
||||
actionRef.current?.reload()
|
||||
@ -622,9 +785,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
let token = await handleGetForwardJDPJInterface(newreq)
|
||||
let tokenData = token ? JSON.parse(token as any) : ""
|
||||
console.log('tokenDatatokenDatatokenDatatokenDatadasdsa', tokenData);
|
||||
|
||||
|
||||
|
||||
let appToken: any = tokenData.data.app_token
|
||||
// 老
|
||||
@ -670,7 +830,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
// sellerTaxpayerId: publicParams.sellerTaxpayerId,
|
||||
// serialNo: '202509-401206-0014',
|
||||
// };
|
||||
// console.log('queryDataqueryData', queryData);
|
||||
|
||||
// // 将data字段进行base64加密
|
||||
// const dataStringOld = JSON.stringify(queryData);
|
||||
@ -684,7 +843,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
// data: encryptedDataOld
|
||||
// };
|
||||
|
||||
// console.log('最终请求参数:', requestParams);
|
||||
|
||||
// let reqResult: any = {
|
||||
// ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
|
||||
@ -692,13 +850,11 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
// 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))))
|
||||
@ -752,7 +908,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
MERCHANTS_ID: obj?.MERCHANTS_ID,// 商户内码
|
||||
MERCHANTS_NAME: obj?.MERCHANTS_NAME,// 商户名称
|
||||
BILL_PERSON: obj?.BILL_PERSON,// 开票人
|
||||
BILL_DATE: obj?.BILL_DATE,// 开票日期
|
||||
BILL_DATE: obj?.BILL_DATE,// 申请时间
|
||||
BANK_NAME: obj?.BANK_NAME,// 开户银行
|
||||
BANK_ACCOUNT: obj?.BANK_ACCOUNT,// 银行账号
|
||||
TAXPAYER_IDENTIFYCODE: obj?.TAXPAYER_IDENTIFYCODE,// 统一信用代码
|
||||
@ -767,7 +923,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
DetailList: obj?.DetailList,// 发票明细列表
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('data2222', data);
|
||||
}
|
||||
// 获取当前用户信息
|
||||
const handleGetUserInfo = async (id: string) => {
|
||||
@ -775,7 +930,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
UserIdEncrypted: id
|
||||
}
|
||||
const data = await handleGetPassportInfoById(req)
|
||||
console.log('datae2e12e1', data);
|
||||
setCurrentUser(data)
|
||||
return data
|
||||
}
|
||||
@ -799,7 +953,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
}
|
||||
|
||||
const data = await handleSynchroAPPLYAPPROVE(reqData)
|
||||
console.log('datadatadata312321', data);
|
||||
|
||||
}
|
||||
// 红冲的时候 同步原先的票子 传入红冲原因
|
||||
@ -808,7 +961,6 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
...record,
|
||||
}
|
||||
const data = await handleSynchroBILLInterface(req)
|
||||
console.log('新票子', data);
|
||||
}
|
||||
|
||||
useEffect(async () => {
|
||||
@ -818,7 +970,7 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ height: 'calc(100vh - 100px)', background: "#fff" }}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
@ -830,290 +982,94 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
||||
rowKey={(record) => {
|
||||
return `${record?.billNo}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: 'calc(100vh - 450px)' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>待开票列表</span>}
|
||||
search={{ span: 6, labelWidth: 100 }}
|
||||
request={async (params: any) => {
|
||||
scroll={{ x: "100%", y: '400px' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>可红冲列表</span>}
|
||||
// search={{ span: 6, labelWidth: 100 }}
|
||||
search={false}
|
||||
request={async (params: any, sorter: any) => {
|
||||
const search = window.location.search;
|
||||
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
||||
console.log('addressParamsaddressParamsaddressParams', addressParams);
|
||||
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
||||
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
|
||||
|
||||
// 获取票据信息表列表
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
BILL_TYPES: "2000",// 现在只支持普票红冲 所以找普票 且状态为 普票的已开票即可
|
||||
SERVERPART_IDS: userInfo?.ServerpartIds,
|
||||
BILL_STATES: "9200"
|
||||
// BILL_TYPES: "1000,2000"
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "BILL_ID desc",
|
||||
}
|
||||
|
||||
const data = await handleGetBILLList(req)
|
||||
console.log('dsahdgasyifgdhsvs', data);
|
||||
if (data && data.length > 0) {
|
||||
return { data: data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columnsState={{
|
||||
value: columnsStateMap,
|
||||
onChange: setColumnsStateMap,
|
||||
}}
|
||||
/>
|
||||
|
||||
<ProTable
|
||||
actionRef={actionBottomRef}
|
||||
formRef={formBottomRef}
|
||||
columns={columnsBottom}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
rowKey={(record) => {
|
||||
return `${record?.billNo}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: '200px' }}
|
||||
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>红冲申请列表</span>}
|
||||
// search={{ span: 6, labelWidth: 100 }}
|
||||
search={false}
|
||||
request={async (params: any, sorter: any) => {
|
||||
const search = window.location.search;
|
||||
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
||||
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
|
||||
// let req: any = {
|
||||
// appId: "FPY001",
|
||||
// appSecret: "FPY001fpy@2023***",
|
||||
// accountId: "2280459335882518528",
|
||||
// tenantid: "xhcamzchwbgonerr",
|
||||
// language: ""
|
||||
// }
|
||||
// const token = await handleGetAppToken(req)
|
||||
// console.log('tokentokentoken', token);
|
||||
// 获取票据信息表列表
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
BILL_TYPES: "3000",// 现在只支持普票红冲 所以找普票 且状态为 普票的已开票即可
|
||||
SERVERPART_IDS: userInfo?.ServerpartIds,
|
||||
BILL_STATES: "9000"
|
||||
// BILL_TYPES: "1000,2000"
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "BILL_ID desc",
|
||||
}
|
||||
|
||||
// let appToken: any = token.data.app_token
|
||||
|
||||
// let tokenReq: any = {
|
||||
// user: "18620126214",
|
||||
// apptoken: appToken,
|
||||
// tenantid: "xhcamzchwbgonerr",
|
||||
// accountId: "2280459335882518528",
|
||||
// usertype: ""
|
||||
// }
|
||||
|
||||
// const accessToken: any = await handleGetSDToken(tokenReq)
|
||||
// console.log('accessTokenaccessTokenaccessToken', accessToken);
|
||||
|
||||
// setAppToken(appToken)
|
||||
// setAccessToken(accessToken.data.access_token)
|
||||
|
||||
|
||||
// // 模拟数据
|
||||
// const mockData: any = [
|
||||
// // // 专票
|
||||
// // {
|
||||
// // billNo: "SRM_202508220957", // 单据编号
|
||||
// // billDate: "2025-08-22", // 单据日期
|
||||
// // totalAmount: 10, // 单据金额
|
||||
// // includeTaxFlag: "1",// 判断是否含税
|
||||
// // autoInvoice: "1",// 自动开票标记
|
||||
// // invoiceType: "10xdp", //发票种类
|
||||
// // buyerName: "深圳市顺丰快运有限公司test01", // 购买方名称
|
||||
// // buyerProperty: "0", // 购买方性质
|
||||
// // sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
|
||||
// // sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
// // sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
// // sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
// // drawer: "测试人",// 开票人
|
||||
// // buyerRecipientPhone: "18158132615",// 购方收票手机号
|
||||
// // buyerRecipientMail: "",// 购方收件邮箱
|
||||
// // amount: 10, // 明细金额 明细金额,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // detailId: "1194121661989796666",// 业务系统明细id 业务系统明细id,用于反写回原业务系统明细 【长度:50】
|
||||
// // goodsName: "蜂胶口腔膜",// 商品名称 商品名称,与商品编码2填1,需提前在系统维护【长度:GBK92字节】
|
||||
// // lineProperty: 2,// 行性质 行性质,1折扣行(折扣行必须紧跟被折扣的正常商品行),2正常商品行
|
||||
// // price: 10,// 单价 单价【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,price有值则quantity必填,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // quantity: 1,// 数量 数量【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,quantity有值则price必填
|
||||
// // revenueCode: "1070304990000000000",// 税收分类编码 税收分类编码,开票项补全或映射会补全税收分类编码,未走开票项补全或映射必填
|
||||
// // taxRate: "0.13",// 税率 税率,【0.13,0.09,0.06等】。不传时根据开票项匹配税率
|
||||
// // units: "个"// 计量单位 计量单位,【长度:GBK22字节】
|
||||
|
||||
// // // billDetail: [
|
||||
// // // {
|
||||
|
||||
// // // }
|
||||
// // // ]
|
||||
// // },
|
||||
// // {
|
||||
// // billNo: "SRM_202508220966", // 单据编号
|
||||
// // billDate: "2025-08-22", // 单据日期
|
||||
// // totalAmount: 10, // 单据金额
|
||||
// // includeTaxFlag: "1",// 判断是否含税
|
||||
// // autoInvoice: "1",// 自动开票标记
|
||||
// // invoiceType: "10xdp", //发票种类
|
||||
// // buyerName: "深圳市顺丰快运有限公司test01", // 购买方名称
|
||||
// // buyerProperty: "0", // 购买方性质
|
||||
// // sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
|
||||
// // sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
// // sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
// // sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
// // drawer: "测试人",// 开票人
|
||||
// // buyerRecipientPhone: "18158132615",// 购方收票手机号
|
||||
// // buyerRecipientMail: "",// 购方收件邮箱
|
||||
// // amount: 10, // 明细金额 明细金额,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // detailId: "1194121661989796666",// 业务系统明细id 业务系统明细id,用于反写回原业务系统明细 【长度:50】
|
||||
// // goodsName: "蜂胶口腔膜",// 商品名称 商品名称,与商品编码2填1,需提前在系统维护【长度:GBK92字节】
|
||||
// // lineProperty: 2,// 行性质 行性质,1折扣行(折扣行必须紧跟被折扣的正常商品行),2正常商品行
|
||||
// // price: 10,// 单价 单价【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,price有值则quantity必填,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // quantity: 1,// 数量 数量【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,quantity有值则price必填
|
||||
// // revenueCode: "1070304990000000000",// 税收分类编码 税收分类编码,开票项补全或映射会补全税收分类编码,未走开票项补全或映射必填
|
||||
// // taxRate: "0.13",// 税率 税率,【0.13,0.09,0.06等】。不传时根据开票项匹配税率
|
||||
// // units: "个"// 计量单位 计量单位,【长度:GBK22字节】
|
||||
|
||||
// // // billDetail: [
|
||||
// // // {
|
||||
|
||||
// // // }
|
||||
// // // ]
|
||||
// // },
|
||||
// // // 普票
|
||||
// // {
|
||||
// // billNo: "SRM_202508221427", // 单据编号
|
||||
// // billDate: "2025-08-22", // 单据日期
|
||||
// // totalAmount: -10, // 单据金额
|
||||
// // includeTaxFlag: "1",// 判断是否含税
|
||||
// // invoiceProperty: 0,
|
||||
// // autoMerge: 1,
|
||||
// // autoInvoice: 1,// 自动开票标记
|
||||
// // invoiceType: "10xdp", //发票种类
|
||||
// // buyerName: "深圳市顺丰快运有限公司test01", // 购买方名称
|
||||
// // buyerProperty: "0", // 购买方性质
|
||||
// // sellerTaxpayerId: "91530112MA7MQ2JR9U", // 销方税号 写死
|
||||
// // sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司", // 销方名称 写死
|
||||
// // sellerBankAndAccount: "13710884704", // 销方银行和账号 写死
|
||||
// // sellerAddressAndTel: "", // 销方地址和电话 写死 应该可以不传
|
||||
// // drawer: "测试人",// 开票人
|
||||
// // buyerRecipientPhone: "18158132615",// 购方收票手机号
|
||||
// // buyerRecipientMail: "",// 购方收件邮箱
|
||||
// // amount: -10, // 明细金额 明细金额,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // detailId: "1194121661989796666",// 业务系统明细id 业务系统明细id,用于反写回原业务系统明细 【长度:50】
|
||||
// // goodsName: "蜂胶口腔膜",// 商品名称 商品名称,与商品编码2填1,需提前在系统维护【长度:GBK92字节】
|
||||
// // lineProperty: 2,// 行性质 行性质,1折扣行(折扣行必须紧跟被折扣的正常商品行),2正常商品行
|
||||
// // price: -10,// 单价 单价【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,price有值则quantity必填,含税标识includeTaxFlag=1时该金额为含税金额
|
||||
// // quantity: 1,// 数量 数量【长度:整数位加小数位最大16位,小数位最多13,小数点占1位】,quantity有值则price必填
|
||||
// // revenueCode: "1070304990000000000",// 税收分类编码 税收分类编码,开票项补全或映射会补全税收分类编码,未走开票项补全或映射必填
|
||||
// // taxRate: "0.13",// 税率 税率,【0.13,0.09,0.06等】。不传时根据开票项匹配税率
|
||||
// // units: "个",// 计量单位 计量单位,【长度:GBK22字节】
|
||||
// // redReason: "2",
|
||||
// // blueInvoiceType: "026",
|
||||
// // originalIssueTime: "2025-08-24 15:00:00",
|
||||
// // blueinvoiceCode: "testBlueCode2025-08-25",
|
||||
// // blueinvoiceNo: "testBlueNo2025-08-25"
|
||||
// // // billDetail: [
|
||||
// // // {
|
||||
|
||||
// // // }
|
||||
// // // ]
|
||||
// // },
|
||||
// // {
|
||||
// // billNo: "202508220003",
|
||||
// // billDate: "2025-08-22",
|
||||
// // autoInvoice: "1",
|
||||
// // includeTaxFlag: "0",
|
||||
// // invoiceProperty: "1",
|
||||
// // invoiceType: "10xdp",
|
||||
// // totalAmount: -8.85,
|
||||
// // buyerTaxpayerId: "91440300MA5G9GK78Y",
|
||||
// // buyerName: "深圳市顺丰快运有限公司test01",
|
||||
// // sellerTaxpayerId: "91530112MA7MQ2JR9U",
|
||||
// // sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司",
|
||||
// // sellerBankAndAccount: "13710884704",
|
||||
// // sellerAddressAndTel: "高新技术产业园南区科技南十二路58996989",
|
||||
// // drawer: "王协芬",
|
||||
// // autoMerge: "0",
|
||||
// // blueinvoiceNo: "SRM_202508220966",
|
||||
// // redReason: "2",
|
||||
// // amount: -8.85,
|
||||
// // goodsName: "通天口服液",
|
||||
// // lineProperty: 2,
|
||||
// // price: -12,
|
||||
// // quantity: 5,
|
||||
// // revenueCode: "1070304990000000000",
|
||||
// // taxRate: "0.09",
|
||||
// // units: "盒"
|
||||
// // },
|
||||
|
||||
// // 普票
|
||||
// {
|
||||
// billNo: "SRM_202509011376",
|
||||
// billDate: "2025-09-01",
|
||||
// autoInvoice: "1",
|
||||
// includeTaxFlag: "1",
|
||||
// invoiceProperty: "0",
|
||||
// invoiceType: "10xdp",
|
||||
// totalAmount: 10.00,
|
||||
// buyerTaxpayerId: "91440300MA5G9GK78Y",
|
||||
// buyerName: "深圳市顺丰快运有限公司test01",
|
||||
// sellerTaxpayerId: "91530112MA7MQ2JR9U",
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司",
|
||||
// sellerBankAndAccount: "13710884704",
|
||||
// sellerAddressAndTel: "高新技术产业园南区科技南十二路58996989",
|
||||
// drawer: "王协芬",
|
||||
// buyerRecipientPhone: "18158132615",
|
||||
// buyerRecipientMail: "",
|
||||
// billDetail: [
|
||||
// {
|
||||
// amount: 5,
|
||||
// detailId: "11112222333344445555",
|
||||
// goodsName: "通天口服液",
|
||||
// lineProperty: 2,
|
||||
// price: 5,
|
||||
// quantity: 1,
|
||||
// revenueCode: "1070304990000000000",
|
||||
// taxRate: "0.13",
|
||||
// units: "盒"
|
||||
// },
|
||||
// {
|
||||
// amount: 5,
|
||||
// detailId: "55554444333322221111",
|
||||
// goodsName: "通天口服液2",
|
||||
// lineProperty: 2,
|
||||
// price: 5,
|
||||
// quantity: 1,
|
||||
// revenueCode: "1070304990000000000",
|
||||
// taxRate: "0.13",
|
||||
// units: "盒"
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
|
||||
// // 专票
|
||||
// {
|
||||
// billNo: "SRM_202509011377",
|
||||
// billDate: "2025-09-02",
|
||||
// autoInvoice: "1",
|
||||
// includeTaxFlag: "1",
|
||||
// invoiceProperty: "0",
|
||||
// invoiceType: "08xdp",
|
||||
// totalAmount: 10.00,
|
||||
// buyerTaxpayerId: "91440300MA5G9GK78Y",
|
||||
// buyerName: "深圳市顺丰快运有限公司test01",
|
||||
// buyerProperty: "1",
|
||||
// sellerTaxpayerId: "91530112MA7MQ2JR9U",
|
||||
// sellerName: "云南交投集团经营开发有限公司彩云驿商业管理分公司",
|
||||
// sellerBankAndAccount: "13710884704",
|
||||
// sellerAddressAndTel: "高新技术产业园南区科技南十二路58996989",
|
||||
// drawer: "王协芬",
|
||||
// buyerRecipientPhone: "18158132615",
|
||||
// buyerRecipientMail: "",
|
||||
// billDetail: [
|
||||
// {
|
||||
// amount: 5,
|
||||
// detailId: "11112222333344445555",
|
||||
// goodsName: "通天口服液",
|
||||
// lineProperty: 2,
|
||||
// price: 5,
|
||||
// quantity: 1,
|
||||
// revenueCode: "1070304990000000000",
|
||||
// taxRate: "0.13",
|
||||
// units: "盒"
|
||||
// },
|
||||
// {
|
||||
// amount: 5,
|
||||
// detailId: "55554444333322221111",
|
||||
// goodsName: "通天口服液2",
|
||||
// lineProperty: 2,
|
||||
// price: 5,
|
||||
// quantity: 1,
|
||||
// revenueCode: "1070304990000000000",
|
||||
// taxRate: "0.13",
|
||||
// units: "盒"
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ];
|
||||
|
||||
// return {
|
||||
// data: mockData,
|
||||
// success: true,
|
||||
// total: mockData.length
|
||||
// }
|
||||
const data = await handleGetBILLList(req)
|
||||
if (data && data.length > 0) {
|
||||
return { data: data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
columnsState={{
|
||||
value: columnsStateBottomMap,
|
||||
onChange: setColumnsStateBottomMap,
|
||||
}}
|
||||
/>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user