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

feat(商品询价): 二次询价

parent f9d171be
import React, { useRef } from 'react';
import Table from '@/pages/transaction/components/TableLayout';
import { history } from 'umi';
import { Tag, Badge } from 'antd';
import { Tag, Badge, Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
......@@ -70,6 +70,7 @@ const OfferSearch = () => {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (_, record) => record.isShowPurchaseOrder && <Button type='link' onClick={() => history.push(`/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder/b2b/add?modelType=3`)}>创建采购订单</Button>
}
];
......
......@@ -8,6 +8,7 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { INQUIRYSEARCHSCHEMA } from './schema';
import { EXTERNALSTATE_COLOR } from '@/pages/transaction/components/stateColor';
import { setAuth, setRouters } from '@/utils/auth';
const InquirySearch = () => {
......@@ -17,6 +18,22 @@ const InquirySearch = () => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
/** 二次询价 */
const secondInquiry = (id) => {
PublicApi.postMemberLoginSwitchrole({
memberRoleId: 11,
}).then(res => {
if (res.code !== 1000) {
return;
}
setAuth(res.data);
setRouters(res.data.urls);
setTimeout(() => {
window.location.replace(`/memberCenter/tranactionAbility/productInquiry/waitAddInquiry/add?id=${id}`);
}, 800);
}).catch(err => {})
}
const columns: ColumnType<any>[] = [
{
title: '询价单号',
......@@ -63,9 +80,13 @@ 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>
<Button disabled={record.isQuoted === 1} type='link'>二次询价</Button>
render: (_text: any, record: any) => <>
{record.isShowQuote && (
<Button onClick={() => history.push(`/memberCenter/tranactionAbility/inquiryOffer/waitAddOffer/offer?id=${record.id}`)} type='link'>报价</Button>
)}
{record.isShowSecondInquiry && (
<Button type='link' onClick={() => secondInquiry(record.id)}>二次询价</Button>
)}
</>
}
];
......
import React from 'react';
import AddForm from './addForm';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
const AddEnquiryOrder = (props: any) => {
const { id } = history.location.query;
return(
<AddForm
id={id}
isEdit={id && true}
title={props.route.name}
fetchRequest={PublicApi.postTransactionInquiryListAdd}
/>
......
......@@ -143,6 +143,9 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
memberRoleId: v.memberRoleId,
imgUrl: v.mainPic,
taxRate: v.taxRate,
upperCommoditySkuId: v.commodityUnitPriceAndPicId,
upperMemberId: v.upperMemberId,
upperMemberRoleId: v.upperMemberRoleId,
})
})
resolve({
......
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