Browse Source

添加关注人。

Chenshilong 8 years ago
parent
commit
9b9536e63e

+ 2 - 2
Dprs/CSL/Measure_Cloud.dof

@@ -115,7 +115,7 @@ AutoIncBuild=1
 MajorVer=3
 MinorVer=1
 Release=3
-Build=1121
+Build=1123
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化云版
-FileVersion=3.1.3.1121
+FileVersion=3.1.3.1123
 InternalName=
 LegalCopyright=
 LegalTrademarks=

+ 10 - 1
Dprs/CSL/Measure_Cloud.dpr

@@ -216,7 +216,15 @@ uses
   OtherMeasureFme in '..\..\Frames\OtherMeasureFme.pas' {OtherMeasureFrame: TFrame},
   ProjGatherSelectFme in '..\..\ProjGather\ProjGatherSelectFme.pas' {ProjGatherSelectFrame: TFrame},
   rpgZoneGatherControl in '..\..\Report\ProjGather\Zone\rpgZoneGatherControl.pas',
-  rpgZoneProjGatherSelectFrm in '..\..\Report\ProjGather\Zone\rpgZoneProjGatherSelectFrm.pas' {rpgZoneProjGatherSelectForm};
+  rpgZoneProjGatherSelectFrm in '..\..\Report\ProjGather\Zone\rpgZoneProjGatherSelectFrm.pas' {rpgZoneProjGatherSelectForm},
+  SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
+  LogUtils in '..\..\Units\LogUtils.pas',
+  ReportPdfHelper in '..\..\Units\ReportPdfHelper.pas',
+  SelectOnlineSignPhaseFrm in '..\..\Forms\SelectOnlineSignPhaseFrm.pas' {SelectOnlineSignPhaseForm},
+  SignOnlineReportsFrm in '..\..\Forms\SignOnlineReportsFrm.pas' {SignOnlineReportsForm},
+  SignReports in '..\..\Units\SignReports.pas',
+  TemplateManagerHelper in '..\..\Units\TemplateManagerHelper.pas',
+  RenameSignReportFrm in '..\..\Forms\RenameSignReportFrm.pas' {RenameSignReportForm};
 
 {$R *.res}
 
@@ -313,6 +321,7 @@ begin
     if CheckDogExists then
     begin
       Application.CreateForm(TMainForm, MainForm);
+  Application.CreateForm(TSetGuestForm, SetGuestForm);
   end;
     Application.Run;
   end;

BIN
Dprs/CSL/Measure_Cloud.res


+ 14 - 15
Forms/FindUserFrm.dfm

@@ -1,10 +1,10 @@
 object FindUserForm: TFindUserForm
-  Left = 934
-  Top = 272
+  Left = 515
+  Top = 266
   ActiveControl = edtMail
   BorderStyle = bsDialog
   Caption = #28155#21152#23457#25209#20154
-  ClientHeight = 387
+  ClientHeight = 349
   ClientWidth = 567
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
@@ -14,14 +14,13 @@ object FindUserForm: TFindUserForm
   Font.Style = []
   OldCreateOrder = False
   Position = poScreenCenter
-  OnCreate = FormCreate
   PixelsPerInch = 96
   TextHeight = 17
   object JimPageControl1: TJimPageControl
     Left = 0
     Top = 0
     Width = 567
-    Height = 387
+    Height = 349
     ActivePage = JimPageControl1Page1
     ActivePageIndex = 0
     Align = alClient
@@ -35,15 +34,15 @@ object FindUserForm: TFindUserForm
       Left = 0
       Top = 24
       Width = 567
-      Height = 363
+      Height = 325
       TabName = 'Page1'
-      Caption = #26597#35810#26032#23457#25209#20154
-      object lbl1: TLabel
-        Left = 32
+      Caption = 'sssssssss'
+      object lblHint1: TLabel
+        Left = 37
         Top = 24
-        Width = 508
+        Width = 482
         Height = 19
