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

🐞fix: 修复采购询价详情bug

parent bcb9e3ed
......@@ -22,7 +22,7 @@ export interface PayPlatformPayConfig {
wayId?: any;
payType: number;
isPitchOn: number;
settlementWay: number;
settlementWay?: any;
settlementDays?: any;
settlementDate?: any;
}
......
import React, { useRef } from 'react';
import React, { useRef, useState } from 'react';
import { StandardTable } from 'god';
import Card from '../../../card';
import EyePreview from '@/components/EyePreview';
import DetailDrawer from '../../../detailDrawer';
export interface IPROPS {
id?: number,
......@@ -12,6 +13,62 @@ export interface IPROPS {
const MaterialLayout: React.FC<IPROPS> = (props: any) => {
const { id, number, fetch } = props;
const currentRef = useRef({});
const [visible, setVisible] = useState<boolean>(false)
const [dataSource, setDataSource] = useState<any>([]);
const handleClick = (item: any) => {
setDataSource([
{
linkTitle: '基本信息',
linkContent: [
{
label: '物料编号',
content: item.number
},
{
label: '物料名称',
content: item.name
},
{
label: '规格型号',
content: item.model
},
{
label: '品类',
content: item.category
},
{
label: '品牌',
content: item.brand
},
]
},
{
linkTitle: '采购数量',
linkContent: [
{
label: '单位',
content: item.unit
},
{
label: '采购数量',
content: item.purchaseCount
},
]
},
{
linkTitle: '附件',
linkContent: [
{
label: '附件',
file: item.urls ? true : false,
content: item.urls
},
]
}
])
setVisible(true);
}
const columns = [
{
title: '物料编号',
......@@ -22,7 +79,7 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
title: '物料名称',
key: 'name',
dataIndex: 'name',
render: (text: any, record: any) => <EyePreview type='button'>{text}</EyePreview>
render: (text: any, record: any) => <EyePreview type='button' handleClick={() => handleClick(record)}>{text}</EyePreview>
},
{
title: '规格型号',
......@@ -70,6 +127,12 @@ const MaterialLayout: React.FC<IPROPS> = (props: any) => {
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => productlist(params)}
/>
<DetailDrawer
title='物料信息'
visible={visible}
dataSource={dataSource}
onCalcel={() => setVisible(false)}
/>
</Card>
)
}
......
......@@ -26,7 +26,7 @@ export interface IProps {
const BidModal: React.FC<IProps> = (props: any) => {
const [form] = Form.useForm();
const { id, turn, visible, handleConfirm, onCancel } = props;
const [files, setFiles] = useState([]);
const [files, setFiles] = useState<any>([]);
const [loading, setloading] = useState(false);
const [priceParityInfos, setPriceParityInfos] = useState<any>([]);
const dataSource = useContext(BidDetailContext);
......@@ -40,7 +40,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
}
// 上传回调
const handleChange = ({ file }) => {
const arr: any = files;
const arr: any[] = files;
setloading(true);
if (file.response) {
if (file.response.code === 1000) {
......@@ -67,7 +67,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
const arr: any = dataSource[0].company || [];
const params: any = [];
arr.forEach((it: any, idx: number) => {
let item = {
let item: any = {
awardCount: it.awardCount,
id: it.id,
memberId: it.memberId,
......@@ -79,9 +79,9 @@ const BidModal: React.FC<IProps> = (props: any) => {
sumPrice: it.sumPrice,
awardInfoResponses: [],
}
let awardInfoResponses = [];
let awardInfoResponses: any[] = [];
dataSource.forEach((item: any, index: number) => {
let cItem = {
let cItem: any = {
brand: item.brand,
category: item.category,
goodsId: item.goodsId,
......@@ -144,7 +144,7 @@ const BidModal: React.FC<IProps> = (props: any) => {
</Form.Item>
<Form.Item label='附件' name='upload'>
<div className={style.upload_data}>
{files.length > 0 && files.map((v, index) => (
{files.length > 0 && files.map((v: any, index: number) => (
<div key={index} className={style.upload_item}>
<div className={style.upload_left}>
<LinkOutlined />
......
.drawerBox {
:global {
.ant-drawer-body {
padding: 0;
.ant-row {
height: 100%;
.ant-anchor {
padding-left: 0px;
.ant-anchor-ink {
display: none;
}
.ant-anchor-link {
padding: 12px 12px 12px 12px;
}
.ant-anchor-link-active {
box-sizing: border-box;
border-left: 2px solid #00B37A;
}
}
}
}
}
.affix_title {
font-size: 14px;
margin-bottom: 12px;
color: #909399;
.divider_style {
width: 2px;
height: 16px;
margin: 0px 5px 0px 0px ;
background-color: #00B37A;
}
}
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
}
import React from 'react';
import { Drawer, Anchor, Row, Col, Divider, Typography } from 'antd';
import style from './index.less';
import { LinkOutlined } from '@ant-design/icons';
const { Link } = Anchor;
interface IProps {
dataSource: any,
visible: boolean,
title?: string,
onOk?: () => void,
onCalcel?: () => void,
}
const DetailDrawer: React.FC<IProps> = (props: any) => {
const { dataSource, visible, title, onOk, onCalcel } = props;
return (
<Drawer
title={title}
placement='right'
visible={visible}
onClose={onCalcel}
width="40%"
className={style.drawerBox}
>
<Row>
<Col span={6}>
<Anchor>
{dataSource.map((item, index) => (
<Link key={`link${index + 1}`} href={`#link${index + 1}`} title={item.linkTitle} />
))}
</Anchor>
</Col>
<Col
span={18}
style={{
height: '100%',
padding: '16px',
overflowY: 'scroll',
borderLeft: '1px solid #F4F5F7',
}}
>
{dataSource.map((item, index) => (
<div key={`link${index + 1}`} id={`#link${index + 1}`}>
<div className={style.affixTitle}>
<Divider type="vertical" className={style.dividerStyle} />
{item.linkTitle}
</div>
{ item.linkContent.map((items, keys) => (
<div key={`content${keys + 1}`} className={style.list}>
<h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{items.label}</h5>
{ !items.file && <h5 className={style.listContent}>{items.content}</h5>}
{
items.file
&& (
<div className={style.upload_data}>
{items.content.length > 0 && items.content.map((v, index) => (
<div key={index} className={style.upload_item}>
<div className={style.upload_left}>
<Typography.Link href={v.url} target="_blank">
<LinkOutlined />
{v.name}
</Typography.Link>
</div>
</div>
))}
</div>
)}
</div>
))}
</div>
))}
</Col>
</Row>
</Drawer>
)
}
export default DetailDrawer;
import React, { Fragment, useEffect, useState } from 'react';
import { Tag, Badge, Tooltip, Button } from 'antd';
import { Tag, Badge, Tooltip, Button, Typography } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { GlobalConfig } from '@/global/config'
......@@ -17,7 +17,7 @@ import {
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
import { CheckCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { CheckCircleOutlined, LinkOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import MaterialLayout from '../../components/detail/components/materialLayout';
import DemandLayout from '../../components/detail/components/demandLayout';
import ModalOperate from '../../components/modalOperate';
......@@ -90,8 +90,8 @@ const DemandDetailed = () => {
{
label: '适用地市', extra: (
<div>
{areas.map((item: any, index: number) => (
<p key={`areas${index + 1}`}>{item}</p>
{data.areas.map((it: any, idx: number) => (
<p key={`areas${idx + 1}`}>{`${it.province}/${it.city}`}</p>
))}
</div>
)
......@@ -108,6 +108,22 @@ const DemandDetailed = () => {
{ label: '交付日期', extra: format(data.deliveryTime) },
{ label: '交付地址', extra: data.address },
{ label: '截止日期', extra: format(data.offerEndTime) },
{
label: '附件',
extra: <>
{data.transactionUurls.map((item: any, index: number) => (
<Typography.Link
style={{ display: 'block', paddingBottom: '8px' }}
key={`link_${index + 1}`}
href={`/api/order/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
target="_blank"
>
<LinkOutlined />
{item.name}
</Typography.Link>
))}
</>
},
]
},
{
......
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