11import { FormDesignKeyEnum } from '@lib/shared/enums/formDesignEnum' ;
22import { ProcessStatusEnum } from '@lib/shared/enums/process' ;
33import { useI18n } from '@lib/shared/hooks/useI18n' ;
4- import { ProcessStatusType } from '@lib/shared/models/system/process' ;
4+ import { BasicFormParams , MoreSettingsParams , ProcessStatusType } from '@lib/shared/models/system/process' ;
55
66import { StatusInfo } from '@/components/business/crm-approval-status/index.vue' ;
77
@@ -15,26 +15,19 @@ export const processStatusMap: Record<ProcessStatusType, StatusInfo> = {
1515 tagBgColor : 'var(--success-5)' ,
1616 tagColor : 'var(--success-green)' ,
1717 } ,
18- [ ProcessStatusEnum . UNAPPROVED ] : {
19- label : t ( 'common.rejected' ) ,
20- icon : 'iconicon_close_circle_filled' ,
21- color : 'var(--error-red)' ,
22- tagBgColor : 'var(--error-5)' ,
23- tagColor : 'var(--error-red)' ,
24- } ,
2518 [ ProcessStatusEnum . APPROVING ] : {
2619 label : t ( 'common.reviewing' ) ,
2720 icon : 'iconicon_wait' ,
2821 color : 'var(--info-blue)' ,
2922 tagBgColor : 'var(--warning-5)' ,
3023 tagColor : 'var(--warning-yellow)' ,
3124 } ,
32- [ ProcessStatusEnum . PENDING ] : {
33- label : t ( 'common.pending ' ) ,
34- icon : 'iconicon_minus_circle_filled1 ' ,
35- color : 'var(--text-n4 )' ,
36- tagBgColor : '' ,
37- tagColor : '' ,
25+ [ ProcessStatusEnum . UNAPPROVED ] : {
26+ label : t ( 'common.rejected ' ) ,
27+ icon : 'iconicon_close_circle_filled ' ,
28+ color : 'var(--error-red )' ,
29+ tagBgColor : 'var(--error-5) ' ,
30+ tagColor : 'var(--error-red) ' ,
3831 } ,
3932 [ ProcessStatusEnum . REVOKED ] : {
4033 label : t ( 'common.revoked' ) ,
@@ -43,6 +36,14 @@ export const processStatusMap: Record<ProcessStatusType, StatusInfo> = {
4336 tagBgColor : '' ,
4437 tagColor : '' ,
4538 } ,
39+ [ ProcessStatusEnum . PENDING ] : {
40+ label : t ( 'common.pending' ) ,
41+ icon : 'iconicon_minus_circle_filled1' ,
42+ color : 'var(--text-n4)' ,
43+ tagBgColor : '' ,
44+ tagColor : '' ,
45+ } ,
46+
4647 [ ProcessStatusEnum . NONE ] : {
4748 label : '-' ,
4849 icon : '' ,
@@ -57,16 +58,38 @@ export const processStatusOptions = Object.entries(processStatusMap).map(([key,
5758 value : key ,
5859} ) ) ;
5960
60- export const defaultBasicForm = {
61- businessType : FormDesignKeyEnum . OPPORTUNITY_QUOTATION ,
61+ export const defaultBasicForm : BasicFormParams = {
62+ formType : FormDesignKeyEnum . OPPORTUNITY_QUOTATION ,
6263 name : '' ,
63- executionTiming : [ 'CREATE' ] ,
64+ executeTiming : [ 'CREATE' ] ,
6465 description : '' ,
6566} ;
6667
67- export const defaultMoreConfig = {
68- submitterAuthority : true ,
69- approverAuthority : [ ] ,
70- autoApproval : 'firstNodeApproval' ,
71- approvalOpinion : false ,
68+ export const defaultMoreConfig : MoreSettingsParams = {
69+ submitterCanRevoke : true ,
70+ allowBatchProcess : false ,
71+ allowWithdraw : false ,
72+ allowAddSign : false ,
73+ duplicateApproverRule : 'FIRST_ONLY' ,
74+ requireComment : false ,
75+ statusPermissions : [ ] ,
7276} ;
77+
78+ export const businessTypeOptions = [
79+ {
80+ label : t ( 'crmFormCreate.drawer.quotation' ) ,
81+ value : FormDesignKeyEnum . OPPORTUNITY_QUOTATION ,
82+ } ,
83+ {
84+ label : t ( 'module.contract' ) ,
85+ value : FormDesignKeyEnum . CONTRACT ,
86+ } ,
87+ {
88+ label : t ( 'module.invoiceApproval' ) ,
89+ value : FormDesignKeyEnum . INVOICE ,
90+ } ,
91+ {
92+ label : t ( 'module.order' ) ,
93+ value : FormDesignKeyEnum . ORDER ,
94+ } ,
95+ ] ;
0 commit comments