Browse Source

其他台账 -- 全额计量台账

MaiXinRong 8 years ago
parent
commit
c7b8b4eecd
6 changed files with 165 additions and 40 deletions
  1. 56 28
      Frames/ProjectFme.dfm
  2. 18 6
      Frames/ProjectFme.pas
  3. 1 1
      Units/Connections.pas
  4. 42 4
      Units/DataBaseTables.pas
  5. 46 1
      Units/ProjectData.pas
  6. 2 0
      Units/UpdateDataBase.pas

+ 56 - 28
Frames/ProjectFme.dfm

@@ -2,7 +2,7 @@ object ProjectFrame: TProjectFrame
   Left = 0
   Top = 0
   Width = 1169
-  Height = 438
+  Height = 528
   Font.Charset = ANSI_CHARSET
   Font.Color = clWindowText
   Font.Height = -12
@@ -14,14 +14,14 @@ object ProjectFrame: TProjectFrame
     Left = 0
     Top = 0
     Width = 65
-    Height = 438
+    Height = 528
     Align = alLeft
     TabOrder = 0
     object dxsbViewControl: TdxSideBar
       Left = 1
       Top = 1
       Width = 63
-      Height = 436
+      Height = 526
       Align = alClient
       BkGround.BeginColor = clInactiveCaption
       BkGround.EndColor = clGradientInactiveCaption
@@ -86,14 +86,23 @@ object ProjectFrame: TProjectFrame
               Tag = 4
             end
             item
+              Caption = #20854#20182#21488#36134
+              Index = 5
+              IsDefault = False
+              LargeImage = 7
+              SmallImage = 7
+              StoredItem = dxsbsViewControlItem8
+              Tag = 5
+            end
+            item
               Caption = #25253#34920
               Hint = #25253#34920
-              Index = 5
+              Index = 6
               IsDefault = False
               LargeImage = 6
               SmallImage = 6
               StoredItem = xbiReport
-              Tag = 5
+              Tag = 6
             end>
         end>
       ActiveGroupIndex = 0
@@ -116,13 +125,13 @@ object ProjectFrame: TProjectFrame
     Left = 65
     Top = 0
     Width = 1104
-    Height = 438
+    Height = 528
     Align = alClient
     TabOrder = 1
     object sprAssistant: TSplitter
       Left = 904
       Top = 22
-      Height = 415
+      Height = 505
       Align = alRight
       Color = clBtnFace
       ParentColor = False
@@ -2725,7 +2734,7 @@ object ProjectFrame: TProjectFrame
       Left = 907
       Top = 22
       Width = 196
-      Height = 415
+      Height = 505
       ActivePage = jpsAssistantBGL
       ActivePageIndex = 4
       Align = alRight
@@ -2735,7 +2744,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'StandardBills'
         Caption = 'StandardBills'
       end
@@ -2743,7 +2752,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'DealPayment'
         Caption = 'BlockLib'
       end
@@ -2751,7 +2760,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'Search'
         Caption = 'Seach'
       end
@@ -2759,7 +2768,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'ZJJL'
         Caption = 'ZJJL'
       end
@@ -2767,7 +2776,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'BGL'
         Caption = 'BGL'
       end
@@ -2775,7 +2784,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'Checker'
         Caption = 'Checker'
       end
@@ -2783,7 +2792,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'Bookmark'
         Caption = 'Bookmark'
       end
@@ -2791,7 +2800,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'UpFile'
         Caption = 'UpFile'
       end
@@ -2799,7 +2808,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 196
-        Height = 415
+        Height = 505
         TabName = 'DealBills'
         Caption = 'DealBills'
       end
@@ -2808,7 +2817,7 @@ object ProjectFrame: TProjectFrame
       Left = 1
       Top = 22
       Width = 903
-      Height = 415
+      Height = 505
       ActivePage = jpsMainBillsCompile
       ActivePageIndex = 0
       Align = alClient
@@ -2818,7 +2827,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 903
-        Height = 415
+        Height = 505
         TabName = 'BillsCompile'
         Caption = 'BillsCompile'
       end
