Commit 04649f54 authored by Gavin Peng's avatar Gavin Peng

feat: 送货计划管理及协同加入按钮权限判断

parent a8757e94
......@@ -20,6 +20,7 @@ import { deliveryPlanCollaborationAwaitSchema } from './schema'
import { godBtoa, TagStatus } from '../../utils'
import { ExternalStateColumn, OperationColumn, PlannedEndDateColumn, PlannedStartDateColumn, PlanNumberColumn, PlanSummaryColumn, SupplyMemberColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanVendorPage } from '@/services/OrderNewV2Api'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'], [4, '已确认'], [5, '已删除']])
......@@ -31,8 +32,8 @@ const DeliveryPlanCollaborationAwait: React.FC = () => {
const controllerBtns = (<Space></Space>)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'确认': 'DevTest',
'查看': 'DevTest',
'确认': 'deliveryPlanCollaborationAwait.confirm',
'查看': 'deliveryPlanCollaborationAwait.looking',
}
const buttonGroup = {
'确认': true,
......@@ -55,7 +56,7 @@ const DeliveryPlanCollaborationAwait: React.FC = () => {
...PlanNumberColumn,
dataIndex: 'planNo',
key: 'planNo',
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanCollaboration/await/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
render: (text: unknown, record: any) => <EyePreview type={AuthUrl('deliveryPlanCollaborationAwait.looking')? 'link': 'button'} url={`/memberCenter/order/deliveryPlanCollaboration/await/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......
......@@ -20,6 +20,7 @@ import { deliveryPlanCollaborationQuerySchema } from './schema'
import { godBtoa, TagStatus } from '../../utils'
import { ExternalStateColumn, OperationColumn, PlannedEndDateColumn, PlannedStartDateColumn, PlanNumberColumn, PlanSummaryColumn, SupplyMemberColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanVendorPage } from '@/services/OrderNewV2Api'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const tagStatus = new TagStatus()
......@@ -36,9 +37,9 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'生成送货通知单': 'DevTest',
'生成送货单': 'DevTest',
'查看': 'deliveryPlanCollaboration.looking',
'生成送货通知单': 'deliveryPlanCollaboration.generateNotice',
'生成送货单': 'deliveryPlanCollaboration.generateDeliveryNote',
}
const buttonGroup = {
'查看': true,
......@@ -67,7 +68,7 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
...PlanNumberColumn,
dataIndex: 'planNo',
key: 'planNo',
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
render: (text: unknown, record: any) => <EyePreview type={AuthUrl('deliveryPlanCollaboration.looking')? 'link': 'button'} url={`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......
......@@ -21,6 +21,8 @@ import { godBtoa, TagStatus } from '../../utils'
import { ExternalStateColumn, OperationColumn, PlannedEndDateColumn, PlannedStartDateColumn, PlanNumberColumn, PlanSummaryColumn, SupplyMemberColumn } from '../../constants/table-column'
import moment from 'moment'
import { getOrderDeliveryPlanBuyerPage, postOrderDeliveryPlanDelete, postOrderDeliveryPlanSubmit } from '@/services/OrderNewV2Api'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
import AuthButton from '@/components/AuthButton'
// 外部状态1-待提交 2-已确认
const STATUS = 2
......@@ -64,15 +66,17 @@ const DeliveryPlanManagementAwaitB2B: React.FC = () => {
const controllerBtns = (
<Space>
<Button type='primary' icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/order/deliveryPlanManagement/awaitB2B/create`)}>新增</Button>
<AuthButton btnCode='create'>
<Button type='primary' icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/order/deliveryPlanManagement/awaitB2B/create`)}>新增</Button>
</AuthButton>
</Space>
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'查看': 'DevTest',
'提交': 'awaitB2B.submit',
'修改': 'awaitB2B.update',
'删除': 'awaitB2B.delete',
'查看': 'awaitB2B.looking',
}
const buttonGroup = {
'提交': record.status <= 1,
......@@ -100,7 +104,7 @@ const DeliveryPlanManagementAwaitB2B: React.FC = () => {
dataIndex: 'planNo',
key: 'planNo',
// width: 160,
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanManagement/awaitB2B/details?i=${godBtoa(record.id)}`}>{text}</EyePreview>
render: (text: unknown, record: any) => <EyePreview type={AuthUrl('awaitB2B.looking') ? 'link' : 'button'} url={`/memberCenter/order/deliveryPlanManagement/awaitB2B/details?i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......
......@@ -21,6 +21,8 @@ import { godBtoa, TagStatus } from '../../utils'
import { ExternalStateColumn, OperationColumn, PlannedEndDateColumn, PlannedStartDateColumn, PlanNumberColumn, PlanSummaryColumn, SupplyMemberColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanBuyerPage, postOrderDeliveryPlanDelete, postOrderDeliveryPlanSubmit } from '@/services/OrderNewV2Api'
import moment from 'moment'
import AuthButton from '@/components/AuthButton'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
// 外部状态1-待提交 2-已确认
const STATUS = 2
......@@ -64,15 +66,17 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => {
const controllerBtns = (
<Space>
<Button type='primary' icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/order/deliveryPlanManagement/awaitSRM/create`)}>新增</Button>
<AuthButton btnCode='deliveryPlanAwaitSRM.create'>
<Button type='primary' icon={<PlusOutlined />} onClick={() => history.push(`/memberCenter/order/deliveryPlanManagement/awaitSRM/create`)}>新增</Button>
</AuthButton>
</Space>
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'查看': 'DevTest',
'提交': 'deliveryPlanAwaitSRM.submit',
'修改': 'deliveryPlanAwaitSRM.update',
'删除': 'deliveryPlanAwaitSRM.delete',
'查看': 'deliveryPlanAwaitSRM.looking',
}
const buttonGroup = {
'提交': record.status <= 1,
......@@ -101,7 +105,7 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => {
dataIndex: 'planNo',
key: 'planNo',
// width: 160,
render: (text: unknown, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanManagement/awaitSRM/details?i=${godBtoa(record.id)}`}>{text}</EyePreview>
render: (text: unknown, record: any) => <EyePreview type={AuthUrl('deliveryPlanAwaitSRM.looking') ? 'link' : 'button'} url={`/memberCenter/order/deliveryPlanManagement/awaitSRM/details?i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......@@ -112,10 +116,10 @@ const DeliveryPlanManagementAwaitSRM: React.FC = () => {
dataIndex: 'status',
key: 'status',
render: (text: string, record: any) => {
const sytle = tagStatus.getTagStyle(record.status);
const styles = tagStatus.getTagStyle(record.status);
return (
<Tag color={sytle.bgColor}>
<span style={{ color: sytle.fontColor }}>{statusTxt.get(record.status)}</span>
<Tag color={styles.bgColor}>
<span style={{ color: styles.fontColor }}>{statusTxt.get(record.status)}</span>
</Tag>
)
}
......
......@@ -19,6 +19,7 @@ import { deliveryPlanManagementQuerySchema } from './schema'
import { godBtoa, TagStatus } from '../../utils'
import { ExternalStateColumn, OperationColumn, PlannedEndDateColumn, PlannedStartDateColumn, PlanNumberColumn, PlanSummaryColumn, SupplyMemberColumn } from '../../constants/table-column'
import { getOrderDeliveryPlanBuyerPage } from '@/services/OrderNewV2Api'
import { AuthUrl } from '@/components/AuthButton/AuthUrl'
const tagStatus = new TagStatus()
const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'],[4,'已确认'],[5,'已删除']])
......@@ -34,8 +35,8 @@ const DeliveryPlanManagementQuery: React.FC = () => {
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'变更': 'DevTest'
'查看': 'deliveryPlanManagement.looking',
'变更': 'deliveryPlanManagement.update'
}
const buttonGroup = {
'查看': true,
......@@ -59,7 +60,7 @@ const DeliveryPlanManagementQuery: React.FC = () => {
dataIndex: 'planNo',
key: 'planNo',
// width: 160,
render: (text: string, record: any) => <EyePreview url={`/memberCenter/order/deliveryPlanManagement/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
render: (text: string, record: any) => <EyePreview type={AuthUrl('deliveryPlanManagement.looking')? 'link': 'button'} url={`/memberCenter/order/deliveryPlanManagement/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`}>{text}</EyePreview>
},
{ ...PlanSummaryColumn, dataIndex: 'digest', key: 'digest' },
{ ...PlannedStartDateColumn, dataIndex: 'planStartTime', key: 'planStartTime', render: (text: string, record: any) => (moment(text).format('YYYY-MM-DD')) },
......
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