刷新的代码太多了,不好意思了。麻烦老师看看吧。
计划管理的代码:
DataTables("合同基本信息表").StopRedraw() '实现即时刷新数据功能
LockBaseMainForm()
'完善合同审批(招标之后)
If (user.group="工程一部" And user.isrole("录入")) Or (user.group="工程二部" And user.isrole("录入")) Or (user.group="设计部" And user.isrole("录入"))
DataTables("合同基本信息表").RemoveFor("承办部门='"& user.group &"' and 承办人 is null")
DataTables("合同基本信息表").AppendLoad("承办部门='"& user.group &"' and 承办人 is null")
End If
'审核审批
If user.group="服务管理中心" Or user.group="公司领导" Or user.group="企管部" Or (user.group="财务部" And user.isrole("财务主管")) Or (user.group="财务部" And user.isrole("部门经理"))
DataTables("合同基本信息表").RemoveFor("承办人 is not null and 审核人 is null and 是否属于专业暂估=0")
DataTables("合同基本信息表").AppendLoad("承办人 is not null and 审核人 is null and 是否属于专业暂估=0")
Else
DataTables("合同基本信息表").RemoveFor("承办部门='"& user.group &"' And 承办人 is not null and 审核人 is null and 是否属于专业暂估=0")
DataTables("合同基本信息表").AppendLoad("承办部门='"& user.group &"' And 承办人 is not null and 审核人 is null and 是否属于专业暂估=0")
End If
'合同交接
If user.group="服务管理中心" Or user.group="公司领导" Or user.group="企管部"
DataTables("合同基本信息表").RemoveFor("审核人 Is not null and 是否属于专业暂估=0 and 提交合同交接日期 Is null")
DataTables("合同基本信息表").AppendLoad("审核人 Is not null and 是否属于专业暂估=0 and 提交合同交接日期 Is null")
Else
DataTables("合同基本信息表").RemoveFor("承办部门='"& user.group &"' And 审核人 Is not null and 是否属于专业暂估=0 and 提交合同交接日期 Is null")
DataTables("合同基本信息表").AppendLoad("承办部门='"& user.group &"' And 审核人 Is not null and 是否属于专业暂估=0 and 提交合同交接日期 Is null")
End If
'交接确认
If user.group="服务管理中心" Or user.group="公司领导" Or user.group="企管部" Or (user.group="行政人事部" And user.isrole("档案管理")) Or (user.group="行政人事部" And user.isrole("部门经理"))
DataTables("合同基本信息表").RemoveFor("提交合同交接日期 Is not null And 接收日期 Is null and 是否属于专业暂估=0")
DataTables("合同基本信息表").AppendLoad("提交合同交接日期 Is not null And 接收日期 Is null and 是否属于专业暂估=0")
End If
UnLockBaseMainForm()
DataTables("合同基本信息表").ResumeRedraw()
DataTables("资金使用申请表").StopRedraw()
LockBaseMainForm()
'审核申请
If user.group="服务管理中心" Or user.group="公司领导" Or user.group="企管部" Or (user.group="财务部" And user.isrole("财务主管")) Or (user.group="财务部" And user.isrole("部门经理"))
DataTables("资金使用申请表").RemoveFor("承办人 is not null and 资金申请审核人 is null and 是否为工资社保公积金=0 and 是否为虚拟合同=0")
DataTables("资金使用申请表").AppendLoad("承办人 is not null and 资金申请审核人 is null and 是否为工资社保公积金=0 and 是否为虚拟合同=0")
Else
DataTables("资金使用申请表").RemoveFor("承办人 is not null and 资金申请审核人 is null and 是否为工资社保公积金=0 and 是否为虚拟合同=0")
DataTables("资金使用申请表").AppendLoad("承办人 is not null and 资金申请审核人 is null and 是否为工资社保公积金=0 and 是否为虚拟合同=0")
End If
'审核支单
If user.group="服务管理中心" Or (user.group="财务部" And user.isrole("会计")) Or (user.group="财务部" And user.isrole("部门经理")) Or user.group="公司领导" Or user.group="企管部"
DataTables("资金使用申请表").RemoveFor("[支单金额] is not null and 支单审核人 is null and 是否为工资社保公积金=0")
DataTables("资金使用申请表").AppendLoad("[支单金额] is not null and 支单审核人 is null and 是否为工资社保公积金=0")
End If
'资金支付
If user.group="服务管理中心" Or (user.group="财务部" And user.isrole("出纳")) Or (user.group="财务部" And user.isrole("部门经理")) Or user.group="公司领导" Or user.group="企管部"
DataTables("资金使用申请表").RemoveFor("((承办人 Is not null And 是否为虚拟合同=1) Or (资金申请审核人 Is not null And 是否为工资社保公积金=0 And 是否为虚拟合同=0)) And 出纳 Is null")
DataTables("资金使用申请表").AppendLoad("((承办人 Is not null And 是否为虚拟合同=1) Or (资金申请审核人 Is not null And 是否为工资社保公积金=0 And 是否为虚拟合同=0)) And 出纳 Is null")
End If
'记账凭证
If user.group="服务管理中心" Or (user.group="财务部" And user.isrole("会计")) Or (user.group="财务部" And user.isrole("部门经理")) Or user.group="公司领导" Or user.group="企管部"
DataTables("资金使用申请表").RemoveFor("是否为工资社保公积金=0 And 出纳 Is not null And 支单审核人 Is not null And 凭证号 Is null")
DataTables("资金使用申请表").AppendLoad("是否为工资社保公积金=0 And 出纳 Is not null And 支单审核人 Is not null And 凭证号 Is null")
End If
'完善建安合同付款(预算录入进度款明细后)
If user.group="服务管理中心" Or user.group="公司领导" Or user.group="工程建设中心"
DataTables("资金使用申请表").RemoveFor("承办部门 is not null and 承办人 is null")
DataTables("资金使用申请表").AppendLoad("承办部门 is not null and 承办人 is null")
Else
DataTables("资金使用申请表").RemoveFor("承办部门='"& user.group &"' and 承办部门 is not null and 承办人 is null")
DataTables("资金使用申请表").AppendLoad("承办部门='"& user.group &"' and 承办部门 is not null and 承办人 is null")
End If
UnLockBaseMainForm()
DataTables("资金使用申请表").ResumeRedraw()