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

🐞 fix: 商品询价bug 修复

parent 1ffc4a8d
......@@ -21,7 +21,7 @@ import asyncRoutes from '../router.config.json';
// import { purchaseInquiryRoute } from './procurementRoute/purchaseInquiry';
// import contracRoute from './contracRoute';
// export const routes = [CommodityRoute, MemberRoute, ShopRoute, ChannelRoute, TranactionRoute, AfterService, PayandSettleRoute, LogisticsRoute, AuthConfigRoute, HandlingRoute, BalaceRoute]
// import marketingRoute from './marketingRoute';
import marketingRoute from './marketingRoute';
const memberCenterRoute = {
path: '/memberCenter',
......
......@@ -40,7 +40,7 @@ export const EXTERNALLOGS: ColumnType<any>[] = [
title: '操作时间',
key: 'createTime',
dataIndex: 'createTime',
render: (_text: any, _record: any) => <Text>{format(_text)}</Text>
render: (_text: any, _record: any) => <Text>{format(_record.createTime || _record.operationTime)}</Text>
},
{
title: '审核意见',
......@@ -86,7 +86,7 @@ export const INTERNALLOGS: ColumnType<any>[] = [
title: '操作时间',
key: 'createTime',
dataIndex: 'createTime',
render: (_text: any, _record: any) => <Text>{format(_text)}</Text>
render: (_text: any, _record: any) => <Text>{format(_record.createTime || _record.operationTime)}</Text>
},
{
title: '审核意见',
......
......@@ -147,11 +147,11 @@ const ConfirmOfferDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'productId',
dataIndex: 'productId',
render: (productId, data) => (
key: 'commodityId',
dataIndex: 'commodityId',
render: (commodityId, data) => (
<Space direction='vertical'>
<Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/commodity/detail/${data.commodityId}`}>{productId}</Typography.Link>
<Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/commodity/detail/${data.commodityId}`}>{commodityId}</Typography.Link>
<Typography.Text>{data.productName}</Typography.Text>
</Space>
)
......
......@@ -148,9 +148,8 @@ const ConfirmOfferPreview = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
key: 'id',
dataIndex: 'id',
key: 'commodityId',
dataIndex: 'commodityId',
},
{
title: '商品名称',
......
......@@ -149,11 +149,11 @@ const InquiryOfferDetail = () => {
const columns: ColumnType<any>[] = [
{
title: '商品ID/名称',
key: 'productId',
dataIndex: 'productId',
render: (productId, data) => (
key: 'commodityId',
dataIndex: 'commodityId',
render: (commodityId, data) => (
<Space direction='vertical'>
<Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`}>{productId}</Typography.Link>
<Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`}>{commodityId}</Typography.Link>
<Typography.Text>{data.productName}</Typography.Text>
</Space>
)
......@@ -210,8 +210,9 @@ const InquiryOfferDetail = () => {
const hitoryColumns: ColumnType<any>[] = [
{
title: '商品ID',
key: 'productId',
dataIndex: 'productId'
key: 'commodityId',
dataIndex: 'commodityId',
render: (commodityId, data) => <Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`}>{commodityId}</Typography.Link>
},
{
title: '商品名称',
......@@ -241,7 +242,8 @@ const InquiryOfferDetail = () => {
{
title: '报价单价',
key: 'price',
dataIndex: 'price'
dataIndex: 'price',
render: price => <>{price ? `¥${price.toFixed(2)}` : '¥0.00'}</>
},
{
title: '询价会员',
......@@ -256,7 +258,8 @@ const InquiryOfferDetail = () => {
{
title: '报价时间',
key: 'createTime',
dataIndex: 'createTime'
dataIndex: 'createTime',
render: (text: any) => format(text)
},
{
title: '报价单',
......@@ -363,7 +366,7 @@ const InquiryOfferDetail = () => {
width={1200}
title='历史报价'
visible={historyVisible}
onClose={() => setVisible(false)}
onClose={() => setHistoryVisible(false)}
>
<StandardTable
columns={hitoryColumns}
......
......@@ -146,8 +146,8 @@ const InquiryOfferPreview = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
key: 'id',
dataIndex: 'id',
key: 'commodityId',
dataIndex: 'commodityId',
},
{
title: '商品名称',
......
......@@ -65,6 +65,15 @@ const OtherExplainLayout: React.FC<OtherExplainLayoutProps> = (props: any) => {
]
useEffect(() => {
PublicApi.getMemberManageUsersPage({ current: '1', pageSize: '10' }).then(res => {
if (res.code !== 1000) {
return
}
const { data } = res.data;
getContacts(data[0])
}).catch(error => {
console.warn(error)
})
fetchTelCode()
}, [])
......
......@@ -18,6 +18,8 @@ const layout: any = {
};
interface AddedFormLayoutProps {
/** 商城id */
shopId?: number,
/** 是否编辑 */
isEdit?: boolean,
/** id */
......@@ -33,7 +35,7 @@ interface AddedFormLayoutProps {
}
const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
const { isEdit, id, fetchRequest, spam, title, two } = props;
const { isEdit, id, fetchRequest, spam, title, two, shopId } = props;
const [form] = Form.useForm();
const [loading, setLoading] = useState<boolean>(false)
const [unsaved, setUnsaved] = useState<boolean>(false);
......@@ -78,6 +80,10 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}
setUnsaved(false);
setLoading(false);
if (two) {
history.push(`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry`)
return
}
history.goBack();
}).catch(_error => {
setLoading(false)
......@@ -146,13 +152,14 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
form.setFieldsValue({
"contactName": value.name,
'contactPhone': value.phone,
'phoneCode': value.phoneCode,
'phoneCode': value.phoneCode || 86,
});
}
/** B端跳来询价 */
const handleB2B = async () => {
const data: any = await getCacheOrderInfoByKey(spam)
console.log(data, 10086)
if (!data) return
const inquiryListProductRequests: any[] = [];
inquiryListProductRequests.push({
......@@ -180,6 +187,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
})
form.setFieldsValue({
...data,
'shopId': Number(shopId),
logistics: '',
"inquiryListProductRequests": inquiryListProductRequests
})
......@@ -206,7 +214,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
res.data.commodityList.forEach(item => {
inquiryListProductRequests.push({
commodityId: item.commodityId,
productId: item.goodsId,
productId: item.id,
imgUrl: item.mainPic,
productName: item.name,
category: item.customerCategoryName,
......@@ -304,7 +312,7 @@ const AddedFormLayout: React.FC<AddedFormLayoutProps> = (props: any) => {
}}
>
<BasicInfoLatyout getMemberInfo={getMemberInfo} memb={memberInfo} isEdit={spam || two} />
<InquiryProductLayout getInquiryProduct={getInquiryProduct} member={memberInfo} setInquiryProduct={inquiryProduct} />
<InquiryProductLayout form={form} getInquiryProduct={getInquiryProduct} member={memberInfo} setInquiryProduct={inquiryProduct} />
<TradeTermsLayout isEdit={two} getFullAddress={getFullAddress} getContacts={getContacts} fullAddress={fullAddress} />
<AttachLayout enclosureUrls={enclosureUrls} getEnclosureUrls={getEnclosureUrls} removeEnclosureUrls={removeEnclosureUrls} />
</Form>
......
......@@ -108,7 +108,7 @@ const BasicInfoLayout: React.FC<BasicInfoLayoutProps> = (props: any) => {
<Input maxLength={30} placeholder="最长60字符,30个汉字" />
</Form.Item>
<Form.Item label="询价商城" name="shopId" rules={[{ required: true, message: '请选择询价商城' }]}>
<Select>
<Select disabled={isEdit}>
{storeList.map(item => (
<Select.Option key={item.id} value={item.id}>{item.name}</Select.Option>
))}
......
......@@ -20,10 +20,12 @@ interface InquiryProductLayoutProps {
setInquiryProduct?: any[],
/** 会员信息 */
member?: number,
/** form */
form?: any,
}
const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) => {
const { getInquiryProduct, setInquiryProduct, member } = props;
const { getInquiryProduct, setInquiryProduct, member, form } = props;
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<any[]>([]);
const [memberId, setMemberId] = useState<number>();
......@@ -47,9 +49,9 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
const columns: ColumnType<any>[] = [
{
title: "商品ID",
key: "productId",
dataIndex: "productId",
render: (productId, data) => <Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`}>{productId}</Typography.Link>
key: "commodityId",
dataIndex: "commodityId",
render: (commodityId, data) => <Typography.Link target="_blank" href={`${ENTERPRISE_CENTER_URL}/shop/${data.memberId}_${data.memberRoleId}/inquiry/detail/${data.commodityId}`}>{commodityId}</Typography.Link>
},
{
title: "商品图片",
......@@ -124,7 +126,7 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
const handleFetchData = useCallback((params: any) => {
return new Promise(resolve => {
PublicApi.getProductCommodityCommonGetCommodityListByBuyer({ ...params, priceTypeList: 2, memberId, shopType: 1 }).then(res => {
PublicApi.getProductCommodityCommonGetCommodityListByBuyer({ ...params, priceTypeList: 2, memberId, shopId: form.getFieldValue('shopId') }).then(res => {
if (res.code !== 1000) {
return
}
......@@ -217,6 +219,10 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
message.warning("请选择被询价会员!")
return
}
if (!form.getFieldValue('shopId')) {
message.warning("请选择询价商城!")
return
}
toggle(true)
}
......
......@@ -87,6 +87,15 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
}
useEffect(() => {
PublicApi.getMemberManageUsersPage({ current: '1', pageSize: '10' }).then(res => {
if (res.code !== 1000) {
return
}
const { data } = res.data;
getContacts(data[0])
}).catch(error => {
console.warn(error)
})
fetchTelCode()
}, [])
......
......@@ -3,11 +3,12 @@ import AddForm from './addForm';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
const RfqEnquiryOrder = (props: any) => {
const { id, spam_id } = history.location.query;
const { id, spam_id, shopId } = history.location.query;
return(
<AddForm
id={id}
isEdit
shopId={shopId}
title={props.route.name}
fetchRequest={PublicApi.postTransactionInquiryListAdd}
spam={spam_id}
......
......@@ -89,13 +89,19 @@ const ReadySubmitExamine = () => {
dataIndex: 'state',
render: (text, record) => (
<>
<Popconfirm title="确定要提交吗?" disabled={!record.id} okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link' disabled={!record.id}>
提交审核
</Button>
</Popconfirm>
{record.id && <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/edit?activityId=${record.activityId}&signUpId=${record.id}`)}>修改报名资料</Button>}
{!record.id && <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>}
{record.button === 7 && <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/edit?activityId=${record.activityId}&signUpId=${record.id}`)}>修改报名资料</Button>}
{
record.button === 6 && (
<>
<Popconfirm title="确定要提交吗?" disabled={!record.id} okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link' disabled={!record.id}>
提交审核
</Button>
</Popconfirm>
<Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>
</>
)}
</>
)
},
......
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