Przeglądaj źródła

Merge branch '3.1.5' of http://192.168.1.12:3000/MaiXinRong/Measure into 3.1.5

CSL 9 lat temu
rodzic
commit
c9ed9c9846

+ 12 - 3
DataModules/BillsMeasureDm.pas

@@ -166,7 +166,8 @@ end;
 procedure TBillsMeasureData.sdvBillsMeasureAfterAddRecord(
   ARecord: TsdDataRecord);
 begin
-  ARecord.ValueByName('IsMeasureAdd').AsBoolean := True;
+  if TProjectData(FProjectData).PhaseData.Active then
+    ARecord.ValueByName('IsMeasureAdd').AsBoolean := True;
 end;
 
 procedure TBillsMeasureData.sdvBillsMeasureGetText(var Text: String;
@@ -807,7 +808,6 @@ procedure TBillsMeasureData.sdvBillsMeasureAfterValueChanged(
 var
   vNode: TBillsIDTreeNode;
 begin
-  vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger));
 
   if TProjectData(FProjectData).PhaseData.Active then
   begin
@@ -817,12 +817,21 @@ begin
       StageData.ReCalculate(AValue.Owner.ValueByName('ID').AsInteger);
   end;
   if Pos('DgnQuantity1', AValue.FieldName) > 0 then
+  begin
+    vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger));
     CalcAddDgnPrice(vNode);
+  end;
 
   if (AValue.FieldName = 'Code') then
-    BillsMeasureTree.RecodeChildrenCode(vNode, VarToStrDef(AValue.OldValue, ''), AValue.AsString)
+  begin                                                                                           
+    vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger));
+    BillsMeasureTree.RecodeChildrenCode(vNode, VarToStrDef(AValue.OldValue, ''), AValue.AsString);
+  end
   else if (AValue.FieldName = 'B_Code') then
+  begin
+    vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger));
     BillsMeasureTree.RecodeChildrenB_Code(vNode, VarToStrDef(AValue.OldValue, ''), AValue.AsString);
+  end;
 end;
 
 procedure TBillsMeasureData.ExpandCurPhase;

+ 9 - 2
DataModules/ReportMemoryDm/rmHaBaiCustomizedDm.pas

@@ -1,6 +1,6 @@
 unit rmHaBaiCustomizedDm;
 
-// 内蒙古 哈白项目定制汇总表 严禁任何其他项目或标表调用该单元
+// 内蒙古 哈白项目/国道306定制汇总表 严禁任何其他项目或标表调用该单元
 // 包括支表2/3/14/3-1/4-1
 
 interface
@@ -22,6 +22,7 @@ type
     FName: string;
     FUnits: string;
     FPrice: Double;
+    FCalcType: Integer;
 
     FQuantity: Double;
     FTotalPrice: Double;
@@ -55,6 +56,7 @@ type
     property Name: string read FName write FName;
     property Units: string read FUnits write FUnits;
     property Price: Double read FPrice write FPrice;
+    property CalcType: Integer read FCalcType write FCalcType;
 
     property Quantity: Double read FQuantity write FQuantity;
     property TotalPrice: Double read FTotalPrice write FTotalPrice;
@@ -988,6 +990,9 @@ procedure TGclNode.Calculate;
 var
   i: Integer;
 begin
+  // 金额模式下不重算
+  if CalcType <> 0 then Exit;
+
   FTotalPrice := FPrice * FQuantity;
   FCurGatherTotalPrice := FPrice * FCurGatherQuantity;
   FEndGatherTotalPrice := FPrice * FEndGatherQuantity;
@@ -1171,7 +1176,8 @@ begin
     if (vGclNode.B_Code = ARec.B_Code.AsString) and
         (vGclNode.Name = ARec.Name.AsString) and
         (vGclNode.Units = ARec.Units.AsString) and
-        (vGclNode.Price = ARec.Price.AsFloat) then
+        (vGclNode.Price = ARec.Price.AsFloat) and
+        (vGclNode.CalcType = ARec.CalcType.AsInteger)then
       begin
         Result := vGclNode;
         Break;
@@ -1227,6 +1233,7 @@ begin
   Result.Name := ARec.Name.AsString;
   Result.Units := ARec.Units.AsString;
   Result.Price := ARec.Price.AsFloat;
+  Result.CalcType := ARec.CalcType.AsInteger;
   LinkGclChapter(Result);
 end;
 

+ 5 - 0
Units/DetailExcelImport.pas

@@ -610,12 +610,17 @@ begin
 end;
 
 procedure TPlaneFxBillsExcelImport.EndImport;
+var
+  ParentRec: TsdDataRecord;
 begin
   FCacheTree.Free;
 
   FProjectData.BillsData.EnableEvents;
   FProjectData.ReConnectTree;
 
+  ParentRec := FProjectData.BillsData.sddBills.FindKey('idxID', ParentID);
+  FProjectData.BillsCompileData.sdvBillsCompile.LocateInControl(ParentRec);
+
   FProjectData.BillsCompileData.CalculateAll;
 
   CloseProgressHint;

+ 5 - 0
Units/ExcelImport.pas

@@ -828,6 +828,8 @@ begin
 end;
 
 procedure TGclBillsExcelImport.EndImport;
+var
+  ParentRec: TsdDataRecord;
 begin
   FSelectSheets.Free;
 
@@ -836,6 +838,9 @@ begin
   FProjectData.BillsData.EnableEvents;
   FProjectData.ReConnectTree;
 
+  ParentRec := FProjectData.BillsData.sddBills.FindKey('idxID', ParentID);
+  FProjectData.BillsCompileData.sdvBillsCompile.LocateInControl(ParentRec);
+
   FProjectData.BillsCompileData.CalculateAll;
 
   CloseProgressHint;

+ 4 - 4
Units/ReportManager.pas

@@ -830,10 +830,10 @@ begin
       48: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3_1, True);
       49: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt4_1, True);
       50: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt_CS, True);
-      52: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt2, True);
-      53: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3, True);
-      54: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3_1, True);
-      55: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt4_1, True);
+      52: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt2, False);
+      53: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3, False);
+      54: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3_1, False);
+      55: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt4_1, False);
       else Result := FrmBillsGatherData.AssignData(FTenders);
     end;
   end;