-        Caption = #36755#20837#23457#25209#20154#30340#36890#34892#24080#21495#27880#20876#37038#31665#65292#26597#35810#24182#30830#35748#29992#25143#21518#65292#28857#20987#8220#20351#29992'Ta'#8221#23436#25104#28155#21152#23457#25209#20154#12290
+        Caption = #36755#20837#23457#25209#20154#30340#36890#34892#24080#21495#27880#20876#37038#31665#65292#26597#35810#24182#30830#35748#21518#65292#28857#20987#8220#20351#29992'Ta'#8221#23436#25104#28155#21152#23457#25209#20154#12290
         Font.Charset = DEFAULT_CHARSET
         Font.Color = clGray
         Font.Height = -13
@@ -51,7 +50,7 @@ object FindUserForm: TFindUserForm
         Font.Style = []
         ParentFont = False
       end
-      object lbl2: TLabel
+      object lblHint2: TLabel
         Left = 69
         Top = 64
         Width = 90
@@ -108,9 +107,9 @@ object FindUserForm: TFindUserForm
       end
       object pnlUser: TPanel
         Left = 0
-        Top = 113
+        Top = 103
         Width = 567
-        Height = 250
+        Height = 222
         Align = alBottom
         BevelOuter = bvNone
         TabOrder = 2
@@ -200,7 +199,7 @@ object FindUserForm: TFindUserForm
       Left = 0
       Top = 24
       Width = 567
-      Height = 363
+      Height = 325
       TabName = 'Page2'
       TabVisible = False
       Caption = #24120#29992#23457#25209#20154

+ 101 - 58
Forms/FindUserFrm.pas

@@ -4,6 +4,8 @@
   单元说明:  查找审核人。
 
   作者时间:  Chenshilong, 2014-07-11
+  
+              2017.06.19 该窗口定制太深,不通用,改成通用查询窗口。
 *******************************************************************************}
 
 unit FindUserFrm;
@@ -20,8 +22,8 @@ type
     JimPageControl1: TJimPageControl;
     JimPageControl1Page1: TJimPage;
     JimPageControl1Page2: TJimPage;
-    lbl1: TLabel;
-    lbl2: TLabel;
+    lblHint1: TLabel;
+    lblHint2: TLabel;
     edtMail: TcxTextEdit;
     btnSearch: TcxButton;
     pnlUser: TPanel;
@@ -35,27 +37,27 @@ type
     btnAdd: TcxButton;
     lblHint: TLabel;
     procedure btnSearchClick(Sender: TObject);
-    procedure FormCreate(Sender: TObject);
     procedure edtMailKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
     procedure btnAddClick(Sender: TObject);
     procedure edtMailClick(Sender: TObject);
   private
-    FProjectData: TObject;
     FOwner: TObject;
-    procedure SetProjectData(const Value: TObject);
-    procedure SetOwner(const Value: TObject);
+    FType: Integer;
+    FWebID: Integer;
+    FPhaseIndex: Integer;
+    FAccount: string;
     { Private declarations }
   public
     { Public declarations }
-     property ProjectData: TObject read FProjectData write SetProjectData;
-     property Owner: TObject read FOwner write SetOwner;
+     // AType调用类型: 0审批人, 1关注人。 AValuesArr:第一个值WebID,第二个值PhaseIndex。
+     constructor Create(AOwner: TObject; AType: Integer; AValuesArr: array of Integer);
   end;
 
 implementation
 
-uses PHPWebDm, ConstUnit, ProjectData, CheckerFme, ProjectFme,
-  OrderCheckerFme;
+uses PHPWebDm, ConstUnit, CheckerFme, ProjectFme,
+  OrderCheckerFme, SetGuestFrm;
 
 {$R *.dfm}
 
@@ -64,12 +66,13 @@ var
   PicPath: string;
 
 procedure TFindUserForm.btnSearchClick(Sender: TObject);
-var bUsed, bSelf, bFull: Boolean;
+var bChecker, bSelf, bFull, bGuest: Boolean;
 begin
   Screen.Cursor := crHourGlass;
   try
+    FAccount := Trim(edtMail.Text);
     UserArr := VarArrayOf(['avatar', 'name', 'jobs', 'company', 'uid']);
-    case PHPWeb.Search(PHPWeb.MeasureURL + 'user/get/search', ['uemail'], [AnsiToUtf8(Trim(edtMail.Text))], UserArr) of
+    case PHPWeb.Search(PHPWeb.MeasureURL + 'user/get/search', ['uemail'], [AnsiToUtf8(FAccount)], UserArr) of
       1:
       begin
         lblHint.Caption := '';
