客户使用专业版,需要实现多级审核,经过几天努力,终于实现了,奉献给大家。下面是采购入库单为例子,
其他单据想授权到 ICTransType表里找到单据对应的FID和FTemplateID 修改语句 执行就行
UPDATE t_SystemProfile SET FVALUE=1 WHERE FKey='ISUseMultiCheck'
--启用多级审核
Delete From t_MultiCheckOption Where FBillType = 1
insert into t_MultiCheckOption (FBillType, FOptionValue, FMultiCheckAmount, FCurrencyID, FCheckCtlLevel, FMaxCheckLevel) values (1,20,0,1,3,3)
--设置采购入库多级审核
delete from t_objecttype where fobjecttype>=80000
delete from t_objectaccesstype where fobjecttype>=80000
delete from t_objectaccess where FObjectType >= 80000
insert into t_objecttype (fobjecttype,fobjectid,fname,fdescription) Values (80000,0,'采购入库一级审核','采购入库一级审核')
Insert Into t_objectaccesstype (FObjectType,FObjectID,FIndex,FAccessMask,FAccessUse,FName,FDescription,FName_cht,FName_en,FDescription_cht,FDescription_en) Values (80000,0,1,1,0,'一级审核','一级审核','','','','')
Insert Into t_objectaccess (FGroupID,FObjectType,FObjectID,FIndex) Values (80000,80000,0,1)
insert into t_objecttype (fobjecttype,fobjectid,fname,fdescription) Values (80001,0,'采购入库二级审核','采购入库二级审核')
Insert Into t_objectaccesstype (FObjectType,FObjectID,FIndex,FAccessMask,FAccessUse,FName,FDescription,FName_cht,FName_en,FDescription_cht,FDescription_en) Values (80001,0,1,1,0,'二级审核','二级审核','','','','')
Insert Into t_objectaccess (FGroupID,FObjectType,FObjectID,FIndex) Values (80001,80001,0,1)
insert into t_objecttype (fobjecttype,fobjectid,fname,fdescription) Values (80002,0,'采购入库三级审核','采购入库三级审核')
Insert Into t_objectaccesstype (FObjectType,FObjectID,FIndex,FAccessMask,FAccessUse,FName,FDescription,FName_cht,FName_en,FDescription_cht,FDescription_en) Values (80002,0,1,1,0,'三级审核','三级审核','','','','')
Insert Into t_objectaccess (FGroupID,FObjectType,FObjectID,FIndex) Values (80002,80002,0,1)
--权限高级里增加授权
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckLevel1'
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckDate1'
--采购入库显示一级审核人和审核日期
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckLevel2'
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckDate2'
--采购入库显示二级审核人和审核日期
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckLevel3'
Update ICTemplate Set FVisForBillType = 31 Where FID = 'A01' And FFieldName like 'FMultiCheckDate3'
--采购入库显示三级审核人和审核日期
---以下字段需要写个执行文件或触发器,实在不会你保存成.SQL文件每次审核授权后到系统管理执行命令
Delete From t_MultiLevelCheck Where FBillType = 1
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,1,FUserID from t_AccessControl where fobjecttype=80000
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,2,FUserID from t_AccessControl where fobjecttype=80001
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,3,FUserID from t_AccessControl where fobjecttype=80002
--设置采购入库一二三级审核人 (需要先在权限高级里增加授权)
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,1,FUserID from t_User where FName='manager'
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,2,FUserID from t_User where FName='manager'
insert into t_MultiLevelCheck (FBillType, FCheckLevel, FCheckMan) select 1,3,FUserID from t_User where FName='manager'
--设置管理员manager采购入库一二三级审核人
GO