修改只允许选中一个环节,而不是多个环节:
procedure TSELECTFLOWTASKLISTFORM.btnOKClick(Sender: TObject);
const
SNoSelected = '没有选中的任务,不能继续!';
SNoExecutors = '选中了任务:"%s",但是没有分配执行者!';
SInvalidExecutors1 = '选择了后续环节:"%s", 但是分配的执行者超过了定义的个数!';
SInvalidExecutors2 = '选择了后续环节:"%s", 但是没有分配所有执行者!';
var
I, lSelCount: Integer;
lListItem: TListItem;
lFlowTask: TFlowTask;
lCheckCount : Integer;
begin
lSelCount := 0;
lCheckCount := 0;
// do zxh
for I := 0 to lvFlowTasks.Items.Count - 1 do
begin
if lvFlowTasks.Items[I].Checked then
lCheckCount := lCheckCount + 1;
end;
if lCheckCount > 1 then
begin
jsDialogs.ShowWarning('只能选择一个环节!','注意');
SysUtils.Abort;
exit;
end;
/////////////// |