@@ -2827,7 +2836,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 903
-        Height = 415
+        Height = 505
         TabName = 'BillsMeasure'
         Caption = 'Bills'
       end
@@ -2836,7 +2845,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 903
-        Height = 415
+        Height = 505
         TabName = 'BillsGather'
         Caption = 'PhaseCompare'
       end
@@ -2845,7 +2854,7 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 903
-        Height = 415
+        Height = 505
         TabName = 'PriceMargin'
         Caption = 'PriceMargin'
       end
@@ -2854,10 +2863,19 @@ object ProjectFrame: TProjectFrame
         Left = 0
         Top = 0
         Width = 903
-        Height = 415
+        Height = 505
         TabName = 'StageCompare'
         Caption = 'StageCompare'
       end
+      object jpsMainOtherMeasure: TJimPage
+        Tag = -1
+        Left = 0
+        Top = 0
+        Width = 903
+        Height = 505
+        TabName = 'OtherMeasure'
+        Caption = 'OtherMeasure'
+      end
     end
   end
   object xpm: TXPMenu
@@ -3127,9 +3145,10 @@ object ProjectFrame: TProjectFrame
       #21488#36134#20998#35299
       #35745#37327#21488#36134
       #28165#21333#27719#24635
-      #23457#26680#27604#36739
       #26448#26009#35843#24046
+      #23457#26680#27604#36739
       #24418#35937#36827#24230
+      #20854#20182#21488#36134
       #25253#34920)
     DefaultLargeImage = -1
     DefaultSmallImage = -1
@@ -3157,7 +3176,7 @@ object ProjectFrame: TProjectFrame
     object xbiStageCompare: TdxStoredSideItem
       Tag = 4
       Caption = #23457#26680#27604#36739
-      Category = 3
+      Category = 4
       Enabled = True
       Hint = #23457#26680#27604#36739
       LargeImage = 3
@@ -3173,9 +3192,9 @@ object ProjectFrame: TProjectFrame
       SmallImage = 5
     end
     object xbiReport: TdxStoredSideItem
-      Tag = 5
+      Tag = 6
       Caption = #25253#34920
-      Category = 6
+      Category = 7
       Enabled = True
       Hint = #25253#34920
       LargeImage = 6
@@ -3192,11 +3211,20 @@ object ProjectFrame: TProjectFrame
     object xbiPriceMargin: TdxStoredSideItem
       Tag = 3
       Caption = #26448#26009#35843#24046
-      Category = 4
+      Category = 3
       Enabled = True
       LargeImage = 4
       SmallImage = 4
     end
+    object dxsbsViewControlItem8: TdxStoredSideItem
+      Tag = 5
+      Caption = #20854#20182#21488#36134
+      Category = 6
+      Enabled = True
+      Hint = #20854#20182#21488#36134
+      LargeImage = 7
+      SmallImage = 7
+    end
   end
   object ilstLarge: TImageList
     Height = 32

+ 18 - 6
Frames/ProjectFme.pas

@@ -6,7 +6,7 @@ uses
   BillsCompileFme, BillsMeasureFme, PhaseCompareFme, DealPaymentFme,
   BillsGatherFme, ZJJLFme, BGLFme, ReportsFrm, SearchFme, BookmarkFme,
   ProjectData, UtilMethods, Globals, mEncryptEditions, DealBillsFme,
-  PriceMarginFme,
+  PriceMarginFme, OtherMeasureFme,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ImgList, XPMenu, Buttons, ComCtrls, ToolWin, ExtCtrls, JimPages,
   StdCtrls, JimCombos, dxsbar, ActnList, dxBar, OrderCheckerFme, CheckerFme,
@@ -81,6 +81,8 @@ type
     actnAllPeg: TAction;
     jpsMainPriceMargin: TJimPage;
     xbiPriceMargin: TdxStoredSideItem;
+    dxsbsViewControlItem8: TdxStoredSideItem;
+    jpsMainOtherMeasure: TJimPage;
     procedure tobtnStandardBillsClick(Sender: TObject);
     procedure jcbPhaseChanged(Sender: TObject);
     procedure sbtnExpendClick(Sender: TObject);
