Explorar el Código

Merge branch 'master' of http://192.168.1.12:3000/MaiXinRong/Measure

chenshilong hace 6 años
padre
commit
8976d08da8

+ 0 - 4
DataModules/BillsGatherDm.dfm

@@ -10,7 +10,6 @@ object BillsGatherData: TBillsGatherData
   end
   object sddGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = smpGclBills
     Left = 40
     Top = 72
@@ -289,7 +288,6 @@ object BillsGatherData: TBillsGatherData
   end
   object sddDetailGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = smpDetailGclBills
     Left = 40
     Top = 248
@@ -566,7 +564,6 @@ object BillsGatherData: TBillsGatherData
   end
   object sddDetailDealBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = smpDetailDealBills
     Left = 136
     Top = 248
@@ -634,7 +631,6 @@ object BillsGatherData: TBillsGatherData
   end
   object sddDetailBGLBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = smpDetailBGLBills
     Left = 240
     Top = 248

+ 1 - 1
DataModules/BillsGatherDm.pas

@@ -366,7 +366,7 @@ var
     Rec := sddGclBills.Add;
     Rec.ValueByName('ID').AsInteger := AGather.ID;
 
-    Rec.ValueByName('IndexCode').AsString := '9999999999999999';
+    Rec.ValueByName('IndexCode').AsString := ' ';
     Rec.ValueByName('Name').AsString := 'ºÏ¼Æ';
 
     Rec.ValueByName('DealTotalPrice').AsFloat := AGather.DealTotalPrice;

+ 0 - 2
DataModules/PriceMarginBillsDm.dfm

@@ -10,7 +10,6 @@ object PriceMarginBillsData: TPriceMarginBillsData
   end
   object sddGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdmpGclBills
     Left = 64
     Top = 80
@@ -52,7 +51,6 @@ object PriceMarginBillsData: TPriceMarginBillsData
   end
   object sddDetailGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdmpDetailGclBills
     Left = 160
     Top = 80

+ 3 - 3
Frames/BillsGatherFme.pas

