Commit 9725acf4 authored by Gavin Peng's avatar Gavin Peng

feat: 按钮权限配置以及修复已知bug

parent 04649f54
......@@ -84,7 +84,7 @@ const CalendarModal = React.forwardRef((props: CalendarModalProps, ref: React.Re
<Modal
title={title || DefaultSelectDateText}
visible={visible}
width={width || 1080}
width={width || 680}
okText={okText || DefaultModalOkText}
cancelText={cancelText || DefaultModalCancelText}
onOk={modalOnOk}
......
......@@ -49,10 +49,12 @@ const statusTxt = new Map([[1, '待提交'], [2, '待确认'], [3, '待修订'],
const selectedTableItem = new Map()
const DeliveryPlanCollaborationDetails: React.FC = () => {
const { location: { query: { ty, i } } } = history
const { location: { query: { ty, i, bt } } } = history
// 1-B2B 2-SRM
const deliveryPlanType = godAtob(ty as string)
const id = godAtob(i as string)
// notice-通知单 deliveryNote-送货单
const pageBtn = godAtob(bt as string)
const ref = useRef<any>()
......@@ -198,7 +200,7 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
const time = new Date().getTime()
// 判断跳转
const url = deliveryPlanType === '1' ? '/memberCenter/order/deliveryNoticeManagement/awaitB2B/add' : '/memberCenter/order/deliveryNoticeManagement/awaitSRM/add'
noticePath[time] = res.data
noticePath[time] = res.data
localStorage.setItem('NOTICE_PATH', JSON.stringify(noticePath))
selectedTableItem.clear()
setTimeout(() => {
......@@ -228,12 +230,12 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
}
let noticePath = {}
const time = new Date().getTime()
noticePath[time] = res.data
noticePath[time] = res.data
localStorage.setItem('DELIVERY_NOTICE_PATH', JSON.stringify(noticePath))
selectedTableItem.clear()
setTimeout(()=> {
setTimeout(() => {
history.push(`/memberCenter/order/deliveryNotice/synergy/create?time=${time}&ot=${deliveryPlanType}`)
},1000)
}, 1000)
} else {
message.warning(res.message)
}
......@@ -256,8 +258,13 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
extra={
<Space>
{/* 条件渲染 */}
<Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('Notice')}>生成通知单</Button>
<Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('DeliveryNote')}>生成送货单</Button>
{
pageBtn === 'notice'
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('Notice')}>生成送货通知单</Button>
: pageBtn === 'deliveryNote'
? <Button type='primary' icon={<CheckCircleOutlined />} onClick={() => handleSubmitVerify('DeliveryNote')}>生成送货单</Button>
: null
}
</Space>
}
>
......@@ -306,8 +313,8 @@ const DeliveryPlanCollaborationDetails: React.FC = () => {
ref={ref}
onOk={(date) => {
operation === 'Notice'
? generateNotice(date)
: generateDeliveryNote(date)
? generateNotice(date)
: generateDeliveryNote(date)
}}
/>
</Spin>
......
......@@ -43,16 +43,16 @@ const DeliveryPlanCollaborationQuery: React.FC = () => {
}
const buttonGroup = {
'查看': true,
'生成送货通知单': true,
'生成送货单': true,
'生成送货通知单': record.status === 4,
'生成送货单': record.status === 4,
}
const operationHandler = {
'查看': () => history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`),
'生成送货通知单': () => {
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`)
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}&bt=${godBtoa('notice')}`)
},
'生成送货单': () => {
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}`)
history.push(`/memberCenter/order/deliveryPlanCollaboration/query/details?ty=${godBtoa(record.orderType)}&i=${godBtoa(record.id)}&bt=${godBtoa('deliveryNote')}`)
},
}
return (
......
......@@ -30,7 +30,7 @@ const ORDER_TYPE = '2'
const initMaterialTableColumn = [
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'productName', width: 128, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
......
......@@ -33,7 +33,7 @@ const DeliveryPlanAwaitSRMDetails: React.FC = () => {
const [materialTableColumn, setMaterialTableColumn] = useState<any>([
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'productName', width: 128, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
......
......@@ -46,7 +46,7 @@ const DeliveryPlanAwaitSRMUpdate: React.FC = () => {
const [materialTableColumn, setMaterialTableColumn] = useState<any>([
{ ...MaterialNoColumn, dataIndex: 'skuId', width: 80, },
{ ...MaterialNameColumn, dataIndex: 'productName', width: 192, },
{ ...MaterialModelColumn, dataIndex: 'productName', width: 128, },
{ ...MaterialModelColumn, dataIndex: 'spec', width: 128, },
{ ...ClassColumn, dataIndex: 'category', width: 96, },
{ ...BrandColumn, dataIndex: 'brand', width: 96, },
{ ...UntilColumn, dataIndex: 'unit', width: 64, },
......
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