浏览代码

关注人。

Chenshilong 8 年之前
父节点
当前提交
0f96e58b8a
共有 6 个文件被更改,包括 51 次插入36 次删除
  1. 1 1
      DataModules/PHPWebDm.pas
  2. 9 8
      Forms/FindUserFrm.dfm
  3. 11 5
      Forms/FindUserFrm.pas
  4. 7 7
      Forms/SetGuestFrm.dfm
  5. 17 14
      Forms/SetGuestFrm.pas
  6. 6 1
      Frames/ProjectFme.pas

+ 1 - 1
DataModules/PHPWebDm.pas

@@ -450,7 +450,7 @@ begin
   vStream := TMemoryStream.Create;
   vIdHTTP := TIdHTTP.Create(nil);
   try
-    while (not bOK) and (iFlag < 3) do   // ³¢ÊÔ3´Î
+    while (not bOK) and (iFlag < 2) do   // ³¢ÊÔ2´Î
       SafeDownFile(ASourceURL, ALocalFile);
 
     Result := bOK;

+ 9 - 8
Forms/FindUserFrm.dfm

@@ -1,10 +1,10 @@
 object FindUserForm: TFindUserForm
-  Left = 515
-  Top = 266
+  Left = 244
+  Top = 376
   ActiveControl = edtMail
   BorderStyle = bsDialog
   Caption = #28155#21152#23457#25209#20154
-  ClientHeight = 349
+  ClientHeight = 327
   ClientWidth = 567
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
@@ -14,13 +14,14 @@ object FindUserForm: TFindUserForm
   Font.Style = []
   OldCreateOrder = False
   Position = poScreenCenter
+  OnActivate = FormActivate
   PixelsPerInch = 96
   TextHeight = 17
   object JimPageControl1: TJimPageControl
     Left = 0
     Top = 0
     Width = 567
-    Height = 349
+    Height = 327
     ActivePage = JimPageControl1Page1
     ActivePageIndex = 0
     Align = alClient
@@ -34,7 +35,7 @@ object FindUserForm: TFindUserForm
       Left = 0
       Top = 24
       Width = 567
-      Height = 325
+      Height = 303
       TabName = 'Page1'
       Caption = 'sssssssss'
       object lblHint1: TLabel
@@ -107,9 +108,9 @@ object FindUserForm: TFindUserForm
       end
       object pnlUser: TPanel
         Left = 0
-        Top = 103
+        Top = 120
         Width = 567
-        Height = 222
+        Height = 183
         Align = alBottom
         BevelOuter = bvNone
         TabOrder = 2
@@ -199,7 +200,7 @@ object FindUserForm: TFindUserForm
       Left = 0
       Top = 24
       Width = 567
-      Height = 325
+      Height = 303
       TabName = 'Page2'
       TabVisible = False
       Caption = #24120#29992#23457#25209#20154

+ 11 - 5
Forms/FindUserFrm.pas

@@ -41,6 +41,7 @@ type
       Shift: TShiftState);
     procedure btnAddClick(Sender: TObject);
     procedure edtMailClick(Sender: TObject);
+    procedure FormActivate(Sender: TObject);
   private
     FOwner: TObject;
     FType: Integer;
@@ -121,8 +122,8 @@ begin
       end;
       -1:
       begin
-        Application.MessageBox(PChar(PHPWeb.NetError('无法查询用户')),
-            '警告', MB_OK + MB_ICONWARNING);
+//        Application.MessageBox(PChar(PHPWeb.NetError('无法查询用户')),
+//            '警告', MB_OK + MB_ICONWARNING);
         lblHint.Caption := '没有找到该用户的相关信息!';
         pnlUser.Visible := False;
         btnAdd.Enabled := False;
@@ -130,8 +131,8 @@ begin
       end;
       0:
       begin
-        Application.MessageBox(PChar(PHPWeb.PageError('无法查询用户' + '[' + edtMail.Text + ']')),
-            '警告', MB_OK + MB_ICONWARNING);
+//        Application.MessageBox(PChar(PHPWeb.PageError('无法查询用户' + '[' + edtMail.Text + ']')),
+//            '警告', MB_OK + MB_ICONWARNING);
         lblHint.Caption := '没有找到该用户的相关信息!';
         pnlUser.Visible := False;
         btnAdd.Enabled := False;
@@ -175,7 +176,7 @@ begin
     end;
     1:
     begin
-      sURL := PHPWeb.MeasureURL + 'api/client/tender/concernaudit/create';    // AAAAA  添加关注人
+      sURL := PHPWeb.MeasureURL + 'tender/concernaudit/create';    // AAAAA  添加关注人
       // 标段ID(网络)、谁添加的、添加的谁
       if PHPWeb.Search(sURL, ['tenderid', 'uid'], [IntToStr(FWebID), UserArr[4]], vArr) = 1 then
       begin
@@ -258,4 +259,9 @@ begin
   lblHint2.Caption := Format('添加新%s', [sName]);
 end;
 
+procedure TFindUserForm.FormActivate(Sender: TObject);
+begin
+  Self.Top := Self.Top + 60;
+end;
+
 end.

