| | |
| | | ExtCtrls, ComCtrls, Menus, StdCtrls, Gauges, EnImgScr, PJMenuSpeedButtons, |
| | | Buttons, ImgList, SBSimpleSSL, SBHTTPSClient, SBWinCertStorage, SBX509, |
| | | SBCustomCertStorage, SBUtils,mpsBarco,BarcodesFinder,HTTPApp,ErrList, |
| | | Xmltool,inifiles,printers,IdHashMessageDigest, idHash, LogFile; |
| | | Xmltool,inifiles,printers,IdHashMessageDigest, idHash, LogFile,ShellApi, |
| | | SBSocket; |
| | | |
| | | var |
| | | Ch_WriteNote : Boolean; |
| | |
| | | Splitter1: TSplitter; |
| | | Panel3: TPanel; |
| | | Label7: TLabel; |
| | | TreeView1: TTreeView; |
| | | Panel6: TPanel; |
| | | CB1: TCheckBox; |
| | | ScanDuplexCB: TCheckBox; |
| | |
| | | PM402: TMenuItem; |
| | | PM403: TMenuItem; |
| | | PM404: TMenuItem; |
| | | HTTPSClient: TElHTTPSClient; |
| | | ElWinCertStorage: TElWinCertStorage; |
| | | ElMemoryCertStorage: TElMemoryCertStorage; |
| | | Panel5: TPanel; |
| | |
| | | Panel11: TPanel; |
| | | SampleScanBtn: TBitBtn; |
| | | WNoteBtn: TBitBtn; |
| | | Panel13: TPanel; |
| | | CaseHelpBtn: TBitBtn; |
| | | PopupMenu1: TPopupMenu; |
| | | PM101: TMenuItem; |
| | | N12: TMenuItem; |
| | |
| | | Edit1: TEdit; |
| | | PM110: TMenuItem; |
| | | Image1: TImage; |
| | | PrtLb: TLabel; |
| | | UseOldCaseLb: TLabel; |
| | | PM111: TMenuItem; |
| | | SmoothCB: TCheckBox; |
| | |
| | | Label3: TLabel; |
| | | LogFile1: TLogFile; |
| | | ScanGrayCB: TCheckBox; |
| | | AttFileGB: TGroupBox; |
| | | AttListBox: TListBox; |
| | | Panel20: TPanel; |
| | | AddAttFileLB: TLabel; |
| | | DelAttFileLB: TLabel; |
| | | Splitter2: TSplitter; |
| | | Panel17: TPanel; |
| | | TreeView1: TTreeView; |
| | | Panel13: TPanel; |
| | | PrtLb: TLabel; |
| | | CaseHelpBtn: TBitBtn; |
| | | HTTPSClient: TElHTTPSClient; |
| | | procedure ActiveFormCreate(Sender: TObject); |
| | | procedure Panel9Resize(Sender: TObject); |
| | | procedure ISB1Click(Sender: TObject); |
| | |
| | | procedure TreeView1MouseEnter(Sender: TObject); |
| | | procedure ScrollBox1MouseEnter(Sender: TObject); |
| | | procedure ScanGrayCBClick(Sender: TObject); |
| | | procedure AddAttFileLBClick(Sender: TObject); |
| | | procedure DelAttFileLBClick(Sender: TObject); |
| | | procedure AttListBoxDblClick(Sender: TObject); |
| | | procedure AttListBoxClick(Sender: TObject); |
| | | procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton; |
| | | Shift: TShiftState; X, Y: Integer); |
| | | procedure HTTPSClientRedirection(Sender: TObject; const OldURL: string; |
| | | var NewURL: string; var AllowRedirection: Boolean); |
| | | private |
| | | { Private declarations } |
| | | HotKeyId1,HotKeyId2,HotKeyId3,HotKeyId4 :Integer; |
| | |
| | | CaseDocNoList : TStringlist; //案件裡的DocNo清單(不重複) |
| | | CaseDocNo_CopiesList : TStringlist; //案件裡的DocNo份數清單 |
| | | ContextList : TStringlist; //案件裡的檔案清單 |
| | | AttContextList : TStringlist; //案件裡的附加檔案清單 |
| | | OMRFileList : TStringList; //要OMR檢核的文件(只檢查每種Form的第一頁) |
| | | Cust_DocNoList : TStringlist; //自行定義文件名稱 |
| | | IN_WH_DocNoList : TStringlist; //入庫的文件清單 |
| | |
| | | FJpgCompression:integer;// 20171211 jpg to tif 的壓縮率 |
| | | |
| | | Draging : Boolean; |
| | | |
| | | MDown : Boolean; //20181210 用來判斷滑鼠右鍵要Popupmenu是否有MouseDonw發生 |
| | | |
| | | FEvents: ICB_IMGPSScanXEvents; |
| | | |
| | |
| | | Procedure initkscan; //檢查掃描器的功能 |
| | | procedure LoadImgFile; //載入案件 |
| | | procedure LoadImgFile1; //載入案件 |
| | | procedure LoadAttFile(CaseID:String); //載入附加檔案 |
| | | Procedure DistinctFormCode(CaseID:String); //案件裡的FormCode取出第一頁 |
| | | Function OMRCheckCase(CaseID:String):Boolean; //OMR檢核 |
| | | Procedure OMRErr2ini(CaseID,Reason,FileName,Site,RelaFileName,RelaSite,Anchor,Anchor1:String;Del,Ingnore,Display:Boolean); //OMR檢核失敗寫入ini |
| | |
| | | Procedure SetCaseList(Mode:Char;Index:Integer;text:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetDocNoList(Mode:Char;Index:Integer;CaseNo,DocDir,Copies:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetContextList(Mode:Char;Index:Integer;CaseNo,DocDir,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | Procedure SetAttContextList(Mode:Char;Index:Integer;CaseNo,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | |
| | | |
| | | Function checkCaseOMRDone:Boolean; //檢查案件是否完成OMR檢核 |
| | | Function CheckCaseID_OK:Boolean; //檢查是否有未配號的案件 |
| | | Procedure CreateEmptyCase(Path,CaseID:String); //產生空白案號(重掃件用) |
| | |
| | | function CheckRequiredColumnValues(workno,caseno:String) :Boolean; //20171003 此大類下此案是否檢核必填 |
| | | function logTimeString :String; |
| | | procedure ReduceLogFile ; |
| | | function FindLastestDocDirForPage(CaseID, DocNo, formid: String): String; |
| | | function OMRErrini2ListForLog(CaseID: String):String; |
| | | protected |
| | | { Protected declarations } |
| | | procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override; |
| | |
| | | DocNo_List.Free; //DocNo清單 |
| | | Context_DocnoList.Free; //案件裡的檔案Docno清單 |
| | | ContextList.Free; //案件裡的檔案清單 |
| | | AttContextList.Free; //案件裡的附加檔案清單 |
| | | NowShowFileList.Free; //目前顯示的影像清單 |
| | | NowSelectFileList.Free; //目前被點選的影像清單 |
| | | Cust_DocNoList.Free; //自行定義文件名稱 |
| | |
| | | if TreeView1.Selected.Parent = MyTreeNode1 then |
| | | PreNode2Name:= GetNode2Name(MyTreeNode2); |
| | | ShowText := _Msg('文件歸類中,請稍候'); |
| | | LogFile1.LogToFile(logTimeString+'縮圖 歸類開始'); |
| | | DataLoading(True,True); |
| | | GoAtt := False; |
| | | if (MytreeNode2 <> nil) and (Pos('Attach',MyTreeNode2.Text)>0) then |
| | |
| | | |
| | | //ShowMessage('DocNoNeedDiv(DocNo)='+BoolToStr(DocNoNeedDiv(DocNo),true)); |
| | | //ShowMessage('DocDir='+DocDir); |
| | | |
| | | if DocNoNeedDiv(DocNo) then //要分份數 |
| | | begin |
| | | if ((FormCode2Page(FormID) = '01') and (GetDocDir_Page(NowCaseno,DocDir)>0)) or (DocDir = '') then |
| | |
| | | if FileExists(ImageSavePath + NowCaseno+'\'+DocDir+'\Context.dat') then |
| | | begin |
| | | ST1.LoadFromFile(ImageSavePath + NowCaseno+'\'+DocDir+'\Context.dat'); |
| | | if ISExistImg(ImageSavePath + NowCaseno+'\'+DocDir+'\'+ST1.Strings[0]) then |
| | | if (ST1.Count > 0) and ISExistImg(ImageSavePath + NowCaseno+'\'+DocDir+'\'+ST1.Strings[0]) then //20181210 多增加判斷ST1>0 否則會有機會出現List out of bound Hong |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',DocNo); |
| | | end; |
| | |
| | | DocDir:=DocNo2DocNoDir(ImageSavePath+NowCaseno+'\',DocNo); |
| | | SetDocNoList('A',-1,NowCaseno,DocDir); |
| | | end; } |
| | | LogFile1.LogToFile(logTimeString+'縮圖 FormID='+FormID); |
| | | if Not DirectoryExists(ImageSavePath+NowCaseno+'\'+DocDir) then |
| | | Mkdir(ImageSavePath+NowCaseno+'\'+DocDir); |
| | | ContextList.Clear; |
| | |
| | | end; |
| | | if CustomDocNo = '' then Exit; |
| | | DocDir := CustomDocNo; |
| | | LogFile1.LogToFile(logTimeString+'縮圖 歸類自訂文件 DocDir='+DocDir); |
| | | SavePath := ImageSavePath+NowCaseNo+'\'+DocDir+'\'; |
| | | Str2Dir(SavePath); |
| | | SetDocNoList('A',-1,NowCaseNo,DocDir,'1'); |
| | |
| | | // Exit; |
| | | // end; |
| | | // end; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'縮圖刪除 iISB.FileName='+iISB.FileName); |
| | | DeleteImageFile(ExtractFilePath(iISB.FileName),ExtractFileName(iISB.FileName),NowCaseNo); |
| | | end; |
| | | end; |
| | |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'掃瞄開始'); |
| | | if (FMode = 'RSCAN') or (FMode = 'ESCAN') or (FMode = 'DSCAN') then |
| | | begin |
| | | if NewTreeNode.Count > 0 then |
| | |
| | | ContextList.Clear; |
| | | Try |
| | | StatrTwainScan; |
| | | LogFile1.LogToFile(logTimeString+'掃瞄結束'); |
| | | Except |
| | | Panel1.Enabled := True; |
| | | Panel2.Enabled := True; |
| | |
| | | P,v,v1,v2,ln,i : Integer; |
| | | iDocDir,iDocNo : String; |
| | | begin |
| | | LogFile1.LogToFile(logTimeString+'Tree 按下刪除'); |
| | | if TreeView1.Selected = NewTreeNode then //全刪 //新掃描件 |
| | | begin |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree 全部刪除'); |
| | | If Messagedlg(_Msg('是否刪除所有案件?'),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | |
| | | end |
| | | Else if TreeView1.Selected = MyTreeNode1 then //案件編號 |
| | | begin |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree 案件編號刪除 NowCaseno='+NowCaseno); |
| | | If Messagedlg(Format(_Msg('編號(%s)是否刪除?'),[NowCaseno]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | clearView(1); |
| | | Application.ProcessMessages; |
| | |
| | | ClearView(1); |
| | | Application.ProcessMessages; |
| | | //ShowMessage(NowDocDir); |
| | | LogFile1.LogToFile(logTimeString+'Tree 文件層號刪除 NowDocDir='+NowDocDir); |
| | | if (Length(NowDocDir)=8) or (NowDocDir=AttName) then |
| | | begin |
| | | //ShowMessage('DeleteDocNoFileForESCAN'); |
| | |
| | | Else if TreeView1.Selected = MyTreeNode3 then //FormID層 |
| | | begin |
| | | If Messagedlg(Format(_Msg('文件(%s)是否刪除?'),[NowFormName]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | |
| | | LogFile1.LogToFile(logTimeString+'Tree FormID層號刪除 NowFormCode='+NowFormCode); |
| | | DeleteFormCodeFile(NowCaseNo,NowDocDir,NowFormCode); |
| | | SetRecordEditedDocDir('A',NowCaseNo,NowDocDir); |
| | | DrawDocItem2(MytreeNode1,NowCaseno); |
| | |
| | | begin |
| | | Result:=False; |
| | | ST:=TStringList.Create; |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | //ShowMessage(ST.Text); |
| | | if FileExists(DocNopath+'\Context.dat') then /////20190319 Hong 當有空的Docno目錄時會掛掉,增加這行 |
| | | ST.loadFromfile(DocNopath+'\Context.dat'); |
| | | for I := 0 to ST.Count - 1 do |
| | | begin |
| | | if ISExistImg(DocNopath+ST.Strings[i]) then |
| | |
| | | if (Treeview1.Selected = NewTreeNode) {or (Treeview1.Selected = MyTreeNode1)} then |
| | | begin |
| | | //ShowMessage('NewScanBtnClick'); |
| | | LogFile1.LogToFile(logTimeString+'Tree NewScanBtnClick'); |
| | | NewScanBtnClick(self) |
| | | end |
| | | Else |
| | | begin |
| | | //ShowMessage('AddScanBtnclick'); |
| | | LogFile1.LogToFile(logTimeString+'Tree AddScanBtnclick'); |
| | | AddScanBtnclick(self); |
| | | end; |
| | | end; |
| | |
| | | ISB := TImageScrollBox.Create(self); |
| | | try |
| | | ShowText := _Msg('檔案加入中,請稍候'); |
| | | LogFile1.LogToFile(logTimeString+'檔案加入中開始'); |
| | | DataLoading(True, True); |
| | | If TreeView1.Selected = Nil Then |
| | | Exit; |
| | |
| | | iGraphic_First := TTiffGraphic.Create; |
| | | iGraphic_sec := TTiffGraphic.Create; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | |
| | | //ShowMessage(IntToStr(iGraphic_First.Palette.palNumEntries)); //彩色 會為0 黑白 為2 |
| | | |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); //判斷A3 有用FormID 所以要先辨條碼 |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(ISB.Graphic, MpsBarcodeinf.r180[n]); |
| | | //MpsGetBarcode(iGraphic_First, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | |
| | | iGraphic_First.Assign(ISB.Graphic); |
| | | //有必要的話先把影像轉正 再開始切圖 |
| | | If CheckNeedCrop(iGraphic_First) Then |
| | | Begin |
| | |
| | | //ShowMessage(IntToStr(MpsBarcodeinf.Count)); |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[n]); |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | | //ShowMessage('XXX '+IntToStr(MpsBarcodeinf.Count)); |
| | | FormID := BarCode2FormID; |
| | | //ShowMessage('FormID='+FormID); |
| | | // 取出FormID |
| | |
| | | |
| | | DocNo := FormCode2DocNo(FormID); |
| | | DocDir := FindLastestDocDir(CaseID, DocNo); |
| | | if (FMode='ESCAN') and (FModeName='補件掃描') then |
| | | begin |
| | | DocDir := FindLastestDocDirForPage(CaseID, DocNo,FormID); |
| | | //ShowMessage('DocDir='+DocDir); |
| | | end; |
| | | |
| | | If DocNoNeedDiv(DocNo) Then // 要分份數 |
| | | Begin |
| | | If ((FormCode2Page(FormID) = '01') And |
| | | (GetDocDir_Page(CaseID, DocDir) > 0)) Or (DocDir = '') Then |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + CaseID + '\', DocNo); |
| | | begin |
| | | DocDir := DocNo2DocNoDir(ImageSavePath + CaseID + '\', DocNo); |
| | | end; |
| | | End |
| | | Else // 不分份數 |
| | | Begin |
| | |
| | | |
| | | For n := 1 To MpsBarcodeinf.Count Do |
| | | Begin |
| | | If MpsBarcodeinf.r180[n] <> 0 Then // 依條碼角度轉影像 |
| | | If (MpsBarcodeinf.r180[n] <> 0) and (Length(MpsBarcodeinf.Text[n])=FormIDLength) Then // 依條碼角度轉影像 |
| | | Begin |
| | | Rotate(iGraphic, MpsBarcodeinf.r180[n]); |
| | | MpsGetBarcode(iGraphic, MpsBarcodeinf); |
| | | MpsGetBarcode(ISB_BW.Graphic, MpsBarcodeinf); |
| | | Break; |
| | | End; |
| | | End; |
| | |
| | | begin |
| | | DocListForm := TDocListForm.Create(self); |
| | | try |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類開始'); |
| | | InitialLanguage(DocListForm); //載入多國語言 |
| | | DocListForm.CheckBox1.Visible:=True; |
| | | for i := 1 to FORM_INF_List.Count - 1 do |
| | |
| | | begin |
| | | //歸類到自訂文件 |
| | | NewFormID:=DocListForm.Edit1.Text; |
| | | |
| | | if Trim(DocListForm.Edit1.Text)='' then |
| | | begin |
| | | Showmessage('未輸入文件名稱'); |
| | |
| | | end; |
| | | CustomDocNo := GetNewCustomDocNo(DisplayPath,NewFormID); |
| | | //ShowMessage('CustomDocNo='+CustomDocNo); |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類到自訂文件 CustomDocNo='+CustomDocNo); |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,CustomDocNo+'010101A'); |
| | |
| | | ShowText := _Msg('歸類中,請稍侯'); |
| | | DataLoading(True,True); |
| | | //ShowMessage('NowDocDir='+NowDocDir); |
| | | LogFile1.LogToFile(logTimeString+'Tree 歸類到既有文件 NewFormID='+NewFormID); |
| | | FormIDReplace(NowCaseNo,NowDocDir,NowFormCode,NewFormID); |
| | | |
| | | end; |
| | |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AddAttFileLBClick(Sender: TObject); |
| | | var |
| | | i : Integer; |
| | | Addfile : String; |
| | | begin |
| | | OpenDialog1.Filter := 'PDF files|*.pdf'; |
| | | OpenDialog1.Options := [ofAllowMultiSelect]; |
| | | if OpenDialog1.Execute then |
| | | begin |
| | | ShowText :=_Msg('檔案加入中,請稍候'); |
| | | DataLoading(True,True); |
| | | for i := 0 to OpenDialog1.Files.Count - 1 do |
| | | begin |
| | | AddFile := HTTPEncode(UTF8Encode(ExtractFileName(OpenDialog1.Files.Strings[i]))); |
| | | if FileExists(ImageSavePath+NowCaseno+'\'+AddFile) then |
| | | begin |
| | | if Messagedlg(Format(_msg('%s己存在,是否覆蓋??'),[Addfile]),mtconfirmation,[mbyes,mbcancel],0) = mrcancel Then |
| | | Continue; |
| | | SetAttContextList('D',-1,NowCaseno,AddFile); |
| | | end; |
| | | // AttFileGB.Visible := True; //附加電子檔窗 //20120207楊玉說不在這加電子檔先拿掉 |
| | | // Splitter2.Visible := True; |
| | | CopyFile(Pchar(OpenDialog1.Files.Strings[i]),Pchar(ImageSavePath+NowCaseno+'\'+AddFile),False); |
| | | SetAttContextList('A',-1,NowCaseno,AddFile); |
| | | LoadAttFile(NowCaseno); |
| | | end; |
| | | end; |
| | | DataLoading(False,False); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AddCredit1RGClick(Sender: TObject); |
| | | begin |
| | | if DisplayPath <> '' then |
| | |
| | | ClearErrini(NowCaseno,MyTreeNode1); //清掉檢核記錄 |
| | | SetDocDirtoSelected(MyTreeNode1,FirstDocDir); |
| | | TreeView1Click(self); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AttListBoxClick(Sender: TObject); |
| | | begin |
| | | DelAttFileLB.Enabled := False; |
| | | if AttListBox.ItemIndex >= 0 then |
| | | DelAttFileLB.Enabled := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.AttListBoxDblClick(Sender: TObject); |
| | | var |
| | | AttFile : String; |
| | | begin |
| | | if AttListBox.ItemIndex < 0 then Exit; |
| | | |
| | | AttFile := HTTPEncode(UTF8Encode(AttListBox.Items.Strings[AttListBox.ItemIndex])); |
| | | if FileExists(DisplayPath+AttFile) then |
| | | ShellExecute(Application.Handle,'open',PChar(DisplayPath+AttFile),nil,nil,SW_SHOW) |
| | | else |
| | | Showmessage(Format(_Msg('找不到檔案:%s'),[AttFile])); |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.BtnMouseEnter(Sender: TObject); |
| | |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | |
| | | |
| | | //ShowMessage('WTF'); |
| | | while not iGraphic.IsEmpty do |
| | | begin |
| | | //Application.ProcessMessages; |
| | |
| | | iGraphic.Compression:=tcJPEG; |
| | | iGraphic.JpegQuality:=FJpgCompression; |
| | | end; |
| | | |
| | | PageEnd; |
| | | IF PEFileName <> '' Then |
| | | begin |
| | |
| | | Str2Dir(ScanPath); |
| | | |
| | | ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo); |
| | | //ShowMessage('AA ScanDocDir='+ScanDocDir); |
| | | |
| | | //ShowMessage('BB ScanDocDir='+ScanDocDir); |
| | | if DocNoNeedDiv(DocNo)then //要分份數 |
| | | begin |
| | | //Showmessage(DocNo+#13+FormCode2Page(FormID)+#13+inttostr(GetDocDir_Page(ScanCaseno,ScanDocDir))+#13+ScanDocDir); |
| | |
| | | FormID := NowGuideFormID; |
| | | DocNo := FormCode2DocNo(FormID); |
| | | ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo); |
| | | //ShowMessage('ScanDocDir='+ScanDocDir); |
| | | |
| | | if (FMode='ESCAN') and (FModeName='補件掃描') then //20180207 加入的特殊邏輯 |
| | | begin |
| | | ScanDocDir := FindLastestDocDirForPage(ScanCaseno, DocNo,FormID); |
| | | end; |
| | | |
| | | if (DocNoNeedDiv(DocNo)) then //要分份數 |
| | | begin |
| | | if TreeView1.Selected = MyTreeNode1 then //20170421 掃瞄插頁時選則在案號上才要分份數 選在FormID上就不分份數 |
| | |
| | | X509Certificate: TElX509Certificate; var Validate: Boolean); |
| | | begin |
| | | Validate := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.HTTPSClientRedirection(Sender: TObject; |
| | | const OldURL: string; var NewURL: string; var AllowRedirection: Boolean); |
| | | begin |
| | | AllowRedirection := True; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.EnableImage(v:integer;Sender : TObject); |
| | |
| | | ContextList.LoadFromFile(Path+'Context.dat'); |
| | | Context_DocnoList.LoadFromFile(Path+'Context_DocNo.dat'); |
| | | end; |
| | | |
| | | if FileExists(Path+'CustomDocNo.dat') then |
| | | Cust_DocNoList.LoadFromFile(Path+'CustomDocNo.dat'); |
| | | |
| | |
| | | if HaveMask then |
| | | ZipMaskFile(Path,MaskPath,Path,'MaskImg.zip'); //有遮罩設定的才產生 |
| | | /////壓檔//// |
| | | |
| | | ///檢查上傳的zip大小//// |
| | | FName :=Path+ 'Img.zip'; |
| | | |
| | |
| | | +'&in_doc2='+HTTPEncode(UTF8Encode(In_Doc2)); |
| | | //ShowMessage('SendData='+SendData); |
| | | //ShowMessage(FData+#10#13+Doc_Data); |
| | | //Showmessage('Wait'); |
| | | |
| | | if not upFile(HTTPSClient,FUrl,'service/imgpsc/IMGPSC02/caseupload',SendData,'file',Path+'Img.zip',FReWrite,Memo1,False) then |
| | | begin |
| | | Showmessage(Inttostr(HttpError.HttpErrorCode)+' '+HttpError.HttpReason+'.'); |
| | |
| | | Exit; |
| | | end; |
| | | ////上傳//// |
| | | |
| | | if FMode = 'ESCAN' then //上傳舊件引入檔案 //20140616 原本先搬舊件再搬新件,改為先搬新件再搬舊件 |
| | | begin |
| | | if not TransOldCaseFile(ImageSavePath+CaseID+'\') then |
| | |
| | | Exit; |
| | | end; |
| | | end; |
| | | |
| | | |
| | | |
| | | // 呼叫Server完成 ///// |
| | | {If not CaseComplete(Path,CaseID,MainCase) Then |
| | | begin |
| | |
| | | end; |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.SetAttContextList(Mode:Char;Index:Integer;CaseNo,FileName:String); //'A:加入,I:插入,D:刪除,E:修改' |
| | | var |
| | | i : Integer; |
| | | begin |
| | | AttContextList.Clear; |
| | | if FileExists(ImageSavePath+CaseNo+'\AttContext.dat') then |
| | | AttContextList.LoadFromFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | case Mode of |
| | | 'A':begin |
| | | AttContextList.Add(FileName); |
| | | end; |
| | | 'I':begin |
| | | AttContextList.Insert(Index,FileName); |
| | | end; |
| | | 'E':begin |
| | | AttContextList.Strings[Index] := FileName; |
| | | end; |
| | | 'D':begin |
| | | if Index <> -1 then |
| | | begin |
| | | AttContextList.Delete(Index); |
| | | end |
| | | Else if (text <> '') then |
| | | begin |
| | | for i := 0 to AttContextList.Count - 1 do |
| | | begin |
| | | if FileName = AttContextList.Strings[i] then |
| | | begin |
| | | AttContextList.Delete(i); |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | if AttContextList.Count = 0 then |
| | | DeleteFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | end; |
| | | end; |
| | | if AttContextList.Count > 0 then |
| | | begin |
| | | AttContextList.SaveToFile(ImageSavePath+CaseNo+'\AttContext.dat'); |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.checkCaseOMRDone:Boolean; //檢查案件是否完成OMR檢核 |
| | | var |
| | | i : Integer; |
| | |
| | | try |
| | | NewDocNo := FormCode2DocNo(NewFormID); |
| | | NewDocDir := FindLastestDocDir(CaseID,NewDocNo); |
| | | if NewDocDir = '' then |
| | | |
| | | /////20190319 Hong 原本的程式判斷怪怪的先Mark在下方,改用這段 |
| | | if DocNoNeedDiv(NewDocNo) then //要分份數 |
| | | begin |
| | | if ((FormCode2Page(NewFormID) = '01') and (GetDocDir_Page(CaseID,NewDocDir)>0)) or (NewDocDir = '') then |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end |
| | | else |
| | | begin //20171016 真對補件影響 所加的判斷 |
| | | ST1.Clear; |
| | | if FileExists(ImageSavePath + CaseID+'\'+NewDocDir+'\Context.dat') then |
| | | begin |
| | | ST1.LoadFromFile(ImageSavePath + CaseID+'\'+NewDocDir+'\Context.dat'); |
| | | if (ST1.Count > 0) and ISExistImg(ImageSavePath + CaseID+'\'+NewDocDir+'\'+ST1.Strings[0]) then //20181210 多增加判斷ST1>0 否則會有機會出現List out of bound Hong |
| | | begin |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else //不分份數 |
| | | begin |
| | | if NewDocNo <> '' then |
| | | NewDocDir := NewDocNo |
| | | else //Attach 附件 |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + CaseID+'\',NewDocNo); |
| | | end; |
| | | |
| | | {if NewDocDir = '' then |
| | | begin |
| | | if DocNoNeedDiv(NewDocNo) then |
| | | begin |
| | |
| | | NewDocDir := DocNo2DocNoDir(ImageSavePath + NowCaseno+'\',NewDocNo); |
| | | end; |
| | | end; |
| | | end; |
| | | end; } |
| | | if Not DirectoryExists(ImageSavePath+CaseID+'\'+NewDocDir) then |
| | | begin |
| | | MkDir(ImageSavePath+CaseID+'\'+NewDocDir); |
| | |
| | | FileList.Delete(FileList.IndexOf(ST1.Strings[n])); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else |
| | | if not DocNoAppear(iDocNo) then Continue; //20180925 Hong覺得應該要加這段 |
| | | end; |
| | | |
| | | |
| | |
| | | begin |
| | | Result := ''; //沒找到 |
| | | iCaseID := ''; |
| | | for i := 1 to MpsBarcodeinf.Count-1 do |
| | | for i := 1 to MpsBarcodeinf.Count do //20180920 拿掉-1 |
| | | begin |
| | | if (Length(MpsBarcodeinf.text[i]) = CaseIDLength) then |
| | | begin |
| | |
| | | end; |
| | | if FileExists(SoPath+'Context.dat') then |
| | | ZipFileList.Add(SoPath+'Context.dat'); |
| | | |
| | | AttContextList.Clear; |
| | | if FileExists(SoPath+'ATTContext.dat') then |
| | | AttContextList.LoadFromFile(SoPath+'ATTContext.dat'); |
| | | for n := 0 to AttContextList.Count - 1 do |
| | | begin |
| | | ZipFileList.Add(SoPath+AttContextList.Strings[n]); |
| | | end; |
| | | if FileExists(SoPath+'ATTContext.dat') then |
| | | ZipFileList.Add(SoPath+'ATTContext.dat'); |
| | | |
| | | |
| | | if FileExists(SoPath+'Context_DocNo.dat') then |
| | | ZipFileList.Add(SoPath+'Context_DocNo.dat'); |
| | | if FileExists(SoPath+'scanlist.dat') then |
| | |
| | | |
| | | if FScanColor = 1 then |
| | | begin |
| | | ScanColor := ifGray256 ; |
| | | //ScanColor := ifGray256 ; |
| | | ScanColor := ifBlackWhite; // |
| | | end; |
| | | |
| | | |
| | | if FScanColor = 2 then |
| | | begin |
| | |
| | | begin |
| | | ShowText := _Msg('處理檢核失敗中,請稍候'); |
| | | DataLoading(True,True); |
| | | LogFile1.LogToFile(logTimeString+'處理檢核失敗中開始'); |
| | | ErrlistForm := TErrlistForm.Create(Self); |
| | | RejectCase := False; |
| | | S := TStringlist.Create; |
| | | try |
| | | InitialLanguage(ErrlistForm); |
| | | Application.ProcessMessages; |
| | | ErrlistForm.LogFile1.LogFile:=LogFile1.LogFile; |
| | | ErrlistForm.DeleteBt.Caption := ErrlistForm.DeleteBt.Caption+'(&D)'; |
| | | ErrlistForm.iniPath := ImageSavePath + NowCaseNo+'\upload\'; |
| | | OMRErrini2List(NowCaseno,ErrlistForm); |
| | |
| | | ST1.Add(FileList.Strings[n]); |
| | | end; |
| | | end; |
| | | |
| | | for n := 0 to ST1.Count - 1 do |
| | | begin |
| | | if (FileList.IndexOf(ST1.Strings[n])<>-1) and (not DocNoIs_In_WH(iDocNo)) then |
| | |
| | | FileList.Delete(FileList.IndexOf(ST1.Strings[n])); |
| | | end; |
| | | end; |
| | | end; |
| | | end |
| | | Else |
| | | if not DocNoAppear(iDocNo) then Continue; //20180925 Hong覺得應該加這段 |
| | | |
| | | |
| | | |
| | | LogFile1.LogToFile(logTimeString+'WH_category='+FWH_category+',Is_In_Wh='+FIs_In_Wh+',FileList.Text='+FileList.CommaText); |
| | | if FileList.Count=0 then Continue; |
| | |
| | | if FScanColor = 1 then |
| | | begin |
| | | ScanColor := ifGray256 ; |
| | | ScanGrayCB.Checked:=True; |
| | | end; |
| | | |
| | | if FScanColor = 2 then |
| | |
| | | begin |
| | | ClearView(1); |
| | | PageLV.Clear; |
| | | AttListBox.Items.Clear; |
| | | AddAttFileLB.Enabled := False; |
| | | DelAttFileLB.Enabled := False; |
| | | DisplayPath := ''; |
| | | ClearCaseIndex; |
| | | CaseHelpBtn.Visible := False; |
| | |
| | | GetCase_PageCount(CaseCount,PageCount); |
| | | v := Pos('-',NewTreeNode.Text); |
| | | NewTreeNode.Text := Format(_Msg('%s-共%d筆共%d頁'),[Copy(NewTreeNode.Text,1,v-1),CaseCount,PageCount]); |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.LoadAttFile(CaseID:String); //載入附加檔案 |
| | | var |
| | | AttContextList : TStringlist; |
| | | i : Integer; |
| | | begin |
| | | AttListBox.Clear; |
| | | AttContextList := TStringlist.Create; |
| | | try |
| | | if FileExists(ImageSavePath+CaseID+'\AttContext.dat') then |
| | | begin |
| | | AttContextList.LoadFromFile(ImageSavePath+CaseID+'\AttContext.dat'); |
| | | end; |
| | | for i := 0 to AttContextList.Count - 1 do |
| | | begin |
| | | AttListBox.Items.Add(UTF8Decode(HTTPDEcode(AttContextList.Strings[i]))); |
| | | end; |
| | | finally |
| | | AttContextList.Free; |
| | | end; |
| | | end; |
| | | |
| | |
| | | if FIs_In_Wh <> 'Y' then //不是入庫文件 |
| | | DocNo := 'YYYYY'+Add_Zoo(Ct,3); |
| | | |
| | | if (FMode='ESCAN') and (FWH_category='N') then //20170914 補件下改成非入庫的自定文件 |
| | | if (FMode='ESCAN') and (FWH_category='N') then //20170914 補件下改成非入庫的自定文件 |
| | | begin |
| | | DocNo := 'YYYYY'+Add_Zoo(Ct,3); |
| | | end; |
| | |
| | | finally |
| | | ini.Free; |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.DelAttFileLBClick(Sender: TObject); |
| | | var |
| | | AttFile : String; |
| | | SelectCount : Integer; |
| | | i : Integer; |
| | | begin |
| | | SelectCount := 0; |
| | | for i := 0 to AttListBox.Items.Count - 1 do |
| | | begin |
| | | if AttListBox.Selected[i] then |
| | | inc(SelectCount); |
| | | end; |
| | | if SelectCount = 0 then |
| | | begin |
| | | Showmessage(_Msg('請選擇要刪除的電子檔')); |
| | | Exit; |
| | | end; |
| | | |
| | | if SelectCount > 0 then |
| | | begin |
| | | if Messagedlg(Format(_Msg('是否刪除這%d筆??'),[SelectCount]),MtConfirmation,[mbyes,mbcancel],0) = mrcancel then Exit; |
| | | for i := 0 to AttListBox.Items.Count - 1 do |
| | | begin |
| | | if AttListBox.Selected[i] then |
| | | begin |
| | | AttFile := HTTPEncode(UTF8Encode(AttListBox.Items.Strings[i])); |
| | | DeleteFile(ImageSavePath+NowCaseNo+'\'+AttFile); |
| | | SetAttContextList('D',-1,NowCaseno,AttFile); |
| | | end; |
| | | end; |
| | | end; |
| | | LoadAttFile(NowCaseNo); |
| | | Showmessage(_msg('刪除完成')); |
| | | end; |
| | | |
| | | Procedure TCB_IMGPSScanX.DeleteCustomDocDir(Path,DocNo:String); //刪除自定文件DocNo |
| | |
| | | FileList.Free; |
| | | end; |
| | | end; |
| | | |
| | | Function TCB_IMGPSScanX.FindLastestDocDirForPage(CaseID,DocNo,formid:String):String; //找出最新的DocDir 20180207 排除隱藏的資料夾 |
| | | var |
| | | i,j:integer; |
| | | DocNoList,FileList : TStringlist; |
| | | Imglist: TStringlist; |
| | | DirIsHide:Boolean; |
| | | begin |
| | | Result := ''; |
| | | DocNoList := TStringlist.Create; |
| | | FileList := TStringlist.Create; |
| | | imglist := TStringlist.Create; |
| | | try |
| | | if FileExists(ImageSavePath+CaseID+'\CaseDocNo.dat') then |
| | | DocNoList.LoadFromFile(ImageSavePath+CaseID+'\CaseDocNo.dat'); |
| | | |
| | | for i := DocNoList.Count-1 downto 0 do |
| | | begin |
| | | if Copy(DocNoList.Strings[i],1,length(DocNo)) = DocNo then |
| | | begin |
| | | //ShowMessage(ImageSavePath+CaseID+'\'+DocNoList.Strings[i]); |
| | | if not DocNoIsExistImg(ImageSavePath+CaseID+'\'+DocNoList.Strings[i]+'\') then |
| | | begin |
| | | //ShowMessage('DDDDD'); |
| | | Result := ''; |
| | | Break; |
| | | end |
| | | else |
| | | begin |
| | | Result := DocNoList.Strings[i]; |
| | | Break; |
| | | end; |
| | | end; |
| | | end; |
| | | finally |
| | | DocNoList.Free; |
| | | FileList.Free; |
| | | imglist.Free; |
| | | end; |
| | | |
| | | end; |
| | | |
| | | |
| | | Procedure TCB_IMGPSScanX.Create_Cust_DocDir(CaseID:String); //產生外面傳入的文件代號及自定文件 |
| | | var |
| | |
| | | Function TCB_IMGPSScanX.DocNoAppear(DocNo:String):Boolean; //DocNo是否可出現 |
| | | begin |
| | | Result := True; |
| | | if (((FIs_In_Wh = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or //入庫掃描不看非入庫文件 |
| | | |
| | | {if (((FIs_In_Wh = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or //入庫掃描不看非入庫文件 |
| | | ((FIs_In_Wh = 'N') and (DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') )) {and //非入庫掃描不看入庫文件 |
| | | (Copy(DocNo,1,5)<>'ZZZZZ')} {then |
| | | {Result := False;} |
| | | //20181031 應該要換成下面的判斷比較對,FIs_In_Wh傳空的話才會出全部 |
| | | if (((FIs_In_Wh = 'Y') and ((not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach'))) or //入庫掃描不看非入庫文件 |
| | | ((FIs_In_Wh = 'N') and ((DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') ))) {and //非入庫掃描不看入庫文件 |
| | | (Copy(DocNo,1,5)<>'ZZZZZ')} then |
| | | Result := False; |
| | | |
| | | |
| | | end; |
| | | |
| | |
| | | var |
| | | i,n:Integer; |
| | | OldPath,NewPath,DocDir : String; |
| | | OldFile,NewFile : String; |
| | | OldFile,NewFile,AttFile : String; |
| | | DocNoList,FileList:TStringlist; |
| | | iFileList,iFile_DocNoList :TStringlist; |
| | | iDocDirList : TStringlist; |
| | | iAttFileList : TStringlist; |
| | | begin |
| | | DocNoList := TStringlist.Create; |
| | | FileList := TStringlist.Create; |
| | | iFileList := TStringlist.Create; |
| | | iFile_DocNoList := TStringlist.Create; |
| | | iDocDirList := TStringlist.Create; |
| | | iAttFileList := TStringlist.Create; |
| | | try |
| | | OldPath := ImageSavePath+CaseID+'\'; |
| | | NewPath := ImageSavePath+CaseID+'\Upload\'; |
| | |
| | | end; |
| | | end; |
| | | end; |
| | | OldPath := ImageSavePath+CaseID+'\'; |
| | | if FileExists(OldPath+'AttContext.dat') then |
| | | begin |
| | | iAttFileList.LoadFromFile(OldPath+'AttContext.dat'); |
| | | for n := 0 to iAttFileList.Count - 1 do |
| | | begin |
| | | AttFile := iAttFileList.Strings[n]; |
| | | CopyFile(PWideChar(OldPath+AttFile),PWideChar(NewPath+AttFile),False); |
| | | end; |
| | | iAttFileList.SaveToFile(NewPath+'AttContext.dat'); |
| | | end; |
| | | |
| | | |
| | | iFileList.SaveToFile(NewPath+'Context.dat'); |
| | | iFile_DocNoList.SaveToFile(NewPath+'Context_DocNo.dat'); |
| | |
| | | |
| | | finally |
| | | iFileList.Free; |
| | | iAttFileList.Free; |
| | | iFile_DocNoList.Free; |
| | | DocNoList.Free; |
| | | FileList.Free; |
| | |
| | | var |
| | | i,n : Integer; |
| | | DocDir:String; |
| | | OldFile,NewFile:String; |
| | | OldFile,NewFile,AttFile:String; |
| | | DocNoList,FileList : TStringlist; |
| | | iFileList,iFile_DocDirList :TStringlist; |
| | | iAttFileList :TStringlist; |
| | | AA,AA2,AA3,AA4:Boolean; |
| | | begin |
| | | |
| | |
| | | FileList := TStringlist.Create; |
| | | iFileList := TStringlist.Create; |
| | | iFile_DocDirList := TStringlist.Create; |
| | | iAttFileList := TStringlist.Create; |
| | | try |
| | | //if Not FileExists(SoDir+'Context.dat') then Exit; |
| | | //iFileList.LoadFromFile(SoDir+'Context.dat'); |
| | |
| | | CaseDocNo_CopiesList.SaveToFile(DeDir+'CaseDocNo_Copies.dat'); |
| | | end; |
| | | end;} |
| | | if FileExists(SoDir+'AttContext.dat') then |
| | | begin |
| | | iAttFileList.LoadFromFile(SoDir+'AttContext.dat'); |
| | | for i := 0 to iAttFileList.Count - 1 do |
| | | begin |
| | | AttFile := iAttFileList.Strings[i]; |
| | | CopyFile(PWideChar(SoDir+AttFile),PWideChar(DeDir+AttFile),False); |
| | | end; |
| | | iAttFileList.SaveToFile(DeDir+'AttContext.dat'); |
| | | end; |
| | | |
| | | |
| | | if FMode='ESCAN' then |
| | | begin |
| | |
| | | end; |
| | | end; |
| | | |
| | | function TCB_IMGPSScanX.OMRErrini2ListForLog(CaseID: String): String; |
| | | var |
| | | ini : Tinifile; |
| | | Errcount : Integer; |
| | | Del : Boolean; |
| | | i,j : Integer; |
| | | ST,CaseList:TStringList; |
| | | |
| | | begin |
| | | Result:=''; |
| | | //CaseList.dat |
| | | ST:=TStringList.Create; |
| | | CaseList:=TStringList.Create; |
| | | CaseList.LoadFromFile(ImageSavePath+'CaseList.dat'); |
| | | for I := 0 to CaseList.Count - 1 do |
| | | begin |
| | | ini := Tinifile.Create(ImageSavePath + CaseList.Strings[i]+'\upload\Checkerr.ini'); |
| | | try |
| | | Errcount := ini.ReadInteger('OMRCount','Count',0); |
| | | |
| | | for j := 1 to ErrCount do |
| | | begin |
| | | Del := ini.ReadBool(inttostr(j),'Del',False); //是否被移除了 |
| | | if Not Del then |
| | | begin |
| | | ST.Add(ini.ReadString(inttostr(j),'Reason','')) ; |
| | | end; |
| | | end; |
| | | finally |
| | | ini.Free; |
| | | end; |
| | | end; |
| | | Result:=ST.Text; |
| | | ST.Free; |
| | | CaseList.Free; |
| | | end; |
| | | |
| | | |
| | | Function TCB_IMGPSScanX.DownLanguage:Boolean; //下載多國語言檔 |
| | | begin |
| | | Result := True; // http://192.168.0.101:8080/fbnp/servlet/CWC01?act=getservertime |
| | |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[n],1); |
| | | |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | |
| | | end; |
| | |
| | | if ISB.ZoomPercent > 100 then |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[i],1); |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | end; |
| | | FitPreViewISB; |
| | |
| | | if ISB.ZoomPercent > 100 then |
| | | ISB.AntiAliased := False; |
| | | ISB.LoadFromFile(Path+iDocNo+'\'+ContextList.Strings[i],1); |
| | | DpiResize(ISB.Graphic,36); |
| | | DpiResize(ISB.Graphic,36,False); |
| | | ISB.Redraw(true); |
| | | |
| | | //NowShowFileList.Add(ContextList.Strings[i]); |
| | |
| | | end; |
| | | end; |
| | | //ShowMessage(SendData); |
| | | //ShowMessage(Memo1.Lines.Text); |
| | | |
| | | IF memo1.Lines.Strings[0] <> '0' Then |
| | | begin |
| | | HttpErrStr := _Msg('')+memo1.Lines.Strings[1]+'。'; |
| | |
| | | Panel6.Visible := True; |
| | | Panel21.Visible := True; |
| | | Panel23.Visible := True; |
| | | |
| | | AttFileGB.Visible := True; |
| | | Splitter2.Visible := True; |
| | | ScanDuplexCB.Visible := True; //雙面掃描 |
| | | end |
| | | Else if FMode = 'FSCAN' then |
| | |
| | | Panel6.Visible := True; |
| | | Panel21.Visible := True; |
| | | Panel23.Visible := True; |
| | | AttFileGB.Visible := True; |
| | | Splitter2.Visible := True; |
| | | end; |
| | | DisplayMode(1,1,1,Panel9); |
| | | Application.ProcessMessages; |
| | |
| | | CaseList := TStringList.Create; //記錄掃瞄案件的順序 |
| | | Context_DocnoList := TStringlist.Create; //案件裡的檔案Docno清單 |
| | | ContextList := TStringlist.Create; //案件裡的檔案清單 |
| | | AttContextList := TStringlist.Create; //案件裡的附加檔案清單 |
| | | NoSaveBarCodeList := TStringlist.Create; //不儲存的條碼清單 |
| | | FormID_List := TStringlist.Create; //FormID清單 |
| | | DocNo_List := TStringlist.Create; //DocNo清單 |
| | |
| | | Showmessage(_msg('資訊尚未下載完成,請稍候或重新進入')); |
| | | Exit; |
| | | end; |
| | | LogFile1.LogToFile(logTimeString+'按下上傳'); |
| | | ClearView(1); |
| | | CaseHelpBtn.Visible := False; |
| | | DisplayPath := ''; |
| | |
| | | CreateIn_WH(CaseID); //產生入庫文件文字檔 In_Wh.dat |
| | | Case2upload(CaseID); //產生原影像結構 |
| | | TransPath := ImageSavePath+CaseID+'\Upload\'; |
| | | |
| | | {if FMode = 'ESCAN' then //20140320 yuu說拿掉此檢查 |
| | | begin |
| | | S := TStringlist.Create; |
| | |
| | | if ReCasecount > 0 then |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('無法上傳件【%d】件'),[ReCasecount]); |
| | | if CheckErrCount > 0 then |
| | | begin |
| | | TransMsg := TransMsg + #13#10 + Format(_Msg('檢核失敗件【%d】件,請先點選「案件編號」,再點選「問號」查看錯誤原因'),[CheckErrCount]); |
| | | |
| | | LogFile1.LogToFile(logTimeString+'檢核失敗原因:'+OMRErrini2ListForLog('')); |
| | | end; |
| | | |
| | | if (FMode = 'DSCAN') and (SuccessCount = 1) then |
| | | begin |
| | |
| | | ClearCaseIndex; |
| | | PageLv.Items.Clear; //頁數清單 |
| | | //Panel18.Enabled:= False; |
| | | AttListBox.Items.Clear; |
| | | AddAttFileLB.Enabled := False; |
| | | DelAttFileLB.Enabled := False; |
| | | UseOldCaseLb.Visible := False; |
| | | PM107.Visible := False; //備註功能 |
| | | CaseHelpBtn.Visible := False; //檢核失敗原因鈕 |
| | |
| | | if FileExists(DisplayPath+'CustomDocNo.dat') then |
| | | Cust_DocNoList.LoadFromFile(DisplayPath+'CustomDocNo.dat'); |
| | | end; |
| | | MyTreeNode1.Expand(True); |
| | | MyTreeNode1.Expand(True); |
| | | AddAttFileLB.Enabled := True; |
| | | if FileExists(DisplayPath+'ATTContext.dat') then |
| | | begin |
| | | LoadAttFile(NowCaseno); |
| | | end; |
| | | end |
| | | Else //點在NewTreenode or MyTreenode1 上 |
| | | begin |
| | |
| | | |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.TreeView1MouseDown(Sender: TObject; |
| | | Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
| | | begin |
| | | IF Button = TMouseButton(MbRight) Then |
| | | begin |
| | | MDown := True; |
| | | If TreeView1.GetNodeAt(X,Y) = nil then Exit; |
| | | TreeView1.Selected := TreeView1.GetNodeAt(X,Y); |
| | | end; |
| | | end; |
| | | |
| | | procedure TCB_IMGPSScanX.TreeView1MouseEnter(Sender: TObject); |
| | | begin |
| | | TreeView1.SetFocus; |
| | |
| | | IF Button = TMouseButton(MbRight) Then |
| | | begin |
| | | If TreeView1.GetNodeAt(X,Y) = nil then Exit; |
| | | TreeView1.Selected := TreeView1.GetNodeAt(X,Y); |
| | | TreeView1Click(self); |
| | | TreeView1.PopupMenu.Popup(Mouse.CursorPos.X ,Mouse.CursorPos.Y); |
| | | if MDown then |
| | | begin |
| | | TreeView1Click(self); |
| | | TreeView1.PopupMenu.Popup(Mouse.CursorPos.X ,Mouse.CursorPos.Y); |
| | | end; |
| | | Application.ProcessMessages; //需加這行,不然有些全域變數會沒變到 |
| | | MDown:= False; |
| | | end; |
| | | end; |
| | | |
| | |
| | | OLEMISC_SIMPLEFRAME or OLEMISC_ACTSLIKELABEL, |
| | | tmApartment); |
| | | |
| | | SetLicenseKey('5B4451E676A1D2976FBB0F3BB18341336AF114C80B5ABAE7F6926B1CAF671F44' + |
| | | {SetLicenseKey('5B4451E676A1D2976FBB0F3BB18341336AF114C80B5ABAE7F6926B1CAF671F44' + |
| | | 'BD2F098CCEDA922F6389BFAE398DA6AEE67F97EEA0C17234C20D75C12173DBDA' + |
| | | '594924D56DD8E342F454389C836AD880BB4352CA3BE62C4933B1BA3828E7462C' + |
| | | '60514F2ECDAD322E6128D841F12D24DA00B623106D3F08EBCAA917D8A97CAA34' + |
| | | '3D65F2DA567316457395BF9123EE53DF235D181F191A5712DBB27735284AA92D' + |
| | | '5DFA0C8308308505F384707E900C6063F53F1BFF4C6972607955D1AE517B19D0' + |
| | | '82CDD16301885403AD229D57BAEF98C056F31430861E5F68F339D658D72E1F92' + |
| | | '63899412EC2D07891FE3AFD35F3E4A4390B2F0A8A1BF1B7D6160E5F1CC009B17'); |
| | | '63899412EC2D07891FE3AFD35F3E4A4390B2F0A8A1BF1B7D6160E5F1CC009B17'); } |
| | | SetLicenseKey('4B2CF65E8C2A86CE8A0DD0F6A7DB03BC0B0126168B48AE4C27EBD78CAE75CF0F' + |
| | | 'A612190861E0D99F6FAE3ED97AC1941B5E97843CFFCF705A3787989072D4EB2C' + |
| | | 'AE6CAB3F5B69B86616ACC8A37AD6A2AB21C7BDD5C9AE1EDF9E4193D353805C9A' + |
| | | '403631CE8A3D0803FEBB1BE4C209CE7A63B1298EF080EB34B8628CED567D2B68' + |
| | | 'E777FAC58E2E32B7411FC217A04336231D1E861A93474759DAA6EDF53F6EB632' + |
| | | 'A3055229A52F3053FB844754741409022DDE3DFB19473510F2BE63328E74BE20' + |
| | | 'A6A29AA24878F91ADA9DF8CE1F320AF4DAF58EBF95D9BE761D70EEA274E19475' + |
| | | '1C15948B184264C5C49E60493F3BCD2FFAE2CA8B021D00B96F45550C5F050D8A'); |
| | | |
| | | |
| | | SetLicenseKey('A6A94A8D91B08A9D58F300C0573EA9EF1B9DB0BF69B90E13B958DB4CB6B44F5A' + |