Commit 4cd9f946 authored by GuanHua's avatar GuanHua

fix: 商城询价单下单获取订单信息方式修改

parent 666412d4
import React, { useState, Fragment, useEffect } from "react";
import { Form, Button } from "antd";
import { Form, Button, message } from "antd";
import { history, Prompt } from 'umi';
import moment from 'moment';
import AddedLayout from "@/pages/transaction/components/detailLayout";
......@@ -108,10 +108,23 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
}
useEffect(() => {
const getCacheOrderInfoByKey = (key: string) => {
return new Promise((resolve) => {
PublicApi.getOrderCacheGet({ key }).then((res) => {
message.destroy()
if (res.data) {
resolve(JSON.parse(res.data))
} else {
resolve(undefined)
}
})
})
}
const init = async () => {
if (isEdit && spam) {
// const data: any = JSON.parse(sessionStorage.getItem(spam));
const data: any = getCookie(spam)
const data: any = await getCacheOrderInfoByKey(spam)
if (!data) return
const inquiryListProductRequests: any[] = [];
inquiryListProductRequests.push({
......@@ -163,6 +176,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
})
}
}
useEffect(() => {
init()
}, [isEdit])
return (
......
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