Ver código fonte

中间计量,仅原报可选择中间计量模式

MaiXinRong 9 anos atrás
pai
commit
d2505df008
5 arquivos alterados com 143 adições e 46 exclusões
  1. 28 16
      Forms/MainFrm.dfm
  2. 2 0
      Forms/MainFrm.pas
  3. 29 14
      Frames/ZJJLFme.dfm
  4. 77 9
      Frames/ZJJLFme.pas
  5. 7 7
      Units/PhaseProperty.pas

+ 28 - 16
Forms/MainFrm.dfm

@@ -20,8 +20,8 @@ object MainForm: TMainForm
   TextHeight = 12
   object jtsProjects: TJimTabSet
     Left = 0
-    Top = 49
-    Width = 734
+    Top = 48
+    Width = 742
     Height = 21
     Align = alTop
     BackgroundColor = clGradientInactiveCaption
@@ -45,8 +45,8 @@ object MainForm: TMainForm
   end
   object dxStatusBar: TdxStatusBar
     Left = 0
-    Top = 480
-    Width = 734
+    Top = 484
+    Width = 742
     Height = 20
     Panels = <
       item
@@ -78,12 +78,12 @@ object MainForm: TMainForm
     object dxStatusBarContainer2: TdxStatusBarContainerControl
       Left = 604
       Top = 2
-      Width = 128
+      Width = 136
       Height = 16
       object ProgressBar: TProgressBar
         Left = 0
         Top = 0
-        Width = 128
+        Width = 136
         Height = 16
         Align = alClient
         Max = 200
@@ -93,9 +93,9 @@ object MainForm: TMainForm
   end
   object jpsMain: TJimPages
     Left = 0
-    Top = 70
-    Width = 734
-    Height = 410
+    Top = 69
+    Width = 742
+    Height = 415
     ActivePage = jpsMainProjectsManager
     ActivePageIndex = 0
     Align = alClient
@@ -103,8 +103,8 @@ object MainForm: TMainForm
     object jpsMainProjectsManager: TJimPage
       Left = 0
       Top = 0
-      Width = 734
-      Height = 410
+      Width = 742
+      Height = 415
       TabName = 'ProjectsManager'
       Caption = 'ProjsMgr'
       object pnlUser: TPanel
@@ -201,8 +201,8 @@ object MainForm: TMainForm
     object jpsMainProjects: TJimPage
       Left = 0
       Top = 0
-      Width = 734
-      Height = 410
+      Width = 742
+      Height = 415
       TabName = 'Projects'
       Caption = 'Projects'
       object jpsProjects: TJimPages
@@ -220,7 +220,7 @@ object MainForm: TMainForm
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
     Font.Height = -12
-    Font.Name = #24494#36719#38597#40657
+    Font.Name = #23435#20307
     Font.Style = []
     Bars = <
       item
@@ -270,7 +270,7 @@ object MainForm: TMainForm
         Caption = #24037#20855#26639
         DockedDockingStyle = dsTop
         DockedLeft = 0
-        DockedTop = 27
+        DockedTop = 26
         DockingStyle = dsTop
         FloatLeft = 484
         FloatTop = 279
@@ -379,7 +379,7 @@ object MainForm: TMainForm
     DockControlHeights = (
       0
       0
-      49
+      48
       0)
     object dxsiFile: TdxBarSubItem
       Caption = #25991#20214'(&F)'
@@ -1021,6 +1021,18 @@ object MainForm: TMainForm
       Visible = ivAlways
       ImageIndex = 15
     end
+    object dxbtnFxZJJL: TdxBarButton
+      Caption = '0'#21495#21488#36134#26684#24335
+      Category = 0
+      Hint = '0'#21495#21488#36134#26684#24335
+      Visible = ivAlways
+    end
+    object dxbtnGclZJJL: TdxBarButton
+      Caption = #24635#37327#25511#21046#26684#24335
+      Category = 0
+      Hint = #24635#37327#25511#21046#26684#24335
+      Visible = ivAlways
+    end
   end
   object Images: TImageList
     DrawingStyle = dsTransparent

+ 2 - 0
Forms/MainFrm.pas

@@ -151,6 +151,8 @@ type
     dxbtnCopyDetailGls: TdxBarButton;
     dxbtnApplyToSameBills: TdxBarButton;
     dxbtnCalculatePriceMargin: TdxBarButton;
