doom4ster
2017-05-10 d825d5f9944e6635747ae8817b73016d82832836
CB_IMGPSScanImp.pas
@@ -4022,14 +4022,17 @@
          end;
          if (FormID <> '') and ISGuideFormID(FormID) then
          begin
            NowGuideFormID := FormID;
          end;
//ShowMessage('NowGuideFormID='+NowGuideFormID);
          if (not (FindDivFormCode(FormID))) and (NowGuideFormID <> '') {and (FormID = '')} then
            FormID := NowGuideFormID;
          DocNo := FormCode2DocNo(FormID);
          if (FormID <>'') and FindDivFormCode(FormID) Then  //只找分案頁上的案件條碼
//ShowMessage('FormID='+FormID);
          if (FormID <>'') and FindDivFormCode(FormID) and (NowGuideFormID <> '')  Then  //只找分案頁上的案件條碼
          begin
            ScanInfo.ImageCount := 0;
            ClearView(1);
            ContextList.Clear;
@@ -4037,6 +4040,7 @@
            ClearCaseIndex;                //清掉案件索引
            ScanCaseno := BarCode2CaseID; //取出案件編號
            NowGuideFormID := '';
//ShowMessage('NowGuideFormID='+NowGuideFormID+#10#13+'FormID='+FormID+#10#13+'ScanCaseno='+ScanCaseno);
          end;
          if ScanCaseno = '' then //一開始都沒找到
          begin
@@ -4126,11 +4130,10 @@
      begin
        ScanSaveFilename := '';
        FormID := BarCode2FormID; //取出FormID
        if (FormID <> '') and ISGuideFormID(FormID) then
          NowGuideFormID := FormID;
        //Showmessage('A:'+FormID+#13+'B:'+NowGuideFormID);
        if (NowGuideFormID <> '') {and (FormID = '')} then
          FormID := NowGuideFormID;
//        if (FormID <> '') and ISGuideFormID(FormID) then   //20170510 註解 因為DSCAN 會全擠在導引頁下
//          NowGuideFormID := FormID;
//        if (NowGuideFormID <> '') {and (FormID = '')} then  //20170510 註解  因為DSCAN 會全擠在導引頁下
//          FormID := NowGuideFormID;
        DocNo := FormCode2DocNo(FormID);
        ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo);
//ShowMessage('ScanDocDir='+ScanDocDir);
@@ -5517,6 +5520,7 @@
  last_add_formidstr :string;
  casepath:String;
  filesizeInt:integer;
  case_page:string;
begin
  Result := True;
  TransName := CaseID;
@@ -5528,7 +5532,9 @@
  end;
  if FileExists(Path+'CustomDocNo.dat') then
    Cust_DocNoList.LoadFromFile(Path+'CustomDocNo.dat');
  Pages := ContextList.Count;
  case_page:=IntToStr(pages);
  if (FMode = 'NSCAN') or (FMode = 'ESCAN') or (FMode = 'ASCAN') or (FMode = 'DSCAN') or (FMode = 'SSCAN') or (FMode = 'MSCAN') or (FMode = 'RI_SCAN') or (FMode = 'RSCAN')  then
  begin
    //Showmessage('1');
@@ -5645,6 +5651,7 @@
  +'&doc_data='+HTTPEncode(UTF8Encode(Doc_Data))
  +'&doc_data1='+HTTPEncode(UTF8Encode(Doc_Data1))
  +'&attach='+AttachYN
  +'&case_page='+case_page
  +'&file_size='+IntToStr(filesizeInt)
  +'&must_formid='+must_formidStr  //擁有的 formid
  +'&last_add_formid='+last_add_formidstr   //當次新加的 formid
@@ -11967,6 +11974,10 @@
  for I := 0 to ContextList.Count - 1 do
  begin
    FileFormID := FileName2FormCode(ContextList.Strings[i]);
    if FileFormID=GuideFormIDList.Strings[0] then //20170509 跳過導引頁的formid
    begin
      Continue;
    end;
    if FindDivFormCode(FileFormID) then
    begin
      Result := FileFormID;
@@ -12691,9 +12702,11 @@
var
  SendData : String;
begin
//Memo1.Clear;
  SendData := 'data='+HTTPEncode(UTF8Encode(FData))+'&verify='+FVerify+'&case_no='+CaseID+'&work_no='+FWork_no;
  if (FMode = 'NSCAN') then
  if (FMode = 'NSCAN') or (FMode = 'DSCAN') then
  begin
//ShowMessage('JJJJJ');
    If not ProcessServlet_Get(HTTPSClient,FURL+'service/imgpsc/IMGPSC05/isnew',SendData,FReWrite,Memo1,False) Then
    begin
      HttpErrStr := _Msg('錯誤代碼:')+inttostr(HttpError.HttpErrorCode)+','+HttpError.HttpReason;
@@ -12701,7 +12714,8 @@
      Exit;
    end;
  end;
//ShowMessage(SendData);
//ShowMessage(Memo1.Lines.Text);
  IF memo1.Lines.Strings[0] <> '0' Then
  begin
    HttpErrStr := _Msg('錯誤原因:')+memo1.Lines.Strings[1];
@@ -13299,6 +13313,7 @@
  DataLoading(False,False);
//ShowMessage('初始話執行完成');
//ShowMessage(GuideFormIDList.Text);
end;
procedure TCB_IMGPSScanX.Timer2Timer(Sender: TObject);