浏览代码

Task #1397 新增“报表显示审批状态”功能,去掉“报表底纹”功能

MaiXinRong 8 年之前
父节点
当前提交
35411380b7
共有 5 个文件被更改,包括 128 次插入7 次删除
  1. 57 4
      Forms/ProjectPropertiesFrm.dfm
  2. 25 0
      Forms/ProjectPropertiesFrm.pas
  3. 1 1
      Forms/ReportsFrm.dfm
  4. 12 2
      Forms/ReportsFrm.pas
  5. 33 0
      Units/ProjectProperty.pas

+ 57 - 4
Forms/ProjectPropertiesFrm.dfm

@@ -1,7 +1,7 @@
 object ProjectPropertiesForm: TProjectPropertiesForm
   Left = 663
   Top = 261
-  ActiveControl = leProjectName
+  ActiveControl = cbShowAlias
   BorderIcons = [biSystemMenu]
   BorderStyle = bsSingle
   Caption = #39033#30446#23646#24615
@@ -120,8 +120,8 @@ object ProjectPropertiesForm: TProjectPropertiesForm
     Top = 63
     Width = 530
     Height = 255
-    ActivePage = jpsPropertiesBase
-    ActivePageIndex = 0
+    ActivePage = jpsPropertiesView
+    ActivePageIndex = 2
     Align = alTop
     Caption = 'jpsProperties'
     object jpsPropertiesBase: TJimPage
@@ -1292,6 +1292,59 @@ object ProjectPropertiesForm: TProjectPropertiesForm
         ParentCtl3D = False
         TabOrder = 4
       end
+      object pnlReportView: TPanel
+        Left = 0
+        Top = 128
+        Width = 529
+        Height = 89
+        BevelOuter = bvNone
+        TabOrder = 5
+        object lblReportShowStateTitle: TLabel
+          Left = 7
+          Top = 5
+          Width = 96
+          Height = 12
+          Caption = #25253#34920#26174#31034#23457#25209#29366#24577
+          Font.Charset = ANSI_CHARSET
+          Font.Color = clBlue
+          Font.Height = -12
+          Font.Name = #23435#20307
+          Font.Style = []
+          ParentFont = False
+        end
+        object pnlReportViewBar: TPanel
+          Left = 110
+          Top = 11
+          Width = 410
+          Height = 2
+          BevelOuter = bvLowered
+          TabOrder = 0
+        end
+        object cbReportShowState: TCheckBox
+          Left = 41
+          Top = 24
+          Width = 16
+          Height = 17
+          TabOrder = 1
+          OnClick = cbReportShowStateClick
+        end
+        object edtReportShowStateText: TEdit
+          Left = 65
+          Top = 22
+          Width = 121
+          Height = 20
+          TabOrder = 2
+          Text = #25253#34920#26410#23457#26680
+        end
+        object cbReportShowStageWithoutReply: TCheckBox
+          Left = 64
+          Top = 48
+          Width = 121
+          Height = 17
+          Caption = #25209#22797#29366#24577#19981#26174#31034
+          TabOrder = 3
+        end
+      end
     end
   end
   object xpm: TXPMenu
@@ -1334,7 +1387,7 @@ object ProjectPropertiesForm: TProjectPropertiesForm
     ComboboxSurfaceMoveColor = 16771030
     ControlDisabledBorderColor = 11913158
     Left = 7
-    Top = 260
+    Top = 324
   end
   object Images: TImageList
     DrawingStyle = dsTransparent

+ 25 - 0
Forms/ProjectPropertiesFrm.pas

@@ -117,6 +117,12 @@ type
     cbDealPayAloneDigiy: TCheckBox;
     leDealPayTotalPriceDigit: TLabeledEdit;
     udDealPayTotalPriceDigit: TUpDown;
