From d02cd5e3e87cbe8ff72b2d6ff91ed185910607b5 Mon Sep 17 00:00:00 2001
From: doom4ster <doom4ster@gmail.com>
Date: 星期三, 09 八月 2017 10:23:53 +0800
Subject: [PATCH] CB_IMGPSScan.cab ver2.0.1.27 修改補件必要文件的問題

---
 CB_IMGPSScanImp.pas |  129 ++++++++++++++++++++++++++++---------------
 1 files changed, 84 insertions(+), 45 deletions(-)

diff --git a/CB_IMGPSScanImp.pas b/CB_IMGPSScanImp.pas
index 6c41278..181e9ad 100644
--- a/CB_IMGPSScanImp.pas
+++ b/CB_IMGPSScanImp.pas
@@ -3269,14 +3269,33 @@
       PM104.Visible := True;   //檔案加入影像
     end;
 
-    if FMode='ESCAN' then
+    if FModeName='異動件' then
     begin
       PM101.Visible := True;
     end;
+//    if FMode='ESCAN' then
+//    begin
+//      PM101.Visible := True;
+//    end;
   end
   Else if TreeView1.Selected = MyTreeNode1 then    //案件層
   begin
     PM101.Visible := True;   //刪除
+
+    if FImgDelete='Y' then
+    begin
+      PM101.Visible:=True;
+    end;
+    if FImgDelete='N' then
+    begin
+      PM101.Visible:=false;
+    end;
+
+    if FModeName='異動件' then
+    begin
+      PM101.Visible := True;
+    end;
+
     if not CaseDelete_Enable(NowCaseno) then //
       PM101.Enabled := False
     else
@@ -3291,10 +3310,10 @@
     begin
       PM102.Visible := True;   //修改案件編號
     end;
-    if FMode='ESCAN' then
-    begin
-      PM101.Visible := True;
-    end;
+//    if FMode='ESCAN' then
+//    begin
+//      PM101.Visible := True;
+//    end;
   end
   Else if TreeView1.Selected = MyTreeNode2 then    //文件層
   begin
@@ -3303,6 +3322,20 @@
     //PM109.Visible := True;   //檢核此筆
     if FCustDocYN <> 'N' Then
       PM110.Visible := True;   //新增自訂文件
+    if FImgDelete='Y' then
+    begin
+      PM101.Visible:=True;
+    end;
+    if FImgDelete='N' then
+    begin
+      PM101.Visible:=false;
+    end;
+
+    if FModeName='異動件' then
+    begin
+      PM101.Visible := True;
+    end;
+
     if GetUseCase('T',DisplayPath,NowDocDir) <> '' then   //沒有被引用走的
       PM101.Enabled := False    //刪除
     Else
@@ -3311,10 +3344,10 @@
       PM111.Visible := True;   //修改份數
     if (FMode = 'NSCAN') then
       PM102.Visible := True;   //修改案件編號
-    if FMode='ESCAN' then
-    begin
-      PM101.Visible := True;
-    end;
+//    if FMode='ESCAN' then
+//    begin
+//      PM101.Visible := True;
+//    end;
   end
   Else if TreeView1.Selected = MyTreeNode3 then    //表單層
   begin
@@ -3325,7 +3358,23 @@
     if FCustDocYN <> 'N' Then
       PM110.Visible := True;   //新增自訂文件
     if GetFormIDPage(ContextList,NowFormCode) < 1 Then
+    begin
       PM108.Visible := False;   //歸類
+    end;
+    if FImgDelete='Y' then
+    begin
+      PM101.Visible:=True;
+    end;
+    if FImgDelete='N' then
+    begin
+      PM101.Visible:=false;
+    end;
+
+    if FModeName='異動件' then
+    begin
+      PM101.Visible := True;
+    end;
+
     if GetUseCase('T',DisplayPath,NowDocDir) <> '' then   //被引用走的
     begin
       PM101.Enabled := False;   //刪除
@@ -3340,24 +3389,12 @@
     end;
 
     if (FMode = 'NSCAN') then
