Commit 263acb86 authored by shenshaokai's avatar shenshaokai

fix: 采购订单-订单查询-变更按钮控制

parent c92d1841
......@@ -259,7 +259,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const buttonGroup = {
变更: record?.showChange,
// 变更: record?.showChange,
[intl.formatMessage({ id: 'purchaseOrder.operation1' })]: record.showCancel,
[intl.formatMessage({ id: 'purchaseOrder.operation2' })]: record.showAfterSales,
[intl.formatMessage({ id: 'purchaseOrder.operation3' })]: record.showComment,
......@@ -269,7 +269,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
}
const operationHandler = {
变更: () => handleOrderVariation(record),
// 变更: () => handleOrderVariation(record),
[intl.formatMessage({ id: 'purchaseOrder.operation1' })]: () => handleCancel(record.orderId),
[intl.formatMessage({ id: 'purchaseOrder.operation2' })]: () => handleSaleAfter(record),
[intl.formatMessage({ id: 'purchaseOrder.operation3' })]: () => handleEvaluate(record.orderId),
......@@ -279,7 +279,7 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
}
const buttonPermissionsMap = {
变更: 'orderList.biangeng',
// 变更: 'orderList.biangeng',
[intl.formatMessage({ id: 'purchaseOrder.operation1' })]: 'orderList.quxiao',
[intl.formatMessage({ id: 'purchaseOrder.operation2' })]: 'orderList.shouhou',
[intl.formatMessage({ id: 'purchaseOrder.operation3' })]: 'orderList.pingjia',
......@@ -288,11 +288,21 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
// [intl.formatMessage({ id: 'purchaseOrder.operation7' })]: 'orderList.shanchu',
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={buttonPermissionsMap}
/>
<>
{
!!record?.showChange && (
<AuthButton btnCode='orderList.biangeng'>
<Button type='link' onClick={() => handleOrderVariation(record)}>变更</Button>
</AuthButton>
)
}
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={buttonPermissionsMap}
/>
</>
)
}
......
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