Commit a669033e authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 912c2d1c 4d454f70
......@@ -33,12 +33,14 @@ interface AddedFormLayoutProps {
title?: string,
/** 二次询价 */
two?: boolean,
/** 商城来询价 */
rfq?: boolean,
/** 二次询价地址显示 */
isDefault?: boolean
}
const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const { isEdit, id, fetchRequest, spam, title, two, shopId, isDefault } = props;
const { isEdit, id, fetchRequest, spam, title, two, shopId, rfq, isDefault } = props;
const [form] = Form.useForm();
const [loading, setLoading] = useState<boolean>(false)
const [unsaved, setUnsaved] = useState<boolean>(false);
......@@ -83,7 +85,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
setUnsaved(false);
setLoading(false);
if (two) {
if (two || rfq) {
history.push(`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry`)
return
}
......
......@@ -12,6 +12,7 @@ const RfqEnquiryOrder = (props: any) => {
title={props.route.name}
fetchRequest={postTransactionInquiryListAdd}
spam={spam_id}
rfq
/>
)
}
......
......@@ -4,7 +4,10 @@ import { ColumnType } from 'antd/lib/table';
import TableModal from '@/pages/transaction/components/tableModal';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { postProductCommodityGetCommoditySkuListByShopId } from '@/services/ProductV2Api';
import { getProductSelectGetSelectBrand, getProductSelectGetSelectCustomerCategory, postProductCommodityGetCommoditySkuListByShopId } from '@/services/ProductV2Api';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
const { onFormMount$ } = FormEffectHooks
export interface CollocationLayoutProps {
/** 活动类型 */
......@@ -122,6 +125,35 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
onConfirm(productList)
}
const useBusinessEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
getProductSelectGetSelectCustomerCategory({ }).then(res => {
const _enum = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
linkage.enum('customerCategoryId', _enum)
}).catch(error => {
console.warn(error)
})
getProductSelectGetSelectBrand({ }).then(res => {
const _enum = res.data.map(item => {
return {
label: item.name,
value: item.id,
}
})
linkage.enum('brandId', _enum)
}).catch(error => {
console.warn(error)
})
})
}
return (
<TableModal
modalType="Drawer"
......@@ -139,6 +171,7 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
effects={($, actions) => {
actions.reset()
useStateFilterSearchLinkageEffect($, actions, "commodityName", FORM_FILTER_PATH)
useBusinessEffects()
}}
schema={{
type: "object",
......
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