Commit a26a9380 authored by shenshaokai's avatar shenshaokai

fix: 物料审核流程规则配置-修复之前统一样式造成按钮操作问题

parent 45420e02
......@@ -5,7 +5,7 @@ import NiceForm from '@/components/NiceForm';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { querySchema } from './schemas/query';
import { Button, Card, Popconfirm, Space, Switch } from 'antd';
import { Button, Card, Popconfirm, Space, Switch, Tooltip } from 'antd';
import { createFormActions } from '@formily/antd';
import {
getProductMaterialProcessDelete,
......@@ -13,10 +13,12 @@ import {
GetProductMaterialProcessPageResponseDetail,
postProductMaterialProcessUpdateStatus
} from '@/services/ProductV2Api';
import { Link, IRouteComponentProps } from 'umi';
import { Link, IRouteComponentProps, getIntl } from 'umi';
import AuthButton from '@/components/AuthButton';
import { columns_ } from '@/pages/systemSetting/processEng/buyingReqProcess';
import { QuestionCircleOutlined } from '@ant-design/icons';
const intl = getIntl();
/**
* 物料审核流程规则配置
*/
......@@ -49,75 +51,95 @@ const MaterialAuditProcessConfig: React.FC<IProps> = (props) => {
}
}
const columns = columns_({ authKey: 'material.rules', urlKey: 'material.rules', '修改': 'material.rules.toEdit','删除': "material.rules.remove" }, handleEnableOrDisable, handleDelete)
// const columns = [
// {
// title: '流程规则ID',
// dataIndex: 'processId',
// render: (text, record) => {
// return (
// <Link to={`${match.path}/detail?id=${record.processId}`}>
// {record.processId}
// </Link>
// )
// }
// },
// {
// title: '流程规则名称',
// dataIndex: 'name',
// },
// {
// title: '状态',
// dataIndex: 'status',
// render: (text, record) => {
// return (
// <Switch checked={!!text} onChange={() => handleEnableOrDisable(record)} />
// )
// }
// },
// {
// title: '是否默认',
// dataIndex: 'isDefault',
// render: (text, record) => text == '1' ? '是' : '否'
// },
// {
// title: '操作时间',
// dataIndex: 'createTime',
// },
// {
// title: '操作',
// dataIndex: 'actions',
// render: (text, record) => {
// if (record.status === 1) {
// return null;
// }
// return (
// <Space>
// <AuthButton btnCode='material.rules.toEdit'>
// <Link to={`${match.path}/edit?id=${record.processId}`}>
// 修改
// </Link>
// </AuthButton>
// const columns = columns_({ authKey: 'material.rules', urlKey: 'material.rules', '修改': 'material.rules.toEdit','删除': "material.rules.remove" }, handleEnableOrDisable, handleDelete)
const columns = [
{
title: 'ID',
key: 'processId',
dataIndex: 'processId',
width: 100,
},
{
title: '流程规则名称',
key: 'name',
dataIndex: 'name',
width: 300,
render: (text, record) => {
return (
<Link to={`${match.path}/detail?id=${record.processId}`}>
{record.name}
</Link>
)
}
},
{
title: intl.formatMessage({ id: 'processRuleSetting.liuchengmingcheng', defaultMessage: '流程名称' }),
key: 'processName',
dataIndex: 'processName',
width: 300
},
{
title: (
<div>
{intl.formatMessage({ id: 'processRuleSetting.shifoumoren', defaultMessage: '是否默认' })}&nbsp;
<Tooltip
title={`${intl.formatMessage({ id: 'processRuleSetting.defaultTipsFragment1', defaultMessage: '系统初始化自动创建的默认流程' })}, ${intl.formatMessage({ id: 'processRuleSetting.defaultTipsFragment2', defaultMessage: '优先使用用户配置的流程' })}, ${intl.formatMessage({ id: 'processRuleSetting.defaultTipsFragment3', defaultMessage: '当用户配置的流程全部都不匹配时则使用默认流程' })}`}
>
<QuestionCircleOutlined />
</Tooltip>
</div>
),
key: 'isDefault',
dataIndex: 'isDefault',
render: (_text, record) => !!_text ? intl.formatMessage({ id: 'common.button.yes', defaultMessage: '是' }) : intl.formatMessage({ id: 'common.button.no', defaultMessage: '否' })
},
{
title: '操作时间',
dataIndex: 'createTime',
},
{
title: '状态',
dataIndex: 'status',
render: (text, record) => {
return (
<Switch checked={!!text} onChange={() => handleEnableOrDisable(record)} />
)
}
},
{
title: '操作',
dataIndex: 'actions',
render: (text, record) => {
if (record.status === 1) {
return null;
}
return (
<Space>
<AuthButton btnCode='material.rules.toEdit'>
<Link to={`${match.path}/edit?id=${record.processId}`}>
修改
</Link>
</AuthButton>
// {
// record.status !== 1 && (
// <AuthButton btnCode="material.rules.remove">
// <Popconfirm
// title="确认删除?"
// onConfirm={() => handleDelete(record)}
// okText="是"
// cancelText="否"
// >
// <a >删除</a>
// </Popconfirm>
// </AuthButton>
// )
// }
// </Space>
// )
// }
// }
// ]
{
record.status !== 1 && (
<AuthButton btnCode="material.rules.remove">
<Popconfirm
title="确认删除?"
onConfirm={() => handleDelete(record)}
okText="是"
cancelText="否"
>
<a >删除</a>
</Popconfirm>
</AuthButton>
)
}
</Space>
)
}
}
]
const controllerBtns = () => {
return (
......
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