+    dxbtnFxZJJL: TdxBarButton;
+    dxbtnGclZJJL: TdxBarButton;
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure jtsProjectsChange(Sender: TObject; NewTab: Integer;

+ 29 - 14
Frames/ZJJLFme.dfm

@@ -80,20 +80,6 @@ object ZJJLFrame: TZJJLFrame
       TabOrder = 1
       OnExit = lePreTextExit
     end
-    object rgType: TRadioGroup
-      Left = 214
-      Top = -3
-      Width = 150
-      Height = 29
-      Columns = 2
-      Ctl3D = False
-      ItemIndex = 0
-      Items.Strings = (
-        '0'#21495#21488#36134
-        #24635#37327#25511#21046)
-      ParentCtl3D = False
-      TabOrder = 2
-    end
   end
   object pnlZJJL: TPanel
     Left = 0
@@ -116,6 +102,8 @@ object ZJJLFrame: TZJJLFrame
       DefaultFixedColWidth = 25
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnMouseDown = zgZJJLMouseDown
       Align = alClient
     end
@@ -205,12 +193,23 @@ object ZJJLFrame: TZJJLFrame
       Caption = #33258#21160#29983#25104
       ImageIndex = 32
       OnExecute = actnGenerateExecute
+      OnUpdate = actnGenerateUpdate
     end
     object actnLocateBills: TAction
       Caption = #23450#20301#33267#21488#36134
       OnExecute = actnLocateBillsExecute
       OnUpdate = actnLocateBillsUpdate
     end
+    object actnGenerateFxZJJL: TAction
+      Caption = '0'#21495#21488#36134#26684#24335
+      ImageIndex = 32
+      OnExecute = actnGenerateFxZJJLExecute
+    end
+    object actnGenerateGclZJJL: TAction
+      Caption = #24635#37327#25511#21046#26684#24335
+      ImageIndex = 32
+      OnExecute = actnGenerateGclZJJLExecute
+    end
   end
   object zaZJJL: TZjGridDBA
     Columns = <
@@ -288,4 +287,20 @@ object ZJJLFrame: TZJJLFrame
     Left = 104
     Top = 160
   end
+  object dxpmAutoGenerate: TdxBarPopupMenu
+    BarManager = MainForm.dxBarManager
+    ItemLinks = <
+      item
+        Item = MainForm.dxbtnFxZJJL
+        Visible = True
+      end
+      item
+        Item = MainForm.dxbtnGclZJJL
+        Visible = True
+      end>
+    UseOwnFont = False
+    OnPopup = dxpmAutoGeneratePopup
+    Left = 104
+    Top = 200
+  end
 end

+ 77 - 9
Frames/ZJJLFme.pas

@@ -29,8 +29,10 @@ type
     lblDataTiel: TLabel;
     pnlDataBar: TPanel;
     dxpmZJJL: TdxBarPopupMenu;
-    rgType: TRadioGroup;
     actnLocateBills: TAction;
+    dxpmAutoGenerate: TdxBarPopupMenu;
+    actnGenerateFxZJJL: TAction;
+    actnGenerateGclZJJL: TAction;
     procedure actnGenerateExecute(Sender: TObject);
     procedure lePreTextExit(Sender: TObject);
     procedure zgZJJLMouseDown(Sender: TObject; Button: TMouseButton;
@@ -38,10 +40,17 @@ type
     procedure dxpmZJJLPopup(Sender: TObject);
     procedure actnLocateBillsExecute(Sender: TObject);
     procedure actnLocateBillsUpdate(Sender: TObject);
+    procedure dxpmAutoGeneratePopup(Sender: TObject);
+    procedure actnGenerateFxZJJLExecute(Sender: TObject);
+    procedure actnGenerateGclZJJLExecute(Sender: TObject);
+    procedure actnGenerateUpdate(Sender: TObject);
   private
     FZJJLData: TZJJLData;
     FDataReadOnly: Boolean;
     procedure SetDataReadOnly(const Value: Boolean);
+
+    procedure RefreshTitle;
+    procedure GenerateZJJL;
   public
     constructor Create(AParent: TFrame; AZJJLData: TZJJLData);
     destructor Destroy; override;
@@ -54,7 +63,8 @@ type
 implementation
 
 uses
-  MergeTextFrm, PhaseData, MainFrm, ProjectData, UtilMethods;
+  MergeTextFrm, PhaseData, MainFrm, ProjectData, UtilMethods,
+  PhaseProperty;
 
 {$R *.dfm}
 
@@ -66,6 +76,7 @@ begin
   ResetFrameLink(AZJJLData);
   with TProjectData(TPhaseData(FZJJLData.PhaseData).ProjectData) do
     lePreText.Text := ProjProperties.ZJJLPreText;
+  RefreshTitle;
 end;
 
 destructor TZJJLFrame.Destroy;
@@ -81,14 +92,19 @@ begin
 end;
 
 procedure TZJJLFrame.actnGenerateExecute(Sender: TObject);
+var
+  bIsRefer: Boolean; 
+  P: TPoint;
 begin
   with TProjectData(TPhaseData(FZJJLData.PhaseData).ProjectData) do
-    ProjProperties.ZJJLPreText := lePreText.Text;
-  if rgType.ItemIndex = 0 then
-    FZJJLData.GenerateAll
-  else if rgType.ItemIndex = 1 then
-    FZJJLData.GenerateAllByB_Code;
-  FZJJLData.AssignedCurData;
+    bIsRefer := ProjProperties.AuditStatus = 0;
+  if bIsRefer then
+  begin
+    P := pnlButton.ClientToScreen(Point(tobtnGenerate.Left, tobtnGenerate.Top + tobtnGenerate.Height));
+    dxpmAutoGenerate.Popup(P.X, P.Y);
+  end
+  else
+    GenerateZJJL;
 end;
 
 procedure TZJJLFrame.lePreTextExit(Sender: TObject);
@@ -102,7 +118,6 @@ begin
   FDataReadOnly := Value;
   actnGenerate.Enabled := not FDataReadOnly;
   lePreText.Enabled := not FDataReadOnly;
-  rgType.Enabled := not FDataReadOnly;
   zaZJJL.Column('Code').ReadOnly := FDataReadOnly;
   zaZJJL.Column('CertificateCode').ReadOnly := FDataReadOnly;
 end;
@@ -134,4 +149,57 @@ begin
   TAction(Sender).Enabled := FZJJLData.cdsZJJLView.RecordCount > 0;
 end;
 
+procedure TZJJLFrame.RefreshTitle;
+var
+  iType: Integer;
+begin
+  iType := TPhaseData(FZJJLData.PhaseData).PhaseProperty.ZJJLType;
+  case iType of
+    0: labTitle.Caption := '中间计量(0号台账)';
+    1: labTitle.Caption := '中间计量(总量控制)';
+  end;
+end;
+
+procedure TZJJLFrame.dxpmAutoGeneratePopup(Sender: TObject);
+begin
+  SetDxBtnAction(actnGenerateFxZJJL, MainForm.dxbtnFxZJJL);
+  SetDxBtnAction(actnGenerateGclZJJL, MainForm.dxbtnGclZJJL);
+end;
+
+procedure TZJJLFrame.actnGenerateFxZJJLExecute(Sender: TObject);
+begin
+  with TPhaseData(FZJJLData.PhaseData).PhaseProperty do
+    ZJJLType := 0;
+  GenerateZJJL;
+end;
+
+procedure TZJJLFrame.GenerateZJJL;
+var
+  iType: Integer;
+begin
+  with TProjectData(TPhaseData(FZJJLData.PhaseData).ProjectData) do
+    ProjProperties.ZJJLPreText := lePreText.Text;
+
+  iType := TPhaseData(FZJJLData.PhaseData).PhaseProperty.ZJJLType;
+  case iType of
+    0: FZJJLData.GenerateAll;
+    1: FZJJLData.GenerateAllByB_Code;
+  end;
+  FZJJLData.AssignedCurData;
+  RefreshTitle;
+end;
+
+procedure TZJJLFrame.actnGenerateGclZJJLExecute(Sender: TObject);
+begin
+  with TPhaseData(FZJJLData.PhaseData).PhaseProperty do
+    ZJJLType := 1;
+  GenerateZJJL;
+end;
+
+procedure TZJJLFrame.actnGenerateUpdate(Sender: TObject);
+begin
+  with TProjectData(TPhaseData(FZJJLData.PhaseData).ProjectData) do
+    TAction(Sender).Enabled := not StageDataReadOnly;
+end;
+
 end.

+ 7 - 7
Units/PhaseProperty.pas

@@ -23,8 +23,8 @@ type
 
     procedure SetFinalAudit(const Value: Boolean);
     procedure SetAuditCount(const Value: Integer);
-    function GetZJJLCount: Integer;
-    procedure SetZJJLCount(const Value: Integer);
+    function GetZJJLType: Integer;
+    procedure SetZJJLType(const Value: Integer);
   public
     constructor Create(AConnection: TADOConnection);
     destructor Destroy; override;
@@ -35,7 +35,7 @@ type
     property AuditCount: Integer read FAuditCount write SetAuditCount;
     property FinalAudit: Boolean read FFinalAudit write SetFinalAudit;
 
-    property ZJJLCount: Integer read GetZJJLCount write SetZJJLCount;
+    property ZJJLType: Integer read GetZJJLType write SetZJJLType;
   end;
 
 implementation
@@ -98,9 +98,9 @@ begin
   Result := VarToStrDef(vProperty, ADef);
 end;
 
-function TPhaseProperties.GetZJJLCount: Integer;
+function TPhaseProperties.GetZJJLType: Integer;
 begin
-  Result := GetIntPropertyDef('ZJJLCount', 0);
+  Result := GetIntPropertyDef('ZJJLType', 0);
 end;
 
 procedure TPhaseProperties.LoadBaseProperties;
@@ -131,9 +131,9 @@ begin
   FPropertyInqurity.Value['FinalAudit'] := FFinalAudit;
 end;
 
-procedure TPhaseProperties.SetZJJLCount(const Value: Integer);
+procedure TPhaseProperties.SetZJJLType(const Value: Integer);
 begin
-  FPropertyInqurity.Value['ZJJLCount'] := Value;
+  FPropertyInqurity.Value['ZJJLType'] := Value;
 end;
 
 end.