@@ -80,20 +83,41 @@ begin
         if PHPWeb.DownFile(UserArr[0], PicPath) then
           imgUserPic.Picture.LoadFromFile(PicPath);
         pnlUser.Visible := True;
-        bUsed := TCheckerFrame(TOrderCheckerFrame(Owner).Owner).InCheckerList(StrToInt(UserArr[4]));
         bSelf := StrToInt(UserArr[4]) = PHPWeb.UserID;
-        bFull := (TCheckerFrame(TOrderCheckerFrame(Owner).Owner).List.Count >= 15);   // AddFrame包含在List.Count中,等效于原报不在List.Count中
-        btnAdd.Enabled := (not bUsed) and (not bSelf) and (not bFull);
-
-        if bFull then
-          btnAdd.Caption := '限添加14人'
-        else if bSelf then
-          btnAdd.Caption := '不能添加自己'
-        else if bUsed then
-          btnAdd.Caption := '已使用'
-        else
-          btnAdd.Caption := '使用Ta';
 
+        case FType of
+          0:
+          begin
+            bChecker := TCheckerFrame(TOrderCheckerFrame(Owner).Owner).InCheckerList(StrToInt(UserArr[4]));
+            // AddFrame包含在List.Count中,等效于原报不在List.Count中
+            bFull := (TCheckerFrame(TOrderCheckerFrame(Owner).Owner).List.Count >= 15);
+            btnAdd.Enabled := (not bChecker) and (not bSelf) and (not bFull);
+
+            if bFull then
+              btnAdd.Caption := '限添加14人'
+            else if bSelf then
+              btnAdd.Caption := '不能添加自己'
+            else if bChecker then
+              btnAdd.Caption := '已使用'
+            else
+              btnAdd.Caption := '使用Ta';
+          end;
+
+          1:
+          begin
+            bChecker := False;     // AAAAA 判断是否是参与人
+            bGuest := TSetGuestForm(FOwner).HasGuest(StrToInt(UserArr[4])); 
+            btnAdd.Enabled := (not bChecker) and (not bGuest);
+
+            if bChecker then
+              btnAdd.Caption := '已是参与人'
+            else if bGuest then
+              btnAdd.Caption := '已是关注人'
+            else
+              btnAdd.Caption := '使用Ta';
+          end;
+        else ;
+        end;
       end;
       -1:
       begin
@@ -119,15 +143,6 @@ begin
   end;
 end;
 