@@ -184,11 +184,11 @@ procedure TBillsGatherFrame.zgGclBillsCellGetColor(Sender: TObject;
 var
   bSimilarBills: Boolean;
 begin
-  if (ACoord.Y >= zgGclBills.FixedRowCount) and (ACoord.Y < zgGclBills.FixedRowCount + saGclBills.DataView.RecordCount) then
+  if (ACoord.Y >= zgGclBills.FixedRowCount + 1) and (ACoord.Y < zgGclBills.FixedRowCount + saGclBills.DataView.RecordCount) then
   begin
-    if ACoord.Y = zgGclBills.FixedRowCount then
+    if ACoord.Y = zgGclBills.FixedRowCount + 1 then
       bSimilarBills := CheckSimilarBills(ACoord.Y, ACoord.Y + 1)
-    else if ACoord.Y < zgGclBills.FixedRowCount + saGclBills.DataView.RecordCount - 1 then
+    else if ACoord.Y < zgGclBills.FixedRowCount + saGclBills.DataView.RecordCount then
       bSimilarBills := CheckSimilarBills(ACoord.Y, ACoord.Y - 1) or
           CheckSimilarBills(ACoord.Y, ACoord.Y + 1)
     else

+ 0 - 5
Report/DataPrepare/rdpBillsGatherDm.dfm

@@ -11,7 +11,6 @@ object rdpBillsGatherData: TrdpBillsGatherData
   end
   object sddGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdpGclBills
     Left = 40
     Top = 72
@@ -172,7 +171,6 @@ object rdpBillsGatherData: TrdpBillsGatherData
   end
   object sddDetailGclBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdpDetailGclBills
     Left = 40
     Top = 192
@@ -297,7 +295,6 @@ object rdpBillsGatherData: TrdpBillsGatherData
   end
   object sddDetailBGLBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdpDetailBGLBills
     Left = 144
     Top = 192
@@ -343,7 +340,6 @@ object rdpBillsGatherData: TrdpBillsGatherData
   end
   object sddDetailDealBills: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdpDetailDealBills
     Left = 248
     Top = 192
@@ -372,7 +368,6 @@ object rdpBillsGatherData: TrdpBillsGatherData
   end
   object sddLeafXmjs: TsdDataSet
     Active = False
-    Filtered = False
     Provider = sdpLeafXmjs
     Left = 136
     Top = 72

+ 135 - 0
Units/BillsPosTree.pas

@@ -0,0 +1,135 @@
+unit BillsPosTree;
+// 清单--部位明细树 (同导入计量Saas相关,不做他用)
+
+interface
+
+uses
+  Classes, CacheTree, ZhAPI;
+
+type
+  TPosNode = class
+  private
+    FQuantity: Double;
+    FMemoStr: string;
+    FName: string;
+  public
+    property Name: string read FName write FName;
+    property Quantity: Double read FQuantity write FQuantity;
+    property MemoStr: string read FMemoStr write FMemoStr;
+  end;
+
+  TBillsPosTreeNode = class(TCacheNode)
+  private
+    FPosList: TList;
+
+    FQuantity: Double;
+    FPrice: Double;
+    FDgnQty1: Double;
+    FDgnQty2: Double;
+    FUnits: string;
+    FDrawingCode: string;
+    FName: string;
+    FCode: string;
+    FMemoStr: string;
+    FB_Code: string;
+    FTotalPrice: Double;
+    function GetPos(AIndex: Integer): TPosNode;
+    function GetPosCount: Integer;
+  public
+    constructor Create(ACacheTree: TCacheTree; AID: Integer); override;
+    destructor Destroy; override;
+
+    function AddPos: TPosNode;
+    procedure Calculate;
+
+    property Code: string read FCode write FCode;
+    property B_Code: string read FB_Code write FB_Code;
+    property Name: string read FName write FName;
+    property Units: string read FUnits write FUnits;
+    property Price: Double read FPrice write FPrice;
+    property Quantity: Double read FQuantity write FQuantity;
+    property TotalPrice: Double read FTotalPrice write FTotalPrice;
+    property DgnQty1: Double read FDgnQty1 write FDgnQty1;
+    property DgnQty2: Double read FDgnQty2 write FDgnQty2;
+    property DrawingCode: string read FDrawingCode write FDrawingCode;
+    property MemoStr: string read FMemoStr write FMemoStr;
+
+    property PosCount: Integer read GetPosCount;
+    property Pos[AIndex: Integer]: TPosNode read GetPos;
+  end;
+
+  TBillsPosTree = class(TCacheTree)
+  private
+  protected
+    function GetNewNode: TCacheNode; override;
+  public
+    procedure CalculateAll;
+  end;
+
+implementation
+
+{ TBillsPosTreeNode }
+
+function TBillsPosTreeNode.AddPos: TPosNode;
+begin
+  Result := TPosNode.Create;
+  FPosList.Add(Result);
+end;
+
+procedure TBillsPosTreeNode.Calculate;
+var
+  fQuantity: Double;
+  iPos: Integer;
+begin
+  fQuantity := 0;
+  for iPos := 0 to FPosList.Count - 1 do
+    fQuantity := fQuantity + TPosNode(FPosList.Items[iPos]).Quantity;
+  Quantity := fQuantity;
+  TotalPrice := Quantity * Price;
+end;
+
+constructor TBillsPosTreeNode.Create(ACacheTree: TCacheTree; AID: Integer);
+begin
+  inherited;
+  FPosList := TList.Create;
+end;
+
+destructor TBillsPosTreeNode.Destroy;
+begin
+  ClearObjects(FPosList);
+  FPosList.Free;
+  inherited;
+end;
+
+function TBillsPosTreeNode.GetPos(AIndex: Integer): TPosNode;
+begin
+  Result := TPosNode(FPosList.Items[AIndex]);
+end;
+
+function TBillsPosTreeNode.GetPosCount: Integer;
+begin
+  Result := FPosList.Count;
+end;
+
+{ TBillsPosTree }
+
+procedure TBillsPosTree.CalculateAll;
+var
+  i: Integer;
+  vNode: TBillsPosTreeNode;
+begin
+  for i := 0 to CacheNodes.Count - 1 do
+  begin
+    vNode := TBillsPosTreeNode(CacheNodes[i]);
+    if (vNode.PosCount > 0) then
+      vNode.Calculate;
+  end;
+end;
+
+function TBillsPosTree.GetNewNode: TCacheNode;
+begin
+  Result := TBillsPosTreeNode.Create(Self, GetNewNodeID);
+  CacheNodes.Add(Result);
+end;
+
+end.