doom4ster
2017-08-29 20ffd04b8c3c56c1af57c6dd218e91b0185aa125
CB_IMGPSScanImp.pas
@@ -3851,8 +3851,10 @@
    'FCaseNoLength='+ IntToStr(FCaseNoLength)   +#10#13+
    'FImgDelete='+    FImgDelete+#10#13+
    'FIsExternal='+    FIsExternal+#10#13+
    'FWH_category='+FWH_category+
    'FCheck_main_form='+    FCheck_main_form);
    //FImgDelete:='Y';
  LoadImgFile;
 { ShowMessage('UpLPoint='+IntToStr(UpLPoint.X)+','+IntToStr(UpLPoint.Y)+#10#13+
    'UpRPoint='+IntToStr(UpRPoint.X)+','+IntToStr(UpRPoint.Y)+#10#13+
    'DownLPoint='+IntToStr(DownLPoint.X)+','+IntToStr(DownLPoint.Y)+#10#13+
@@ -6234,7 +6236,7 @@
    Result := False;
    Exit;
  end;
//ShowMessage('sssss');
//ShowMessage('替換zip');
  AttPath := Path + 'AttFile\';
  if FileExists(Path+CaseID+'.zip') then
  begin
@@ -6729,7 +6731,7 @@
          end;
    end;
    //Showmessage('abc'+#13+ImageSavePath+CaseNo+'\CaseDocNo.dat'+#13+inttostr(CaseDocNoList.Count)+#13+CaseDocNoList.Text);
    if CaseDocNoList.Count > 0 then
    if CaseDocNoList.Count >= 0 then
    begin
      CaseDocNoList.SaveToFile(ImageSavePath+CaseNo+'\CaseDocNo.dat');
      CaseDocNo_CopiesList.SaveToFile(ImageSavePath+CaseNo+'\CaseDocNo_Copies.dat');
@@ -8068,8 +8070,9 @@
      DocNoCopies := Strtoint(CaseDocNo_CopiesList.Strings[i]);
      DocNoPage := FileList.Count;
      iDocNo := DocNoDir2DocNo(CaseDocNoList.Strings[i]);
      //Showmessage(iDocNo);
      //Showmessage(DocNo2DocName(Caseno,iDocNo));
//Showmessage(iDocNo);
//Showmessage(DocNo2DocName(Caseno,iDocNo));
//ShowMessage('FileList='+FileList.Text);
      {if (((FIs_In_Wh  = 'Y') and (not DocNoIs_In_WH(iDocNo))) or   //入庫掃描不看非入庫文件
         ((FIs_In_Wh  = 'N') and (DocNoIs_In_WH(iDocNo)))) and
         ((iDocNo <> 'Attach') and (Copy(iDocNo,1,5)<>'ZZZZZ')) then     //非入庫掃描不看入庫文件
@@ -8587,6 +8590,7 @@
    end;
    CasePage := GetCasePage(ImageSavePath,CaseList.Strings[i]);
//ShowMessage('CasePage='+IntToStr(CasePage));
    MytreeNode1 := TreeView1.Items.AddChild(NewTreeNode,Format(_Msg('%s-%d頁'),[CaseList.Strings[i],CasePage]));
    MytreeNode1.ImageIndex := 1;
    MytreeNode1.SelectedIndex := 1;
@@ -11834,7 +11838,7 @@
    ST1:TStringList;
begin
   ShowText := '影像顯示中,請稍候';
   //DataLoading(True,True);
   DataLoading(True,True);
ST1:=TStringList.Create;
//Display1.Lines.Clear;
   IF DocNo = 'ShowAll' then  //顯示所有的影像 (因為附件會傳空字串,所以用ShowAll)
@@ -11860,6 +11864,7 @@
       end;
       iDocNo := CaseDocNoList.Strings[i];
//ShowMessage('ST1.Count='+IntToStr(ST1.Count));
       if ST1.Count<>0 then
       begin
         if ST1.IndexOf(iDocNo)<>-1 then
@@ -11877,7 +11882,7 @@
       ContextList.Clear;
       if FileExists(Path+iDocNo+'\Context.dat') then
         ContextList.LoadFromFile(Path+iDocNo+'\Context.dat');
//ShowMessage('ContextList='+ContextList.Text);
       for n := 0 to ContextList.Count - 1 do
       begin
@@ -11885,7 +11890,11 @@
         begin
           if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[n]) then
           begin
             Continue;
             if not DocNoIs_In_WH(Copy(iDocNo,1,8)) then
             begin
               Continue;
             end;
           end;
         end;
@@ -11925,23 +11934,13 @@
   end
   Else if (DocNo <> '') and (FormID = '') then  //顯示指定DocNo+組別的影像  附件傳 Attach
   begin
   begin                               //顯示 文件層下的影像
     iDocNo := DocNo;
     ContextList.Clear;
     if FileExists(Path+iDocNo+'\Context.dat') then
       ContextList.LoadFromFile(Path+iDocNo+'\Context.dat');
//     Ct:=0 ;
//     for I := 0 to ContextList.Count - 1 do
//     begin
//       if FWH_category='N' then
//       begin
//         if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]) then
//         begin
//           Inc(Ct);
//           //ContextList.Delete(ContextList.IndexOf(ContextList.Strings[i]));
//         end;
//       end;
//     end;
//ShowMessage('ContextList.Count='+IntToStr(ContextList.Count));
     CreatePreViewISB(ContextList.Count);
//ShowMessage(IntToStr(ContextList.Count-Ct));
     int1:=0;
@@ -11951,8 +11950,12 @@
       begin
         if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]) then
         begin
           inc(int1);
           Continue;
           if not DocNoIs_In_WH(Copy(iDocNo,1,8)) then
           begin
             inc(int1);
             Continue;
           end;
         end;
       end;
       ISB := TImageScrollBox(FindComponent(ISBName+intToStr(i+1-int1)));
@@ -11988,7 +11991,8 @@
//ShowMessage(BoolToStr(ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]),true));
             if ISExistImg(Path+iDocNo+'\'+ContextList.Strings[i]) then
             begin
               Continue;
               if not DocNoIs_In_WH(FormCode2DocNo(FormID)) then
                 Continue;
             end;
           end;
           inc(Ct);
@@ -13519,8 +13523,8 @@
  i: Integer;
begin
  Timer1.Enabled := False;
//  FIs_In_Wh:='Y'; /// test 記得關掉
//  FWH_category :='N';  // test 記得關掉
  //FIs_In_Wh:='Y'; /// test 記得關掉
  //FWH_category :='N';  // test 記得關掉
//  FImgDelete := 'Y'; //test 記得關掉
  //Showmessage('a');
  //self.FIs_OldCase := 'Y';
@@ -13854,6 +13858,8 @@
//ShowMessage(IntToStr(ScanDpi));
  R_W_Scanini('R'); //掃瞄設定的ini
//ShowMessage(IntToStr(ScanDpi));
//ShowMessage('停掉DataLoading');
//DataLoading(False,False);
  ScanDuplexCB.Checked := ScanDuplex;
  if FMode <> 'SAMPLESCAN' then
    LoadImgFile;