-procedure TFindUserForm.FormCreate(Sender: TObject);
-begin
-  lblHint.Caption := '';
-  pnlUser.Visible := False;
-
-  if G_IsTest then
-    edtMail.Text := 'sp1@qq.com';
-end;
-
 procedure TFindUserForm.edtMailKeyDown(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 begin
@@ -138,37 +153,41 @@ end;
 procedure TFindUserForm.btnAddClick(Sender: TObject);
 var sURL: string;
   vArr: array of string;
-  vProj: TProjectData;
   vOwner: TCheckerFrame;
 begin
-  sURL := PHPWeb.MeasureURL + 'user/add/audit/measure';
   vArr := VarArrayOf(['msg']);
-  vProj := TProjectData(ProjectData);
-  // 标段ID(网络)、谁添加的、添加的谁、期号
-  if PHPWeb.Search(sURL, ['pmid', 'creatoruid', 'auditoruid', 'numpname'],
-    [IntToStr(vProj.WebID), IntToStr(PHPWeb.UserID), UserArr[4],
-    IntToStr(vProj.PhaseIndex)], vArr) = 1 then
-  begin
-    btnAdd.Enabled := False;
-    btnAdd.Caption := '添加成功';
-    vOwner := TCheckerFrame(TOrderCheckerFrame(Owner).Owner);
-    vOwner.AddNewChecker(cftChecker, StrToInt(UserArr[4]), UserArr[1], UserArr[2], UserArr[3], PicPath, '', csNotBegin, '', -1);
-    vOwner.RepairOrder;
-    vOwner.RepairDelete(True);
-  end;
-end;
 
-procedure TFindUserForm.SetProjectData(const Value: TObject);
-begin
-  FProjectData := Value;
-end;
-
-procedure TFindUserForm.SetOwner(const Value: TObject);
-begin
-  FOwner := Value;
+  case FType of
+    0:
+    begin
+      sURL := PHPWeb.MeasureURL + 'user/add/audit/measure';
+      // 标段ID(网络)、谁添加的、添加的谁、期号
+      if PHPWeb.Search(sURL, ['pmid', 'creatoruid', 'auditoruid', 'numpname'],
+        [IntToStr(FWebID), IntToStr(PHPWeb.UserID), UserArr[4], IntToStr(FPhaseIndex)], vArr) = 1 then
+      begin
+        btnAdd.Enabled := False;
+        btnAdd.Caption := '添加成功';
+        vOwner := TCheckerFrame(TOrderCheckerFrame(FOwner).Owner);
+        vOwner.AddNewChecker(cftChecker, StrToInt(UserArr[4]), UserArr[1], UserArr[2], UserArr[3], PicPath, '', csNotBegin, '', -1);
+        vOwner.RepairOrder;
+        vOwner.RepairDelete(True);
+      end;
+    end;
+    1:
+    begin
+      sURL := '';    // AAAAA  添加关注人
+      // 标段ID(网络)、谁添加的、添加的谁
+      if PHPWeb.Search(sURL, ['pmid', 'creatoruid', 'auditoruid'],
+        [IntToStr(FWebID), IntToStr(PHPWeb.UserID), UserArr[4]], vArr) = 1 then
+      begin
+        btnAdd.Enabled := False;
+        btnAdd.Caption := '添加成功';
+        TSetGuestForm(FOwner).AddGuest(StrToInt(UserArr[4]), UserArr[1], FAccount);
+      end;
+    end;
+  end;  
 end;
 
-
 procedure TFindUserForm.edtMailClick(Sender: TObject);
 begin
   if G_IsTest then
@@ -216,4 +235,28 @@ begin
   end;
 end;
 
+constructor TFindUserForm.Create(AOwner: TObject; AType: Integer; AValuesArr: array of Integer);
+var sName: string;
+begin
+  inherited Create(nil);
+  FOwner := AOwner;
+  FType := AType;
+  FWebID := AValuesArr[0];
+  FPhaseIndex := AValuesArr[1];
+
+  lblHint.Caption := '';
+  pnlUser.Visible := False;
+
+  case AType of
+    0: sName := '审批人';
+    1: sName := '关注人';
+  else sName := '用户';
+  end;
+
+  self.Caption := '添加' + sName;
+  JimPageControl1Page1.Caption := Format('查询新%s', [sName]);
+  lblHint1.Caption := Format('输入%s的通行帐号注册邮箱,查询并确认后,点击“使用Ta”完成添加%s。', [sName, sName]);
+  lblHint2.Caption := Format('添加新%s', [sName]);
+end;
+
 end.

+ 18 - 12
Forms/MainFrm.dfm

@@ -21,7 +21,7 @@ object MainForm: TMainForm
   object jtsProjects: TJimTabSet
     Left = 0
     Top = 49
-    Width = 742
+    Width = 734
     Height = 21
     Align = alTop
     BackgroundColor = clGradientInactiveCaption
@@ -45,8 +45,8 @@ object MainForm: TMainForm
   end
   object dxStatusBar: TdxStatusBar
     Left = 0
-    Top = 487
-    Width = 742
+    Top = 480
+    Width = 734
     Height = 20
     Panels = <
       item
@@ -78,12 +78,12 @@ object MainForm: TMainForm
     object dxStatusBarContainer2: TdxStatusBarContainerControl
       Left = 604
       Top = 2
-      Width = 136
+      Width = 128
       Height = 16
       object ProgressBar: TProgressBar
         Left = 0
         Top = 0
-        Width = 136
+        Width = 128
         Height = 16
         Align = alClient
         Max = 200
@@ -94,8 +94,8 @@ object MainForm: TMainForm
   object jpsMain: TJimPages
     Left = 0
     Top = 70
-    Width = 742
-    Height = 417
+    Width = 734
+    Height = 410
     ActivePage = jpsMainProjectsManager
     ActivePageIndex = 0
     Align = alClient
@@ -103,8 +103,8 @@ object MainForm: TMainForm
     object jpsMainProjectsManager: TJimPage
       Left = 0
       Top = 0
-      Width = 742
-      Height = 417
+      Width = 734
+      Height = 410
       TabName = 'ProjectsManager'
       Caption = 'ProjsMgr'
       object pnlUser: TPanel
@@ -201,8 +201,8 @@ object MainForm: TMainForm
     object jpsMainProjects: TJimPage
       Left = 0
       Top = 0
-      Width = 742
-      Height = 417
+      Width = 734
+      Height = 410
       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 = 'Microsoft YaHei UI'
+    Font.Name = #24494#36719#38597#40657
     Font.Style = []
     Bars = <
       item
@@ -1083,6 +1083,12 @@ object MainForm: TMainForm
       Hint = 'New Item'
       Visible = ivAlways
     end
+    object dxbtnGuest: TdxBarButton
+      Caption = #26631#27573#20851#27880#20154
+      Category = 0
+      Hint = #26631#27573#20851#27880#20154
+      Visible = ivAlways
+    end
   end
   object Images: TImageList
     DrawingStyle = dsTransparent

+ 1 - 0
Forms/MainFrm.pas

@@ -162,6 +162,7 @@ type
     dxbtnWithoutCalcCurPay: TdxBarButton;
     dxbtnSignOnline: TdxBarButton;
     dxbtnExportTpExcel: TdxBarButton;
+    dxbtnGuest: TdxBarButton;
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure jtsProjectsChange(Sender: TObject; NewTab: Integer;

+ 141 - 0
Forms/SetGuestFrm.dfm

@@ -0,0 +1,141 @@
+object SetGuestForm: TSetGuestForm
+  Left = 365
+  Top = 307
+  BorderStyle = bsDialog
+  Caption = #35774#32622#26631#27573#20851#27880#20154
+  ClientHeight = 338
+  ClientWidth = 504
+  Color = clBtnFace
+  Font.Charset = ANSI_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -15
+  Font.Name = #24494#36719#38597#40657
+  Font.Style = []
+  OldCreateOrder = False
+  Position = poMainFormCenter
+  PixelsPerInch = 96
+  TextHeight = 20
+  object btnAdd: TButton
+    Left = 8
+    Top = 5
+    Width = 97
+    Height = 29
+    Caption = #28155#21152#20851#27880#20154
+    TabOrder = 0
+    OnClick = btnAddClick
+  end
+  object zgGuest: TZJGrid
+    Left = 8
+    Top = 39
+    Width = 489
+    Height = 265
+    Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
+    OptionsEx = []
+    ColCount = 4
+    RowCount = 4
+    ShowGridLine = False
+    DefaultColWidth = 73
+    DefaultFixedRowHeight = 25
+    DefaultRowHeight = 23
+    Selection.AlphaBlend = False
+    Selection.TransparentColor = False
+    FrozenCol = 0
+    FrozenRow = 0
+    OnCellGetFont = zgGuestCellGetFont
+    OnMouseDown = zgGuestMouseDown
+  end
+  object btnOK: TButton
+    Left = 418
+    Top = 308
+    Width = 75
+    Height = 25
+    Caption = #30830#23450
+    ModalResult = 1
+    TabOrder = 2
+  end
+  object zaGuest: TZjGridDBA
+    Columns = <
+      item
+        Title.Caption = #22995#21517
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -15
+        Title.Font.Name = #24494#36719#38597#40657
+        Title.Font.Style = []
+        Alignment = taCenter
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -13
+        Font.Name = #24494#36719#38597#40657
+        Font.Style = []
+        FieldName = 'Name'
+        ReadOnly = True
+      end
+      item
+        Title.Caption = #36134#21495
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -15
+        Title.Font.Name = #24494#36719#38597#40657
+        Title.Font.Style = []
+        Alignment = taLeftJustify
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -13
+        Font.Name = #24494#36719#38597#40657
+        Font.Style = []
+        FieldName = 'Account'
+        Width = 200
+        ReadOnly = True
+      end
+      item
+        Title.Caption = #25805#20316
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -15
+        Title.Font.Name = #24494#36719#38597#40657
+        Title.Font.Style = []
+        Alignment = taCenter
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -13
+        Font.Name = #24494#36719#38597#40657
+        Font.Style = []
+        FieldName = 'Operate'
+        ReadOnly = True
+      end>
+    DataSet = cdsGuest
+    Grid = zgGuest
+    ExtendRowCount = 3
+    Left = 352
+    Top = 104
+  end
+  object cdsGuest: TClientDataSet
+    Active = True
+    Aggregates = <>
+    Params = <>
+    Left = 384
+    Top = 104
+    Data = {
+      760000009619E0BD010000001800000004000000000003000000760002494404
+      00010000000000044E616D6501004A0000000100055749445448020002002800
+      074163636F756E7401004A000000010005574944544802000200C800074F7065
+      7261746501004A00000001000557494454480200020028000000}
+    object cdsGuestID: TIntegerField
+      FieldName = 'ID'
+    end
+    object cdsGuestName: TWideStringField
+      FieldName = 'Name'
+    end
+    object cdsGuestAccount: TWideStringField
+      FieldName = 'Account'
+      Size = 100
+    end
+    object cdsGuestOperate: TWideStringField
+      FieldName = 'Operate'
+    end
+  end
+end

+ 184 - 0
Forms/SetGuestFrm.pas

@@ -0,0 +1,184 @@
+{*******************************************************************************
+  单元名称:  FindUserFrm.pas
+
+  单元说明:  设置游客帐号,标段关注人。
+
+  作者时间:  Chenshilong, 2017-06-19
+*******************************************************************************}
+
+unit SetGuestFrm;
+
+interface
+
+uses
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ZJGrid, ZjGridDBA, DB, DBClient, sdDB;
+
+type
+  TSetGuestForm = class(TForm)
+    btnAdd: TButton;
+    zgGuest: TZJGrid;
+    btnOK: TButton;
+    zaGuest: TZjGridDBA;
+    cdsGuest: TClientDataSet;
+    cdsGuestID: TIntegerField;
+    cdsGuestName: TWideStringField;
+    cdsGuestAccount: TWideStringField;
+    cdsGuestOperate: TWideStringField;
+    procedure btnAddClick(Sender: TObject);
+    procedure zgGuestCellGetFont(Sender: TObject; ACoord: TPoint;
+      AFont: TFont);
+    procedure zgGuestMouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+  private
+    { Private declarations }
+    FWebID: Integer;
+
+    procedure GetGuests;
+    function Col(AGridDBA: TZjGridDBA; FieldName: string): Integer;
+
+  public
+    { Public declarations }
+    constructor Create(AWebID: Integer);
+    procedure AddGuest(AID: Integer; AName, AEmail: string);
+    function HasGuest(AID: Integer): Boolean;
+  end;
+
+var
+  SetGuestForm: TSetGuestForm;
+
+implementation
+
+uses FindUserFrm, PHPWebDm, CSLJson;
+
+{$R *.dfm}
+
+procedure TSetGuestForm.AddGuest(AID: Integer; AName, AEmail: string);
+begin
+  cdsGuest.Append;
+  cdsGuestID.AsInteger := AID;
+  cdsGuestName.AsString := AName;
+  cdsGuestAccount.AsString := AEmail;
+  cdsGuestOperate.AsString := '取消关注';
+  cdsGuest.Post;
+end;
+
+procedure TSetGuestForm.btnAddClick(Sender: TObject);
+var
+  FindUserForm: TFindUserForm;
+begin
+  FindUserForm := TFindUserForm.Create(self, 1, []);
+  try
+    FindUserForm.ShowModal;
+  finally
+    FindUserForm.Free;
+  end;
+end;
+
+function TSetGuestForm.Col(AGridDBA: TZjGridDBA;
+  FieldName: string): Integer;
+begin
+  Result := AGridDBA.ColumnIndex(FieldName) + 1;
+end;
+
+constructor TSetGuestForm.Create(AWebID: Integer);
+var i: Integer;
+begin
+  inherited Create(nil);
+  FWebID := AWebID;
+//  GetGuests;
+
+// for test
+  for i := 1 to 5 do
+  begin
+    cdsGuest.Append;
+    cdsGuestID.AsString := IntToStr(i);
+    cdsGuestName.AsString := 'aaa' + IntToStr(i);
+    cdsGuestAccount.AsString := 'aaaa@qq.com';
+    cdsGuestOperate.AsString := '取消关注';
+    cdsGuest.Post;
+  end;
+end;
+
+procedure TSetGuestForm.GetGuests;
+var sURL: string;
+  UserArr: TOVArr;
+  i: Integer;
+begin
+  Screen.Cursor := crHourGlass;
+  try
+    sURL := 'xxxxxx';   // AAAAAA 查询标段的关注人
+    case PHPWeb.Search(PHPWeb.MeasureURL + sURL, ['WebID'], [InttoStr(FwebID)], UserArr) of
+      1:
+      begin
+        if cdsGuest.RecordCount > 0 then
+          cdsGuest.EmptyDataSet;
+
+        for i := Low(UserArr) to High(UserArr) do
+        begin
+          cdsGuest.Append;
+          cdsGuestID.AsString := UserArr[i, 0];
+          cdsGuestName.AsString := UserArr[i, 1];
+          cdsGuestAccount.AsString := UserArr[i, 2];
+          cdsGuestOperate.AsString := '取消关注';
+          cdsGuest.Post;
+        end;
+
+        cdsGuest.First;
+      end;
+      -1:
+      begin
+        Application.MessageBox(PChar(PHPWeb.NetError('无法查询到关注人')),
+            '警告', MB_OK + MB_ICONWARNING);
+        Exit;
+      end;
+      0:
+      begin
+        Application.MessageBox(PChar(PHPWeb.PageError('无法查询到关注人')),
+            '警告', MB_OK + MB_ICONWARNING);
+        Exit;
+      end;
+    end;
+  finally
+    Screen.Cursor := crDefault;
+  end;
+end;
+
+function TSetGuestForm.HasGuest(AID: Integer): Boolean;
+begin
+  Result := False;
+  cdsGuest.First;
+  while not cdsGuest.Eof do
+  begin
+    if cdsGuestID.AsInteger = AID then
+    begin
+      Result := True;
+      Break;
+    end;
+
+    cdsGuest.Next;
+  end;
+end;
+
+procedure TSetGuestForm.zgGuestCellGetFont(Sender: TObject; ACoord: TPoint;
+  AFont: TFont);
+begin
+  if ACoord.X = Col(zaGuest, 'Operate') then
+    AFont.Color := clBlue;
+end;
+
+procedure TSetGuestForm.zgGuestMouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+  var s: string;
+begin
+  if zgGuest.CurCol = Col(zaGuest, 'Operate') then
+  begin
+    s := Format('确定要取消用户“%s”对该标段的关注吗?', [cdsGuestName.AsString]);
+    if Application.MessageBox(PChar(s), '询问', MB_YESNO + MB_ICONQUESTION) = ID_No then
+       Exit;
+
+    // do   
+  end;
+end;
+
+end.

+ 3 - 3
Frames/OrderCheckerFme.pas

@@ -229,12 +229,12 @@ procedure TOrderCheckerFrame.shpAddMouseDown(Sender: TObject;
   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
 var
   FindUserForm: TFindUserForm;
+  vPD: TProjectData;
 begin
   if Button = mbLeft then
   begin
-    FindUserForm := TFindUserForm.Create(nil);
-    FindUserForm.ProjectData := TCheckerFrame(Owner).ProjectData;
-    FindUserForm.Owner := Self;
+    vPD := TProjectData(TCheckerFrame(Owner).ProjectData);
+    FindUserForm := TFindUserForm.Create(Self, 0, [vPD.WebID, vPD.PhaseIndex]);
     try
       FindUserForm.ShowModal;
     finally

+ 9 - 0
Frames/ProjectManagerFme.dfm

@@ -490,6 +490,11 @@ object ProjectManagerFrame: TProjectManagerFrame
       OnExecute = actnSignOnlineExecute
       OnUpdate = actnSignOnlineUpdate
     end
+    object actnGuest: TAction
+      Caption = #26631#27573#20851#27880#20154
+      OnExecute = actnGuestExecute
+      OnUpdate = actnGuestUpdate
+    end
   end
   object dxpmProjectManager: TdxBarPopupMenu
     BarManager = MainForm.dxBarManager
@@ -528,6 +533,10 @@ object ProjectManagerFrame: TProjectManagerFrame
         Visible = True
       end
       item
+        Item = MainForm.dxbtnGuest
+        Visible = True
+      end
+      item
         BeginGroup = True
         Item = MainForm.dxbtnOpenBackupFolder
         Visible = True

+ 29 - 4
Frames/ProjectManagerFme.pas

@@ -64,6 +64,7 @@ type
     actnOpenBackupFolder: TAction;
     sbChecker: TScrollBox;
     actnSignOnline: TAction;
+    actnGuest: TAction;
     procedure actnOpenExecute(Sender: TObject);
     procedure actnDeleteExecute(Sender: TObject);
     procedure zgProjectsMouseDown(Sender: TObject; Button: TMouseButton;
@@ -94,6 +95,8 @@ type
     procedure pnlProgressClick(Sender: TObject);
     procedure actnSignOnlineExecute(Sender: TObject);
     procedure actnSignOnlineUpdate(Sender: TObject);
+    procedure actnGuestExecute(Sender: TObject);
+    procedure actnGuestUpdate(Sender: TObject);
   private
     FProjectManagerData: TProjectManagerData;
 
@@ -176,7 +179,8 @@ implementation
 uses
   MainFrm, UtilMethods, ProjectCommands, Globals, ConfigDoc, ConstUnit,
   WebNewTenderFrm, PHPWebDm, Math, mProgressFrm, ProgressHintFrm,
-  ShellAPI, ProjectFme, SelectOnlineSignPhaseFrm, SignOnlineReportsFrm;
+  ShellAPI, ProjectFme, SelectOnlineSignPhaseFrm, SignOnlineReportsFrm,
+  SetGuestFrm;
 
 {$R *.dfm}
 
@@ -191,6 +195,7 @@ begin
   SetDxBtnAction(actnOpenBackupFolder, MainForm.dxbtnOpenBackupFolder);
   SetDxBtnAction(actnRename, MainForm.dxbtnRename);
   SetDxBtnAction(actnSignOnline, MainForm.dxbtnSignOnline);
+  SetDxBtnAction(actnGuest, MainForm.dxbtnGuest);
 end;
 
 constructor TProjectManagerFrame.Create(AOwner: TComponent);
@@ -387,9 +392,10 @@ begin
 
       if not MainForm.CurProjectFrame.CheckFileAndCloudChekerList then
       begin
-        sHint := '项目校验:“' + FWebBidName_OnLine + '”文件中的审批人和云端的审批人不一致,' +
-          '禁止继续操作,项目即将关闭!请删除本地项目重新从云端获取,' +
-          '重新获取后如果仍然存在同样的问题,请联系纵横服务人员以寻求帮助。';
+        sHint := '“'+ FWebBidName_OnLine +'”无法打开,本地与云端审批人不一致。“' + #10#13 +
+          '1、如当前项目审批不通过并已重新开始计量:请回到原电脑操作。' + #10#13 +
+          '2、审批中/审批完成项目:请删除本地项目重新从云端获取;' + #10#13 +
+          '如仍然存在同样问题,请联系纵横服务人员。';
         Application.MessageBox(PChar(sHint), '文件错误', MB_OK +MB_ICONWARNING);
         MainForm.actnCloseProject.Execute;
         Exit;
@@ -1889,4 +1895,23 @@ begin
       HasCompletePhase(stdProjects.IDTree.Selected.Rec);
 end;
 
+procedure TProjectManagerFrame.actnGuestExecute(Sender: TObject);
+var
+  SetGuestForm: TSetGuestForm;
+begin
+  SetGuestForm := TSetGuestForm.Create(CurRec.ValueByName('WebID').AsInteger);
+  try
+    SetGuestForm.ShowModal;
+  finally
+    SetGuestForm.Free;
+  end;
+end;
+
+procedure TProjectManagerFrame.actnGuestUpdate(Sender: TObject);
+begin
+  TAction(Sender).Visible := G_IsCloud;
+  TAction(Sender).Enabled := Assigned(stdProjects.IDTree.Selected) and
+    (stdProjects.IDTree.Selected.Rec.ValueByName('Type').AsInteger = 1);
+end;
+
 end.