瀏覽代碼

云端删除项目判断。(增加了一个判断接口)

CSL 9 年之前
父節點
當前提交
ca3599bcad
共有 4 個文件被更改,包括 42 次插入23 次删除
  1. 4 2
      DataModules/PHPWebDm.pas
  2. 2 2
      Forms/IPFrm.dfm
  3. 16 16
      Forms/MainFrm.dfm
  4. 20 3
      Frames/ProjectManagerFme.pas

+ 4 - 2
DataModules/PHPWebDm.pas

@@ -297,12 +297,13 @@ begin
       IdDataStream.AddFormField('CheckerMemo', ReplaceCharsForJson(ACheckerMemo));
     end;
 
+    IdDataStream.AddFile('upfile', AFile, 'text/plain');
     IdDataStream.AddFormField('upfile', AFile);
 //    IdDataStream.AddFormField('submit', 'submit');
     IdDataStream.AddFormField('MD5_JL', AMD5_JL);
     sZipMD5 := MD5_File(AFile);
     IdDataStream.AddFormField('MD5_Zip', sZipMD5);
-    IdDataStream.AddFile('upfile', AFile, 'text/plain');
+
     IdDataStream.Position := 0;
     try
       sResult := IdHTTP.Post(sURL, IdDataStream);
@@ -601,11 +602,12 @@ begin
   vMPFDS := TIdMultiPartFormDataStream.Create;
   try
     sURL := Format('%stender/attachment/%d/%d/upload', [FMeasureURL, AWebID, AUperID]);
+    vMPFDS.AddFile('upitem', AFile, 'text/plain');
     vMPFDS.AddFormField('itemid', IntToStr(ABillID));
     vMPFDS.AddFormField('Category', ACategory);
     vMPFDS.AddFormField('Memo', ReplaceCharsForJson(AMemo));
     vMPFDS.AddFormField('PhaseName', APhaseName);
-    vMPFDS.AddFile('upitem', AFile, 'text/plain');
+
     vMPFDS.Position := 0;
     try
       sResult := IdHTTP.Post(sURL, vMPFDS);

+ 2 - 2
Forms/IPFrm.dfm

@@ -191,9 +191,9 @@ object IPForm: TIPForm
       object lblTitleEdit2: TLabel
         Left = 29
         Top = 79
-        Width = 144
+        Width = 119
         Height = 24
-        Caption = #36755#20837#31169#26377#20113#22320#22336'/IP'
+        Caption = #36755#20837#26381#21153#22120#22320#22336
         Font.Charset = DEFAULT_CHARSET
         Font.Color = 7105644
         Font.Height = -17

+ 16 - 16
Forms/MainFrm.dfm

@@ -20,8 +20,8 @@ object MainForm: TMainForm
   TextHeight = 12
   object jtsProjects: TJimTabSet
     Left = 0
-    Top = 48
-    Width = 742
+    Top = 49
+    Width = 734
     Height = 21
     Align = alTop
     BackgroundColor = clGradientInactiveCaption
@@ -45,8 +45,8 @@ object MainForm: TMainForm
   end
   object dxStatusBar: TdxStatusBar
     Left = 0
-    Top = 484
-    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
@@ -93,9 +93,9 @@ object MainForm: TMainForm
   end
   object jpsMain: TJimPages
     Left = 0
-    Top = 69
-    Width = 742
-    Height = 415
+    Top = 70
+    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 = 415
+      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 = 415
+      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 = #23435#20307
+    Font.Name = #24494#36719#38597#40657
     Font.Style = []
     Bars = <
       item
@@ -266,7 +266,7 @@ object MainForm: TMainForm
         Caption = #24037#20855#26639
         DockedDockingStyle = dsTop
         DockedLeft = 0
-        DockedTop = 26
+        DockedTop = 27
         DockingStyle = dsTop
         FloatLeft = 484
         FloatTop = 279
@@ -375,7 +375,7 @@ object MainForm: TMainForm
     DockControlHeights = (
       0
       0
-      48
+      49
       0)
     object dxsiFile: TdxBarSubItem
       Caption = #25991#20214'(&F)'

+ 20 - 3
Frames/ProjectManagerFme.pas

@@ -241,6 +241,20 @@ var
 
     bLock, bCanImp: Boolean;
     vFileCheck: TTenderFileChecker;
+
+    function HasWebBidInfo(AWebID: Integer): Boolean;
+    var vArr: array of string;
+      iResult: Integer;
+    begin
+      sSearchURL := Format('%stender/get/%d/exist', [PHPWeb.MeasureURL, AWebID]);
+      vArr := VarArrayOf(['id', 'name']);
+      iResult := PHPWeb.Search(sSearchURL, [''], [''], vArr);
+
+      if (iResult = 1) and (High(vArr) >= 0) then
+        Result := True
+      else
+        Result := False;
+    end;
   begin
     Result := False;
 
@@ -348,9 +362,12 @@ var
     end
     else if (iSearch = 10) then
     begin
-      sHint :='该项目[' + FBidName + ']在云端已被删除,点击"确定"后,可手动删除该项目。';
-      Application.MessageBox(PChar(sHint), '系统提示', MB_OK + MB_ICONINFORMATION);
-      Exit;
+      if not HasWebBidInfo(FWebID) then
+      begin
+        sHint :='该项目[' + FBidName + ']在云端已被删除,点击"确定"后,可手动删除该项目。';
+        Application.MessageBox(PChar(sHint), '提示', MB_OK + MB_ICONINFORMATION);
+        Exit;
+      end;
     end
     else if (iSearch = 0) or (iSearch = -1) then
     begin