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

🐞 fix: 修改被询价会员跳转商城

parent 65f13e18
......@@ -41,14 +41,25 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const handleSubmit = () => {
setLoading(true)
form.validateFields().then(res => {
const params = {
...res,
const params: any = {
details: res.details,
deliveryTime: res.deliveryTime && moment(res.deliveryTime).format('x'),
quotationAsTime: res.quotationAsTime && moment(res.quotationAsTime).format('x'),
memberName: res.memberName,
memberId: memberInfo.memberId,
memberRoleId: memberInfo.memberRoleId,
memberRoleName: memberInfo.memberRoleName,
memberRoleId: memberInfo.roleId,
memberRoleName: memberInfo.roleName,
fullAddress: fullAddress.children,
fullAddressId: res.fullAddressId,
offer: res.offer,
paymentType: res.paymentType,
taxes: res.taxes,
logistics: res.logistics,
packRequire: res.packRequire,
otherRequire: res.otherRequire,
enclosureUrls: res.enclosureUrls,
inquiryListProductRequests: res.inquiryListProductRequests,
}
id && (params.id = id);
fetchRequest({ ...params }).then(res => {
......@@ -67,10 +78,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const getMemberInfo = (value) => {
form.setFieldsValue({ "memberName": value.name });
setMenberInfo(value)
console.log(value)
}
const getInquiryProduct = (data) => {
setInquiryProduct(data)
form.setFieldsValue({
"inquiryListProductRequests": data
})
......@@ -96,8 +107,8 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
setMenberInfo({
memberId: data.memberId,
memberRoleId: data.memberRoleId,
memberRoleName: data.memberRoleName,
roleId: data.memberRoleId,
roleName: data.memberName,
})
setFullAddress({
children: data.fullAddress,
......@@ -143,7 +154,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
}}
>
<BasicInfoLatyout getMemberInfo={getMemberInfo} />
<BasicInfoLatyout getMemberInfo={getMemberInfo} memb={memberInfo} />
<InquiryProductLayout getInquiryProduct={getInquiryProduct} member={memberInfo} setInquiryProduct={inquiryProduct} />
<TradeTermsLayout getFullAddress={getFullAddress} />
<AttachLayout />
......
import React, { useCallback, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { Row, Col, Form, Input, Button } from 'antd';
import { LinkOutlined } from '@ant-design/icons';
import Card from '@/pages/transaction/components/card';
import TableModal from '@/pages/transaction/components/TableModal';
import { PublicApi } from '@/services/api';
import style from './index.less';
import { isEmpty } from '@formily/shared';
interface BasicInfoLayoutProps {
/** 获取询价会员 */
getMemberInfo: (e) => void
getMemberInfo: (e) => void,
/** 会员信息 */
memb?: number,
}
const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
const { getMemberInfo } = props;
const { getMemberInfo, memb } = props;
const [visible, setVisible] = useState<boolean>(false);
const [member, setMember] = useState<any>({})
......@@ -65,6 +69,19 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
toggle(false)
}
const hanleGoMall = () => {
console.log(member)
if (member.memberId) {
window.open(`/shop?shopId=${btoa(JSON.stringify({ memberId: member.memberId, roleId: member.roleId }))}`)
}
}
useEffect(() => {
if (!isEmpty(memb)) {
setMember(memb)
}
}, [memb])
return (
<Card
id="basicInfoLayout"
......@@ -76,9 +93,9 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
<Input />
</Form.Item>
</Col>
<Col span={12}>
<Col span={12} className={style.searchColor}>
<Form.Item label="被询价会员" name='memberName' rules={[{ required: true, message: '请选择被询价会员' }]}>
<Input.Search onSearch={() => toggle(true)} readOnly enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
<Input.Search onClick={hanleGoMall} onSearch={() => toggle(true)} readOnly enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
</Form.Item>
</Col>
</Row>
......
.searchColor {
:global {
.ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child {
color: @main-color,
}
}
}
......@@ -75,7 +75,10 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
key: "purchaseCount",
dataIndex: "purchaseCount",
render: (text, _data, index) => (
<InputNumber min={1} defaultValue={text} onChange={(val) => setInputNumber(val, index)} />
<Form.Item initialValue={text} name={`purchaseCount${index}`} rules={[{ required: true, message: '请输入采购数量' }]} style={{ marginBottom: '0px' }}>
<InputNumber min={1} onChange={(val) => setInputNumber(val, index)} />
</Form.Item>
)
},
{
......@@ -130,7 +133,7 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
purchaseCount: 1,
logistics: v.logistics,
memberId: v.memberId,
memberRoleId: v.memberRoleId,
memberRoleId: v.roleId,
imgUrl: v.mainPic
})
})
......
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