Commit 7591115b authored by 卢均锐's avatar 卢均锐

feat: 采购竞价&在线竞价对接部分接口

parent 2368dfa9
......@@ -38,7 +38,7 @@ const ResultItem: React.FC<ResultItemPrpos> = (props: any) => {
</div>
<div className={styles.resultItemRow}>
<div className={styles.money}>¥{detail.price}<span>(含税)</span></div>
<Button type='link' onClick={checkDetailFunc}>查看报价明细</Button>
<Button type='link' onClick={() => {checkDetailFunc(detail.id)}}>查看报价明细</Button>
</div>
<Divider dashed style={{ color: '#EBECF0', margin: '6px 0' }} />
<div className={styles.resultItemRow}><div className={styles.label}>联系人姓名:</div><div className={styles.title}>{detail.contacts}</div></div>
......
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
\ No newline at end of file
import React, { useContext, useRef } from 'react';
import { Row, Col, Image, Tag, Tooltip, Switch, Typography } from 'antd';
import { StandardTable } from 'god';
import Card from '../../../card';
import { Context } from '../context';
import style from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
const TYPE = {
1: '发布至平台',
2: '系统匹配',
3: '邀请会员',
}
const ColStyle = {
display: 'flex',
alignItems: 'center',
border: '1px solid #1fbf87',
paddingTop: ' 6px',
paddingBottom: '6px',
margin: '5px',
borderRadius: '4px',
}
const TextStyle = {
color: '#1fbf87',
marginLeft: '10px',
}
export interface DemandLayoutIProps {
storeList?: any,
title?: string,
bidId: number,
number: string,
fetch?: () => Promise<unknown>
}
const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
const { storeList, title, bidId, number, fetch } = props;
const tableRef = useRef<any>({});
const context = useContext(Context);
const columns = [
{
title: '序号',
key: 'number',
dataIndex: 'number',
render: (text: any, record: any, index: number) => <>{index + 1}</>
},
{
title: '会员名称',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '会员类型',
key: 'memberTypeName',
dataIndex: 'memberTypeName',
},
{
title: '会员角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '会员等级',
key: 'levelTag',
dataIndex: 'levelTag',
},
{
title: '是否归属会员',
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (text: any) => (<Tag color={text ? 'success' : 'error'}>{text ? '是' : '否'}</Tag>)
},
{
title: (
<>
<span>需求发送</span>
<Tooltip placement="top" title='打开开关,审核通过后,将发送需求至选择的归属会员'>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (text: any) => (
<Switch checked={text} disabled={true} />
)
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
进入店铺
</Typography.Link>
)
},
]
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
fetch({ id: bidId, number: number, ...params }).then(res => {
resolve(res.data)
})
})
}
return (
<Card
id='demandLayout'
title='需求对接'
>
<div className={style.list}>
<h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{title}</h5>
<h5 className={style.listContent}>{TYPE[context.type]}</h5>
</div>
{context.type === 1
&& (
<Row gutter={[16, 16]}>
{storeList.map(item => (
<Col
span={6}
key={item.id}
style={ColStyle}
>
<Image width={32} height={32} src={item.logoUrl} />
<span style={TextStyle}>{item.name}</span>
</Col>
))}
</Row>
)}
{context.type !== 1
&& (
<StandardTable
currentRef={tableRef}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
/>
)}
</Card>
)
}
DemandLayout.defaultProps = {
title: '发布方式'
}
export default DemandLayout;
......@@ -60,8 +60,8 @@ interface Iprops {
effects?: string,
selectedRow?: boolean,
reload?: any,
externalStatusFetch?: any,
interiorStatusFetch?: any,
externalStatusFetch?: Promise<unknown>,
interiorStatusFetch?: Promise<unknown>,
}
const formActions = createFormActions();
const Table: React.FC<Iprops> = (props: any) => {
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -92,29 +91,15 @@ const ReadyBid = () => {
</>
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDREADYBID_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingStayBiddingList}
fetch={PublicApi.getPurchaseOnlineBiddingStayBiddingList}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -57,7 +56,7 @@ const ReadySignUp = () => {
</>,
width: 180
}, {
title: '竞价开始/结束时间',
title: '报名开始/结束时间',
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
......@@ -92,29 +91,15 @@ const ReadySignUp = () => {
</>
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDREADYSIGN_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingStayExamineBiddingSignup}
fetch={PublicApi.getPurchaseOnlineBiddingStayExamineBiddingSignup}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -20,8 +19,6 @@ const { Text } = Typography;
const Search = () => {
const ref = useRef<any>({});
const [id, setId] = useState<number>();
const [visible, setVisible] = useState<boolean>(false);
const columns: ColumnType<any>[] = [{
title: '序号',
align: 'center',
......@@ -67,7 +64,7 @@ const Search = () => {
key: 'isPrize',
dataIndex: 'isPrize',
render: (text: any, record: any) => <>
{(text !== 1 || text !== 0) ? null : <Tag color={BID_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag> }
{(text !== 1 && text !== 0) ? null : <Tag color={text ? 'success' : 'warning'}>{text ? '是' : '否'}</Tag> }
</>,
width: 180
}, {
......@@ -82,29 +79,15 @@ const Search = () => {
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDORDER_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingList}
fetch={PublicApi.getPurchaseOnlineBiddingList}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -16,7 +16,7 @@ const { Text } = Typography;
const formActions = createFormActions();
const QuotationDetailsDrawer = (props: any) => {
const { visible, onClose, schemaType, effects, reload } = props;
const { visible, onClose, schemaType, effects, reload, fetch, quotationDetailsId, number } = props;
const tableRef = useRef<any>({});
const columns: ColumnType<any>[] = [{
title: '序号',
......@@ -74,7 +74,7 @@ const QuotationDetailsDrawer = (props: any) => {
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
fetch({ ...params }).then(res => {
fetch({ id: quotationDetailsId, number: number, ...params }).then(res => {
resolve(res.data)
})
})
......@@ -120,9 +120,9 @@ const QuotationDetailsDrawer = (props: any) => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
}}
schema={
schemaType && SchemaRender()
}
// schema={
// schemaType && SchemaRender()
// }
>
</NiceForm>
}
......
......@@ -88,6 +88,11 @@ const ReadyExamineOne = () => {
setVisible(!visible);
}
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
......@@ -119,6 +124,7 @@ const ReadyExamineOne = () => {
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExamine1}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
</>
......
......@@ -87,6 +87,11 @@ const ReadyExamineTwo = () => {
setVisible(!visible);
}
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
......@@ -118,6 +123,7 @@ const ReadyExamineTwo = () => {
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExamine2}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
</>
......
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