Browse Source

Merge branch 'master' of http://192.168.1.12:3000/maixinrong/measure

MaiXinRong 9 years ago
parent
commit
63f4f7aa69

+ 3 - 3
DataModules/BillsDm.pas

@@ -429,9 +429,9 @@ begin
   for iIndex := 0 to sddBills.RecordCount - 1 do
   begin
     Rec := TBillsRecord(sddBills.Records[iIndex]);
-    Rec.SetBoolValue(Rec.LockLevel, True);
-    Rec.SetBoolValue(Rec.LockInfo, True);
-    Rec.SetBoolValue(Rec.LockNewPrice, Rec.NewPrice.AsFloat <> 0);
+    Rec.SetBoolValue(Rec.LockedLevel, True);
+    Rec.SetBoolValue(Rec.LockedInfo, True);
+    Rec.SetBoolValue(Rec.LockedNewPrice, Rec.NewPrice.AsFloat <> 0);
   end;
   sddBills.EndUpdate;
 end;

+ 2 - 2
Dprs/CSL/Measure_Cloud.dof

@@ -115,7 +115,7 @@ AutoIncBuild=1
 MajorVer=3
 MinorVer=1
 Release=3
-Build=1072
+Build=1076
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化云版
-FileVersion=3.1.3.1072
+FileVersion=3.1.3.1076
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

BIN
Dprs/CSL/Measure_Cloud.res


+ 47 - 8
Frames/BillsCompileFme.pas

@@ -5,7 +5,7 @@ interface
 uses
   BillsCompileDm, UtilMethods, BillsClipboard, sdIDTree, BatchReplaceBillsFrm,
   CheckAndClearFrm, DealBillsFrm, BillsPasteSelectFrm,
-  sdDB, BillsTree,
+  sdDB, BillsTree, sdIDTreeCells,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
   Dialogs, ActnList, sdGridDBA, sdGridTreeDBA, dxBar, ZJGrid, StdCtrls,
   ExtCtrls;
@@ -68,7 +68,7 @@ type
     procedure actnImportGclBillsToXmjExecute(Sender: TObject);
     procedure actnImportPlaneFxBillsToXmjExecute(Sender: TObject);
     procedure zgBillsCompileCellTextChanged(Sender: TObject; Col,
-      Row: Integer);
+      Row: Integer);    
   private
     FBillsCompileData: TBillsCompileData;
     FShowIDField: Boolean;
@@ -82,6 +82,8 @@ type
 
     procedure SetShowIDField(AValue: Boolean);
 
+    procedure ExpandMouseDown(AGridCell: TzjCell);
+
     procedure BeginExpandNode;
     procedure EndExpandNode;
 
@@ -214,6 +216,7 @@ begin
   stdBillsCompile.IDTree := FBillsCompileData.BillsCompileTree;
   with TProjectData(FBillsCompileData.ProjectData) do
     stdBillsCompile.Column('LockedInfo').ReadOnly := ProjProperties.PhaseCount > 0;
+  zgBillsCompile.OnExpandMouseDown := ExpandMouseDown;
 end;
 
 destructor TBillsCompileFrame.Destroy;
@@ -229,7 +232,13 @@ begin
     dxpmBillsCompile.PopupFromCursorPos
   else
   begin
-
+    if CheckExprsColumn then
+      laEdtExprs.Text := zgBillsCompile.CurCell.EditText
+    else
+      laEdtExprs.Text := '';
+    with stdBillsCompile.DataView do
+      if Assigned(Current) then
+        laEdtExprs.ReadOnly := Current.ValueByName('LockedInfo').AsBoolean;
   end;
 end;
 
@@ -283,10 +292,7 @@ begin
   iCol := zgBillsCompile.CurCol-zgBillsCompile.FixedColCount;
   Result := (iCol = stdBillsCompile.VisibleCol('OrgQuantity'))
          or (iCol = stdBillsCompile.VisibleCol('MisQuantity'))
