Commit 2ffc4c5f authored by 卢均锐's avatar 卢均锐

fix: 采购竞价-待商城新增采购竞价单按钮权限配置

parent eab42381
# btnCode 是pass 平台配置唯一表示
# btnCode 是pass 平台配置唯一表示
......@@ -533,6 +533,14 @@
readyAdd.edit 待新增采购竞价单-编辑 待新增采购竞价单-编辑-按钮
readyAdd.del 待新增采购竞价单-删除 待新增采购竞价单-删除-按钮
readyAdd.more 待新增采购竞价单-更多 待新增采购竞价单-更多-按钮
9.3.1 待新增商城采购竞价单
readyAddShop.add 待新增采购竞价单-新曾 待新增采购竞价单-新曾-按钮
readyAddShop.batchshenhe 待新增采购竞价单-批量审核 待新增采购竞价单-批量审核-按钮
readyAddShop.batchdel 待新增采购竞价单-批量删除 待新增采购竞价单-批量删除-按钮
readyAddShop.submit 待新增采购竞价单-审核 待新增采购竞价单-审核-按钮
readyAddShop.edit 待新增采购竞价单-编辑 待新增采购竞价单-编辑-按钮
readyAddShop.del 待新增采购竞价单-删除 待新增采购竞价单-删除-按钮
readyAddShop.more 待新增采购竞价单-更多 待新增采购竞价单-更多-按钮
9.4 待审核采购竞价单一级
readyExamineOne.shenhe 待审核采购竞价单一级-审核 待审核采购竞价单一级-审核-按钮
readyExamineOne.batchshenhe 待审核采购竞价单一级-批量审核 待审核采购竞价单一级-批量审核-按钮
......
import React, { useRef, useState,useEffect,useCallback } 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, message, Modal } 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,getPurchaseBiddingAwaitShopNewList } from '@/services/PurchaseV2Api';
import { postPurchaseBiddingExamine, postPurchaseBiddingExamineBatch, postPurchaseBiddingDelete, postPurchaseBiddingDeleteBatch, getPurchaseBiddingAwaitNewList, getPurchaseBiddingAwaitShopNewList } from '@/services/PurchaseV2Api';
import { getTemplateWebMemberPurchaseWebFindCurrMemberPurchase } from '@/services/TemplateV2Api';
import Table from '../../components/table'
......@@ -18,15 +18,16 @@ import {
PurchaseBidButtons
} from '../../constants/purchaseBid';
import AuthButton from '@/components/AuthButton';
import { AuthUrl } from '@/components/AuthButton/AuthUrl';
const intl = getIntl();
const { Text } = Typography;
const ReadyAdd = () => {
const {pathname} = history.location;
const { pathname } = history.location;
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [isShop ,setIsShop] = useState<any>(pathPci !== 'readyAdd');
const [isShop, setIsShop] = useState<any>(pathPci !== 'readyAdd');
/** 多选操作 */
const ref = useRef<any>({});
const [rowkeys, setRowKeys] = useState<Array<number>>([]);
......@@ -81,7 +82,7 @@ const ReadyAdd = () => {
dataIndex: 'operate',
render: (text: any, record: any) => <>
{record?.buttons?.indexOf(PurchaseBidButtons.SUBMIT_REVIEW) >= 0 &&
<AuthButton btnCode='readyAdd.submit'>
<AuthButton btnCode={isShop ? 'readyAddShop.submit' : 'readyAdd.submit'}>
<Popconfirm title={intl.formatMessage({ id: 'table.purchase.popconfirm1' })} okText={intl.formatMessage({ id: 'table.purchase.okText' })} cancelText={intl.formatMessage({ id: 'table.purchase.cancelText' })} onConfirm={() => fetchSubmitBatch(record.id)}>
<Button type='link'>
{intl.formatMessage({ id: 'table.purchase.submit' })}
......@@ -107,10 +108,10 @@ const ReadyAdd = () => {
<Dropdown overlay={
<Menu onClick={(e) => handleMenuClick(e, record)}>
{/* <AuthButton btnCode='readyAdd.edit' key="1"> */}
{record?.buttons?.indexOf(PurchaseBidButtons.UPDATE) >= 0 && <Menu.Item key="1">{intl.formatMessage({ id: 'detail.purchase.edit' })}</Menu.Item>}
{AuthUrl(isShop ? 'readyAddShop.edit' : 'readyAdd.edit') && record?.buttons?.indexOf(PurchaseBidButtons.UPDATE) >= 0 && <Menu.Item key="1">{intl.formatMessage({ id: 'detail.purchase.edit' })}</Menu.Item>}
{/* </AuthButton> */}
{/* <AuthButton btnCode='readyAdd.del' key="2"> */}
{record?.buttons?.indexOf(PurchaseBidButtons.DELETE) >= 0 && <Menu.Item key="2" disabled={!(record.button === 1)}>{intl.formatMessage({ id: 'table.purchase.delete' })}</Menu.Item>}
{AuthUrl(isShop ? 'readyAddShop.del' : 'readyAdd.del') && record?.buttons?.indexOf(PurchaseBidButtons.DELETE) >= 0 && <Menu.Item key="2" disabled={!(record.button === 1)}>{intl.formatMessage({ id: 'table.purchase.delete' })}</Menu.Item>}
{/* </AuthButton> */}
</Menu>
......@@ -171,10 +172,10 @@ const ReadyAdd = () => {
// },[isShop])
useEffect(() => {
if(isShop){
if (isShop) {
ref.current.reload();
}
},[isShop])
}, [isShop])
const addFn = async () => {
await getTemplateWebMemberPurchaseWebFindCurrMemberPurchase().then(res => {
......@@ -209,7 +210,7 @@ const ReadyAdd = () => {
<Row>
<Col span={24}>
<Space size={16}>
<AuthButton btnCode='readyAdd.add'>
<AuthButton btnCode={isShop ? 'readyAddShop.add' : 'readyAdd.add'}>
<Button
onClick={addFn}
type="primary"
......@@ -218,7 +219,7 @@ const ReadyAdd = () => {
{intl.formatMessage({ id: 'table.purchase.added' })}
</Button>
</AuthButton>
<AuthButton btnCode='readyAdd.batchshenhe'>
<AuthButton btnCode={isShop ? 'readyAddShop.batchshenhe' : 'readyAdd.batchshenhe'}>
<Button
onClick={() => fetchSubmitBatch()}
disabled={rowkeys.length === 0}
......@@ -226,7 +227,7 @@ const ReadyAdd = () => {
{intl.formatMessage({ id: 'table.purchase.submitBatch' })}
</Button>
</AuthButton>
<AuthButton btnCode='readyAdd.del'>
<AuthButton btnCode={isShop ? 'readyAddShop.del' : 'readyAdd.del'}>
<Button
onClick={() => fetchDeleteBatch()}
disabled={rowkeys.length === 0}
......
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