Commit 34b56a47 authored by 前端-许佳敏's avatar 前端-许佳敏

fix:去掉theInvoiceInfo字段的传递,交给后端自行冗余

parent b9af4593
...@@ -9,6 +9,7 @@ export enum PageStatus { ...@@ -9,6 +9,7 @@ export enum PageStatus {
export const usePageStatus = () => { export const usePageStatus = () => {
const { preview, id = '', ...rest } = history.location.query const { preview, id = '', ...rest } = history.location.query
const lastTypeParams = history.location.pathname.substr(history.location.pathname.lastIndexOf('/'))
// 默认预览状态 // 默认预览状态
let pageStatus = PageStatus.PREVIEW let pageStatus = PageStatus.PREVIEW
if (preview === '1') { if (preview === '1') {
...@@ -25,6 +26,7 @@ export const usePageStatus = () => { ...@@ -25,6 +26,7 @@ export const usePageStatus = () => {
pageStatus, pageStatus,
id, id,
preview, preview,
lastTypeParams,
...rest, ...rest,
} }
} }
\ No newline at end of file
...@@ -108,7 +108,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -108,7 +108,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const [btnLoading, setBtnLoading] = useState(false) const [btnLoading, setBtnLoading] = useState(false)
const update = useUpdate() const update = useUpdate()
const [productSumPrice, setProductSumPrice] = useState<number>(0) const [productSumPrice, setProductSumPrice] = useState<number>(0)
const { pageStatus, id, page_type = '0', modelType, spam_id } = usePageStatus() const { pageStatus, id, page_type = '0', modelType, spam_id, lastTypeParams } = usePageStatus()
const [initFormValue, setInitFormValue] = useState<any>(() => { const [initFormValue, setInitFormValue] = useState<any>(() => {
let resultState = {} let resultState = {}
...@@ -162,6 +162,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -162,6 +162,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
try { try {
let fnResult = null let fnResult = null
// 可做新增/修改的判断
// if (lastTypeParams === 'add') {
// } else if (lastTypeParams === 'edit') {
// }
switch (page_type) { switch (page_type) {
case '0': { case '0': {
// 新增订单/编辑订单 // 新增订单/编辑订单
...@@ -186,7 +192,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -186,7 +192,10 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
...omit(value.deliveryAddresId, ['id']), ...omit(value.deliveryAddresId, ['id']),
// 冗余发票信息 // 冗余发票信息
theInvoiceId: value.theInvoiceId ? value.theInvoiceId.id : undefined, theInvoiceId: value.theInvoiceId ? value.theInvoiceId.id : undefined,
theInvoiceInfo: value.theInvoiceId || null
// 去掉该冗余字段的传递, 只做详情展示
// theInvoiceInfo: (value.typeof value.theInvoiceId === 'object' ? value.theInvoiceId : null
// theInvoiceInfo: value.theInvoiceInfo
} }
setBtnLoading(true) setBtnLoading(true)
fnResult = id ? await PublicApi.postOrderProcurementOrderUpdate({...params, id}) : await PublicApi.postOrderProcurementOrderAddReinsurancePolicy(params) fnResult = id ? await PublicApi.postOrderProcurementOrderUpdate({...params, id}) : await PublicApi.postOrderProcurementOrderAddReinsurancePolicy(params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment