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

🐞 fix: 修改采购确认报价bug

parent e45be8ef
......@@ -17,15 +17,38 @@ export const demandPlanRoute = [
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanSearch'
},
{
/** 需求计划查询 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/preview',
name: '需求计划查询',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待新增需求计划 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanAdded'
},
{
/** 待新增需求计划 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded/add',
/** 待新增需求计划 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded/preview',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 新增需求计划 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded/add',
name: '新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanAdded/add',
hideInMenu: true,
},
{
/** 修改需求计划 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanAdded/edit',
name: '修改需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanAdded/add',
hideInMenu: true,
},
......@@ -36,17 +59,57 @@ export const demandPlanRoute = [
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanOne'
},
{
/** 待审核需求计划(一级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanOne/preview',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核需求计划(一级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanOne/detail',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核需求计划(二级) */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanTwo',
name: '待审核需求计划(二级)',
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanTwo'
},
{
/** 待审核需求计划(二级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanTwo/preview',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待审核需求计划(二级) - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanTwo/detail',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
{
/** 待提交需求计划 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanSubmit',
name: '待提交需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/demandPlanSubmit'
}
},
{
/** 待提交需求计划 - 详情 */
path: '/memberCenter/procurementAbility/demandPlan/demandPlanSubmit/preview',
name: '待新增需求计划',
component: '@/pages/transaction/purchaseAbility/demandPlan/detail',
hideInMenu: true,
noMargin: true,
},
]
}
]
......@@ -5,15 +5,16 @@ export interface CardType {
id?: string,
title?: string,
extra?: React.ReactNode,
backgroundColor?: string,
}
const Card: React.FC<CardType> = (props: any) => {
const { id, title, extra, children } = props;
const { id, title, extra, children, backgroundColor } = props;
return (
<div id={id} className='ant-card ant-card-bordered'>
<div className='ant-card-head'>
<div className='ant-card-head-wrapper'>
<div className='ant-card-head-wrapper'>
<div id={id} className='ant-card ant-card-bordered' style={{ overflow: 'hidden' }}>
<div className='ant-card-head' style={{ padding: 0, backgroundColor: backgroundColor ? backgroundColor : 'transparent' }}>
<div className='ant-card-head-wrapper' style={{ padding: '12px 16px' }}>
<div className='ant-card-head-wrapper' style={{ color: backgroundColor ? '#FFF' : '#303133' }}>
{title}
</div>
{extra &&
......
......@@ -2,11 +2,9 @@ import React, { useContext, useEffect, useState } from 'react';
import { Tabs, Table, Row, Col, Space, Typography, Button } from 'antd';
import { Context } from '../context';
import Card from '../../../card';
import { PublicApi } from '@/services/api';
import style from './index.less';
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
import CrossSellProducts from '@/pages/transaction/purchaseAbility/offter/addOffter/modal/crossSellProducts';
import { truncate } from 'lodash';
export type effectType = {
/** 报价轮次 */
......
import React, { useContext } from 'react';
import { Context } from '../context';
import Card from '../../../card';
const BidLayout = () => {
const context = useContext(Context);
console.log(context.awardResults)
return (
<Card
id='bidLayout'
title='中标通知'
backgroundColor='#00B37A'
>
<div style={{ whiteSpace: 'pre' }}>{context.awardResults}</div>
</Card>
)
}
export default BidLayout;
.tableStyle {
:global {
.ant-table-thead {
tr {
th {
padding: 10px;
.ant-space-item {
margin-bottom: 0;
}
}
}
}
.ant-table-expanded-row td {
padding: 0;
}
}
}
.childrenWrap {
background-color: #fff;
.childrenTitle {
height: 100%;
background: linear-gradient(to left, #FFFFFF, #DAF2E7);
color: #00B37A;
p {
padding-left: 16px;
margin: 0;
font-size: 12px;
height: 14px;
line-height: 14px;
}
padding: 12px 0;
}
.childrenContent {
margin-top: 8px;
p {
margin: 0;
span {
height: 12px;
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 12px;
padding-right: 10px;
}
}
}
}
import React, { useEffect, useState, useContext } from 'react';
import { Space, Typography, Table, Row, Col } from 'antd';
import { Context } from '../context';
import Card from '../../../card';
import style from './index.less';
import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
export interface BidResultProps {
fetch?: () => Promise<unknown>,
}
const BidResultLayout: React.FC<BidResultProps> = (props: any) => {
const { fetch } = props;
const [dataSource, setDataSource] = useState<any>([]);
const [totalAmount, setTotalAmount] = useState<number>(0);
const context = useContext(Context);
const columns = [
{
title: '物料编号/名称',
key: 'number',
dataIndex: 'number'
},
{
title: '规格',
key: 'model',
dataIndex: 'model'
},
{
title: '品类',
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand'
},
{
title: '采购数量/单位',
key: 'purchaseCount',
dataIndex: 'purchaseCount',
render: (text: any, record: any) => (
<>
<Typography.Text>{text}</Typography.Text>
&nbsp;
<Typography.Text type="secondary">{`(${record.unit})`}</Typography.Text>
</>
)
},
{
title: '含税/税率',
key: 'isTax',
dataIndex: 'isTax'
},
{
title: '单价(含税)',
key: 'taxUnitPrice',
dataIndex: 'taxUnitPrice'
},
{
title: (
<Space direction='vertical'>
<Typography.Text>金额(含税)</Typography.Text>
<Typography.Text>合计: ¥{totalAmount.toFixed(2)}</Typography.Text>
</Space>
),
key: 'taxPrice',
dataIndex: 'taxPrice'
}
]
/** 物料信息 */
const fetchDataSource = async (params: any) => {
await fetch({ ...params }).then((res: any) => {
if (res.code !== 1000) {
return
}
const { data } = res.data
setDataSource(data)
let total: number = 0;
data.forEach((item) => {
total += item.taxPrice
})
setTotalAmount(total)
})
}
const splitProductAttributeJson = (name: string, num: number) => {
const arr = name.split('-');
return arr[num]
}
/** 物料信息 */
useEffect(() => {
if (context.memberId) {
fetchDataSource({
id: context.purchaseInquiryId,
memberId: context.createMemberId,
memberRoleId: context.createMemberRoleId,
current: '1',
pageSize: '10',
})
}
}, [context])
return (
<Card
id='bidResultLayout'
title='授标结果'
>
<Table
className={style.tableStyle}
columns={columns}
rowKey='id'
expandable={{
expandedRowRender: record => (
<div className={style.childrenWrap}>
<Row>
<Col span={3}>
<div className={style.childrenTitle}>
<p>对应</p>
<p>招标商品</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>商品ID:</span>{record.productId}</p>
<p><span>商品名称:</span>{record.productName}</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>规格:</span>{splitProductAttributeJson(record.productAttributeJson, 0)}</p>
<p><span>品类:</span>{splitProductAttributeJson(record.productAttributeJson, 1)}</p>
</div>
</Col>
<Col span={6}>
<div className={style.childrenContent}>
<p><span>品牌:</span>{record.productBrand}</p>
</div>
</Col>
</Row>
</div>
),
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
) : (
<CaretRightOutlined onClick={e => onExpand(record, e)} />
)
}}
dataSource={dataSource}
pagination={{ size: "small" }}
/>
</Card>
)
}
export default BidResultLayout;
......@@ -30,7 +30,7 @@ const RecordLayout: React.FC<ProgressProps> = () => {
defaultValue={LOGSTATESTYPE.EXTERNALSTATES}
>
{context.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{context.externalLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
{context.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
</Radio.Group>
}
>
......
import React, { useState, useEffect, Fragment } from 'react';
import React, { useState, useEffect, Fragment, useCallback } from 'react';
import { PublicApi } from '@/services/api';
import { Tag, Badge, Tooltip, Button } from 'antd';
import { Context, BidDetailContext } from '../../components/detail/components/context';
......@@ -47,6 +47,7 @@ const ContrastPrice = () => {
const [auditDataSource, setAuditDataSource] = useState<any>([]);
const [link] = useState<string>(pathname.split('/')[pathname.split('/').length - 1]);
const [path] = useState<string>(pathname.split('/')[pathname.split('/').length - 2]);
const [companyJoinUs, setCompanyJoinUs] = useState<any>([])
const [bid, setBid] = useState<any>({});
const handleBasicEffect = (data: any) => {
......@@ -154,14 +155,10 @@ const ContrastPrice = () => {
company.push(`${item.memberName}(中标总金额(含税):¥${item.sumPrice})`)
}
})
setBid({
id,
awardResults: ` ${dataSource.memberName}${dataSource.details}》评标工作已经结束,中标人已经确定。现将中标结果公布如下:\n中标供应商: ${company.join(',')}\n中标理由:价格最低。`,
content: `贵公司参与了我公司《${dataSource.details}》竞标。在我公司综合各投标单位的基本情况,并进行充分技术交流后,经评标委员会综合评定,贵公司未能中标。我公司对贵公司的积极参与和支持深表感谢!希望下次合作成功。`,
})
setCompanyJoinUs(company)
setAuditDataSource(data)
}
Object.keys(dataSource).length > 0 && console.log(dataSource, 1008689)
const fetchLink = () => {
switch (path) {
case 'auditResultsOne':
......@@ -170,6 +167,17 @@ const ContrastPrice = () => {
return PublicApi.postPurchaseConfirmQuotedPriceStayExamineAward2
}
}
useEffect(() => {
if (link !== 'preview' && path === 'confirmResults') {
setBid({
id,
awardResults: ` ${dataSource.memberName}${dataSource.details}》评标工作已经结束,中标人已经确定。现将中标结果公布如下:\n中标供应商: ${companyJoinUs.join(',')}\n中标理由:价格最低。`,
content: `贵公司参与了我公司《${dataSource.details}》竞标。在我公司综合各投标单位的基本情况,并进行充分技术交流后,经评标委员会综合评定,贵公司未能中标。我公司对贵公司的积极参与和支持深表感谢!希望下次合作成功。`,
})
}
}, [visible, dataSource, companyJoinUs])
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
......
export const DEMANDPLAN_INTERNALSTATE_TYPE {
/** 待提交审核 */
/** 审核不通过(一级) */
/** 审核不通过(二级) */
/** 采购退回 */
}
import React from 'react';
import React, { useRef } from 'react';
import { history } from 'umi';
import Table from '../../components/table'
import { ColumnType } from 'antd/lib/table/interface';
import EyePreview from '@/components/EyePreview';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { Row, Col, Button, Badge, Space, Typography } from 'antd';
import { Row, Col, Button, Badge, Space, Typography, Popconfirm } from 'antd';
import {
OFFTER_INTERNALSTATE_COLOR,
} from '../../constants';
......@@ -13,7 +13,7 @@ import { PlayCircleOutlined, PlusOutlined, PoweroffOutlined } from '@ant-design/
const { Text } = Typography;
const DemandPlanAdded = () => {
console.log('待新增采购需求单');
const ref = useRef<any>({});
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
......@@ -23,7 +23,7 @@ const DemandPlanAdded = () => {
dataIndex: 'needPlanNo',
render: (text: any, record: any) => (
<Space direction='vertical' size={0}>
<EyePreview url={`/memberCenter/procurementAbility/offter/auditOffterOne/view?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/demandPlan/demandPlanAdded/preview?id=${record.id}`}>{text}</EyePreview>
<Text>{record.summary}</Text>
</Space>
)
......@@ -61,18 +61,39 @@ const DemandPlanAdded = () => {
dataIndex: 'operate',
render: (text: any, record: any) => (
<>
<Button
type='link'
onClick={() => history.push(`/memberCenter/procurementAbility/offter/auditOffterOne/detail?id=${record.id}&number=${record.quotedPriceNo}`)}
>
审核
</Button>
<Button type='link' onClick={() => handleSubmit(record.id)}>提交</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/procurementAbility/demandPlan/demandPlanAdded/edit?id=${record.id}`)}>修改</Button>
<Popconfirm title="确定要删除吗?" okText="是" cancelText="否" onConfirm={() => handleDelect(record.id)}>
<Button type='link'>
删除
</Button>
</Popconfirm>
</>
)
}];
const handleSubmit = async (id: number) => {
await PublicApi.postPurchaseNeedPlanSubmitExam({ id }).then(res => {
if (res.code !== 1000) {
return
}
ref.current.reload();
})
}
const handleDelect = async (id: number) => {
await PublicApi.postPurchaseNeedPlanDelete({ id }).then(res => {
if (res.code !== 1000) {
return
}
ref.current.reload();
})
}
return (
<Table
reload={ref}
schemaType="DEMANDPLANADDED_SECHEMA"
columns={columns}
effects="needPlanNo"
......
import React, { Fragment, useEffect, useState } from 'react';
import { Badge, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { Context } from '../../components/detail/components/context';
import PeripheralLayout from '../../components/detail';
import ProgressLayout from '../../components/detail/components/progressLayout';
import BasicLayout from '../../components/detail/components/basicLayout';
import RecordLyout from '../../components/detail/components/recordLyout';
import moment from 'moment';
import {
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
import { CheckCircleOutlined } from '@ant-design/icons';
import MaterialLayout from '../../components/detail/components/materialLayout';
import ModalOperate from '../../components/modalOperate';
const ICON_STYLE: any = {
color: '#C0C4CC',
fontSize: '14px',
marginLeft: '5px'
}
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'materialLayout', title: '采购物料' },
{ id: 'recordLyout', title: '流转记录' },
]
const DemandDetailed = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const {
query: {
id,
number
},
pathname,
} = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const handleBasicEffect = (data: any) => {
setBasicEffect([
{
col: [
{ label: '需求计划编号', extra: data.needPlanNo },
{ label: '需求计划摘要', extra: data.summary },
{ label: '内部状态', extra: <Badge status={OFFTER_INTERNALSTATE_COLOR[data.innerStatus]} text={data.innerStatusName} /> },
]
},
{
col: [
{ label: '需求计划开始', extra: format(data.startTime) },
{ label: '需求计划截止', extra: format(data.endTime) },
]
},
{
col: [
{ label: '编制部门', extra: data.department },
{ label: '编制人', extra: data.userName },
{ label: '编制时间', extra: format(data.createTime) },
]
},
])
}
const fetchDataSource = async () => {
const params = {
id,
}
await PublicApi.getPurchaseNeedPlanDetails({ ...params }).then(res => {
if (res.code !== 1000) {
history.goBack();
return;
}
const { data } = res;
setDataSource(data);
handleBasicEffect(data);
})
}
useEffect(() => {
fetchDataSource();
}, [])
const fetchLink = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'auditInquiryOne':
fetchSoure = PublicApi.postPurchasePurchaseInquiryExamine1
break;
case 'auditInquiryTwo':
fetchSoure = PublicApi.postPurchasePurchaseInquiryExamine2
break;
}
return fetchSoure
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.purchaseInquiryNo}
tabLink={TABLINK}
effect={
<>
{path === 'detail'
&& (
<Button
onClick={() => setVisible(true)}
type='primary'
>
<CheckCircleOutlined />
单据审核
</Button>
)}
</>
}
components={
<Fragment>
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<MaterialLayout
id={id}
number={number}
fetch={PublicApi.getPurchasePurchaseInquiryProductlistList}
/>
<RecordLyout />
</Fragment>
}
/>
<ModalOperate
id={id}
title="单据审核"
modalType="audit"
visible={visible}
fetch={fetchLink()}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
/>
</Context.Provider>
)
}
export default DemandDetailed;
......@@ -19,8 +19,10 @@ import {
OFFTER_INTERNALSTATE_COLOR
} from '../../constants';
import { CheckCircleOutlined, LinkOutlined } from '@ant-design/icons';
import BidLayout from '../../components/detail/components/bidLayout';
import BidResultLayout from '../../components/detail/components/bidResultLayout';
const TABLINK = [
const TABLINK1 = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'contrastLyout', title: '报价信息' },
......@@ -28,6 +30,16 @@ const TABLINK = [
{ id: 'recordLyout', title: '流转记录' },
]
const TABLINK2 = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'bidLayout', title: '中标通知' },
{ id: 'bidResultLayout', title: '授标结果' },
{ id: 'contrastLyout', title: '报价信息' },
{ id: 'otherLyout', title: '其他说明' },
{ id: 'recordLyout', title: '流转记录' },
]
const QuoteDetails = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
......@@ -139,7 +151,7 @@ const QuoteDetails = () => {
<PeripheralLayout
no={dataSource.quotedPriceNo}
detail={dataSource.quotedDetails}
tabLink={TABLINK}
tabLink={(pathPci === 'offter' && dataSource.externalState === 99) ? TABLINK2 : TABLINK1}
effect={
<>
{path === 'detail'
......@@ -158,6 +170,14 @@ const QuoteDetails = () => {
<Fragment>
<ProgressLayout />
<BasicLayout effect={basicEffect} />
{(pathPci === 'offter' && dataSource.externalState === 99) && (
<>
<BidLayout />
<BidResultLayout
fetch={PublicApi.getPurchaseQuotedPriceProductlistListContract}
/>
</>
)}
<BidInfoLayout
fetch={PublicApi.getPurchaseQuotedPriceMaterielDetailed}
effect={{ turn, id }}
......
......@@ -150,7 +150,6 @@ const Material: React.FC<Iprops> = (props: any) => {
style={{ margin: 0 }}
name={`brand_${index + 1}`}
initialValue={text}
rules={[{ required: true, message: '请输入' }]}
>
<Input onChange={(e) => handleEdit(e, 'brand', index)} />
</Form.Item>
......
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