Commit 491920ff authored by 卢均锐's avatar 卢均锐

chore: 修改采购竞价接口引入方式

parent 1692708f
......@@ -5,7 +5,7 @@ import { ArrowLeftOutlined } from '@ant-design/icons';
import isEmpty from 'lodash/isEmpty'
import { observer } from 'mobx-react'
import { PublicApi } from '@/services/api';
import { getPurchaseOnlineBiddingBiddingDetails } from '@/services/PurchaseV2Api';
import { priceFormat } from '@/utils/numberFomat';
import { formatTimeString } from '@/utils';
import { toChatRoom } from '@/utils/im';
......@@ -56,7 +56,7 @@ const Detail = () => {
current: '1',
pageSize: '1'
}
await PublicApi.getPurchaseOnlineBiddingBiddingDetails({ ...params }).then(res => {
await getPurchaseOnlineBiddingBiddingDetails({ ...params }).then(res => {
if (res.code !== 1000) {
history.goBack();
return;
......
......@@ -7,7 +7,7 @@ import { ENTERPRISE_CENTER_URL } from '@/constants'
import { formatTimeString } from '@/utils'
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import { getPurchaseOnlineBiddingStayExamineBiddingSignup } from '@/services/PurchaseV2Api';
import Table from '../../components/table'
......@@ -91,7 +91,7 @@ const ReadySignUp = () => {
schemaType="ONLINEBIDREADYSIGN_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseOnlineBiddingStayExamineBiddingSignup}
fetch={getPurchaseOnlineBiddingStayExamineBiddingSignup}
reload={ref}
/>
)
......
......@@ -7,7 +7,8 @@ import { SaveOutlined } from '@ant-design/icons'
import { ArrayTable } from '@formily/antd-components'
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect'
import { PublicApi } from '@/services/api'
import { getManageCountryAreaGetTelCode } from '@/services/ManageV2Api'
import { postPurchaseOnlineBiddingOnlineSignup, getPurchaseOnlineBiddingDetails } from '@/services/PurchaseV2Api'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import NiceForm from '@/components/NiceForm'
import ReutrnEle from '@/components/ReturnEle';
......@@ -36,7 +37,7 @@ const SignUpForm = () => {
const getCountryCodeId = async () => {
const res = await PublicApi.getManageCountryAreaGetTelCode()
const res = await getManageCountryAreaGetTelCode()
if (res.code === 1000) {
let _value = ''
for (let i = 0; i < res.data.length; i++) {
......@@ -66,7 +67,7 @@ const SignUpForm = () => {
console.log(_params)
setBtnLoading(true);
setRefundDisabled(true);
PublicApi.postPurchaseOnlineBiddingOnlineSignup(_params).then(res => {
postPurchaseOnlineBiddingOnlineSignup(_params).then(res => {
if (res.code === 1000) {
history.goBack()
} else {
......@@ -97,7 +98,7 @@ const SignUpForm = () => {
pageSize: '1'
}
setFormLoading(true)
await PublicApi.getPurchaseOnlineBiddingDetails({ ...params }).then(res => {
await getPurchaseOnlineBiddingDetails({ ...params }).then(res => {
setFormLoading(false)
if (res.code !== 1000) {
history.goBack();
......
......@@ -6,88 +6,88 @@ import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
import { formatTimeString } from '@/utils'
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import { getPurchaseOnlineBiddingList, getPurchaseOnlineBiddingExternalStatus, getPurchaseOnlineBiddingInteriorStatus } from '@/services/PurchaseV2Api';
import Table from '../../components/table'
import {
BID_EXTERNALSTATE_COLOR,
BID_INTERNALSTATE_COLOR
BID_EXTERNALSTATE_COLOR,
BID_INTERNALSTATE_COLOR
} from '../../constants/purchaseBid';
const { Text } = Typography;
const Search = () => {
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
render: (t, r, i) => ++i
}, {
title: '竞价单号/摘要',
key: 'biddingNo',
dataIndex: 'biddingNo',
render: (text: any, record: any) => (
<Space direction='vertical' style={{width: 300}}>
<EyePreview
url={`/memberCenter/procurementAbility/onlineBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
)
}, {
title: '采购会员',
key: 'createMemberName',
dataIndex: 'createMemberName',
render: (text: any, record: any) => text
}, {
title: '竞价开始/结束时间',
key: 'biddingStartTime',
dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.biddingStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.biddingEndTime)}</div>
</>,
width: 180
}, {
title: '报名开始/结束时间',
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.startSignUp)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.endSignUp)}</div>
</>,
width: 180
}, {
title: '是否中标',
key: 'isPrize',
dataIndex: 'isPrize',
render: (text: any, record: any) => <>
{(text !== 1 && text !== 0) ? null : <StatusTag type={text ? 'success' : 'danger'} title={text ? '是' : '否'} />}
</>
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR(text)} text={record.interiorStateName} />
}];
return (
<Table
schemaType="ONLINEBIDORDER_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseOnlineBiddingList}
externalStatusFetch={PublicApi.getPurchaseOnlineBiddingExternalStatus}
interiorStatusFetch={PublicApi.getPurchaseOnlineBiddingInteriorStatus}
reload={ref}
/>
const ref = useRef<any>({});
const columns: ColumnType<any>[] = [{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
render: (t, r, i) => ++i
}, {
title: '竞价单号/摘要',
key: 'biddingNo',
dataIndex: 'biddingNo',
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<EyePreview
url={`/memberCenter/procurementAbility/onlineBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
)
}, {
title: '采购会员',
key: 'createMemberName',
dataIndex: 'createMemberName',
render: (text: any, record: any) => text
}, {
title: '竞价开始/结束时间',
key: 'biddingStartTime',
dataIndex: 'biddingStartTime',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.biddingStartTime)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.biddingEndTime)}</div>
</>,
width: 180
}, {
title: '报名开始/结束时间',
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
<div><PlayCircleOutlined />&nbsp;{formatTimeString(record.startSignUp)}</div>
<div><PoweroffOutlined />&nbsp;{formatTimeString(record.endSignUp)}</div>
</>,
width: 180
}, {
title: '是否中标',
key: 'isPrize',
dataIndex: 'isPrize',
render: (text: any, record: any) => <>
{(text !== 1 && text !== 0) ? null : <StatusTag type={text ? 'success' : 'danger'} title={text ? '是' : '否'} />}
</>
}, {
title: '外部状态',
key: 'externalState',
dataIndex: 'externalState',
render: (text: any, record: any) => <StatusTag type={BID_EXTERNALSTATE_COLOR(text)} title={record.externalStateName} />
}, {
title: '内部状态',
key: 'interiorState',
dataIndex: 'interiorState',
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR(text)} text={record.interiorStateName} />
}];
return (
<Table
schemaType="ONLINEBIDORDER_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={getPurchaseOnlineBiddingList}
externalStatusFetch={getPurchaseOnlineBiddingExternalStatus}
interiorStatusFetch={getPurchaseOnlineBiddingInteriorStatus}
reload={ref}
/>
)
}
export default Search
......@@ -3,7 +3,7 @@ import { Badge, Popconfirm, Button } from 'antd';
import { history } from 'umi';
import { CheckCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { getPurchaseBiddingStaySubmitDetails, getPurchaseBiddingDetails, postPurchaseBiddingExamine, postPurchaseBiddingExamine1, postPurchaseBiddingExamine2, postPurchaseBiddingSubmit, postPurchaseBiddingExaminBiddingSignup, postPurchaseBiddingSubmitBidding1, postPurchaseBiddingSubmitBidding2, getPurchaseBiddingMaterielPage, getPurchaseBiddingMemberPage, postPurchaseBiddingUpdateBiddingReturn, postPurchaseBiddingSubmitExamineBiddingReturn, postPurchaseBiddingStayConfirmBidding, getPurchaseBiddingQuotedPriceDetaild } from '@/services/PurchaseV2Api';
import { GlobalConfig } from '@/global/config'
import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
......@@ -243,7 +243,7 @@ const SearchDetail = () => {
pageSize: '1'
}
const _fetch = pathPci === 'readySubmitExamineResult' ? PublicApi.getPurchaseBiddingStaySubmitDetails : PublicApi.getPurchaseBiddingDetails
const _fetch = pathPci === 'readySubmitExamineResult' ? getPurchaseBiddingStaySubmitDetails : getPurchaseBiddingDetails
await _fetch({ ...params }).then(res => {
if (res.code !== 1000) {
......@@ -274,7 +274,7 @@ const SearchDetail = () => {
/** 提交 */
const fetchSubmitBatch = async () => {
let res = null;
res = await PublicApi.postPurchaseBiddingExamine({ id });
res = await postPurchaseBiddingExamine({ id });
if (res.code === 1000) {
history.goBack();
}
......@@ -321,7 +321,7 @@ const SearchDetail = () => {
default:
return null
}
}else{
} else {
return null
}
}
......@@ -330,22 +330,22 @@ const SearchDetail = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'readyExamineOne':
fetchSoure = PublicApi.postPurchaseBiddingExamine1
fetchSoure = postPurchaseBiddingExamine1
break;
case 'readyExamineTwo':
fetchSoure = PublicApi.postPurchaseBiddingExamine2
fetchSoure = postPurchaseBiddingExamine2
break;
case 'readySubmit':
fetchSoure = PublicApi.postPurchaseBiddingSubmit
fetchSoure = postPurchaseBiddingSubmit
break;
case 'readyExamineSignUp':
fetchSoure = PublicApi.postPurchaseBiddingExaminBiddingSignup
fetchSoure = postPurchaseBiddingExaminBiddingSignup
break;
case 'readyExamineResultOne':
fetchSoure = PublicApi.postPurchaseBiddingSubmitBidding1
fetchSoure = postPurchaseBiddingSubmitBidding1
break;
case 'readyExamineResultTwo':
fetchSoure = PublicApi.postPurchaseBiddingSubmitBidding2
fetchSoure = postPurchaseBiddingSubmitBidding2
break;
}
return fetchSoure
......@@ -380,7 +380,7 @@ const SearchDetail = () => {
<MaterialLayout
id={id}
number={number}
fetch={PublicApi.getPurchaseBiddingMaterielPage}
fetch={getPurchaseBiddingMaterielPage}
layoutTitle='采购物料'
/>
)
......@@ -530,7 +530,7 @@ const SearchDetail = () => {
<DemandLayout
bidId={id}
number={number}
fetch={PublicApi.getPurchaseBiddingMemberPage}
fetch={getPurchaseBiddingMemberPage}
storeList={storeList}
title='对接方式' />
)
......@@ -576,7 +576,7 @@ const SearchDetail = () => {
signUpIdea,
urls
}
const _fetch = button === 1 ? PublicApi.postPurchaseBiddingUpdateBiddingReturn : PublicApi.postPurchaseBiddingSubmitExamineBiddingReturn;
const _fetch = button === 1 ? postPurchaseBiddingUpdateBiddingReturn : postPurchaseBiddingSubmitExamineBiddingReturn;
setConfirmLoading(true)
_fetch(_params).then(res => {
if (res.code === 1000) {
......@@ -622,7 +622,7 @@ const SearchDetail = () => {
record={{ ...dataSource, memberName: memberName }}
visible={confirmBidResultVisible}
onCancel={() => setConfirmBidResultVisible(false)}
fetch={PublicApi.postPurchaseBiddingStayConfirmBidding}
fetch={postPurchaseBiddingStayConfirmBidding}
onOk={() => { history.goBack() }}
/>
<SubmitResultModal
......@@ -633,7 +633,7 @@ const SearchDetail = () => {
confirmLoading={confirmLoading}
/>
<QuotationDetailsDrawer
fetch={PublicApi.getPurchaseBiddingQuotedPriceDetaild}
fetch={getPurchaseBiddingQuotedPriceDetaild}
quotationDetailsId={quotationDetailsId}
number={number}
effects='id'
......
......@@ -5,7 +5,7 @@ import { SaveOutlined } from '@ant-design/icons';
import { Tabs, Card, Button, Badge } from 'antd';
import ReutrnEle from '@/components/ReturnEle';
import { PublicApi } from '@/services/api';
import { postPurchaseBiddingUpdate, postPurchaseBiddingAdd, getPurchaseBiddingDetails } from '@/services/PurchaseV2Api';
import { getAuth } from '@/utils/auth';
import Material from '../../purchaseInquiry/addInquiry/components/material';
......@@ -96,9 +96,9 @@ const AddForm = () => {
time: number,
} = null;
if (id) {
res = await PublicApi.postPurchaseBiddingUpdate({ id, ...params })
res = await postPurchaseBiddingUpdate({ id, ...params })
} else {
res = await PublicApi.postPurchaseBiddingAdd({ ...params });
res = await postPurchaseBiddingAdd({ ...params });
}
if (res.code !== 1000) {
setLoading(false);
......@@ -128,7 +128,7 @@ const AddForm = () => {
current: '1',
pageSize: '1',
}
PublicApi.getPurchaseBiddingDetails(parmas).then((res: any) => {
getPurchaseBiddingDetails(parmas).then((res: any) => {
if (res.code === 1000) {
const params = res.data;
const basicInfo = { ...basic };
......
......@@ -12,7 +12,7 @@ import {
} from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { getManageAreaAll, getManageAreaByPcodeAll } from '@/services/ManageV2Api';
import { formatTimeString } from '@/utils'
import { validatorByte } from '../../validator';
......@@ -54,7 +54,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
/** 获取所有地区 */
const manageProvince = () => {
return new Promise(resolve => {
PublicApi.getManageAreaAll().then(res => {
getManageAreaAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
......@@ -74,7 +74,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
if (num === 1) {
await province.forEach(item => {
if (item.code === val) {
PublicApi.getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
getManageAreaByPcodeAll({ pcode: val }).then((res: any) => {
if (res.code === 1000) {
result[idx].provinceCode = val;
result[idx].province = item.name;
......@@ -162,7 +162,7 @@ const BasicInfo: React.FC<Iprops> = (props: any) => {
if (Object.keys(fetchdata).length > 0) {
setrequisitionFormAddress([...fetchdata.areas]);
fetchdata.areas.forEach((item: any, index: number) => {
PublicApi.getManageAreaByPcodeAll({ pcode: item.provinceCode }).then((res: any) => {
getManageAreaByPcodeAll({ pcode: item.provinceCode }).then((res: any) => {
if (res.code === 1000) {
const citydata = {
citydata: res.data
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Form, Input, DatePicker, Select } from 'antd';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api';
import { validatorByte } from '../../validator';
......@@ -39,7 +39,7 @@ const Condition: React.FC<Iprops> = (props: any) => {
const [selAddress, setSelAddress] = useState<ADDRESS_TYPE>();
/** 获取交付地址 */
const handleGetLogistics = async () => {
const service = PublicApi.getLogisticsSelectListReceiverAddress;
const service = getLogisticsSelectListReceiverAddress;
const res = await service();
if (res.code === 1000) {
setAddress(res.data);
......
......@@ -6,7 +6,7 @@ import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import { getPurchaseBiddingStayBiddingList } from '@/services/PurchaseV2Api';
import { formatTimeString } from '@/utils'
import Table from '../../components/table'
......@@ -76,7 +76,7 @@ const ReadyBid = () => {
schemaType="PURCHASEBIDOSIGNUP_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseBiddingStayBiddingList}
fetch={getPurchaseBiddingStayBiddingList}
/>
)
}
......
......@@ -3,7 +3,7 @@ import { Row, Col, Input, Drawer, Table, Space, Typography, message, Form } from
import { ColumnType } from 'antd/lib/table/interface';
import { priceFormat } from '@/utils/numberFomat';
import { PublicApi } from '@/services/api';
import { postPurchaseOnlineBiddingSubmitReportPrice } from '@/services/PurchaseV2Api';
import BtnItem from '../../../../../../components/detail/components/bidDetailBtnItem';
......@@ -164,7 +164,7 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
materiels: _dataSource2,
}
setBtnLoading(true);
PublicApi.postPurchaseOnlineBiddingSubmitReportPrice(_params).then(res => {
postPurchaseOnlineBiddingSubmitReportPrice(_params).then(res => {
if (res.code === 1000) {
onClose && onClose();
}
......
......@@ -6,7 +6,7 @@ import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
import { ENTERPRISE_CENTER_URL } from '@/constants'
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import { getPurchaseBiddingStayConfirmBiddingList, postPurchaseBiddingStayConfirmBidding } from '@/services/PurchaseV2Api';
import { formatTimeString } from '@/utils'
import ConfirmBidResultModal from '../components/confirmBidResultModal';
......@@ -99,13 +99,13 @@ const ReadyConfirm = () => {
schemaType="PURCHASEBIDOSIGNUP_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseBiddingStayConfirmBiddingList}
fetch={getPurchaseBiddingStayConfirmBiddingList}
/>
<ConfirmBidResultModal
record={confirmRecord}
title="确认竞价结果"
visible={confirmBidResultVisible}
fetch={PublicApi.postPurchaseBiddingStayConfirmBidding}
fetch={postPurchaseBiddingStayConfirmBidding}
onCancel={() => setConfirmBidResultVisible(false)}
onOk={handleOnOk}
/>
......
......@@ -6,7 +6,7 @@ import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons';
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { PublicApi } from '@/services/api';
import { postPurchaseBiddingExamine1, postPurchaseBiddingExamine1Batch, getPurchaseBiddingStayExamineList1 } from '@/services/PurchaseV2Api';
import { formatTimeString } from '@/utils'
import ModalOperate from '../../components/modalOperate';
......@@ -74,9 +74,9 @@ const ReadyExamineOne = () => {
const fetchSubmitBatch = async (id?: number) => {
let res = null;
if (id) {
res = await PublicApi.postPurchaseBiddingExamine1({ id, state: 1 });
res = await postPurchaseBiddingExamine1({ id, state: 1 });
} else {
res = await PublicApi.postPurchaseBiddingExamine1Batch({ ids: rowkeys });
res = await postPurchaseBiddingExamine1Batch({ ids: rowkeys });
}
if (res.code === 1000) {
ref.current.reload();
......@@ -104,7 +104,7 @@ const ReadyExamineOne = () => {
schemaType="PURCHASEBIDREADYADD_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseBiddingStayExamineList1}
fetch={getPurchaseBiddingStayExamineList1}
controllerBtns={
<Row>
<Col span={24}>
......@@ -125,7 +125,7 @@ const ReadyExamineOne = () => {
title="单据审核"
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExamine1}
fetch={postPurchaseBiddingExamine1}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
......
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