|
@@ -287,14 +287,19 @@ procedure TOtherMeasurePhaseData.sdvPhaseBeforeDeleteRecord(
|
|
|
end;
|
|
|
|
|
|
begin
|
|
|
- Allow := CanDelete(ARecord);
|
|
|
- if not Allow then
|
|
|
+ if (ARecord.ValueByName('PreTotalPrice').AsFloat = 0) then
|
|
|
begin
|
|
|
- ARecord.ValueByName('Deleted').AsBoolean := True;
|
|
|
- ARecord.ValueByName('DeletePhaseID').AsInteger := TProjectData(FProjectData).PhaseIndex;
|
|
|
- ARecord.ValueByName('DeleteStageID').AsInteger := TProjectData(FProjectData).StageIndex;
|
|
|
- sdvPhase.RefreshFilter;
|
|
|
- end;
|
|
|
+ Allow := CanDelete(ARecord);
|
|
|
+ if not Allow then
|
|
|
+ begin
|
|
|
+ ARecord.ValueByName('Deleted').AsBoolean := True;
|
|
|
+ ARecord.ValueByName('DeletePhaseID').AsInteger := TProjectData(FProjectData).PhaseIndex;
|
|
|
+ ARecord.ValueByName('DeleteStageID').AsInteger := TProjectData(FProjectData).StageIndex;
|
|
|
+ sdvPhase.RefreshFilter;
|
|
|
+ end;
|
|
|
+ end
|
|
|
+ else
|
|
|
+ DataSetErrorMessage(Allow, '往期已计量,不允许删除');
|
|
|
end;
|
|
|
|
|
|
procedure TOtherMeasurePhaseData.sdvPhaseFilterRecord(
|