update
This commit is contained in:
parent
87ec1f9508
commit
345c90cecf
@ -8,6 +8,7 @@ import { handleGetAppToken, handleGetBILLDETAILList, handleGetBILLList, handleGe
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { encryptAES } from "@/utils/handleAes";
|
import { encryptAES } from "@/utils/handleAes";
|
||||||
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
||||||
|
import InvoiceDetial from "../redReversal/components/InvoiceDetial";
|
||||||
|
|
||||||
interface ConnectState {
|
interface ConnectState {
|
||||||
user: {
|
user: {
|
||||||
@ -55,6 +56,8 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
const [currentRow, setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 红冲悬浮框点击的加载效果
|
// 红冲悬浮框点击的加载效果
|
||||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||||
|
// 显示详情抽屉
|
||||||
|
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
@ -79,6 +82,13 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.BILL_NO ?
|
||||||
|
<a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowDetailModal(true)
|
||||||
|
}}>{record?.BILL_NO}</a> : ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '流水号',
|
title: '流水号',
|
||||||
@ -638,35 +648,35 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
setAccessToken(accessToken.data.access_token)
|
setAccessToken(accessToken.data.access_token)
|
||||||
|
|
||||||
|
|
||||||
// const queryData = {
|
const queryData = {
|
||||||
// // sellerTaxpayerId: "91530112MA7MQ2JR9U",
|
// sellerTaxpayerId: "91530112MA7MQ2JR9U",
|
||||||
// sellerTaxpayerId: publicParams.sellerTaxpayerId,
|
sellerTaxpayerId: publicParams.sellerTaxpayerId,
|
||||||
// serialNo: '202509-401206-0014',
|
serialNo: '20251020-5300001245-009',
|
||||||
// };
|
};
|
||||||
// console.log('queryDataqueryData', queryData);
|
console.log('queryDataqueryData', queryData);
|
||||||
|
|
||||||
// // 将data字段进行base64加密
|
// 将data字段进行base64加密
|
||||||
// const dataStringOld = JSON.stringify(queryData);
|
const dataStringOld = JSON.stringify(queryData);
|
||||||
// const encryptedDataOld = btoa(unescape(encodeURIComponent(dataStringOld)));
|
const encryptedDataOld = btoa(unescape(encodeURIComponent(dataStringOld)));
|
||||||
|
|
||||||
// // 构造最终请求参数
|
// 构造最终请求参数
|
||||||
// const requestParams = {
|
const requestParams = {
|
||||||
// businessSystemCode: "BUSINESS_YCIC",
|
businessSystemCode: "BUSINESS_YCIC",
|
||||||
// interfaceCode: "BILL.INVOICE.QUERY",
|
interfaceCode: "BILL.INVOICE.QUERY",
|
||||||
// requestId: Date.now().toString(),
|
requestId: Date.now().toString(),
|
||||||
// data: encryptedDataOld
|
data: encryptedDataOld
|
||||||
// };
|
};
|
||||||
|
|
||||||
// console.log('最终请求参数:', requestParams);
|
console.log('最终请求参数:', requestParams);
|
||||||
|
|
||||||
// let reqResult: any = {
|
let reqResult: any = {
|
||||||
// ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
|
ReqUrl: `https://cosmic.piaozone.com/ynjtjtjykf/kapi/app/sim/openApi?access_token=${accessToken.data.access_token}`,
|
||||||
// Access_token: accessToken.data.access_token,
|
Access_token: accessToken.data.access_token,
|
||||||
// data: JSON.stringify(requestParams)
|
data: JSON.stringify(requestParams)
|
||||||
// }
|
}
|
||||||
// let responseOld = await handleGetForwardJDPJInterface(reqResult)
|
let responseOld = await handleGetForwardJDPJInterface(reqResult)
|
||||||
// console.log('responseOldresponseOldresponseOld', responseOld);
|
console.log('responseOldresponseOldresponseOld', responseOld);
|
||||||
// responseOld = JSON.parse(responseOld as any)
|
responseOld = JSON.parse(responseOld as any)
|
||||||
|
|
||||||
// 老
|
// 老
|
||||||
// // 调用查询接口 (这里需要传入正确的code参数)
|
// // 调用查询接口 (这里需要传入正确的code参数)
|
||||||
@ -787,6 +797,8 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
useEffect(async () => {
|
useEffect(async () => {
|
||||||
// 先调用token 后续这个页面用得到
|
// 先调用token 后续这个页面用得到
|
||||||
await handleGetTokenInPage()
|
await handleGetTokenInPage()
|
||||||
|
|
||||||
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|
||||||
@ -803,13 +815,12 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
rowKey={(record) => {
|
rowKey={(record) => {
|
||||||
return `${record?.billNo}`
|
return `${record?.billNo}`
|
||||||
}}
|
}}
|
||||||
scroll={{ x: "100%", y: 'calc(100vh - 450px)' }}
|
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 }}
|
search={{ span: 6, labelWidth: 100 }}
|
||||||
request={async (params: any) => {
|
request={async (params: any) => {
|
||||||
const search = window.location.search;
|
const search = window.location.search;
|
||||||
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
const addressParams = Object.fromEntries(new URLSearchParams(search).entries());
|
||||||
console.log('addressParamsaddressParamsaddressParams', addressParams);
|
|
||||||
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
const userInfo = await handleGetUserInfo(addressParams.UserIdEncrypted)
|
||||||
|
|
||||||
// 获取票据信息表列表
|
// 获取票据信息表列表
|
||||||
@ -829,264 +840,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
return { data: data, success: true }
|
return { data: data, success: true }
|
||||||
}
|
}
|
||||||
return { data: [], success: true }
|
return { data: [], success: true }
|
||||||
|
|
||||||
|
|
||||||
// let req: any = {
|
|
||||||
// appId: "FPY001",
|
|
||||||
// appSecret: "FPY001fpy@2023***",
|
|
||||||
// accountId: "2280459335882518528",
|
|
||||||
// tenantid: "xhcamzchwbgonerr",
|
|
||||||
// language: ""
|
|
||||||
// }
|
|
||||||
// const token = await handleGetAppToken(req)
|
|
||||||
// console.log('tokentokentoken', token);
|
|
||||||
|
|
||||||
// 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
|
|
||||||
// }
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -1146,6 +899,9 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
/> */}
|
/> */}
|
||||||
</ProForm>
|
</ProForm>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<InvoiceDetial showDetail={showDetailModal} setShowDetail={setShowDetailModal} parentRow={currentRow} setParentRow={setCurrentRow} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,3 +123,18 @@ export async function handleGetForwardJDPJInterface(params: any) {
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 拿到票据的审批流程
|
||||||
|
export async function handleGetAPPLYAPPROVEList(params: any) {
|
||||||
|
const data = await requestOld(`/Office/GetAPPLYAPPROVEList`, {
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
|
||||||
|
if (data.Result_Code !== 100) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.Result_Data.List
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ import { handleGetAppToken, handleGetBILLDETAILList, handleGetBILLList, handleGe
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { encryptAES } from "@/utils/handleAes";
|
import { encryptAES } from "@/utils/handleAes";
|
||||||
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
||||||
|
import InvoiceDetial from "../redReversal/components/InvoiceDetial";
|
||||||
|
|
||||||
interface ConnectState {
|
interface ConnectState {
|
||||||
user: {
|
user: {
|
||||||
@ -55,6 +56,8 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
const [currentRow, setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 红冲悬浮框点击的加载效果
|
// 红冲悬浮框点击的加载效果
|
||||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||||
|
// 显示详情抽屉
|
||||||
|
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
@ -79,6 +82,13 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.BILL_NO ?
|
||||||
|
<a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowDetailModal(true)
|
||||||
|
}}>{record?.BILL_NO}</a> : ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '流水号',
|
title: '流水号',
|
||||||
@ -1082,6 +1092,10 @@ const InvoiceInquiry: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
/> */}
|
/> */}
|
||||||
</ProForm>
|
</ProForm>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
||||||
|
<InvoiceDetial showDetail={showDetailModal} setShowDetail={setShowDetailModal} parentRow={currentRow} setParentRow={setCurrentRow} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
334
src/pages/redReversal/components/InvoiceDetial.tsx
Normal file
334
src/pages/redReversal/components/InvoiceDetial.tsx
Normal file
@ -0,0 +1,334 @@
|
|||||||
|
import React, { useEffect, useRef } 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";
|
||||||
|
import { ProTable } from "@ant-design/pro-components";
|
||||||
|
import { handleGetAPPLYAPPROVEList, handleGetBILLDETAILList } from "@/pages/DigitalElectronics/service";
|
||||||
|
import moment from "moment";
|
||||||
|
import { encryptAES } from "@/utils/handleAes";
|
||||||
|
|
||||||
|
const { Text } = Typography;
|
||||||
|
|
||||||
|
interface ConnectState {
|
||||||
|
user: { data: any };
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ParamsType {
|
||||||
|
showDetail: boolean;
|
||||||
|
setShowDetail: (v: boolean) => void;
|
||||||
|
parentRow: any;
|
||||||
|
setParentRow: (v: any) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const InvoiceDetail = ({ showDetail, setShowDetail, parentRow, setParentRow }: ParamsType) => {
|
||||||
|
const formRef = useRef<FormInstance<any>>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (formRef.current) {
|
||||||
|
if (parentRow) {
|
||||||
|
formRef.current.setFieldsValue(parentRow);
|
||||||
|
} else {
|
||||||
|
formRef.current.resetFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [parentRow]);
|
||||||
|
|
||||||
|
const detailColumns: any = [
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>款项名称</div>,
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "ITEM_NAME"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>规格型号</div>,
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "ITEM_RULE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>计量单位</div>,
|
||||||
|
align: 'center',
|
||||||
|
width: 100,
|
||||||
|
dataIndex: "ITEM_UNIT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>数量</div>,
|
||||||
|
align: 'right',
|
||||||
|
width: 80,
|
||||||
|
valueType: 'digit',
|
||||||
|
dataIndex: "INVOICE_COUNT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>单价</div>,
|
||||||
|
align: 'right',
|
||||||
|
width: 80,
|
||||||
|
valueType: 'digit',
|
||||||
|
dataIndex: "INVOICE_PRICE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>金额</div>,
|
||||||
|
align: 'right',
|
||||||
|
width: 80,
|
||||||
|
valueType: 'digit',
|
||||||
|
dataIndex: "INVOICE_AMOUNT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>税率</div>,
|
||||||
|
align: 'center',
|
||||||
|
width: 80,
|
||||||
|
dataIndex: "DUTY_PARAGRAPH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>税额</div>,
|
||||||
|
align: 'right',
|
||||||
|
width: 80,
|
||||||
|
dataIndex: "INVOICE_TAX"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>折扣</div>,
|
||||||
|
align: 'center',
|
||||||
|
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') : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const approveColumns: any = [
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>环节名称</div>,
|
||||||
|
width: 200,
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: "ACTINST_NAME",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>票据状态</div>,
|
||||||
|
width: 150,
|
||||||
|
dataIndex: "APPROVE_STATE",
|
||||||
|
align: 'center',
|
||||||
|
valueType: 'select',
|
||||||
|
fieldProps: {
|
||||||
|
options: [
|
||||||
|
{ label: "填写中", value: 1000 },
|
||||||
|
{ label: "待审核", value: 2000 },
|
||||||
|
{ label: "开票中", value: 9000 },
|
||||||
|
{ label: "已开票", value: 9200 },
|
||||||
|
{ label: "红冲申请中", value: 9990 },
|
||||||
|
{ label: "已红冲", value: 9999 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>审批人</div>,
|
||||||
|
dataIndex: "STAFF_NAME",
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>审批时间</div>,
|
||||||
|
dataIndex: "APPROVE_DATE",
|
||||||
|
align: 'center',
|
||||||
|
width: 150,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.APPROVE_DATE ? moment(record?.APPROVE_DATE).format('YYYY-MM-DD HH:mm:ss') : "-"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <div style={{ textAlign: 'center' }}>审批意见</div>,
|
||||||
|
dataIndex: "APPROVE_INFO",
|
||||||
|
ellipsis: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Drawer
|
||||||
|
width="70%"
|
||||||
|
open={showDetail}
|
||||||
|
title="票据详情"
|
||||||
|
onClose={() => {
|
||||||
|
setShowDetail(false);
|
||||||
|
setParentRow(undefined);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* 统一 labelCol 宽度:通过 formProps 设置 */}
|
||||||
|
<ProForm
|
||||||
|
formRef={formRef}
|
||||||
|
submitter={false}
|
||||||
|
layout="horizontal"
|
||||||
|
formProps={{ labelCol: { span: 8 } }}
|
||||||
|
>
|
||||||
|
{/* 第一行:三列(每列 span=8) */}
|
||||||
|
<Row gutter={16}>
|
||||||
|
<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 />
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormSelect name="BILL_TYPE" label="票据类型" readonly fieldProps={{
|
||||||
|
options: [
|
||||||
|
{ label: "专票", value: 1000 },
|
||||||
|
{ label: "普票", value: 2000 },
|
||||||
|
{ label: "红票", value: 3000 }
|
||||||
|
]
|
||||||
|
}} />
|
||||||
|
<ProFormSelect name="BILL_STATE" label="票据状态" readonly fieldProps={{
|
||||||
|
options: [
|
||||||
|
{ label: "填写中", value: 1000 },
|
||||||
|
{ label: "待审核", value: 2000 },
|
||||||
|
{ label: "开票中", value: 9000 },
|
||||||
|
{ label: "已开票", value: 9200 },
|
||||||
|
{ label: "红冲申请中", value: 9990 },
|
||||||
|
{ label: "已红冲", value: 9999 }
|
||||||
|
]
|
||||||
|
}} />
|
||||||
|
<ProFormText name="MERCHANTS_NAME" label="商户名称" readonly />
|
||||||
|
<ProFormText name="SERVERPART_NAME" label="服务区" readonly />
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="SERVERPARTSHOP_NAME" label="门店" readonly />
|
||||||
|
<ProFormText name="BILL_TAXAMOUNT" label="含税开票金额" readonly />
|
||||||
|
<ProFormText name="BILL_AMOUNT" label="除税开票金额" readonly />
|
||||||
|
<ProFormText name="TAX_PRICE" label="开票税金" readonly />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
{/* 第二行 */}
|
||||||
|
<Row gutter={16} style={{ marginTop: 12 }}>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="DUTY_PARAGRAPH" label="开票税率" readonly />
|
||||||
|
<ProFormText name="ACCOUNTED_DATE" label="入账时间" readonly />
|
||||||
|
<ProFormText name="BANK_NAME" label="开户银行" readonly />
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="RECEIVE_PHONENUMBER" label="收票手机" readonly />
|
||||||
|
<ProFormText name="RECEIVE_EMAIL" label="收票邮箱" readonly />
|
||||||
|
{/* 发票图片:显示为链接 */}
|
||||||
|
<ProFormText
|
||||||
|
name="DOWNLOAD_URL"
|
||||||
|
label="发票图片"
|
||||||
|
readonly
|
||||||
|
fieldProps={{
|
||||||
|
value: parentRow?.DOWNLOAD_URL ? (
|
||||||
|
<a
|
||||||
|
href={parentRow.DOWNLOAD_URL}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
style={{ color: '#1890ff', textDecoration: 'none' }}
|
||||||
|
>
|
||||||
|
查看发票图片
|
||||||
|
</a>
|
||||||
|
) : '无发票图片',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="BANK_ACCOUNT" label="银行账号" readonly />
|
||||||
|
<ProFormText name="TAXPAYER_IDENTIFYCODE" label="统一信用代码" readonly />
|
||||||
|
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
{/* 第三行:备注信息(仍三列) */}
|
||||||
|
<Row gutter={16} style={{ marginTop: 12 }}>
|
||||||
|
<Col span={8}>
|
||||||
|
{/* 修改 label 文案为 纳税人识别号 */}
|
||||||
|
<ProFormText name="TAXPAYER_CODE" label="纳税人识别号" readonly />
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="INTERBANK_NO" label="联行号" readonly />
|
||||||
|
</Col>
|
||||||
|
<Col span={8}>
|
||||||
|
<ProFormText name="BILL_DESC" label="备注" readonly />
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
|
{/* 发票明细 */}
|
||||||
|
<div style={{ marginTop: 24 }}>
|
||||||
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
|
<Text strong>发票明细</Text>
|
||||||
|
<ProTable
|
||||||
|
search={false}
|
||||||
|
columns={detailColumns}
|
||||||
|
options={false}
|
||||||
|
bordered
|
||||||
|
request={async () => {
|
||||||
|
console.log('parentRowparentRowparentRow', parentRow);
|
||||||
|
const billDetail = await handleGetBILLDETAILList({
|
||||||
|
SearchParameter: {
|
||||||
|
BILL_ID: parentRow?.BILL_ID
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
SortStr: "BILLDETAIL_ID"
|
||||||
|
})
|
||||||
|
console.log('billDetailbillDetailbillDetail', billDetail);
|
||||||
|
|
||||||
|
if (billDetail && billDetail.length > 0) {
|
||||||
|
return { data: billDetail, success: true }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 审批意见 */}
|
||||||
|
<div style={{ marginTop: 24 }}>
|
||||||
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
|
<Text strong>审批意见</Text>
|
||||||
|
|
||||||
|
<ProTable
|
||||||
|
search={false}
|
||||||
|
columns={approveColumns}
|
||||||
|
options={false}
|
||||||
|
bordered
|
||||||
|
request={async () => {
|
||||||
|
console.log('parentRowparentRowparentRow', parentRow);
|
||||||
|
|
||||||
|
const req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
APPROVE_TYPE: parentRow?.BILL_ID,// 票的id
|
||||||
|
APPROVE_DESC: "T_BILL"
|
||||||
|
},
|
||||||
|
PageIndex: 1,
|
||||||
|
PageSize: 999999,
|
||||||
|
SortStr: "APPROVE_DATE desc"
|
||||||
|
}
|
||||||
|
let reqData: any = {
|
||||||
|
name: "",
|
||||||
|
value: encryptAES(JSON.stringify(req))
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await handleGetAPPLYAPPROVEList(reqData)
|
||||||
|
console.log('data', data);
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
return { data, success: true }
|
||||||
|
}
|
||||||
|
return { data: [], success: true }
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ProForm>
|
||||||
|
</Drawer>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default connect(({ user }: ConnectState) => ({ currentUser: user.data }))(InvoiceDetail);
|
||||||
@ -8,6 +8,7 @@ import { handleGetAppToken, handleGetBILLDETAILList, handleGetBILLList, handleGe
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { encryptAES } from "@/utils/handleAes";
|
import { encryptAES } from "@/utils/handleAes";
|
||||||
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
import { ProForm, ProFormSelect, ProFormTextArea } from "@ant-design/pro-components";
|
||||||
|
import InvoiceDetial from "./components/InvoiceDetial";
|
||||||
|
|
||||||
interface ConnectState {
|
interface ConnectState {
|
||||||
user: {
|
user: {
|
||||||
@ -55,6 +56,10 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
const [currentRow, setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
// 红冲悬浮框点击的加载效果
|
// 红冲悬浮框点击的加载效果
|
||||||
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
const [confirmLoading, setConfirmLoading] = useState<boolean>(false)
|
||||||
|
// 显示详情抽屉
|
||||||
|
const [showDetailModal, setShowDetailModal] = useState<boolean>(false)
|
||||||
|
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title: '服务区名称',
|
title: '服务区名称',
|
||||||
@ -79,6 +84,13 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
hideInSearch: true,
|
hideInSearch: true,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.BILL_NO ?
|
||||||
|
<a onClick={() => {
|
||||||
|
setCurrentRow(record)
|
||||||
|
setShowDetailModal(true)
|
||||||
|
}}>{record?.BILL_NO}</a> : ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '流水号',
|
title: '流水号',
|
||||||
@ -1143,6 +1155,8 @@ const RedReversal: React.FC<{ currentUser: any }> = (props) => {
|
|||||||
/> */}
|
/> */}
|
||||||
</ProForm>
|
</ProForm>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<InvoiceDetial showDetail={showDetailModal} setShowDetail={setShowDetailModal} parentRow={currentRow} setParentRow={setCurrentRow} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user