Browse Source

部颁11表设计调整,上报审核前提示用户生成中间计量数据

MaiXinRong 10 years ago
parent
commit
d3ed907521

+ 19 - 3
DataModules/ReportMemoryDm/rmBillsGatherDm.pas

@@ -492,10 +492,20 @@ end;
 
 
 procedure TrmBillsGatherData.FilterBillsNode(ANode: TsdIDTreeNode;
 procedure TrmBillsGatherData.FilterBillsNode(ANode: TsdIDTreeNode;
   AProjectIndex: Integer);
   AProjectIndex: Integer);
+
+  function CanGatherNode: Boolean;
+  begin
+    case GatherType of
+      bgtFinal11: Result := ANode.Rec.ValueByName('TotalPrice').AsFloat <> 0;
+      else Result := True;
+    end;
+  end;
+
 var
 var
   GclNode: TGclGatherNode;
   GclNode: TGclGatherNode;
 begin
 begin
-  if not Assigned(ANode) then Exit;
+  if not Assigned(ANode) or not CanGatherNode then Exit;
+
   GclNode := FGclList.GetGclGatherNode(ANode.Rec);
   GclNode := FGclList.GetGclGatherNode(ANode.Rec);
   with ANode.Rec do
   with ANode.Rec do
   begin
   begin
@@ -535,7 +545,7 @@ begin
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(2).FirstChild, nil, AProjectIndex, AProject);
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(2).FirstChild, nil, AProjectIndex, AProject);
       bgtFinal09: // 09表 取第三部分及其后所有项目节
       bgtFinal09: // 09表 取第三部分及其后所有项目节
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(3), nil, AProjectIndex, AProject);
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(3), nil, AProjectIndex, AProject);
-      bgtGcl, bgtFinal07, bgtFinal11, bgtFinal19:
+      bgtGcl, bgtFinal07, bgtFinal11, bgtFinal19: // 汇总工程量清单
         FilterBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, AProjectIndex);
         FilterBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, AProjectIndex);
       bgtFinal12: // 不做数据汇总,直接流水式写入数据
       bgtFinal12: // 不做数据汇总,直接流水式写入数据
         WriteFlowData(FProjectData);
         WriteFlowData(FProjectData);
@@ -547,7 +557,7 @@ begin
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(48), nil, AProjectIndex, AProject);
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(48), nil, AProjectIndex, AProject);
       bgtG_Final06_1: // 粤竣06-1表 仅汇总土地及其子节点
       bgtG_Final06_1: // 粤竣06-1表 仅汇总土地及其子节点
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(21), nil, AProjectIndex, AProject);
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(21), nil, AProjectIndex, AProject);
-      else
+      else // 标准汇总方式,分项清单
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, nil, AProjectIndex, AProject)
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, nil, AProjectIndex, AProject)
     end;
     end;
 
 
@@ -752,6 +762,12 @@ begin
     stnNode := ATree.Items[iIndex];
     stnNode := ATree.Items[iIndex];
     if stnNode.ID >= 100 then Continue;
     if stnNode.ID >= 100 then Continue;
     FixedIDNode := FFixedIDList.GetFixedIDBillsNode(stnNode.ID);
     FixedIDNode := FFixedIDList.GetFixedIDBillsNode(stnNode.ID);
+
+    FixedIDNode.TotalPrice := FixedIDNode.TotalPrice
+      + stnNode.Rec.ValueByName('TotalPrice').AsFloat;
+    FixedIDNode.TotalPrice :=
+      + stnNode.Rec.ValueByName('TotalPrice').AsFloat;
+
     FixedIDNode.AddGatherTotalPrice := FixedIDNode.AddGatherTotalPrice
     FixedIDNode.AddGatherTotalPrice := FixedIDNode.AddGatherTotalPrice
       + stnNode.Rec.ValueByName('AddGatherTotalPrice').AsFloat;
       + stnNode.Rec.ValueByName('AddGatherTotalPrice').AsFloat;
     FixedIDNode.P_AddGatherTotalPrice[AProjectIndex] :=
     FixedIDNode.P_AddGatherTotalPrice[AProjectIndex] :=

+ 2 - 0
Forms/MainFrm.pas

@@ -555,6 +555,8 @@ end;
 
 
 procedure TMainForm.actnSubmitExecute(Sender: TObject);   // Éϱ¨
 procedure TMainForm.actnSubmitExecute(Sender: TObject);   // Éϱ¨
 begin
 begin
+  if not CurProjectFrame.CheckCanReport then Exit;
+
   Screen.Cursor := crHourGlass;
   Screen.Cursor := crHourGlass;
   try
   try
     CurProjectFrame.ProjectData.Save;
     CurProjectFrame.ProjectData.Save;

+ 19 - 0
Frames/ProjectFme.pas

@@ -155,6 +155,8 @@ type
 
 
     procedure RefreshColumnDisplay;
     procedure RefreshColumnDisplay;
 
 
+    function CheckCanReport: Boolean;
+
     procedure UnLockData;
     procedure UnLockData;
     procedure ReLockData;
     procedure ReLockData;
 
 
@@ -690,6 +692,8 @@ end;
 
 
 procedure TProjectFrame.btnSubmitClick(Sender: TObject);
 procedure TProjectFrame.btnSubmitClick(Sender: TObject);
 begin
 begin
+  if not CheckCanReport then Exit;
+
   Screen.Cursor := crHourGlass;
   Screen.Cursor := crHourGlass;
   try
   try
     UpToWeb(True);
     UpToWeb(True);
@@ -1314,4 +1318,19 @@ begin
   end;
   end;
 end;
 end;
 
 
+function TProjectFrame.CheckCanReport: Boolean;
+begin
+  Result := QuestMessageYesNo('请确定已生成中间计量数据?');
+  // 使用控件点击进行定位,重新定义方法太复杂
+  if not Result then
+  begin
+    // 先定位至计量台账界面
+    dxsbViewControl.SelectedItem := dxsbViewControl.ActiveGroup.Items[1];
+    dxsbViewControlItemClick(dxsbViewControl, dxsbViewControl.ActiveGroup.Items[1]);
+    // 再定位至中间计量界面
+    tobtnZJJL.Down := True;
+    tobtnZJJL.Click;
+  end;
+end;
+
 end.
 end.

+ 7 - 0
Units/UtilMethods.pas

@@ -22,6 +22,7 @@ type
   procedure WarningMessage(const AMsg: string);
   procedure WarningMessage(const AMsg: string);
   procedure ErrorMessage(const AMsg: string);
   procedure ErrorMessage(const AMsg: string);
   function QuestMessage(const AMsg: string): Boolean;
   function QuestMessage(const AMsg: string): Boolean;
+  function QuestMessageYesNo(const AMsg: string): Boolean;
   procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
   procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
 
 
   {Get Common Path}
   {Get Common Path}
@@ -175,6 +176,12 @@ begin
   Application.ProcessMessages;
   Application.ProcessMessages;
 end;
 end;
 
 
+function QuestMessageYesNo(const AMsg: string): Boolean;
+begin
+  Result := MessageBox(Application.Handle, PChar(AMsg), PChar('ѯÎÊ'), MB_YESNO or MB_ICONQUESTION) = IDOK;
+  Application.ProcessMessages;
+end;
+
 procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
 procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
 begin
 begin
   Allow := False;
   Allow := False;