-         or (iCol = stdBillsCompile.VisibleCol('OthQuantity'))
-         or (iCol = stdBillsCompile.VisibleCol('OrgTotalPrice'))
-         or (iCol = stdBillsCompile.VisibleCol('MisTotalPrice'))
-         or (iCol = stdBillsCompile.VisibleCol('OthTotalPirce'));
+         or (iCol = stdBillsCompile.VisibleCol('OthQuantity'));
 end;
 
 procedure TBillsCompileFrame.laEdtExprsKeyDown(Sender: TObject;
@@ -541,6 +547,7 @@ end;
 
 procedure TBillsCompileFrame.BeginExpandNode;
 begin
+  zgBillsCompile.BeginUpdate;
   zgBillsCompile.OnCellGetColor := nil;
   BeginUpdateWindow(zgBillsCompile.Handle);
   stdBillsCompile.DisableControl;
@@ -551,7 +558,7 @@ begin
   stdBillsCompile.EnableControl;
   EndUpdateWindow(zgBillsCompile.Handle);
   zgBillsCompile.OnCellGetColor := zgBillsCompileCellGetColor;
-  zgBillsCompile.Invalidate;
+  zgBillsCompile.EndUpdate;
 end;
 
 procedure TBillsCompileFrame.RefreshPhase_Stage;
@@ -609,6 +616,38 @@ begin
   end;
 end;
 
+procedure TBillsCompileFrame.ExpandMouseDown(AGridCell: TzjCell);
+
+  procedure CommonExpand(vNode: TsdIDTreeNode);
+  begin
+    AGridCell.Grid.BeginUpdate;
+    vNode.Expanded := not vNode.Expanded;
+    AGridCell.Grid.EndUpdate;
+    AGridCell.Grid.InvalidateView(AGridCell.ViewRect);
+  end;
+
+  procedure QuikExpand(vNode: TsdIDTreeNode);
+  begin
+    Screen.Cursor := crHourGlass;
+    BeginExpandNode;
+    try
+      vNode.Expanded := not vNode.Expanded;
+    finally
+      EndExpandNode;
+      Screen.Cursor := crDefault;
+    end;
+  end;
+
+var
+  stnNode: TsdIDTreeNode;
+begin
+  stnNode := TsdIDTreeCell(AGridCell).TreeNode;
+  if stnNode.PosterityCount > 10000 then
+    QuikExpand(stnNode)
+  else
+    CommonExpand(stnNode);
+end;
+
 procedure TBillsCompileFrame.zgBillsCompileCellTextChanged(Sender: TObject;
   Col, Row: Integer);
 begin

+ 40 - 4
Frames/BillsMeasureFme.pas

@@ -3,7 +3,7 @@ unit BillsMeasureFme;
 interface
 
 uses
-  BillsMeasureDm, UtilMethods, BillsClipboard,
+  BillsMeasureDm, UtilMethods, BillsClipboard, sdIDTreeCells,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ZJGrid, ComCtrls, ToolWin, StdCtrls, ExtCtrls, sdGridDBA,
   sdGridTreeDBA, sdDB, ActnList, dxBar, sdIDTree, JimLabels;
@@ -60,6 +60,8 @@ type
     FOnAfterSetBookmark: TBookmarkRefreshEvent;
     FShowAlias: Boolean;
 
+    procedure ExpandMouseDown(AGridCell: TzjCell);
+
     function CheckExprsColumn: Boolean;
 
     procedure SetColumnVisible(const AColumn: string; AVisible: Boolean);
@@ -114,6 +116,7 @@ begin
   inherited Create(AProjectFrame);
   FBillsMeasureData := ABillsMeasureData;
   stdBillsMeasure.IDTree := FBillsMeasureData.BillsMeasureTree;
+  zgBillsMeasure.OnExpandMouseDown := ExpandMouseDown;
 end;
 
 destructor TBillsMeasureFrame.Destroy;
@@ -205,8 +208,8 @@ begin
   // 书签
   if TProjectData(FBillsMeasureData.ProjectData).ProjProperties.PhaseCount > 0 then
   begin
-    StageRec := TBillsIDTreeNode(stnNode).StageRec;
-    if Assigned(StageRec) and StageRec.HasBookMark.AsBoolean then
+    StageRec := stnNode.StageRec;
+    if Assigned(StageRec) and StageRec.HasBookmark.AsBoolean then
       AColor := $00CFE2F9;
   end;
   // 根据节点创建期数底色不同
@@ -586,6 +589,7 @@ end;
 
 procedure TBillsMeasureFrame.BeginExpandNode;
 begin
+  zgBillsMeasure.BeginUpdate;
   zgBillsMeasure.OnCellGetColor := nil;
   BeginUpdateWindow(zgBillsMeasure.Handle);
   stdBillsMeasure.DisableControl;
@@ -596,7 +600,7 @@ begin
   stdBillsMeasure.EnableControl;
   EndUpdateWindow(zgBillsMeasure.Handle);
   zgBillsMeasure.OnCellGetColor := zgBillsMeasureCellGetColor;
-  zgBillsMeasure.Invalidate;
+  zgBillsMeasure.EndUpdate;
 end;
 
 procedure TBillsMeasureFrame.ExpandCurPhase;
@@ -655,4 +659,36 @@ begin
   stdBillsMeasure.Column('PM_AddTotalPrice').Visible := AValue;
 end;
 
+procedure TBillsMeasureFrame.ExpandMouseDown(AGridCell: TzjCell);
+
+  procedure CommonExpand(vNode: TsdIDTreeNode);
+  begin
+    AGridCell.Grid.BeginUpdate;
+    vNode.Expanded := not vNode.Expanded;
+    AGridCell.Grid.EndUpdate;
+    AGridCell.Grid.InvalidateView(AGridCell.ViewRect);
+  end;
+
+  procedure QuikExpand(vNode: TsdIDTreeNode);
+  begin
+    Screen.Cursor := crHourGlass;
+    BeginExpandNode;
+    try
+      vNode.Expanded := not vNode.Expanded;
+    finally
+      EndExpandNode;
+      Screen.Cursor := crDefault;
+    end;
+  end;
+
+var
+  stnNode: TsdIDTreeNode;
+begin
+  stnNode := TsdIDTreeCell(AGridCell).TreeNode;
+  if stnNode.PosterityCount > 10000 then
+    QuikExpand(stnNode)
+  else
+    CommonExpand(stnNode);
+end;
+
 end.

+ 3 - 0
Frames/CheckerFme.pas

@@ -324,7 +324,10 @@ begin
   begin
     if (TOrderCheckerFrame(FList[i]) <> OwnerFrame) and
       (TOrderCheckerFrame(FList[i]) <> AddFrame) then
+    begin
+      TOrderCheckerFrame(FList[i]).lblOrderStatus.Visible := (not ACanDelete);
       TOrderCheckerFrame(FList[i]).btnDelete.Visible := ACanDelete;
+    end;
   end;
 end;
 

+ 14 - 6
Frames/OrderCheckerFme.pas

@@ -62,6 +62,7 @@ type
     procedure SetCheckStatus(const Value: TCheckStatus);
     procedure SetCheckerMemo(const Value: string);
     procedure SetCheckeTime(const Value: string);
+    procedure RightAlign(ALabel: TLabel);
     { Private declarations }
   public
     { Public declarations }
@@ -107,11 +108,8 @@ begin
   lblOrderCheckerName.Visible := not bAdd;
   lblOrderCheckerRole.Visible := not bAdd;
   lblOrderCheckerCompany.Visible := not bAdd;
-  lblOrderStatus.Visible := not bAdd;
-
   shpImage.Visible := not bAdd;
   lblOrderCheckerMemo.Visible := not bAdd;
-
   bOwner := AType = cftOwner;
   lblLast.Visible := bOwner;
   lblOrderCheckerNum.Visible := not bOwner;
@@ -119,9 +117,13 @@ begin
   CheckerFrameType := AType;
   CheckStatus := ACheckStatus;
 
+  lblOrderStatus.Visible := not bAdd;
   if lblOrderStatus.Visible then
-    lblOrderStatus.Left := btnDelete.Left + btnDelete.Width - lblOrderStatus.Width;
+    RightAlign(lblOrderStatus);
+
   lblOrderCheckerTime.Visible := (not bAdd) and (CheckStatus in [csFinished, csNotPass]);
+  if lblOrderCheckerTime.Visible then
+    RightAlign(lblOrderCheckerTime);
 
   case AType of
     cftChecker, cftOwner:
@@ -184,7 +186,7 @@ var vColor: TColor;
 begin
   FCheckStatus := Value;
   lblOrderStatus.Caption := CheckStatusNames[Value];
-
+  RightAlign(lblOrderStatus);
   vColor := CheckStatusColors[Value];
   lblOrderCheckerNum.Font.Color := vColor;
   lblOrderStatus.Font.Color := vColor;
@@ -290,7 +292,13 @@ begin
   FCheckeTime := Value;
 
   lblOrderCheckerTime.Caption := Value;
-  lblOrderCheckerTime.Left := btnDelete.Left + btnDelete.Width - lblOrderCheckerTime.Width;
+  lblOrderCheckerTime.Visible := (CheckStatus in [csFinished, csNotPass]);
+  RightAlign(lblOrderCheckerTime);
+end;
+
+procedure TOrderCheckerFrame.RightAlign(ALabel: TLabel);
+begin
+  ALabel.Left := btnDelete.Left + btnDelete.Width - ALabel.Width;
 end;
 
 end.

+ 22 - 9
Frames/ProjectManagerFme.pas

@@ -623,16 +623,20 @@ procedure TProjectManagerFrame.zgProjectsDrawCellText(ACanvas: TCanvas;
   const ARect: TRect; const ACoord: TPoint; AGrid: TZJGrid;
   const Text: String; var ADefaultDraw: Boolean);
 
-  procedure GetBitmap(AImage: TBitmap);
+  procedure GetBitmap(AImage: TBitmap; ANode: TsdIDTreeNode);
   begin
-    with stdProjects.IDTree.Items[ACoord.Y - 1] do
-      if Rec.ValueByName('Type').AsInteger = 0 then
-        if Expanded and HasChildren then
+    if Assigned(ANode) and Assigned(ANode.Rec) then
+    begin
+      if ANode.Rec.ValueByName('Type').AsInteger = 0 then
+        if ANode.Expanded and ANode.HasChildren then
           MainForm.Images.GetBitmap(34, AImage)
         else
           MainForm.Images.GetBitmap(34, AImage)
       else
         MainForm.Images.GetBitmap(11, AImage);
+    end
+    else
+      AImage := nil;
   end;
 
 const
@@ -642,13 +646,15 @@ var
   Img: TBitmap;
   Cell: TZjCell;
   rImg: TRect;
+  vNode: TsdIDTreeNode;
 begin
   if (ACoord.X = 1) and (ACoord.Y > zgProjects.FixedRowCount - 1) then
   begin
     Cell := zgProjects.Cells[ACoord.X, ACoord.Y];
     Img := TBitmap.Create;
     try
-      GetBitmap(Img);
+      vNode := stdProjects.IDTree.Items[ACoord.Y-zgProjects.FixedRowCount];
+      GetBitmap(Img, vNode);
       case Cell.Align of
         gaTopLeft, gaTopCenter, gaTopRight:
           rImg := Rect(ARect.Left + 2, ARect.Top, ARect.Left + rIconWidth, ARect.Top + rIconHeight);
@@ -850,14 +856,21 @@ procedure TProjectManagerFrame.actnImportExecute(Sender: TObject);
 
 var
   sFileName, sProjectName: string;
+  vCur: TsdIDTreeNode;
 begin
   if SelectFile(sFileName, '.mtf;*.mpf') then
   begin
-    if SameText(ExtractFileExt(sFileName), '.mtf')
-      and (stdProjects.IDTree.Selected.Rec.ValueByName('Type').AsInteger = 0) then
-      sProjectName := GetImportProjectName(sFileName, stdProjects.IDTree.Selected)
+    vCur := stdProjects.IDTree.Selected;
+    if Assigned(vCur) then
+    begin
+      if SameText(ExtractFileExt(sFileName), '.mtf')
+        and (vCur.Rec.ValueByName('Type').AsInteger = 0) then
+        sProjectName := GetImportProjectName(sFileName, stdProjects.IDTree.Selected)
+      else
+        sProjectName := GetImportProjectName(sFileName, stdProjects.IDTree.Selected.Parent);
+    end
     else
-      sProjectName := GetImportProjectName(sFileName, stdProjects.IDTree.Selected.Parent);
+      sProjectName := GetImportProjectName(sFileName, vCur);
 
     Screen.Cursor := crHourGlass;
     try

+ 9 - 9
Units/mDataRecord.pas

@@ -68,9 +68,9 @@ type
     FAddGatherQuantity: TsdValue;
     FAddGatherTotalPrice: TsdValue;
 
-    FLockLevel: TsdValue;
-    FLockInfo: TsdValue;
-    FLockNewPrice: TsdValue;
+    FLockedLevel: TsdValue;
+    FLockedInfo: TsdValue;
+    FLockedNewPrice: TsdValue;
     FCreatePhaseID: TsdValue;
     FIsMeasureAdd: TsdValue;
 
@@ -155,9 +155,9 @@ type
     property AddGatherQuantity: TsdValue read FAddGatherQuantity;
     property AddGatherTotalPrice: TsdValue read FAddGatherTotalPrice;
 
-    property LockLevel: TsdValue read FLockLevel;
-    property LockInfo: TsdValue read FLockInfo;
-    property LockNewPrice: TsdValue read FLockNewPrice;
+    property LockedLevel: TsdValue read FLockedLevel;
+    property LockedInfo: TsdValue read FLockedInfo;
+    property LockedNewPrice: TsdValue read FLockedNewPrice;
     property CreatePhaseID: TsdValue read FCreatePhaseID;
     property IsMeasureAdd: TsdValue read FIsMeasureAdd;
 
@@ -519,9 +519,9 @@ begin
   FAddGatherQuantity := ValueByName('AddGatherQuantity');
   FAddGatherTotalPrice := ValueByName('AddGatherTotalPrice');
 
-  FLockLevel := ValueByName('LockLevel');
-  FLockInfo := ValueByName('LockInfo');
-  FLockNewPrice := ValueByName('LockNewPrice');
+  FLockedLevel := ValueByName('LockedLevel');
+  FLockedInfo := ValueByName('LockedInfo');
+  FLockedNewPrice := ValueByName('LockedNewPrice');
   FCreatePhaseID := ValueByName('CreatePhaseID');
   FIsMeasureAdd := ValueByName('IsMeasureAdd');