+    pnlReportView: TPanel;
+    lblReportShowStateTitle: TLabel;
+    pnlReportViewBar: TPanel;
+    cbReportShowState: TCheckBox;
+    edtReportShowStateText: TEdit;
+    cbReportShowStageWithoutReply: TCheckBox;
     procedure btnOkClick(Sender: TObject);
     procedure leContractPriceClick(Sender: TObject);
     procedure msbBaseMouseWheel(Sender: TObject; Shift: TShiftState;
@@ -142,6 +148,7 @@ type
     procedure cbShowReportShadingClick(Sender: TObject);
     procedure dtpBaselineChange(Sender: TObject);
     procedure cbDealPayAloneDigiyClick(Sender: TObject);
+    procedure cbReportShowStateClick(Sender: TObject);
   private
     FProjectData: TProjectData;
     FStaffData: TStaffData;
@@ -238,6 +245,12 @@ begin
   cbShowReportShading.Checked := FProjProperties.ShowReportShading;
   edtReportShading.Enabled := cbShowReportShading.Checked;
   edtReportShading.Text := FProjProperties.ReportShading;
+
+  cbReportShowState.Checked := FProjProperties.ReportShowState;
+  edtReportShowStateText.Text := FProjProperties.ReportShowStateText;
+  edtReportShowStateText.Enabled := cbReportShowState.Checked;
+  cbReportShowStageWithoutReply.Checked := FProjProperties.ReportShowStateWithoutReply;
+  cbReportShowStageWithoutReply.Enabled := cbReportShowState.Checked;
 end;
 
 procedure TProjectPropertiesForm.btnOkClick(Sender: TObject);
@@ -611,6 +624,10 @@ begin
   FProjProperties.ShowReportShading := cbShowReportShading.Checked;
   FProjProperties.ReportShading := edtReportShading.Text;
 
+  FProjProperties.ReportShowState := cbReportShowState.Checked;
+  FProjProperties.ReportShowStateText := edtReportShowStateText.Text;
+  FProjProperties.ReportShowStateWithoutReply := cbReportShowStageWithoutReply.Checked;
+
   FProjProperties.ShowPriceChange := cbShowPriceChange.Checked;
   FProjProperties.ShowBGLCode := cbShowBGLCode.Checked;
   FProjProperties.ShowDesignQuantity := cbShowDesignQuantity.Checked;
@@ -663,4 +680,12 @@ begin
   udDealPayTotalPriceDigit.Enabled := (FProjProperties.PhaseCount = 0) and cbDealPayAloneDigiy.Checked;
 end;
 
+procedure TProjectPropertiesForm.cbReportShowStateClick(Sender: TObject);
+begin
+  cbReportShowStageWithoutReply.Enabled := cbReportShowState.Checked;
+  if cbReportShowState.Checked then
+    cbReportShowStageWithoutReply.Checked := True;
+  edtReportShowStateText.Enabled := cbReportShowState.Checked;
+end;
+
 end.

+ 1 - 1
Forms/ReportsFrm.dfm

@@ -216,7 +216,7 @@ object ReportsForm: TReportsForm
     Font.Charset = DEFAULT_CHARSET
     Font.Color = clWindowText
     Font.Height = -12
-    Font.Name = #24494#36719#38597#40657
+    Font.Name = 'Microsoft YaHei UI'
     Font.Style = []
     Bars = <
       item

+ 12 - 2
Forms/ReportsFrm.pas

@@ -773,8 +773,18 @@ begin
   InitPageSettings(APrintCom);
   InitPaperSettings(ATemplate, APrintCom);
 
-  APrintCom.ShowBackgroundMark := FProjectData.ProjProperties.ShowReportShading;
-  APrintCom.BackgroundMarkStr := FProjectData.ProjProperties.ReportShading;
+  {APrintCom.ShowBackgroundMark := FProjectData.ProjProperties.ShowReportShading;
+  APrintCom.BackgroundMarkStr := FProjectData.ProjProperties.ReportShading;}
+  if FProjectData.ProjProperties.ReportShowState then
+  begin
+    if FProjectData.ProjProperties.ReportShowStateWithoutReply and (FProjectData.ProjProperties.AuditStatus = -1) then
+      APrintCom.ShowBackgroundMark := False
+    else
+      APrintCom.ShowBackgroundMark := True;
+  end
+  else
+    APrintCom.ShowBackgroundMark := False;
+  APrintCom.BackgroundMarkStr := FProjectData.ProjProperties.ReportShowStateText;
 end;
 
 procedure TReportsForm.InitPageSettings(APrintCom: TPrintComXML);

+ 33 - 0
Units/ProjectProperty.pas

@@ -80,6 +80,9 @@ type
     FBaseline: string;
     FDeadline: string;
     FDealPayAloneDigit: Boolean;
+    FReportShowState: Boolean;
+    FReportShowStateWithoutReply: Boolean;
+    FReportShowStateText: string;
 
     function GetBoolPropertyDef(const AName: string; ADef: Boolean): Boolean;
     function GetIntPropertyDef(const AName: string; ADef: Integer): Integer;
@@ -126,6 +129,9 @@ type
     procedure SetBaseline(const Value: string);
     procedure SetDeadline(const Value: string);
     procedure SetDealPayAloneDigit(const Value: Boolean);
+    procedure SetReportShowState(const Value: Boolean);
+    procedure SetReportShowStateText(const Value: string);
+    procedure SetReportShowStateWithoutReply(const Value: Boolean);
   public
     constructor Create(AProjectData: TObject);
     destructor Destroy; override;
@@ -232,6 +238,10 @@ type
 
     property ShowReportShading: Boolean read FShowReportShading write SetShowReportShading;
     property ReportShading: string read FReportShading write SetReportShading;
+
+    property ReportShowState: Boolean read FReportShowState write SetReportShowState;
+    property ReportShowStateText: string read FReportShowStateText write SetReportShowStateText;
+    property ReportShowStateWithoutReply: Boolean read FReportShowStateWithoutReply write SetReportShowStateWithoutReply;
   end;
 
 implementation
@@ -510,6 +520,10 @@ begin
 
   FShowReportShading := GetBoolPropertyDef('ShowReportShading', False);
   FReportShading := GetStrPropertyDef('ReportShading', '');
+
+  FReportShowState := GetBoolPropertyDef('ReportShowState', True);
+  FReportShowStateText := GetStrPropertyDef('ReportShowStateText', '±ê¶ÎδÅú¸´');
+  FReportShowStateWithoutReply := GetBoolPropertyDef('ReportShowStateWithoutReply', True);
 end;
 
 procedure TProjProperties.Open(AConnection: TADOConnection);
@@ -668,6 +682,25 @@ begin
   FPropertyInqurity.Value['ReportShading'] := Value;
 end;
 
+procedure TProjProperties.SetReportShowState(const Value: Boolean);
+begin
+  FReportShowState := Value;
+  FPropertyInqurity.Value['ReportShowState'] := Value;
+end;
+
+procedure TProjProperties.SetReportShowStateText(const Value: string);
+begin
+  FReportShowStateText := Value;                      
+  FPropertyInqurity.Value['ReportShowStateText'] := Value;
+end;
+
+procedure TProjProperties.SetReportShowStateWithoutReply(
+  const Value: Boolean);
+begin
+  FReportShowStateWithoutReply := Value;
+  FPropertyInqurity.Value['ReportShowStateWithoutReply'] := Value;
+end;
+
 procedure TProjProperties.SetShowAlias(const Value: Boolean);
 begin
   FShowAlias := Value;