Commit cb8e9637 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

feat: 完善请款单流程规则

parent 652f0cce
...@@ -111,18 +111,72 @@ const AuthConfigRoute: RouterChild = { ...@@ -111,18 +111,72 @@ const AuthConfigRoute: RouterChild = {
}, },
// 流程引擎 // 流程引擎
{ {
path: '/memberCenter/systemSetting/processEng', path: '/memberCenter/systemSetting/processManagement',
name: '流程引擎', name: '流程引擎',
routes: [ routes: [
{ {
// 交易流程规则配置
path: '/memberCenter/systemSetting/processManagement/transactionRules',
name: '交易流程规则配置',
component: '@/pages/transaction/transactionRules',
},
{
// 新增交易流程规则
path: '/memberCenter/systemSetting/processManagement/transactionRules/add',
name: '新增交易流程规则',
component: '@/pages/transaction/transactionRules/addRule',
hideInMenu: true,
},
{
// 编辑交易流程规则
path: '/memberCenter/systemSetting/processManagement/transactionRules/edit',
name: '编辑交易流程规则',
component: '@/pages/transaction/transactionRules/addRule',
hideInMenu: true,
},
{
// 交易流程规则详情
path: '/memberCenter/systemSetting/processManagement/transactionRules/detail',
name: '交易流程规则详情',
component: '@/pages/transaction/transactionRules/addRule',
hideInMenu: true,
},
{
// 采购流程规则配置
path: '/memberCenter/systemSetting/processManagement/purchaseRules',
name: '采购流程规则配置',
component: '@/pages/transaction/purchaseRules',
},
{
// 新增交易流程规则
path: '/memberCenter/systemSetting/processManagement/purchaseRules/add',
name: '新增采购流程规则',
component: '@/pages/transaction/purchaseRules/addRule',
hideInMenu: true,
},
{
// 编辑采购流程规则
path: '/memberCenter/systemSetting/processManagement/purchaseRules/edit',
name: '编辑采购流程规则',
component: '@/pages/transaction/purchaseRules/addRule',
hideInMenu: true,
},
{
// 采购流程规则详情
path: '/memberCenter/systemSetting/processManagement/purchaseRules/detail',
name: '采购流程规则详情',
component: '@/pages/transaction/purchaseRules/addRule',
hideInMenu: true,
},
{
// 请款单流程规则配置 // 请款单流程规则配置
path: '/memberCenter/systemSetting/processEng/invoiceProcessEng', path: '/memberCenter/systemSetting/processManagement/invoiceProcessEng',
name: '请款单流程规则配置', name: '请款单流程规则配置',
component: '@/pages/systemSetting/processEng/invoiceProcessEng', component: '@/pages/systemSetting/processEng/invoiceProcessEng',
}, },
{ {
// 新增请款单流程规则 // 新增请款单流程规则
path: '/memberCenter/systemSetting/processEng/invoiceProcessEng/add', path: '/memberCenter/systemSetting/processManagement/invoiceProcessEng/add',
name: '新增请款单流程规则', name: '新增请款单流程规则',
component: '@/pages/systemSetting/processEng/invoiceProcessEng/add', component: '@/pages/systemSetting/processEng/invoiceProcessEng/add',
hideInMenu: true, hideInMenu: true,
......
...@@ -25,7 +25,7 @@ const COLOR: ColorType = { ...@@ -25,7 +25,7 @@ const COLOR: ColorType = {
success: { bg: '#E4F7EF', text: '#00A98F' }, success: { bg: '#E4F7EF', text: '#00A98F' },
} }
const getColor = (scale: number) => { export const getColor = (scale: number) => {
if (scale < 60) { if (scale < 60) {
return COLOR.error return COLOR.error
} }
......
...@@ -5,6 +5,7 @@ import { SaveOutlined } from '@ant-design/icons'; ...@@ -5,6 +5,7 @@ import { SaveOutlined } from '@ant-design/icons';
import ProcessEngLayout from './components/processEng'; import ProcessEngLayout from './components/processEng';
import ProcessSelectLayout from './components/processSelect'; import ProcessSelectLayout from './components/processSelect';
import InvoiceTypeLayout from './components/invoiceType'; import InvoiceTypeLayout from './components/invoiceType';
import { getColor } from '@/components/FormProgress';
export const layout: any = { export const layout: any = {
colon: false, colon: false,
...@@ -12,11 +13,23 @@ export const layout: any = { ...@@ -12,11 +13,23 @@ export const layout: any = {
labelAlign: "left" labelAlign: "left"
}; };
const progress = {
display: 'flex',
alignItems: 'center',
width: '240px',
height: '16px',
marginLeft: '8px',
padding: '0 8px',
borderRadius: '8px',
fontSize: '12px',
fontWeight: 'normal',
}
const AddInvoiceProcessEng: React.FC<{}> = () => { const AddInvoiceProcessEng: React.FC<{}> = () => {
const [percent, setPercent] = useState<number>(0); const [percent, setPercent] = useState<number>(0);
/**计算输入框输入了百分之多少 */ /**计算输入框输入了百分之多少 */
const onValuesChange = (allValues) => { const onFieldsChange = (allValues) => {
const values = Object.values(allValues); const values = Object.values(allValues);
let num = 0; let num = 0;
values.forEach(_item => { values.forEach(_item => {
...@@ -24,13 +37,21 @@ const onValuesChange = (allValues) => { ...@@ -24,13 +37,21 @@ const onValuesChange = (allValues) => {
num += 1 num += 1
} }
}) })
console.log(((num/values.length) * 100).toFixed(0) + '%') setPercent(Number(((num / values.length) * 100)))
}
}
return ( return (
<Fragment> <Fragment>
<PeripheralLayout <PeripheralLayout
hideBreak hideBreak
detail='新增请款单流程规则' detail='新增请款单流程规则'
no={
<div
style={{ ...progress, backgroundColor: getColor(percent).bg, color: getColor(percent).text }}
>
信息完整度 {percent.toFixed(0)}%
</div>
}
tabLink={[ tabLink={[
{ title: '流程规则', id: 'processEng' }, { title: '流程规则', id: 'processEng' },
{ title: '流程选择', id: 'processSelect' }, { title: '流程选择', id: 'processSelect' },
...@@ -45,7 +66,7 @@ const onValuesChange = (allValues) => { ...@@ -45,7 +66,7 @@ const onValuesChange = (allValues) => {
</Button> </Button>
} }
components={ components={
<Form {...layout} onValuesChange={(_, allValues) => onValuesChange(allValues) }> <Form {...layout} onFieldsChange={(_, allValues) => onFieldsChange(allValues)}>
<ProcessEngLayout /> <ProcessEngLayout />
<ProcessSelectLayout /> <ProcessSelectLayout />
<InvoiceTypeLayout /> <InvoiceTypeLayout />
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
margin-left: 8px; margin-left: 8px;
display: flex;
align-items: center;
} }
} }
} }
......
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