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

feat: 完成采购报价新增修改

parent 938af454
......@@ -4,7 +4,7 @@
* @LastEditors: Please set LastEditors
* @LastEditTime: 2020-10-19 11:12:51
*/
// import CommodityRoute from './commodityRoute' // 商品能力路由
import CommodityRoute from './commodityRoute' // 商品能力路由
// import MemberRoute from './memberRoute' // 会员能力路由
// import ShopRoute from './shopRoute' // 店铺能力路由
// import ChannelRoute from './channelRoute' // 渠道能力路由
......@@ -55,7 +55,7 @@ const memberCenterRoute = {
// // component: '@/pages/index',
// component: '@/pages/home',
// },
CommodityRoute,
// srm开发临时使用...
ProcurementRoute,
// 合同能力
......
import { callForBidsRoute } from './callForBids';
import { offterRoute } from './offter';
import { purchaseInquiryRoute } from './purchaseInquiry';
import { confirmOfferRoute } from './confirmOffer';
import { tenderRoute } from './tender';
/**
......@@ -19,6 +20,8 @@ const ProcurementRoute = {
...purchaseInquiryRoute,
// 报价
...offterRoute,
/** 确认报价 */
...confirmOfferRoute,
],
}
......
......@@ -91,6 +91,13 @@ export const offterRoute = [
hideInMenu: true,
},
{
// 修改报价单
path: '/memberCenter/procurementAbility/offter/edit',
name: '修改报价单',
component: '@/pages/transaction/purchaseAbility/offter/addOffter/add',
hideInMenu: true,
},
{
// 采购需求单详情
path: '/memberCenter/procurementAbility/offter/addOffter/preview',
name: '采购需求单详情',
......
......@@ -20,41 +20,39 @@ const AuditResultsOne = () => {
}
const columns: ColumnType<any>[] = [{
title: '报价单号/摘要',
key: 'quotedPriceNo',
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
}, {
title: '需求单号/会员',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/memberCenter/procurementAbility/offter/auditOffterOne/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<Text type='secondary'>{record.memberName}</Text>
url={`/memberCenter/procurementAbility/offter/inquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
}, {
title: '有效报价数',
key: 'count',
dataIndex: 'count',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
......@@ -63,14 +61,20 @@ const AuditResultsOne = () => {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{OFFTER_INTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<Button type='link'>审核</Button>
}];
return (
<Table
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
fetch={PublicApi.getPurchaseQuotedPriceStayExamineList1}
fetch={PublicApi.getPurchaseConfirmQuotedPriceStayExamineAward1List}
controllerBtns={
<Row>
<Col span={6}>
......
......@@ -20,41 +20,39 @@ const AuditResultsTwo = () => {
}
const columns: ColumnType<any>[] = [{
title: '报价单号/摘要',
key: 'quotedPriceNo',
dataIndex: 'quotedPriceNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
}, {
title: '需求单号/会员',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/memberCenter/procurementAbility/offter/auditOffterOne/preview?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}
>{text}</EyePreview>
<Text type='secondary'>{record.memberName}</Text>
url={`/memberCenter/procurementAbility/offter/inquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'createTime',
dataIndex: 'createTime',
key: 'voucherTime',
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
}, {
title: '有效报价数',
key: 'count',
dataIndex: 'count',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
......@@ -63,14 +61,20 @@ const AuditResultsTwo = () => {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{OFFTER_INTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<Button type='link'>审核</Button>
}];
return (
<Table
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
fetch={PublicApi.getPurchaseQuotedPriceStayExamineList1}
fetch={PublicApi.getPurchaseConfirmQuotedPriceStayExamineAward2List}
controllerBtns={
<Row>
<Col span={6}>
......
......@@ -9,6 +9,8 @@ import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR,
} from '../../constants';
const { Text } = Typography
......@@ -18,7 +20,7 @@ const ConfirmResults = () => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const columns: ColumnType<any>[] = [{
title: '需求单号',
title: '报价单号/摘要',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
......@@ -29,18 +31,14 @@ const ConfirmResults = () => {
</Space>
)
}, {
title: '需求会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
......@@ -48,28 +46,37 @@ const ConfirmResults = () => {
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
}, {
title: '有效报价数',
key: 'count',
dataIndex: 'count',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{OFFTER_INTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<Button
onClick={() => history.push(`/memberCenter/procurementAbility/offter/quote?id=${record.id}&number=${record.purchaseInquiryNo}`)}
type='link'
>
报价
</Button>
<Button type='link'>确认授标结果</Button>
}];
return (
<Table
schemaType="PurchaseDemand"
columns={columns}
effects="requisitionFormNo"
fetch={PublicApi.getPurchaseQuotedPricePurchaseInquiryList}
fetch={PublicApi.getPurchaseConfirmQuotedPriceStayConfirmAwardResultList}
/>
)
}
......
import React from 'react';
import Table from '../../components/table';
import { history } from 'umi';
import { Button, Space, Typography, Tag } from 'antd';
import { Button, Typography, Tag } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
......@@ -9,6 +9,8 @@ import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const { Text } = Typography
......@@ -22,16 +24,13 @@ const OfferInquire = () => {
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview
url={`/memberCenter/procurementAbility/offter/inquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
<EyePreview
url={`/memberCenter/procurementAbility/offter/inquiry/preview?id=${record.id}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
)
}, {
title: '需求会员',
key: 'memberName',
dataIndex: 'memberName',
title: '需求摘要',
key: 'details',
dataIndex: 'details',
}, {
title: '交付日期',
key: 'deliveryTime',
......@@ -39,29 +38,41 @@ const OfferInquire = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
key: 'voucherTime',
dataIndex: 'voucherTime',
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
}, {
title: '有效报价数',
key: 'count',
dataIndex: 'count',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{OFFTER_INTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<Button
onClick={() => history.push(`/memberCenter/procurementAbility/offter/quote?id=${record.id}&number=${record.purchaseInquiryNo}`)}
type='link'
>
报价
调整截止时间
</Button>
}];
return (
......@@ -69,7 +80,7 @@ const OfferInquire = () => {
schemaType="PurchaseDemand"
columns={columns}
effects="requisitionFormNo"
fetch={PublicApi.getPurchaseQuotedPricePurchaseInquiryList}
fetch={PublicApi.getPurchaseConfirmQuotedPriceList}
/>
)
}
......
......@@ -9,6 +9,8 @@ import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
const { Text } = Typography
......@@ -18,7 +20,7 @@ const ToComparePrices = () => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const columns: ColumnType<any>[] = [{
title: '需求单号',
title: '报价单号/摘要',
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
......@@ -29,18 +31,14 @@ const ToComparePrices = () => {
</Space>
)
}, {
title: '需求会员',
key: 'memberName',
dataIndex: 'memberName',
}, {
title: '交付日期',
key: 'deliveryTime',
dataIndex: 'deliveryTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价截止时间',
key: 'quotationAsTime',
dataIndex: 'quotationAsTime',
key: 'offerEndTime',
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
......@@ -48,28 +46,40 @@ const ToComparePrices = () => {
dataIndex: 'voucherTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
}, {
title: '有效报价数',
key: 'count',
dataIndex: 'count',
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Tag color={OFFTER_INTERNALSTATE_COLOR[text]}>{OFFTER_INTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) =>
<Button
onClick={() => history.push(`/memberCenter/procurementAbility/offter/quote?id=${record.id}&number=${record.purchaseInquiryNo}`)}
type='link'
>
报价
</Button>
<>
<Button type='link'>比价</Button>
<Button type='link'>修改授标结果</Button>
</>
}];
return (
<Table
schemaType="PurchaseDemand"
columns={columns}
effects="requisitionFormNo"
fetch={PublicApi.getPurchaseQuotedPricePurchaseInquiryList}
fetch={PublicApi.getPurchaseConfirmQuotedPriceStayContrastPrice}
/>
)
}
......
/** 询价外部状态 */
export const INQUIRY_EXTERNALSTATE = {
'-1': '作废',
99: '已完成',
1: '待提交需求单',
2: '待审核需求单',
3: '待提交报价单',
4: '待确认授标结果'
}
/** 询价外部状态颜色 */
export const INQUIRY_EXTERNALSTATE_COLOR = {
'-1': 'error',
99: 'success',
1: 'default',
2: 'warning',
3: 'warning',
4: 'warning'
}
/** 询价内部状态 */
export const INQUIRY_INTERNALSTATE = {
99: '已完成',
1: '待提交审核',
2: '待审核(一级)',
3: '待审核(二级)',
4: '待提交报价单',
5: '待比价',
6: '审核通过(一级)',
7: '审核通过(二级)',
8: '审核不通过(一级)',
9: '审核不通过(二级)',
}
/** 询价内部状态颜色 */
export const INQUIRY_INTERNALSTATE_COLOR = {
99: 'success',
1: 'default',
2: 'warning',
3: 'warning',
4: 'warning',
5: 'default',
6: 'success',
7: 'success',
8: 'error',
9: 'error',
}
/** 报价外部状态 */
export const OFFTER_EXTERNALSTATE = {
'-1': '作废',
99: '已完成',
1: '待提交需求单',
2: '待审核需求单',
......@@ -9,7 +53,6 @@ export const OFFTER_EXTERNALSTATE = {
}
/** 报价外部状态颜色 */
export const OFFTER_EXTERNALSTATE_COLOR = {
'-1': 'error',
99: 'success',
1: 'default',
2: 'warning',
......@@ -18,30 +61,44 @@ export const OFFTER_EXTERNALSTATE_COLOR = {
}
/** 报价内部状态 */
export const OFFTER_INTERNALSTATE = {
'-1': '作废',
99: '已完成',
1: '待比价',
2: '待审核授标结果(一级)',
3: '待审核授标结果(二级)',
4: '待确认授标结果',
5: '审核授标结果通过(一级)',
6: '审核授标结果通过(二级)',
7: '审核授标结果不通过(一级)',
8: '审核授标结果不通过(二级)',
1: '待提交审核',
2: '待审核(一级)',
3: '待审核(二级)',
4: '待提交报价单',
5: '待比价',
6: '审核通过(一级)',
7: '审核通过(二级)',
8: '审核不通过(一级)',
9: '审核不通过(二级)',
}
/** 报价内部状态颜色 */
export const OFFTER_INTERNALSTATE_COLOR = {
'-1': 'error',
99: 'success',
1: 'default',
2: 'warning',
3: 'warning',
4: 'warning',
5: 'success',
5: 'default',
6: 'success',
7: 'error',
7: 'success',
8: 'error',
9: 'error',
}
export enum OFFTER_EXTERNALSTATE_TYPE {
/** 待提交需求单 */
WAITSUBMITINQUIRY_TYPE = 1,
/** 待审核需求单 */
WAITAUDITINQUIRY_TYPE,
/** 待提交报价单 */
WAITSUBMIOFFER_TYPE,
/** 待确认授标结果 */
WAITCONFIRMRESULTS_TYPE,
/** 已完成 */
SUCCESS_TYPE = 99,
}
export enum OFFTER_INTERNALSTATE_TYPE {
/** 作废 */
ABANDON_TYPE = -1,
......
......@@ -42,7 +42,7 @@ const AddForm = () => {
}
if (path === 'quote') {
link = PublicApi.getPurchaseQuotedPricePurchaseInquiryDetails
} else if (path === 'add' && id && number) {
} else if ((path === 'add' || path === 'edit') && id && number) {
link = PublicApi.getPurchaseQuotedPriceDetails
}
link(params).then(res => {
......@@ -69,6 +69,7 @@ const AddForm = () => {
}
/** 修改才有回显下面这些的 */
if (path === 'edit') {
basicInfo.quotedDetails = params.quotedDetails,
basicInfo.telPrefix = params.telPrefix;
basicInfo.tel = params.tel;
explainInfo.payDetails = params.payDetails;
......@@ -95,23 +96,35 @@ const AddForm = () => {
setLoading(true);
if (basicRef.state && explainRef.state && offerRef.state) {
const params = {
purchaseInquiryId: id,
purchaseInquiryNo: number,
quotedDetails: basicRef.data.quotedDetails,
tel: basicRef.data.phone.tel,
telPrefix: basicRef.data.phone.telPrefix,
contacts: basicRef.data.contacts,
memberName: name,
memberId: memberId,
memberRoleId: memberRoleId,
...explainRef.data,
detailss: offerRef.data,
}
const res = await PublicApi.postPurchaseQuotedPriceAdd(params);
if (res.code === 1000) {
history.goBack()
if (path === 'edit') {
params.id = id;
await PublicApi.postPurchaseQuotedPriceUpdate({...params}).then(res => {
if (res.code === 1000) {
history.goBack()
} else {
setLoading(false);
}
});
} else {
setLoading(false);
params.purchaseInquiryId = id;
params.purchaseInquiryNo = number;
params.memberName = name;
params.memberId = memberId;
params.memberRoleId = memberRoleId;
await PublicApi.postPurchaseQuotedPriceAdd({...params}).then(res => {
if (res.code === 1000) {
history.goBack()
} else {
setLoading(false);
}
});
}
} else {
setLoading(false);
......@@ -138,6 +151,7 @@ const AddForm = () => {
<Offer
fetchdata={offer}
currentRef={currentOffer}
name={path}
/>
</TabPane>
<TabPane key='3' tab='报价说明' forceRender>
......
......@@ -7,6 +7,7 @@ import {
Tag,
Badge
} from 'antd';
import moment from 'moment';
import style from './index.less';
import {
OFFTER_EXTERNALSTATE,
......@@ -32,6 +33,9 @@ export interface IProps {
}
const BasicInfo: React.FC<IProps> = (props: any) => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const [form] = Form.useForm();
const {
fetchdata,
......@@ -146,13 +150,13 @@ const BasicInfo: React.FC<IProps> = (props: any) => {
label='报价截止时间'
name='offerEndTime'
>
<Text strong>{fetchdata && fetchdata.offerEndTime}</Text>
<Text strong>{fetchdata && format(fetchdata.offerEndTime)}</Text>
</Form.Item>
<Form.Item
label='单据时间'
name='createTime'
>
<Text strong>{fetchdata && fetchdata.createTime}</Text>
<Text strong>{fetchdata && format(fetchdata.createTime)}</Text>
</Form.Item>
<Form.Item
label='外部状态'
......
......@@ -19,7 +19,8 @@ const { Option } = Select;
export interface IProps {
fetchdata: any,
currentRef: any
currentRef: any,
name: string,
}
const OfferInfo: React.FC<IProps> = (props: any) => {
......@@ -27,6 +28,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const {
fetchdata,
currentRef,
name
} = props;
const [tabs, setTabs] = useState<number[]>([]);
const [visible, setVisible] = useState<boolean>(false);
......@@ -39,7 +41,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
const data = [...dataSource];
switch (name) {
case 'isTax':
data[idx].isTax = '100'
data[idx].isTax = Number(e)
break;
case 'taxProbability':
data[idx].taxProbability = e.target.value;
......@@ -85,6 +87,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item
name={`isTax${index}`}
style={{ margin: 0 }}
initialValue={text}
rules={[{ required: true, message: '请选择' }]}
>
<Select
......@@ -92,7 +95,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
onChange={(e) => handleEdit(e, 'isTax', index)}
>
<Option value={1}></Option>
<Option value={2}></Option>
<Option value={0}></Option>
</Select>
</Form.Item>
)
......@@ -105,6 +108,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item
style={{ margin: 0 }}
name={`taxProbability${index}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]}
>
<Input
......@@ -124,6 +128,7 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
<Form.Item
style={{ margin: 0 }}
name={`taxUnitPrice${index}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]}
>
<Input
......@@ -159,7 +164,8 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
},
]
/** 用于展示有第几轮的TABS */
const handleTabs = (num: number = 1) => {
const [count, setCount] = useState<number>()
const handleTabs = (num: number) => {
const tabs: number[] = []
for (let i = 0; i < num; i += 1) {
tabs.push(i + 1)
......@@ -171,22 +177,25 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
console.log(params, 10086)
const data = [...dataSource];
data[index].productId = params.product.id;
data[index].goodsId = params.product.goodsId;
data[index].customerCategoryName = params.product.customerCategoryName;
data[index].productName = params.product.name;
data[index].productBrand = params.product.brandName;
setDataSource(data)
setVisible(false);
}
useEffect(() => {
handleTabs(fetchdata && fetchdata.count);
}, [])
useEffect(() => {
if (fetchdata.materiels) {
setDataSource(fetchdata.materiels)
}
}, [fetchdata.materiels])
if (fetchdata.count) {
form.setFieldsValue({
count: fetchdata.count
})
setCount(fetchdata.count)
handleTabs( fetchdata.count || 1)
}
}, [fetchdata])
useEffect(() => {
currentRef.current = {
......@@ -194,8 +203,9 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
form.validateFields().then(res => {
const detailss: any = [];
dataSource.forEach(item => {
console.log(item, 10086)
detailss.push({
purchaseInquiryDetailsId: item.id,
purchaseInquiryDetailsId: name === 'quote' ? item.id : item.purchaseInquiryDetailsId,
taxUnitPrice: item.taxUnitPrice,
isTax: item.isTax,
taxProbability: item.taxProbability,
......@@ -225,11 +235,16 @@ const OfferInfo: React.FC<IProps> = (props: any) => {
form={form}
className={style.offerStyle}
>
<Radio.Group defaultValue={fetchdata && fetchdata.count}>
{tabs.length > 0 && tabs.map(item => (
<Radio.Button key={item} value={item}>{item}</Radio.Button>
))}
</Radio.Group>
<Form.Item name='count'>
<Radio.Group>
{tabs.length > 0 && tabs.map(item => {
console.log(item, 100856111)
return (
<Radio.Button key={item} value={item}>{item}</Radio.Button>
)
})}
</Radio.Group>
</Form.Item>
<Table
columns={columns}
dataSource={dataSource}
......
import React from 'react';
import React, { useRef, useState } from 'react';
import Table from '../../components/table'
import { history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment'
import { PublicApi } from '@/services/api';
import { Row, Col, Space, Button, Typography } from 'antd';
import { Row, Col, Space, Button, Typography, Popconfirm } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
OFFTER_INTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE_TYPE,
} from '../../constants';
import { Badge, Tag } from 'antd';
const { Text } = Typography;
......@@ -54,8 +55,9 @@ const AddOffter = () => {
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
key: 'count',
dataIndex: 'count',
render: (text: any, record: any) => text && <Text strong>{text}</Text>
}, {
title: '外部状态',
key: 'externalState',
......@@ -66,9 +68,65 @@ const AddOffter = () => {
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => <>
{
record.interiorState === OFFTER_INTERNALSTATE_TYPE.WAITSUBMITAUDIT_TYPE
&& (
<>
<Button type='link'>提交审核</Button>
<Button
onClick={() => history.push(`/memberCenter/procurementAbility/offter/edit?id=${record.id}&number=${record.quotedPriceNo}`)}
type='link'
>修改</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => fetchDeleteBatch(record.id)}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</>
)
}
</>
}];
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
/** 批量审核 */
const fetchSubmitBatch = async () => {
const res = await PublicApi.postPurchaseQuotedPriceSubmitBatch({ ids: rowkeys });
if (res.code === 1000) {
ref.current.reload();
setRowKeys([])
}
}
/**
* 删除或批量删除
* @type: 1: 单个删除, 2: 批量删除
* */
const fetchDeleteBatch = async (id?: number) => {
let res = null;
if (id) {
res = await PublicApi.postPurchaseQuotedPriceDelete({ id });
} else {
res = await PublicApi.postPurchaseQuotedPriceDeleteBatch({ ids: rowkeys });
}
if (res.code === 1000) {
ref.current.reload();
setRowKeys([])
}
}
return (
<Table
selectedRow
reload={ref}
fetchRowkeys={(e) => setRowKeys(e)}
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
......@@ -77,8 +135,18 @@ const AddOffter = () => {
<Row>
<Col span={24}>
<Space size={16}>
<Button>批量提交审核</Button>
<Button>批量删除</Button>
<Button
onClick={fetchSubmitBatch}
disabled={rowkeys.length === 0}
>
批量提交审核
</Button>
<Button
onClick={() => fetchDeleteBatch()}
disabled={rowkeys.length === 0}
>
批量删除
</Button>
</Space>
</Col>
</Row>
......
......@@ -51,45 +51,11 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
render: (text: any) => <span>{(text && Object.keys(text).length > 0) && text.name}</span>
},
]
const data = [{
applyTime: 1610691292164,
brandName: "t11-1",
code: "P000066",
commodityId: 68,
commodityUnitPriceAndPicId: null,
customerCategoryName: "床上用品",
goodsId: 13,
id: 198,
isMemberPrice: false,
logistics: { deliveryType: 3, carriageType: null, weight: null, useTemplate: null, templateId: null },
mainPic: "https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/c02b01ccaed8402f862db2d7c3d718371610691032335.jpg",
max: null,
memberId: 8,
memberName: "昊嘉网络有限公司",
memberRoleId: 4,
memberRoleName: "企业会员_服务提供者",
min: null,
minOrder: 3,
name: "tttttttt/黄色/M/111111",
priceType: 2,
status: 5,
stockCount: null,
unitName: "件",
unitPrice: null,
}]
const fetchGoodsData = (params: any) => {
return new Promise(resolve => {
// PublicApi.getProductCommodityCommonGetCommodityListBySeller({ ...params, priceTypeList: 2, environment: 1, shopType: 1 }).then(res => {
// resolve(res.data)
// })
const queryResult = data.find(v => v.id === params.keywords);
setTimeout(() => {
resolve({
code: 200,
message: '',
data: queryResult ? [queryResult] : data,
});
}, 1000);
PublicApi.getProductCommodityCommonGetCommodityListBySeller({ ...params, environment: 1, shopType: 1 }).then(res => {
resolve(res.data)
})
})
}
/** 关闭 */
......
import React from 'react';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import Table from '../../components/table'
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......@@ -64,9 +65,45 @@ const AuditOffterOne = () => {
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/purchaseInquiry/auditInquiryOne/detail?id=${record.id}&number=${record.purchaseInquiryNo}`)}
>
审核
</Button>
</>
)
}];
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false)
/** 批量审核 */
const fetchSubmitBatch = async () => {
setLoading(true)
const res = await PublicApi.postPurchaseQuotedPriceExamine1Batch({ ids: rowkeys });
if (res.code === 1000) {
ref.current.reload();
setRowKeys([])
setLoading(false)
} else {
setLoading(false)
}
}
return (
<Table
selectedRow
reload={ref}
fetchRowkeys={(e) => setRowKeys(e)}
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
......@@ -74,7 +111,13 @@ const AuditOffterOne = () => {
controllerBtns={
<Row>
<Col span={6}>
<Button>批量提交审核</Button>
<Button
loading={loading}
onClick={fetchSubmitBatch}
disabled={rowkeys.length === 0}
>
批量提交审核
</Button>
</Col>
</Row>
}
......
import React from 'react';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import Table from '../../components/table'
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......@@ -65,9 +66,45 @@ const AuditOffterTwo = () => {
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/purchaseInquiry/auditInquiryOne/detail?id=${record.id}&number=${record.purchaseInquiryNo}`)}
>
审核
</Button>
</>
)
}];
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false)
/** 批量审核 */
const fetchSubmitBatch = async () => {
setLoading(true)
const res = await PublicApi.postPurchaseQuotedPriceExamine2Batch({ ids: rowkeys });
if (res.code === 1000) {
ref.current.reload();
setRowKeys([])
setLoading(false)
} else {
setLoading(false)
}
}
return (
<Table
selectedRow
reload={ref}
fetchRowkeys={(e) => setRowKeys(e)}
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
......@@ -75,7 +112,13 @@ const AuditOffterTwo = () => {
controllerBtns={
<Row>
<Col span={6}>
<Button>批量提交审核</Button>
<Button
loading={loading}
onClick={fetchSubmitBatch}
disabled={rowkeys.length === 0}
>
批量提交审核
</Button>
</Col>
</Row>
}
......
......@@ -7,8 +7,8 @@ import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
} from '../../constants';
const { Text } = Typography
......@@ -51,7 +51,7 @@ const Inquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '操作',
key: 'operate',
......
......@@ -18,6 +18,7 @@ const Offter = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const columns: ColumnType<any>[] = [{
title: '报价单号/摘要',
key: 'quotedPriceNo',
......@@ -46,18 +47,20 @@ const Offter = () => {
dataIndex: 'offerEndTime',
render: (text: any, record: any) => format(text)
}, {
title: '单据时间',
title: '报价时间',
key: 'createTime',
dataIndex: 'createTime',
render: (text: any, record: any) => format(text)
}, {
title: '报价轮次',
key: 'turn',
dataIndex: 'turn',
key: 'count',
dataIndex: 'count',
render: (text: any, record: any) => text && <Text strong>{text}</Text>
}, {
title: '是否中标',
key: 'iSprize',
dataIndex: 'iSprize',
render: (text: any) => (text ? <Text type='success'></Text> : <Text type='warning'></Text>)
}, {
title: '外部状态',
key: 'externalState',
......
import React from 'react';
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import Table from '../../components/table'
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
......@@ -65,9 +66,45 @@ const SubmitOffter = () => {
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/purchaseInquiry/auditInquiryOne/detail?id=${record.id}&number=${record.purchaseInquiryNo}`)}
>
提交报价单
</Button>
</>
)
}];
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
const [loading, setLoading] = useState<boolean>(false)
/** 批量审核 */
const fetchSubmitBatch = async () => {
setLoading(true)
const res = await PublicApi.postPurchaseQuotedPriceStayCommitBatch({ ids: rowkeys });
if (res.code === 1000) {
ref.current.reload();
setRowKeys([])
setLoading(false)
} else {
setLoading(false)
}
}
return (
<Table
selectedRow
reload={ref}
fetchRowkeys={(e) => setRowKeys(e)}
schemaType="PurchaseDemandPublic"
columns={columns}
effects="requisitionFormNo"
......@@ -75,7 +112,13 @@ const SubmitOffter = () => {
controllerBtns={
<Row>
<Col span={6}>
<Button>批量提交审核</Button>
<Button
loading={loading}
onClick={fetchSubmitBatch}
disabled={rowkeys.length === 0}
>
批量提交审核
</Button>
</Col>
</Row>
}
......
......@@ -224,7 +224,7 @@ const Material: React.FC<Iprops> = (props: any) => {
state: true,
name: 'material',
data: {
...res,
materielMode: res.materielMode,
materiels: dataSource,
},
})
......
......@@ -8,10 +8,10 @@ import { PublicApi } from '@/services/api';
import { Row, Col, Space, Button, Dropdown, Menu, Tag, Badge, Popconfirm, Typography } from 'antd';
import { DeleteOutlined, DownOutlined, PlusOutlined } from '@ant-design/icons';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR,
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
INQUIRY_INTERNALSTATE,
INQUIRY_INTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE_TYPE
} from '../../constants';
const { Text } = Typography;
......@@ -50,12 +50,12 @@ const AddInquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={INQUIRY_INTERNALSTATE_COLOR[text]} text={INQUIRY_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -94,6 +94,8 @@ const DrawerWrite: React.FC<Iprops> = (props: any) => {
const handleSubmit = () => {
form.validateFields().then(res => {
const data = {
goodsId: product.id,
itemNo: product.code || res.numbe,
number: product.code || res.number,
name: product.name || res.name,
category: product.customerCategory.name,
......
......@@ -7,10 +7,10 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Badge, Typography, Space } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
INQUIRY_INTERNALSTATE,
INQUIRY_INTERNALSTATE_COLOR
} from '../../constants';
const { Text } = Typography;
const AuditInquiryOne = () => {
......@@ -56,12 +56,12 @@ const AuditInquiryOne = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={INQUIRY_INTERNALSTATE_COLOR[text]} text={INQUIRY_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -7,10 +7,10 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Badge, Typography, Space } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
INQUIRY_INTERNALSTATE,
INQUIRY_INTERNALSTATE_COLOR
} from '../../constants';
const { Text } = Typography;
const AuditInquiryTwo = () => {
......@@ -56,12 +56,12 @@ const AuditInquiryTwo = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={INQUIRY_INTERNALSTATE_COLOR[text]} text={INQUIRY_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -6,10 +6,10 @@ import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
INQUIRY_INTERNALSTATE,
INQUIRY_INTERNALSTATE_COLOR
} from '../../constants';
import ModalOperate from '../../components/modalOperate';
......@@ -52,12 +52,12 @@ const Inquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={INQUIRY_INTERNALSTATE_COLOR[text]} text={INQUIRY_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
......@@ -7,10 +7,10 @@ import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Tag, Badge, Typography, Space } from 'antd';
import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
OFFTER_INTERNALSTATE,
OFFTER_INTERNALSTATE_COLOR
INQUIRY_EXTERNALSTATE,
INQUIRY_EXTERNALSTATE_COLOR,
INQUIRY_INTERNALSTATE,
INQUIRY_INTERNALSTATE_COLOR
} from '../../constants';
const { Text } = Typography;
const SubmitInquiry = () => {
......@@ -56,12 +56,12 @@ const SubmitInquiry = () => {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <Tag color={OFFTER_EXTERNALSTATE_COLOR[text]}>{OFFTER_EXTERNALSTATE[text]}</Tag>
render: (text: any, record: any) => <Tag color={INQUIRY_EXTERNALSTATE_COLOR[text]}>{INQUIRY_EXTERNALSTATE[text]}</Tag>
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={OFFTER_INTERNALSTATE_COLOR[text]} text={OFFTER_INTERNALSTATE[text]} />
render: (text: any, record: any) => <Badge status={INQUIRY_INTERNALSTATE_COLOR[text]} text={INQUIRY_INTERNALSTATE[text]} />
}, {
title: '操作',
key: 'operate',
......
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