+ 7 - 7
Forms/SetGuestFrm.dfm

@@ -1,9 +1,9 @@
 object SetGuestForm: TSetGuestForm
-  Left = 365
-  Top = 307
+  Left = 986
+  Top = 309
   BorderStyle = bsDialog
   Caption = #35774#32622#26631#27573#20851#27880#20154
-  ClientHeight = 338
+  ClientHeight = 450
   ClientWidth = 504
   Color = clBtnFace
   Font.Charset = ANSI_CHARSET
@@ -28,11 +28,11 @@ object SetGuestForm: TSetGuestForm
     Left = 8
     Top = 39
     Width = 489
-    Height = 265
+    Height = 378
     Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
     OptionsEx = []
     ColCount = 4
-    RowCount = 4
+    RowCount = 6
     ShowGridLine = False
     DefaultColWidth = 73
     DefaultFixedRowHeight = 25
@@ -46,7 +46,7 @@ object SetGuestForm: TSetGuestForm
   end
   object btnOK: TButton
     Left = 418
-    Top = 308
+    Top = 420
     Width = 75
     Height = 25
     Caption = #30830#23450
@@ -109,7 +109,7 @@ object SetGuestForm: TSetGuestForm
       end>
     DataSet = cdsGuest
     Grid = zgGuest
-    ExtendRowCount = 3
+    ExtendRowCount = 5
     Left = 352
     Top = 104
   end

+ 17 - 14
Forms/SetGuestFrm.pas

@@ -70,7 +70,7 @@ procedure TSetGuestForm.btnAddClick(Sender: TObject);
 var
   FindUserForm: TFindUserForm;
 begin
-  FindUserForm := TFindUserForm.Create(self, 1, []);
+  FindUserForm := TFindUserForm.Create(self, 1, [FWebID, -1]);
   try
     FindUserForm.ShowModal;
   finally
@@ -89,18 +89,18 @@ var i: Integer;
 begin
   inherited Create(nil);
   FWebID := AWebID;
-//  GetGuests;
+  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;
+//  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;
@@ -110,7 +110,7 @@ var sURL: string;
 begin
   Screen.Cursor := crHourGlass;
   try
-    sURL := Format('%sapi/client/tender/%s/concernaudit/list', [PHPWeb.MeasureURL, InttoStr(FwebID)]);   // AAAAAA 查询标段的关注人
+    sURL := Format('%stender/%s/concernaudit/list', [PHPWeb.MeasureURL, InttoStr(FwebID)]);   // AAAAAA 查询标段的关注人
     case PHPWeb.Search(sURL, [], [], UserArr) of
       1:
       begin
@@ -134,12 +134,14 @@ begin
         Application.MessageBox(PChar(PHPWeb.NetError('无法查询到关注人')),
             '警告', MB_OK + MB_ICONWARNING);
         Exit;
+        close;
       end;
       0:
       begin
         Application.MessageBox(PChar(PHPWeb.PageError('无法查询到关注人')),
             '警告', MB_OK + MB_ICONWARNING);
         Exit;
+        close;
       end;
     end;
   finally
@@ -180,7 +182,8 @@ procedure TSetGuestForm.zgGuestMouseDown(Sender: TObject;
   var s, sURL: string;
   vArr: array of string;
 begin
-  if zgGuest.CurCol = Col(zaGuest, 'Operate') then
+
+  if ((zgGuest.CurCol = Col(zaGuest, 'Operate')) and (zgGuest.CurRow <= cdsGuest.RecordCount)) then
   begin
     s := Format('确定要取消用户“%s”对该标段的关注吗?', [cdsGuestName.AsString]);
     if Application.MessageBox(PChar(s), '询问', MB_YESNO + MB_ICONQUESTION) = ID_No then
@@ -189,7 +192,7 @@ begin
     Screen.Cursor := crHourGlass;
     vArr := VarArrayOf(['msg']);
     try
-      sURL := PHPWeb.MeasureURL + '/api/client/tender/concernaudit/del';   // AAAAAA 取消关注人
+      sURL := PHPWeb.MeasureURL + 'tender/concernaudit/del';   // AAAAAA 取消关注人
 
       case PHPWeb.Search(sURL, ['tenderid', 'uid'], [InttoStr(FwebID), cdsGuestID.AsString], vArr) of
         1:

+ 6 - 1
Frames/ProjectFme.pas

@@ -806,7 +806,12 @@ begin
     if ProjectData.PhaseIndex < ProjectData.ProjProperties.PhaseCount then
       btnPass.Enabled := False
     else
-      btnPass.Enabled := CheckerFrame.Me.IsChecking;
+    begin
+      if CheckerFrame.Me <> nil then
+        btnPass.Enabled := CheckerFrame.Me.IsChecking
+      else         // Óοͣ¬¹Ø×¢ÈËÉí·Ý
+        btnPass.Enabled := False;
+    end;
 
     btnNotPass.Enabled := btnPass.Enabled;
     btnPass.Left := jcbAudit.Left + jcbAudit.Width + 5;