Commit 6e6afb94 authored by 前端-许冠华's avatar 前端-许冠华

Merge branch 'fix-v2' into 'v2'

fix: 修改新增询价报价BUG 报价单价提交为空的问题 See merge request linkseeks-design/pro-platform!40
parents d5daf6bd 1e43943f
......@@ -218,7 +218,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}}
>
<BasicInfoLayout getInquiryInfo={getInquiryInfo} inq={inquiry} isEdit={spam} />
<ProductQuoteLayout setProductQuote={productQuote} />
<ProductQuoteLayout setProductQuote={productQuote} form={form} />
<OtherExplainLayout getContacts={getContacts} />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
</Form>
......
......@@ -10,17 +10,20 @@ import moment from 'moment';
import { getAuth } from '@/utils/auth'
import { getTransactionProductQuotationHistoryList } from '@/services/TransactionV2Api';
import { getIntl } from 'umi';
import { FormInstance } from 'antd/es/form/Form';
interface ProductQuoteLayoutProps {
/** 回显 */
setProductQuote?: any[],
/** FormInstance */
form?: FormInstance
}
const intl = getIntl();
const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
const { setProductQuote } = props;
const { setProductQuote, form } = props;
const [dataSource, setDataSource] = useState<any[]>([]);
const [commoditySkuId, setCommoditySkuId] = useState();
const [visible, setVisible] = useState<boolean>(false);
......@@ -37,7 +40,9 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
v.money = count(v.purchaseCount, value);
}
})
console.log(dataSource)
form.setFieldsValue({
"inquiryListProductRequests": dataSource,
})
setDataSource([...dataSource]);
}
......@@ -202,7 +207,6 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
useEffect(() => {
if (!isEmpty(setProductQuote)) {
console.log(setProductQuote)
setDataSource([...setProductQuote])
}
}, [setProductQuote])
......@@ -223,8 +227,6 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
})
}, [commoditySkuId])
console.log(dataSource)
return (
<Card
id="productQuoteLayout"
......
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