-      PM102.Visible := True;   //修改案件編號
-    //PM103.Visible := True;   //掃瞄器加入影像
-    //PM104.Visible := True;   //檔案加入影像
-    //PM107.Visible := True;   //寫備註
-    //PM109.Visible := True;   //檢核此筆
-
-    if FMode='ESCAN' then
     begin
-      PM101.Visible := True;
-      PM108.Visible := True;
-      PM110.Visible := True;
+      PM102.Visible := True;   //修改案件編號
     end;
   end;
 
-  if FImgDelete='Y' then
-  begin
-    PM101.Visible:=True;
-  end;
+
 
 end;
 
@@ -3435,26 +3472,27 @@
     PM605.Visible := True;  //刪除
   end;
 
+  if  FModeName<>'異動件' then
+  begin
+    if (FImgDelete='Y') then
+    begin
+      PM605.Enabled:=True;
+    end;
+    if FImgDelete='N' then
+    begin
+      PM605.Enabled:=false;
+    end;
+  end;
+
+
+
+
   if CheckSelectImg_UseCase(DisplayPath,NowCaseNo) then //選擇的影像不可有引用的
   begin
     PM601.Enabled := False;  //歸類
     PM605.Enabled := False;  //刪除
-  end
-  Else
-  begin
-    PM601.Enabled := True;  //歸類
-    PM605.Enabled := True;  //刪除
   end;
 
-  if FMode='ESCAN' then
-  begin
-    PM605.Enabled:=False;
-  end;
-
-  if FImgDelete='Y' then
-  begin
-    PM605.Enabled:=True;
-  end;
 
 end;
 
@@ -3837,6 +3875,8 @@
   ShowMessage('LASTEST_FORM_INF_List='+LASTEST_FORM_INF_List.Text)   ;
   ShowMessage('SampleFormIDList='+SampleFormIDList.Text);
   ShowMessage('ExistImgList='+ExistImgList.Text);
+  ShowMessage('LastInitFormidList='+LastInitFormidList.Text);
+  ShowMessage('IN_WH_DocNoList='+IN_WH_DocNoList.Text);
 
 //  SampleFormIDList.Add('31A00101011706A');
 //  SampleFormIDList.Add('31A00101021706A');
@@ -5803,6 +5843,7 @@
   ST1:=TStringList.Create;
   ST1.LoadFromFile(path+'FormCode_Name.dat');
 //ShowMessage(ST1.Text);
+//ShowMessage(LastInitFormidList.Text);
   ST2:=TStringList.Create;
 
   for I := 0 to ST1.Count - 1 do
@@ -5810,14 +5851,16 @@
     if (Pos('_',St1.Strings[i])<>1) and (Pos('_',St1.Strings[i])<>-11) then
     begin
       str1:=Copy(ST1.Strings[i],1,Pos('_',St1.Strings[i])-1);
+      ST2.Add(str1);
       if ST2.IndexOf(str1) = -1 then
       begin
-        ST2.Add(str1);
+
         must_formidStr:= must_formidStr+str1+'@#,';
       end;
     end;
   end;
   must_formidStr:=Copy(must_formidStr,1,Length(must_formidStr)-3) ;
+//ShowMessage('AST2='+ST2.Text);
   for I := 0 to LastInitFormidList.Count - 1 do
   begin
     if ST2.IndexOf(LastInitFormidList.Strings[i]) <> -1 then
@@ -5825,19 +5868,15 @@
       ST2.Delete(ST2.IndexOf(LastInitFormidList.Strings[i]));
     end;
   end;
+//ShowMessage('BST2='+ST2.Text);
   for I := 0 to ST2.Count - 1 do
   begin
-    if i <> ST2.Count then
-    begin
       last_add_formidstr:=last_add_formidstr+ST2.Strings[i]+'@#,';
-    end
-    else
-    begin
-      last_add_formidstr:=last_add_formidstr+ST2.Strings[i]
-    end;
   end;
+  last_add_formidstr:=Copy(last_add_formidstr,1,Length(last_add_formidstr)-3) ;
   ST1.Free;
   ST2.Free;
+//ShowMessage('last_add_formidstr='+last_add_formidstr);
   ///////必要formid 20170315 end //////////////////////////
 
   ///保留外部影像  start///////////////////////////////

--
Gitblit v1.8.0