Commit 988451fc authored by leimo's avatar leimo

Merge branch '220518-feat' into 'v2-220518'

feat: 新增规则引擎-合同协同规则引擎/合同管理规则引擎/物料管理规则引擎/采购流程规则引擎/请款单管理规则引擎 See merge request linkseeks-design/pro-platform!564
parents 90f1604e aab2e219
...@@ -220,11 +220,48 @@ const AuthConfigRoute: RouterChild = { ...@@ -220,11 +220,48 @@ const AuthConfigRoute: RouterChild = {
name: '规则引擎', name: '规则引擎',
routes: [ routes: [
{ {
/** 请购单流程规则配置列表 */ /** 规则引擎配置 */
path: '/memberCenter/systemSetting/ruleEng/ruleEngConfig',
name: '规则引擎配置',
component: '@/pages/systemSetting/ruleEng/ruleEngConfig',
hideInMenu: true,
},
{
/** 请购单管理规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/buyingRequisitionRule', path: '/memberCenter/systemSetting/ruleEng/buyingRequisitionRule',
name: '请购单流程规则配置', name: '请购单管理规则引擎',
component: '@/pages/systemSetting/ruleEng/buyingRequisitionRule' component: '@/pages/systemSetting/ruleEng/buyingRequisitionRule'
}, },
{
/** 物料管理规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/materialManageRule',
name: '物料管理规则引擎',
component: '@/pages/systemSetting/ruleEng/materialManageRule'
},
{
/** 采购流程规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/purchaseProcessRule',
name: '采购流程规则引擎',
component: '@/pages/systemSetting/ruleEng/purchaseProcessRule'
},
{
/** 合同管理规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/contractManageRule',
name: '合同管理规则引擎',
component: '@/pages/systemSetting/ruleEng/contractManageRule'
},
{
/** 合同协同规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/contractCoordinationRule',
name: '合同协同规则引擎',
component: '@/pages/systemSetting/ruleEng/contractCoordinationRule'
},
{
/** 请款单管理规则引擎 */
path: '/memberCenter/systemSetting/ruleEng/requestFundsManageRule',
name: '请款单管理规则引擎',
component: '@/pages/systemSetting/ruleEng/requestFundsManageRule'
},
] ]
}, },
/** 密钥管理 */ /** 密钥管理 */
......
...@@ -12,6 +12,8 @@ export const name: ColumnType<any> = { ...@@ -12,6 +12,8 @@ export const name: ColumnType<any> = {
title: '流程规则名称', title: '流程规则名称',
key: 'name', key: 'name',
dataIndex: 'name', dataIndex: 'name',
width: 160,
ellipsis: true,
} }
/** 流程名称 */ /** 流程名称 */
......
...@@ -26,10 +26,12 @@ ...@@ -26,10 +26,12 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 80px;
height: 20px; > span {
border-radius: 2px; padding: 4px;
font-size: 12px; border-radius: 2px;
background-color: #ECF2FE; font-size: 12px;
color: #4787F0; background-color: #ECF2FE;
color: #4787F0;
}
} }
...@@ -23,7 +23,7 @@ const RadioBlock: React.FC<PropsType> = ({ options }) => { ...@@ -23,7 +23,7 @@ const RadioBlock: React.FC<PropsType> = ({ options }) => {
<div className={styles.label}>{options.label}</div> <div className={styles.label}>{options.label}</div>
<div className={styles.detail}>{options.detail}</div> <div className={styles.detail}>{options.detail}</div>
</div> </div>
<span className={styles.tag}>{options.type}</span> <div className={styles.tag}><span>{options.type}</span></div>
</Radio> </Radio>
) )
} }
......
/** /**
* 系统能力 - 规则引擎 - 请购单流程规则配置 * 系统能力 - 规则引擎 - 请购单管理规则引擎
* @author: Crayon * @author: Crayon
*/ */
import React, { useRef } from 'react' import React from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout' import { ColumnType } from 'antd/lib/table'
import { Card, Tag } from 'antd' import TableOperation from '@/components/TableOperation'
import StandardTable from '@/components/StandardTable' import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import { ColumnType } from 'antd/lib/table' import CommonTable from '../component/CommonTable'
import TableOperation from '@/components/TableOperation' import { column_id, column_name, column_processName, column_status, column_createTime, column_operation } from '../columns';
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { schema } from './schema'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import { STATUS_COLOR, STATUS_NAME } from '../../constants'
const BuyingRequisitionProcess: React.FC = () => { const MaterialManageRule: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
const renderOptionButton = (record: any) => { const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { const btnAuthOfOperationTextMap = { '配置': 'buyingRequisitionRule.config' }
'配置': 'buyingRequisitionRule.config', const buttonGroup = { '配置': true }
} const operationHandler = { '配置': () => { } }
const buttonGroup = {
'配置': true,
}
const operationHandler = {
'配置': () => {},
}
return ( return (
<TableOperation <TableOperation
buttonTextFieldMap={buttonGroup} buttonTextFieldMap={buttonGroup}
...@@ -39,73 +24,30 @@ const BuyingRequisitionProcess: React.FC = () => { ...@@ -39,73 +24,30 @@ const BuyingRequisitionProcess: React.FC = () => {
) )
} }
const fetchData = (params: any) => {
return new Promise((resolve) => {
getOrderDeliveryNoticeOrderVendorPage({
...params,
}).then(({ code, data }) => {
if (code === 1000) {
resolve(data)
}
})
})
}
const columns: ColumnType<any>[] = [ const columns: ColumnType<any>[] = [
{ title: '流程规则ID', dataIndex: 'processId', key: 'processId' }, // 流程规则ID
{ column_id,
title: '流程规则名称', // 流程规则名称
dataIndex: 'processRuleName', column_name,
key: 'processRuleName', // 流程名称
width: 160, column_processName,
ellipsis: true, // 状态
}, column_status,
{ title: '流程名称', dataIndex: 'processName', key: 'processName' }, // 操作时间
column_createTime,
// 操作
{ {
title: '状态', ...column_operation,
dataIndex: 'status',
key: 'status',
render: (text: string) => (
<Tag color={STATUS_COLOR[text]?.color}>
<span style={{ color: STATUS_COLOR[text]?.fontColor }}>{STATUS_NAME[text]}</span>
</Tag>
)
},
{ title: '操作时间', dataIndex: 'createTime', key: 'createTime' },
{
title: '操作',
align: 'center',
render: (record) => renderOptionButton(record) render: (record) => renderOptionButton(record)
}, }
] ]
return ( return (
<PageHeaderWrapper> <CommonTable
<Card> fetchApi={getOrderDeliveryNoticeOrderVendorPage}
<StandardTable columns={columns}
currentRef={ref} />
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
FORM_FILTER_PATH,
)
}}
schema={schema}
/>
}
/>
</Card>
</PageHeaderWrapper>
) )
} }
export default BuyingRequisitionProcess export default MaterialManageRule
import { ColumnType } from 'antd/lib/table/interface';
import { Tag } from 'antd'
import { STATUS_COLOR, STATUS_NAME } from '../../constants'
import { id, name, processName, createTime, operation, status } from '../../columns';
/** 流程规则ID */
export const column_id = id
/** 流程规则名称 */
export const column_name = name
/** 流程规则类型 */
export const column_processRuleType: ColumnType<any> = {
title: '流程规则类型',
key: 'processRuleType',
dataIndex: 'processRuleType',
}
/** 流程名称 */
export const column_processName = processName
/** 操作时间 */
export const column_createTime = createTime
/** 状态 */
export const column_status: ColumnType<any> = {
...status,
render: (text: string) => (
<Tag color={STATUS_COLOR[text]?.color}>
<span style={{ color: STATUS_COLOR[text]?.fontColor }}>{STATUS_NAME[text]}</span>
</Tag>
)
}
/** 操作 */
export const column_operation = operation
/**
* 规则引擎-表格共用
* @author: Crayon
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card, Tag } from 'antd'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import NiceForm from '@/components/NiceForm'
import { ISchema } from '@formily/antd'
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { tableFormSchema } from './schema'
type PropsType = {
rowKey?: string
searchKey?: string
schema?: ISchema
fetchApi: Function
fetchParams?: Object
columns: ColumnType<any>[]
}
const CommonTable: React.FC<PropsType> = (props) => {
const { schema = tableFormSchema, fetchApi, fetchParams = {}, columns, searchKey = 'name', rowKey = 'id' } = props
const ref = useRef<any>({})
const formActions = createFormActions()
const fetchData = (params: any) => {
return new Promise((resolve) => {
fetchApi?.({
...params,
...fetchParams
}).then(({ code, data }) => {
if (code === 1000) {
resolve(data)
}
})
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKey }}
fetchTableData={(params: any) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
searchKey,
FORM_FILTER_PATH,
)
}}
schema={schema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default CommonTable
import { ISchema } from '@formily/antd' import { ISchema } from '@formily/antd'
export const schema: ISchema = { export const tableFormSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
name: { name: {
......
/**
* 系统能力 - 规则引擎 - 合同协同规则引擎
* @author: Crayon
*/
import React from 'react'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import CommonTable from '../component/CommonTable'
import { column_id, column_name, column_processName, column_status, column_createTime, column_operation } from '../columns';
import { history } from 'umi'
const ContractCoordinationRule: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { '配置': 'contractCoordinationRule.config' }
const buttonGroup = { '配置': true }
const operationHandler = { '配置': () => { history.push('/memberCenter/systemSetting/ruleEng/ruleEngConfig') } }
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<any>[] = [
// 流程规则ID
column_id,
// 流程规则名称
column_name,
// 合同流程名称
{
...column_processName,
title: '合同流程名称'
},
// 状态
column_status,
// 操作时间
column_createTime,
// 操作
{
...column_operation,
render: (record) => renderOptionButton(record)
}
]
return (
<CommonTable
fetchApi={getOrderDeliveryNoticeOrderVendorPage}
columns={columns}
/>
)
}
export default ContractCoordinationRule
/**
* 系统能力 - 规则引擎 - 合同管理规则引擎
* @author: Crayon
*/
import React from 'react'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import CommonTable from '../component/CommonTable'
import { column_id, column_name, column_processName, column_status, column_createTime, column_operation } from '../columns';
import { history } from 'umi'
const ContractManageRule: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { '配置': 'contractManageRule.config' }
const buttonGroup = { '配置': true }
const operationHandler = { '配置': () => { history.push('/memberCenter/systemSetting/ruleEng/ruleEngConfig') } }
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<any>[] = [
// 流程规则ID
column_id,
// 流程规则名称
column_name,
// 合同管理流程名称
{
...column_processName,
title: '合同管理流程名称'
},
// 状态
column_status,
// 操作时间
column_createTime,
// 操作
{
...column_operation,
render: (record) => renderOptionButton(record)
}
]
return (
<CommonTable
fetchApi={getOrderDeliveryNoticeOrderVendorPage}
columns={columns}
/>
)
}
export default ContractManageRule
/**
* 系统能力 - 规则引擎 - 物料管理规则引擎
* @author: Crayon
*/
import React from 'react'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import CommonTable from '../component/CommonTable'
import { column_id, column_name, column_processName, column_status, column_createTime, column_operation } from '../columns';
import { history } from 'umi'
const BuyingRequisitionRule: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { '配置': 'materialManageRule.config' }
const buttonGroup = { '配置': true }
const operationHandler = { '配置': () => { history.push('/memberCenter/systemSetting/ruleEng/ruleEngConfig') } }
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<any>[] = [
// 流程规则ID
column_id,
// 流程规则名称
column_name,
// 物料流程名称
{
...column_processName,
title: '物料流程名称'
},
// 状态
column_status,
// 操作时间
column_createTime,
// 操作
{
...column_operation,
render: (record) => renderOptionButton(record)
}
]
return (
<CommonTable
fetchApi={getOrderDeliveryNoticeOrderVendorPage}
columns={columns}
/>
)
}
export default BuyingRequisitionRule
/**
* 系统能力 - 规则引擎 - 采购流程规则引擎
* @author: Crayon
*/
import React from 'react'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import CommonTable from '../component/CommonTable'
import { column_id, column_name, column_processRuleType, column_processName, column_status, column_createTime, column_operation } from '../columns';
import { history } from 'umi'
const PurchaseProcessRule: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { '配置': 'purchaseProcessRule.config' }
const buttonGroup = { '配置': true }
const operationHandler = { '配置': () => { history.push('/memberCenter/systemSetting/ruleEng/ruleEngConfig') } }
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<any>[] = [
// 流程规则ID
column_id,
// 流程规则名称
column_name,
// 流程规则类型
column_processRuleType,
// 交易流程名称
{
...column_processName,
title: '交易流程名称'
},
// 状态
column_status,
// 操作时间
column_createTime,
// 操作
{
...column_operation,
render: (record) => renderOptionButton(record)
}
]
return (
<CommonTable
fetchApi={getOrderDeliveryNoticeOrderVendorPage}
columns={columns}
/>
)
}
export default PurchaseProcessRule
/**
* 系统能力 - 规则引擎 - 请款单管理规则引擎
* @author: Crayon
*/
import React from 'react'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import { getOrderDeliveryNoticeOrderVendorPage } from '@/services/OrderNewV2Api'
import CommonTable from '../component/CommonTable'
import { column_id, column_name, column_processName, column_status, column_createTime, column_operation } from '../columns';
import { history } from 'umi'
const RequestFundsManageRule: React.FC = () => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = { '配置': 'requestFundsManageRule.config' }
const buttonGroup = { '配置': true }
const operationHandler = { '配置': () => { history.push('/memberCenter/systemSetting/ruleEng/ruleEngConfig') } }
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<any>[] = [
// 流程规则ID
column_id,
// 流程规则名称
column_name,
// 请款单流程名称
{
...column_processName,
title: '请款单流程名称'
},
// 状态
column_status,
// 操作时间
column_createTime,
// 操作
{
...column_operation,
render: (record) => renderOptionButton(record)
}
]
return (
<CommonTable
fetchApi={getOrderDeliveryNoticeOrderVendorPage}
columns={columns}
/>
)
}
export default RequestFundsManageRule
/**
* 系统能力 - 规则引擎 - 规则引擎配置
* @author: Crayon
*/
import React from 'react'
const RuleEngConfig: React.FC = () => {
return (
<div>RuleEngConfig</div>
)
}
export default RuleEngConfig
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