Commit a041bf8c authored by 前端-许冠华's avatar 前端-许冠华

Merge branch 'v2-220418-fixPurchaseBid' into 'v2-220418'

V2 220418 fix purchase bid See merge request linkseeks-design/pro-platform!119
parents 3e279f70 6e665639
......@@ -126,10 +126,10 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
{ required: true, message: intl.formatMessage({ id: 'detail.purchase.message45' }) }, () => ({
async validator(_, value) {
let _exVal = await exRef.current.biddingTime();
if (_exVal[0] && moment(value[1]).isAfter(_exVal[0])) {
if (_exVal?.[0] && value?.[1] && moment(value?.[1]).isAfter(_exVal?.[0])) {
return Promise.reject(new Error(intl.formatMessage({ id: 'detail.purchase.message46' })));
}
if (!value[0] || !value[1]) {
if (!value?.[0] || !value?.[1]) {
return Promise.reject(new Error(intl.formatMessage({ id: 'detail.purchase.message45' })));
} else {
return Promise.resolve();
......
......@@ -116,10 +116,10 @@ const BidRules: React.FC<Iprops> = (props: any) => {
{ required: true, message: intl.formatMessage({ id: 'detail.purchase.message47' }) }, () => ({
async validator(_, value) {
let _exVal = await exRef.current.signUpTime();
if (_exVal[1] && moment(value[0]).isBefore(_exVal[1])) {
if (_exVal?.[1] && value?.[0] && moment(value?.[0]).isBefore(_exVal?.[1])) {
return Promise.reject(new Error(intl.formatMessage({ id: 'detail.purchase.message48' })));
}
if (!value[0] || !value[1]) {
if (!value?.[0] || !value?.[1]) {
return Promise.reject(new Error(intl.formatMessage({ id: 'detail.purchase.message47' })));
} else {
return Promise.resolve();
......@@ -139,7 +139,7 @@ const BidRules: React.FC<Iprops> = (props: any) => {
</Form.Item>
<Form.Item
name='isStartingPrice'
label={<Tooltip placement="right" title={intl.formatMessage({ id: 'ddetail.purchase.tips9' })}>{intl.formatMessage({ id: 'detail.purchase.startingPrice' })}<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
label={<Tooltip placement="right" title={intl.formatMessage({ id: 'detail.purchase.tips9' })}>{intl.formatMessage({ id: 'detail.purchase.startingPrice' })}<QuestionCircleOutlined style={{ marginLeft: '5px' }} /></Tooltip>}
>
<Checkbox checked={isStartingPrice} onChange={(e) => { onCheckboxChange(e, setIsStartingPrice, 'startingPrice') }}>{intl.formatMessage({ id: 'detail.purchase.isStartingPrice' })}</Checkbox>
</Form.Item>
......
import React, { useRef, useState,useEffect,useCallback } from 'react';
import { getIntl, history } from 'umi';
import { ColumnType } from 'antd/lib/table/interface';
import { Row, Col, Space, Button, Typography, Popconfirm, Badge, Menu, Dropdown } from 'antd';
import { Row, Col, Space, Button, Typography, Popconfirm, Badge, Menu, Dropdown, message, Modal } from 'antd';
import { PlusOutlined, PlayCircleOutlined, PoweroffOutlined, CaretDownOutlined } from '@ant-design/icons';
import { formatTimeString } from '@/utils'
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { postPurchaseBiddingExamine, postPurchaseBiddingExamineBatch, postPurchaseBiddingDelete, postPurchaseBiddingDeleteBatch, getPurchaseBiddingAwaitNewList,getPurchaseBiddingAwaitShopNewList } from '@/services/PurchaseV2Api';
import { getTemplateWebMemberPurchaseWebFindCurrMemberPurchase } from '@/services/TemplateV2Api';
import Table from '../../components/table'
......@@ -174,6 +175,24 @@ const ReadyAdd = () => {
}
},[isShop])
const addFn = async () => {
await getTemplateWebMemberPurchaseWebFindCurrMemberPurchase().then(res => {
if (res.code !== 1000) {
message.error(intl.formatMessage({ id: `${res.code}` }));
return
}
if (!res.data) {
Modal.warning({
title: intl.formatMessage({ id: 'table.purchase.moduleWarning' }),
content: intl.formatMessage({ id: 'table.purchase.moduleWarning1' }),
okText: intl.formatMessage({ id: 'detail.purchase.confirm' }),
onOk: () => history.push('/memberCenter/procurementAbility/purchasDoor/purchasInfo'),
})
return
}
history.push(`/memberCenter/procurementAbility/purchaseBid/${isShop ? 'readyAddShop' : 'readyAdd'}/add`)
})
}
return (
......@@ -191,7 +210,7 @@ const ReadyAdd = () => {
<Space size={16}>
<AuthButton btnCode='readyAdd.add'>
<Button
onClick={() => history.push(`/memberCenter/procurementAbility/purchaseBid/${isShop ? 'readyAddShop' : 'readyAdd'}/add`)}
onClick={addFn}
type="primary"
icon={<PlusOutlined />}
>
......
......@@ -49,7 +49,7 @@ const ReadyConfirm = () => {
key: 'memberName',
dataIndex: 'memberName',
render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
<EyePreview type='button' class>{text}</EyePreview>
)
}, {
title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
......
......@@ -43,7 +43,7 @@ const ReadyExamineResultOne = () => {
key: 'memberName',
dataIndex: 'memberName',
render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
<EyePreview type='button' class>{text}</EyePreview>
)
}, {
title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
......
......@@ -43,7 +43,7 @@ const ReadyExamineResultTwo = () => {
key: 'memberName',
dataIndex: 'memberName',
render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
<EyePreview type='button' class>{text}</EyePreview>
)
}, {
title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
......
......@@ -49,7 +49,7 @@ const ReadyExamineSignUp = () => {
dataIndex: 'signUpTime',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{record.createMemberName}</EyePreview>
<EyePreview type='button' class>{record.createMemberName}</EyePreview>
<Text type='secondary'>{formatTimeString(record.signUpTime)}</Text>
</Space>
)
......
......@@ -45,7 +45,7 @@ const ReadySubmitExamineResult = () => {
key: 'memberName',
dataIndex: 'memberName',
render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
<EyePreview type='button' class>{text}</EyePreview>
)
}, {
title: intl.formatMessage({ id: 'table.purchase.biddingStartTime' }),
......
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