Browse Source

改造新建标段窗口。

Chenshilong 9 years ago
parent
commit
e4110d04f1
2 changed files with 64 additions and 37 deletions
  1. 35 33
      Forms/WebNewTenderFrm.dfm
  2. 29 4
      Forms/WebNewTenderFrm.pas

+ 35 - 33
Forms/WebNewTenderFrm.dfm

@@ -1,58 +1,60 @@
 object WebNewTenderForm: TWebNewTenderForm
-  Left = 534
-  Top = 268
+  Left = 1163
+  Top = 401
   BorderStyle = bsDialog
   Caption = #26032#24314#26631#27573
-  ClientHeight = 158
-  ClientWidth = 314
+  ClientHeight = 160
+  ClientWidth = 310
   Color = clBtnFace
   Font.Charset = ANSI_CHARSET
   Font.Color = clBlack
-  Font.Height = -12
-  Font.Name = #23435#20307
+  Font.Height = -14
+  Font.Name = #24494#36719#38597#40657
   Font.Style = []
   OldCreateOrder = False
+  Position = poMainFormCenter
   OnCreate = FormCreate
   PixelsPerInch = 96
-  TextHeight = 12
+  TextHeight = 20
   object lbl1: TLabel
-    Left = 16
-    Top = 11
-    Width = 54
-    Height = 12
+    Left = 12
+    Top = 6
+    Width = 67
+    Height = 20
     Caption = #35831#36755#20837'KEY'
-    Font.Charset = ANSI_CHARSET
-    Font.Color = clBlack
-    Font.Height = -12
-    Font.Name = #23435#20307
-    Font.Style = []
-    ParentFont = False
   end
   object lbl2: TLabel
-    Left = 16
-    Top = 58
-    Width = 48
-    Height = 12
+    Left = 12
+    Top = 56
+    Width = 56
+    Height = 20
     Caption = #26631#27573#21517#31216
+  end
+  object lblHint: TLabel
+    Left = 13
+    Top = 104
+    Width = 24
+    Height = 17
+    Caption = #25552#31034
     Font.Charset = ANSI_CHARSET
-    Font.Color = clBlack
+    Font.Color = clRed
     Font.Height = -12
-    Font.Name = #23435#20307
+    Font.Name = #24494#36719#38597#40657
     Font.Style = []
     ParentFont = False
   end
   object btnOK: TButton
-    Left = 144
-    Top = 120
+    Left = 146
+    Top = 125
     Width = 75
     Height = 25
     Caption = #30830#23450
-    ModalResult = 1
     TabOrder = 0
+    OnClick = btnOKClick
   end
   object btnCancel: TButton
-    Left = 219
-    Top = 120
+    Left = 222
+    Top = 125
     Width = 75
     Height = 25
     Caption = #21462#28040
@@ -60,18 +62,18 @@ object WebNewTenderForm: TWebNewTenderForm
     TabOrder = 1
   end
   object edtKey: TEdit
-    Left = 16
+    Left = 12
     Top = 27
     Width = 285
-    Height = 20
+    Height = 28
     TabOrder = 2
     OnKeyDown = edtKeyKeyDown
   end
   object edtTenderName: TEdit
-    Left = 16
-    Top = 74
+    Left = 12
+    Top = 76
     Width = 285
-    Height = 20
+    Height = 28
     TabOrder = 3
     OnKeyDown = edtKeyKeyDown
   end

+ 29 - 4
Forms/WebNewTenderFrm.pas

@@ -14,9 +14,11 @@ type
     edtKey: TEdit;
     lbl2: TLabel;
     edtTenderName: TEdit;
+    lblHint: TLabel;
     procedure FormCreate(Sender: TObject);
     procedure edtKeyKeyDown(Sender: TObject; var Key: Word;
       Shift: TShiftState);
+    procedure btnOKClick(Sender: TObject);
   private
     { Private declarations }
   public
@@ -33,19 +35,42 @@ procedure TWebNewTenderForm.FormCreate(Sender: TObject);
 begin
   if G_IsTest then
   begin
-    edtKey.Text := '31kyI7UwUI'; // 本地
-    edtTenderName.Text := FormatDateTime('yyyymmdd_', Now);
+    edtKey.Text := ''; // 本地
+    edtTenderName.Text := '';
   end;
+  lblHint.Caption := '';
+  lblHint.Update;
 end;
 
 procedure TWebNewTenderForm.edtKeyKeyDown(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 begin
   if Key = 13 then
+    btnOK.Click;
+end;
+
+procedure TWebNewTenderForm.btnOKClick(Sender: TObject);
+begin
+  lblHint.Caption := '';
+  lblHint.Update;
+
+  if Trim(edtKey.Text) = '' then
   begin
-    if (edtKey.Text <> '') and (edtTenderName.Text <> '') then
-      ModalResult := mrOk;
+    lblHint.Caption := 'KEY不能为空';
+    lblHint.Update;
+    edtKey.SetFocus;
+    Exit;
   end;
+
+  if Trim(edtTenderName.Text) = '' then
+  begin
+    lblHint.Caption := '标段名称不能为空';
+    lblHint.Update;
+    edtTenderName.SetFocus;
+    Exit;
+  end;
+
+  ModalResult := mrOk;
 end;
 
 end.