Commit 70feed17 authored by 卢均锐's avatar 卢均锐

feat: 重构采购竞价

-暂存相关修改
parent 737bc0e5
......@@ -52,6 +52,34 @@ export const purchaseBidRoute = [
hideInMenu: true,
noMargin: true,
},
// 待新增商城采购竞价单
{
path: '/memberCenter/procurementAbility/purchaseBid/readyAddShop',
name: '待新增商城采购竞价单',
component: '@/pages/transaction/purchaseAbility/purchaseBid/readyAdd'
},
// 新增商城采购竞价单
{
path: '/memberCenter/procurementAbility/purchaseBid/readyAddShop/add',
name: '新增商城采购竞价单',
component: '@/pages/transaction/purchaseAbility/purchaseBid/readyAdd/add',
hideInMenu: true
},
// 修改商城采购竞价单
{
path: '/memberCenter/procurementAbility/purchaseBid/readyAddShop/modify',
name: '修改商城采购竞价单',
component: '@/pages/transaction/purchaseAbility/purchaseBid/readyAdd/add',
hideInMenu: true
},
// 待新增商城采购竞价单详情
{
path: '/memberCenter/procurementAbility/purchaseBid/readyAddShop/detail',
name: '待新增商城采购竞价单详情',
component: '@/pages/transaction/purchaseAbility/purchaseBid/detail',
hideInMenu: true,
noMargin: true,
},
// 待审核采购竞价单(一级)
{
path: '/memberCenter/procurementAbility/purchaseBid/readyExamineOne',
......@@ -189,4 +217,3 @@ export const purchaseBidRoute = [
]
},
]
\ No newline at end of file
......@@ -583,7 +583,7 @@ const AddressSelect: React.FC<AddressSelectProps> = (props) => {
flag: false,
};
});
editAddressId.current = id;
}, 20);
} else {
......@@ -610,7 +610,7 @@ const AddressSelect: React.FC<AddressSelectProps> = (props) => {
const current = list.find((item) => item.id === value?.id);
const full = current ? `${current.name} ${current.fullAddress} ${current.phone}` : null;
const isStr = typeof value === 'string';
console.log(value)
return (
<div>{full || (!isStr ? `${value?.name || ''} ${value?.fullAddress || ''} ${value?.phone || ''}` : value)}</div>
);
......
......@@ -71,43 +71,43 @@ const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
key: 'levelTag',
dataIndex: 'levelTag',
},
{
title: intl.formatMessage({ id: 'detail.purchase.isSubMember' }),
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (text: any) => (<StatusTag type={text ? 'success' : 'danger'} title={text ? intl.formatMessage({ id: 'detail.purchase.okText' }) : intl.formatMessage({ id: 'detail.purchase.cancelText' })} />)
},
{
title: (
<>
<span>{intl.formatMessage({ id: 'detail.purchase.demendSend' })}</span>
<Tooltip placement="top" title={intl.formatMessage({ id: 'detail.purchase.tips5' })}>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (text: any) => (
<Switch checked={text} disabled={true} />
)
},
{
title: intl.formatMessage({ id: 'table.purchase.operate' }),
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
{intl.formatMessage({ id: 'detail.purchase.entryMall' })}
</Typography.Link>
)
},
// {
// title: intl.formatMessage({ id: 'detail.purchase.isSubMember' }),
// key: 'membershipOrNot',
// dataIndex: 'membershipOrNot',
// render: (text: any) => (<StatusTag type={text ? 'success' : 'danger'} title={text ? intl.formatMessage({ id: 'detail.purchase.okText' }) : intl.formatMessage({ id: 'detail.purchase.cancelText' })} />)
// },
// {
// title: (
// <>
// <span>{intl.formatMessage({ id: 'detail.purchase.demendSend' })}</span>
// <Tooltip placement="top" title={intl.formatMessage({ id: 'detail.purchase.tips5' })}>
// <QuestionCircleOutlined
// style={{
// marginLeft: '5px',
// fontSize: '14px',
// color: '#909399'
// }}
// />
// </Tooltip>
// </>
// ),
// key: 'state',
// dataIndex: 'state',
// render: (text: any) => (
// <Switch checked={text} disabled={true} />
// )
// },
// {
// title: intl.formatMessage({ id: 'table.purchase.operate' }),
// key: 'operate',
// dataIndex: 'operate',
// render: (_text: any, _record: any) => (
// <Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
// {intl.formatMessage({ id: 'detail.purchase.entryMall' })}
// </Typography.Link>
// )
// },
]
......
......@@ -128,7 +128,7 @@ const RecordLayout: React.FC<ProgressProps> = (props: any) => {
defaultValue={LOGSTATESTYPE.EXTERNALSTATES}
>
{context.externalLogs && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>{intl.formatMessage({ id: 'detail.purchase.externalLogStates' })}</Radio.Button>}
{context.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>{intl.formatMessage({ id: 'detail.interiorLogStates' })}</Radio.Button>}
{context.interiorLogs && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>{intl.formatMessage({ id: 'detail.purchase.interiorLogStates' })}</Radio.Button>}
</Radio.Group>
}
>
......
......@@ -26,7 +26,9 @@ export interface IProps {
onCancel?: () => void,
onOk?: () => void,
fetch?: () => Promise<unknown>,
maxNumber?: number
maxNumber?: number,
createMemberId?: any,
createMemberRoleId?: any
}
const ModalOperate: React.FC<IProps> = (props: any) => {
......@@ -40,6 +42,8 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
modalType,
fetch,
maxNumber,
createMemberId,
createMemberRoleId
} = props;
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
......@@ -220,6 +224,10 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
if (modalType === 'audit') {
params.state = value.state;
value.state !== 1 && (params.auditOpinion = value.auditOpinion);
// 采购竞价新增 start
createMemberId && (params.memberId = createMemberId);
createMemberRoleId && (params.memberRoleId = createMemberRoleId);
// 采购竞价新增 end
} else if (modalType === 'abandon') {
params.reason = value.reason
params.reasonTime = new Date(value.reasonTime).getTime();
......
......@@ -35,7 +35,7 @@ const Search = () => {
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<EyePreview
type={AuthUrl('onlineBid.see') ? 'link' : 'button'}
// type={AuthUrl('onlineBid.see') ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/onlineBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
......
......@@ -37,17 +37,17 @@ const transforType = {
const TABLINK = [
{ id: 'progressLayout', title: intl.formatMessage({ id: 'detail.purchase.progressLayout' }) },
{ id: 'bidResultLayout', title: intl.formatMessage({ id: 'detail.purchase.bidResultLayout' }), include: ['search', 'readyAdd', 'readyBid'] },
{ id: 'bidResultLayout', title: intl.formatMessage({ id: 'detail.purchase.bidResultLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyBid'] },
{ id: 'basicLayout', title: intl.formatMessage({ id: 'detail.purchase.basicLayout' }) },
{ id: 'materialLayout', title: intl.formatMessage({ id: 'detail.purchase.materialLayout' }), include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'bidRulesLayout', title: intl.formatMessage({ id: 'detail.purchase.bidRulesLayout' }), include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'signUpLayout', title: intl.formatMessage({ id: 'detail.purchase.signUpLayout' }), include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readyExamineSignUp', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'signUpMsgLayout', title: intl.formatMessage({ id: 'detail.purchase.signUpMsgLayout' }), include: ['search', 'readyAdd', 'readyExamineSignUp', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'materialLayout', title: intl.formatMessage({ id: 'detail.purchase.materialLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'bidRulesLayout', title: intl.formatMessage({ id: 'detail.purchase.bidRulesLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'signUpLayout', title: intl.formatMessage({ id: 'detail.purchase.signUpLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readyExamineSignUp', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'signUpMsgLayout', title: intl.formatMessage({ id: 'detail.purchase.signUpMsgLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyExamineSignUp', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'signUpFileLayout', title: intl.formatMessage({ id: 'detail.purchase.signUpFileLayout' }), include: ['readyExamineSignUp'] },
{ id: 'conditionLayout', title: intl.formatMessage({ id: 'detail.purchase.conditionLayout' }), include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'fileLayout', title: intl.formatMessage({ id: 'detail.purchase.file' }), include: ['search', 'readyAdd', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'demandLayout', title: intl.formatMessage({ id: 'detail.purchase.demandLayout' }), include: ['search', 'readyAdd', 'readyBid'] },
{ id: 'resultLayout', title: intl.formatMessage({ id: 'detail.purchase.bidLayout' }), include: ['search', 'readyAdd', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'conditionLayout', title: intl.formatMessage({ id: 'detail.purchase.conditionLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'fileLayout', title: intl.formatMessage({ id: 'detail.purchase.file' }), include: ['search', 'readyAdd', 'readyAddShop', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'demandLayout', title: intl.formatMessage({ id: 'detail.purchase.demandLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readyBid'] },
{ id: 'resultLayout', title: intl.formatMessage({ id: 'detail.purchase.bidLayout' }), include: ['search', 'readyAdd', 'readyAddShop', 'readySubmitExamineResult', 'readyBid', 'readyExamineResultOne', 'readyExamineResultTwo', 'readyConfirm'] },
{ id: 'recordLayout', title: intl.formatMessage({ id: 'detail.purchase.recordLyout' }) },
]
......@@ -59,7 +59,9 @@ const SearchDetail = () => {
signUpId, //报名ID
button, //按钮类型
memberName, //中标供应商
action //是否显示审核按钮
action, //是否显示审核按钮
createMemberId,//报名会员id
createMemberRoleId,//报名角色id
},
pathname,
} = history.location;
......@@ -285,6 +287,7 @@ const SearchDetail = () => {
if (action) {
switch (pathPci) {
case 'readyAdd':
case 'readyAddShop':
if (button === 1) {
return (
<Popconfirm title={intl.formatMessage({ id: 'table.purchase.popconfirm1' })} okText={intl.formatMessage({ id: 'detail.purchase.okText' })} cancelText={intl.formatMessage({ id: 'detail.purchase.cancelText' })} onConfirm={fetchSubmitBatch}>
......@@ -356,6 +359,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyBid':
return (
<BidCommonLayout layoutId="bidResultLayout" title={intl.formatMessage({ id: 'detail.purchase.bidResultLayout' })} effect={resultEffect} />
......@@ -369,6 +373,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
......@@ -394,6 +399,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
......@@ -412,6 +418,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
......@@ -431,6 +438,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readySubmitExamineResult':
case 'readyBid':
case 'readyExamineResultOne':
......@@ -440,7 +448,7 @@ const SearchDetail = () => {
case 'readyExamineSignUp':
let _data: any = {};
for (let key in dataSource.sginUpInfos) {
if (dataSource.sginUpInfos[key].id == signUpId) {
if (dataSource.sginUpInfos[key].createMemberId == createMemberId) {
_data = dataSource.sginUpInfos[key];
}
}
......@@ -449,7 +457,7 @@ const SearchDetail = () => {
<BidCommonLayout layoutId="signUpMsgLayout" title={intl.formatMessage({ id: 'detail.purchase.signUpMsgLayout' })} effect={[
{
col: [
{ label: intl.formatMessage({ id: 'table.purchase.inviteMemberName' }), extra: _data.memberName, type: 'text' },
{ label: intl.formatMessage({ id: 'table.purchase.inviteMemberName' }), extra: _data.createMemberName, type: 'text' },
{ label: intl.formatMessage({ id: 'detail.purchase.contacts' }), extra: _data.contacts, type: 'text' },
]
},
......@@ -483,6 +491,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
......@@ -501,6 +510,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readySubmitExamineResult':
case 'readyBid':
case 'readyExamineResultOne':
......@@ -526,6 +536,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readyBid':
return (
<DemandLayout
......@@ -549,6 +560,7 @@ const SearchDetail = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyAddShop':
case 'readySubmitExamineResult':
case 'readyBid':
case 'readyExamineResultOne':
......@@ -617,6 +629,8 @@ const SearchDetail = () => {
fetch={fetchLink()}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
createMemberId={createMemberId}
createMemberRoleId={createMemberRoleId}
/>
<ConfirmBidResultModal
title={intl.formatMessage({ id: 'detail.purchase.modalTitle11' })}
......
......@@ -37,8 +37,9 @@ const AddForm = () => {
},
pathname, } = history.location;
const { memberId, memberRoleId, name } = getAuth();
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
console.log(path)
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [isShop ,setIsShop] = useState<boolean>(false);
console.log(pathPci)
/** 基本信息 */
const [basic, setBasic] = useState<any>({});
/** 添加采购物料 */
......@@ -56,6 +57,10 @@ const AddForm = () => {
const [badge, setbadge] = useState<any>([0, 0, 0, 0, 0, 0]);
const [loading, setLoading] = useState<boolean>(false);
useEffect(() => {
setIsShop(pathPci !== 'readyAdd')
},[pathPci])
/** 拿表单数据的 */
const currentBasic = useRef<any>({});
const currentRules = useRef<any>({});
......@@ -255,6 +260,8 @@ const AddForm = () => {
fetchdata={demand}
onBadge={getError}
badgeIndex={5}
needOperate={false}
isShop={isShop}
/>
</TabPane>
<TabPane key='7' tab={intl.formatMessage({ id: 'detail.purchase.file' })} forceRender>
......
import React, { useState, useEffect } from 'react';
import { Form, Input, DatePicker, Select } from 'antd';
import moment from 'moment';
import AddressSelect from '@/components/AddressSelect';
import { getLogisticsSelectListReceiverAddress } from '@/services/LogisticsV2Api';
import { validatorByte } from '../../validator';
......@@ -27,8 +27,10 @@ interface Iprops {
const intl = getIntl();
export type ADDRESS_TYPE = {
address: string,
addressId: number,
fullAddress: string,
id: number,
name: string,
phone : string
}
const Condition: React.FC<Iprops> = (props: any) => {
......@@ -40,26 +42,47 @@ const Condition: React.FC<Iprops> = (props: any) => {
} = props;
const [address, setAddress] = useState<Array<any>>([]);
const [selAddress, setSelAddress] = useState<ADDRESS_TYPE>();
const [textAddress, setTextAddress] = useState<string>('');
/** 获取交付地址 */
const handleGetLogistics = async () => {
const service = getLogisticsSelectListReceiverAddress;
const res = await service();
if (res.code === 1000) {
if (res.code === 1000 && res.data.length > 0) {
const info: any = res.data[0];
const params: ADDRESS_TYPE = {
fullAddress: `${info.receiverName} ${info.fullAddress} ${info.phone}`,
id: info.id,
name: info.receiverName,
phone : info.phone,
}
setSelAddress(params)
setAddress(res.data);
setTextAddress(params.fullAddress)
}
}
useEffect(() => {
handleGetLogistics();
!fetchdata?.address && handleGetLogistics();
}, [])
/** 选择地址 */
const handleSelectAddress = (val: any, option: any) => {
// const handleSelectAddress = (val: any, option: any) => {
// const params: ADDRESS_TYPE = {
// address: option.children,
// id: option.value,
// }
// setSelAddress(params);
// }
const getFullAddress = (info) => {
const params: ADDRESS_TYPE = {
address: option.children,
addressId: option.value,
fullAddress: `${info.name} ${info.fullAddress} ${info.phone}`,
id: info.id,
phone: info.phone,
name: info.name,
}
setSelAddress(params);
setSelAddress(params)
setTextAddress(params.fullAddress)
}
useEffect(() => {
......@@ -77,7 +100,8 @@ const Condition: React.FC<Iprops> = (props: any) => {
packRequire: res.packRequire,
paymentType: res.paymentType,
taxes: res.taxes,
...selAddress,
address: selAddress.fullAddress,
addressId: selAddress.id,
},
})
onBadge(0, 4)
......@@ -104,11 +128,15 @@ const Condition: React.FC<Iprops> = (props: any) => {
packRequire: fetchdata.packRequire,
otherRequire: fetchdata.otherRequire
})
const _stringList = fetchdata?.address?.split(' ');
const params: ADDRESS_TYPE = {
address: fetchdata.address,
addressId: fetchdata.addressId,
fullAddress: fetchdata.address,
id: fetchdata.addressId,
phone: _stringList?.[2] || undefined,
name: _stringList?.[0] || undefined,
}
setSelAddress(params);
setTextAddress(params.fullAddress)
}
}, [fetchdata])
......@@ -135,14 +163,22 @@ const Condition: React.FC<Iprops> = (props: any) => {
name='addressId'
rules={[{ required: true, message: intl.formatMessage({ id: 'detail.purchase.message55' }) }]}
>
<Select
<AddressSelect
echo={true}
value={textAddress}
isDefaultAddress={true}
addressType={1}
disabled={false}
onChange={getFullAddress}
/>
{/* <Select
onSelect={handleSelectAddress}
placeholder={intl.formatMessage({ id: 'detail.purchase.message55' })}
>
{address.map(v => (
<Option key={v.id} value={v.id}>{v.fullAddress}</Option>
))}
</Select>
</Select> */}
</Form.Item>
<Form.Item
label={intl.formatMessage({ id: 'detail.purchase.offerAsk' })}
......
import React, { useRef, useState } from 'react';
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';
......@@ -7,7 +7,7 @@ import { PlusOutlined, PlayCircleOutlined, PoweroffOutlined, CaretDownOutlined }
import { formatTimeString } from '@/utils'
import EyePreview from '@/components/EyePreview';
import StatusTag from '@/components/StatusTag';
import { postPurchaseBiddingExamine, postPurchaseBiddingExamineBatch, postPurchaseBiddingDelete, postPurchaseBiddingDeleteBatch, getPurchaseBiddingAwaitNewList } from '@/services/PurchaseV2Api';
import { postPurchaseBiddingExamine, postPurchaseBiddingExamineBatch, postPurchaseBiddingDelete, postPurchaseBiddingDeleteBatch, getPurchaseBiddingAwaitNewList,getPurchaseBiddingAwaitShopNewList } from '@/services/PurchaseV2Api';
import Table from '../../components/table'
......@@ -22,9 +22,20 @@ const intl = getIntl();
const { Text } = Typography;
const ReadyAdd = () => {
const {pathname} = history.location;
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [isShop ,setIsShop] = useState<any>(pathPci !== 'readyAdd');
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
// useEffect(() => {
// if(pathPci !== 'readyAdd'){
// setIsShop(true)
// }else{
// setIsShop(false)
// }
// },[pathPci])
const columns: ColumnType<any>[] = [
{
title: intl.formatMessage({ id: 'table.purchase.biddingNo' }),
......@@ -32,7 +43,7 @@ const ReadyAdd = () => {
dataIndex: 'biddingNo',
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<EyePreview url={`/memberCenter/procurementAbility/purchaseBid/readyAdd/detail?id=${record.id}&number=${text}&button=${record.button}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchaseBid/${isShop ? 'readyAddShop' : 'readyAdd'}/detail?id=${record.id}&number=${text}&button=${record.button}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
......@@ -93,12 +104,12 @@ const ReadyAdd = () => {
{/* 有点问题先注释上面 */}
<Dropdown overlay={
<Menu onClick={(e) => handleMenuClick(e, record)}>
<AuthButton btnCode='readyAdd.edit'>
{/* <AuthButton btnCode='readyAdd.edit' key="1"> */}
<Menu.Item key="1">{intl.formatMessage({ id: 'detail.purchase.edit' })}</Menu.Item>
</AuthButton>
<AuthButton btnCode='readyAdd.del'>
{/* </AuthButton> */}
{/* <AuthButton btnCode='readyAdd.del' key="2"> */}
<Menu.Item key="2" disabled={!(record.button === 1)}>{intl.formatMessage({ id: 'table.purchase.delete' })}</Menu.Item>
</AuthButton>
{/* </AuthButton> */}
</Menu>
}>
......@@ -110,8 +121,9 @@ const ReadyAdd = () => {
}];
const handleMenuClick = (e: any, record: any) => {
console.log(e)
if (e.key === '1') {
history.push(`/memberCenter/procurementAbility/purchaseBid/readyAdd/modify?id=${record.id}&number=${record.biddingNo}`)
history.push(`/memberCenter/procurementAbility/purchaseBid/${isShop ? 'readyAddShop' : 'readyAdd'}/modify?id=${record.id}&number=${record.biddingNo}`)
} else {
fetchDeleteBatch(record.id);
}
......@@ -148,6 +160,22 @@ const ReadyAdd = () => {
}
}
// const _listFetch = useCallback(() => {
// if(isShop === true){
// return getPurchaseBiddingAwaitShopNewList
// }else{
// return getPurchaseBiddingAwaitNewList
// }
// },[isShop])
useEffect(() => {
if(isShop){
ref.current.reload();
}
},[isShop])
return (
<Table
selectedRow
......@@ -156,14 +184,14 @@ const ReadyAdd = () => {
schemaType="PURCHASEBIDREADYADD_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={getPurchaseBiddingAwaitNewList}
fetch={isShop ? getPurchaseBiddingAwaitShopNewList : getPurchaseBiddingAwaitNewList}
controllerBtns={
<Row>
<Col span={24}>
<Space size={16}>
<AuthButton btnCode='readyAdd.add'>
<Button
onClick={() => history.push('/memberCenter/procurementAbility/purchaseBid/readyAdd/add')}
onClick={() => history.push(`/memberCenter/procurementAbility/purchaseBid/${isShop ? 'readyAddShop' : 'readyAdd'}/add`)}
type="primary"
icon={<PlusOutlined />}
>
......
......@@ -91,7 +91,7 @@ const ReadyExamineSignUp = () => {
}];
const handleExamine = (record: any) => {
history.push(`/memberCenter/procurementAbility/purchaseBid/readyExamineSignUp/detail?id=${record.biddingId}&number=${record.biddingNo}&signUpId=${record.id}&action=1`)
history.push(`/memberCenter/procurementAbility/purchaseBid/readyExamineSignUp/detail?id=${record.biddingId}&number=${record.biddingNo}&signUpId=${record.id}&action=1&createMemberId=${record.createMemberId}&createMemberRoleId=${record.createMemberRoleId}`)
// setId(id);
// setVisible(!visible);
}
......
......@@ -122,7 +122,7 @@ const ReadySubmit = () => {
onClick={() => fetchSubmitBatch()}
disabled={rowkeys.length === 0}
>
{intl.formatMessage({ id: 'detail.purchase.submitBatch1' })}
{intl.formatMessage({ id: 'table.purchase.submitBatch1' })}
</Button>
</AuthButton>
</Space>
......
......@@ -40,7 +40,7 @@ const Search = () => {
render: (text: any, record: any) => (
<Space direction='vertical' style={{ width: 300 }}>
<EyePreview
type={AuthUrl('purchaseBid.see') ? 'link' : 'button'}
// type={AuthUrl('purchaseBid.see') ? 'link' : 'button'}
url={`/memberCenter/procurementAbility/purchaseBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<Text type="secondary">{record.details}</Text>
</Space>
......
......@@ -8,6 +8,7 @@ import StandardTable from '@/components/StandardTable';
import { ENTERPRISE_CENTER_URL } from '@/constants'
import SelectMenber from '../modal/selectMenber';
import { postPurchasePurchaseInquirySystemMatchingMemberInitializeList } from '@/services/PurchaseV2Api';
import { getManageShopListEnterpriseShopBySite } from '@/services/ManageV2Api';
import { getIntl } from 'umi';
const intl = getIntl();
const layout: any = {
......@@ -35,7 +36,9 @@ interface Iprops {
currentRef: any,
fetchdata: { [key: string]: any },
onBadge?: Function,
badgeIndex?: number
badgeIndex?: number,
needOperate?: boolean,
isShop?: boolean,
}
const { Link } = Typography
......@@ -46,7 +49,9 @@ const Demand: React.FC<Iprops> = (props: any) => {
currentRef,
fetchdata,
onBadge,
badgeIndex
badgeIndex,
needOperate = true,
isShop = false
} = props;
const [value, setValue] = useState<number>(0);
const [store, setStore] = useState<Array<any>>([]);
......@@ -90,50 +95,58 @@ const Demand: React.FC<Iprops> = (props: any) => {
key: 'levelTag',
dataIndex: 'levelTag',
},
{
title: intl.formatMessage({ id: 'detail.purchase.isSubMember' }),
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (_text: any, _record: any) => <>
{ (value === 3 || (value === 2 && _record.isSubMember === 1)) && <Typography.Text type='success'></Typography.Text>}
</>
},
{
title: (
<>
<span>{intl.formatMessage({ id: 'detail.purchase.demendSend' })}</span>
<Tooltip placement="top" title={intl.formatMessage({ id: 'detail.purchase.tips5' })}>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any, index: number) => (
<Form.Item
style={{ marginBottom: 0 }}
>
<Switch checked={_text} onChange={(e: any) => handleGetSwitch(e, index)} />
</Form.Item>
)
},
{
title: intl.formatMessage({ id: 'detail.purchase.option' }),
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Link href={`${ENTERPRISE_CENTER_URL}/shop/${_record.memberId}_${_record.roleId}`} target="_blank">
{intl.formatMessage({ id: 'detail.purchase.entryMall' })}
</Link>
)
},
]
const columnsRemix = () => {
if(needOperate){
return columns.concat([
{
title: intl.formatMessage({ id: 'detail.purchase.isSubMember' }),
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (_text: any, _record: any) => <>
{ (value === 3 || (value === 2 && _record.isSubMember === 1)) && <Typography.Text type='success'></Typography.Text>}
</>
},
{
title: (
<>
<span>{intl.formatMessage({ id: 'detail.purchase.demendSend' })}</span>
<Tooltip placement="top" title={intl.formatMessage({ id: 'detail.purchase.tips5' })}>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (_text: any, _record: any, index: number) => (
<Form.Item
style={{ marginBottom: 0 }}
>
<Switch checked={_text} onChange={(e: any) => handleGetSwitch(e, index)} />
</Form.Item>
)
},
{
title: intl.formatMessage({ id: 'detail.purchase.option' }),
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Link href={`${ENTERPRISE_CENTER_URL}/shop/${_record.memberId}_${_record.roleId}`} target="_blank">
{intl.formatMessage({ id: 'detail.purchase.entryMall' })}
</Link>
)
}
])
}
return columns
}
/** 切换需求模式 */
const changeRadio = (e: any) => {
const { value } = e.target;
......@@ -192,11 +205,19 @@ const Demand: React.FC<Iprops> = (props: any) => {
}
useEffect(() => {
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 6).map(
v => v
)
setStoreList(shopList)
}, [])
if(isShop){
getManageShopListEnterpriseShopBySite({siteId: GlobalConfig.global.siteInfo.id}).then((res) => {
if(res.code === 1000){
setStoreList(res.data)
}
})
}else{
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 6).map(
v => v
)
setStoreList(shopList)
}
}, [isShop])
useEffect(() => {
currentRef.current = {
......@@ -237,17 +258,25 @@ const Demand: React.FC<Iprops> = (props: any) => {
type: fetchdata.type
})
if (fetchdata.type === 1) {
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 6).map(
v => v
)
setStoreList(shopList)
if(isShop){
getManageShopListEnterpriseShopBySite({siteId: GlobalConfig.global.siteInfo.id}).then((res) => {
if(res.code === 1000){
setStoreList(res.data)
}
})
}else{
let shopList = GlobalConfig.web.shopInfo.filter(v => v.type == 6).map(
v => v
)
setStoreList(shopList)
}
}
setValue(fetchdata.type);
fetchdata.shopIds && handleStoreIds(fetchdata.shopIds);
fetchdata.demandMembers && setRowCtl([...fetchdata.demandMembers]);
fetchdata.demandMembers && form.setFieldsValue({ "rowCol": fetchdata.demandMembers })
}
}, [fetchdata])
}, [fetchdata,isShop])
const handleCancel = () => {
setValue(3)
......@@ -295,7 +324,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
&& (
<Form.Item noStyle>
<StandardTable
columns={columns}
columns={columnsRemix()}
fetchTableData={(params) => fetchSystemMateData(params)}
/>
</Form.Item>
......@@ -313,7 +342,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
{intl.formatMessage({ id: 'detail.purchase.selectMenber' })}
</Button>
<Table
columns={columns}
columns={columnsRemix()}
dataSource={rowCtl}
pagination={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