@@ -107,6 +109,8 @@ type
     FBillsGatherFrame: TBillsGatherFrame;
     FPriceMarginFrame: TPriceMarginFrame;
     FPhaseCompareFrame: TPhaseCompareFrame;
+    FOtherMeasureFrame: TOtherMeasureFrame;
+
     FCheckerFrame: TCheckerFrame;
 
     FDealPaymentFrame: TDealPaymentFrame;
@@ -180,6 +184,7 @@ type
     property BillsMeasureFrame: TBillsMeasureFrame read FBillsMeasureFrame;
     property BillsGatherFrame: TBillsGatherFrame read FBillsGatherFrame;
     property PriceMarginFrame: TPriceMarginFrame read FPriceMarginFrame;
+    property OtherMeasureFrame: TOtherMeasureFrame read FOtherMeasureFrame;
 
     property CheckerFrame: TCheckerFrame read FCheckerFrame;
     property UpFileManageView: TUpFileManageView read FUpFileManageView write SetUpFileManageView;
@@ -256,6 +261,7 @@ destructor TProjectFrame.Destroy;
 begin
   FBookmarkFrame.Free;
   FZJJLFrame.Free;
+  FOtherMeasureFrame.Free;
   FBillsGatherFrame.Free;
   FDealPaymentFrame.Free;
   FBillsCompileFrame.Free;
