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

🐞 fix(询价报价): 修复bug

parent 2bceb283
......@@ -173,8 +173,8 @@ const InquiryOfferDetail = () => {
},
{
title: '含税/税率',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
key: 'isTax',
dataIndex: 'isTax',
},
{
title: '报价单价',
......
......@@ -63,7 +63,7 @@ const InquirySearch = () => {
title: '操作',
key: 'options',
dataIndex: 'options',
render: (text: any, record: any) => <Button disabled={record.isQuoted === 1} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
render: (text: any, record: any) => <Button disabled={record.isQuoted === 1 || record.externalState === 2} onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
}
];
......
......@@ -117,6 +117,27 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
}
const getInquiryInfo = (value) => {
form.setFieldsValue({ "inquiryListNo": value.orderNo });
setInquiry({
inquiryListId: value.orderId,
inquiryListNo: value.orderNo,
})
PublicApi.getTransactionProductInquiryDetails({ id: value.orderId.toString() }).then(resolve => {
if (resolve.code !== 1000) {
return
}
const { inquiryListProductRequests } = resolve.data;
inquiryListProductRequests.forEach((item: any) => {
item.money = count(item.purchaseCount, item.price)
})
setProductQuote(inquiryListProductRequests);
form.setFieldsValue({
"inquiryListProductRequests": inquiryListProductRequests,
})
})
}
const getEnclosureUrls = (data) => {
setEnclosureUrls(data);
form.setFieldsValue({
......@@ -165,7 +186,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
}}
>
<BasicInfoLayout inq={inquiry} isEdit={spam} />
<BasicInfoLayout getInquiryInfo={getInquiryInfo} inq={inquiry} isEdit={spam} />
<ProductQuoteLayout setProductQuote={productQuote} />
<OtherExplainLayout />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
......
......@@ -11,6 +11,8 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { isEmpty } from 'lodash';
interface BasicInfoLayoutProps {
/** 获取询价单 */
getInquiryInfo: (e) => void,
/** 是否可修改 */
isEdit?: boolean,
/** 询价单信息 */
......@@ -18,7 +20,7 @@ interface BasicInfoLayoutProps {
}
const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
const { isEdit, inq } = props;
const { getInquiryInfo, isEdit, inq } = props;
const context = useContext(Context);
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
......@@ -67,8 +69,8 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
const handleSubmit = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const target = selectRowRecord[0];
getInquiryInfo(target)
setInquiry(target)
console.log(target)
toggle(false)
}
......@@ -113,11 +115,12 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
<TableModal
modalType="Drawer"
visible={visible}
title="选择会员"
title="选择询价单"
mode="radio"
tableProps={{
rowKey: 'id',
rowKey: 'orderId',
}}
customKey="orderId"
fetchData={handleFetchData}
onClose={() => toggle(false)}
onOk={handleSubmit}
......
......@@ -55,6 +55,11 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
dataIndex: "brand",
},
{
title: "含税/税率",
key: "isTax",
dataIndex: "isTax",
},
{
title: "采购数量/单位",
key: "purchaseCount",
dataIndex: "purchaseCount",
......@@ -82,14 +87,14 @@ const ProductQuoteLayout: React.FC<ProductQuoteLayoutProps> = (props: any) => {
key: "money",
dataIndex: "money"
},
// {
// title: "操作",
// key: "operate",
// dataIndex: "operate",
// render: (_text, _data, index) => (
// <Button type="link">历史报价</Button>
// )
// },
{
title: "操作",
key: "operate",
dataIndex: "operate",
render: (_text, _data, index) => (
<Button type="link">历史报价</Button>
)
},
]
useEffect(() => {
......
......@@ -196,7 +196,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
}}
>
<BasicInfoLatyout getMemberInfo={getMemberInfo} memb={memberInfo} />
<BasicInfoLatyout getMemberInfo={getMemberInfo} memb={memberInfo} isEdit={spam} />
<InquiryProductLayout getInquiryProduct={getInquiryProduct} member={memberInfo} setInquiryProduct={inquiryProduct} />
<TradeTermsLayout getFullAddress={getFullAddress} />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
......
......@@ -14,10 +14,12 @@ interface BasicInfoLayoutProps {
getMemberInfo: (e) => void,
/** 会员信息 */
memb?: number,
/** 是否可修改 */
isEdit?: boolean,
}
const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
const { getMemberInfo, memb } = props;
const { getMemberInfo, memb, isEdit } = props;
const [visible, setVisible] = useState<boolean>(false);
const [member, setMember] = useState<any>({})
......@@ -97,7 +99,7 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
</Col>
<Col span={12} className={style.searchColor}>
<Form.Item label="被询价会员" name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Input.Search onClick={hanleGoMall} onSearch={() => toggle(true)} readOnly enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
<Input.Search onClick={hanleGoMall} onSearch={() => toggle(true)} readOnly enterButton={<Button disabled={isEdit} style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
</Form.Item>
</Col>
</Row>
......
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