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

🐞fix: 修复报价新增少传字段

parent d8f53be4
......@@ -12,7 +12,7 @@ const Key = () => {
const date = new Date();
const now = date.getTime();
//设置截止时间
const end = Number(sessionStorage.getItem('time'));
const end = sessionStorage.getItem('time') && Number(sessionStorage.getItem('time'));
//时间差
const leftTime = end - now;
......@@ -41,14 +41,9 @@ const Key = () => {
useEffect(() => {
getSecretKey();
countTime()
}, [])
useEffect(() => {
if (sessionStorage.getItem('time')) {
countTime()
}
}, [sessionStorage.getItem('time')])
return (
<PageHeaderWrapper>
<Card>
......
......@@ -95,8 +95,8 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
]
/** 物料信息 */
const fetchDataSource = (params: any) => {
fetch({ ...params }).then((res: any) => {
const fetchDataSource = async (params: any) => {
await fetch({ ...params }).then((res: any) => {
if (res.code !== 1000) {
return
}
......@@ -123,14 +123,23 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
}
}, [effect.turn])
const handleOnChange = async (key: any) => {
fetchDataSource({
id: effect.id,
turn: key,
current: '1',
pageSize: '10',
})
}
return (
<Card
id='bidInfoLayout'
title='报价信息'
>
<Tabs defaultActiveKey="1">
<Tabs defaultActiveKey="1" onChange={handleOnChange}>
{turn.map((item) => (
<Tabs.TabPane key={`trun${item}`} tab={`第${chNum[item]}轮`}>
<Tabs.TabPane key={item} tab={`第${chNum[item]}轮`}>
<Table
className={style.tableStyle}
columns={columns}
......
......@@ -99,8 +99,8 @@ const AddForm = () => {
if (basicRef.state && explainRef.state && offerRef.state && fileRef.state) {
const params = {
quotedDetails: basicRef.data.quotedDetails,
tel: basicRef.data.phone.tel,
telPrefix: basicRef.data.phone.telPrefix,
tel: basicRef.data.tel,
telPrefix: basicRef.data.telPrefix,
contacts: basicRef.data.contacts,
...explainRef.data,
detailss: offerRef.data,
......
......@@ -5,7 +5,9 @@ import {
Typography,
Select,
Tag,
Badge
Badge,
Row,
Col
} from 'antd';
import moment from 'moment';
import style from './index.less';
......@@ -48,10 +50,8 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
form.setFieldsValue({
quotedDetails: fetchdata.quotedDetails,
contacts: fetchdata.contacts,
phone: {
telPrefix: fetchdata.telPrefix,
tel: fetchdata.tel,
},
telPrefix: fetchdata.telPrefix,
tel: fetchdata.tel,
})
PublicApi.getManageCountryAreaGetTelCode().then(res => {
if (res.code === 1000) {
......@@ -80,6 +80,17 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
}
})
const userPhoneRule = (rule, value) => {
const RegExp = /^1[345678]\d{9}$/gi;
if (!value) {
return Promise.reject(new Error('请输入您的手机号'))
}
if (!RegExp.test(value)) {
return Promise.reject(new Error('手机号码格式不正确'))
}
return Promise.resolve();
}
return (
<Form
className={style.formStyle}
......@@ -115,30 +126,23 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
>
<Input maxLength={6} placeholder='最长12个字符,6个汉字' />
</Form.Item>
<Form.Item
label='联系人手机'
required
>
<Input.Group compact>
<Form.Item
name={['phone', 'telPrefix']}
noStyle
rules={[{ required: true, message: '请选择区号' }]}
>
<Select placeholder="+86">
{telCode.map((item:any) => (
<Option value={item}>{item}</Option>
))}
</Select>
</Form.Item>
<Form.Item
name={['phone', 'tel']}
noStyle
rules={[{ required: true, message: '请输入手机号码' }]}
>
<Input style={{ width: '50%' }} placeholder="请输入你的手机号码" />
</Form.Item>
</Input.Group>
<Form.Item label='联系人手机' colon={false} required={true} style={{ marginBottom: '0' }}>
<Row gutter={24}>
<Col span={7}>
<Form.Item name='telPrefix' rules={[{ required: true, message: '请选择区号' }]}>
<Select placeholder="+86">
{telCode.map((item: any) => (
<Option value={item}>{item}</Option>
))}
</Select>
</Form.Item>
</Col>
<Col span={17}>
<Form.Item name='tel' rules={[{ required: true, validator: userPhoneRule, }]}>
<Input placeholder="请输入你的手机号码" />
</Form.Item>
</Col>
</Row>
</Form.Item>
<Form.Item
label='报价单号'
......@@ -162,13 +166,13 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
label='外部状态'
name='externalState'
>
{ fetchdata && <Tag color={OFFTER_EXTERNALSTATE_COLOR[fetchdata.externalState]}>{OFFTER_EXTERNALSTATE[fetchdata.externalState]}</Tag> }
{fetchdata && <Tag color={OFFTER_EXTERNALSTATE_COLOR[fetchdata.externalState]}>{OFFTER_EXTERNALSTATE[fetchdata.externalState]}</Tag>}
</Form.Item>
<Form.Item
label='内部状态'
name='interiorState'
>
{ fetchdata && <Badge status={OFFTER_INTERNALSTATE_COLOR[fetchdata.interiorState]} text={OFFTER_INTERNALSTATE[fetchdata.interiorState]} /> }
{fetchdata && <Badge status={OFFTER_INTERNALSTATE_COLOR[fetchdata.interiorState]} text={OFFTER_INTERNALSTATE[fetchdata.interiorState]} />}
</Form.Item>
</Form>
......
......@@ -86,6 +86,13 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
title: '采购数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
render: (text: any, record: any) => (
<>
<Typography.Text>{text}</Typography.Text>
&nbsp;
<Typography.Text type="secondary">{`(${record.unit})`}</Typography.Text>
</>
)
},
{
title: '含税',
......@@ -176,11 +183,14 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
/** 确定关联商品 */
const handleConfirm = (params: any) => {
console.log(params, 10086)
const productAttributeJson = params.product.name.split('/').filter((_item, index) => index !== 0).join('/');
const data = [...dataSource];
data[index].productId = params.product.id;
data[index].customerCategoryName = params.product.customerCategoryName;
data[index].productName = params.product.name;
data[index].productBrand = params.product.brandName;
data[index].productAttributeJson = productAttributeJson;
data[index].enclosureUrls = params.files;
setDataSource(data)
setVisible(false);
}
......@@ -239,7 +249,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item name='count'>
<Radio.Group>
{tabs.length > 0 && tabs.map(item => {
console.log(item, 100856111)
return (
<Radio.Button key={item} value={item}>{item}</Radio.Button>
)
......@@ -270,7 +279,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>规格:</span>Q89YTE1</p>
<p><span>规格:</span>{record.productAttributeJson}</p>
<p><span>品类:</span>{record.customerCategoryName}</p>
</div>
</Col>
......
......@@ -39,7 +39,7 @@ const AddOffter = () => {
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/memberCenter/procurementAbility/offter/addOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
url={`/memberCenter/procurementAbility/offter/addOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}&turn=${record.turn}`}
>{text}</EyePreview>
<Text type='secondary'>{record.memberName}</Text>
</Space>
......@@ -56,8 +56,8 @@ const AddOffter = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'count',
dataIndex: 'count',
key: 'turn',
dataIndex: 'turn',
render: (text: any, record: any) => (
<>
<Rate
......@@ -79,12 +79,12 @@ const AddOffter = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}, {
title: '操作',
key: 'operate',
......
......@@ -77,7 +77,8 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
const handleConfirm = () => {
onClick({
product,
attribute
attribute,
files,
})
}
......@@ -106,6 +107,13 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
setFiles([...arr])
}
const removeFiles = (index: any) => {
console.log(index, 10086)
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
}
return (
<>
<Drawer
......@@ -276,8 +284,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
))}
</div>
))}
{/* 附件 */}
<div id='file'>
<Form.Item
......@@ -315,7 +321,7 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
<LinkOutlined />
<span>{v.name}</span>
</div>
<div className={style.upload_right}>
<div className={style.upload_right} onClick={() => removeFiles(index)}>
<DeleteOutlined />
</div>
</div>
......
......@@ -56,7 +56,7 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
const data = {
environment: 1,
shopType: 1,
// priceTypeList: [1]
// priceTypeList: [2]
}
PublicApi.getProductCommodityCommonGetCommodityListBySeller({ ...params, ...data }).then(res => {
resolve(res.data)
......
......@@ -26,7 +26,7 @@ const AuditOffterOne = () => {
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
......@@ -54,8 +54,8 @@ const AuditOffterOne = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'count',
dataIndex: 'count',
key: 'turn',
dataIndex: 'turn',
render: (text: any, record: any) => (
<>
<Rate
......@@ -77,12 +77,12 @@ const AuditOffterOne = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}, {
title: '操作',
key: 'operate',
......
......@@ -27,7 +27,7 @@ const AuditOffterTwo = () => {
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterTwo/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterTwo/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
......@@ -55,8 +55,8 @@ const AuditOffterTwo = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'count',
dataIndex: 'count',
key: 'turn',
dataIndex: 'turn',
render: (text: any, record: any) => (
<>
<Rate
......@@ -78,12 +78,12 @@ const AuditOffterTwo = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}, {
title: '操作',
key: 'operate',
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect, Fragment, useCallback } from 'react';
import { PublicApi } from '@/services/api';
import { history } from 'umi';
import moment from 'moment';
import { Tag, Badge, Button } from 'antd';
import { Tag, Badge, Button, Typography } from 'antd';
import { Context } from '../../components/detail/components/context';
import PeripheralLayout from '../../components/detail';
import ProgressLayout from '../../components/detail/components/progressLayout';
......@@ -18,7 +18,7 @@ import {
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
import { CheckCircleOutlined } from '@ant-design/icons';
import { CheckCircleOutlined, LinkOutlined } from '@ant-design/icons';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -32,7 +32,7 @@ const QuoteDetails = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const { query: { id, number }, pathname } = history.location;
const { query: { id, number, turn }, pathname } = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [dataSource, setDataSource] = useState<any>({});
......@@ -54,7 +54,7 @@ const QuoteDetails = () => {
col: [
{ label: '对应需求单号', extra: data.purchaseInquiryNo },
{ label: '需求会员', extra: data.memberName },
{ label: '联系人姓名', extra: '缺少字段' },
{ label: '联系人姓名', extra: data.contacts },
{ label: '联系人手机', extra: data.tel },
]
},
......@@ -71,7 +71,7 @@ const QuoteDetails = () => {
setOtherEffect([
{
col: [
{ label: '交付说明', extra: '缺少字段' },
{ label: '交付说明', extra: data.deliveryDetails },
{ label: '付款说明', extra: data.payDetails },
{ label: '税费说明', extra: data.taxes },
]
......@@ -85,7 +85,20 @@ const QuoteDetails = () => {
},
{
col: [
{ label: '附件', extra: '缺少字段' },
{
label: '附件',
extra: <>
{data.enclosureUrls.map((item: any, index: number) => (
<Typography.Link
key={`link_${index + 1}`}
href={`/api/order/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
>
<LinkOutlined />
{item.name}
</Typography.Link>
))}
</>
},
]
},
])
......@@ -146,7 +159,7 @@ const QuoteDetails = () => {
<BasicLayout effect={basicEffect} />
<BidInfoLayout
fetch={PublicApi.getPurchaseQuotedPriceMaterielDetailed}
effect={{turn: dataSource.count, id }}
effect={{ turn, id }}
/>
<OtherLayout effect={otherEffect} />
<RecordLyout />
......
......@@ -51,7 +51,7 @@ const Inquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '操作',
key: 'operate',
......
......@@ -26,7 +26,7 @@ const Offter = () => {
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/offter/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
......@@ -54,8 +54,8 @@ const Offter = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'count',
dataIndex: 'count',
key: 'turn',
dataIndex: 'turn',
render: (text: any, record: any) => (
<>
<Rate
......@@ -82,12 +82,12 @@ const Offter = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}];
return (
<Table
......
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