@@ -532,7 +538,7 @@ procedure TProjectFrame.dxsbViewControlItemClick(Sender: TObject;
     BeforeChangeView;
     case Item.Tag of
       0, 2: jpsMain.ActivePageIndex := Item.Tag;
-      1, 3: if CheckMeasureEdition then jpsMain.ActivePageIndex := Item.Tag;
+      1, 3, 5: if CheckMeasureEdition then jpsMain.ActivePageIndex := Item.Tag;
     end;
     AfterChangeView;
   end;
@@ -600,10 +606,10 @@ begin
   bCloseCompare := (Item.Tag in [0..3]) and (jpsMain.ActivePageIndex = 4);
 
   case Item.Tag of
-    0..2: ChangeView;
+    0..2, 5: ChangeView;
     3: DisplayPriceMargin;
     4: DisplayCompare;
-    5: DisplayReports;
+    6: DisplayReports;
   end;
 
   if bCloseCompare then
@@ -1152,10 +1158,16 @@ begin
   CreateBillsFrame;
   UpdateSysProgress(130, '正在解析数据');
   CreateDealPaymentFrame;
-  UpdateSysProgress(140, '正在解析数据');
+  UpdateSysProgress(135, '正在解析数据');
   CreateBillsGatherFrame;
+  UpdateSysProgress(140, '正在解析数据');
+  CreatePriceMarginFrame;                
+  UpdateSysProgress(145, '正在解析数据');
+
+  FOtherMeasureFrame := TOtherMeasureFrame.Create(FProjectData);
+  AlignControl(FOtherMeasureFrame, jpsMainOtherMeasure, alClient);
   UpdateSysProgress(150, '正在解析数据');
-  CreatePriceMarginFrame;
+
 
   FZJJLFrame := TZJJLFrame.Create(Self, FProjectData.PhaseData.ZJJLData);
   FZJJLFrame.DataReadOnly := FProjectData.PhaseData.StageDataReadOnly;

+ 1 - 1
Units/Connections.pas

@@ -8,7 +8,7 @@ uses
 const
   ProductName = 'Measure';
   EmptyFileVersion = '1.0.0.0';
-  FileVersion = '1.0.1.6';
+  FileVersion = '1.0.1.7';
   EncryptVersion = 'Auto1.0';
   SAdoConnectStr = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;' +
                    'User ID=Admin;Password='''';Persist Security Info=True';

+ 42 - 4
Units/DataBaseTables.pas

@@ -691,12 +691,50 @@ const
     (FieldName: 'PrePhasePay'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
   );
 
+  {其他台账 -- 全额计量}
+  SOtherMeasureOnce = 'OtherMeasureOnce';
+  tdOtherMeasureOnce: array [0..7] of TScFieldDef = (
+    (FieldName: 'ID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 排序
+    (FieldName: 'SerialNo'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 编号
+    (FieldName: 'Code'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 名称
+    (FieldName: 'Name'; FieldType: ftString; Size: 200; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 台账类型
+    (FieldName: 'MType'; FieldType: ftString; Size: 20; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 金额
+    (FieldName: 'TotalPrice'; FieldType: ftDouble; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 备注
+    (FieldName: 'MemoStr'; FieldType: ftString; Size: 255; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 创建日期
+    (FieldName: 'CreatePhaseID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+  );
+
+  {其他台账 -- 分期计量}
+  SOtherMeasurePhase = 'OtherMeasurePhase';
+  tdOtherMeasurePhase: array [0..6] of TScFieldDef =(
+    (FieldName: 'ID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
+    // 排序
+    (FieldName: 'SerialNo'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 编号
+    (FieldName: 'Code'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 名称
+    (FieldName: 'Name'; FieldType: ftString; Size: 200; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 台账类型
+    (FieldName: 'MType'; FieldType: ftString; Size: 20; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 备注
+    (FieldName: 'MemoStr'; FieldType: ftString; Size: 255; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 创建日期
+    (FieldName: 'CreatePhaseID'; FieldType: ftInteger; Size: 0; Precision: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+  );
+
   {PhaseData}
 
-  // Refer  :原报
-  // Audit1 :1审
-  // Audit2 :2审
-  // Audit3 :3审
+  // Refer  : 原报
+  // Audit1 : 1审
+  // Audit2 : 2审
+  // Audit3 : 3审
   // ......
   SRefer = 'Refer';
   SAudit = 'Audit';

+ 46 - 1
Units/ProjectData.pas

@@ -7,7 +7,7 @@ uses
   PhaseCompareDm, DealPaymentDm, SearchDm, DealBillsDm, MainDataListDm,
   BillsGatherDm, BGLDm, StaffDm, BillsCompileDm, BillsMeasureDm,
   BillsBookmarkDm, UpFileManageUnit, ProjectGLDm, PriceMarginBillsDm,
-  DetailGLDm,
+  DetailGLDm, OtherMeasureOnceDm,
   Classes, SysUtils, ADODB, sdDB, Checker;
 
 type
@@ -46,6 +46,8 @@ type
     FDetailGLData: TDetailGLData;
     FPriceMarginBillsData: TPriceMarginBillsData;
 
+    FOtherMeasureOnceData: TOtherMeasureOnceData;
+
     FCanUnlockInfo: Boolean;
 
     FWebID: Integer;
@@ -128,6 +130,8 @@ type
     procedure OpenForReport2(const AFileName: string);
     {OpenForReport3: OpenForReport2的基础上打开最后一个审核人数据,打开BillsMeasureTree不打开BillsCompileTree,链接BillsMeasureTree跟StageData}
     procedure OpenForReport3(const AFileName: string);
+    {OpenForGather: BillsData, BillsMeasureTree, DealPaymentData, BGLData, PhaseData(根据PhaseIndex指定打开)}
+    procedure OpenForGather(const AFileName: string; APhaseIndex: Integer = -1);
     //-----------------------  End ---后台打开 ------------------------
 
     procedure SaveDebugFile(const AFileName: string);
@@ -209,6 +213,8 @@ type
     property DetailGLData: TDetailGLData read FDetailGLData;
     property PriceMarginBillsData: TPriceMarginBillsData read FPriceMarginBillsData;
 
+    property OtherMeasureOnceData: TOtherMeasureOnceData read FOtherMeasureOnceData;
+
     // 台账、合同支付
     property AllowInsert: Boolean read GetAllowInsert;
     property BaseDataReadOnly: Boolean read GetBaseDataReadOnly;
@@ -289,6 +295,7 @@ begin
   FProjectGLData := TProjectGLData.Create(Self);
   FDetailGLData := TDetailGLData.Create(Self);
   FPriceMarginBillsData := TPriceMarginBillsData.Create(Self);
+  FOtherMeasureOnceData := TOtherMeasureOnceData.Create(Self);
   FAttachmentData := TUpFiles.Create;
   FPhaseIndex := 0;
 end;
@@ -309,6 +316,7 @@ destructor TProjectData.Destroy;
 begin
   try
     FCheckers.Free;
+    FOtherMeasureOnceData.Free;
     FPriceMarginBillsData.Free;
     FDetailGLData.Free;
     FProjectGLData.Free;
@@ -449,6 +457,7 @@ begin
 
   //FBillsGatherData.RefreshBills;
   FMainListData.Open(FConnection.Connection);
+  FOtherMeasureOnceData.Open(FConnection.Connection);
   UpdateSysProgress(200, '就绪');
 
   if _IsDebugView then
@@ -493,6 +502,9 @@ begin
     FBillsCompileData.ReLockBaseData;
     UpdateSysProgress(110, '正在保存数据');
     FBillsData.Save;
+    UpdateSysProgress(165, '正在保存数据');
+
+    FOtherMeasureOnceData.Save;
     UpdateSysProgress(170, '正在保存数据');
 
     FProjProperties.AuditCompany := FStaffData.FinalStaffCompany;
@@ -1737,12 +1749,21 @@ procedure TProjectData.ResetFloatDigitView;
     FBGLData.cdsBGBillsViewUsedQuantity.DisplayFormat := FProjProperties.QuantityFormat;
   end;
 
+  procedure SetOtherMeasureDigit;
+  begin
+    with FOtherMeasureOnceData.sdvOnce do
+    begin
+      Columns.FindColumn('TotalPrice').DisplayFormat := FProjProperties.TotalPriceFormat;
+    end;
+  end;
+
 begin
   SetBillsCompileDigit;
   SetBillsMeasureDigit;
   SetDealPaymentDigit;
   SetBillsGatherDigit;
   SetBGLDigit;
+  SetOtherMeasureDigit;
 end;
 
 function TProjectData.GetStageDataReadOnly: Boolean;
@@ -1955,4 +1976,28 @@ begin
     Result := False;
 end;
 
+procedure TProjectData.OpenForGather(const AFileName: string;
+  APhaseIndex: Integer = -1);
+begin
+  FProjectID := -1;
+  UnZipFile(AFileName, TempPath);
+  FConnection.Open(MainFileName);
+  UpdateProjectDataBase;
+  FProjProperties.Open(FConnection.Connection);
+  UpdateOldData;
+  FBillsData.Open(FConnection.Connection);
+  FBillsCompileData.Open;
+  FDealPaymentData.Open(FConnection.Connection);
+  FBGLData.Open(FConnection.Connection);
+  if ProjProperties.PhaseCount > 0 then
+  begin
+    if (APhaseIndex <= ProjProperties.PhaseCount) and (APhaseIndex > 0) then
+      FPhaseIndex := APhaseIndex
+    else
+      FPhaseIndex := ProjProperties.PhaseCount;
+    FPhaseData.SimpleOpen2(Format('%sPhase%d.dat', [TempPath, FPhaseIndex]));
+  end;
+  FBillsMeasureData.ResetTreeNodeStageRec;
+end;
+
 end.

+ 2 - 0
Units/UpdateDataBase.pas

@@ -98,6 +98,8 @@ begin
     Updater.AddTableDef(SProjectGL, @tdProjectGL, Length(tdProjectGL), False, False);
     Updater.AddTableDef(SGLPrice, @tdGLPrice, Length(tdGLPrice), False, False);
     Updater.AddTableDef(SDetailGL, @tdDetailGL, Length(tdDetailGL), False, False);
+    Updater.AddTableDef(SOtherMeasureOnce, @tdOtherMeasureOnce, Length(tdOtherMeasureOnce), False, False);
+    Updater.AddTableDef(SOtherMeasurePhase, @tdOtherMeasurePhase, Length(tdOtherMeasurePhase), False, False);
     Updater.ExcuteUpdate;
   finally
     Updater.Free;