Commit b8675138 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

修改需求发布,修改询价报价/商品询价

parent e74f8b48
...@@ -34,7 +34,7 @@ export const productModalByMemberSchema: ISchema = { ...@@ -34,7 +34,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component-props": { "x-component-props": {
placeholder: '请选择品类', placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ?? className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory, fetchSearch: PublicApi.getProductSelectGetMemberCategory,
style: { style: {
width: 160 width: 160
} }
...@@ -45,7 +45,7 @@ export const productModalByMemberSchema: ISchema = { ...@@ -45,7 +45,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component": 'SearchSelect', "x-component": 'SearchSelect',
"x-component-props": { "x-component-props": {
placeholder: '请选择品牌', placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand, fetchSearch: PublicApi.getProductSelectGetMemberBrand,
style: { style: {
width: 160 width: 160
} }
......
...@@ -146,11 +146,11 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => { ...@@ -146,11 +146,11 @@ const ModalTableOrder: React.FC<ModalTableProps> = (props) => {
}) })
break; break;
case 2: case 2:
PublicApi.getAsreplaceGoodspageToBeAddReturnByLogistics({...parmas}).then(res => { // PublicApi.getAsreplaceGoodspageToBeAddReturnByLogistics({...parmas}).then(res => {
if(res.code === 1000) { // if(res.code === 1000) {
resolve(res.data) // resolve(res.data)
} // }
}) // })
break; break;
case 3: case 3:
break; break;
......
...@@ -260,7 +260,7 @@ const detailInfo: React.FC<detailParams> = (props) => { ...@@ -260,7 +260,7 @@ const detailInfo: React.FC<detailParams> = (props) => {
title: '商品名称', title: '商品名称',
key: 'name', key: 'name',
dataIndex: 'name', dataIndex: 'name',
render: (text: any, record: any) => <EyePreview type='button' handleClick={() => {setanchorvisible(true);seteditdata(record)}}>{text}</EyePreview> render: (text: any, record: any) => <EyePreview type='button' handleClick={() => { setanchorvisible(true); seteditdata(record) }}>{text}</EyePreview>
}, },
{ {
title: '规格型号', title: '规格型号',
...@@ -292,29 +292,31 @@ const detailInfo: React.FC<detailParams> = (props) => { ...@@ -292,29 +292,31 @@ const detailInfo: React.FC<detailParams> = (props) => {
const fetchData = (params?: any) => { const fetchData = (params?: any) => {
return new Promise(resolve => { return new Promise(resolve => {
PublicApi.getOrderRequisitionFormProductList({id, ...params }).then(res => { PublicApi.getOrderRequisitionFormProductList({ id, ...params }).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
const arr: any[] = [] const arr: any[] = []
res.data.data.forEach((item: any, index: number) => { res.data.data.forEach((item: any, index: number) => {
const productAttributeJson = JSON.parse(item.productAttributeJson); if (item.productAttributeJson) {
let obj: any = {} const productAttributeJson = JSON.parse(item.productAttributeJson);
let newObj: any = {} let obj: any = {}
productAttributeJson.forEach((items: any) => { let newObj: any = {}
obj = { ...obj, ...items } productAttributeJson.forEach((items: any) => {
for (let key in obj) { obj = { ...obj, ...items }
newObj = { for (let key in obj) {
...newObj, ...{ newObj = {
[key]: obj[key].join(',') ...newObj, ...{
[key]: obj[key].join(',')
}
} }
arr.push({
title: key,
key,
dataIndex: key
})
} }
arr.push({ })
title: key, Object.assign(item, newObj)
key, }
dataIndex: key
})
}
})
Object.assign(item, newObj)
}) })
let attributeObj = {}; let attributeObj = {};
const attributeColumn = arr.reduce((item, next) => { const attributeColumn = arr.reduce((item, next) => {
...@@ -520,7 +522,7 @@ const detailInfo: React.FC<detailParams> = (props) => { ...@@ -520,7 +522,7 @@ const detailInfo: React.FC<detailParams> = (props) => {
{data.type === 1 && {data.type === 1 &&
<Form.Item name='shopIds' noStyle wrapperCol={{ span: 24 }}> <Form.Item name='shopIds' noStyle wrapperCol={{ span: 24 }}>
<Checkbox.Group disabled className={style.checkbox_wrap_style}> <Checkbox.Group disabled className={style.checkbox_wrap_style}>
<Row gutter={[24,24]}> <Row gutter={[24, 24]}>
{ {
goodAllIds.map((v: any, i: number) => { goodAllIds.map((v: any, i: number) => {
return ( return (
......
...@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
import { history } from 'umi'; import { history } from 'umi';
import ReutrnEle from '@/components/ReturnEle' import ReutrnEle from '@/components/ReturnEle'
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button, Card, Tabs } from 'antd'; import { Button, Card, Tabs, Badge } from 'antd';
import BasicInfo from './components/basicInfo'; import BasicInfo from './components/basicInfo';
import TradingConditions from './components/tradingConditions' import TradingConditions from './components/tradingConditions'
import FlowRecord from './components/flowRecord'; import FlowRecord from './components/flowRecord';
...@@ -11,6 +11,14 @@ import DemandDbutted from './components/demandDbutted'; ...@@ -11,6 +11,14 @@ import DemandDbutted from './components/demandDbutted';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
const { TabPane } = Tabs; const { TabPane } = Tabs;
const TabFormErrors = (props) => {
return (
<Badge size="small" count={props.dot} offset={[6, -5]}>
{props.children}
</Badge>
)
}
const AddDemandOrder: React.FC<{}> = () => { const AddDemandOrder: React.FC<{}> = () => {
const { id } = history.location.query; const { id } = history.location.query;
const [fetchdata, setfetchdata] = useState<any>({}); const [fetchdata, setfetchdata] = useState<any>({});
...@@ -18,6 +26,7 @@ const AddDemandOrder: React.FC<{}> = () => { ...@@ -18,6 +26,7 @@ const AddDemandOrder: React.FC<{}> = () => {
const [attribute, setattribute] = useState<Array<any>>([]); const [attribute, setattribute] = useState<Array<any>>([]);
const [externalState, setExternalState] = useState<any>([]); const [externalState, setExternalState] = useState<any>([]);
const [interiorState, setInteriorState] = useState<any>([]); const [interiorState, setInteriorState] = useState<any>([]);
const [badge, setbadge] = useState<any>([0, 0, 0, 0]);
useEffect(() => { useEffect(() => {
const external = new Promise(resolve => { const external = new Promise(resolve => {
//查询需求单外部状态枚举列表 //查询需求单外部状态枚举列表
...@@ -64,7 +73,7 @@ const AddDemandOrder: React.FC<{}> = () => { ...@@ -64,7 +73,7 @@ const AddDemandOrder: React.FC<{}> = () => {
} else { } else {
data.defaultAddres = 1 data.defaultAddres = 1
} }
if(id) { if (id) {
data.id = fetchdata.id; data.id = fetchdata.id;
PublicApi.postOrderRequisitionFormUpdate(data).then(res => { PublicApi.postOrderRequisitionFormUpdate(data).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
...@@ -90,27 +99,40 @@ const AddDemandOrder: React.FC<{}> = () => { ...@@ -90,27 +99,40 @@ const AddDemandOrder: React.FC<{}> = () => {
resolve(res.data) resolve(res.data)
} }
}) })
}).then((res:any) => { }).then((res: any) => {
setfetchdata(res) setfetchdata(res)
}) })
} }
}, [id]) }, [id])
/**获取所有地址 */ /**获取所有地址 */
const getAreaCode = (record:any) => { const getAreaCode = (record: any) => {
setGoodsInfo({...goodsInfo,record}) setGoodsInfo({ ...goodsInfo, record })
} }
/**获取添加的商品品类id */ /**获取添加的商品品类id */
const getCategoryIds = (data:any, record:any) => { const getCategoryIds = (data: any, index: number, record?: any) => {
const categoryIds: Array<any>[] = [] if (index === 1) {
data.forEach((item:any) => { const categoryIds: Array<any>[] = []
categoryIds.push(...item.ids) data.forEach((item: any) => {
}) categoryIds.push(...item.ids)
setGoodsInfo({...goodsInfo, categoryIds}) })
setattribute([...attribute, ...record]) setGoodsInfo({ ...goodsInfo, categoryIds })
if (record) {
setattribute([...attribute, ...record])
}
} else if(index === 2) {
console.log(data, 10086)
}
}
/**必填没填写出现角标 */
const getError = (num: number, idx: number) => {
const data = [...badge];
data[idx] = num;
setbadge(data);
} }
console.log(goodsInfo, 10086)
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()} onBack={() => history.goBack()}
...@@ -121,31 +143,35 @@ const AddDemandOrder: React.FC<{}> = () => { ...@@ -121,31 +143,35 @@ const AddDemandOrder: React.FC<{}> = () => {
> >
<Card> <Card>
<Tabs type='card'> <Tabs type='card'>
<TabPane forceRender tab='基本信息' key='1'> <TabPane forceRender tab={<TabFormErrors dot={badge[0]}>基本信息</TabFormErrors>} key='1'>
<BasicInfo <BasicInfo
set={fetchdata} set={fetchdata}
onBadge={getError}
onGet={getAreaCode} onGet={getAreaCode}
currentRef={basic} currentRef={basic}
externalState={externalState} externalState={externalState}
interiorState={interiorState} interiorState={interiorState}
/> />
</TabPane> </TabPane>
<TabPane forceRender tab='添加商品' key='2'> <TabPane forceRender tab={<TabFormErrors dot={badge[1]}>添加商品</TabFormErrors>} key='2'>
<AddGoods <AddGoods
set={fetchdata} set={fetchdata}
onBadge={getError}
onGet={getCategoryIds} onGet={getCategoryIds}
currentRef={goods} currentRef={goods}
/> />
</TabPane> </TabPane>
<TabPane forceRender tab='交易条件' key='3'> <TabPane forceRender tab={<TabFormErrors dot={badge[2]}>交易条件</TabFormErrors>} key='3'>
<TradingConditions <TradingConditions
set={fetchdata} set={fetchdata}
onBadge={getError}
currentRef={trading} currentRef={trading}
/> />
</TabPane> </TabPane>
<TabPane forceRender tab='需求对接' key='4'> <TabPane forceRender tab={<TabFormErrors dot={badge[3]}>需求对接</TabFormErrors>} key='4'>
<DemandDbutted <DemandDbutted
set={fetchdata} set={fetchdata}
onBadge={getError}
goodsInfo={goodsInfo} goodsInfo={goodsInfo}
attribute={attribute} attribute={attribute}
currentRef={dbutted} currentRef={dbutted}
......
...@@ -151,6 +151,7 @@ const ModalAnchor: React.FC<anchorParams> = (props) => { ...@@ -151,6 +151,7 @@ const ModalAnchor: React.FC<anchorParams> = (props) => {
visible={visible} visible={visible}
onCancel={() => onCancel()} onCancel={() => onCancel()}
onOk={onSubmit} onOk={onSubmit}
footer={props.disable && null}
> >
<Layout> <Layout>
<Sider width={159} className={style.site_layout_background}> <Sider width={159} className={style.site_layout_background}>
......
...@@ -30,6 +30,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -30,6 +30,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
const [loading, setloading] = useState(false); const [loading, setloading] = useState(false);
const [files, setFiles] = useState([]); const [files, setFiles] = useState([]);
const [category, setcategory] = useState<Array<any>>([]); const [category, setcategory] = useState<Array<any>>([]);
const [selected, setselected] = useState<string>('')
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' }); const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id', type: 'radio' });
const [visibleChannelGoods, setvisibleChannelGoods] = useState<boolean>(false); const [visibleChannelGoods, setvisibleChannelGoods] = useState<boolean>(false);
const [goods, setGoods] = useState<any>({}) const [goods, setGoods] = useState<any>({})
...@@ -42,6 +43,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -42,6 +43,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
} }
}) })
}).then((data: any) => { }).then((data: any) => {
console.log(data)
setcategory(data) setcategory(data)
}) })
} }
...@@ -57,10 +59,12 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -57,10 +59,12 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
code: fetchdata.goodsNo code: fetchdata.goodsNo
} }
PublicApi.getProductGoodsGetGoodsList({ ...params }).then(res => { PublicApi.getProductGoodsGetGoodsList({ ...params }).then((res: any) => {
const { data } = res const { data } = res.data
RowCtl.setSelectRow(data.data) if (data.length > 0) {
RowCtl.setSelectedRowKeys([data.data[0].id]) RowCtl.setSelectRow(data)
RowCtl.setSelectedRowKeys([data[0].id])
}
}) })
form.setFieldsValue({ form.setFieldsValue({
model: fetchdata.model, model: fetchdata.model,
...@@ -68,7 +72,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -68,7 +72,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
unit: fetchdata.unit, unit: fetchdata.unit,
purchaseCount: fetchdata.purchaseCount, purchaseCount: fetchdata.purchaseCount,
name: fetchdata.name, name: fetchdata.name,
category: fetchdata.category, category: fetchdata.ids,
goodsNo: fetchdata.goodsNo, goodsNo: fetchdata.goodsNo,
}) })
} }
...@@ -76,13 +80,17 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -76,13 +80,17 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
/**提交表单 */ /**提交表单 */
const onSubmit = (value: any) => { const onSubmit = (value: any) => {
form.validateFields().then(res => { form.validateFields().then(res => {
console.log(rowSelection, RowCtl, 10086)
const data = { const data = {
...res, goodsNo: goods.code,
goodsId: goods.id, name: goods.name,
goodsName: goods.name category: selected,
ids: res.category,
brand: res.brand,
model: res.model,
purchaseCount: res.purchaseCount,
unit: res.unit
} }
onOk(res, goods) onOk(data)
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
}) })
...@@ -108,13 +116,13 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -108,13 +116,13 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
title: '品类', title: '品类',
key: 'customerCategory', key: 'customerCategory',
dataIndex: 'customerCategory', dataIndex: 'customerCategory',
render: (text: any) => <span>{Object.keys(text).length > 0 && text.name}</span> render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
}, },
{ {
title: '品牌', title: '品牌',
key: 'brand', key: 'brand',
dataIndex: 'brand', dataIndex: 'brand',
render: (text: any) => <span>{Object.keys(text).length > 0 && text.name}</span> render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
}, },
{ {
title: '单位', title: '单位',
...@@ -145,14 +153,23 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -145,14 +153,23 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
name: data.name, name: data.name,
model: data.type, model: data.type,
category: ids.join(',').split(','), category: ids.join(',').split(','),
brand: data.brand.name, brand: data.brand && data.brand.name,
unit: data.unitName, unit: data.unitName,
}) })
} }
/**查询品类信息--包括品类、属性、属性值 */
const getCategoryById = (val: any, selectedOptions?: any) => {
if (selectedOptions.length > 0) {
const name = selectedOptions[selectedOptions.length - 1];
setselected(name.title)
}
}
return ( return (
<> <>
<Modal <Modal
title='通过平台属性添加' title='选择货品添加'
width='800px' width='800px'
destroyOnClose destroyOnClose
wrapClassName={style.modal_wrap_className} wrapClassName={style.modal_wrap_className}
...@@ -194,6 +211,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => { ...@@ -194,6 +211,7 @@ const ModalGoods: React.FC<goodsParams> = (props) => {
fieldNames={{ label: 'title', value: 'id', children: 'children' }} fieldNames={{ label: 'title', value: 'id', children: 'children' }}
placeholder="请选择品类" placeholder="请选择品类"
notFoundContent={<Spin size="small" />} notFoundContent={<Spin size="small" />}
onChange={getCategoryById}
/> />
</Form.Item> </Form.Item>
<Form.Item label='货品品牌' name='brand'><Input /></Form.Item> <Form.Item label='货品品牌' name='brand'><Input /></Form.Item>
......
...@@ -16,10 +16,11 @@ const layout: any = { ...@@ -16,10 +16,11 @@ const layout: any = {
export interface faceSetData { export interface faceSetData {
set?: any, set?: any,
onGet?: Function, onGet?: Function,
currentRef: any currentRef: any,
onBadge?: Function
} }
const AddGoods: React.FC<faceSetData> = (props) => { const AddGoods: React.FC<faceSetData> = (props) => {
const { set, currentRef, onGet } = props const { set, currentRef, onGet, onBadge } = props
const [form] = Form.useForm(); const [form] = Form.useForm();
const [addMode, setaddMode] = useState<number>(0); const [addMode, setaddMode] = useState<number>(0);
const btnname: Array<string> = ['添加商品', '选择货品', '导入货品'] const btnname: Array<string> = ['添加商品', '选择货品', '导入货品']
...@@ -71,7 +72,7 @@ const AddGoods: React.FC<faceSetData> = (props) => { ...@@ -71,7 +72,7 @@ const AddGoods: React.FC<faceSetData> = (props) => {
render: (text: any, record: any, index: number) => render: (text: any, record: any, index: number) =>
<> <>
<Button type='link' onClick={() => handleEdit(record, index)}>编辑</Button> <Button type='link' onClick={() => handleEdit(record, index)}>编辑</Button>
<Button type='link'>删除</Button> <Button type='link' onClick={() => handleDel(record, index)}>删除</Button>
</> </>
} }
] ]
...@@ -99,13 +100,15 @@ const AddGoods: React.FC<faceSetData> = (props) => { ...@@ -99,13 +100,15 @@ const AddGoods: React.FC<faceSetData> = (props) => {
const handleSubmit = (data: any, record?: any) => { const handleSubmit = (data: any, record?: any) => {
if (idx === -1) { if (idx === -1) {
settabledata([...tabledata, data]) settabledata([...tabledata, data])
onGet([...tabledata, data], 1, record)
} else { } else {
console.log(data)
const newdata = [...tabledata] const newdata = [...tabledata]
newdata[idx] = data newdata[idx] = data
settabledata([...newdata]); settabledata([...newdata]);
setidx(-1); setidx(-1);
onGet([...tabledata, data], 2)
} }
onGet([...tabledata, data], record)
handleModal(addMode); handleModal(addMode);
} }
/** 编辑商品 */ /** 编辑商品 */
...@@ -116,6 +119,13 @@ const AddGoods: React.FC<faceSetData> = (props) => { ...@@ -116,6 +119,13 @@ const AddGoods: React.FC<faceSetData> = (props) => {
handleModal(addMode) handleModal(addMode)
} }
/** 删除商品 */
const handleDel = (record: any, index: number) => {
const list = [...tabledata];
list.splice(index, 1);
settabledata(list)
}
useEffect(() => { useEffect(() => {
currentRef.current = { currentRef.current = {
get: () => new Promise((resolve: any) => { get: () => new Promise((resolve: any) => {
...@@ -128,8 +138,11 @@ const AddGoods: React.FC<faceSetData> = (props) => { ...@@ -128,8 +138,11 @@ const AddGoods: React.FC<faceSetData> = (props) => {
requisitionFormProducts: tabledata, requisitionFormProducts: tabledata,
} }
}) })
onBadge(0, 1)
}).catch(error => { }).catch(error => {
console.log(error) if (error && error.errorFields) {
onBadge(error.errorFields.length, 1)
}
}) })
}) })
} }
...@@ -161,7 +174,7 @@ const AddGoods: React.FC<faceSetData> = (props) => { ...@@ -161,7 +174,7 @@ const AddGoods: React.FC<faceSetData> = (props) => {
{addMode > 0 && {addMode > 0 &&
<Form.Item noStyle> <Form.Item noStyle>
<Button onClick={() => { handleModal(addMode); setisEdit(false) }} type='dashed' block style={{ marginBottom: '24px' }}><PlusOutlined />{handleText(addMode)}</Button> <Button onClick={() => { handleModal(addMode); setisEdit(false) }} type='dashed' block style={{ marginBottom: '24px' }}><PlusOutlined />{handleText(addMode)}</Button>
<Table columns={columns} dataSource={tabledata} rowKey={(record:any, index:number) => record.id ? record.id : index} /> <Table columns={columns} dataSource={tabledata} rowKey={(record: any, index: number) => record.id ? record.id : index} />
</Form.Item> </Form.Item>
} }
<ModalAnchor <ModalAnchor
......
...@@ -19,13 +19,14 @@ export interface faceSetData { ...@@ -19,13 +19,14 @@ export interface faceSetData {
onGet?: Function, onGet?: Function,
currentRef?: any, currentRef?: any,
externalState?:any, externalState?:any,
interiorState?: any interiorState?: any,
onBadge?: Function
} }
const { Option } = Select; const { Option } = Select;
const BasicInfo: React.FC<faceSetData> = (props) => { const BasicInfo: React.FC<faceSetData> = (props) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const { set, onGet, currentRef, externalState, interiorState } = props const { set, onGet, currentRef, externalState, interiorState, onBadge } = props
const [province, setprovince] = useState<any>([]);// 省列表 const [province, setprovince] = useState<any>([]);// 省列表
const [city, setcity] = useState<any>([]);// 市列表 const [city, setcity] = useState<any>([]);// 市列表
const [requisitionFormAddress, setrequisitionFormAddress] = useState<any>([{ const [requisitionFormAddress, setrequisitionFormAddress] = useState<any>([{
...@@ -184,8 +185,11 @@ const BasicInfo: React.FC<faceSetData> = (props) => { ...@@ -184,8 +185,11 @@ const BasicInfo: React.FC<faceSetData> = (props) => {
requisitionFormAddress, requisitionFormAddress,
} }
}) })
onBadge(0, 0)
}).catch(error => { }).catch(error => {
console.log(error) if (error && error.errorFields) {
onBadge(error.errorFields.length, 0)
}
}) })
}) })
} }
......
...@@ -21,10 +21,11 @@ export interface faceSetData { ...@@ -21,10 +21,11 @@ export interface faceSetData {
get?: Function, get?: Function,
goodsInfo?: any, goodsInfo?: any,
attribute?:any, attribute?:any,
currentRef?: any currentRef?: any,
onBadge?: Function
} }
const DemandDbutted: React.FC<faceSetData> = (props) => { const DemandDbutted: React.FC<faceSetData> = (props) => {
const { set, get, currentRef, goodsInfo, attribute } = props; const { set, get, currentRef, goodsInfo, attribute, onBadge } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [type, setType] = useState<Number>(0); const [type, setType] = useState<Number>(0);
const ref = useRef<any>({}); const ref = useRef<any>({});
...@@ -199,8 +200,11 @@ const DemandDbutted: React.FC<faceSetData> = (props) => { ...@@ -199,8 +200,11 @@ const DemandDbutted: React.FC<faceSetData> = (props) => {
...buttedObj ...buttedObj
} }
}) })
onBadge(0, 3)
}).catch(error => { }).catch(error => {
console.log(error) if (error && error.errorFields) {
onBadge(error.errorFields.length, 3)
}
}) })
}) })
} }
......
...@@ -12,10 +12,11 @@ const layout: any = { ...@@ -12,10 +12,11 @@ const layout: any = {
export interface faceSetData { export interface faceSetData {
set?: any, set?: any,
get?: Function, get?: Function,
currentRef?: any currentRef?: any,
onBadge?: Function
} }
const TradingConditions: React.FC<faceSetData> = (props) => { const TradingConditions: React.FC<faceSetData> = (props) => {
const { set, get, currentRef } = props const { set, get, currentRef,onBadge } = props
const [TradingConditionsForm] = Form.useForm(); const [TradingConditionsForm] = Form.useForm();
const [address, setAddress] = useState([]); const [address, setAddress] = useState([]);
const [selectAddress, setselectAddress] = useState<any>({}); const [selectAddress, setselectAddress] = useState<any>({});
...@@ -48,8 +49,11 @@ const TradingConditions: React.FC<faceSetData> = (props) => { ...@@ -48,8 +49,11 @@ const TradingConditions: React.FC<faceSetData> = (props) => {
taxes: res.taxes, taxes: res.taxes,
} }
}) })
onBadge(0, 2)
}).catch(error => { }).catch(error => {
console.log(error) if (error && error.errorFields) {
onBadge(error.errorFields.length, 2)
}
}) })
}) })
} }
...@@ -135,4 +139,4 @@ const TradingConditions: React.FC<faceSetData> = (props) => { ...@@ -135,4 +139,4 @@ const TradingConditions: React.FC<faceSetData> = (props) => {
) )
} }
export default TradingConditions export default TradingConditions
\ No newline at end of file
...@@ -4,8 +4,8 @@ import {TimeList, filterExternalStateLabelList, filterInternalStateLabelList} fr ...@@ -4,8 +4,8 @@ import {TimeList, filterExternalStateLabelList, filterInternalStateLabelList} fr
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
/** /**
* @description: 待审核询价单 * @description: 待审核询价单
* @param {type} * @param {type}
* @return {type} * @return {type}
*/ */
export const pendingReviewSchema: ISchema = { export const pendingReviewSchema: ISchema = {
type:'object', type:'object',
...@@ -78,36 +78,36 @@ export const pendingReviewSchema: ISchema = { ...@@ -78,36 +78,36 @@ export const pendingReviewSchema: ISchema = {
}, },
enum: TimeList enum: TimeList
}, },
externalState:{ // externalState:{
type:'string', // type:'string',
"x-component": 'Select', // "x-component": 'Select',
"x-component-props":{ // "x-component-props":{
placeholder:'外部状态', // placeholder:'外部状态',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ?? // className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getOrderProductInquiryExternalStateEnum, // fetchSearch: PublicApi.getOrderProductInquiryExternalStateEnum,
style: { // style: {
width: 160 // width: 160
} // }
}, // },
}, // },
interiorState :{ // interiorState :{
type:'string', // type:'string',
"x-component": 'Select', // "x-component": 'Select',
"x-component-props":{ // "x-component-props":{
placeholder:'内部状态', // placeholder:'内部状态',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ?? // className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getOrderProductInquiryInteriorStateEnum, // fetchSearch: PublicApi.getOrderProductInquiryInteriorStateEnum,
style: { // style: {
width: 160 // width: 160
} // }
}, // },
}, // },
} }
}, },
sumbit:{ sumbit:{
"x-component":'Submit', "x-component":'Submit',
"x-mega-props":{ "x-mega-props":{
span:1 span:1
}, },
"x-component-props":{ "x-component-props":{
children:'查询' children:'查询'
......
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