Commit e717467f authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'v2-220418' of…

Merge branch 'v2-220418' of https://gitlab.shushangyun.com/linkseeks-design/pro-platform into fix418
parents a1a0aade cd264ca1
......@@ -24,25 +24,28 @@ const AuthButton = (props: AuthButtonProps) => {
const RoutesAuth = auth.filter((item: any) => item?.u === pathname)
const _authorityBtn = () => {
// 本地开发时传的特殊标识,直接开放权限
return true
// 本地开发时直接开放权限
if (process.env.NODE_ENV === "development") return true
// 全部按钮打开
// if (btnCode === 'DevTest') return true
// if (RoutesAuth.length > 0) {
// const { b } = RoutesAuth[0];
// console.log(RoutesAuth.length, RoutesAuth)
// for (let i = 0; i < b.length; i++) {
// if (btnCode) {
// // 是否有页面标识
// // 找到该页面标识的按钮权限数据,并匹配权限按钮是否勾选
// if (b[i] === btnCode) {
// return true
// }
// }
// continue
// }
// return false
// }
return true
// 校验权限
if (RoutesAuth.length > 0) {
const { b } = RoutesAuth[0];
console.log(RoutesAuth.length, RoutesAuth)
for (let i = 0; i < b.length; i++) {
if (btnCode) {
// 是否有页面标识
// 找到该页面标识的按钮权限数据,并匹配权限按钮是否勾选
if (b[i] === btnCode) {
return true
}
}
continue
}
return false
}
}
return _authorityBtn() ? children : null
}
......
# 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 待审核采购竞价单一级-批量审核 待审核采购竞价单一级-批量审核-按钮
......
......@@ -13,15 +13,16 @@ export const HarvestMaterialContextProvider = HarvestMaterialContext.Provider
export const HarvestMaterialContextConsumer = HarvestMaterialContext.Consumer
/**
*
*
* @param props Table修个的时候,需要参数
* @returns
* @returns
*/
export function HarvestMaterialInput(props: {
value: any, //input 显示的值
index: number // table 当前的 index下标
keyUp: string // dataSource 对应的row key
min?: number
disabled?: boolean
}) {
const context = useContext(HarvestMaterialContext);
......@@ -35,7 +36,7 @@ export function HarvestMaterialInput(props: {
saveValue(targetVal)
return;
}
// 存在小数点 且 字符串必须大于 . +1 才执行
// 存在小数点 且 字符串必须大于 . +1 才执行
if (targetVal.includes('.') && targetVal.length != targetVal.indexOf('.')) {
const reg = new RegExp("((^[1-9][0-9]{0,8})+(.?[0-9]{1,3})?$)")
const test = reg.test(targetVal)
......@@ -81,4 +82,4 @@ export function HarvestMaterialDelete(props: {
return (
<Button onClick={handleClick} type="link">删除</Button>
)
}
\ No newline at end of file
}
......@@ -88,7 +88,7 @@ const DeliveryNoticeAwaitDetails: React.FC = () => {
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode='deliveryNoticeAwait.confirm'>
{
(type === PAGE_TYPE.CONFIRM && details.status === STATUS.WAIT_CONFIRM) && (
<Button loading={loading} onClick={() => setModalVisible(true)} type='primary'>提交</Button>
......
......@@ -26,8 +26,8 @@ const DeliveryNoticeCollaborationAwait: React.FC = () => {
const controllerBtns = (<Space></Space>)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'确认': 'DevTest',
'查看': 'DevTest',
'确认': 'deliveryNoticeAwait.confirm',
'查看': 'deliveryNoticeAwait.see',
}
const buttonGroup = {
'确认': true,
......
......@@ -26,7 +26,7 @@ const DeliveryNoticeCollaborationQuery: React.FC = () => {
const controllerBtns = (<Space></Space>)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'查看': 'deliveryNoticeQuery.see',
}
const buttonGroup = {
'查看': true,
......
......@@ -6,17 +6,17 @@ import React, { useRef } from 'react'
import { history } from 'umi'
import AddEditContent from './components/AddEditContent'
const mock = {"1649815945186":{"planNo":"DL2022041200006","noticeNo":null,"buyerMemberId":231,"buyerRoleId":11,"buyerMemberName":"牛逼","digest":"2022-04-12~2022-04-12 168一路发 送货计划","deliveryTime":"2022-04-13","deliveryStartTime":"08:00","deliveryEndTime":"12:00","consignee":"毛爷爷","provinceName":"湖南省","cityName":"邵阳市","districtName":"邵阳县","streetName":"","address":"东北玩泥巴","phone":"18800000123","consigneeId":301,"products":[],"remark":null}}
const DeliveryNoticeManagementAwaitB2BAdd: React.FC = () => {
const time = history.location?.query?.time
// window.localStorage.setItem("NOTICE_PATH", JSON.stringify(mock))
const planData = JSON.parse(window.localStorage.getItem("NOTICE_PATH"))?.[time as string]
return (
<AddEditContent type='add' planData={planData} />
<AddEditContent
type='add'
planData={planData}
btnCode='deliveryNoticeAwaitB2B.submit'
/>
)
}
......
......@@ -25,6 +25,7 @@ type PropsType = {
type: 'add' | 'edit';
id?: string;
planData?: any;
btnCode: string;
}
enum PAGE_TYPE {
......@@ -42,7 +43,7 @@ const formItemLayout = {
wrapperCol: { span: 18 }
}
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData }) => {
const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
......@@ -149,20 +150,19 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
} else {
// 通过送货计划生成时
if (planData) {
const firstProduct = planData.products?.[0] || {}
const receivingAddress = {
provinceName: firstProduct.provinceName,
cityName: firstProduct.cityName,
districtName: firstProduct.districtName,
streetName: firstProduct.streetName,
address: firstProduct.address,
phone: firstProduct.phone,
consignee: firstProduct.consignee,
consigneeId: firstProduct.consigneeId,
fullAddress: `${firstProduct.provinceName || ''}${firstProduct.cityName || ''}${firstProduct.districtName || ''}${firstProduct.streetName || ''}${firstProduct.address || ''}`
provinceName: planData.provinceName,
cityName: planData.cityName,
districtName: planData.districtName,
streetName: planData.streetName,
address: planData.address,
phone: planData.phone,
consignee: planData.consignee,
consigneeId: planData.consigneeId,
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${firstProduct.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -218,7 +218,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode={btnCode}>
<Button loading={loading} onClick={handleSubmit} type='primary'>提交</Button>
</AuthButton>
}
......@@ -294,6 +294,7 @@ const DeliveryNoticeManagementAwaitB2BDetails: React.FC<PropsType> = ({ type, id
{...formItemLayout}
label={DeliveryTime}
name='deliveryStartEndTime'
initialValue={[moment('08:00', 'HH:mm'), moment('12:00', 'HH:mm')]}
rules={[
{ required: true, message: `请选择${DeliveryTime}` }
]}
......
......@@ -13,6 +13,7 @@ const DeliveryNoticeManagementAwaitB2BEdit: React.FC = () => {
<AddEditContent
type='edit'
id={id as string}
btnCode='deliveryNoticeAwaitB2B.submit'
/>
)
}
......
......@@ -27,7 +27,7 @@ const DeliveryNoticeManagementAwaitB2B: React.FC = () => {
const controllerBtns = (
<Space>
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode='deliveryNoticeAwaitB2B.add'>
<Button
type='primary'
icon={<PlusOutlined/>}
......@@ -41,8 +41,8 @@ const DeliveryNoticeManagementAwaitB2B: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'修改': 'DevTest',
'查看': 'DevTest',
'修改': 'deliveryNoticeAwaitB2B.edit',
'查看': 'deliveryNoticeAwaitB2B.see',
}
const buttonGroup = {
'修改': [STATUS.WAIT_REVISE, STATUS.HAD_CONFIRM].includes(record.status),
......
......@@ -15,7 +15,11 @@ const DeliveryNoticeManagementAwaitSRMAdd: React.FC = () => {
const planData = JSON.parse(window.localStorage.getItem("NOTICE_PATH"))?.[time as string]
return (
<AddEditContent type='add' planData={planData} />
<AddEditContent
type='add'
planData={planData}
btnCode='deliveryNoticeAwaitSRM.submit'
/>
)
}
......
......@@ -26,6 +26,7 @@ type PropsType = {
type: 'add' | 'edit';
id?: string;
planData?: any;
btnCode: string;
}
enum PAGE_TYPE {
......@@ -43,7 +44,7 @@ const formItemLayout = {
wrapperCol: { span: 18 }
}
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData }) => {
const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id, planData, btnCode }) => {
const [form] = Form.useForm()
const [iAnchors, setiAnchors] = useState<AnchorsItem[]>([
Circulation,
......@@ -150,20 +151,19 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
} else {
// 通过送货计划生成时
if (planData) {
const firstProduct = planData.products?.[0] || {}
const receivingAddress = {
provinceName: firstProduct.provinceName,
cityName: firstProduct.cityName,
districtName: firstProduct.districtName,
streetName: firstProduct.streetName,
address: firstProduct.address,
phone: firstProduct.phone,
consignee: firstProduct.consignee,
consigneeId: firstProduct.consigneeId,
fullAddress: `${firstProduct.provinceName || ''}${firstProduct.cityName || ''}${firstProduct.districtName || ''}${firstProduct.streetName || ''}${firstProduct.address || ''}`
provinceName: planData.provinceName,
cityName: planData.cityName,
districtName: planData.districtName,
streetName: planData.streetName,
address: planData.address,
phone: planData.phone,
consignee: planData.consignee,
consigneeId: planData.consigneeId,
fullAddress: `${planData.provinceName || ''}${planData.cityName || ''}${planData.districtName || ''}${planData.streetName || ''}${planData.address || ''}`
}
form.setFieldsValue({
digest: `${planData.deliveryTime}${firstProduct.productName || ''}送货通知`,
digest: `${planData.deliveryTime}${planData.productName || ''}送货通知`,
deliveryTime: moment(planData.deliveryTime),
receivingAddress,
member: {
......@@ -219,7 +219,7 @@ const DeliveryNoticeManagementAwaitSRMDetails: React.FC<PropsType> = ({ type, id
onBack={() => history.goBack()}
anchors={iAnchors}
extra={
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode={btnCode}>
<Button loading={loading} onClick={handleSubmit} type='primary'>提交</Button>
</AuthButton>
}
......
......@@ -14,6 +14,7 @@ const DeliveryNoticeManagementAwaitSRMEdit: React.FC = () => {
<AddEditContent
type='edit'
id={id as string}
btnCode='deliveryNoticeAwaitSRM.submit'
/>
)
}
......
......@@ -38,7 +38,7 @@ const DeliveryNoticeManagementAwaitSRM: React.FC = () => {
const controllerBtns = (
<Space>
<AuthButton btnCode='' menuCode=''>
<AuthButton btnCode='deliveryNoticeAwaitSRM.add'>
<Button
type='primary'
icon={<PlusOutlined />}
......@@ -52,8 +52,8 @@ const DeliveryNoticeManagementAwaitSRM: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'修改': 'DevTest',
'查看': 'DevTest',
'修改': 'deliveryNoticeAwaitSRM.edit',
'查看': 'deliveryNoticeAwaitSRM.see',
}
const buttonGroup = {
'修改': [STATUS.WAIT_REVISE, STATUS.HAD_CONFIRM].includes(record.status),
......
......@@ -15,6 +15,7 @@ import { DeliveryNumColumn, OrderNumColumn } from "../../constants/table-column"
import { DatePickerSelect } from "@/components/DatePickerSelect";
import { SourceTypeEnum } from "../../constants/SourceTypeEnum";
import { useLocation } from "umi";
import AuthButton from "@/components/AuthButton";
const ContentBox = BaseInfo
const service = new DeliveryNoticeOrderAddService();
......@@ -73,12 +74,12 @@ function DeliveryNoticeFromCreate() {
}
return (
<AnchorPage title="送货单管理详情(SRM)"
<AnchorPage title="送货单管理详情"
anchors={anchors}
extra={
<Button.Group>
<AuthButton btnCode='deliveryNoticeQuery.submit'>
<Button onClick={handleSubmit} type='primary'>提交</Button>
</Button.Group>
</AuthButton>
}
>
<Form
......@@ -273,4 +274,4 @@ function DeliveryNoticeFromCreate() {
}
export default DeliveryNoticeFromCreate;
\ No newline at end of file
export default DeliveryNoticeFromCreate;
......@@ -16,21 +16,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { deliveryNoticeManagementQuerySchema } from './schema'
import { useHistory, useIntl } from 'umi'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import { TAG_STATUS_COLOR, STATUS, STATUS_NAME } from '../../constants/deliveryNotice'
import ToVoidModal, { HandleType } from './components/ToVoidModal'
const mock = {
totalCount: 4,
data: [
{ id: 1, noticeNo: '2e12e', status: STATUS.WAIT_CONFIRM },
{ id: 2, noticeNo: 'axascac', status: STATUS.WAIT_REVISE },
{ id: 3, noticeNo: 'fafa', status: STATUS.HAD_CONFIRM },
{ id: 4, noticeNo: 'fasffqw', status: STATUS.HAD_CONFIRM },
]
}
const DeliveryNoticeManagementQuery: React.FC = () => {
const intl = useIntl()
......@@ -42,10 +31,10 @@ const DeliveryNoticeManagementQuery: React.FC = () => {
const controllerBtns = (<Space></Space>)
const renderOptionButton = (r: any) => {
const btnAuthOfOperationTextMap = {
'生成送货单': 'DevTest',
'变更': 'DevTest',
'作废': 'DevTest',
'查看': 'DevTest',
'生成送货单': 'deliveryNoticeQuery.generate',
'变更': 'deliveryNoticeQuery.change',
'作废': 'deliveryNoticeQuery.void',
'查看': 'deliveryNoticeQuery.see',
}
const buttonGroup = {
'生成送货单': [STATUS.HAD_CONFIRM].includes(r.status),
......@@ -108,7 +97,6 @@ const DeliveryNoticeManagementQuery: React.FC = () => {
getOrderDeliveryNoticeOrderVendorPage(params).then(({ code, data }) => {
if (code === 1000) {
resolve(data)
// resolve(mock)
}
})
})
......
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}
......
......@@ -58,7 +58,7 @@ const BillDelivery: React.FC<BasicInfoProps> = ({ cardTitle, type, styles }) =>
{_v?.noTitle ? null : <Col span={6} className={style['card-list_title']}>{_v.title}</Col>}
{
_data.deliveryMethodName == "物流" && _v.title == '送货地址:' ?
<Col><p style={{ paddingRight: 20 }}>{_data.receiverAddressResponse.provinceName + _data.receiverAddressResponse.districtName + _data.receiverAddressResponse.cityName}</p></Col>
<Col><p style={{ paddingRight: 20 }}>{_data.deliveryAddressId ? _data.receiverAddressResponse.provinceName + _data.receiverAddressResponse.districtName + _data.receiverAddressResponse.cityName : _data.deliveryAddress}</p></Col>
: <Col><p style={{ paddingRight: 20 }}>{_v.render ? _v.render(dataSource[_v.name], dataSource) : dataSource[_v.name]}</p></Col>
}
......
......@@ -4,6 +4,7 @@ import EyePreview from '@/components/EyePreview'
import { history, useIntl } from 'umi'
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { getPurchaseRequisitionOrderPageSelectOption } from '@/pages/transaction/effect';
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
/** 采购 请购单查询 带内部状态schmea */
export const tableSearchListSchema: any = (align?: String, colStyle?: Object) => {
......@@ -212,7 +213,7 @@ export const tableListSchema: any = (align?: String, colStyle?: Object) => {
}
/** 采购 请购单 公共列 */
export const baseOrderListColumns: any = () => {
export const baseOrderListColumns: any = (code: string) => {
const intl = useIntl()
return [
......@@ -223,7 +224,7 @@ export const baseOrderListColumns: any = () => {
key: 'requisitionNo',
render: (text, record) => {
return (
<EyePreview url={`${history.location.pathname}/preview?id=${record.id}`}>
<EyePreview type={AuthUrl(code) ? 'link' : 'button'} url={`${history.location.pathname}/preview?id=${record.id}`}>
{text}
</EyePreview>
)
......
......@@ -10,11 +10,12 @@ import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import ApprovedOrderModal from '@/pages/transaction/components/approvedOrderModal';
import { postPurchaseRequisitionFirstAudit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待审核请购单详情 一级
const FirstOrderPreview: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const { run, loading } = useHttpRequest(postPurchaseRequisitionFirstAudit)
const approvedRef = useRef<any>({})
......@@ -25,7 +26,7 @@ const FirstOrderPreview: React.FC = () => {
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => {
approvedRef.current.actions.submit().then(async ({ values }) => {
const params = {
id: Number(id),
...values,
......@@ -46,9 +47,11 @@ const FirstOrderPreview: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='firstApprovedBill.xiangqingshenhe'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -16,7 +16,7 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'DevTest',
'审核': 'firstApprovedBill.shenhe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
......@@ -34,7 +34,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns("firstApprovedBill.see")
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -25,6 +25,7 @@ import { getPurchaseRequisitionDeliveryMethodItems, getPurchaseRequisitionDetail
import { UPLOAD_TYPE } from '@/constants'
import styles from './index.less'
import { getAuth } from '@/utils/auth'
import AuthButton from '@/components/AuthButton'
const addSchemaAction = createFormActions()
......@@ -450,9 +451,11 @@ const IncreaseRequisition: React.FC<{}> = () => {
title={id ? intl.formatMessage({ id: 'purchaseRequisition.bianjiqinggoudan', defaultMessage: '编辑请购单' }) : intl.formatMessage({ id: 'purchaseRequisition.xinzengqinggoudan', defaultMessage: '新增请购单' })}
schema={increaseSchema}
extraRight={[
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
{intl.formatMessage({ id: 'purchaseRequisition.baocun', defaultMessage: '保存' })}
</Button>,
<AuthButton btnCode={id ? 'increaseRequisition.bianji' : 'increaseRequisition.xingzheng'}>
<Button key="1" onClick={() => addSchemaAction.submit()} loading={btnLoading} type="primary" icon={<SaveOutlined />}>
{intl.formatMessage({ id: 'purchaseRequisition.baocun', defaultMessage: '保存' })}
</Button>,
</AuthButton>
]}
/>
<FormDetailWrapper>
......
......@@ -93,8 +93,8 @@ const RequestBill: React.FC<RequestBillProps> = () => {
/** 参照后台数据生成 */
const renderOptionButton = record => {
const btnAuthOfOperationTextMap = {
'取消订单': 'DevTest',
'中止': 'DevTest',
'取消订单': 'purchaseRequisition.quxiaodingdan',
'中止': 'purchaseRequisition.zhongzhi',
}
const buttonGroup = {
......@@ -129,7 +129,7 @@ const RequestBill: React.FC<RequestBillProps> = () => {
};
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns();
const alreadyColumns = baseOrderListColumns('purchaseRequisition.see');
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -16,6 +16,7 @@ import { createAsyncFormActions, createFormActions, FormEffectHooks } from '@for
import { searchOptionEffect } from './effect';
import { getMemberUserPage } from '@/services/MemberV2Api';
import NiceForm from '@/components/NiceForm';
import AuthButton from '@/components/AuthButton';
// 待新增请购单
......@@ -52,13 +53,16 @@ const ReadyAddBill: React.FC<ReadyAddBillProps> = () => {
const controllerBtns = (
<Space>
<Button
icon={<PlusCircleOutlined />}
type='primary'
onClick={clickAdd}
>
{intl.formatMessage({ id: 'purchaseRequisition.xinjian', defaultMessage: '新建' })}
</Button>
<AuthButton btnCode='readyAddBill.add'>
<Button
icon={<PlusCircleOutlined />}
type='primary'
onClick={clickAdd}
>
{intl.formatMessage({ id: 'purchaseRequisition.xinjian', defaultMessage: '新建' })}
</Button>
</AuthButton>
</Space>
)
return <PageHeaderWrapper>
......
......@@ -34,9 +34,9 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交审核': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'提交审核': 'readyAddBill.tijiaoshenhe',
'修改': 'readyAddBill.xiugai',
'删除': 'readyAddBill.shanchu',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })]: record.showSubmit, [intl.formatMessage({ id: 'purchaseRequisition.xiugai', defaultMessage: '修改' })]: true, [intl.formatMessage({ id: 'purchaseRequisition.shanchu', defaultMessage: '删除' })]: record.showDelete }
......@@ -56,7 +56,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns("readyAddBill.add")
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -9,18 +9,19 @@ import { Button } from 'antd';
import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import { postPurchaseRequisitionSubmit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待提交请购单详情
const ReadySubmitBillDetail: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const intl = useIntl()
const { run, loading } = useHttpRequest(postPurchaseRequisitionSubmit)
const approvedRef = useRef<any>({})
const handleClick = async () => {
const result = await run({id})
const result = await run({ id })
if (result.code === 1000) {
history.goBack()
}
......@@ -33,9 +34,11 @@ const ReadySubmitBillDetail: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='readySubmitBill.xiangqingsheng'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -7,7 +7,7 @@ import TableOperation from '@/components/TableOperation'
// 待提交请购单 Hook
export const useSelfTable = () => {
const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({ customKey: 'id' })
const intl = useIntl()
......@@ -15,8 +15,11 @@ export const useSelfTable = () => {
history.push(`/memberCenter/procurementAbility/purchaseRequisition/readySubmitBill/detail?id=${id}`)
}
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'readySubmitBill.shenhe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
const operationHandler = {
......@@ -27,13 +30,14 @@ export const useSelfTable = () => {
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
const alreadyColumns = baseOrderListColumns("readySubmitBill.see")
if (alreadyColumns) {
return alreadyColumns.concat([
{
title: intl.formatMessage({ id: 'purchaseRequisition.caozuo', defaultMessage: '操作' }),
......
......@@ -34,7 +34,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns('readyRequisitionOrder.see')
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
......@@ -10,12 +10,13 @@ import { useHttpRequest } from '@/hooks/useHttpRequest';
import { history, useIntl } from 'umi';
import ApprovedOrderModal from '@/pages/transaction/components/approvedOrderModal';
import { postPurchaseRequisitionTwoAudit } from '@/services/PurchaseV2Api';
import AuthButton from '@/components/AuthButton';
// 待审核请购单详情 二级
const SecondOrderPreview: React.FC = () => {
const { formContext, id, anchorTitleList } = useBillDetail({type: 'requestBill'})
const { formContext, id, anchorTitleList } = useBillDetail({ type: 'requestBill' })
const intl = useIntl()
const { run, loading } = useHttpRequest(postPurchaseRequisitionTwoAudit)
const approvedRef = useRef<any>({})
......@@ -26,7 +27,7 @@ const SecondOrderPreview: React.FC = () => {
// 提交表单
const handleSubmit = useCallback(() => {
approvedRef.current.actions.submit().then(async ({values}) => {
approvedRef.current.actions.submit().then(async ({ values }) => {
const params = {
id: Number(id),
...values,
......@@ -47,9 +48,11 @@ const SecondOrderPreview: React.FC = () => {
formContext={formContext}
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
<AuthButton btnCode='secondApprovedBill.xiangqingshenghe'>
<Button type='primary' onClick={handleClick} loading={loading}>
{intl.formatMessage({ id: 'purchaseRequisition.tijiaoshenhe', defaultMessage: '提交审核' })}
</Button>
</AuthButton>
}
/>
<BillDetailWrapper>
......
......@@ -17,7 +17,7 @@ export const useSelfTable = () => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'审核': 'DevTest',
'审核': 'secondApprovedBill.shenghe',
}
const buttonGroup = { [intl.formatMessage({ id: 'purchaseRequisition.shenhe', defaultMessage: '审核' })]: true }
......@@ -35,7 +35,7 @@ export const useSelfTable = () => {
}
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
const alreadyColumns = baseOrderListColumns('secondApprovedBill.see')
if (alreadyColumns) {
return alreadyColumns.concat([
{
......
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