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

🐞fix: 修改二轮报价列表显示的问题

parent e1fa60b2
...@@ -6,9 +6,15 @@ import { PublicApi } from '@/services/api'; ...@@ -6,9 +6,15 @@ import { PublicApi } from '@/services/api';
import style from './index.less'; import style from './index.less';
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons'; import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
export type effectType = {
/** 报价轮次 */
turn?: number,
/** 订单Id */
id: number,
}
export interface BidInfoProps { export interface BidInfoProps {
fetch?: () => Promise<unknown>, fetch?: () => Promise<unknown>,
effect?: any, effect?: effectType,
} }
const chNum: { [key: number]: string } = { const chNum: { [key: number]: string } = {
...@@ -132,6 +138,11 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => { ...@@ -132,6 +138,11 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
}) })
} }
const splitProductAttributeJson = (name: string,num: number) => {
const arr = name.split('-');
return arr[num]
}
return ( return (
<Card <Card
id='bidInfoLayout' id='bidInfoLayout'
...@@ -162,8 +173,8 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => { ...@@ -162,8 +173,8 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
</Col> </Col>
<Col span={6}> <Col span={6}>
<div className={style.childrenContent}> <div className={style.childrenContent}>
<p><span>规格:</span>-</p> <p><span>规格:</span>{splitProductAttributeJson(record.productAttributeJson, 0)}</p>
<p><span>品类:</span>-</p> <p><span>品类:</span>{splitProductAttributeJson(record.productAttributeJson, 1)}</p>
</div> </div>
</Col> </Col>
<Col span={6}> <Col span={6}>
......
...@@ -55,6 +55,7 @@ const AddForm = () => { ...@@ -55,6 +55,7 @@ const AddForm = () => {
const fileInfo: any = { ...file }; const fileInfo: any = { ...file };
basicInfo.id = params.purchaseInquiryId || params.id; basicInfo.id = params.purchaseInquiryId || params.id;
basicInfo.number = params.purchaseInquiryNo; basicInfo.number = params.purchaseInquiryNo;
basicInfo.contacts = params.contacts;
basicInfo.purchaseInquiryNo = params.purchaseInquiryNo; basicInfo.purchaseInquiryNo = params.purchaseInquiryNo;
basicInfo.quotedPriceNo = params.quotedPriceNo; basicInfo.quotedPriceNo = params.quotedPriceNo;
basicInfo.memberName = params.memberName; basicInfo.memberName = params.memberName;
...@@ -62,12 +63,13 @@ const AddForm = () => { ...@@ -62,12 +63,13 @@ const AddForm = () => {
basicInfo.createTime = params.createTime; basicInfo.createTime = params.createTime;
basicInfo.externalState = params.externalState; basicInfo.externalState = params.externalState;
basicInfo.interiorState = params.interiorState; basicInfo.interiorState = params.interiorState;
offerInfo.count = params.count || 0;
offerInfo.id = params.id; offerInfo.id = params.id;
if (params.count) { if (path === 'edit') {
offerInfo.materiels = params.quotedPriceProducts; offerInfo.materiels = params.quotedPriceProducts;
offerInfo.count = params.count;
} else { } else {
offerInfo.materiels = params.materiels; offerInfo.materiels = params.materiels;
offerInfo.turn = params.turn;
} }
/** 修改才有回显下面这些的 */ /** 修改才有回显下面这些的 */
if (path === 'edit') { if (path === 'edit') {
...@@ -85,7 +87,6 @@ const AddForm = () => { ...@@ -85,7 +87,6 @@ const AddForm = () => {
setbasic(basicInfo); setbasic(basicInfo);
setoffer(offerInfo); setoffer(offerInfo);
setexplain(explainInfo); setexplain(explainInfo);
console.log(res.data, 10086)
} }
}) })
}, []) }, [])
......
...@@ -36,7 +36,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -36,7 +36,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const [record, setRecord] = useState<any>({}); const [record, setRecord] = useState<any>({});
const [index, setIndex] = useState<number>(); const [index, setIndex] = useState<number>();
const [data, setData] = useState<any>({}); const [data, setData] = useState<any>({});
const [dataSource, setDataSource] = useState<any>([]);
const [idx, setIdx] = useState<number>(0); const [idx, setIdx] = useState<number>(0);
/** 修改税率&单价 */ /** 修改税率&单价 */
...@@ -107,7 +106,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -107,7 +106,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item <Form.Item
name={`isTax${index}`} name={`isTax${index}`}
style={{ margin: 0 }} style={{ margin: 0 }}
initialValue={text}
rules={[{ required: true, message: '请选择' }]} rules={[{ required: true, message: '请选择' }]}
> >
<Select <Select
...@@ -129,7 +127,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -129,7 +127,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item <Form.Item
style={{ margin: 0 }} style={{ margin: 0 }}
name={`taxProbability${index}`} name={`taxProbability${index}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]} rules={[{ required: true, message: '请输入' }]}
> >
<Input <Input
...@@ -149,7 +146,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -149,7 +146,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item <Form.Item
style={{ margin: 0 }} style={{ margin: 0 }}
name={`taxUnitPrice${index}`} name={`taxUnitPrice${index}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]} rules={[{ required: true, message: '请输入' }]}
> >
<Input <Input
...@@ -194,13 +190,23 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -194,13 +190,23 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
query[index].customerCategoryName = params.product.customerCategoryName; query[index].customerCategoryName = params.product.customerCategoryName;
query[index].productName = params.product.name; query[index].productName = params.product.name;
query[index].productBrand = params.product.brandName; query[index].productBrand = params.product.brandName;
query[index].productAttributeJson = productAttributeJson; query[index].productAttributeJson = `${productAttributeJson}-${params.product.customerCategoryName}`;
query[index].enclosureUrls = params.files; query[index].enclosureUrls = params.files;
param[idx] = [...query]; param[idx] = [...query];
setData(param) setData(param)
setVisible(false); setVisible(false);
} }
const setFieldsValueFn = (params: any) => {
params.forEach((it: any, i: number) => {
form.setFieldsValue({
['isTax' + i]: it.isTax,
['taxProbability' + i]: it.taxProbability,
['taxUnitPrice' + i]: it.taxUnitPrice
})
})
}
const fetchTableData = (turn: any, index: number) => { const fetchTableData = (turn: any, index: number) => {
const params = { const params = {
id: fetchdata.id, id: fetchdata.id,
...@@ -210,14 +216,31 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -210,14 +216,31 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
} }
const param = { ...data }; const param = { ...data };
if (name === 'quote') { if (name === 'quote') {
param[index] = fetchdata.materiels; PublicApi.getPurchasePurchaseInquiryGetMaterielsByPurchaseInquiryId({ ...params }).then((res: any) => {
setData({ ...param }); if (res.code !== 1000) {
return
}
if (res.data.data.length > 0) {
console.log(1)
param[index] = [...res.data.data];
if (param[index]) {
setFieldsValueFn(param[index])
}
} else {
console.log(2)
param[index] = fetchdata.materiels;
}
setData({ ...param });
})
} else { } else {
PublicApi.getPurchaseQuotedPriceMaterielDetailed({ ...params }).then((res: any) => { PublicApi.getPurchaseQuotedPriceMaterielDetailed({ ...params }).then((res: any) => {
if (res.code !== 1000) { if (res.code !== 1000) {
return return
} }
param[index] = [...res.data.data]; param[index] = [...res.data.data];
if (param[index]) {
setFieldsValueFn(param[index])
}
setData({ ...param }); setData({ ...param });
}) })
} }
...@@ -226,25 +249,23 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -226,25 +249,23 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
useEffect(() => { useEffect(() => {
if (fetchdata.id) { if (fetchdata.id) {
const isTurn = fetchdata.count ? fetchdata.count : 1; const isTurn = fetchdata.turn ? fetchdata.turn : 1;
fetchTableData(isTurn, 0) fetchTableData(isTurn, 0)
} }
console.log(fetchdata.count, 10086) let aCount = 0;
if (fetchdata.count || fetchdata.count === 0) { if (fetchdata.turn) {
let aCount = 0; aCount = (fetchdata.turn + 1)
if (name === 'edit') { } else {
aCount = fetchdata.count ? (fetchdata.count + 1) : 1; aCount = 1
} else if (name === 'quote') { }
aCount = fetchdata.count ? (fetchdata.count + 1) : 1; if (name === 'edit') {
} aCount = fetchdata.count ? (fetchdata.count + 1) : 1;
form.setFieldsValue({
count: aCount
})
setCount(aCount);
handleTabs(aCount);
} }
form.setFieldsValue({
count: aCount
})
setCount(aCount);
handleTabs(aCount);
}, [fetchdata]) }, [fetchdata])
useEffect(() => { useEffect(() => {
...@@ -253,7 +274,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -253,7 +274,6 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
form.validateFields().then(res => { form.validateFields().then(res => {
const detailss: any = []; const detailss: any = [];
data[0].forEach(item => { data[0].forEach(item => {
console.log(item, 10086)
detailss.push({ detailss.push({
purchaseInquiryDetailsId: name === 'quote' ? item.id : item.purchaseInquiryDetailsId, purchaseInquiryDetailsId: name === 'quote' ? item.id : item.purchaseInquiryDetailsId,
taxUnitPrice: item.taxUnitPrice, taxUnitPrice: item.taxUnitPrice,
...@@ -263,7 +283,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -263,7 +283,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
productId: item.productId, productId: item.productId,
goodsId: item.goodsId, goodsId: item.goodsId,
productBrand: item.productBrand, productBrand: item.productBrand,
productAttributeJson: `${item.productAttributeJson}-${item.customerCategoryName}`, productAttributeJson: item.productAttributeJson,
}) })
}) })
resolve({ resolve({
...@@ -283,21 +303,28 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -283,21 +303,28 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const handleRadioGroup = (e) => { const handleRadioGroup = (e) => {
const params = { ...data }; const params = { ...data };
const { value } = e.target; const { value } = e.target;
const index = e.target['data-index'] const index = e.target['data-index'];
setCount(value);
setIdx(index); setIdx(index);
setCount(value);
if (!params[index]) { if (!params[index]) {
const isTurn = value === 1 ? 1 : value - 1 const isTurn = value === 1 ? 1 : value - 1
fetchTableData(isTurn, index) fetchTableData(isTurn, index)
} else {
setFieldsValueFn(params[index])
} }
} }
const splitProductAttributeJson = (name: string, num: number) => {
const arr = name.split('-');
return arr[num]
}
return ( return (
<Form <Form
form={form} form={form}
className={style.offerStyle} className={style.offerStyle}
> >
<Form.Item name='count'> <Form.Item name='count' initialValue={count}>
<Radio.Group onChange={handleRadioGroup}> <Radio.Group onChange={handleRadioGroup}>
{tabs.length > 0 && tabs.map((item, index: any) => { {tabs.length > 0 && tabs.map((item, index: any) => {
return ( return (
...@@ -330,8 +357,8 @@ const OfferInfo: React.FC<IProps> = (props: any) => { ...@@ -330,8 +357,8 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
</Col> </Col>
<Col span={6}> <Col span={6}>
<div className={style.childrenContent}> <div className={style.childrenContent}>
<p><span>规格:</span>{record.productAttributeJson}</p> <p><span>规格:</span>{splitProductAttributeJson(record.productAttributeJson, 0)}</p>
<p><span>品类:</span>{record.customerCategoryName}</p> <p><span>品类:</span>{splitProductAttributeJson(record.productAttributeJson, 1)}</p>
</div> </div>
</Col> </Col>
<Col span={6}> <Col span={6}>
......
...@@ -28,7 +28,7 @@ const AddOffter = () => { ...@@ -28,7 +28,7 @@ const AddOffter = () => {
dataIndex: 'quotedPriceNo', dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space direction='vertical'> <Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/addOffter/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview> <EyePreview url={`/memberCenter/procurementAbility/offter/addOffter/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text> <Text type='secondary'>{record.details}</Text>
</Space> </Space>
) )
...@@ -39,7 +39,7 @@ const AddOffter = () => { ...@@ -39,7 +39,7 @@ const AddOffter = () => {
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space direction='vertical'> <Space direction='vertical'>
<EyePreview <EyePreview
url={`/memberCenter/procurementAbility/offter/addOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}&turn=${record.turn}`} url={`/memberCenter/procurementAbility/offter/addOffter/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview> >{text}</EyePreview>
<Text type='secondary'>{record.memberName}</Text> <Text type='secondary'>{record.memberName}</Text>
</Space> </Space>
......
...@@ -114,8 +114,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -114,8 +114,6 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
setFiles(arr); setFiles(arr);
} }
console.log(record, 10086)
return ( return (
<> <>
<Drawer <Drawer
......
...@@ -86,6 +86,7 @@ const AddInquiry = () => { ...@@ -86,6 +86,7 @@ const AddInquiry = () => {
const res = await PublicApi.postPurchasePurchaseInquirySubmitBatch({ ids: rowkeys }); const res = await PublicApi.postPurchasePurchaseInquirySubmitBatch({ ids: rowkeys });
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
setRowKeys([])
} }
} }
...@@ -102,6 +103,7 @@ const AddInquiry = () => { ...@@ -102,6 +103,7 @@ const AddInquiry = () => {
} }
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
setRowKeys([])
} }
} }
......
...@@ -22,6 +22,7 @@ const AuditInquiryOne = () => { ...@@ -22,6 +22,7 @@ const AuditInquiryOne = () => {
const res = await PublicApi.postPurchasePurchaseInquiryExamine1Batch({ ids: rowkeys }); const res = await PublicApi.postPurchasePurchaseInquiryExamine1Batch({ ids: rowkeys });
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
setRowKeys([])
} }
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
......
...@@ -24,6 +24,7 @@ const AuditInquiryTwo = () => { ...@@ -24,6 +24,7 @@ const AuditInquiryTwo = () => {
const res = await PublicApi.postPurchasePurchaseInquiryExamine2Batch({ ids: rowkeys }); const res = await PublicApi.postPurchasePurchaseInquiryExamine2Batch({ ids: rowkeys });
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
setRowKeys([])
} }
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
......
...@@ -22,6 +22,7 @@ const SubmitInquiry = () => { ...@@ -22,6 +22,7 @@ const SubmitInquiry = () => {
const res = await PublicApi.postPurchasePurchaseInquiryCommitBatch({ ids: rowkeys }); const res = await PublicApi.postPurchasePurchaseInquiryCommitBatch({ ids: rowkeys });
if (res.code === 1000) { if (res.code === 1000) {
ref.current.reload(); ref.current.reload();
setRowKeys([])
} }
} }
const columns: ColumnType<any>[] = [{ const columns: ColumnType<any>[] = [{
......
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