{$INCLUDE t_main.inc} unit u_tree_main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, dxDBTLCl, dxGrClms, StdCtrls, bsSkinCtrls, ComCtrls, dxDBGrid, dxTL, dxDBCtrl, dxCntner, bsSkinTabs, ExtCtrls, dxtree, dxdbtree, jpeg, ToolWin, BusinessSkinForm, ImgList, Menus, DB, ADODB, ActnList,inifiles, Grids, DBGrids, XPMenu ,shellapi, kbmMemTable, dxsbar, OleCtrls, SHDocVw, cxControls, cxSplitter, dxDBTL, Buttons, RxLookup, cxContainer, cxEdit, cxLabel,IdSMTP,IdMessage,IdAttachment, IdAttachmentFile,IdText, wwdbdatetimepicker; Const WM_COMM = WM_APP+100; type Tfrm_tree_main = class(TForm) CoolBar1: TCoolBar; ToolBar1: TToolBar; ToolButton1: TToolButton; ToolButton2: TToolButton; ToolButton7: TToolButton; ToolButton3: TToolButton; ToolButton4: TToolButton; ToolButton11: TToolButton; ToolButton5: TToolButton; ToolButton9: TToolButton; ToolButton6: TToolButton; ToolButton10: TToolButton; ToolButton8: TToolButton; Panel6: TPanel; Panel7: TPanel; Image6: TImage; Viewsmall: TImageList; ViewLarge: TImageList; vtoolbar: TImageList; ImageList1: TImageList; PopupMenu2: TPopupMenu; N9: TMenuItem; N10: TMenuItem; N15: TMenuItem; popView: TPopupMenu; N32: TMenuItem; N31: TMenuItem; N30: TMenuItem; N11: TMenuItem; N12: TMenuItem; N13: TMenuItem; N14: TMenuItem; N7: TMenuItem; N8: TMenuItem; popOper: TPopupMenu; menu_opseae: TMenuItem; menu_opseai: TMenuItem; menu_opair: TMenuItem; menu_opairi: TMenuItem; MMModule: TMainMenu; PopupMenu3: TPopupMenu; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; dsrmodule: TDataSource; qrymodule: TADOStoredProc; popMessage: TPopupMenu; N21: TMenuItem; N22: TMenuItem; N23: TMenuItem; N24: TMenuItem; N25: TMenuItem; N26: TMenuItem; N27: TMenuItem; N28: TMenuItem; N29: TMenuItem; ActionList1: TActionList; Act101: TAction; Act102: TAction; Act103: TAction; Act104: TAction; Act105: TAction; Act111: TAction; Act121: TAction; Act131: TAction; Act1401: TAction; Act151: TAction; Act152: TAction; Act16: TAction; Act20101: TAction; Act211: TAction; Act212: TAction; Act213: TAction; Act214: TAction; Act22: TAction; Act241: TAction; Act242: TAction; Act30101: TAction; Act30102: TAction; Act30103: TAction; Act30104: TAction; Act30117: TAction; Act304: TAction; Act303: TAction; Act155: TAction; Act30201: TAction; Act30202: TAction; Act30203: TAction; Act30204: TAction; Act411: TAction; Act412: TAction; Act413: TAction; Act41401: TAction; Act41402: TAction; Act41403: TAction; Act43: TAction; Act44: TAction; Act441: TAction; Act442: TAction; Act443: TAction; Act444: TAction; Act445: TAction; Act451: TAction; Act452: TAction; Act453: TAction; Act47: TAction; Act49: TAction; Act48: TAction; Act51: TAction; Act521: TAction; Act522: TAction; Act523: TAction; Act524: TAction; Act525: TAction; Act526: TAction; Act5310: TAction; Act5321: TAction; Act5330: TAction; Act5340: TAction; Act5350: TAction; Act5360: TAction; Act5370: TAction; Act5380: TAction; Act541: TAction; Act542: TAction; Act543: TAction; Act544: TAction; Act545: TAction; Act546: TAction; Act61: TAction; Act62: TAction; Act71: TAction; Act72: TAction; Act73: TAction; Act74: TAction; Act801: TAction; Act80206: TAction; Act804: TAction; Act805: TAction; Act806: TAction; Act807: TAction; Act808: TAction; Act911: TAction; Act912: TAction; Act913: TAction; Act914: TAction; Act921: TAction; Act922: TAction; Act931: TAction; Act932: TAction; Act933: TAction; Act934: TAction; Act935: TAction; Act936: TAction; Act937: TAction; Act938: TAction; Act941: TAction; Act942: TAction; Act943: TAction; Act944: TAction; Act945: TAction; Act946: TAction; Act951: TAction; Act952: TAction; Act953: TAction; Act954: TAction; Act955: TAction; Act956: TAction; Act957: TAction; Act958: TAction; Act959: TAction; Act960: TAction; Act961: TAction; Act962: TAction; Act963: TAction; Act964: TAction; Act965: TAction; Act966: TAction; Act967: TAction; Act968: TAction; Act969: TAction; Act970: TAction; Act971: TAction; Act1009: TAction; Act80201: TAction; Act80202: TAction; Act80203: TAction; Act80204: TAction; Act80205: TAction; Act2001: TAction; Act2002: TAction; Act2003: TAction; Act2004: TAction; Act2005: TAction; Act2006: TAction; Act20102: TAction; Act20103: TAction; Act20104: TAction; Act75: TAction; Act17: TAction; Act939: TAction; Act9391: TAction; Act972: TAction; Act1001: TAction; Act1002: TAction; Act1003: TAction; Act5323: TAction; Act5390: TAction; Act5400: TAction; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; Panel5: TPanel; Panel8: TPanel; Image7: TImage; Label1: TLabel; Label14: TLabel; Label9: TLabel; Label15: TLabel; ListView1: TListView; bsSkinMainMenuBar1: TbsSkinMainMenuBar; bsBusinessSkinForm1: TbsBusinessSkinForm; Act9390: TAction; PopupClose: TPopupMenu; popclose_close: TMenuItem; OpenDialog1: TOpenDialog; p_view: TADOStoredProc; Act515: TAction; Act18: TAction; Act547: TAction; Act548: TAction; Act5381: TAction; Act5382: TAction; Act5383: TAction; Act5384: TAction; Act5391: TAction; Act5392: TAction; Act5401: TAction; Act5402: TAction; Act5403: TAction; Act5404: TAction; Splitter1: TSplitter; Act215: TAction; Act5210: TAction; Act4011: TAction; Act4012: TAction; Act4013: TAction; Act4014: TAction; Act4015: TAction; bsSkinPageControl2: TbsSkinPageControl; tabtree: TbsSkinTabSheet; tabfav: TbsSkinTabSheet; Viewpage: TImageList; dxbar_main: TdxSideBar; ToolButton12: TToolButton; t_sys_module_emp1: TDataSource; t_sys_module_emp: TADOQuery; p_sys_module_emp: TADOStoredProc; qrytmp: TADOQuery; popdxlist: TPopupMenu; N1: TMenuItem; Act307: TAction; Act947: TAction; Act5405: TAction; Act191: TAction; Act192: TAction; Act948: TAction; Act974: TAction; Act78: TAction; Act245: TAction; Act402: TAction; Act549: TAction; Act1010: TAction; Act156: TAction; Act949: TAction; Act491: TAction; Act492: TAction; Act5491: TAction; Act25: TAction; Act308: TAction; ToolButton13: TToolButton; Act815: TAction; Act816: TAction; Act975: TAction; Act5492: TAction; Act976: TAction; Act817: TAction; t: TkbmMemTable; Act5351: TAction; Act493: TAction; Act309: TAction; Act5324: TAction; bsSkinPanel1: TbsSkinPanel; maintree: TdxDBTreeView; cxSplitter1: TcxSplitter; WebBrowser1: TWebBrowser; Act977: TAction; Act416: TAction; Act3001: TAction; Act31001: TAction; Act31002: TAction; Act31003: TAction; Act31004: TAction; Act19901: TAction; Act980: TAction; Act981: TAction; Act30118: TAction; Act4020: TAction; Act157: TAction; Act158: TAction; Act982: TAction; Act200: TAction; Act978: TAction; Act979: TAction; Act1082: TAction; Act9392: TAction; Act494: TAction; Act3003: TAction; Act216: TAction; Act9331: TAction; Act482: TAction; Act201: TAction; Act202: TAction; Act483: TAction; Act246: TAction; Act312: TAction; Act313: TAction; Act20308: TAction; ToolButton14: TToolButton; PopView_Load: TPopupMenu; N33: TMenuItem; N20: TMenuItem; N17: TMenuItem; N18: TMenuItem; N19: TMenuItem; Act5406: TAction; Act9501: TAction; Act1901: TAction; Act5411: TAction; Act1902: TAction; Act1903: TAction; Act1904: TAction; Act1905: TAction; Act1906: TAction; Act1911: TAction; Act1912: TAction; Act1915: TAction; Act495: TAction; pnl1: TPanel; spl1: TSplitter; dsTask: TDataSource; qry1task: TADOQuery; btnRereshTask: TSpeedButton; pnl2_taskLeft: TPanel; pnl3: TPanel; btn1: TSpeedButton; tv1: TTreeView; pnl4: TPanel; pnl5: TPanel; dxdbgrd1_task: TdxDBGrid; dxdbgrdclmndxdbgrd1Column1: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column4: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column2: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column3: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column5: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column6: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column7: TdxDBGridColumn; dxdbgrdclmndxdbgrd1Column8: TdxDBGridColumn; dxdbgrdchckclmndxdbgrd1Column9: TdxDBGridCheckColumn; dxdbgrdbtnclmndxdbgrdhyprlnkclmndxdbgrd1Column10: TdxDBGridButtonColumn; tlb1: TToolBar; btn1ZB: TToolButton; btn2VC: TToolButton; il1: TImageList; lbl1: TLabel; cxspltr1: TcxSplitter; qry2TaskType: TADOQuery; il2: TImageList; il2_taskmenu: TImageList; pm1_tsk_vcMenu: TPopupMenu; mni_tskN2Forword: TMenuItem; mni_tskN2OkFinish: TMenuItem; pm1_tsk_orMenu: TPopupMenu; mni_tskor_N1Ok: TMenuItem; mni_tskor_N3Cancel: TMenuItem; dxdbgrdtclmndxdbgrd1_taskColumn11: TdxDBGridDateColumn; qry_op_file_items: TADOQuery; dxdbgrdclmndxdbgrd1_taskColumn12: TdxDBGridColumn; cxlbl1: TcxLabel; RxDBLookupCombo57: TRxDBLookupCombo; Editedwtdw: TEdit; dxdbgrdclmndxdbgrd1_taskColumn13: TdxDBGridColumn; lbl2: TLabel; lbl3: TLabel; img1: TImage; mni_tskor_N2Finish: TMenuItem; N16: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; pm1_tsk_swMenu: TPopupMenu; MenuItem1: TMenuItem; MenuItem2: TMenuItem; mni3_swFinish: TMenuItem; MenuItem4: TMenuItem; mni3_swCancel: TMenuItem; btn3SW: TToolButton; N37: TMenuItem; mni3_swPENDING: TMenuItem; qry_op_seae: TADOQuery; mailSend: TkbmMemTable; strngfldSendStringField: TStringField; strngfldSendField: TStringField; strngfldSendField2: TStringField; strngfldSendField3: TStringField; strngfldSendField4: TStringField; strngfldSendField5: TStringField; strngfldSendField6: TStringField; strngfldSendField7: TStringField; dxdbgrdclmndxdbgrd1_taskColumn15: TdxDBGridColumn; dxdbgrdchckclmndxdbgrdclmndxdbgrd1_taskColumn14: TdxDBGridCheckColumn; mni_tskN2Cancel: TMenuItem; btn4_ReAssignTask: TToolButton; btn5AlertOk: TToolButton; btn6_Invoic: TToolButton; pm4_Invoice: TPopupMenu; mni4_OK: TMenuItem; mni2: TMenuItem; mni4_PENDING: TMenuItem; mni4: TMenuItem; mni4_CANCEL: TMenuItem; wdbdtmpckr1: TwwDBDateTimePicker; wdbdtmpckr2: TwwDBDateTimePicker; lbl4: TLabel; lbl5: TLabel; wdbdtmpckr2_finish: TwwDBDateTimePicker; wdbdtmpckr1_finish: TwwDBDateTimePicker; btn7_BCBABCL: TToolButton; pm5_BcBaBcl: TPopupMenu; mni5_forword: TMenuItem; mni3: TMenuItem; mni5_OK: TMenuItem; mni6: TMenuItem; mni5_PENDING: TMenuItem; mni8: TMenuItem; mni5_CANCEL: TMenuItem; btn2: TToolButton; dxdbgrdtclmndxdbgrd1_taskColumn16: TdxDBGridDateColumn; pm1_reAssignTsk: TPopupMenu; mniN4_tskAss_rematch: TMenuItem; mniN4_tskAss_subRematch: TMenuItem; Act516: TAction; ToolButton15: TToolButton; dxdbgrd1_taskColumn17: TdxDBGridColumn; Act551: TAction; btn1VGM: TToolButton; pm1_tsk_VgmMenu: TPopupMenu; MenuItem3: TMenuItem; MenuItem5: TMenuItem; MenuItem8: TMenuItem; Act111001: TAction; Act9502: TAction; Act9503: TAction; Act9504: TAction; Act111002: TAction; Act111004: TAction; Act111005: TAction; Act497: TAction; Act499: TAction; Act2502: TAction; ToolButton16: TToolButton; Act5209: TAction; ToolButton17: TToolButton; pm_ysjh: TPopupMenu; MenuItem6: TMenuItem; MenuItem7: TMenuItem; MenuItem9: TMenuItem; Act418: TAction; Act9393: TAction; Act9505: TAction; bsSkinButton1: TbsSkinButton; qry_op_seae1: TDataSource; Act9506: TAction; Act9507: TAction; Act5493: TAction; Act5211: TAction; Act4991: TAction; Act4992: TAction; dxdbgrd1_taskColumn18: TdxDBGridColumn; Act4302: TAction; Act5365: TAction; procedure N9Click(Sender: TObject); procedure N15Click(Sender: TObject); procedure maintreeChange(Sender: TObject; Node: TTreeNode); procedure maintreeDblClick(Sender: TObject); procedure N32Click(Sender: TObject); procedure N31Click(Sender: TObject); procedure N11Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N13Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure menu_opseaeClick(Sender: TObject); procedure menu_opseaiClick(Sender: TObject); procedure menu_opairClick(Sender: TObject); procedure menu_opairiClick(Sender: TObject); procedure N3Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure ToolButton1Click(Sender: TObject); procedure ToolButton2Click(Sender: TObject); procedure N21Click(Sender: TObject); procedure N23Click(Sender: TObject); procedure N25Click(Sender: TObject); procedure N27Click(Sender: TObject); procedure N29Click(Sender: TObject); procedure ListView1DblClick(Sender: TObject); procedure ToolButton5Click(Sender: TObject); procedure Act801Execute(Sender: TObject); procedure Act80206Execute(Sender: TObject); procedure Act804Execute(Sender: TObject); procedure Act805Execute(Sender: TObject); procedure Act806Execute(Sender: TObject); procedure Act807Execute(Sender: TObject); procedure Act808Execute(Sender: TObject); procedure Act80201Execute(Sender: TObject); procedure Act80202Execute(Sender: TObject); procedure Act80203Execute(Sender: TObject); procedure Act80204Execute(Sender: TObject); procedure Act80205Execute(Sender: TObject); procedure Act51Execute(Sender: TObject); procedure Act43Execute(Sender: TObject); procedure Act44Execute(Sender: TObject); procedure Act47Execute(Sender: TObject); procedure Act49Execute(Sender: TObject); procedure Act48Execute(Sender: TObject); procedure Act541Execute(Sender: TObject); procedure Act542Execute(Sender: TObject); procedure Act543Execute(Sender: TObject); procedure Act544Execute(Sender: TObject); procedure Act545Execute(Sender: TObject); procedure Act546Execute(Sender: TObject); procedure Act941Execute(Sender: TObject); procedure Act942Execute(Sender: TObject); procedure Act943Execute(Sender: TObject); procedure Act944Execute(Sender: TObject); procedure Act945Execute(Sender: TObject); procedure Act946Execute(Sender: TObject); procedure ToolButton8Click(Sender: TObject); procedure Act921Execute(Sender: TObject); procedure Act922Execute(Sender: TObject); procedure Act101Execute(Sender: TObject); procedure Act102Execute(Sender: TObject); procedure Act103Execute(Sender: TObject); procedure Act104Execute(Sender: TObject); procedure Act105Execute(Sender: TObject); procedure Act111Execute(Sender: TObject); procedure Act121Execute(Sender: TObject); procedure Act131Execute(Sender: TObject); procedure Act1401Execute(Sender: TObject); procedure Act151Execute(Sender: TObject); procedure Act152Execute(Sender: TObject); procedure Act16Execute(Sender: TObject); procedure Act155Execute(Sender: TObject); procedure Act17Execute(Sender: TObject); procedure Act5310Execute(Sender: TObject); procedure Act5321Execute(Sender: TObject); procedure Act5330Execute(Sender: TObject); procedure Act5340Execute(Sender: TObject); procedure Act5350Execute(Sender: TObject); procedure Act5360Execute(Sender: TObject); procedure Act5370Execute(Sender: TObject); procedure Act5380Execute(Sender: TObject); procedure Act5323Execute(Sender: TObject); procedure Act5390Execute(Sender: TObject); procedure Act5400Execute(Sender: TObject); procedure Act951Execute(Sender: TObject); procedure Act952Execute(Sender: TObject); procedure Act953Execute(Sender: TObject); procedure Act954Execute(Sender: TObject); procedure Act955Execute(Sender: TObject); procedure Act956Execute(Sender: TObject); procedure Act957Execute(Sender: TObject); procedure Act958Execute(Sender: TObject); procedure Act959Execute(Sender: TObject); procedure Act960Execute(Sender: TObject); procedure Act961Execute(Sender: TObject); procedure Act962Execute(Sender: TObject); procedure Act963Execute(Sender: TObject); procedure Act964Execute(Sender: TObject); procedure Act965Execute(Sender: TObject); procedure Act966Execute(Sender: TObject); procedure Act967Execute(Sender: TObject); procedure Act968Execute(Sender: TObject); procedure Act969Execute(Sender: TObject); procedure Act970Execute(Sender: TObject); procedure Act971Execute(Sender: TObject); procedure Act972Execute(Sender: TObject); procedure Act411Execute(Sender: TObject); procedure Act412Execute(Sender: TObject); procedure Act413Execute(Sender: TObject); procedure Act41401Execute(Sender: TObject); procedure Act41402Execute(Sender: TObject); procedure Act41403Execute(Sender: TObject); procedure Act931Execute(Sender: TObject); procedure Act932Execute(Sender: TObject); procedure Act933Execute(Sender: TObject); procedure Act934Execute(Sender: TObject); procedure Act935Execute(Sender: TObject); procedure Act936Execute(Sender: TObject); procedure Act937Execute(Sender: TObject); procedure Act938Execute(Sender: TObject); procedure Act939Execute(Sender: TObject); procedure Act9391Execute(Sender: TObject); procedure Act1009Execute(Sender: TObject); procedure Act1001Execute(Sender: TObject); procedure Act1002Execute(Sender: TObject); procedure Act1003Execute(Sender: TObject); procedure Act451Execute(Sender: TObject); procedure Act452Execute(Sender: TObject); procedure Act453Execute(Sender: TObject); procedure Act2001Execute(Sender: TObject); procedure Act2002Execute(Sender: TObject); procedure Act2003Execute(Sender: TObject); procedure Act2004Execute(Sender: TObject); procedure Act2005Execute(Sender: TObject); procedure Act2006Execute(Sender: TObject); procedure Act71Execute(Sender: TObject); procedure Act72Execute(Sender: TObject); procedure Act73Execute(Sender: TObject); procedure Act74Execute(Sender: TObject); procedure Act75Execute(Sender: TObject); procedure Act911Execute(Sender: TObject); procedure Act912Execute(Sender: TObject); procedure Act913Execute(Sender: TObject); procedure Act914Execute(Sender: TObject); procedure Act521Execute(Sender: TObject); procedure Act522Execute(Sender: TObject); procedure Act523Execute(Sender: TObject); procedure Act524Execute(Sender: TObject); procedure Act525Execute(Sender: TObject); procedure Act526Execute(Sender: TObject); procedure Act30117Execute(Sender: TObject); procedure Act304Execute(Sender: TObject); procedure Act303Execute(Sender: TObject); procedure Act441Execute(Sender: TObject); procedure Act442Execute(Sender: TObject); procedure Act443Execute(Sender: TObject); procedure Act444Execute(Sender: TObject); procedure Act445Execute(Sender: TObject); procedure Act241Execute(Sender: TObject); procedure Act242Execute(Sender: TObject); procedure Act20101Execute(Sender: TObject); procedure Act211Execute(Sender: TObject); procedure Act212Execute(Sender: TObject); procedure Act213Execute(Sender: TObject); procedure Act214Execute(Sender: TObject); procedure Act22Execute(Sender: TObject); procedure Act20102Execute(Sender: TObject); procedure Act20103Execute(Sender: TObject); procedure Act20104Execute(Sender: TObject); procedure Act30201Execute(Sender: TObject); procedure Act30202Execute(Sender: TObject); procedure Act30203Execute(Sender: TObject); procedure Act30204Execute(Sender: TObject); procedure Act30101Execute(Sender: TObject); procedure Act30102Execute(Sender: TObject); procedure Act30103Execute(Sender: TObject); procedure Act30104Execute(Sender: TObject); procedure Act61Execute(Sender: TObject); procedure Act62Execute(Sender: TObject); procedure FormShow(Sender: TObject); procedure ToolButton6Click(Sender: TObject); procedure Act9390Execute(Sender: TObject); procedure bsSkinPageControl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure popclose_closeClick(Sender: TObject); procedure ToolButton11Click(Sender: TObject); procedure Act515Execute(Sender: TObject); procedure Act18Execute(Sender: TObject); procedure Act547Execute(Sender: TObject); procedure Act548Execute(Sender: TObject); procedure Act5381Execute(Sender: TObject); procedure Act5382Execute(Sender: TObject); procedure Act5383Execute(Sender: TObject); procedure Act5384Execute(Sender: TObject); procedure Act5391Execute(Sender: TObject); procedure Act5392Execute(Sender: TObject); procedure Act5401Execute(Sender: TObject); procedure Act5402Execute(Sender: TObject); procedure Act5403Execute(Sender: TObject); procedure Act5404Execute(Sender: TObject); procedure Act215Execute(Sender: TObject); procedure Act5210Execute(Sender: TObject); procedure Act4011Execute(Sender: TObject); procedure Act4012Execute(Sender: TObject); procedure Act4013Execute(Sender: TObject); procedure Act4014Execute(Sender: TObject); procedure Act4015Execute(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinPageControl2Change(Sender: TObject); procedure ToolButton12Click(Sender: TObject); procedure dxbar_mainItemClick(Sender: TObject; Item: TdxSideBarItem); procedure N1Click(Sender: TObject); procedure Act307Execute(Sender: TObject); procedure Act947Execute(Sender: TObject); procedure Act5405Execute(Sender: TObject); procedure Act191Execute(Sender: TObject); procedure Act192Execute(Sender: TObject); procedure Act948Execute(Sender: TObject); procedure Act974Execute(Sender: TObject); procedure Act78Execute(Sender: TObject); procedure Act245Execute(Sender: TObject); procedure Act402Execute(Sender: TObject); procedure Act549Execute(Sender: TObject); procedure Act1010Execute(Sender: TObject); procedure Act156Execute(Sender: TObject); procedure Act949Execute(Sender: TObject); procedure Act491Execute(Sender: TObject); procedure Act492Execute(Sender: TObject); procedure Act5491Execute(Sender: TObject); procedure Act25Execute(Sender: TObject); procedure Act308Execute(Sender: TObject); procedure Act815Execute(Sender: TObject); procedure Act816Execute(Sender: TObject); procedure Act975Execute(Sender: TObject); procedure Act5492Execute(Sender: TObject); procedure Act976Execute(Sender: TObject); procedure Act817Execute(Sender: TObject); procedure Act5351Execute(Sender: TObject); procedure Act493Execute(Sender: TObject); procedure Act309Execute(Sender: TObject); procedure Act5324Execute(Sender: TObject); procedure Act977Execute(Sender: TObject); procedure WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); procedure Act416Execute(Sender: TObject); procedure Act3001Execute(Sender: TObject); procedure Act31001Execute(Sender: TObject); procedure Act31002Execute(Sender: TObject); procedure Act31003Execute(Sender: TObject); procedure Act31004Execute(Sender: TObject); procedure Act19901Execute(Sender: TObject); procedure Act980Execute(Sender: TObject); procedure Act981Execute(Sender: TObject); procedure Act30118Execute(Sender: TObject); procedure Act4020Execute(Sender: TObject); procedure Act157Execute(Sender: TObject); procedure Act158Execute(Sender: TObject); procedure Act982Execute(Sender: TObject); procedure Act200Execute(Sender: TObject); procedure Act978Execute(Sender: TObject); procedure Act979Execute(Sender: TObject); procedure Act1082Execute(Sender: TObject); procedure Act9392Execute(Sender: TObject); procedure Act494Execute(Sender: TObject); procedure Act216Execute(Sender: TObject); procedure Act9331Execute(Sender: TObject); procedure Act482Execute(Sender: TObject); procedure Act201Execute(Sender: TObject); procedure Act483Execute(Sender: TObject); procedure Act202Execute(Sender: TObject); procedure Act312Execute(Sender: TObject); procedure Act246Execute(Sender: TObject); procedure Act313Execute(Sender: TObject); procedure Act20308Execute(Sender: TObject); procedure ToolButton14Click(Sender: TObject); procedure N33Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N18Click(Sender: TObject); procedure N19Click(Sender: TObject); procedure Act5406Execute(Sender: TObject); procedure Act9501Execute(Sender: TObject); procedure Act1901Execute(Sender: TObject); procedure Act5411Execute(Sender: TObject); procedure actAct1902Execute(Sender: TObject); procedure Act1903Execute(Sender: TObject); procedure Act1904Execute(Sender: TObject); procedure Act1905Execute(Sender: TObject); procedure Act1906Execute(Sender: TObject); procedure Act1911Execute(Sender: TObject); procedure Act1912Execute(Sender: TObject); procedure Act1915Execute(Sender: TObject); procedure Act495Execute(Sender: TObject); procedure btnRereshTaskClick(Sender: TObject); procedure dxdbgrd2CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); procedure tv1Changing(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); procedure rzgrp1_PersonItems0Click(Sender: TObject); procedure tv1Change(Sender: TObject; Node: TTreeNode); procedure dxdbgrd1_taskDblClick(Sender: TObject); procedure EditedwtdwKeyPress(Sender: TObject; var Key: Char); procedure btn4_ReAssignTaskClick(Sender: TObject); procedure mni_tskor_N2FinishClick(Sender: TObject); procedure mni_tskor_N3CancelClick(Sender: TObject); procedure mni_tskor_N1OkClick(Sender: TObject); procedure mni_tskN2ForwordClick(Sender: TObject); procedure mni3_swPENDINGClick(Sender: TObject); procedure btn5AlertOkClick(Sender: TObject); procedure mniN4_tskAss_rematchClick(Sender: TObject); procedure mniN4_tskAss_subRematchClick(Sender: TObject); procedure Act516Execute(Sender: TObject); procedure ToolButton15Click(Sender: TObject); procedure Act550Execute(Sender: TObject); procedure Act551Execute(Sender: TObject); procedure dxdbgrd1_taskColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure Act111001Execute(Sender: TObject); procedure Act9502Execute(Sender: TObject); procedure Act9503Execute(Sender: TObject); procedure Act9504Execute(Sender: TObject); procedure Act111002Execute(Sender: TObject); procedure Act111004Execute(Sender: TObject); procedure Act111005Execute(Sender: TObject); procedure Act497Execute(Sender: TObject); procedure Act499Execute(Sender: TObject); procedure Act2502Execute(Sender: TObject); procedure ToolButton16Click(Sender: TObject); procedure Act5209Execute(Sender: TObject); procedure MenuItem6Click(Sender: TObject); procedure MenuItem9Click(Sender: TObject); procedure Act418Execute(Sender: TObject); procedure Act9393Execute(Sender: TObject); procedure Act9505Execute(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure Act9506Execute(Sender: TObject); procedure Act9507Execute(Sender: TObject); procedure Act5493Execute(Sender: TObject); procedure Act5211Execute(Sender: TObject); procedure Act4991Execute(Sender: TObject); procedure Act4992Execute(Sender: TObject); procedure Act4302Execute(Sender: TObject); procedure Act5365Execute(Sender: TObject); private { Private declarations } CloseSheet:TTabSheet ; bliNitialOk:Boolean;//是否初始化完毕 function getpname(pid:integer):TMenuItem ; procedure addlv(myid: integer); procedure addlvemp(myid: integer); procedure dellvemp(myid: integer); procedure addLVcolumn ; procedure adddx; procedure Addmenu ; procedure menuclick(Sender: TObject) ; procedure SaveView(skinName:string); function delmenu(menu:TMenuItem):boolean; procedure initialTaskType(); procedure bindtaskdata(); procedure UpLoadProFile(fname,RemotePathName,Users,pw,mblNo,bsno:string;fid:integer;filetype:string); procedure updateGuadanFilecount(fid:Integer;bsno:string); procedure taskFinish( Ofiletype:string ); // 线程结束执行,线程任务执行在mythread里调用 procedure MyOnTerminate(Sender: TObject); //BC/BA分单挂单 function AssignPub_ORIGINAL_SEAWAY_VC():Boolean; public { Public declarations } function freesheeet:boolean ; procedure replmenu ; function Guadan(mainNo,bsno,filetype,filename_src:string):boolean; //分单挂单 function Guadan_2(mainNo,bsno,filetype,filename_src:string;isFendan:Boolean;subNo:string):boolean; function ConnectDownServer():Boolean; //连接Nass cjb 2017-11 function sendmail( mailSendTbl: TkbmMemTable;mailtype,bsno:string;ishtml:Boolean):Boolean; function sendmailQue( mailSendTbl: TADOQuery):Boolean; function checkGuadanTimes( str:string):Boolean;//2017-12-06 //邮件队列发送 function sendmailBatch(taskqueNo:string ): Integer; //stdcall; end; MYPARA=record QNo: pchar; QType: pchar; end; PMYPARA=^MYPARA; var frm_tree_main: Tfrm_tree_main; implementation uses u_data_share,u_info_tell, u_sys_message_pri, u_main, my_sys_function, u_rp_dui_accepttotal, U_ch_prnFee, {$IFDEF PZJIEKOU} u_cw_pingzheng, {$ENDIF} {$IFDEF QTFEIYONG} u_op_fee, {$ENDIF} {$IFDEF YWTAIZHANG} u_rp_tai_total,u_rp_tai_seae_pin, {$ENDIF} u_rp_fee_modify, u_rp_ch_balance_accept, u_rp_ch_balance_pay, u_rp_ch_balance_rate, u_rp_ch_currency_change, {$IFDEF FYZHUANGTAI} u_rp_ch_fee_state, {$ENDIF} u_sys_parameters, u_code_empty, u_code_subcomp, u_sys_close, u_sys_dep_emp, u_sys_limited, u_op_seae, {$IFDEF PXHUANHUO}u_op_seae_huanhuo,{$ENDIF} u_op_seae_vessel_change, {$IFDEF QDQUEREN}u_op_seae_qiandan,{$ENDIF} u_op_seae_qiandan_add, u_op_seai, {$IFDEF JGCHE}{$ENDIF} {$IFDEF SJBAOGUAN}u_op_seae_apply, u_op_seai_apply, u_op_apply,{$ENDIF} u_op_seae_card, {$IFDEF TSQUEREN}u_op_seae_tuishui,{$ENDIF} u_op_delete, u_rp_rp_seae_pin, u_rp_rp_total, {$IFDEF ZHYDTONGJI}u_rp_rp_monthtotal,{$ENDIF} {$IFDEF ZHMXTONGJI}u_rp_ch_total,{$ENDIF} {$IFDEF ZHZIYOU}u_rp_chfree_total,{$ENDIF} {$IFDEF GYSHANG}u_rp_truck_no, u_rp_apply_no,{$ENDIF} u_rp_zou_total, u_rp_rp_seae, u_rp_fen_total, u_code_ctn_kind, u_code_ctn, u_code_goods, u_code_package, u_code_tiaokuan, u_code_country, u_code_port, u_code_trade, u_code_vessel, {$IFDEF EDI}u_code_line_edi, {$ENDIF} u_code_signbill, u_code_items, u_code_code, u_code_send_head, u_code_card, {$IFDEF ZTGENGZONG}u_code_state, {$ENDIF} u_code_source, u_code_opresult, {$IFDEF FPSHENQING}u_ch_invoice_shen,u_ch_invoice_check,{$ENDIF} u_ch_invoice, u_rp_in_ch, u_rp_in_fenlei, u_rp_in_total, u_code_currency, u_code_fee_type, u_code_fee, u_code_fee_project, u_code_free, u_code_fee_color, {$IFDEF PZJIEKOU} u_cw_design, u_cw_kemu, {$ENDIF} u_code_UsdExRate, u_info_card, {$IFDEF FFLIUCHENG}u_ch_check_shen, u_ch_check_check,{$ENDIF} u_ch_balance_pay, u_sys_employee, u_info_tell_manage, u_crm_client, {$IFDEF KHGUANLI}u_code_price,u_rp_crm_credit,u_code_customstatu,U_sys_crm_params,u_crm_client_report, u_crm_client_sales,u_code_client_parameter,{$ENDIF} u_sys_company, u_code_print_head, u_sys_bank, u_rp_no_total, {$IFDEF QFFZZONGHE} u_rp_ch_clienttotal, {$ENDIF} U_rp_fee_outamt, u_rp_zl_total, {$IFDEF QFZOUSHI} u_rp_no_zou, {$ENDIF} {$IFDEF SFLIUCHENG} u_ch_accept_shen, u_ch_balance_accept_deng, u_ch_balance_accept_hexiao, u_ch_balance_accept_check, {$ENDIF} u_ch_balance_accept, {$IFDEF XSGUANLI} u_rp_sales_profit, u_rp_sales_profitLcx,u_ch_fee_sea_sales,u_ch_fee_seai_sales, u_rp_sales_profit_lx,u_sys_sale_profitset, {$ENDIF} {$IFDEF YWFUHE} u_ch_fee_Recheck_seae, u_ch_fee_Recheck_seai,{$ENDIF} u_ch_fee_check_seae, u_ch_fee_check_seai, {$IFDEF ZJFENXI}u_rp_zj_total, u_rp_zj_zou,{$ENDIF} u_sys_module, u_chrat_message, {$IFDEF DLFENZHANG}u_rp_rp_sea_daili,u_code_fee_project_cargomainfest,u_code_fee_project_agent,u_rp_fenzhang,{$ENDIF} u_rp_dui_accept, {$IFDEF TBQITA} u_rp_zou_seae, u_rp_zou_seai, u_rp_fen_seae, u_rp_fen_seai,u_rp_fen_seae_ctn, {$ENDIF} u_rp_dui_pay, u_rp_yunjia_seae, u_rp_yunfeibl_seae, {$IFDEF WLZHANG} u_rp_ch_genleg,u_ch_genleg,AccCloseOffu, AccCloseOffBacku,u_rp_wl_total, {$ENDIF} u_info_bunk, {$IFDEF QFYDFENXI}u_rp_no_monthtotal,{$ENDIF} u_op_seae_close, u_op_seai_close, u_sys_dxbar_sort, u_op_seae_unlock, u_sys_printset, u_rp_hl_histry, u_sys_noset, u_code_port_load, u_crm_client_special, {$IFDEF DCKA} u_op_seae_weituo,u_op_seae_order, {$ENDIF} u_sys_about, u_op_seae_tdqr, u_code_zlset, u_code_edi_port, u_rp_ch_balance_detail, u_code_airtrade, u_op_seae_fangdan, u_rp_pin_total, u_code_letter, u_ch_invoice_hexiao, U_op_state_view, u_op_seae_web_order, u_op_seai_order, u_op_seai_fuhui, u_op_truck, u_code_truck_client, u_code_truck_changzhan, u_op_seae_list, u_code_stlmode, u_ch_cust_befbal, u_code_fee_unit, u_op_mblsign, u_op_mblsignin, u_op_seae_teshufandan, u_op_seae_teshushen, u_op_seae_teshufz, u_op_seae_teshusales, u_op_seae_edi_data, u_rp_op_ttl, u_rp_dui_month, crm_OnLineBooking, U_SetCompany, U_SelectLinkMan,U_BookingLog,U_SelectLinkCompany, u_rp_rp_apply, u_rp_cx_total, u_cust_mailproject, u_rp_mail_log, u_rp_cdfxg_total, u_op_seae_sign, u_op_seae_signqtdlist, u_op_seae_signqtdnotify, u_op_seae_invoice_sign,u_op_seae_paper_manage, u_op_seae_paper_print, u_op_seae_paper_print_submitinfo, u_ch_invoice_bankdata,u_rp_tai_tasks,u_op_tftp,u_rp_wy, u_op_seae_TaskContrast, u_sys_progress, u_MyThread, u_ch_fee_edi, u_rp_tai_total_op, u_code_dggoods, u_code_stowgoods, u_code_bangoods, u_op_seae_dg, u_code_fee_project_auto, u_rp_dg_except, u_rp_cdstl, u_cw_pingzheng_jk, u_ch_zlsales, u_op_seae_order_edit, u_op_seae_web_order_edit, u_op_web_cust_audit, u_rp_bssource_total, u_op_seae_web_si_edit, u_info_shareDoc, u_op_seae_ysbg, u_ch_invoice_jk, u_code_goods_inv, u_code_trade_msc, u_op_seae_mscbc, u_code_dgunno, u_code_package_dg, u_rp_nolx_ttl, u_rp_zl_total2, u_op_seae_web_dg_import, u_cw_pingzheng_u8, u_cw_pingzheng_jku8, u_rp_dui_auto; {$R *.dfm} /// /// 临时目录 /// function GetWinTempPath: string; var TempDir: array[0..255] of char; begin GetTempPath(255, @TempDir); Result := strPas(TempDir); end; procedure Tfrm_tree_main.N9Click(Sender: TObject); begin maintree.FullCollapse ; end; procedure Tfrm_tree_main.N15Click(Sender: TObject); begin maintree.FullExpand ; end; procedure Tfrm_tree_main.maintreeChange(Sender: TObject; Node: TTreeNode); var ListItem:Tlistitem; begin if showing then if maintree.Selected.HasChildren then begin ListView1.Items.Clear ; addlv(qrymodule.fieldbyname('fmoduleid').asinteger); end else begin ListView1.Items.Clear ; ListItem:=ListView1.items.Add ; ListItem.Caption:=qrymodule.fieldbyname('模块名称').asstring ; ListItem.SubItems.add(qrymodule.fieldbyname('备注').asstring) ; ListItem.SubItems.add(qrymodule.fieldbyname('fmoduleid').asstring) ; ListItem.ImageIndex:=0 ; end ; end; procedure Tfrm_tree_main.maintreeDblClick(Sender: TObject); var myid,i:integer; myaction: string; begin if maintree.Selected=nil then exit ; if maintree.Selected.HasChildren then exit ; myid:=qrymodule.fieldbyname('fmoduleid').asinteger ; if not vold then begin if myid<>0 then begin { if frm_data_share.memreg.Locate('fmoduleid',myid,[]) then begin if frm_data_share.memreg.fieldbyname('reg').AsInteger=0 then begin MessageDlg('本模块没有注册不能使用!',mtWarning,[mbOk],0); exit; end else if frm_data_share.memreg.fieldbyname('reg').AsInteger=2 then begin i:=frm_main.RegwareII1.DaysLeft; if i<=0 then begin MessageDlg('本模块为试用注册,试用时间已过!',mtWarning,[mbOk],0); exit; end else begin MessageDlg('本模块为试用注册,试用剩余天数为'+inttostr(i)+'天!',mtWarning,[mbOk],0); end; end; end else begin MessageDlg('本模块没有注册不能使用!',mtWarning,[mbOk],0); exit; end; } end; end; myaction:='Act'+inttostr(myid); with ActionList1 do for i:=0 to ActionCount-1 do if Actions[i].Name=myaction then begin Actions[i].Execute ; break ; end ; end; procedure Tfrm_tree_main.N32Click(Sender: TObject); begin Panel6.Visible:=true ; N32.Checked:=true ; N31.Checked:=false ; Panel6.Width:=185 ; end; procedure Tfrm_tree_main.N31Click(Sender: TObject); begin Panel6.Visible:=false ; N32.Checked:=false ; N31.Checked:=true ; end; procedure Tfrm_tree_main.N11Click(Sender: TObject); begin listview1.ViewStyle:=vsicon ; end; procedure Tfrm_tree_main.N12Click(Sender: TObject); begin listview1.ViewStyle:=vssmallicon ; end; procedure Tfrm_tree_main.N13Click(Sender: TObject); begin listview1.ViewStyle:=vslist ; end; procedure Tfrm_tree_main.N14Click(Sender: TObject); begin listview1.ViewStyle:=vsreport ; end; procedure Tfrm_tree_main.N8Click(Sender: TObject); begin Panel6.Width:=185 ; Panel6.Visible:=true ; ListView1.ViewStyle:=vsicon ; end; procedure Tfrm_tree_main.menu_opseaeClick(Sender: TObject); begin Act101.Execute ; end; procedure Tfrm_tree_main.menu_opseaiClick(Sender: TObject); begin Act111.Execute ; end; procedure Tfrm_tree_main.menu_opairClick(Sender: TObject); begin Act121.Execute ; end; procedure Tfrm_tree_main.menu_opairiClick(Sender: TObject); begin Act131.Execute ; end; procedure Tfrm_tree_main.N3Click(Sender: TObject); begin frm_main.bsSkinData1.StoredSkin:=frm_main.bsStoredSkin1 ; saveView('1'); end; procedure Tfrm_tree_main.N4Click(Sender: TObject); begin frm_main.bsSkinData1.StoredSkin:=frm_main.bsStoredSkin2 ; saveView('2'); end; procedure Tfrm_tree_main.N5Click(Sender: TObject); begin frm_main.bsSkinData1.StoredSkin:=frm_main.bsStoredSkin3 ; saveView('3'); end; procedure Tfrm_tree_main.N6Click(Sender: TObject); begin frm_main.bsSkinData1.StoredSkin:=frm_main.bsStoredSkin4 ; saveView('4'); end; procedure Tfrm_tree_main.addlv(myid: integer); var ListItem:Tlistitem; begin with P_View do begin // open ; first ; filter:='pid='+inttostr(myid); filtered:=true ; first ; while not eof do begin ListItem:=ListView1.items.Add ; ListItem.Caption:=fieldbyname('模块名称').asstring ; ListItem.SubItems.add(fieldbyname('备注').asstring) ; ListItem.SubItems.add(fieldbyname('fmoduleid').asstring) ; if fieldbyname('是否明细').AsBoolean then ListItem.ImageIndex:=0 else ListItem.ImageIndex:=1 ; next ; end ; end ; { with qryView do begin open ; first ; while not eof do begin ListItem:=ListView1.items.Add ; ListItem.Caption:=fieldbyname('模块名称').asstring ; ListItem.SubItems.add(fieldbyname('备注').asstring) ; ListItem.SubItems.add(fieldbyname('fmoduleid').asstring) ; if fieldbyname('是否明细').AsBoolean then ListItem.ImageIndex:=0 else ListItem.ImageIndex:=1 ; next ; end ; end ; } end; procedure Tfrm_tree_main.addLVcolumn; var lvcol:TListColumn; begin lvcol:=listview1.Columns.Add(); lvcol.Caption:='运行模块'; lvcol.width:=150; lvcol:=listview1.Columns.Add(); lvcol.Caption:='模块说明'; lvcol.width:=500; lvcol:=listview1.Columns.Add(); lvcol.Caption:='系统代码' ; lvcol.Width:= 50 ; end; procedure Tfrm_tree_main.Addmenu; var NewMenuItem: TMenuItem; HeadMenuItem: TMenuItem; begin with qrymodule do begin disablecontrols ; first ; while not eof do begin NewMenuItem:=TMenuItem.Create(Self); NewMenuItem.Name:='A'+fieldbyname('fmoduleid').asString ; NewMenuItem.Caption:=fieldbyname('模块名称').asstring ; NewMenuItem.Tag:=fieldbyname('fmoduleid').asinteger ; NewMenuItem.OnClick:=menuclick; HeadMenuItem:=getpname(fieldbyname('pid').asinteger) ; if HeadMenuItem=nil then MMModule.Items.Add(NewMenuItem) else HeadMenuItem.add(NewMenuItem); Next ; end ; enablecontrols ; end ; bsSkinMainMenuBar1.UpDateItems ; end; function Tfrm_tree_main.getpname(pid:integer):TMenuItem ; var i, j :integer ; begin if pid=0 then result:=nil else begin for i:=0 to MMModule.Items.Count-1 do begin if MMModule.Items[I].Tag=pid then result:=MMModule.Items[I] else for j:=0 to MMModule.Items[I].Count-1 do begin if MMModule.Items[I].Items[j].Tag=pid then begin result:=MMModule.Items[I].Items[j] ; exit; end else result:=nil ; end ; end ; end ; end ; procedure Tfrm_tree_main.menuclick(Sender: TObject); var i,mid:integer; myid,myaction: string; begin with sender as tmenuitem do mid:=TAG; myid:=inttostr(mid); // myid:=copy(name,2,length(name)) ; // mid:=strtointdef(myid,0); if not vold then begin if mid<>0 then begin if frm_data_share.memreg.Locate('fmoduleid',mid,[]) then begin if frm_data_share.memreg.fieldbyname('reg').AsInteger=0 then begin MessageDlg('本模块没有注册不能使用!',mtWarning,[mbOk],0); exit; end else if frm_data_share.memreg.fieldbyname('reg').AsInteger=2 then begin i:=frm_main.RegwareII1.DaysLeft; if i<=0 then begin MessageDlg('本模块为试用注册,试用时间已过!',mtWarning,[mbOk],0); exit; end else begin MessageDlg('本模块为试用注册,试用剩余天数为'+inttostr(i)+'天!',mtWarning,[mbOk],0); end; end; end else begin end; end; end; myaction:='Act'+myid; with ActionList1 do for i:=0 to ActionCount-1 do if Actions[i].Name=myaction then begin Actions[i].Execute ; break ; end ; end; procedure Tfrm_tree_main.SaveView(skinName: string); var inifile1:Tinifile; begin inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini'); try inifile1.writeString('View','Viewskin',skinName) ; finally inifile1.free; end ; end; procedure Tfrm_tree_main.ToolButton1Click(Sender: TObject); begin qrymodule.Prior ; end; procedure Tfrm_tree_main.ToolButton2Click(Sender: TObject); begin qrymodule.Next ; end; procedure Tfrm_tree_main.N21Click(Sender: TObject); begin // if t_info_bulletin.IsEmpty then exit; {$IFDEF BGXITONG} { try frm_info_bulletin:=tfrm_info_bulletin.Create (self); frm_info_bulletin.ShowModal; finally frm_info_bulletin.Free; frm_info_bulletin:=nil; end; } {$ENDIF} end; procedure Tfrm_tree_main.N23Click(Sender: TObject); begin // if t_info_leaveword.IsEmpty then exit; {$IFDEF GRXINXI} { try frm_info_leaveword:=tfrm_info_leaveword.Create (self); frm_info_leaveword.ShowModal; finally frm_info_leaveword.Free; frm_info_leaveword:=nil; end; frm_main.t_info_leaveword.Requery(); } {$ENDIF} end; procedure Tfrm_tree_main.N25Click(Sender: TObject); begin {$IFDEF GRXINXI} // if t_info_plan.IsEmpty then exit; {$ENDIF} end; procedure Tfrm_tree_main.N27Click(Sender: TObject); begin // if t_info_tell.IsEmpty then exit; try frm_info_tell:=tfrm_info_tell.Create (self); frm_info_tell.ShowModal; finally frm_info_tell.Free; frm_info_tell:=nil; end; frm_main.t_info_tell.Requery(); end; procedure Tfrm_tree_main.N29Click(Sender: TObject); begin try frm_sys_message_pri:=tfrm_sys_message_pri.Create (self); frm_sys_message_pri.ShowModal; finally frm_sys_message_pri.Free; frm_sys_message_pri:=nil; end; end; procedure Tfrm_tree_main.ListView1DblClick(Sender: TObject); var myid,i:integer; myaction: string; begin if ListView1.Selected=nil then exit ; myaction:='Act'+trim(ListView1.Selected.SubItems[1]); if ListView1.Selected.ImageIndex=1 then qrymodule.Locate('fmoduleid',strtoint(trim(ListView1.Selected.SubItems[1])),[]) else begin //捷丰权限限制屏蔽 { if not vold then begin myid:=strtointdef(trim(ListView1.Selected.SubItems[1]),0); if myid<>0 then begin if frm_data_share.memreg.Locate('fmoduleid',myid,[]) then begin if frm_data_share.memreg.fieldbyname('reg').AsInteger=0 then begin MessageDlg('本模块没有注册不能使用!',mtWarning,[mbOk],0); exit; end else if frm_data_share.memreg.fieldbyname('reg').AsInteger=2 then begin i:=frm_main.RegwareII1.DaysLeft; if i<=0 then begin MessageDlg('本模块为试用注册,试用时间已过!',mtWarning,[mbOk],0); exit; end else begin MessageDlg('本模块为试用注册,试用剩余天数为'+inttostr(i)+'天!',mtWarning,[mbOk],0); end; end; end else begin MessageDlg('本模块没有注册不能使用!',mtWarning,[mbOk],0); exit; end; end; end; } with ActionList1 do for i:=0 to ActionCount-1 do if Actions[i].Name=myaction then begin Actions[i].Execute ; break ; end ; end ; end; procedure Tfrm_tree_main.ToolButton5Click(Sender: TObject); begin if Panel6.Visible then N31.click else N32.Click ; end; procedure Tfrm_tree_main.Act801Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('166') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_bulletin_manage) then frm_info_bulletin_manage:=tfrm_info_bulletin_manage.Create (self); frm_info_bulletin_manage.ManualDock(frm_main.SearchTabs('frm_info_bulletin_manage',frm_info_bulletin_manage.caption,'801'),nil,alClient); frm_info_bulletin_manage.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act80206Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('169') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_kaoqin_report) then frm_info_kaoqin_report:=tfrm_info_kaoqin_report.Create (self); frm_info_kaoqin_report.ManualDock(frm_main.SearchTabs('frm_info_kaoqin_report',frm_info_kaoqin_report.caption,'80206'),nil,alClient); frm_info_kaoqin_report.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act804Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('240') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_rules) then frm_info_rules:=tfrm_info_rules.Create (self); frm_info_rules.ManualDock(frm_main.SearchTabs('frm_info_rules',frm_info_rules.caption,'804'),nil,alClient); frm_info_rules.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act805Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('243') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_criterion) then frm_info_criterion:=tfrm_info_criterion.Create (self); frm_info_criterion.ManualDock(frm_main.SearchTabs('frm_info_criterion',frm_info_criterion.caption,'805'),nil,alClient); frm_info_criterion.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act806Execute(Sender: TObject); begin {$IFDEF GZBAOGAO} { if not if_open('020') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_render_manager) then frm_info_render_manager:=tfrm_info_render_manager.Create (self); frm_info_render_manager.ManualDock(frm_main.SearchTabs('frm_info_render_manager',frm_info_render_manager.caption,'806'),nil,alClient); frm_info_render_manager.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act807Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('167') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_yijian_manage) then frm_info_yijian_manage:=tfrm_info_yijian_manage.Create (self); frm_info_yijian_manage.ManualDock(frm_main.SearchTabs('frm_info_yijian_manage',frm_info_yijian_manage.caption,'807'),nil,alClient); frm_info_yijian_manage.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act808Execute(Sender: TObject); begin {$IFDEF BGXITONG} if not if_open('246') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_shareDoc) then frm_info_shareDoc:=tfrm_info_shareDoc.Create (self); frm_info_shareDoc.ManualDock(frm_main.SearchTabs('frm_info_shareDoc',frm_info_shareDoc.caption,'808'),nil,alClient); frm_info_shareDoc.show; {$ENDIF} end; procedure Tfrm_tree_main.Act80201Execute(Sender: TObject); begin frm_main.p_kaoqin.Parameters.ParamByName('emp').value:=employee; frm_main.p_kaoqin.Parameters.ParamByName('lei').value:='上午签到'; frm_main.p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; frm_main.p_kaoqin.Parameters.ParamByName('sh').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('shouquan_date').value:=DatabaseDateTime; frm_main.p_kaoqin.ExecProc; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('上午签到成功!!'); end else begin showmessage('上午您已经签到!!'); end; end; procedure Tfrm_tree_main.Act80202Execute(Sender: TObject); begin frm_main.p_kaoqin.Parameters.ParamByName('emp').value:=employee; frm_main.p_kaoqin.Parameters.ParamByName('lei').value:='上午签退'; frm_main.p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; frm_main.p_kaoqin.Parameters.ParamByName('sh').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('shouquan_date').value:=DatabaseDateTime; frm_main.p_kaoqin.ExecProc; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('上午签退成功!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('上午您已经签退!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=4 then begin showmessage('上午您还没有签到不能签退!!'); exit; end; end; procedure Tfrm_tree_main.Act80203Execute(Sender: TObject); begin frm_main.p_kaoqin.Parameters.ParamByName('emp').value:=employee; frm_main.p_kaoqin.Parameters.ParamByName('lei').value:='下午签到'; frm_main.p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; frm_main.p_kaoqin.Parameters.ParamByName('sh').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('shouquan_date').value:=DatabaseDateTime; frm_main.p_kaoqin.ExecProc; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('下午签到成功!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('下午您已经签到!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=3 then begin showmessage('下午签到只能在13:00以后才能操作!!'); end; end; procedure Tfrm_tree_main.Act80204Execute(Sender: TObject); begin frm_main.p_kaoqin.Parameters.ParamByName('emp').value:=employee; frm_main.p_kaoqin.Parameters.ParamByName('lei').value:='下午签退'; frm_main.p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; frm_main.p_kaoqin.Parameters.ParamByName('sh').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; frm_main.p_kaoqin.Parameters.ParamByName('shouquan_date').value:=DatabaseDateTime; frm_main.p_kaoqin.ExecProc; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('下午签退成功!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('下午您已经签退!!'); exit; end; if frm_main.p_kaoqin.Parameters.ParamByName('i').value=5 then begin showmessage('下午您还没有签到不能签退!!'); exit; end; end; procedure Tfrm_tree_main.Act80205Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('168') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_info_kaoqin_shouquan) then frm_info_kaoqin_shouquan:=tfrm_info_kaoqin_shouquan.Create (self); frm_info_kaoqin_shouquan.ShowModal; finally frm_info_kaoqin_shouquan.free; frm_info_kaoqin_shouquan:=nil; end; } {$ENDIF} end; procedure Tfrm_tree_main.Act51Execute(Sender: TObject); begin {$IFDEF YWTAIZHANG} if not if_open('041') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_tai_total) then frm_rp_tai_total:=tfrm_rp_tai_total.Create (self); frm_rp_tai_total.ManualDock(frm_main.SearchTabs('frm_rp_tai_total',frm_rp_tai_total.caption,'51'),nil,alClient); frm_rp_tai_total.show; {$ENDIF} end; procedure Tfrm_tree_main.Act43Execute(Sender: TObject); begin if not if_open('271') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_dui_accepttotal) then frm_rp_dui_accepttotal:=Tfrm_rp_dui_accepttotal.Create(self); frm_rp_dui_accepttotal.ManualDock(frm_main.SearchTabs('frm_rp_dui_accepttotal',frm_rp_dui_accepttotal.caption,'43'),nil,alClient); frm_rp_dui_accepttotal.show; end; procedure Tfrm_tree_main.Act44Execute(Sender: TObject); begin {$IFDEF DLFENZHANG} if not if_open('197') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_rp_sea_daili) then frm_rp_rp_sea_daili:=tfrm_rp_rp_sea_daili.Create (self); frm_rp_rp_sea_daili.ManualDock(frm_main.SearchTabs('frm_rp_rp_sea_daili',frm_rp_rp_sea_daili.caption,'44'),nil,alClient); frm_rp_rp_sea_daili.show; {$ENDIF} end; procedure Tfrm_tree_main.Act47Execute(Sender: TObject); begin if not if_open('230') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_cw_prnFee) then frm_cw_prnFee:=tfrm_cw_prnFee.Create (self); frm_cw_prnFee.ManualDock(frm_main.SearchTabs('frm_cw_prnFee',frm_cw_prnFee.caption,'47'),nil,alClient); frm_cw_prnFee.show; end; procedure Tfrm_tree_main.Act49Execute(Sender: TObject); begin {$IFDEF PZJIEKOU} if not if_open('185') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_cw_pingzheng) then frm_cw_pingzheng:=tfrm_cw_pingzheng.Create (self); frm_cw_pingzheng.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng',frm_cw_pingzheng.caption,'49'),nil,alClient); frm_cw_pingzheng.show; {$ENDIF} end; procedure Tfrm_tree_main.Act48Execute(Sender: TObject); begin {$IFDEF QTFEIYONG} if not if_open('187') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_dui_month) then frm_rp_dui_month:=tfrm_rp_dui_month.Create (self); frm_rp_dui_month.ManualDock(frm_main.SearchTabs('frm_rp_dui_month',frm_rp_dui_month.caption,'48'),nil,alClient); frm_rp_dui_month.show; {$ENDIF} end; procedure Tfrm_tree_main.Act541Execute(Sender: TObject); begin if not if_open('051') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fee_modify) then frm_rp_fee_modify:=tfrm_rp_fee_modify.Create (self); frm_rp_fee_modify.ManualDock(frm_main.SearchTabs('frm_rp_fee_modify',frm_rp_fee_modify.caption,'541'),nil,alClient); frm_rp_fee_modify.show; end; procedure Tfrm_tree_main.Act542Execute(Sender: TObject); begin if not if_open('192') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_balance_accept) then frm_rp_ch_balance_accept:=tfrm_rp_ch_balance_accept.Create (self); frm_rp_ch_balance_accept.ManualDock(frm_main.SearchTabs('frm_rp_ch_balance_accept',frm_rp_ch_balance_accept.caption,'542'),nil,alClient); frm_rp_ch_balance_accept.show; end; procedure Tfrm_tree_main.Act543Execute(Sender: TObject); begin if not if_open('193') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_balance_pay) then frm_rp_ch_balance_pay:=tfrm_rp_ch_balance_pay.Create (self); frm_rp_ch_balance_pay.ManualDock(frm_main.SearchTabs('frm_rp_ch_balance_pay',frm_rp_ch_balance_pay.caption,'543'),nil,alClient); frm_rp_ch_balance_pay.show; end; procedure Tfrm_tree_main.Act544Execute(Sender: TObject); begin if not if_open('196') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_balance_rate) then frm_rp_ch_balance_rate:=tfrm_rp_ch_balance_rate.Create (self); frm_rp_ch_balance_rate.ManualDock(frm_main.SearchTabs('frm_rp_ch_balance_rate',frm_rp_ch_balance_rate.caption,'544'),nil,alClient); frm_rp_ch_balance_rate.show; end; procedure Tfrm_tree_main.Act545Execute(Sender: TObject); begin if not if_open('203') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_currency_change) then frm_rp_ch_currency_change:=tfrm_rp_ch_currency_change.Create (self); frm_rp_ch_currency_change.ManualDock(frm_main.SearchTabs('frm_rp_ch_currency_change',frm_rp_ch_currency_change.caption,'545'),nil,alClient); frm_rp_ch_currency_change.show; end; procedure Tfrm_tree_main.Act546Execute(Sender: TObject); begin {$IFDEF FYZHUANGTAI} if not if_open('204') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_fee_state) then frm_rp_ch_fee_state:=tfrm_rp_ch_fee_state.Create (self); frm_rp_ch_fee_state.ManualDock(frm_main.SearchTabs('frm_rp_ch_fee_state',frm_rp_ch_fee_state.caption,'546'),nil,alClient); frm_rp_ch_fee_state.show; {$ENDIF} end; procedure Tfrm_tree_main.Act941Execute(Sender: TObject); begin if not if_open('096') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_sys_parameters) then frm_sys_parameters:=tfrm_sys_parameters.Create (self); frm_sys_parameters.ShowModal; finally frm_sys_parameters.free; end; end; procedure Tfrm_tree_main.Act942Execute(Sender: TObject); begin if not if_open('165') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_empty) then frm_code_empty:=tfrm_code_empty.Create (self); frm_code_empty.ShowModal; finally frm_code_empty.free; frm_code_empty:=NIL; end; end; procedure Tfrm_tree_main.Act943Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('119') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_sys_crm_params) then frm_sys_crm_params:=tfrm_sys_crm_params.Create (self); frm_sys_crm_params.ShowModal; finally FreeAndNil(frm_sys_crm_params); end; {$ENDIF} end; procedure Tfrm_tree_main.Act944Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('096') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_sys_sale_profitset) then frm_sys_sale_profitset:=tfrm_sys_sale_profitset.Create (self); frm_sys_sale_profitset.ShowModal; finally FreeAndNil(frm_sys_sale_profitset); end; {$ENDIF} end; procedure Tfrm_tree_main.Act945Execute(Sender: TObject); begin if not if_open('284') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_subComp:=tfrm_code_subComp.Create (self); frm_code_subComp.ShowModal; finally frm_code_subComp.Free; frm_code_subComp:=nil; end; end; procedure Tfrm_tree_main.Act946Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('119') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_client_parameter) then frm_code_client_parameter:=tfrm_code_client_parameter.Create (self); frm_code_client_parameter.ShowModal; finally frm_code_client_parameter.free; end; {$ENDIF} end; procedure Tfrm_tree_main.ToolButton8Click(Sender: TObject); var inifile1:Tinifile; begin inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini'); inifile1.Writeinteger('View','tabindex',bsSkinPageControl2.ActivePageIndex); inifile1.free; // if Item.Caption = '退出系统' then frm_main.Close; { try frm_sys_close:=Tfrm_sys_close.Create(self); frm_sys_close.ShowModal; finally frm_sys_close.Free; end; exit; } end; procedure Tfrm_tree_main.Act921Execute(Sender: TObject); begin if not if_open('002') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_sys_dep_emp:=tfrm_sys_dep_emp.Create (self); if employee<>'DEMO-SA' then begin { frm_sys_dep_emp.t_sys_department.Close; frm_sys_dep_emp.t_sys_department.SQL.Clear; frm_sys_dep_emp.t_sys_department.SQL.Add('select * from t_sys_department order by 部门名称'); frm_sys_dep_emp.t_sys_department.Open; } frm_sys_dep_emp.t_sys_department.Filtered:=false; frm_sys_dep_emp.t_sys_department.Filter:='部门经理='''+employee+''''; frm_sys_dep_emp.t_sys_department.Filtered:=true; end; frm_sys_dep_emp.ShowModal; finally frm_sys_dep_emp.Free; end; end; procedure Tfrm_tree_main.Act922Execute(Sender: TObject); begin if not if_open('001') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_sys_limited) then frm_sys_limited:=tfrm_sys_limited.Create (self); if employee<>'DEMO-SA' then begin with frm_sys_limited.t_sys_employee do begin close;sql.clear; sql.add('select * from t_sys_employee where 部门名称 in (select 部门名称 from t_sys_department where 部门经理='''+employee+''')'); sql.add('order by 姓名'); Open; end; with frm_sys_limited.t_sys_employee2 do begin close;sql.clear; sql.add('select * from t_sys_employee where 状态=''在职'' and 部门名称 in (select 部门名称 from t_sys_department where 部门经理='''+employee+''')'); sql.add('order by 姓名'); Open; end; end else begin with frm_sys_limited.t_sys_employee do begin close;sql.clear; sql.add('select * from t_sys_employee '); sql.add('order by 姓名'); Open; end; with frm_sys_limited.t_sys_employee2 do begin close;sql.clear; sql.add('select * from t_sys_employee '); sql.add('order by 姓名'); Open; end; end; frm_sys_limited.ManualDock(frm_main.SearchTabs('frm_sys_limited',frm_sys_limited.caption,'922'),nil,alClient); frm_sys_limited.show; end; procedure Tfrm_tree_main.Act101Execute(Sender: TObject); begin if not if_open('014') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae) then frm_op_seae:=tfrm_op_seae.Create (self); frm_op_seae.ManualDock(frm_main.SearchTabs('frm_op_seae',frm_op_seae.caption,'101'),nil,alClient); frm_op_seae.show; end; procedure Tfrm_tree_main.Act102Execute(Sender: TObject); begin {$IFDEF PXHUANHUO} if not if_open('152') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_huanhuo) then frm_op_seae_huanhuo:=tfrm_op_seae_huanhuo.Create (self); frm_op_seae_huanhuo.ManualDock(frm_main.SearchTabs('frm_op_seae_huanhuo',frm_op_seae_huanhuo.caption,'102'),nil,alClient); frm_op_seae_huanhuo.show; {$ENDIF} end; procedure Tfrm_tree_main.Act103Execute(Sender: TObject); begin if not if_open('141') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_vessel_change) then frm_op_seae_vessel_change:=tfrm_op_seae_vessel_change.Create (self); frm_op_seae_vessel_change.ManualDock(frm_main.SearchTabs('frm_op_seae_vessel_change',frm_op_seae_vessel_change.caption,'103'),nil,alClient); frm_op_seae_vessel_change.show; end; procedure Tfrm_tree_main.Act104Execute(Sender: TObject); begin {$IFDEF QDQUEREN} if not if_open('160') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_qiandan) then frm_op_seae_qiandan:=tfrm_op_seae_qiandan.Create (self); frm_op_seae_qiandan.ManualDock(frm_main.SearchTabs('frm_op_seae_qiandan',frm_op_seae_qiandan.caption,'104'),nil,alClient); frm_op_seae_qiandan.show; {$ENDIF} end; procedure Tfrm_tree_main.Act105Execute(Sender: TObject); begin if not if_open('160') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_qiandan_add) then frm_op_seae_qiandan_add:=tfrm_op_seae_qiandan_add.Create (self); frm_op_seae_qiandan_add.ManualDock(frm_main.SearchTabs('frm_op_seae_qiandan_add',frm_op_seae_qiandan_add.caption,'105'),nil,alClient); frm_op_seae_qiandan_add.show; end; procedure Tfrm_tree_main.Act111Execute(Sender: TObject); begin if not if_open('054') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seai) then frm_op_seai:=tfrm_op_seai.Create (self); frm_op_seai.ManualDock(frm_main.SearchTabs('frm_op_seai',frm_op_seai.caption,'111'),nil,alClient); frm_op_seai.show; end; procedure Tfrm_tree_main.Act121Execute(Sender: TObject); begin { if not if_open('072') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_aire) then frm_op_aire:=tfrm_op_aire.Create (self); frm_op_aire.ManualDock(frm_main.SearchTabs('frm_op_aire',frm_op_aire.caption,'121'),nil,alClient); frm_op_aire.show; } end; procedure Tfrm_tree_main.Act131Execute(Sender: TObject); begin { if not if_open('080') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_airi) then frm_op_airi:=tfrm_op_airi.Create (self); frm_op_airi.ManualDock(frm_main.SearchTabs('frm_op_airi',frm_op_airi.caption,'131'),nil,alClient); frm_op_airi.show; } end; procedure Tfrm_tree_main.Act1401Execute(Sender: TObject); begin {$IFDEF JGCHE} { if not if_open('348') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_airtruck) then frm_op_airtruck:=tfrm_op_airtruck.Create (self); frm_op_airtruck.ManualDock(frm_main.SearchTabs('frm_op_airtruck',frm_op_airtruck.caption,'14'),nil,alClient); frm_op_airtruck.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act151Execute(Sender: TObject); begin {$IFDEF SJBAOGUAN} if not if_open('190') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_apply) then frm_op_seae_apply:=tfrm_op_seae_apply.Create (self); frm_op_seae_apply.ManualDock(frm_main.SearchTabs('frm_op_seae_apply',frm_op_seae_apply.caption,'151'),nil,alClient); frm_op_seae_apply.show; {$ENDIF} end; procedure Tfrm_tree_main.Act152Execute(Sender: TObject); begin {$IFDEF SJBAOGUAN} if not if_open('191') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seai_apply) then frm_op_seai_apply:=tfrm_op_seai_apply.Create (self); frm_op_seai_apply.ManualDock(frm_main.SearchTabs('frm_op_seai_apply',frm_op_seai_apply.caption,'152'),nil,alClient); frm_op_seai_apply.show; {$ENDIF} end; procedure Tfrm_tree_main.Act16Execute(Sender: TObject); begin if not if_open('160') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_card) then frm_op_seae_card:=tfrm_op_seae_card.Create (self); frm_op_seae_card.ManualDock(frm_main.SearchTabs('frm_op_seae_card',frm_op_seae_card.caption,'16'),nil,alClient); frm_op_seae_card.show; end; procedure Tfrm_tree_main.Act155Execute(Sender: TObject); begin {$IFDEF TSQUEREN} if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_tuishui) then frm_op_seae_tuishui:=tfrm_op_seae_tuishui.Create (self); frm_op_seae_tuishui.ManualDock(frm_main.SearchTabs('frm_op_seae_tuishui',frm_op_seae_tuishui.caption,'155'),nil,alClient); frm_op_seae_tuishui.show; {$ENDIF} end; procedure Tfrm_tree_main.Act17Execute(Sender: TObject); begin if not if_open('189') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_delete) then frm_op_delete:=tfrm_op_delete.Create (self); frm_op_delete.ManualDock(frm_main.SearchTabs('frm_op_delete',frm_op_delete.caption,'17'),nil,alClient); frm_op_delete.show; end; procedure Tfrm_tree_main.Act5310Execute(Sender: TObject); begin if not if_open('173') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_rp_seae_pin) then frm_rp_rp_seae_pin:=tfrm_rp_rp_seae_pin.Create (self); frm_rp_rp_seae_pin.ManualDock(frm_main.SearchTabs('frm_rp_rp_seae_pin',frm_rp_rp_seae_pin.caption,'5310'),nil,alClient); frm_rp_rp_seae_pin.show; end; procedure Tfrm_tree_main.Act5321Execute(Sender: TObject); begin if not if_open('111') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_rp_total) then frm_rp_rp_total:=tfrm_rp_rp_total.Create (self); frm_rp_rp_total.ManualDock(frm_main.SearchTabs('frm_rp_rp_total',frm_rp_rp_total.caption,'5321'),nil,alClient); frm_rp_rp_total.show; end; procedure Tfrm_tree_main.Act5330Execute(Sender: TObject); begin {$IFDEF ZHYDTONGJI} if not if_open('111') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_rp_monthtotal) then frm_rp_rp_monthtotal:=tfrm_rp_rp_monthtotal.Create (self); frm_rp_rp_monthtotal.ManualDock(frm_main.SearchTabs('frm_rp_rp_monthtotal',frm_rp_rp_monthtotal.caption,'5330'),nil,alClient); frm_rp_rp_monthtotal.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5340Execute(Sender: TObject); begin {$IFDEF ZHMXTONGJI} if not if_open('111') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_total) then frm_rp_ch_total:=tfrm_rp_ch_total.Create (self); frm_rp_ch_total.ManualDock(frm_main.SearchTabs('frm_rp_ch_total',frm_rp_ch_total.caption,'5340'),nil,alClient); frm_rp_ch_total.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5350Execute(Sender: TObject); begin {$IFDEF ZHZIYOU} if not if_open('111') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_chfree_total) then frm_rp_chfree_total:=tfrm_rp_chfree_total.Create (self); frm_rp_chfree_total.ManualDock(frm_main.SearchTabs('frm_rp_chfree_total',frm_rp_chfree_total.caption,'5350'),nil,alClient); frm_rp_chfree_total.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5360Execute(Sender: TObject); begin {$IFDEF GYSHANG} if not if_open('259') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_truck_no) then frm_rp_truck_no:=tfrm_rp_truck_no.Create (self); frm_rp_truck_no.ManualDock(frm_main.SearchTabs('frm_rp_truck_no',frm_rp_truck_no.caption,'5360'),nil,alClient); frm_rp_truck_no.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5370Execute(Sender: TObject); begin {$IFDEF GYSHANG} if not if_open('260') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_apply_no) then frm_rp_apply_no:=tfrm_rp_apply_no.Create (self); frm_rp_apply_no.ManualDock(frm_main.SearchTabs('frm_rp_apply_no',frm_rp_apply_no.caption,'5370'),nil,alClient); frm_rp_apply_no.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5380Execute(Sender: TObject); begin if not if_open('114') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zou_total) then frm_rp_zou_total:=tfrm_rp_zou_total.Create (self); frm_rp_zou_total.ManualDock(frm_main.SearchTabs('frm_rp_zou_total',frm_rp_zou_total.caption,'5380'),nil,alClient); frm_rp_zou_total.show; end; procedure Tfrm_tree_main.Act5323Execute(Sender: TObject); begin if not if_open('048') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_rp_seae) then frm_rp_rp_seae:=tfrm_rp_rp_seae.Create (self); frm_rp_rp_seae.ManualDock(frm_main.SearchTabs('frm_rp_rp_seae',frm_rp_rp_seae.caption,'5323'),nil,alClient); frm_rp_rp_seae.show; end; procedure Tfrm_tree_main.Act5390Execute(Sender: TObject); begin {$IFDEF TBQITA} if not if_open('157') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fen_seae_ctn) then frm_rp_fen_seae_ctn:=tfrm_rp_fen_seae_ctn.Create (self); frm_rp_fen_seae_ctn.ManualDock(frm_main.SearchTabs('frm_rp_fen_seae_ctn',frm_rp_fen_seae_ctn.caption,'5390'),nil,alClient); frm_rp_fen_seae_ctn.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5400Execute(Sender: TObject); begin if not if_open('117') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_cx_total) then frm_rp_cx_total:=tfrm_rp_cx_total.Create (self); frm_rp_cx_total.ManualDock(frm_main.SearchTabs('frm_rp_cx_total',frm_rp_cx_total.caption,'5400'),nil,alClient); frm_rp_cx_total.show; end; procedure Tfrm_tree_main.Act951Execute(Sender: TObject); begin if not if_open('017') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_ctn_kind:=tfrm_code_ctn_kind.Create (self); frm_code_ctn_kind.ShowModal; finally frm_code_ctn_kind.Free; end; end; procedure Tfrm_tree_main.Act952Execute(Sender: TObject); begin if not if_open('009') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_ctn:=tfrm_code_ctn.Create (self); frm_code_ctn.ShowModal; finally frm_code_ctn.Free; end; end; procedure Tfrm_tree_main.Act953Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('122') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_price_ctn) then frm_code_price_ctn:=tfrm_code_price_ctn.Create (self); frm_code_price_ctn.ShowModal; finally frm_code_price_ctn.free; end; } {$ENDIF} end; procedure Tfrm_tree_main.Act954Execute(Sender: TObject); begin if not if_open('007') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_goods:=tfrm_code_goods.Create (self); frm_code_goods.ShowModal; finally frm_code_goods.Free; end; end; procedure Tfrm_tree_main.Act955Execute(Sender: TObject); begin if not if_open('013') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_package:=tfrm_code_package.Create (self); frm_code_package.ShowModal; finally frm_code_package.Free; end; end; procedure Tfrm_tree_main.Act956Execute(Sender: TObject); begin if not if_open('188') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_tiaokuan) then frm_code_tiaokuan:=tfrm_code_tiaokuan.Create (self); frm_code_tiaokuan.ShowModal; finally frm_code_tiaokuan.free; frm_code_tiaokuan:=NIL; end; end; procedure Tfrm_tree_main.Act957Execute(Sender: TObject); begin if not assigned(frm_code_country) then frm_code_country:=tfrm_code_country.Create (self); frm_code_country.ManualDock(frm_main.SearchTabs('frm_code_country',frm_code_country.caption,'957'),nil,alClient); frm_code_country.show; end; procedure Tfrm_tree_main.Act958Execute(Sender: TObject); begin if not assigned(frm_code_port) then frm_code_port:=tfrm_code_port.Create (self); frm_code_port.ManualDock(frm_main.SearchTabs('frm_code_port',frm_code_port.caption,'958'),nil,alClient); frm_code_port.show; end; procedure Tfrm_tree_main.Act959Execute(Sender: TObject); begin { if not if_open('155') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_port_air) then frm_code_port_air:=tfrm_code_port_air.Create (self); frm_code_port_air.ShowModal; finally frm_code_port_air.free; frm_code_port_air:=NIL; end; } end; procedure Tfrm_tree_main.Act960Execute(Sender: TObject); begin try frm_code_trade:=tfrm_code_trade.Create (self); frm_code_trade.ShowModal; finally frm_code_trade.Free; end; end; procedure Tfrm_tree_main.Act961Execute(Sender: TObject); begin if not if_open('097') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_vessel:=tfrm_code_vessel.Create (self); frm_code_vessel.ShowModal; finally frm_code_vessel.Free; end; end; procedure Tfrm_tree_main.Act962Execute(Sender: TObject); begin {$IFDEF EDI} if not if_open('179') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_line_edi) then frm_code_line_edi:=tfrm_code_line_edi.Create (self); frm_code_line_edi.ShowModal; finally frm_code_line_edi.free; frm_code_line_edi:=NIL; end; {$ENDIF} end; procedure Tfrm_tree_main.Act963Execute(Sender: TObject); begin {$IFDEF KDYEWU} { if not if_open('164') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_send_address) then frm_code_send_address:=tfrm_code_send_address.Create (self); frm_code_send_address.bsSkinButton3.Enabled:=false; frm_code_send_address.ShowModal; finally frm_code_send_address.free; frm_code_send_address:=NIL; end; } {$ENDIF} end; procedure Tfrm_tree_main.Act964Execute(Sender: TObject); begin if not if_open('071') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_signbill:=tfrm_code_signbill.Create (self); frm_code_signbill.ShowModal; finally frm_code_signbill.Free; end; end; procedure Tfrm_tree_main.Act965Execute(Sender: TObject); begin if not if_open('008') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_items:=tfrm_code_items.Create (self); frm_code_items.ShowModal; finally frm_code_items.Free; end; end; procedure Tfrm_tree_main.Act966Execute(Sender: TObject); begin if not if_open('016') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_code:=tfrm_code_code.Create (self); frm_code_code.ShowModal; finally frm_code_code.Free; end; end; procedure Tfrm_tree_main.Act967Execute(Sender: TObject); begin if not if_open('144') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_send_head:=tfrm_code_send_head.Create (self); code_send_head_num:=0; frm_code_send_head.ShowModal; finally frm_code_send_head.Free; frm_code_send_head:=nil; end; end; procedure Tfrm_tree_main.Act968Execute(Sender: TObject); begin if not if_open('145') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_code_card) then frm_code_card:=tfrm_code_card.Create (self); frm_code_card.ManualDock(frm_main.SearchTabs('frm_code_card',frm_code_card.caption,'968'),nil,alClient); frm_code_card.show; end; procedure Tfrm_tree_main.Act969Execute(Sender: TObject); begin {$IFDEF ZTGENGZONG} if not if_open('052') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_code_state) then frm_code_state:=tfrm_code_state.Create (self); frm_code_state.ManualDock(frm_main.SearchTabs('frm_code_state',frm_code_state.caption,'969'),nil,alClient); frm_code_state.show; {$ENDIF} end; procedure Tfrm_tree_main.Act970Execute(Sender: TObject); begin if not if_open('151') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_source:=tfrm_code_source.Create (self); frm_code_source.ShowModal; finally frm_code_source.Free; frm_code_source:=nil; end; end; procedure Tfrm_tree_main.Act971Execute(Sender: TObject); begin if not if_open('151') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_opresult:=tfrm_code_opresult.Create (self); frm_code_opresult.ShowModal; finally frm_code_opresult.Free; frm_code_opresult:=nil; end; end; procedure Tfrm_tree_main.Act972Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('151') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_customstatu:=tfrm_code_customstatu.Create (self); frm_code_customstatu.ShowModal; finally frm_code_customstatu.Free; frm_code_customstatu:=nil; end; {$ENDIF} end; procedure Tfrm_tree_main.Act411Execute(Sender: TObject); begin {$IFDEF FPSHENQING} if not if_open('281') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice_shen) then frm_ch_invoice_shen:=tfrm_ch_invoice_shen.Create (self); frm_ch_invoice_shen.ManualDock(frm_main.SearchTabs('frm_ch_invoice_shen',frm_ch_invoice_shen.caption,'411'),nil,alClient); frm_ch_invoice_shen.show; {$ENDIF} end; procedure Tfrm_tree_main.Act412Execute(Sender: TObject); begin {$IFDEF FPSHENQING} if not if_open('029') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice_check) then frm_ch_invoice_check:=tfrm_ch_invoice_check.Create (self); frm_ch_invoice_check.ManualDock(frm_main.SearchTabs('frm_ch_invoice_check',frm_ch_invoice_check.caption,'412'),nil,alClient); frm_ch_invoice_check.show; {$ENDIF} end; procedure Tfrm_tree_main.Act413Execute(Sender: TObject); begin if not if_open('030') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice) then frm_ch_invoice:=tfrm_ch_invoice.Create (self); frm_ch_invoice.ManualDock(frm_main.SearchTabs('frm_ch_invoice',frm_ch_invoice.caption,'413'),nil,alClient); frm_ch_invoice.show; end; procedure Tfrm_tree_main.Act41401Execute(Sender: TObject); begin if not if_open('046') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_in_ch) then frm_rp_in_ch:=tfrm_rp_in_ch.Create (self); frm_rp_in_ch.ManualDock(frm_main.SearchTabs('frm_rp_in_ch',frm_rp_in_ch.caption,'41401'),nil,alClient); frm_rp_in_ch.show; end; procedure Tfrm_tree_main.Act41402Execute(Sender: TObject); begin if not if_open('205') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_in_fenlei) then frm_rp_in_fenlei:=tfrm_rp_in_fenlei.Create (self); frm_rp_in_fenlei.ManualDock(frm_main.SearchTabs('frm_rp_in_fenlei',frm_rp_in_fenlei.caption,'41402'),nil,alClient); frm_rp_in_fenlei.show; end; procedure Tfrm_tree_main.Act41403Execute(Sender: TObject); begin if not if_open('105') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_in_total) then frm_rp_in_total:=tfrm_rp_in_total.Create (self); frm_rp_in_total.ManualDock(frm_main.SearchTabs('frm_rp_in_total',frm_rp_in_total.caption,'41403'),nil,alClient); frm_rp_in_total.show; end; procedure Tfrm_tree_main.Act931Execute(Sender: TObject); begin if not if_open('005') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_currency:=tfrm_code_currency.Create (self); frm_code_currency.ShowModal; finally frm_code_currency.Free; end; end; procedure Tfrm_tree_main.Act932Execute(Sender: TObject); begin if not if_open('154') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_fee_type) then frm_code_fee_type:=tfrm_code_fee_type.Create (self); frm_code_fee_type.ShowModal; finally frm_code_fee_type.free; frm_code_fee_type:=NIL; end; end; procedure Tfrm_tree_main.Act933Execute(Sender: TObject); begin if not if_open('006') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_fee:=tfrm_code_fee.Create (self); frm_code_fee.ShowModal; finally frm_code_fee.Free; end; end; procedure Tfrm_tree_main.Act934Execute(Sender: TObject); begin if not if_open('140') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_code_fee_project) then frm_code_fee_project:=tfrm_code_fee_project.Create (self); frm_code_fee_project.ManualDock(frm_main.SearchTabs('frm_code_fee_project',frm_code_fee_project.caption,'934'),nil,alClient); frm_code_fee_project.show; end; procedure Tfrm_tree_main.Act935Execute(Sender: TObject); begin if not if_open('015') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_free:=tfrm_code_free.Create (self); frm_code_free.ShowModal; finally frm_code_free.Free; end; end; procedure Tfrm_tree_main.Act936Execute(Sender: TObject); begin if not if_open('038') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_fee_color:=tfrm_code_fee_color.Create (self); frm_code_fee_color.ShowModal; finally frm_code_fee_color.Free; frm_code_fee_color:=nil; end; end; procedure Tfrm_tree_main.Act937Execute(Sender: TObject); begin {$IFDEF PZJIEKOU} if not if_open('183') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_cw_design) then frm_cw_design:=tfrm_cw_design.Create (self); frm_cw_design.ShowModal; finally frm_cw_design.free; frm_cw_design:=NIL; end; {$ENDIF} end; procedure Tfrm_tree_main.Act938Execute(Sender: TObject); begin {$IFDEF PZJIEKOU} if not if_open('184') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_cw_kemu) then frm_cw_kemu:=tfrm_cw_kemu.Create (self); frm_cw_kemu.ManualDock(frm_main.SearchTabs('frm_cw_kemu',frm_cw_kemu.caption,'938'),nil,alClient); frm_cw_kemu.show; {$ENDIF} end; procedure Tfrm_tree_main.Act939Execute(Sender: TObject); begin {$IFDEF DLFENZHANG} if not if_open('140') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_project_fee_agent) then frm_project_fee_agent:=tfrm_project_fee_agent.Create (self); frm_project_fee_agent.ManualDock(frm_main.SearchTabs('frm_project_fee_agent',frm_project_fee_agent.caption,'939'),nil,alClient); frm_project_fee_agent.show; {$ENDIF} end; procedure Tfrm_tree_main.Act9391Execute(Sender: TObject); begin if not if_open('005') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_UsdExRate:=tfrm_code_UsdExRate.Create (self); frm_code_UsdExRate.ShowModal; finally frm_code_UsdExRate.Free; end; end; procedure Tfrm_tree_main.Act1009Execute(Sender: TObject); begin if not if_open('270') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_card) then frm_info_card:=tfrm_info_card.Create (self); frm_info_card.ManualDock(frm_main.SearchTabs('frm_info_card',frm_info_card.caption,'1009'),nil,alClient); frm_info_card.show; end; procedure Tfrm_tree_main.Act1001Execute(Sender: TObject); begin {$IFDEF KDYEWU} { if not if_open('162') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_kuaidi_shen) then frm_op_kuaidi_shen:=tfrm_op_kuaidi_shen.Create (self); frm_op_kuaidi_shen.ManualDock(frm_main.SearchTabs('frm_op_kuaidi_shen',frm_op_kuaidi_shen.caption,'1001'),nil,alClient); frm_op_kuaidi_shen.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act1002Execute(Sender: TObject); begin {$IFDEF KDYEWU} { if not if_open('163') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_kuaidi_check) then frm_op_kuaidi_check:=tfrm_op_kuaidi_check.Create (self); frm_op_kuaidi_check.ManualDock(frm_main.SearchTabs('frm_op_kuaidi_check',frm_op_kuaidi_check.caption,'1002'),nil,alClient); frm_op_kuaidi_check.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act1003Execute(Sender: TObject); begin {$IFDEF KDYEWU} { if not if_open('182') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_kuaidi_manage) then frm_op_kuaidi_manage:=tfrm_op_kuaidi_manage.Create (self); frm_op_kuaidi_manage.ManualDock(frm_main.SearchTabs('frm_op_kuaidi_manage',frm_op_kuaidi_manage.caption,'1003'),nil,alClient); frm_op_kuaidi_manage.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act451Execute(Sender: TObject); begin {$IFDEF FFLIUCHENG} if not if_open('282') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_check_shen) then frm_ch_check_shen:=tfrm_ch_check_shen.Create (self); frm_ch_check_shen.ManualDock(frm_main.SearchTabs('frm_ch_check_shen',frm_ch_check_shen.caption,'451'),nil,alClient); frm_ch_check_shen.show; {$ENDIF} end; procedure Tfrm_tree_main.Act452Execute(Sender: TObject); begin {$IFDEF FFLIUCHENG} if not if_open('037') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_check_check) then frm_ch_check_check:=tfrm_ch_check_check.Create (self); frm_ch_check_check.ManualDock(frm_main.SearchTabs('frm_ch_check_check',frm_ch_check_check.caption,'452'),nil,alClient); frm_ch_check_check.show; {$ENDIF} end; procedure Tfrm_tree_main.Act453Execute(Sender: TObject); begin if not if_open('034') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_balance_pay) then frm_ch_balance_pay:=tfrm_ch_balance_pay.Create (self); frm_ch_balance_pay.ManualDock(frm_main.SearchTabs('frm_ch_balance_pay',frm_ch_balance_pay.caption,'453'),nil,alClient); frm_ch_balance_pay.show; end; procedure Tfrm_tree_main.Act2001Execute(Sender: TObject); begin // if Item.Caption = '个人资料维护' then try frm_sys_employee:=tfrm_sys_employee.Create (self); frm_sys_employee.ShowModal; finally frm_sys_employee.Free; end; end; procedure Tfrm_tree_main.Act2002Execute(Sender: TObject); begin // if Item.Caption = '个人计划安排' then {$IFDEF GRXINXI} {$ENDIF} end; procedure Tfrm_tree_main.Act2003Execute(Sender: TObject); begin {$IFDEF GRXINXI} // if Item.Caption = '个人计时提醒' then if not assigned(frm_info_tell_manage) then frm_info_tell_manage:=tfrm_info_tell_manage.Create (self); frm_info_tell_manage.ManualDock(frm_main.SearchTabs('frm_info_tell_manage',frm_info_tell_manage.caption,'2003'),nil,alClient); frm_info_tell_manage.show; {$ENDIF} end; procedure Tfrm_tree_main.Act2004Execute(Sender: TObject); begin {$IFDEF GZBAOGAO} // if Item.Caption = '个人工作报告' then { if not assigned(frm_info_render) then frm_info_render:=tfrm_info_render.Create (self); frm_info_render.ManualDock(frm_main.SearchTabs('frm_info_render',frm_info_render.caption,'2004'),nil,alClient); frm_info_render.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act2005Execute(Sender: TObject); begin {$IFDEF GRXINXI} // if Item.Caption = '个人留言管理' then { if not assigned(frm_info_leaveword_manage) then frm_info_leaveword_manage:=tfrm_info_leaveword_manage.Create (self); frm_info_leaveword_manage.ManualDock(frm_main.SearchTabs('frm_info_leaveword_manage',frm_info_leaveword_manage.caption,'2005'),nil,alClient); frm_info_leaveword_manage.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act2006Execute(Sender: TObject); begin //反馈意见及建议 {$IFDEF BGXITONG} { try frm_info_yijian:=tfrm_info_yijian.Create (self); frm_info_yijian.ShowModal; finally frm_info_yijian.Free; frm_info_yijian:=nil; end; } {$ENDIF} end; procedure Tfrm_tree_main.Act71Execute(Sender: TObject); begin if not if_open('018') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client) then frm_crm_client:=tfrm_crm_client.Create (self); frm_crm_client.ManualDock(frm_main.SearchTabs('frm_crm_client',frm_crm_client.caption,'71'),nil,alClient); frm_crm_client.show; end; procedure Tfrm_tree_main.Act72Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('257') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_credit) then frm_crm_credit:=tfrm_crm_credit.Create (self); showprice:=false ; frm_crm_credit.ManualDock(frm_main.SearchTabs('frm_crm_credit',frm_crm_credit.caption,'72'),nil,alClient); frm_crm_credit.show; {$ENDIF} end; procedure Tfrm_tree_main.Act73Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('093') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_report) then frm_crm_client_report:=tfrm_crm_client_report.Create (self); frm_crm_client_report.ManualDock(frm_main.SearchTabs('frm_crm_client_report',frm_crm_client_report.caption,'73'),nil,alClient); frm_crm_client_report.show; {$ENDIF} end; procedure Tfrm_tree_main.Act74Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('090') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_price:=tfrm_code_price.Create (self); frm_code_price.ShowModal; finally frm_code_price.Free; end; {$ENDIF} end; procedure Tfrm_tree_main.Act75Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('091') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_sales) then frm_crm_client_sales:=tfrm_crm_client_sales.Create (self); frm_crm_client_sales.ManualDock(frm_main.SearchTabs('frm_crm_client_sales',frm_crm_client_sales.caption,'75'),nil,alClient); frm_crm_client_sales.show; {$ENDIF} end; procedure Tfrm_tree_main.Act911Execute(Sender: TObject); begin if not if_open('003') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_sys_company:=tfrm_sys_company.Create (self); frm_sys_company.ShowModal; finally frm_sys_company.Free; end; end; procedure Tfrm_tree_main.Act912Execute(Sender: TObject); begin if not if_open('151') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_subComp:=tfrm_code_subComp.Create (self); frm_code_subComp.ShowModal; finally frm_code_subComp.Free; frm_code_subComp:=nil; end; end; procedure Tfrm_tree_main.Act913Execute(Sender: TObject); begin if not if_open('070') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_print_head:=tfrm_code_print_head.Create (self); frm_code_print_head.ShowModal; finally frm_code_print_head.Free; end; end; procedure Tfrm_tree_main.Act914Execute(Sender: TObject); begin if not if_open('004') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_sys_bank:=tfrm_sys_bank.Create (self); frm_sys_bank.ShowModal; finally frm_sys_bank.Free; end; end; procedure Tfrm_tree_main.Act521Execute(Sender: TObject); begin if not if_open('043') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_no_total) then frm_rp_no_total:=tfrm_rp_no_total.Create (self); frm_rp_no_total.ManualDock(frm_main.SearchTabs('frm_rp_no_total',frm_rp_no_total.caption,'521'),nil,alClient); frm_rp_no_total.show; end; procedure Tfrm_tree_main.Act522Execute(Sender: TObject); begin {$IFDEF QFZOUSHI} if not if_open('129') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_no_zou) then frm_rp_no_zou:=tfrm_rp_no_zou.Create (self); frm_rp_no_zou.ManualDock(frm_main.SearchTabs('frm_rp_no_zou',frm_rp_no_zou.caption,'522'),nil,alClient); frm_rp_no_zou.show; {$ENDIF} end; procedure Tfrm_tree_main.Act523Execute(Sender: TObject); begin {$IFDEF QFFZZONGHE} if not if_open('042') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_clienttotal) then frm_rp_ch_clienttotal:=tfrm_rp_ch_clienttotal.Create (self); frm_rp_ch_clienttotal.ManualDock(frm_main.SearchTabs('frm_rp_ch_clienttotal',frm_rp_ch_clienttotal.caption,'523'),nil,alClient); frm_rp_ch_clienttotal.show; {$ENDIF} end; procedure Tfrm_tree_main.Act524Execute(Sender: TObject); begin if not if_open('252') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_OutAmt) then frm_rp_ch_OutAmt:=tfrm_rp_ch_OutAmt.Create (self); frm_rp_ch_OutAmt.ManualDock(frm_main.SearchTabs('frm_rp_ch_OutAmt',frm_rp_ch_OutAmt.caption,'524'),nil,alClient); frm_rp_ch_OutAmt.show; end; procedure Tfrm_tree_main.Act525Execute(Sender: TObject); begin if not if_open('102') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zl_total) then frm_rp_zl_total:=tfrm_rp_zl_total.Create (self); frm_rp_zl_total.ManualDock(frm_main.SearchTabs('frm_rp_zl_total',frm_rp_zl_total.caption,'525'),nil,alClient); frm_rp_zl_total.show; end; procedure Tfrm_tree_main.Act526Execute(Sender: TObject); begin {$IFDEF KHGUANLI} if not if_open('257') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_credit) then frm_crm_credit:=tfrm_crm_credit.Create (self); showprice:=false ; frm_crm_credit.ManualDock(frm_main.SearchTabs('frm_crm_credit',frm_crm_credit.caption,'526'),nil,alClient); frm_crm_credit.show; {$ENDIF} end; procedure Tfrm_tree_main.Act30117Execute(Sender: TObject); begin {$IFDEF JGCHE} { if not if_open('234') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_airtruck) then frm_ch_fee_check_airtruck:=tfrm_ch_fee_check_airtruck.Create (self); frm_ch_fee_check_airtruck.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_airtruck',frm_ch_fee_check_airtruck.caption,'306'),nil,alClient); frm_ch_fee_check_airtruck.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act304Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('258') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_special_price_qus) then frm_special_price_qus:=tfrm_special_price_qus.Create (self); frm_special_price_qus.ManualDock(frm_main.SearchTabs('frm_special_price_qus',frm_special_price_qus.caption,'304'),nil,alClient); frm_special_price_qus.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act303Execute(Sender: TObject); begin {$IFDEF FFLIUCHENG} if not if_open('278') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_check_check) then frm_ch_check_check:=tfrm_ch_check_check.Create (self); frm_ch_check_check.ManualDock(frm_main.SearchTabs('frm_ch_check_check',frm_ch_check_check.caption,'303'),nil,alClient); frm_ch_check_check.show; {$ENDIF} end; procedure Tfrm_tree_main.Act441Execute(Sender: TObject); begin {$IFDEF SFLIUCHENG} if not if_open('217') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_accept_shen) then frm_ch_accept_shen:=tfrm_ch_accept_shen.Create (self); frm_ch_accept_shen.ManualDock(frm_main.SearchTabs('frm_ch_accept_shen',frm_ch_accept_shen.caption,'441'),nil,alClient); frm_ch_accept_shen.show; {$ENDIF} end; procedure Tfrm_tree_main.Act442Execute(Sender: TObject); begin {$IFDEF SFLIUCHENG} if not if_open('174') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_balance_accept_deng) then frm_ch_balance_accept_deng:=tfrm_ch_balance_accept_deng.Create (self); frm_ch_balance_accept_deng.ManualDock(frm_main.SearchTabs('frm_ch_balance_accept_deng',frm_ch_balance_accept_deng.caption,'442'),nil,alClient); frm_ch_balance_accept_deng.show; {$ENDIF} end; procedure Tfrm_tree_main.Act443Execute(Sender: TObject); begin {$IFDEF SFLIUCHENG} if not if_open('175') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_balance_accept_hexiao) then frm_ch_balance_accept_hexiao:=tfrm_ch_balance_accept_hexiao.Create (self); frm_ch_balance_accept_hexiao.ManualDock(frm_main.SearchTabs('frm_ch_balance_accept_hexiao',frm_ch_balance_accept_hexiao.caption,'443'),nil,alClient); frm_ch_balance_accept_hexiao.show; {$ENDIF} end; procedure Tfrm_tree_main.Act444Execute(Sender: TObject); begin {$IFDEF SFLIUCHENG} if not if_open('176') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_balance_accept_check) then frm_ch_balance_accept_check:=tfrm_ch_balance_accept_check.Create (self); frm_ch_balance_accept_check.ManualDock(frm_main.SearchTabs('frm_ch_balance_accept_check',frm_ch_balance_accept_check.caption,'444'),nil,alClient); frm_ch_balance_accept_check.show; {$ENDIF} end; procedure Tfrm_tree_main.Act445Execute(Sender: TObject); begin if not if_open('032') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_balance_accept) then frm_ch_balance_accept:=tfrm_ch_balance_accept.Create (self); frm_ch_balance_accept.ManualDock(frm_main.SearchTabs('frm_ch_balance_accept',frm_ch_balance_accept.caption,'445'),nil,alClient); frm_ch_balance_accept.show; end; procedure Tfrm_tree_main.Act241Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('232') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_sales_profit) then frm_rp_sales_profit:=tfrm_rp_sales_profit.Create (self); frm_rp_sales_profit.ManualDock(frm_main.SearchTabs('frm_rp_sales_profit',frm_rp_sales_profit.caption,'241'),nil,alClient); frm_rp_sales_profit.show; {$ENDIF} end; procedure Tfrm_tree_main.Act242Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('232') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_sales_profitLcx) then frm_rp_sales_profitLcx:=tfrm_rp_sales_profitLcx.Create (self); frm_rp_sales_profitLcx.ManualDock(frm_main.SearchTabs('frm_rp_sales_profitLcx',frm_rp_sales_profitLcx.caption,'242'),nil,alClient); frm_rp_sales_profitLcx.show; {$ENDIF} end; procedure Tfrm_tree_main.Act20101Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('021') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_seae_sales) then frm_ch_fee_seae_sales:=tfrm_ch_fee_seae_sales.Create (self); frm_ch_fee_seae_sales.ManualDock(frm_main.SearchTabs('frm_ch_fee_seae_sales',frm_ch_fee_seae_sales.caption,'20101'),nil,alClient); frm_ch_fee_seae_sales.show; {$ENDIF} end; procedure Tfrm_tree_main.Act211Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('053') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_manage) then frm_info_price_manage:=tfrm_info_price_manage.Create (self); frm_info_price_manage.ManualDock(frm_main.SearchTabs('frm_info_price_manage',frm_info_price_manage.caption,'211'),nil,alClient); frm_info_price_manage.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act212Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('125') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_release) then frm_info_price_release:=tfrm_info_price_release.Create (self); frm_info_price_release.ManualDock(frm_main.SearchTabs('frm_info_price_release',frm_info_price_release.caption,'212'),nil,alClient); frm_info_price_release.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act213Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('126') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_other) then frm_info_price_other:=tfrm_info_price_other.Create (self); frm_info_price_other.ManualDock(frm_main.SearchTabs('frm_info_price_other',frm_info_price_other.caption,'213'),nil,alClient); frm_info_price_other.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act214Execute(Sender: TObject); begin {$IFDEF YJGUANLI} { if not if_open('261') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_special_price_qus) then frm_special_price_qus:=tfrm_special_price_qus.Create (self); frm_special_price_qus.ManualDock(frm_main.SearchTabs('frm_special_price_qus',frm_special_price_qus.caption,'214'),nil,alClient); frm_special_price_qus.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act22Execute(Sender: TObject); begin if not assigned(frm_rp_dui_accepttotal) then frm_rp_dui_accepttotal:=Tfrm_rp_dui_accepttotal.Create(self); frm_rp_dui_accepttotal.ManualDock(frm_main.SearchTabs('frm_rp_dui_accepttotal',frm_rp_dui_accepttotal.caption,'22'),nil,alClient); frm_rp_dui_accepttotal.show; end; procedure Tfrm_tree_main.Act20102Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('057') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_seai_sales) then frm_ch_fee_seai_sales:=tfrm_ch_fee_seai_sales.Create (self); frm_ch_fee_seai_sales.ManualDock(frm_main.SearchTabs('frm_ch_fee_seai_sales',frm_ch_fee_seai_sales.caption,'20102'),nil,alClient); frm_ch_fee_seai_sales.show; {$ENDIF} end; procedure Tfrm_tree_main.Act20103Execute(Sender: TObject); begin {$IFDEF XSGUANLI} { if not if_open('075') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_aire_sales) then frm_ch_fee_aire_sales:=tfrm_ch_fee_aire_sales.Create (self); frm_ch_fee_aire_sales.ManualDock(frm_main.SearchTabs('frm_ch_fee_aire_sales',frm_ch_fee_aire_sales.caption,'20103'),nil,alClient); frm_ch_fee_aire_sales.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act20104Execute(Sender: TObject); begin {$IFDEF XSGUANLI} { if not if_open('083') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_airi_sales) then frm_ch_fee_airi_sales:=tfrm_ch_fee_airi_sales.Create (self); frm_ch_fee_airi_sales.ManualDock(frm_main.SearchTabs('frm_ch_fee_airi_sales',frm_ch_fee_airi_sales.caption,'20104'),nil,alClient); frm_ch_fee_airi_sales.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act30201Execute(Sender: TObject); begin {$IFDEF YWFUHE} if not if_open('248') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_Recheck_seae) then frm_ch_fee_Recheck_seae:=tfrm_ch_fee_Recheck_seae.Create (self); frm_ch_fee_Recheck_seae.ManualDock(frm_main.SearchTabs('frm_ch_fee_Recheck_seae',frm_ch_fee_Recheck_seae.caption,'30201'),nil,alClient); frm_ch_fee_Recheck_seae.show; {$ENDIF} end; procedure Tfrm_tree_main.Act30202Execute(Sender: TObject); begin {$IFDEF YWFUHE} if not if_open('249') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_Recheck_seai) then frm_ch_fee_Recheck_seai:=tfrm_ch_fee_Recheck_seai.Create (self); frm_ch_fee_Recheck_seai.ManualDock(frm_main.SearchTabs('frm_ch_fee_Recheck_seai',frm_ch_fee_Recheck_seai.caption,'30202'),nil,alClient); frm_ch_fee_Recheck_seai.show; {$ENDIF} end; procedure Tfrm_tree_main.Act30203Execute(Sender: TObject); begin {$IFDEF YWFUHE} { if not if_open('250') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_aire) then frm_ch_fee_Recheck_aire:=tfrm_ch_fee_Recheck_aire.Create (self); frm_ch_fee_Recheck_aire.ManualDock(frm_main.SearchTabs('frm_ch_fee_Recheck_aire',frm_ch_fee_Recheck_aire.caption,'30203'),nil,alClient); frm_ch_fee_Recheck_aire.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act30204Execute(Sender: TObject); begin {$IFDEF YWFUHE} { if not if_open('251') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_Recheck_airi) then frm_ch_fee_Recheck_airi:=tfrm_ch_fee_Recheck_airi.Create (self); frm_ch_fee_Recheck_airi.ManualDock(frm_main.SearchTabs('frm_ch_fee_Recheck_airi',frm_ch_fee_Recheck_airi.caption,'30204'),nil,alClient); frm_ch_fee_Recheck_airi.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act30101Execute(Sender: TObject); begin if not if_open('024') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_seae) then frm_ch_fee_check_seae:=tfrm_ch_fee_check_seae.Create (self); frm_ch_fee_check_seae.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_seae',frm_ch_fee_check_seae.caption,'30101'),nil,alClient); frm_ch_fee_check_seae.show; end; procedure Tfrm_tree_main.Act30102Execute(Sender: TObject); begin if not if_open('060') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_seai) then frm_ch_fee_check_seai:=tfrm_ch_fee_check_seai.Create (self); frm_ch_fee_check_seai.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_seai',frm_ch_fee_check_seai.caption,'30102'),nil,alClient); frm_ch_fee_check_seai.show; end; procedure Tfrm_tree_main.Act30103Execute(Sender: TObject); begin { if not if_open('076') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_aire) then frm_ch_fee_check_aire:=tfrm_ch_fee_check_aire.Create (self); frm_ch_fee_check_aire.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_aire',frm_ch_fee_check_aire.caption,'30103'),nil,alClient); frm_ch_fee_check_aire.show; } end; procedure Tfrm_tree_main.Act30104Execute(Sender: TObject); begin { if not if_open('084') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_fee_check_airi) then frm_ch_fee_check_airi:=tfrm_ch_fee_check_airi.Create (self); frm_ch_fee_check_airi.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_airi',frm_ch_fee_check_airi.caption,'30104'),nil,alClient); frm_ch_fee_check_airi.show; } end; procedure Tfrm_tree_main.Act61Execute(Sender: TObject); begin {$IFDEF ZJFENXI} if not if_open('108') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zj_total) then frm_rp_zj_total:=tfrm_rp_zj_total.Create (self); frm_rp_zj_total.ManualDock(frm_main.SearchTabs('frm_rp_zj_total',frm_rp_zj_total.caption,'61'),nil,alClient); frm_rp_zj_total.show; {$ENDIF} end; procedure Tfrm_tree_main.Act62Execute(Sender: TObject); begin {$IFDEF ZJFENXI} if not if_open('130') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zj_zou) then frm_rp_zj_zou:=tfrm_rp_zj_zou.Create (self); frm_rp_zj_zou.ManualDock(frm_main.SearchTabs('frm_rp_zj_zou',frm_rp_zj_zou.caption,'62'),nil,alClient); frm_rp_zj_zou.show; {$ENDIF} end; procedure Tfrm_tree_main.FormShow(Sender: TObject); var inifile1:Tinifile; str:widestring; begin bliNitialOk:=False; if NOT strtobool(get_parameters_value(149,'false')) then begin WebBrowser1.Visible:=false; cxSplitter1.Visible:=false; WebBrowser1.Height:=1; end else WebBrowser1.Navigate('http://www.dongshengsoft.com/dspage.asp'); str:='111111'; if not vold then begin {// 屏蔽捷丰权限验证 程建波 2017-07-10 frm_data_share.memreg.first; while not frm_data_share.memreg.eof do begin if frm_data_share.memreg.fieldbyname('reg').AsInteger=0 then str:=str+','+frm_data_share.memreg.fieldbyname('fmoduleid').asstring else if frm_data_share.memreg.fieldbyname('reg').AsInteger=2 then begin if frm_main.RegwareII1.DaysLeft<=0 then str:=str+','+frm_data_share.memreg.fieldbyname('fmoduleid').asstring; end; frm_data_share.memreg.next; end; } end; if (Uppercase(get_parameters_value(101,'false'))='FALSE') and (Uppercase(get_parameters_value(105,'false'))='FALSE') then begin str:=str+','+'30201'; end; if (Uppercase(get_parameters_value(102,'false'))='FALSE') and (Uppercase(get_parameters_value(106,'false'))='FALSE') then begin str:=str+','+'30202'; end; if (Uppercase(get_parameters_value(103,'false'))='FALSE') and (Uppercase(get_parameters_value(107,'false'))='FALSE') then begin str:=str+','+'30203'; end; if (Uppercase(get_parameters_value(104,'false'))='FALSE') and (Uppercase(get_parameters_value(108,'false'))='FALSE') then begin str:=str+','+'30204'; end; if (Uppercase(get_parameters_value(1,'false'))='FALSE') then str:=str+','+'412'; addLVcolumn ; with p_view do //p_userRight begin Close ; Parameters.ParamByName('@oper').value:=employee ; {$IFDEF Primary} Parameters.ParamByName('@verclass').value:=1; {$ENDIF} {$IFDEF Stand} Parameters.ParamByName('@verclass').value:=2; {$ENDIF} {$IFDEF Support} Parameters.ParamByName('@verclass').value:=3; {$ENDIF} Parameters.ParamByName('@notid').value:=str; Open ; end ; with qrymodule do //p_userRight begin Close ; Parameters.ParamByName('@oper').value:=employee ; {$IFDEF Primary} Parameters.ParamByName('@verclass').value:=1; {$ENDIF} {$IFDEF Stand} Parameters.ParamByName('@verclass').value:=2; {$ENDIF} {$IFDEF Support} Parameters.ParamByName('@verclass').value:=3; {$ENDIF} Parameters.ParamByName('@notid').value:=str; Open ; { qrymodule.LoadFromDataSet(tvmodule,[mtcpostructure,mtcpoProperties,mtcpoFieldIndex]); if not vold then begin first; while not eof do begin if qrymodule['是否明细'] then begin if not if_reg(qrymodule['fmoduleid']) then qrymodule.Delete else next; end else next; end; end; } end ; with t_sys_module_emp do begin Close ; SQL.Clear; SQL.Add('select * from t_sys_module_emp where 姓名='''+employee+''' order by forderid'); Open ; end ; Addmenu; menu_opseae.Visible:=qrymodule.Locate('fmoduleid',101,[]) ; menu_opseai.Visible:=qrymodule.Locate('fmoduleid',111,[]) ; menu_opair.Visible:=qrymodule.Locate('fmoduleid',121,[]) ; menu_opairi.Visible:=qrymodule.Locate('fmoduleid',131,[]) ; label14.Caption:=employee; label15.Caption:=FormatDateTime('hh',now)+':'+FormatDateTime('nn',now); { if not assigned(frm_chart_message) then frm_chart_message:=tfrm_chart_message.Create (Application); frm_chart_message.ManualDock(frm_main.SearchTabs('frm_chart_message',frm_chart_message.caption),nil,alClient); frm_chart_message.show ; } bsSkinPageControl1.ActivePage:=bsSkinTabSheet1 ; maintree.FullCollapse ; qrymodule.First ; if G_ZWCHK='TRUE' then begin N27.Visible:=false ; N28.Visible:=false ; N29.Visible:=false ; end ; inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini'); bsSkinPageControl2.ActivePageIndex:=inifile1.readinteger('View','tabindex',0); bsSkinPageControl2.OnChange(nil); CoolBar1.Visible:=inifile1.Readbool('other','toolbar',false); bsSkinMainMenuBar1.Visible:=inifile1.Readbool('other','toolbar',false); inifile1.free; // wdbdtmpckr1.Date:=Date-10; wdbdtmpckr2.Date:=Date; wdbdtmpckr1_finish.Date:=date-7; wdbdtmpckr2_finish.Date:=Date; initialTaskType(); bindtaskdata(); bliNitialOk:=True; end; procedure Tfrm_tree_main.ToolButton6Click(Sender: TObject); begin //关于系统 if not assigned(frm_sys_about) then frm_sys_about:=tfrm_sys_about.Create (self); frm_sys_about.Show; // 权限管理 { if not assigned(frm_sys_module) then frm_sys_module:=tfrm_sys_module.Create (self); frm_sys_module.ManualDock(frm_main.SearchTabs('frm_sys_module',frm_sys_module.caption),nil,alClient); frm_sys_module.show; } end; procedure Tfrm_tree_main.Act9390Execute(Sender: TObject); begin {$IFDEF DLFENZHANG} if not if_open('140') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_project_fee_cargomainfest) then frm_project_fee_cargomainfest:=tfrm_project_fee_cargomainfest.Create (self); frm_project_fee_cargomainfest.ManualDock(frm_main.SearchTabs('frm_project_fee_cargomainfest',frm_project_fee_cargomainfest.caption,'9390'),nil,alClient); frm_project_fee_cargomainfest.show; {$ENDIF} end; procedure Tfrm_tree_main.bsSkinPageControl1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var Index: Integer; begin if (Button = mbRIght) then begin Index := bsSkinPageControl1.IndexOfTabAt(X,Y); if Index >= 2 then begin popupclose.Popup( mouse.CursorPos.X, mouse.CursorPos.Y); CloseSheet:=bsSkinPageControl1.Pages[Index]; end else CloseSheet:=nil ; end; end; procedure Tfrm_tree_main.popclose_closeClick(Sender: TObject); var i:integer ; begin if CloseSheet<>nil then for i:=0 to CloseSheet.ControlCount-1 do if CloseSheet.controls[i].Name=CloseSheet.Hint then Tform(CloseSheet.controls[i]).Close ; end; procedure Tfrm_tree_main.ToolButton11Click(Sender: TObject); begin // if OpenDialog1.Execute then // frm_main.bsSkinData1.LoadFromFile(OpenDialog1.FileName); end; function Tfrm_tree_main.delmenu(menu:TMenuItem):boolean; var str:string; begin while(menu.Count >0) do begin str:= menu.Items[0].Name ; if menu.Items[0].Count >0 then begin delmenu(menu.Items[0]); end else begin menu.Items[0].Free ; end; end; end; procedure Tfrm_tree_main.replmenu; begin while(MMModule.Items.Count >0) do begin delmenu(MMModule.Items[0]); MMModule.Items[0].Free; end; addmenu ; menu_opseae.Visible:=qrymodule.Locate('fmoduleid',101,[]) ; menu_opseai.Visible:=qrymodule.Locate('fmoduleid',111,[]) ; menu_opair.Visible:=qrymodule.Locate('fmoduleid',121,[]) ; menu_opairi.Visible:=qrymodule.Locate('fmoduleid',131,[]) ; label14.Caption:=employee; label15.Caption:=FormatDateTime('hh',now)+':'+FormatDateTime('nn',now); end; procedure Tfrm_tree_main.Act515Execute(Sender: TObject); begin {$IFDEF YWTAIZHANG} if not if_open('150',515) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_tai_seae_pin) then frm_rp_tai_seae_pin:=tfrm_rp_tai_seae_pin.Create (self); frm_rp_tai_seae_pin.ManualDock(frm_main.SearchTabs('frm_rp_tai_seae_pin',frm_rp_tai_seae_pin.caption,'515'),nil,alClient); frm_rp_tai_seae_pin.show; {$ENDIF} end; procedure Tfrm_tree_main.Act18Execute(Sender: TObject); begin act22.Execute ; end; procedure Tfrm_tree_main.Act547Execute(Sender: TObject); begin if not if_open('194',547) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_dui_accept) then frm_rp_dui_accept:=tfrm_rp_dui_accept.Create (self); frm_rp_dui_accept.ManualDock(frm_main.SearchTabs('frm_rp_dui_accept',frm_rp_dui_accept.caption,'547'),nil,alClient); frm_rp_dui_accept.show; end; procedure Tfrm_tree_main.Act548Execute(Sender: TObject); begin if not if_open('195',548) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_dui_pay) then frm_rp_dui_pay:=tfrm_rp_dui_pay.Create (self); frm_rp_dui_pay.ManualDock(frm_main.SearchTabs('frm_rp_dui_pay',frm_rp_dui_pay.caption,'548'),nil,alClient); frm_rp_dui_pay.show; end; procedure Tfrm_tree_main.Act5381Execute(Sender: TObject); begin {$IFDEF TBQITA} if not if_open('049',5381) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zou_seae) then frm_rp_zou_seae:=tfrm_rp_zou_seae.Create (self); frm_rp_zou_seae.ManualDock(frm_main.SearchTabs('frm_rp_zou_seae',frm_rp_zou_seae.caption,'5381'),nil,alClient); frm_rp_zou_seae.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5382Execute(Sender: TObject); begin {$IFDEF TBQITA} if not if_open('068',5382) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zou_seai) then frm_rp_zou_seai:=tfrm_rp_zou_seai.Create (self); frm_rp_zou_seai.ManualDock(frm_main.SearchTabs('frm_rp_zou_seai',frm_rp_zou_seai.caption,'5382'),nil,alClient); frm_rp_zou_seai.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5383Execute(Sender: TObject); begin {$IFDEF TBQITA} { if not if_open('112',5383) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zou_aire) then frm_rp_zou_aire:=tfrm_rp_zou_aire.Create (self); frm_rp_zou_aire.ManualDock(frm_main.SearchTabs('frm_rp_zou_aire',frm_rp_zou_aire.caption,'5383'),nil,alClient); frm_rp_zou_aire.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act5384Execute(Sender: TObject); begin {$IFDEF TBQITA} { if not if_open('113',5384) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zou_airi) then frm_rp_zou_airi:=tfrm_rp_zou_airi.Create (self); frm_rp_zou_airi.ManualDock(frm_main.SearchTabs('frm_rp_zou_airi',frm_rp_zou_airi.caption,'5384'),nil,alClient); frm_rp_zou_airi.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act5391Execute(Sender: TObject); begin if not if_open('049',5391) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_yunjia_seae) then frm_rp_yunjia_seae:=tfrm_rp_yunjia_seae.Create (self); frm_rp_yunjia_seae.ManualDock(frm_main.SearchTabs('frm_rp_yunjia_seae',frm_rp_yunjia_seae.caption,'5391'),nil,alClient); frm_rp_yunjia_seae.show; end; procedure Tfrm_tree_main.Act5392Execute(Sender: TObject); begin if not if_open('049',5392) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_yunfeibl_seae) then frm_rp_yunfeibl_seae:=tfrm_rp_yunfeibl_seae.Create (self); frm_rp_yunfeibl_seae.ManualDock(frm_main.SearchTabs('frm_rp_yunfeibl_seae',frm_rp_yunfeibl_seae.caption,'5392'),nil,alClient); frm_rp_yunfeibl_seae.show; end; procedure Tfrm_tree_main.Act5401Execute(Sender: TObject); begin {$IFDEF TBQITA} if not if_open('050',5401) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fen_seae) then frm_rp_fen_seae:=tfrm_rp_fen_seae.Create (self); frm_rp_fen_seae.ManualDock(frm_main.SearchTabs('frm_rp_fen_seae',frm_rp_fen_seae.caption,'5401'),nil,alClient); frm_rp_fen_seae.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5402Execute(Sender: TObject); begin {$IFDEF TBQITA} if not if_open('069',5402) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fen_seai) then frm_rp_fen_seai:=tfrm_rp_fen_seai.Create (self); frm_rp_fen_seai.ManualDock(frm_main.SearchTabs('frm_rp_fen_seai',frm_rp_fen_seai.caption,'5402'),nil,alClient); frm_rp_fen_seai.show; {$ENDIF} end; procedure Tfrm_tree_main.Act5403Execute(Sender: TObject); begin {$IFDEF TBQITA} { if not if_open('115',5403) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fen_aire) then frm_rp_fen_aire:=tfrm_rp_fen_aire.Create (self); frm_rp_fen_aire.ManualDock(frm_main.SearchTabs('frm_rp_fen_aire',frm_rp_fen_aire.caption,'5403'),nil,alClient); frm_rp_fen_aire.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act5404Execute(Sender: TObject); begin {$IFDEF TBQITA} { if not if_open('116',5404) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fen_airi) then frm_rp_fen_airi:=tfrm_rp_fen_airi.Create (self); frm_rp_fen_airi.ManualDock(frm_main.SearchTabs('frm_rp_fen_airi',frm_rp_fen_airi.caption,'5404'),nil,alClient); frm_rp_fen_airi.show; } {$ENDIF} end; function Tfrm_tree_main.freesheeet: boolean; var i:integer ; mysheet:TTabSheet ; begin result:=true ; if bsSkinPageControl1.PageCount<=1 then exit ; try while bsSkinPageControl1.PageCount>1 do begin mysheet:=bsSkinPageControl1.Pages[1]; for i:=0 to mysheet.ControlCount-1 do if MySheet.controls[i].Name=MySheet.Hint then Tform(MYSheet.controls[i]).Close ; end ; result:=true ; except showmessage('窗体关闭出错!请重新启动计算机!'); result:=false ; end ; end; procedure Tfrm_tree_main.Act215Execute(Sender: TObject); begin if not if_open('262') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_bunk) then frm_info_bunk:=tfrm_info_bunk.Create (self); frm_info_bunk.ManualDock(frm_main.SearchTabs('frm_info_bunk',frm_info_bunk.caption),nil,alClient); frm_info_bunk.show; end; procedure Tfrm_tree_main.Act5210Execute(Sender: TObject); begin {$IFDEF QFYDFENXI} if not if_open('043',5210) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_no_monthtotal) then frm_rp_no_monthtotal:=tfrm_rp_no_monthtotal.Create (self); frm_rp_no_monthtotal.ManualDock(frm_main.SearchTabs('frm_rp_no_monthtotal',frm_rp_no_monthtotal.caption,'5210'),nil,alClient); frm_rp_no_monthtotal.show; {$ENDIF} end; procedure Tfrm_tree_main.Act4011Execute(Sender: TObject); begin if not (if_open('027',4011) or if_open('146') or if_open('332') or if_open('337') ) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_close) then frm_op_seae_close:=tfrm_op_seae_close.Create (self); frm_op_seae_close.ManualDock(frm_main.SearchTabs('frm_op_seae_close',frm_op_seae_close.caption,'4011'),nil,alClient); frm_op_seae_close.show; end; procedure Tfrm_tree_main.Act4012Execute(Sender: TObject); begin if not (if_open('061') or if_open('147') or if_open('333') or if_open('338')) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seai_close) then frm_op_seai_close:=tfrm_op_seai_close.Create (self); frm_op_seai_close.ManualDock(frm_main.SearchTabs('frm_op_seai_close',frm_op_seai_close.caption,'4012'),nil,alClient); frm_op_seai_close.show; end; procedure Tfrm_tree_main.Act4013Execute(Sender: TObject); begin { if not (if_open('079') or if_open('148') or if_open('334') or if_open('339') ) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_aire_close) then frm_op_aire_close:=tfrm_op_aire_close.Create (self); frm_op_aire_close.ManualDock(frm_main.SearchTabs('frm_op_aire_close',frm_op_aire_close.caption,'4013'),nil,alClient); frm_op_aire_close.show; } end; procedure Tfrm_tree_main.Act4014Execute(Sender: TObject); begin { if not (if_open('087') or if_open('149') or if_open('335') or if_open('340') ) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_airi_close) then frm_op_airi_close:=tfrm_op_airi_close.Create (self); frm_op_airi_close.ManualDock(frm_main.SearchTabs('frm_op_airi_close',frm_op_airi_close.caption,'4014'),nil,alClient); frm_op_airi_close.show; } end; procedure Tfrm_tree_main.Act4015Execute(Sender: TObject); begin {$IFDEF JGCHE} { if not (if_open('235') or if_open('236') or if_open('336') or if_open('341') ) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_airtruck_close) then frm_op_airtruck_close:=tfrm_op_airtruck_close.Create (self); frm_op_airtruck_close.ManualDock(frm_main.SearchTabs('frm_op_airtruck_close',frm_op_airtruck_close.caption,'4015'),nil,alClient); frm_op_airtruck_close.show; } {$ENDIF} end; procedure Tfrm_tree_main.FormClose(Sender: TObject; var Action: TCloseAction); begin p_view.Close; qrymodule.close; action:=caFree; end; procedure Tfrm_tree_main.bsSkinPageControl2Change(Sender: TObject); begin if bsSkinPageControl2.ActivePage=tabtree then begin ToolButton12.Enabled:=true; ToolButton12.ImageIndex:=9; ToolButton12.Caption:='添加收藏'; end else if bsSkinPageControl2.ActivePage=tabfav then begin ToolButton12.Enabled:=true; ToolButton12.ImageIndex:=10; ToolButton12.Caption:='删除收藏'; ListView1.Items.Clear; adddx; end else begin ToolButton12.Enabled:=false; end; end; procedure Tfrm_tree_main.addlvemp(myid: integer); begin if t_sys_module_emp.Locate('fmoduleid',myid,[]) then begin t_sys_module_emp.edit; t_sys_module_emp['是否启用']:=1; t_sys_module_emp.Post; end else begin t_sys_module_emp.Insert; t_sys_module_emp['fmoduleid']:=myid; t_sys_module_emp['姓名']:=employee; t_sys_module_emp['是否启用']:=1; t_sys_module_emp['forderid']:=t_sys_module_emp.RecordCount+1; t_sys_module_emp.Post; end; end; procedure Tfrm_tree_main.dellvemp(myid: integer); begin if t_sys_module_emp.Locate('fmoduleid',myid,[]) then begin t_sys_module_emp.Delete; end; end; procedure Tfrm_tree_main.ToolButton12Click(Sender: TObject); var tabname:string; begin if ListView1.Items.Count=0 then begin MessageDlg('只有打开明细模块才能添加或删除收藏!',mtWarning,[mbOK],0); exit; end; if bsSkinPageControl1.ActivePageIndex=0 then begin if ListView1.Selected.ImageIndex=1 then begin MessageDlg('只有明细模块才能收藏!',mtWarning,[mbOK],0); exit; end; end; if bsSkinPageControl1.ActivePageIndex=0 then tabname:=trim(ListView1.Selected.SubItems[1]) else tabname:=copy(trim(bsSkinPageControl1.Pages[bsSkinPageControl1.ActivePageIndex].name),4,length(trim(bsSkinPageControl1.Pages[bsSkinPageControl1.ActivePageIndex].name))-3); if bsSkinPageControl2.ActivePage=tabtree then begin addlvemp(strtoint(tabname)); end else if bsSkinPageControl2.ActivePage=tabfav then begin dellvemp(strtoint(tabname)); end; adddx; end; procedure Tfrm_tree_main.adddx; var i:integer; MItem: TdxSideBarItem ; Mgroup:TdxSideGroup ; function getPcaption(pid:integer):string; begin with qrytmp do begin Close;SQL.Clear; SQL.Add('select 模块名称 from t_sys_module where fmoduleid='+inttostr(pid)); Open; result:=FieldByName('模块名称').AsString; end; end; begin with p_sys_module_emp do //p_userRight begin Close ; Parameters.ParamByName('@oper').value:=employee ; Open ; end ; dxbar_main.Groups.Clear; Mgroup:=dxbar_main.Groups.add; Mgroup.Caption:='我的收藏'; i:=0; p_sys_module_emp.First; while not p_sys_module_emp.Eof do begin MItem:=Mgroup.Items.Add ; MItem.Caption:=getPcaption(p_sys_module_emp.fieldbyname('pid').Asinteger)+'\'+p_sys_module_emp.fieldbyname('模块名称').AsString; // MItem.Caption:=p_sys_module_emp.fieldbyname('模块名称').AsString; MItem.LargeImage:=1; MItem.Index:=i; i:=i+1; MItem.CustomData:=p_sys_module_emp.fieldbyname('fmoduleid').AsString; p_sys_module_emp.Next; end; end; procedure Tfrm_tree_main.dxbar_mainItemClick(Sender: TObject; Item: TdxSideBarItem); var myid,myaction:string; i:integer; ListItem:Tlistitem; begin ListView1.Items.Clear ; ListItem:=ListView1.items.Add ; ListItem.Caption:=item.caption ; ListItem.SubItems.add(item.caption) ; ListItem.SubItems.add(item.CustomData); ListItem.ImageIndex:=0 ; myid:=item.CustomData; myaction:='Act'+myid; with ActionList1 do for i:=0 to ActionCount-1 do if Actions[i].Name=myaction then begin Actions[i].Execute ; break ; end ; end; procedure Tfrm_tree_main.N1Click(Sender: TObject); var ListItem:TListItem; i:integer; begin frm_sys_dxbar_sort:=tfrm_sys_dxbar_sort.create(self); try frm_sys_dxbar_sort.ListView1.Items.Clear; with p_sys_module_emp do //p_userRight begin Close ; Parameters.ParamByName('@oper').value:=employee ; Open ; end ; frm_sys_dxbar_sort.ListView1.Items.Clear; for i:=0 to dxbar_main.Groups[0].ItemCount-1 do begin ListItem:=frm_sys_dxbar_sort.ListView1.Items.Add ; ListItem.Caption:=dxbar_main.Groups[0].Items[i].Caption ; ListItem.SubItems.add(dxbar_main.Groups[0].Items[i].CustomData) ; ListItem.ImageIndex:=1 ; end; { p_sys_module_emp.First; while not p_sys_module_emp.Eof do begin ListItem:=frm_sys_dxbar_sort.ListView1.Items.Add ; ListItem.Caption:=p_sys_module_emp.fieldbyname('模块名称').asstring ; ListItem.SubItems.add(p_sys_module_emp.fieldbyname('fmoduleid').AsString) ; ListItem.ImageIndex:=1 ; p_sys_module_emp.Next; end; } frm_sys_dxbar_sort.ShowModal; if frm_sys_dxbar_sort.ModalResult=mrok then begin for i:=0 to frm_sys_dxbar_sort.ListView1.Items.Count-1 do begin if t_sys_module_emp.Locate('fmoduleid',frm_sys_dxbar_sort.ListView1.Items[i].SubItems[0],[]) then begin t_sys_module_emp.edit; t_sys_module_emp['forderid']:=i+1; t_sys_module_emp.Post; end; end; end; adddx; finally FreeAndNil(frm_sys_dxbar_sort); end; end; procedure Tfrm_tree_main.Act307Execute(Sender: TObject); begin if not if_open('178') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_unlock) then frm_op_seae_unlock:=tfrm_op_seae_unlock.Create (self); frm_op_seae_unlock.ManualDock(frm_main.SearchTabs('frm_op_seae_unlock',frm_op_seae_unlock.caption,'307'),nil,alClient); frm_op_seae_unlock.show; end; procedure Tfrm_tree_main.Act947Execute(Sender: TObject); begin if not if_open('170') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_sys_printset:=tfrm_sys_printset.Create (self); frm_sys_printset.ShowModal; finally frm_sys_printset.Free; end; end; procedure Tfrm_tree_main.Act5405Execute(Sender: TObject); begin if not (if_open('280')) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_hl_histry) then frm_rp_hl_histry:=tfrm_rp_hl_histry.Create (self); frm_rp_hl_histry.ManualDock(frm_main.SearchTabs('frm_rp_hl_histry',frm_rp_hl_histry.caption,'5405'),nil,alClient); frm_rp_hl_histry.show; end; procedure Tfrm_tree_main.Act191Execute(Sender: TObject); begin {$IFDEF FPSHENQING} if not if_open('028') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice_shen) then frm_ch_invoice_shen:=tfrm_ch_invoice_shen.Create (self); frm_ch_invoice_shen.ManualDock(frm_main.SearchTabs('frm_ch_invoice_shen',frm_ch_invoice_shen.caption,'191'),nil,alClient); frm_ch_invoice_shen.show; {$ENDIF} end; procedure Tfrm_tree_main.Act192Execute(Sender: TObject); begin {$IFDEF FFLIUCHENG} if not if_open('036') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_check_shen) then frm_ch_check_shen:=tfrm_ch_check_shen.Create (self); frm_ch_check_shen.ManualDock(frm_main.SearchTabs('frm_ch_check_shen',frm_ch_check_shen.caption,'192'),nil,alClient); frm_ch_check_shen.show; {$ENDIF} end; procedure Tfrm_tree_main.Act948Execute(Sender: TObject); begin if not if_open('285') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_sys_noset) then frm_sys_noset:=tfrm_sys_noset.Create (self); frm_sys_noset.ShowModal; finally FreeAndNil(frm_sys_noset); end; end; procedure Tfrm_tree_main.Act974Execute(Sender: TObject); begin frm_code_port_load:=tfrm_code_port_load.Create (self); try frm_code_port_load.ShowModal; finally FreeAndNil(frm_code_port_load); end; end; procedure Tfrm_tree_main.Act78Execute(Sender: TObject); begin if not if_open('181') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_crm_client_special) then frm_crm_client_special:=tfrm_crm_client_special.Create (self); frm_crm_client_special.ShowModal; finally frm_crm_client_special.free; frm_crm_client_special:=nil; end; end; procedure Tfrm_tree_main.Act245Execute(Sender: TObject); begin {$IFDEF XSGUANLI} if not if_open('232') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_sales_profit_Lx) then frm_rp_sales_profit_Lx:=tfrm_rp_sales_profit_Lx.Create(self); frm_rp_sales_profit_Lx.ManualDock(frm_main.SearchTabs('frm_rp_sales_profit_lx',frm_rp_sales_profit_Lx.caption),nil,alClient); frm_rp_sales_profit_Lx.show; {$ENDIF} end; procedure Tfrm_tree_main.Act402Execute(Sender: TObject); begin {$IFDEF WLZHANG} if not if_open('286') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_ch_genleg:=tfrm_ch_genleg.Create (self); frm_ch_genleg.ShowModal; finally frm_ch_genleg.free; frm_ch_genleg:=nil; end; {$ENDIF} end; procedure Tfrm_tree_main.Act549Execute(Sender: TObject); begin {$IFDEF WLZHANG} if not if_open('287') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_genleg) then frm_rp_ch_genleg:=tfrm_rp_ch_genleg.Create (self); frm_rp_ch_genleg.ManualDock(frm_main.SearchTabs('frm_rp_ch_genleg',frm_rp_ch_genleg.caption),nil,alClient); frm_rp_ch_genleg.show; {$ENDIF} end; procedure Tfrm_tree_main.Act1010Execute(Sender: TObject); begin if not if_open('014') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_tdqr) then frm_op_seae_tdqr:=tfrm_op_seae_tdqr.Create (self); frm_op_seae_tdqr.ManualDock(frm_main.SearchTabs('frm_op_seae_tdqr',frm_op_seae_tdqr.caption),nil,alClient); frm_op_seae_tdqr.show; end; procedure Tfrm_tree_main.Act156Execute(Sender: TObject); begin {$IFDEF SJBAOGUAN} if not if_open('288') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_apply) then frm_op_apply:=tfrm_op_apply.Create (self); frm_op_apply.ManualDock(frm_main.SearchTabs('frm_op_apply',frm_op_apply.caption),nil,alClient); frm_op_apply.show; {$ENDIF} end; procedure Tfrm_tree_main.Act949Execute(Sender: TObject); begin if not if_open('096') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_zlset) then frm_code_zlset:=tfrm_code_zlset.Create (self); frm_code_zlset.ShowModal; finally FreeAndNil(frm_code_zlset); end; end; procedure Tfrm_tree_main.Act491Execute(Sender: TObject); begin {$IFDEF WLZHANG} if not if_open('289') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; frmAccCloseOff:=TfrmAccCloseOff.create(self); try frmAccCloseOff.showmodal; finally FreeAndNil(frmAccCloseOff); end; {$ENDIF} end; procedure Tfrm_tree_main.Act492Execute(Sender: TObject); begin {$IFDEF WLZHANG} if not if_open('290') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; frmAccCloseOffBack:=TfrmAccCloseOffBack.create(self); try frmAccCloseOffBack.showmodal; finally FreeAndNil(frmAccCloseOffBack); end; {$ENDIF} end; procedure Tfrm_tree_main.Act5491Execute(Sender: TObject); begin {$IFDEF WLZHANG} if not if_open('291') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_wl_total) then frm_rp_wl_total:=tfrm_rp_wl_total.Create (self); frm_rp_wl_total.ManualDock(frm_main.SearchTabs('frm_rp_wl_total',frm_rp_wl_total.caption),nil,alClient); frm_rp_wl_total.show; {$ENDIF} end; procedure Tfrm_tree_main.Act25Execute(Sender: TObject); begin {$IFDEF DCKA} if not if_open('301') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_weituo) then frm_op_seae_weituo:=tfrm_op_seae_weituo.Create (self); frm_op_seae_weituo.ManualDock(frm_main.SearchTabs('frm_op_seae_weituo',frm_op_seae_weituo.caption),nil,alClient); frm_op_seae_weituo.show; {$ENDIF} end; procedure Tfrm_tree_main.Act308Execute(Sender: TObject); begin {$IFDEF DCKA} if not if_open('302') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_order) then frm_op_seae_order:=tfrm_op_seae_order.Create (self); frm_op_seae_order.ManualDock(frm_main.SearchTabs('frm_op_seae_order',frm_op_seae_order.caption),nil,alClient); frm_op_seae_order.show; {$ENDIF} end; procedure Tfrm_tree_main.Act815Execute(Sender: TObject); begin {$IFDEF GZBAOGAO} { if not if_open('020') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_render_manager) then frm_info_render_manager:=tfrm_info_render_manager.Create (self); frm_info_render_manager.ManualDock(frm_main.SearchTabs('frm_info_render_manager',frm_info_render_manager.caption),nil,alClient); frm_info_render_manager.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act816Execute(Sender: TObject); begin {$IFDEF GRXINXI} {$ENDIF} end; procedure Tfrm_tree_main.Act975Execute(Sender: TObject); begin {$IFDEF EDI} if not if_open('179') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_edi_port) then frm_code_edi_port:=tfrm_code_edi_port.Create (self); frm_code_edi_port.ShowModal; finally frm_code_edi_port.free; frm_code_edi_port:=NIL; end; {$ENDIF} end; procedure Tfrm_tree_main.Act5492Execute(Sender: TObject); begin if not if_open('303') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_ch_balance_detail) then frm_rp_ch_balance_detail:=tfrm_rp_ch_balance_detail.Create (self); frm_rp_ch_balance_detail.ManualDock(frm_main.SearchTabs('frm_rp_ch_balance_detail',frm_rp_ch_balance_detail.caption),nil,alClient); frm_rp_ch_balance_detail.show; end; procedure Tfrm_tree_main.Act976Execute(Sender: TObject); begin try frm_code_airtrade:=tfrm_code_airtrade.Create (self); frm_code_airtrade.ShowModal; finally frm_code_airtrade.Free; end; end; procedure Tfrm_tree_main.Act817Execute(Sender: TObject); begin {$IFDEF BGXITONG} { if not if_open('305') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_luntan) then frm_info_luntan:=tfrm_info_luntan.Create (self); frm_info_luntan.ManualDock(frm_main.SearchTabs('frm_info_luntan',frm_info_luntan.caption,'817'),nil,alClient); frm_info_luntan.show; } {$ENDIF} end; procedure Tfrm_tree_main.Act5351Execute(Sender: TObject); begin {$IFDEF DLFENZHANG} if not if_open('156') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_fenzhang) then frm_rp_fenzhang:=tfrm_rp_fenzhang.Create (self); frm_rp_fenzhang.ManualDock(frm_main.SearchTabs('frm_rp_fenzhang',frm_rp_fenzhang.caption),nil,alClient); frm_rp_fenzhang.show; {$ENDIF} end; procedure Tfrm_tree_main.Act493Execute(Sender: TObject); begin if not if_open('306') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_fangdan) then frm_op_seae_fangdan:=tfrm_op_seae_fangdan.Create (self); frm_op_seae_fangdan.ManualDock(frm_main.SearchTabs('frm_op_seae_fangdan',frm_op_seae_fangdan.caption),nil,alClient); frm_op_seae_fangdan.show; end; procedure Tfrm_tree_main.Act309Execute(Sender: TObject); begin if not if_open('307') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_fangdan) then frm_op_seae_fangdan:=tfrm_op_seae_fangdan.Create (self); frm_op_seae_fangdan.ManualDock(frm_main.SearchTabs('frm_op_seae_fangdan',frm_op_seae_fangdan.caption),nil,alClient); frm_op_seae_fangdan.show; end; procedure Tfrm_tree_main.Act5324Execute(Sender: TObject); begin if not if_open('308') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_pin_total) then frm_rp_pin_total:=tfrm_rp_pin_total.Create (self); frm_rp_pin_total.ManualDock(frm_main.SearchTabs('frm_rp_pin_total',frm_rp_pin_total.caption),nil,alClient); frm_rp_pin_total.show; end; procedure Tfrm_tree_main.Act977Execute(Sender: TObject); begin if not if_open('153') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_letter) then frm_code_letter:=tfrm_code_letter.Create (self); frm_code_letter.ShowModal; finally frm_code_letter.free; frm_code_letter:=NIL; end; end; procedure Tfrm_tree_main.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); begin WebBrowser1.OleObject.Document.Body.Scroll := 'yes'; end; procedure Tfrm_tree_main.Act416Execute(Sender: TObject); begin if not if_open('311') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice_hexiao) then frm_ch_invoice_hexiao:=tfrm_ch_invoice_hexiao.Create (self); frm_ch_invoice_hexiao.ManualDock(frm_main.SearchTabs('frm_ch_invoice_hexiao',frm_ch_invoice_hexiao.caption),nil,alClient); frm_ch_invoice_hexiao.show; end; procedure Tfrm_tree_main.Act3001Execute(Sender: TObject); begin if not if_open('312') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_state_view) then frm_op_state_view:=tfrm_op_state_view.Create (self); frm_op_state_view.ManualDock(frm_main.SearchTabs('frm_op_state_view',frm_op_state_view.caption),nil,alClient); frm_op_state_view.show; end; procedure Tfrm_tree_main.Act31001Execute(Sender: TObject); begin if not if_open('315') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_web_order) then frm_op_seae_web_order:=tfrm_op_seae_web_order.Create (self); frm_op_seae_web_order.ManualDock(frm_main.SearchTabs('frm_op_seae_web_order',frm_op_seae_web_order.caption),nil,alClient); frm_op_seae_web_order.show; end; procedure Tfrm_tree_main.Act31002Execute(Sender: TObject); begin if not if_open('316') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seai_order) then frm_op_seai_order:=tfrm_op_seai_order.Create (self); frm_op_seai_order.ManualDock(frm_main.SearchTabs('frm_op_seai_order',frm_op_seai_order.caption),nil,alClient); frm_op_seai_order.show; end; procedure Tfrm_tree_main.Act31003Execute(Sender: TObject); begin { if not if_open('317') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_aire_order) then frm_op_aire_order:=tfrm_op_aire_order.Create (self); frm_op_aire_order.ManualDock(frm_main.SearchTabs('frm_op_aire_order',frm_op_aire_order.caption),nil,alClient); frm_op_aire_order.show; } end; procedure Tfrm_tree_main.Act31004Execute(Sender: TObject); begin { if not if_open('317') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_airi_order) then frm_op_airi_order:=tfrm_op_airi_order.Create (self); frm_op_airi_order.ManualDock(frm_main.SearchTabs('frm_op_airi_order',frm_op_airi_order.caption),nil,alClient); frm_op_airi_order.show; } end; procedure Tfrm_tree_main.Act19901Execute(Sender: TObject); begin { if not if_open('319') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_railway) then frm_op_railway:=tfrm_op_railway.Create (self); frm_op_railway.ManualDock(frm_main.SearchTabs('frm_op_railway',frm_op_railway.caption),nil,alClient); frm_op_railway.show; } end; procedure Tfrm_tree_main.Act980Execute(Sender: TObject); begin { if not if_open('320') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_railwayctnsource) then frm_code_railwayctnsource:=tfrm_code_railwayctnsource.Create (self); frm_code_railwayctnsource.ShowModal; finally FreeAndNil(frm_code_railwayctnsource); end; } end; procedure Tfrm_tree_main.Act981Execute(Sender: TObject); begin { if not if_open('321') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_railport) then frm_code_railport:=tfrm_code_railport.Create (self); frm_code_railport.ShowModal; finally FreeAndNil(frm_code_railport); end; } end; procedure Tfrm_tree_main.Act30118Execute(Sender: TObject); begin { if not assigned(frm_ch_fee_check_railway) then frm_ch_fee_check_railway:=tfrm_ch_fee_check_railway.Create (self); frm_ch_fee_check_railway.ManualDock(frm_main.SearchTabs('frm_ch_fee_check_railway',frm_ch_fee_check_railway.caption,'30118'),nil,alClient); frm_ch_fee_check_railway.show; } end; procedure Tfrm_tree_main.Act4020Execute(Sender: TObject); begin { if not assigned(frm_op_railway_close) then frm_op_railway_close:=tfrm_op_railway_close.Create (self); frm_op_railway_close.ManualDock(frm_main.SearchTabs('frm_op_railway_close',frm_op_railway_close.caption,'4020'),nil,alClient); frm_op_railway_close.show; } end; procedure Tfrm_tree_main.Act157Execute(Sender: TObject); begin { if not assigned(frm_op_railway_apply) then frm_op_railway_apply:=tfrm_op_railway_apply.Create (self); frm_op_railway_apply.ManualDock(frm_main.SearchTabs('frm_op_railway_apply',frm_op_railway_apply.caption,'157'),nil,alClient); frm_op_railway_apply.show; } end; procedure Tfrm_tree_main.Act158Execute(Sender: TObject); begin {$IFDEF TSQUEREN} if not if_open('327') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seai_fuhui) then frm_op_seai_fuhui:=tfrm_op_seai_fuhui.Create (self); frm_op_seai_fuhui.ManualDock(frm_main.SearchTabs('frm_op_seai_fuhui',frm_op_seai_fuhui.caption,'158'),nil,alClient); frm_op_seai_fuhui.show; {$ENDIF} end; procedure Tfrm_tree_main.Act982Execute(Sender: TObject); begin { if not if_open('328') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_railwaypath) then frm_code_railwaypath:=tfrm_code_railwaypath.Create (self); frm_code_railwaypath.ShowModal; finally FreeAndNil(frm_code_railwaypath); end; } end; procedure Tfrm_tree_main.Act200Execute(Sender: TObject); begin { if not if_open('161') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; } if not assigned(frm_op_truck) then frm_op_truck:=tfrm_op_truck.Create (self); frm_op_truck.ManualDock(frm_main.SearchTabs('frm_op_truck',frm_op_truck.caption),nil,alClient); frm_op_truck.show; end; procedure Tfrm_tree_main.Act978Execute(Sender: TObject); begin try if not assigned(frm_code_truck_client) then frm_code_truck_client:=tfrm_code_truck_client.Create (self); frm_code_truck_client.ShowModal; finally FreeAndNil(frm_code_truck_client); end; end; procedure Tfrm_tree_main.Act979Execute(Sender: TObject); begin try if not assigned(frm_code_truck_changzhan) then frm_code_truck_changzhan:=tfrm_code_truck_changzhan.Create (self); frm_code_truck_changzhan.ShowModal; finally FreeAndNil(frm_code_truck_changzhan); end; end; procedure Tfrm_tree_main.Act1082Execute(Sender: TObject); begin if not if_open('331') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_list) then frm_op_seae_list:=tfrm_op_seae_list.Create (self); frm_op_seae_list.ManualDock(frm_main.SearchTabs('frm_op_seae_list',frm_op_seae_list.caption),nil,alClient); frm_op_seae_list.show; end; procedure Tfrm_tree_main.Act9392Execute(Sender: TObject); begin try if not assigned(frm_code_stlmode) then frm_code_stlmode:=tfrm_code_stlmode.Create (self); frm_code_stlmode.ShowModal; finally FreeAndNil(frm_code_stlmode); end; end; procedure Tfrm_tree_main.Act494Execute(Sender: TObject); begin if not if_open('344') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_cust_befbal) then frm_ch_cust_befbal:=tfrm_ch_cust_befbal.Create (self); frm_ch_cust_befbal.ManualDock(frm_main.SearchTabs('frm_ch_cust_befbal',frm_ch_cust_befbal.caption),nil,alClient); frm_ch_cust_befbal.show; end; procedure Tfrm_tree_main.Act216Execute(Sender: TObject); var salecrmhd,main:thandle; begin salecrmhd:=FindProcessId('salecrm.exe'); if salecrmhd<>0 then begin main:=findwindow(nil,pchar('东胜运价管理系统 - [主控制台]')); if main<>0 then begin setforegroundwindow(main); end; { SendMessage(salecrmhd,WM_COMM,0,0); main:=FindWindowEx(0, 0, 'Tfrmmain', nil); if main<>0 then begin setforegroundwindow(main); end; } // setforegroundwindow(salecrmhd); // SendMessage(salecrmhd,WM_ACTIVATE,0,0); // SetForegroundWindow(salecrmhd); end else begin ShellExecute(Application.Handle,nil,PChar(ExtractFilePath(application.ExeName)+'salecrm.exe'),pchar(employee),pchar(emppassword),SW_HIDE); end; end; procedure Tfrm_tree_main.Act9331Execute(Sender: TObject); begin if not if_open('347') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try frm_code_fee_unit:=tfrm_code_fee_unit.Create (self); frm_code_fee_unit.ShowModal; finally frm_code_fee_unit.Free; end; end; procedure Tfrm_tree_main.Act482Execute(Sender: TObject); begin if not if_open('356') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_mblsignin) then frm_op_mblsignin:=Tfrm_op_mblsignin.Create (self); frm_op_mblsignin.op:=1; frm_op_mblsignin.ManualDock(frm_main.SearchTabs('frm_op_mblsignin',frm_op_mblsignin.caption),nil,alClient); frm_op_mblsignin.show; end; procedure Tfrm_tree_main.Act201Execute(Sender: TObject); begin if not if_open('355') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_mblsign) then frm_op_mblsign:=Tfrm_op_mblsign.Create (self); frm_op_mblsign.op:=0; frm_op_mblsign.ManualDock(frm_main.SearchTabs('frm_op_mblsign',frm_op_mblsign.caption),nil,alClient); frm_op_mblsign.show; end; procedure Tfrm_tree_main.Act483Execute(Sender: TObject); begin if not if_open('358') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_teshufandan) then frm_op_seae_teshufandan:=Tfrm_op_seae_teshufandan.Create (self); frm_op_seae_teshufandan.ManualDock(frm_main.SearchTabs('frm_op_seae_teshufandan',frm_op_seae_teshufandan.caption),nil,alClient); frm_op_seae_teshufandan.show; end; procedure Tfrm_tree_main.Act202Execute(Sender: TObject); begin if not if_open('357') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; tefangload:=false; if not assigned(frm_op_seae_teshufandan) then frm_op_seae_teshufandan:=Tfrm_op_seae_teshufandan.Create (self); frm_op_seae_teshufandan.ManualDock(frm_main.SearchTabs('frm_op_seae_teshufandan',frm_op_seae_teshufandan.caption),nil,alClient); frm_op_seae_teshufandan.show; end; procedure Tfrm_tree_main.Act312Execute(Sender: TObject); begin if not if_open('360') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_teshushenhe) then frm_op_seae_teshushenhe:=Tfrm_op_seae_teshushenhe.Create (self); frm_op_seae_teshushenhe.ManualDock(frm_main.SearchTabs('frm_op_seae_teshushenhe',frm_op_seae_teshushenhe.caption),nil,alClient); frm_op_seae_teshushenhe.show; end; procedure Tfrm_tree_main.Act246Execute(Sender: TObject); begin if not if_open('359') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_teshusales) then frm_op_seae_teshusales:=Tfrm_op_seae_teshusales.Create (self); frm_op_seae_teshusales.ManualDock(frm_main.SearchTabs('frm_op_seae_teshusales',frm_op_seae_teshusales.caption),nil,alClient); frm_op_seae_teshusales.show; end; procedure Tfrm_tree_main.Act313Execute(Sender: TObject); begin if not if_open('361') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_seae_teshufz) then frm_op_seae_teshufz:=Tfrm_op_seae_teshufz.Create (self); frm_op_seae_teshufz.ManualDock(frm_main.SearchTabs('frm_op_seae_teshufz',frm_op_seae_teshufz.caption),nil,alClient); frm_op_seae_teshufz.show; end; procedure Tfrm_tree_main.Act20308Execute(Sender: TObject); begin { if not if_open('400') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; } if not assigned(frm_op_seae_edi_data) then frm_op_seae_edi_data:=tfrm_op_seae_edi_data.Create(self); frm_op_seae_edi_data.ManualDock(frm_main.SearchTabs('frm_op_seae_edi_data',frm_op_seae_edi_data.caption,'20308'),nil,alClient); frm_op_seae_edi_data.show; end; procedure Tfrm_tree_main.ToolButton14Click(Sender: TObject); var _count:Integer; begin //点击打开服务端 待接收的业务列表。 { try frm_crm_OnLineBooking:=Tfrm_crm_OnLineBooking.Create (self); frm_crm_OnLineBooking.Caption:='在线订舱列表'; if (frm_crm_OnLineBooking.GetXML('0')>0) then begin frm_crm_OnLineBooking.ShowModal; end else begin ShowMessage('没有待获取的订舱信息'); end; finally frm_crm_OnLineBooking.Free; end; } try if not assigned(frm_crm_OnLineBooking) then begin frm_crm_OnLineBooking:=Tfrm_crm_OnLineBooking.Create (self); frm_crm_OnLineBooking.ManualDock(frm_main.SearchTabs('frm_crm_OnLineBooking',frm_crm_OnLineBooking.caption,'701'),nil,alClient); frm_crm_OnLineBooking.Caption:='在线订舱列表'; _count:=frm_crm_OnLineBooking.GetXML; frm_crm_OnLineBooking.Show; end else begin frm_crm_OnLineBooking.bsSkinButton10Click(self); end; finally //Form2.Free; end; end; procedure Tfrm_tree_main.N33Click(Sender: TObject); begin try frm_BookingLog := Tfrm_BookingLog.Create(self); frm_BookingLog.ShowModal; finally //showmessage(frm_crm_spxcompany.t_crm_spxcompany.FieldByName('客户全称').AsString); frm_BookingLog.Free; end; end; procedure Tfrm_tree_main.N17Click(Sender: TObject); begin //点击打开服务端 待接收的业务列表。 try frm_SetCompany:=Tfrm_SetCompany.Create (self); //if (frm_crm_OnLineBooking.GetXML>0) then begin frm_SetCompany.ShowModal; //end else begin // ShowMessage('没有待获取的订舱信息'); //end; finally frm_SetCompany.Free; end; end; procedure Tfrm_tree_main.N18Click(Sender: TObject); begin try frm_SelectLinkMan:=Tfrm_SelectLinkMan.Create (self); frm_SelectLinkMan.ShowModal; finally frm_SelectLinkMan.Free; end; end; procedure Tfrm_tree_main.N19Click(Sender: TObject); begin try frm_SelectLinkCompany:=Tfrm_SelectLinkCompany.Create (self); frm_SelectLinkCompany.ShowModal; finally frm_SelectLinkCompany.Free; end; end; procedure Tfrm_tree_main.Act5406Execute(Sender: TObject); begin if not assigned(frm_rp_rp_apply) then frm_rp_rp_apply:=Tfrm_rp_rp_apply.Create (self); frm_rp_rp_apply.ManualDock(frm_main.SearchTabs('frm_rp_rp_apply',frm_rp_rp_apply.caption),nil,alClient); frm_rp_rp_apply.show; end; procedure Tfrm_tree_main.Act9501Execute(Sender: TObject); begin if not assigned(frm_cust_mailproject) then frm_cust_mailproject:=Tfrm_cust_mailproject.Create (self); frm_cust_mailproject.ManualDock(frm_main.SearchTabs('frm_cust_mailproject',frm_cust_mailproject.caption),nil,alClient); frm_cust_mailproject.show; end; procedure Tfrm_tree_main.Act1901Execute(Sender: TObject); begin if not assigned(frm_rp_mail_log) then frm_rp_mail_log:=Tfrm_rp_mail_log.Create (self); frm_rp_mail_log.ManualDock(frm_main.SearchTabs('frm_rp_mail_log',frm_rp_mail_log.caption),nil,alClient); frm_rp_mail_log.show; end; procedure Tfrm_tree_main.Act5411Execute(Sender: TObject); begin if not assigned(frm_rp_cdfxg_total) then frm_rp_cdfxg_total:=Tfrm_rp_cdfxg_total.Create (self); frm_rp_cdfxg_total.ManualDock(frm_main.SearchTabs('frm_rp_cdfxg_total',frm_rp_cdfxg_total.caption),nil,alClient); frm_rp_cdfxg_total.show; end; /// /// 签单条管理 /// procedure Tfrm_tree_main.actAct1902Execute(Sender: TObject); begin // //if not if_open('427') then // begin // showmessage('对不起你没有此模块的操作权限!'); // exit; //end; if not assigned(frm_op_seae_sign) then frm_op_seae_sign:=Tfrm_op_seae_sign.Create (self); frm_op_seae_sign.ManualDock(frm_main.SearchTabs('frm_op_seae_sign',frm_op_seae_sign.caption),nil,alClient); frm_op_seae_sign.show; end; /// /// 签单条签字 /// procedure Tfrm_tree_main.Act1903Execute(Sender: TObject); begin // //if not if_open('427') then // begin // showmessage('对不起你没有此模块的操作权限!'); // exit; //end; if not assigned(frm_op_seae_signqdtlist) then frm_op_seae_signqdtlist:=Tfrm_op_seae_signqdtlist.Create (self); frm_op_seae_signqdtlist.ManualDock(frm_main.SearchTabs('frm_op_seae_signqdtlist',frm_op_seae_signqdtlist.caption,'428'),nil,alClient); frm_op_seae_signqdtlist.show; end; procedure Tfrm_tree_main.Act1904Execute(Sender: TObject); begin // end; /// ///签单条签出通知 /// procedure Tfrm_tree_main.Act1905Execute(Sender: TObject); begin if not assigned(frm_op_seae_signqtdnotify) then frm_op_seae_signqtdnotify:=Tfrm_op_seae_signqtdnotify.Create (self); frm_op_seae_signqtdnotify.ManualDock(frm_main.SearchTabs('frm_op_seae_signqtdnotify',frm_op_seae_signqtdnotify.caption,'430'),nil,alClient); frm_op_seae_signqtdnotify.show; end; /// /// 发票签发 /// procedure Tfrm_tree_main.Act1906Execute(Sender: TObject); begin if not assigned(frm_op_seae_invoice_sign) then frm_op_seae_invoice_sign:=Tfrm_op_seae_invoice_sign.Create (self); frm_op_seae_invoice_sign.ManualDock(frm_main.SearchTabs('frm_op_seae_invoice_sign',frm_op_seae_invoice_sign.caption,'431'),nil,alClient); frm_op_seae_invoice_sign.show; end; procedure Tfrm_tree_main.Act1911Execute(Sender: TObject); begin if not assigned(frm_op_seae_paper_manage) then frm_op_seae_paper_manage:=Tfrm_op_seae_paper_manage.Create (self); frm_op_seae_paper_manage.ManualDock(frm_main.SearchTabs('frm_op_seae_paper_manage',frm_op_seae_paper_manage.caption,'441'),nil,alClient); frm_op_seae_paper_manage.show; end; procedure Tfrm_tree_main.Act1912Execute(Sender: TObject); begin if not assigned(frm_op_seae_paper_print) then frm_op_seae_paper_print:=Tfrm_op_seae_paper_print.Create (self); frm_op_seae_paper_print.ManualDock(frm_main.SearchTabs('frm_op_seae_paper_print',frm_op_seae_paper_print.caption,'442'),nil,alClient); frm_op_seae_paper_print.show; end; /// /// 提单签入通知 /// procedure Tfrm_tree_main.Act1915Execute(Sender: TObject); begin if not assigned(frm_op_seae_paper_print_submitinfo) then frm_op_seae_paper_print_submitinfo:=Tfrm_op_seae_paper_print_submitinfo.Create (self); frm_op_seae_paper_print_submitinfo.ManualDock( frm_main.SearchTabs('frm_op_seae_paper_print_submitinfo' ,frm_op_seae_paper_print_submitinfo.caption,'445'),nil,alClient); frm_op_seae_paper_print_submitinfo.show; end; procedure Tfrm_tree_main.Act495Execute(Sender: TObject); begin // if not assigned(frm_ch_invoice_bankdata) then frm_ch_invoice_bankdata:=Tfrm_ch_invoice_bankdata.Create (self); frm_ch_invoice_bankdata.ManualDock(frm_main.SearchTabs('frm_ch_invoice_bankdata',frm_ch_invoice_bankdata.caption,'447'),nil,alClient); frm_ch_invoice_bankdata.show; end; procedure Tfrm_tree_main.initialTaskType(); var tmpnode,personNode,pubNode,finishNode: TTreeNode; strtype:string; typelist:TStringList; begin qry2TaskType.Active:=False; qry2TaskType.Active:=True; tv1.Items[0].DeleteChildren(); tv1.Items[1].DeleteChildren(); tv1.Items[2].DeleteChildren(); personNode:= tv1.Items[0]; pubNode:= tv1.Items[1]; finishNode:= tv1.Items[2]; typelist:=TStringList.Create; if(qry2TaskType.IsEmpty) then Exit; with qry2TaskType do begin qry2TaskType.First; while not Eof do begin strtype:= fieldbyname('任务类型').AsString; if( FieldByName('是否公共').AsBoolean=False) then begin tmpnode:= tv1.Items.AddChildObject(personNode,strtype,nil); tmpnode.SelectedIndex:=1; tmpnode.ImageIndex:=0; end else begin tmpnode:= tv1.Items.AddChildObject(pubNode,strtype,nil); tmpnode.SelectedIndex:=1; tmpnode.ImageIndex:=0; end; //已处理增加子节点 if(typelist.IndexOf(strtype)<0) then begin typelist.Add(strtype); tv1.Items.AddChildObject(finishNode,strtype,nil); end; Next; end; end; end; procedure Tfrm_tree_main.bindtaskdata(); var sql,sqlwhere,strtj1,strtj2,strtj3_qx:string; selNode:TTreeNode; begin sql:='select t.*,s.委托单位,s.是否换签,s.开船日期,s.委托编号,s.签单方式 from [t_op_task] t left join t_op_seae s on t.SEA编号=s.编号 '; strtj1:=''; strtj2:=''; if( employee='DEMO-SA')then begin dxdbgrdclmndxdbgrd1Column6.Visible:=True; strtj3_qx:='' ; end else strtj3_qx:=' and (t.任务相关人员 is null or CHARINDEX('''+employee +''',t.任务相关人员)>0 ) '; if RxDBLookupCombo57.Text<>'<无>' then strtj1:= format(' and s.委托单位=''%s'' ',[RxDBLookupCombo57.DisplayValues[1]]); if trim(Editedwtdw.Text)<>'' then strtj2:= ' and t.提单号 like ''%'+trim(Editedwtdw.Text)+'%'''; if(tv1.SelectionCount>0) then begin selNode:= tv1.Selected; dxdbgrdtclmndxdbgrd1_taskColumn11.Visible:=False; if(selNode.Level=0) then begin if(selNode.Text='个人') then begin sqlwhere:= ' where t.是否完成=0 and t.是否公共=0 ' +strtj1+strtj2 +strtj3_qx ; if(wdbdtmpckr1.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间>=''' + wdbdtmpckr1.text+''' '; if(wdbdtmpckr2.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间-1<=''' + wdbdtmpckr2.text+''' '; end else if(selNode.Text='公共') then begin sqlwhere:= ' where t.是否完成=0 and t.是否公共=1' +strtj2 +strtj3_qx; if(wdbdtmpckr1.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间>=''' + wdbdtmpckr1.text+''' '; if(wdbdtmpckr2.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间-1<=''' + wdbdtmpckr2.text+''' '; end else begin //任务开始时间 sqlwhere:= ' where t.是否完成=1'+strtj1+strtj2+strtj3_qx; if(wdbdtmpckr1_finish.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间>=''' + wdbdtmpckr1.text+''' '; if(wdbdtmpckr2_finish.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间-1<=''' + wdbdtmpckr2.text+''' '; dxdbgrdtclmndxdbgrd1_taskColumn11.Visible:=true; end; //dxdbgrd1_task..OptionsView. end else begin if(selNode.Parent.Text='个人') then sqlwhere:= ' where t.是否完成=0 and t.是否公共=0 and t.任务类型=''' +selNode.Text +'''' +strtj1+strtj2+strtj3_qx else if(selNode.Parent.Text='公共') then sqlwhere:= ' where t.是否完成=0 and t.是否公共=1 and t.任务类型=''' +selNode.Text +'''' +strtj2 +strtj3_qx else begin sqlwhere:= ' where t.是否完成=1 and t.任务类型=''' +selNode.Text +'''' +strtj1+strtj2 + strtj3_qx ; end; //已处理不会出现在这里 if(wdbdtmpckr1.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间>=''' + wdbdtmpckr1.text+''' '; if(wdbdtmpckr2.Text<>'') then sqlwhere:= sqlwhere+ ' and 任务开始时间-1<=''' + wdbdtmpckr2.text+''' '; end; end; qry1task.Active:=False; qry1task.SQL.Clear(); qry1task.SQL.Add(sql+sqlwhere) ; qry1task.Active:=True; dxdbgrd1_task.FullExpand(); end; procedure Tfrm_tree_main.btnRereshTaskClick(Sender: TObject); begin initialTaskType(); bindtaskdata(); end; procedure Tfrm_tree_main.dxdbgrd2CustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean; var AText: String; var AColor: TColor; AFont: TFont; var AAlignment: TAlignment; var ADone: Boolean); begin if ANode.HasChildren then Exit; { if not ASelected and (AColumn = dxDBGrid2PaymentAmount) then begin Value := ANode.Values[AColumn.Index]; if not VarIsNull(Value) then begin if Value < 200 then AColor := clLime else if Value < 300 then AColor := clYellow else begin // > 300 AColor := clRed; AFont.Color := clWhite; end; end; } end; procedure Tfrm_tree_main.tv1Changing(Sender: TObject; Node: TTreeNode; var AllowChange: Boolean); var zbMenuVisible,vcvisible,swVisible,vgmMenuVisible:Boolean; //正本 菜单是否可见 begin //Node.DisplayRect(True); // Node.ImageIndex:=0 ; //重新分配按钮状态 mniN4_tskAss_subRematch.enabled:=false; if ((Node.Level=0) and( Node.Text='公共')) or((Node.Level=1) and( Node.Parent.Text='公共')) then btn4_ReAssignTask.Enabled:=true else btn4_ReAssignTask.Enabled:=False; btn6_Invoic.Enabled:=false;// zbMenuVisible:=true; vcvisible:=true; swVisible:=true; btn1ZB.Enabled:=true; btn2VC.Enabled:=True; ToolButton17.Enabled:=True; btn3SW.Enabled:=True; btn6_Invoic.Enabled:=True; btn7_BCBABCL.Enabled :=True; btn1VGM.Enabled:=TRUE; ToolButton16.Enabled:=true; // mni5_OK.Visible:=True; mni5_PENDING.Visible:=True; mni5_CANCEL.Visible:=True; //正本菜单 if ((Node.Level=0) and ( Node.Text='已处理')) THEN begin zbMenuVisible:=false; vcvisible:=false; swVisible:=false; btn6_Invoic.Enabled:=false; btn1ZB.Enabled:=false; btn5AlertOk.Enabled:=False; btn4_ReAssignTask.Enabled:=False; btn1VGM.Enabled:=false; ToolButton17.Enabled:=false; wdbdtmpckr1.Visible:=false; wdbdtmpckr2.Visible:=false; wdbdtmpckr1_finish.Visible:=true; wdbdtmpckr2_finish.Visible:=true; // mni5_OK.Visible:=false; mni5_PENDING.Visible:=false; mni5_CANCEL.Visible:=false; ToolButton16.Enabled:=false; end else if(Node.Level=1) THEN begin if (Node.Parent.Text='已处理') then begin btn1ZB.Enabled:=false; btn2VC.Enabled:=false; btn3SW.Enabled:=false; btn5AlertOk.Enabled:=false; btn6_Invoic.Enabled:=false; btn7_BCBABCL.Enabled :=false; btn4_ReAssignTask.Enabled:=False; btn1VGM.Enabled:=false; zbMenuVisible:=false; vcvisible:=false; swVisible:=false; vgmMenuVisible:=false; ToolButton16.Enabled:=false; ToolButton17.Enabled:=false; wdbdtmpckr1.Visible:=false; wdbdtmpckr2.Visible:=false; wdbdtmpckr1_finish.Visible:=true; wdbdtmpckr2_finish.Visible:=true; // mni5_OK.Visible:=false; mni5_PENDING.Visible:=false; mni5_CANCEL.Visible:=false; if( Node.Text='ORIGINAL' ) then // btn1ZB.Enabled:=True else if( Node.Text='VC' ) then btn2VC.Enabled:=true else if( Node.Text='运输计划变更' ) then ToolButton17.Enabled:=true else if( Node.Text='SEAWAY' ) then btn3SW.Enabled:=true else if( Node.Text='VGM' ) then btn1VGM.Enabled:=true else if( Node.Text='预警提醒' ) then //btn5AlertOk.Enabled:=true else if ( Node.Text='INVOIC' ) then //btn6_Invoic.E;//nabled :=True else if(pos(node.Text,'BC/BA')>0) then begin btn7_BCBABCL.Enabled :=True; if(node.Text<>'BCL') THEN mniN4_tskAss_subRematch.enabled:=true; end; end else //<--------------- begin btn1ZB.Enabled:=false; btn2VC.Enabled:=false; ToolButton17.Enabled:=false; btn3SW.Enabled:=false; btn5AlertOk.Enabled:=false; btn6_Invoic.Enabled:=false; btn7_BCBABCL.Enabled :=False; btn1VGM.Enabled:=false; if( Node.Text='ORIGINAL' ) then btn1ZB.Enabled:=True else if( Node.Text='VC' ) then btn2VC.Enabled:=true else if( Node.Text='运输计划变更' ) then ToolButton17.Enabled:=true else if( Node.Text='VGM' ) then btn1VGM.Enabled:=true else if( Node.Text='SEAWAY' ) then btn3SW.Enabled:=true else if( Node.Text='预警提醒' ) then btn5AlertOk.Enabled:=true else if ( Node.Text='INVOIC' ) then btn6_Invoic.Enabled :=True else if(pos(node.Text,'BC/BA/BCL')>0) then btn7_BCBABCL.Enabled :=True; if(pos(node.Text,'ORIGINAL/SEAWAY/VCL')>0) then begin mniN4_tskAss_subRematch.enabled:=true; end; ToolButton16.Enabled:=true; // wdbdtmpckr1.Visible:=true; wdbdtmpckr2.Visible:=true; wdbdtmpckr1_finish.Visible:=false; wdbdtmpckr2_finish.Visible:=false; //-------------------------> end; end else begin btn5AlertOk.Enabled:=true; // wdbdtmpckr1.Visible:=true; wdbdtmpckr2.Visible:=true; wdbdtmpckr1_finish.Visible:=false; wdbdtmpckr2_finish.Visible:=false; end; mni_tskor_N1Ok.Visible:=zbMenuVisible; mni_tskor_N2Finish.Visible:=zbMenuVisible; mni_tskor_N3Cancel.Visible:=zbMenuVisible; // vc mni_tskN2OkFinish.Visible:=vcvisible; mni_tskN2Cancel.Visible :=vcvisible; //sw mni3_swFinish.Visible:=swVisible; mni3_swPENDING.Visible:=swVisible; mni3_swCancel.Visible:=swVisible; // // mni4_OK.Visible:=swVisible; mni4_PENDING.Visible:=swVisible; mni4_CANCEL.Visible:=swVisible; MenuItem3.Visible:=vgmMenuVisible; MenuItem8.Visible:=zbMenuVisible; end; procedure Tfrm_tree_main.rzgrp1_PersonItems0Click(Sender: TObject); begin // end; procedure Tfrm_tree_main.tv1Change(Sender: TObject; Node: TTreeNode); begin if bliNitialOk then bindtaskdata(); end; procedure Tfrm_tree_main.dxdbgrd1_taskDblClick(Sender: TObject); var //frmcontrast:TfrmOpSeae_TaskContrast; bsno,pdffilename,ftype:string; begin //TfrmOpSeae_TaskContrast if(qry1task.RecordCount<1) then Exit; ftype:= qry1task.FieldByName('任务类型').AsString; bsno:= qry1task.FieldByName('SEA编号').AsString; if (ftype='危品回写') then begin // //初始化窗体 if not assigned(frm_op_seae_web_dg_import) then frm_op_seae_web_dg_import:=Tfrm_op_seae_web_dg_import.Create (self); frm_op_seae_web_dg_import.InitialData(qry1task,bsno); frm_op_seae_web_dg_import.Caption:=ftype+'确认窗口'; try frm_op_seae_web_dg_import.ShowModal(); finally frm_op_seae_web_dg_import.Hide; end; end else if (ftype='网上订舱客户审核') then begin // //初始化窗体 if not assigned(frm_op_web_cust_audit) then frm_op_web_cust_audit:=Tfrm_op_web_cust_audit.Create (self); frm_op_web_cust_audit.InitialData(qry1task,bsno); frm_op_web_cust_audit.Caption:=ftype+'确认窗口'; try frm_op_web_cust_audit.ShowModal(); finally frm_op_web_cust_audit.Hide; end; end else if (ftype='网上订舱') then begin // //初始化窗体 if not assigned(frm_op_seae_web_order_edit) then frm_op_seae_web_order_edit:=Tfrm_op_seae_web_order_edit.Create (self); frm_op_seae_web_order_edit.InitialData(qry1task,bsno); frm_op_seae_web_order_edit.Caption:=ftype+'确认窗口'; try frm_op_seae_web_order_edit.ShowModal(); finally frm_op_seae_web_order_edit.Hide; end; end else if (ftype='网上截单') then begin // //初始化窗体 if not assigned(frm_op_seae_web_si_edit) then frm_op_seae_web_si_edit:=Tfrm_op_seae_web_si_edit.Create (self); frm_op_seae_web_si_edit.InitialData(qry1task,bsno); frm_op_seae_web_si_edit.Caption:=ftype+'确认窗口'; try frm_op_seae_web_si_edit.ShowModal(); finally frm_op_seae_web_si_edit.Hide; end; end else if (ftype='EDI订舱') or (ftype='EDI订舱退舱') or (ftype='EDI订舱修改') then begin // //初始化窗体 if not assigned(frm_op_seae_order_edit) then frm_op_seae_order_edit:=Tfrm_op_seae_order_edit.Create (self); frm_op_seae_order_edit.InitialData(qry1task,bsno); frm_op_seae_order_edit.Caption:=ftype+'确认窗口'; try frm_op_seae_order_edit.ShowModal(); finally frm_op_seae_order_edit.Hide; end; end else if (ftype='MSC BC') or (ftype='MSC BCL') or (ftype='MSC SI') or (ftype='MSC VGM') or (ftype='MSC Pending') then begin // //初始化窗体 if not assigned(frmOpSeae_mscbc) then frmOpSeae_mscbc:=TfrmOpSeae_mscbc.Create (self); pdffilename:=qry1task.FieldByName('电子档案路径').AsString; frmOpSeae_mscbc.InitialData(qry1task,bsno,pdffilename); frmOpSeae_mscbc.Caption:=ftype+'确认窗口'; try frmOpSeae_mscbc.ShowModal(); finally frmOpSeae_mscbc.Hide; end; end else if (ftype='运输计划变更') then begin pdffilename:=qry1task.FieldByName('电子档案路径').AsString; // //初始化窗体 if not assigned(frmOpSeae_ysbg) then frmOpSeae_ysbg:=TfrmOpSeae_ysbg.Create (self); frmOpSeae_ysbg.InitialData(qry1task,bsno,pdffilename); frmOpSeae_ysbg.Caption:=ftype+'确认窗口'; try frmOpSeae_ysbg.ShowModal(); finally frmOpSeae_ysbg.Hide; end; end else begin ConnectDownServer(); pdffilename:=qry1task.FieldByName('电子档案路径').AsString; // //初始化窗体 if not assigned(frmOpSeae_TaskContrast) then frmOpSeae_TaskContrast:=TfrmOpSeae_TaskContrast.Create (self); frmOpSeae_TaskContrast.InitialData(qry1task,bsno,pdffilename); frmOpSeae_TaskContrast.Caption:=ftype+'对照窗口'; try frmOpSeae_TaskContrast.ShowModal(); finally frmOpSeae_TaskContrast.Hide; end; end; end; /// /// 挂单 /// function Tfrm_tree_main.Guadan(mainNo,bsno,filetype,filename_src:string):boolean; begin Result:= Guadan_2(mainNo,bsno,filetype,filename_src,false,''); end; /// /// 挂单 /// /// 是否分单 function Tfrm_tree_main.Guadan_2(mainNo,bsno,filetype,filename_src:string;isFendan:Boolean;subNo:string):boolean; var FileStream:TFileStream; fsize:double; numunzipped:integer; qry_op_file:TAdoquery; fid:Integer; naspath:string; filename:string;//解决文件锁定的问题 fendan_mid:string; begin try Result:=True; naspath:=get_parameters_value(175,'\\223.223.95.160\data'); qry_op_file:=CreateADoQuery(); with qry_op_file do begin close(); SQL.Clear; SQL.Add( format('select * from [t_op_file] where 编号=''%s''',[bsno])); open; end; if qry_op_file.RecordCount<=0 then begin qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='托书'; qry_op_file.FieldByName('备注').AsString:='是'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='入货通知'; qry_op_file.FieldByName('备注').AsString:='是'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='提单OK件'; qry_op_file.FieldByName('备注').AsString:='是'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='费用确认'; qry_op_file.FieldByName('备注').AsString:='是'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='提单留底'; qry_op_file.FieldByName('备注').AsString:='是'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='提单确认'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='舱单'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='报关资料'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='提单COPY'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='船公司账单'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='正本提单交回回执条'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='保函'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:='船公司挂单'; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; //刷新取得FID qry_op_file.Requery(); end; //qry_op_file.Close; //qry_op_file.SQL.Clear; //qry_op_file.SQL.Add(format('select * from [t_op_file] where 编号=''%s'' and 文件类型=''%s'' ',bsno,filetype)); if not ( qry_op_file.Locate('文件类型',filetype,[]) ) then begin qry_op_file.Append; qry_op_file.FieldByName('编号').AsString:=bsno; qry_op_file.FieldByName('文件类型').AsString:=filetype; qry_op_file.FieldByName('备注').AsString:='否'; qry_op_file.Post; end; qry_op_file.Requery(); if not ( qry_op_file.Locate('文件类型',filetype,[])) then begin Application.MessageBox(pchar('对不起,文件类型不在处理范围:'+filetype),'信息提示',MB_ICONINFORMATION); Result :=false; Exit; end; //验证权限 448 ,提单签回+提单签入 cjb 2017-08-04 { if (trim(t_op_file.FieldByName('文件类型').AsString)='提单留底') and (if_open('448')=False) then begin //验证权限 448 Application.MessageBox('对不起,您没有上传提单留底的权限,不能上传','信息提示',MB_ICONINFORMATION); Exit; end; } //上传附件 //判断文件路径,如果是共享路径则 if(pos(':',filename_src)<1) or (pos('\\',filename_src)>0) then begin ConnectDownServer(); end ; if FileExists(filename_src) then begin //拷贝到临时目录 if(isfendan) then fendan_mid:=format('_分单_%s',[subNo]); filename:= GetWinTempPath()+ mainNo +fendan_mid+'_'+FormatDateTime('MMDDhhmmss',Now)+'.pdf'; // ExtractFileName(filename_src); if(FileExists(filename)) then DeleteFile(filename); //本地路径直接拷贝 CopyFile(pChar(filename_src),pChar(filename),false); // FileStream:=TFileStream.Create(filename,fmopenRead); //打开文件 try fsize:=FileStream.size; finally freeandnil(FileStream); end; begin fid := qry_op_file.fieldbyname('FID').AsInteger; try UpLoadProFile(filename,naspath,'user','user',mainNo,bsno,fid,filetype); updateGuadanFilecount(fid,bsno);//更新数量 if trim(qry_op_file.FieldByName('文件类型').AsString)='提单留底' then begin InsertSeaeStatus(bsno,'提单签回',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now)); // 程建波 2017-08-04 InsertSeaeStatus(bsno,'提单签入',employee,FormatDateTime('YYYY-MM-DD hh:mm:ss',Now)); // 提单取消签入后,再次提单签入,业务中op_seae中提单签发状态为空:去掉 '通知放单' 的限制条件 程建波 2017-09-21 ////if (not GetStatus_notice(t_op_seae.FieldByName('编号').AsString,)) //// and (not GetStatus_notice(t_op_seae.FieldByName('编号').AsString,'提单签入')) //已签入 ////and if (not GetStatus_notice(bsno,'提单签出')) and (not GetStatus_notice(bsno,'提单签发')) then begin // 程建波 2017-08-04 //UpdateMblStatus(t_op_seae.FieldByName('编号').AsString,'提单签回'); //写入提单签入(提单签回会被覆盖,所以提单签回状态写入委托单的动作取消 UpdateMblStatus(bsno,'提单签入'); end; end; finally end; end; end else begin MessageDlg('文件不存在或者不能访问,不能超过95个字符!!',mtWarning,[mbyes],0); Result:=False; exit ; end; except on ex:exception do begin Result:=false; MessageDlg('上传文件发生异常:'+ex.Message ,mtWarning,[mbyes],0); end; end; end; /// /// 连接nass /// function Tfrm_tree_main.ConnectDownServer( ):Boolean; //连接 var NetSource : TNetResource; nasspath: string; begin nasspath:=get_parameters_value(175,'\\223.223.95.160\data'); with NetSource do begin dwType := RESOURCETYPE_DISK; lpLocalName :=''; lpRemoteName:=PChar(nasspath); // 此处为\\server\dataserver lpProvider :=''; end; Result:=(WnetAddConnection2(NetSource, PChar('user'),Pchar('user'),CONNECT_UPDATE_PROFILE)=0); //pwd;username 此处为你的用户名与密码 end; procedure DisConnectDownServer(nasspath:string); //断开 begin WNetCancelConnection2(Pchar(nasspath),CONNECT_UPDATE_PROFILE,True); end; procedure Tfrm_tree_main.UpLoadProFile(fname,RemotePathName,Users,pw,mblNo,bsno:string;fid:integer;filetype:string); var path,newpath:string; NetSource :TNetResource; filePath,filepath_pre,filename,fileExt:string; begin //上传文件 if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(self); frm_sys_progress.bsSkinGauge1.ProgressText:='加载数据请等候。。。'; frm_sys_progress.Show; frm_sys_progress.Update; filename:=ExtractFileName(fname) ; fileExt:=ExtractFileExt(filename) ; with NetSource do begin dwType := RESOURCETYPE_ANY; lpLocalName :=''; // 将远程资源映射到此驱动器 lpRemoteName:=pChar(RemotePathName); // 远程网络资源 lpProvider :=''; end; WnetAddConnection2(NetSource, pChar(Users),pChar(pw),CONNECT_UPDATE_PROFILE); filePath:=FormatDateTime('YYYYMM',DatabaseDateTime); if not DirectoryExists(RemotePathName+'\'+filePath) then MkDir(RemotePathName+'\'+filePath); if not DirectoryExists(RemotePathName+'\'+filePath+'\'+mblNo) then MkDir(RemotePathName+'\'+filePath+'\'+mblNo); //增加类型 filepath_pre:=RemotePathName+'\'+filePath+'\'+trim(mblNo)+'\'+ filetype; if not DirectoryExists(filepath_pre) then MkDir(filepath_pre); newpath:=filepath_pre+'\'+filename; if CopyFile(pChar(fname),pChar(newpath),false) then else ; try finally WNetCancelConnection2(pChar(RemotePathName),CONNECT_UPDATE_PROFILE,True); end; with qry_op_file_items do begin Close;SQL.Clear; sql.Add('select * from t_op_file_items'); sql.Add('where PID=:PID and 编号=:编号'); Parameters.ParamByName('PID').Value:=fid; Parameters.ParamByName('编号').Value:=bsno; Open; try append; FieldByName('名称').AsString:=newpath; FieldByName('上传日期').AsDateTime:=now(); FieldByName('所有者').Asstring:=employee; FieldByName('类型').Asstring:=fileExt; FieldByName('文件存储').AsBoolean:=true; FieldByName('编号').AsString:=bsno; FieldByName('pid').AsInteger:=fid; Post; // Application.MessageBox('程序上传至服务器成功!','提示',MB_OK+MB_IconInformation); finally frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.close; frm_sys_progress:=nil; end; end; end; procedure Tfrm_tree_main.updateGuadanFilecount(fid:integer;bsno:string); var t_op_file_items_pl : TAdoQuery; t_op_file_items_Update:TAdoQuery; cnt:integer; begin t_op_file_items_pl:=CreateAdoQuery_file; t_op_file_items_Update:=CreateAdoQuery; with t_op_file_items_pl do try Close;SQL.Clear; sql.Add('select fid from t_op_file_items'); sql.Add('where PID=:PID and 编号=:编号'); Parameters.ParamByName('PID').Value:=fid; Parameters.ParamByName('编号').Value:=bsno; Open; cnt:=Recordcount; with t_op_file_items_Update do begin Close;SQL.Clear; sql.Add('Update t_op_file set 大小=:c'); sql.Add('where FID=:FID'); Parameters.ParamByName('FID').Value:=fid; Parameters.ParamByName('c').Value:=cnt; Execsql; end; finally Free; t_op_file_items_Update.Free; end; end; procedure Tfrm_tree_main.EditedwtdwKeyPress(Sender: TObject; var Key: Char); begin IF key=#13 then begin key:=#0; bindtaskdata(); end; end; procedure Tfrm_tree_main.btn4_ReAssignTaskClick(Sender: TObject); var taskType,taskTypeWhere,strinfo: string; sqlSelfTaskcount:string;//个人充分配数量 sql,sqlUpdate:string; qrytmp,qryexc:TADOQuery; i,nselfcount:integer; begin // if( tv1.Selected=nil) then exit; taskType:=tv1.Selected.Text; if(tv1.Selected.Level=0 ) then taskTypeWhere :='' else taskTypeWhere := ' and t.任务类型=''' + taskType +''' ' ; // sqlSelfTaskcount:='select count(tsk.pl_id) as ncount from ' +' (select t.pl_id,t.提单号,任务类型 from t_op_task t where t.是否公共=1 ' + taskTypeWhere + ' and t.是否完成=0)tsk join ' +' (select 主提单号,客服员,操作员,编号 from t_op_seae where 业务类型=''普通货'' ) s ' +' on tsk.提单号=s.主提单号 and 客服员='''+ employee +''''; // sql:='select tsk.pl_id,tsk.提单号,s.客服员,s.编号 from ( ' +' select t.pl_id,t.提单号 from t_op_task t where t.是否公共=1 ' + taskTypeWhere+ 'and t.是否完成=0)tsk join ' +' (select 主提单号,客服员,操作员,编号 from t_op_seae where 业务类型=''普通货'' ) s ' +'on tsk.提单号=s.主提单号 '; sqlUpdate:='update t_op_task set 任务相关人员= v.客服员,sea编号=v.编号,' +'是否公共=0 ,备注= isnull(备注,'''')+''(重新匹配任务)'' from ( ' + sql + ') v where t_op_task.pl_id = v.pl_id'; //费用处理 qrytmp:=CreateAdoQuery(); nselfcount:=0; with qrytmp do begin close;sql.Clear; sql.Add(sqlSelfTaskcount); Open; if(not IsEmpty) then begin First; nselfcount:= fieldbyname('ncount').AsInteger; end; Close; end; try with qrytmp do begin close;sql.Clear; sql.Add(sqlUpdate); i:=ExecSQL(); Application.MessageBox(PChar(format('重新匹配了%d个任务,其中为您重新分配了%d个任务',[i,nselfcount])) ,'信息提示',MB_ICONINFORMATION); end; except on ex: Exception do begin // ShowMessage('重新分配发生异常:'+ex.message); end; end; end; procedure Tfrm_tree_main.mni_tskor_N2FinishClick(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype,Ofiletype:string; i:Integer; begin if(qry1task.RecordCount<1) then Exit; if (TMenuItem(Sender).Tag=1) then Ofiletype:='ORIGINAL' else if (TMenuItem(Sender).Tag=2) then Ofiletype:='VC' else if (TMenuItem(Sender).Tag=3) then Ofiletype:='SEAWAY' else if (TMenuItem(Sender).Tag=11) then Ofiletype:='VGM' else if (TMenuItem(Sender).Tag=4) then begin Ofiletype:='INVOIC'; //检查 frm if(not assigned( frmCh_fee_edi)) then begin frmCh_fee_edi:= TfrmCh_fee_edi.create(nil); end; frmCh_fee_edi.Hide; end else if(TMenuItem(Sender).Tag=5) then begin // if(tv1.SelectionCount>0) then begin if(tv1.Selected.Level=0) then begin Ofiletype:='BC/BA/BCL'; end else begin Ofiletype:= tv1.Selected.Text; end; end; end; if( Application.MessageBox(PChar('您确实要确认并完成'+Ofiletype+'任务吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; if (Ofiletype='') then exit; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype=strtmp) or ( (Ofiletype='BC/BA/BCL') and (Pos(strtmp,Ofiletype)>0) )) then begin optype:='完成'; isok:=true; try qry1task.Connection.BeginTrans; //挂单 mainno:=qry1task.fieldbyname('提单号').AsString; bsno:=qry1task.fieldbyname('SEA编号').AsString; filename:=qry1task.fieldbyname('电子档案路径').AsString; if strtmp ='ORIGINAL' then begin filetype:='船公司挂单'; //换签可以2次挂单,两次以上不可以;非换签两次及以上不可以 if(checkGuadanTimes(qry1task.fieldbyname('备注').AsString)=False) then begin qry1task.Connection.RollbackTrans;// Continue; end; isok:= Guadan(mainNo,bsno, filetype,filename); end else if strtmp ='VC' then begin filetype:='VC挂单'; end else if(strtmp='INVOIC') then begin // 费用导入 frmCh_fee_edi.BindData(qry1task,false); isok:= frmCh_fee_edi.DoImportData(); end else if ((strtmp ='BC') or (strtmp ='BA')) then begin filetype:='入货通知'; //换签可以2次挂单,两次以上不可以;非换签两次及以上不可以 isok:= Guadan(mainNo,bsno, filetype,filename); end; if(isok=true) then begin qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:=optype; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,optype,employee] ); qry1task.Connection.Execute(sql); qry1task.Connection.CommitTrans; end else begin qry1task.Connection.RollbackTrans; end; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); end; procedure Tfrm_tree_main.mni_tskor_N3CancelClick(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype,Ofiletype:string; i:Integer; begin if(qry1task.RecordCount<1) then Exit; if (TMenuItem(Sender).Tag=1) then Ofiletype:='ORIGINAL' else if (TMenuItem(Sender).Tag=2) then Ofiletype:='VC' else if (TMenuItem(Sender).Tag=3) then Ofiletype:='SEAWAY' else if (TMenuItem(Sender).Tag=4) then Ofiletype:='INVOIC' else if (TMenuItem(Sender).Tag=11) then Ofiletype:='VGM' else if(TMenuItem(Sender).Tag=5) then begin // if(tv1.SelectionCount>0) then begin if(tv1.Selected.Level=0) then begin Ofiletype:='BC/BA/BCL'; end else begin Ofiletype:= tv1.Selected.Text; end; end; end; if( Application.MessageBox(PChar('您确实要直接结束选中的'+Ofiletype+'任务吗?'+#13#10+'结束任务将直接关闭任务!,是否结束任务?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; if (Ofiletype='') then exit; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype=strtmp) or ( (Ofiletype='BC/BA/BCL') and (Pos(strtmp,Ofiletype)>0) )) then begin optype:='完成'; isok:=true; try qry1task.Connection.BeginTrans; qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:='结束'; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,'结束',employee] ); qry1task.Connection.Execute(sql); qry1task.Connection.CommitTrans; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); end; procedure Tfrm_tree_main.mni_tskor_N1OkClick(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype,Ofiletype:string; i:Integer; begin if(qry1task.RecordCount<1) then Exit; if (TMenuItem(Sender).Tag=1) then Ofiletype:='ORIGINAL' else if (TMenuItem(Sender).Tag=2) then Ofiletype:='VC' else if (TMenuItem(Sender).Tag=3) then Ofiletype:='SEAWAY' else if (TMenuItem(Sender).Tag=4) then Ofiletype:='INVOIC' else if(TMenuItem(Sender).Tag=5) then begin // if(tv1.SelectionCount>0) then begin if(tv1.Selected.Level=0) then begin Ofiletype:='BC/BA/BCL'; end else begin Ofiletype:= tv1.Selected.Text; end; end; if( Application.MessageBox(PChar('您确实要选中的PENDING'+Ofiletype+'任务吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; if (Ofiletype='') then exit; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype=strtmp) or ( (Ofiletype='BC/BA/BCL') and (Pos(strtmp,Ofiletype)>0) )) then optype:='PENDING'; isok:=true; try //qry1task.Connection.BeginTrans; qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('任务状态').AsString:=optype; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; // sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,optype,employee] ); qry1task.Connection.Execute(sql); //qry1task.Connection.CommitTrans; except on e:Exception do begin // qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); end; function Tfrm_tree_main.sendmailBatch(taskqueNo:string ): Integer; var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype:string; i,j:Integer; strsql, str,wtdw,strsjr,tasktype,YJ_FILEID,FNType:string; aQuery,qryMail :TADOQuery; ishtml:Boolean; // //转发的邮件类型 // pt2: MYPARA; // Ofiletype:string; //邮件任务 qryMailQue:TADOQuery; qrytmp:TADOQuery; // taskQNo:string; begin Sleep(1000); Result:=-1; // pt2 := MYPARA(p^); {转换} //taskqueNo:=StrPas(pt2.QNo); strsql:='SELECT * FROM t_op_task_mailque q where q.qid='''+taskqueNo+''''; qryMailQue:=CreateAdoQuery(); qryMailQue.Close; qryMailQue.SQL.Add(strsql); qryMailQue.Open; if(qryMailQue.IsEmpty) then Exit ; qryMailQue.First; while not qryMailQue.Eof do begin taskQNo:= qryMailQue.FieldByName('任务编号').AsString ; try isok:= frm_tree_main.sendmailQue(qryMailQue) except on ex:Exception do begin isok:=False; errorlog(ex.Message); end; end; if(isok) then begin qryMailQue.Edit; qryMailQue.FieldByName('发件人').AsString:=employee; qryMailQue.FieldByName('是否完成').AsBoolean:=True; qryMailQue.FieldByName('完成时间').AsDateTime:=Now; qryMailQue.FieldByName('状态').AsString:='已发送'; qryMailQue.Post; //挂单 strsql:=format('select t.任务编号 from t_op_task t where t.任务编号=''%s'' and 是否完成=0 AND 任务类型 in(''BA'',''BC'') ',[taskQNo]); qrytmp:=CreateAdoQuery(); qrytmp.Close; qrytmp.SQL.Clear; qrytmp.SQL.Add(strsql); qrytmp.Open; // if(not qrytmp.IsEmpty) then begin //未完成的BC/BA任务 执行挂单操作:入货通知 isok:= Guadan(qryMailQue.fieldbyname('主提单号').AsString,qryMailQue.fieldbyname('编号').AsString, '入货通知',qryMailQue.fieldbyname('附件名称').AsString); end ; if(not isok) then begin //挂单失败 strsql:='update t_op_task set 任务状态=''已转发,但是挂单失败'',操作人='''+ employee +''',完成时间=GETDATE() where 任务编号='''+ qryMailQue.FieldByName('任务编号').AsString +''''; qryMailQue.Connection.Execute( strsql ); ShowMessage('邮件已转发;但是自动挂单失败,任务类型:'+qryMailQue.FieldByName('任务类型').AsString +',主提单号:'+ qryMailQue.FieldByName('主提单号').AsString); end else begin // strsql:='update t_op_task set 是否完成=1,任务状态=''已转发'',操作人='''+ employee +''',完成时间=GETDATE() where 任务编号='''+ qryMailQue.FieldByName('任务编号').AsString +''''; qryMailQue.Connection.Execute( strsql ); end; end else begin qryMailQue.Edit; qryMailQue.FieldByName('发件人').AsString:=employee; qryMailQue.FieldByName('是否完成').AsBoolean:=false; qryMailQue.FieldByName('完成时间').AsDateTime:=Now; qryMailQue.FieldByName('状态').AsString:='转发失败'; qryMailQue.Post; strsql:='update t_op_task set 任务状态=''转发失败'',操作人='''+ employee +''',完成时间=GETDATE() where 任务编号='''+ qryMailQue.FieldByName('任务编号').AsString +''''; qryMailQue.Connection.Execute( strsql ); end; qryMailQue.Next; end; result:=0; //是否刷新列表???? qry1task.Requery(); end; procedure Tfrm_tree_main.mni_tskN2ForwordClick(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype:string; i:Integer; strsql, str,wtdw,strsjr,tasktype,YJ_FILEID,FNType:string; aQuery,qryMail:TADOQuery; ishtml:Boolean; //邮件队列列表 lsttsk:TstringList; //转发的邮件类型 Ofiletype:string; //邮件任务 qryMailQuee:TADOQuery; // taskQNo:string; ID: DWORD; pt:MYPARA; myThread1 :TMyThread; wtbh:string;//委托编号,BC/BA类邮件转发使用 begin if(qry1task.RecordCount<1) then Exit; if (TMenuItem(Sender).Tag=1) then Ofiletype:='ORIGINAL' else if (TMenuItem(Sender).Tag=2) then Ofiletype:='VC' else if (TMenuItem(Sender).Tag=3) then Ofiletype:='SEAWAY' else if(TMenuItem(Sender).Tag=5) then begin // if(tv1.SelectionCount>0) then begin if(tv1.Selected.Level=0) then begin Ofiletype:='BC/BA'; end else if(tv1.Selected.Text<>'BCL') THEN //BCL 无转发功能 begin Ofiletype:= tv1.Selected.Text; end; end; end; if (Ofiletype='') then exit; if( Application.MessageBox(PChar('您确实要转发选中的'+Ofiletype+'邮件吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; //** if (Ofiletype='') then exit; lsttsk:=TStringList.Create(); // ishtml:=False; aQuery:=CreateAdoQuery(); qryMail:=CreateAdoQuery(); //## //## taskQNo:='q'+FormatDateTime('YYYYMMDDHHmmsszzz', Now); qryMailQuee:= CreateAdoQuery(); qryMailQuee.Close; qryMailQuee.SQL.Clear; qryMailQuee.SQL.Add('SELECT * FROM [t_op_task_mailque] where 1=2') ; qryMailQuee.Open; try for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); if(qry1task.FieldByName('任务状态').AsString ='转发中') then continue; wtbh:=''; strtmp:=qry1task.fieldbyname('委托编号').AsString; if((strtmp='') or ( Pos('TSE',UpperCase(strtmp))=1)) then wtbh:='' else wtbh:='___'+strtmp; wtdw:=qry1task.fieldbyname('委托单位').AsString; strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype=strtmp) or ( (Ofiletype='BC/BA') and (Pos(strtmp,Ofiletype)>0) )) then begin qry_op_seae.close; qry_op_seae.Parameters.ParamByName('编号').Value:=qry1task.FieldByName('SEA编号').AsString; qry_op_seae.Open; if not qry_op_seae.IsEmpty then begin // if((Ofiletype='BA') or (Ofiletype='BC') or(Ofiletype='BC/BA') ) then FNType:='入货通知' else FNType:='VC_SEAWAY_提单留底'; tasktype:= qry1task.FieldByName('任务类型').AsString; // d.收件人 str:=' select d.*,c.客户名称 from t_code_cust_mailproject_detail d left join t_code_cust_mailproject c ' +' on (c.方案代码=d.方案代码) where 单据类型='''+ FNType +''' and c.客户名称='''+wtdw+''' and ' +' d.方案代码 in ' +'( SELECT distinct 客户邮件方案 from t_op_seae where 委托单位='''+wtdw+''' and isnull(客户邮件方案,'''')<>'''' ' +'and 编号='''+ qry_op_seae.FieldByName('编号').AsString +''' )'; with aQuery do begin close;sql.Clear; SQL.Add(str); Open; strsjr:=''; if aQuery.IsEmpty then begin ShowMessage('委托单位['+FNType+']邮件方案为空或者该票票业务没有选择邮件方案,无法转发!'); continue; end; aQuery.First; while not aQuery.eof do begin // if strsjr='' then strsjr := fieldbyname('收件人').AsString else strsjr := strsjr +',' +fieldbyname('收件人').AsString; Next; end; if(pos('@',strsjr)<1) then begin Application.MessageBox('邮件方案的收件人地址不正确,请确认后再转发!','信息提示',MB_OK+MB_ICONINFORMATION) ; continue; end; First; //** lsttsk.Add(qry1task.fieldbyname('任务编号').AsString ); //<--------------- {mailSend.EmptyTable; mailSend.Open; mailSend.Insert; mailSend.FieldByName('收件人').AsString:= strsjr;//fieldbyname('收件人').AsString; mailSend.FieldByName('邮件签名').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('邮件签名').AsString; } qryMailQuee.Insert; qryMailQuee.FieldByName('qid').AsString:=taskQNo; qryMailQuee.FieldByName('任务编号').AsString:=qry1task.FieldByName('任务编号').AsString; qryMailQuee.FieldByName('收件人').AsString:=strsjr; qryMailQuee.FieldByName('邮件签名').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('邮件签名').AsString; if(Ofiletype='BC/BA') then begin Ofiletype:= qry1task.fieldbyname('任务类型').AsString; end; if ( Ofiletype='BC') or ( Ofiletype='BA') or (tasktype='VC') or ((UpperCase(tasktype)='SEAWAY') and (qry1task.fieldbyname('任务来源').AsString='邮件') ) then begin YJ_FILEID:=qry1task.fieldbyname('邮件编号').AsString; ishtml:=True; qryMail.Close; qryMail.SQL.Clear; qryMail.SQL.Add('SELECT [邮件主题],[邮件内容] FROM [t_op_seae_edi_mail] where [邮件ID]='''+YJ_FILEID+''';') ; qryMail.Open; if(not qryMail.Eof) then begin // { str:=qryMail.fieldbyname('邮件主题').AsString; mailsend.fieldbyname('邮件主题').AsString :=str; mailSend.FieldByName('附件名称').AsString:=qry1task.fieldbyname('电子档案路径').AsString ; str:=qryMail.fieldbyname('邮件内容').AsString; mailSend.FieldByName('邮件内容').AsString:=str; } qryMailQuee.fieldbyname('邮件主题').AsString :='转发:'+StringReplace(StringReplace(qryMail.fieldbyname('邮件主题').AsString, #10, '', [rfReplaceAll]),#10,'', [rfReplaceAll]); if(FNType='入货通知') then //BC/BA类的委托编号不为空且不为[TSE]开头则邮件标题+[___委托编号] qryMailQuee.fieldbyname('邮件主题').AsString := StringReplace(StringReplace(qryMail.fieldbyname('邮件主题').AsString, #10, '', [rfReplaceAll]),#10,'', [rfReplaceAll]) +wtbh; qryMailQuee.FieldByName('附件名称').AsString:=qry1task.fieldbyname('电子档案路径').AsString ; qryMailQuee.FieldByName('邮件内容').AsString:=qryMail.fieldbyname('邮件内容').AsString; end ELSE BEGIN ShowMessage('未取得原始邮件信息,任务编号:'+Ofiletype+',邮件ID:'+YJ_FILEID+',提单号:'+qry1task.fieldbyname('提单号').AsString); Continue; end; end else if(UpperCase(tasktype)='SEAWAY') then begin //YJ_FILEID:=m_qryTask.fieldbyname('文件编号').AsString; str:='SEAWAY BILL:'+qry1task.fieldbyname('提单号').AsString ;// fieldbyname('主题模板').AsString +FormatDateTime('YYYYMMDDHHMMSS',now) ; //mailsend.fieldbyname('邮件主题').AsString :=str; //mailSend.FieldByName('附件名称').AsString:=qry1task.fieldbyname('电子档案路径').AsString ; qryMailQuee.fieldbyname('邮件主题').AsString :=StringReplace(StringReplace(str, #10, '', [rfReplaceAll]),#10,'', [rfReplaceAll]); qryMailQuee.FieldByName('附件名称').AsString:=qry1task.fieldbyname('电子档案路径').AsString ; if fieldbyname('邮件内容').IsNull then str:=' ' else str:=fieldbyname('邮件内容').AsString; //mailSend.FieldByName('邮件内容').AsString:=str; qryMailQuee.FieldByName('邮件内容').AsString:=str; end; qryMailQuee.FieldByName('任务类型').AsString:=tasktype; qryMailQuee.FieldByName('单据类型').AsString:=fieldbyname('单据类型').AsString; qryMailQuee.FieldByName('编号').AsString:=qry1task.fieldbyname('SEA编号').AsString ; qryMailQuee.FieldByName('主提单号').AsString:=qry1task.fieldbyname('提单号').AsString ; qryMailQuee.FieldByName('发件人').AsString:=employee; qryMailQuee.Post; //----------> try qry1task.Connection.BeginTrans; // sendmail(mailSend,FNType,qry1task.fieldbyname('SEA编号').AsString,ishtml) ; //更新状态 qry1task.Edit; //qry1task.FieldByName('完成时间').AsDateTime:=Now; //qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:='转发中';//'已转发'; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; // strsql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; strsql:=Format(strsql,[qry1task.fieldbyname('任务编号').asstring,'转发中',employee] ); // 已转发 qry1task.Connection.Execute(strsql); qry1task.Connection.CommitTrans; aQuery.Close(); except on ex:exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('转发失败:'+ex.Message),'信息提示',MB_OK+MB_ICONINFORMATION); continue; end; end; end ; end else begin Application.MessageBox(PChar('无业务数据无法转发!'),'信息提示',MB_OK+MB_ICONINFORMATION); end; end; end; finally FreeAndNil(aQuery); FreeAndNil(qryMail); end; qry1task.requery(); //调用邮件发送线程 // sendmailBatch(taskQNo); myThread1 := TMyThread.Create(taskQNo); // 创建线程并挂起 myThread1.OnTerminate:=MyOnTerminate; myThread1.Resume; // pt.QNo:= pchar(taskQNo) ; //CreateThread(nil, 0, @sendmailBatch, pointer(@pt) , 0, ID); end; function Tfrm_tree_main.sendmail(mailSendTbl: TkbmMemTable; mailtype, bsno: string; ishtml: Boolean): Boolean; var i:integer; str_memo:Tmemo; SMTP1:TIdSMTP; IdMsg:TIdMessage; strfile,mailremarks,naspath,strnr,lognr:string; // emptybody, textbody, htmlbody : TIdText; idAtta: TIdAttachmentFile; filename:string; begin try naspath:=get_parameters_value(175,'\\223.223.95.160\data'); try frm_tree_main.ConnectDownServer(); except on ex: Exception do begin ;//s end; end; if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.bsSkinGauge1.ProgressText:='正在发送邮件。。。'; frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=1; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; begin SMTP1:=TIdSMTP.Create(nil); IdMsg:=TIdMessage.Create(nil); str_memo:=Tmemo.create(nil); SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL); SMTP1.username:=MailAddress; SMTP1.Password :=MailPw; SMTP1.Host :='mail.sdsmartlogistics.com'; //---------------- { SMTP1.username:='dev003@dongshengsoft.com'; SMTP1.Password :='carey2017'; SMTP1.Host :='smtpcom.263xmail.com'; } //debug SMTP1.Port :=25; try SMTP1.Connect; except on e : Exception do begin ShowMessage('连接邮箱出错:'+E.Message); Exit; end; end; if not SMTP1.Connected then begin SMTP1.Connect; end; try with IdMsg do begin body.Clear; if(ishtml) then begin IdMsg:=TIDMessage.create(); emptybody := TIdText.Create(IdMsg.MessageParts, nil); emptybody.ContentType := 'multipart/alternative'; emptybody.ParentPart := -1; textbody := TIdText.Create(IdMsg.MessageParts, nil); textbody.Body.Text := 'plain text part'; textbody.ContentType := 'text/plain'; textbody.ParentPart := 0; htmlbody := TIdText.Create(IdMsg.MessageParts, nil); htmlbody.body.text :=mailSendTbl.fieldbyname('邮件内容').AsString;// '

This is a email saying weeeeee

黑体字'; htmlbody.ContentType := 'text/html'; htmlbody.ParentPart := 0; IdMsg.ContentType := 'multipart/related; type="multipart/alternative"'; //IdMsg.ContentType :='text/html'; IdMsg.CharSet:='iso-8859-1'; IdMsg.Encoding:=meMIME; // IdMsg.body:=null;//mailSendTbl.fieldbyname('邮件内容').AsString; lognr:='VC挂单,具体内容请查阅邮件 '; end else begin // textbody := TIdText.Create(IdMsg.MessageParts, nil); // textbody.Body.Text := 'plain text part'; // textbody.ContentType := 'text/plain'; //textbody.ParentPart := 0; //textbody.Body.Text:= mailSendTbl.fieldbyname('邮件内容').AsString; Body.Text:=mailSendTbl.fieldbyname('邮件内容').AsString; lognr :=Body.Text; end; From.address :=MailAddress; Recipients.EMailAddresses :=mailSendTbl.FieldByName('收件人').AsString; Subject:=mailSendTbl.FieldByName('邮件主题').AsString; strfile:= mailSend.FieldByName('附件名称').AsString; //----------------- if(FileExists(strfile)) then begin idAtta:= TIdAttachmentFile.Create(MessageParts,strfile); idAtta.ContentType:='application/octet-stream'; idAtta.ContentDisposition:='attachment'; idAtta.ContentTransfer:='base64'; idAtta.FileName:=ExtractFileName(strfile); end; end; if not SMTP1.Connected then begin Sleep(1000); SMTP1.Connect; end; SMTP1.Send(IdMsg); // 长度判断 Insert_mail_Log(bsno,mailtype,mailSendTbl.FieldByName('收件人').AsString,mailSendTbl.FieldByName('邮件主题').AsString,lognr,mailSend.FieldByName('附件名称').AsString); finally SMTP1.Disconnect; end; try finally str_memo.Free; SMTP1.Free; IdMsg.Free; end; end; finally frm_sys_progress.close; frm_sys_progress:=nil; end; end; /// /// 队列发邮件使用的函数 /// function Tfrm_tree_main.sendmailQue(mailSendTbl: TADOQuery): Boolean; var i:integer; str_memo:Tmemo; SMTP1:TIdSMTP; IdMsg:TIdMessage; strfile,mailremarks,naspath,strnr,lognr:string; // emptybody, textbody, htmlbody : TIdText; idAtta: TIdAttachmentFile; filename:string; ishtml:Boolean; bsno,mailtype:string; begin ishtml:=true; try naspath:=get_parameters_value(175,'\\223.223.95.160\data'); try frm_tree_main.ConnectDownServer(); except on ex: Exception do begin errorlog(ex.Message); end; end; begin // frm_sys_progress.bsSkinGauge1.Value:=i; SMTP1:=TIdSMTP.Create(nil); IdMsg:=TIdMessage.Create(nil); str_memo:=Tmemo.create(nil); SMTP1.AuthType := satDefault; //(satNone, satDefault, satSASL); SMTP1.username:=MailAddress; SMTP1.Password :=MailPw; SMTP1.Host :='mail.sdsmartlogistics.com'; //---------------- { SMTP1.username:='dev003@dongshengsoft.com'; SMTP1.Password :='carey2017'; SMTP1.Host :='smtpcom.263xmail.com'; } //debug SMTP1.Port :=25; try SMTP1.Connect; except on e : Exception do begin ShowMessage('连接邮箱出错:'+E.Message); Exit; end; end; if not SMTP1.Connected then begin SMTP1.Connect; end; try with IdMsg do begin body.Clear; if(ishtml) then begin IdMsg:=TIDMessage.create(); emptybody := TIdText.Create(IdMsg.MessageParts, nil); emptybody.ContentType := 'multipart/alternative'; emptybody.ParentPart := -1; textbody := TIdText.Create(IdMsg.MessageParts, nil); textbody.Body.Text := 'plain text part'; textbody.ContentType := 'text/plain'; textbody.ParentPart := 0; htmlbody := TIdText.Create(IdMsg.MessageParts, nil); htmlbody.body.text :=mailSendTbl.fieldbyname('邮件内容').AsString;// '

This is a email saying weeeeee

黑体字'; htmlbody.ContentType := 'text/html'; htmlbody.ParentPart := 0; IdMsg.ContentType := 'multipart/related; type="multipart/alternative"'; //IdMsg.ContentType :='text/html'; IdMsg.CharSet:='iso-8859-1'; IdMsg.Encoding:=meMIME; // IdMsg.body:=null;//mailSendTbl.fieldbyname('邮件内容').AsString; lognr:='挂单,具体内容请查阅邮件 '; end else begin Body.Text:=mailSendTbl.fieldbyname('邮件内容').AsString; lognr :=Body.Text; end; From.address :=MailAddress; Recipients.EMailAddresses :=mailSendTbl.FieldByName('收件人').AsString; // Recipients.EMailAddresses :='dev001@dongshengsoft.com'; // Subject:='ss'; Subject:=StringReplace(StringReplace(mailSendTbl.fieldbyname('邮件主题').AsString, #10, '', [rfReplaceAll]),#10,'', [rfReplaceAll]); strfile:= mailSendTbl.FieldByName('附件名称').AsString; bsno:= mailSendTbl.FieldByName('编号').AsString; mailtype:= mailSendTbl.FieldByName('单据类型').AsString; //----------------- if(FileExists(strfile)) then begin idAtta:= TIdAttachmentFile.Create(MessageParts,strfile); idAtta.ContentType:='application/octet-stream'; idAtta.ContentDisposition:='attachment'; idAtta.ContentTransfer:='base64'; idAtta.FileName:=ExtractFileName(strfile); end; end; if not SMTP1.Connected then begin Sleep(1000); SMTP1.Connect; end; SMTP1.Send(IdMsg); // 长度判断 Insert_mail_Log(bsno,mailtype,mailSendTbl.FieldByName('收件人').AsString,mailSendTbl.FieldByName('邮件主题').AsString,lognr,mailSend.FieldByName('附件名称').AsString); Result:=True; finally SMTP1.Disconnect; end; try finally str_memo.Free; SMTP1.Free; IdMsg.Free; end; end; finally // frm_sys_progress.close; // frm_sys_progress:=nil; end; end; function Tfrm_tree_main.checkGuadanTimes(str:string ):Boolean; begin result:=false; if(str='') or (pos('换签',str)<1 ) and (pos('挂单',str)<1 ) then begin result:=True; Exit; end; { if (pos('非换签:',Str)<1) and (Pos('换签:二',Str)>0) then //换签2次挂单:允许 begin result:=True; Exit; end; if(Pos('换签:',Str)>0) then //两次及以上的挂单不允许 result:=false; } end; procedure Tfrm_tree_main.mni3_swPENDINGClick(Sender: TObject); begin // mni_tskor_N1OkClick(Sender); end; procedure Tfrm_tree_main.btn5AlertOkClick(Sender: TObject); begin // taskFinish('预警提醒') end; procedure Tfrm_tree_main.taskFinish(Ofiletype:string ); var isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype,optype:string; i:Integer; begin if( Application.MessageBox(PChar('您确实要确认并完成'+Ofiletype+'任务吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; if (Ofiletype='') then exit; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if (Ofiletype=strtmp) then begin optype:='完成'; isok:=true; //挂单 mainno:=qry1task.fieldbyname('提单号').AsString; bsno:=qry1task.fieldbyname('SEA编号').AsString; filename:=qry1task.fieldbyname('电子档案路径').AsString; if strtmp ='ORIGINAL' then begin filetype:='船公司挂单'; //换签可以2次挂单,两次以上不可以;非换签两次及以上不可以 if(checkGuadanTimes(qry1task.fieldbyname('备注').AsString)=False) then begin Continue; end; isok:= Guadan(mainNo,bsno, filetype,filename); end else if strtmp ='VC' then begin filetype:='VC挂单'; end; try qry1task.Connection.BeginTrans; if(isok=true) then begin qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:=optype; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,optype,employee] ); qry1task.Connection.Execute(sql); qry1task.Connection.CommitTrans; end else begin qry1task.Connection.RollbackTrans; end; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); end; procedure Tfrm_tree_main.MyOnTerminate(Sender: TObject); begin { retVal := (Sender as TMyThread).MyFunRetVal; if retVal then ShowMessage('异步转发邮件成功') else ShowMessage('异步转发邮件存在失败'); } qry1task.Requery(); //ShowMessage( '邮件转发完成') ; end; procedure Tfrm_tree_main.mniN4_tskAss_rematchClick(Sender: TObject); begin //重新匹配任务 btn4_ReAssignTaskClick(btn4_ReAssignTask); end; /// /// 公共任务中的分单挂单任务处理 /// function Tfrm_tree_main.AssignPub_ORIGINAL_SEAWAY_VC():Boolean; var optype:string; isok:Boolean; strsql,strtmp:string; mainno,bsno,filename,filetype,Ofiletype,submainorder,subnos:string; i,isubcount:Integer; qrytmp:TADOQuery; unionsubnos:string;//union-->table,记录分单的主提单号 strTaskNewPerson:string; //分单多次挂单信息提示:写入备注 strOriginalMultiGuadn:string; begin if(qry1task.RecordCount<1) then Exit; Ofiletype:= tv1.Selected.Text; if( Application.MessageBox(PChar('您确实要批量匹配'+Ofiletype+'任务吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; subnos:=''; unionsubnos:=''; strOriginalMultiGuadn:=''; // ORIGINAL,SEAWAY,VC //先得到分单匹配的主单 isubcount:=0; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin submainorder:= qry1task.fieldbyname('提单号').AsString; qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); Ofiletype:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype='ORIGINAL') or (Ofiletype='SEAWAY') or (Ofiletype='VC') ) then begin //SELECT '57460774101' AS SUBNO if(isubcount=0) then unionsubnos:= FORMAT('SELECT ''%s'' AS SUBNO ',[submainorder]) else unionsubnos:= unionsubnos+ FORMAT(' UNION SELECT ''%s'' AS SUBNO ',[submainorder]); isubcount:=isubcount+1; subnos := subnos+ Format('''%s'',',[submainorder]) ; end; end; // if(isubcount=0) then begin ShowMessage('请选择分单!'); exit; end; subnos:=Copy(subnos,1,Length(subnos)-1); // strsql:='select t.主编号,count(主提单号) as Ncount from t_op_seae_assistant t ' +' where t.主提单号 in (' +subnos+ ')group by 主编号;'; qrytmp:=CreateAdoQuery; qrytmp.Close; with qrytmp do begin SQL.Add(strsql); Open; if(IsEmpty) then begin ShowMessage('请选择分单没有匹配记录!'); Exit; end else if(Recordset.RecordCount>1) then begin //多个 ShowMessage('选中的分单对应'+inttostr(Recordset.RecordCount)+'个主提单号,请重新选择!'); Close;//关闭qry Exit; end; //检查分单是否都在主单中 if(isubcount> FieldByName('Ncount').AsInteger) then begin strsql:= 'SELECT V.* FROM ( %s) V ' +#10#13 +' WHERE not exists (select t.主编号 from t_op_seae_assistant t where t.主提单号=v.subno ) '; Close;//关闭qry SQL.Clear; { t SELECT V.* FROM ( uniontable) V WHERE not exists (select t.主编号 from t_op_seae_assistant t where t.主提单号=v.subno ) } SQL.Add( Format(strsql,[unionsubnos])); Open; if(not IsEmpty) then begin //查出不存在的分单 First; strtmp:=''; while not Eof do begin strtmp:=strtmp+fieldbyname('SUBNO').AsString+','; Next; end; strtmp:=Copy(strtmp,1,Length(strtmp)-1); ShowMessage(format('分单[%s]在业务系统中没有匹配的主提单号!',[strtmp])); end; Exit; end; //检查分单对应的主单是否真正存在 strtmp:=fieldbyname('主编号').AsString; Close; SQL.Clear; SQL.Add(Format('select top 1 编号,主编号,主提单号,客服员 from t_op_seae t where t.主编号=''%s'' and t.业务类型=''普通货''', [strtmp])); Open; if(IsEmpty) then begin ShowMessage('异常数据:选中的分单对应的主提单在系统中没有记录!'); Close;//关闭qry Exit; end; mainno:= fieldbyname('主提单号').AsString; bsno:= fieldbyname('编号').AsString; strTaskNewPerson:=fieldbyname('客服员').AsString; end; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype='ORIGINAL') or (Ofiletype='SEAWAY') or (Ofiletype='VC') ) then begin optype:='分单挂单'; isok:=true; strOriginalMultiGuadn:=''; filename:=qry1task.fieldbyname('电子档案路径').AsString; submainorder:=qry1task.fieldbyname('提单号').AsString; if(Ofiletype='ORIGINAL') then begin //分提单号,sea编号检查是否已经挂单???? filetype:='船公司挂单'; //换签可以2次挂单,两次以上不可以;非换签两次及以上不可以 qrytmp.close; qrytmp.SQL.Clear; qrytmp.SQL.Add('select t.任务开始时间,t.完成时间 from t_op_task t '); qrytmp.SQL.Add(Format(' where sea编号=''%S'' and 任务类型=''ORIGINAL'' and 是否公共=1 and t.提单号=''%s''', [bsno,submainorder])) ; qrytmp.Open; if(not qrytmp.IsEmpty )then begin strtmp:=format('分单%s已经挂单%d次:',[submainorder,qrytmp.recordset.recordcount]); qrytmp.First; while not qrytmp.Eof do begin strtmp:=strtmp+#10#13+ Format('任务开始时间:%s,挂单时间:%s' ,[ qrytmp.fieldbyname('任务开始时间').AsString,qrytmp.fieldbyname('完成时间').AsString]); qrytmp.Next; end; strtmp:=strtmp+#10#13+'是否继续挂单?'; if(Application.MessageBox( PChar(strtmp),'信息提示',MB_YESNO+MB_ICONQUESTION)<>IDYES) then Continue; strOriginalMultiGuadn:=format('[第%d挂单]',[qrytmp.recordset.recordcount+1]); end; end else if(Ofiletype='SEAWAY') then filetype:='Seaway挂单' else if (Ofiletype='VC') then filetype:='VC挂单' else begin ShowMessage(format('提单号为%S的任务类型%s错误!',[mainNo,filetype])); continue; end; isok:= Guadan_2(mainNo,bsno, filetype,filename,True,submainorder); //分单挂单 try qry1task.Connection.BeginTrans; //挂单 if(isok=true) then begin qry1task.Edit; //分单对应的主提单的编号 qry1task.FieldByName('SEA编号').AsString:=bsno; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:=optype; qry1task.FieldByName('操作人').AsString:=employee; qry1task.FieldByName('备注').AsString:= qry1task.FieldByName('备注').AsString +format('(%s:%s)',[strtasknewperson ,mainno]) +strOriginalMultiGuadn; qry1task.Post; strsql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; strsql:=Format(strsql,[qry1task.fieldbyname('任务编号').asstring,optype,employee] ); qry1task.Connection.Execute(strsql); qry1task.Connection.CommitTrans; end else begin qry1task.Connection.RollbackTrans; end; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); // end; /// /// 公共任务BC/BA挂单 /// procedure Tfrm_tree_main.mniN4_tskAss_subRematchClick(Sender: TObject); begin //分单重新挂单---> //查找是否有主单,得到主单号 AssignPub_ORIGINAL_SEAWAY_VC(); end; procedure Tfrm_tree_main.Act516Execute(Sender: TObject); begin {$IFDEF YWTAIZHANG} {if not if_open('451',516) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; } if not assigned(frm_rp_tai_tasks) then frm_rp_tai_tasks:=tfrm_rp_tai_tasks.Create (self); frm_rp_tai_tasks.ManualDock(frm_main.SearchTabs('frm_rp_tai_tasks',frm_rp_tai_tasks.caption,'516'),nil,alClient); frm_rp_tai_tasks.show; {$ENDIF} end; procedure Tfrm_tree_main.ToolButton15Click(Sender: TObject); begin bindtaskdata(); end; procedure Tfrm_tree_main.Act550Execute(Sender: TObject); begin {if not if_open('453') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_op_tftp) then frm_op_tftp:=Tfrm_op_tftp.Create (self); frm_op_tftp.ManualDock(frm_main.SearchTabs('frm_op_tftp',frm_op_tftp.caption),nil,alClient); frm_op_tftp.show; } end; procedure Tfrm_tree_main.Act551Execute(Sender: TObject); begin if not if_open('454') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_wy) then frm_rp_wy:=Tfrm_rp_wy.Create (self); frm_rp_wy.ManualDock(frm_main.SearchTabs('frm_rp_wy',frm_rp_wy.caption),nil,alClient); frm_rp_wy.show; end; procedure Tfrm_tree_main.dxdbgrd1_taskColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,qry1task,'pl_id'); end; procedure Tfrm_tree_main.Act111001Execute(Sender: TObject); begin if not assigned(frm_rp_tai_total_op) then frm_rp_tai_total_op:=tfrm_rp_tai_total_op.Create (self); frm_rp_tai_total_op.ManualDock(frm_main.SearchTabs('frm_rp_tai_total_op',frm_rp_tai_total_op.caption,'111001'),nil,alClient); frm_rp_tai_total_op.show; end; procedure Tfrm_tree_main.Act9502Execute(Sender: TObject); begin try frm_code_dggoods:=tfrm_code_dggoods.Create (self); frm_code_dggoods.ShowModal; finally frm_code_dggoods.Free; end; end; procedure Tfrm_tree_main.Act9503Execute(Sender: TObject); begin try frm_code_stowgoods:=tfrm_code_stowgoods.Create (self); frm_code_stowgoods.ShowModal; finally frm_code_stowgoods.Free; end; end; procedure Tfrm_tree_main.Act9504Execute(Sender: TObject); begin try frm_code_bangoods:=tfrm_code_bangoods.Create (self); frm_code_bangoods.ShowModal; finally frm_code_bangoods.Free; end; end; procedure Tfrm_tree_main.Act111002Execute(Sender: TObject); begin if not assigned(frm_op_seae_dg) then frm_op_seae_dg:=tfrm_op_seae_dg.Create (self); frm_op_seae_dg.ManualDock(frm_main.SearchTabs('frm_op_seae_dg',frm_op_seae_dg.caption,'111002'),nil,alClient); frm_op_seae_dg.show; end; procedure Tfrm_tree_main.Act111004Execute(Sender: TObject); begin if not assigned(frm_code_fee_project_auto) then frm_code_fee_project_auto:=tfrm_code_fee_project_auto.Create (self); frm_code_fee_project_auto.ManualDock(frm_main.SearchTabs('frm_code_fee_project_auto',frm_code_fee_project_auto.caption,'111004'),nil,alClient); frm_code_fee_project_auto.show; end; procedure Tfrm_tree_main.Act111005Execute(Sender: TObject); begin if not assigned(frm_rp_dg_except) then frm_rp_dg_except:=tfrm_rp_dg_except.Create (self); frm_rp_dg_except.ManualDock(frm_main.SearchTabs('frm_rp_dg_except',frm_rp_dg_except.caption,'111005'),nil,alClient); frm_rp_dg_except.show; end; procedure Tfrm_tree_main.Act497Execute(Sender: TObject); begin if not assigned(frm_rp_cdstl) then frm_rp_cdstl:=tfrm_rp_cdstl.Create (self); frm_rp_cdstl.ManualDock(frm_main.SearchTabs('frm_rp_cdstl',frm_rp_cdstl.caption,'497'),nil,alClient); frm_rp_cdstl.show; end; procedure Tfrm_tree_main.Act499Execute(Sender: TObject); begin if not if_open('523') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_cw_pingzheng_jk) then frm_cw_pingzheng_jk:=tfrm_cw_pingzheng_jk.Create (self); frm_cw_pingzheng_jk.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng_jk',frm_cw_pingzheng_jk.caption,'499'),nil,alClient); frm_cw_pingzheng_jk.show; end; procedure Tfrm_tree_main.Act2502Execute(Sender: TObject); begin if not assigned(frm_ch_zlsales) then frm_ch_zlsales:=tfrm_ch_zlsales.Create (self); frm_ch_zlsales.ManualDock(frm_main.SearchTabs('frm_ch_zlsales',frm_ch_zlsales.caption,'2502'),nil,alClient); frm_ch_zlsales.show; end; procedure Tfrm_tree_main.ToolButton16Click(Sender: TObject); var i:Integer; sql:string; begin for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); try qry1task.Connection.BeginTrans; qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:='结束'; qry1task.FieldByName('操作人').AsString:=employee; qry1task.FieldByName('任务相关人员').AsString:=employee; qry1task.Post; sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,'结束',employee] ); qry1task.Connection.Execute(sql); qry1task.Connection.CommitTrans; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; qry1task.requery(); end; procedure Tfrm_tree_main.Act5209Execute(Sender: TObject); begin if not assigned(frm_rp_bssource_total) then frm_rp_bssource_total:=tfrm_rp_bssource_total.Create (self); frm_rp_bssource_total.ManualDock(frm_main.SearchTabs('frm_rp_bssource_total',frm_rp_bssource_total.caption,'2502'),nil,alClient); frm_rp_bssource_total.show; end; procedure Tfrm_tree_main.MenuItem6Click(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype:string; i:Integer; strsql, str,wtdw,strsjr,tasktype,YJ_FILEID,FNType:string; aQuery,qryMail:TADOQuery; ishtml:Boolean; //邮件队列列表 lsttsk:TstringList; //转发的邮件类型 Ofiletype:string; //邮件任务 qryMailQuee:TADOQuery; // taskQNo:string; ID: DWORD; pt:MYPARA; myThread1 :TMyThread; wtbh:string;//委托编号,BC/BA类邮件转发使用 begin if(qry1task.RecordCount<1) then Exit; if( Application.MessageBox(PChar('您确实要转发选中的运输计划变更邮件吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; //** if (Ofiletype='') then exit; lsttsk:=TStringList.Create(); // ishtml:=False; aQuery:=CreateAdoQuery(); qryMail:=CreateAdoQuery(); //## //## taskQNo:='q'+FormatDateTime('YYYYMMDDHHmmsszzz', Now); qryMailQuee:= CreateAdoQuery(); qryMailQuee.Close; qryMailQuee.SQL.Clear; qryMailQuee.SQL.Add('SELECT * FROM [t_op_task_mailque] where 1=2') ; qryMailQuee.Open; try for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); if(qry1task.FieldByName('任务状态').AsString ='转发中') then continue; wtbh:=''; strtmp:=qry1task.fieldbyname('委托编号').AsString; if((strtmp='') or ( Pos('TSE',UpperCase(strtmp))=1)) then wtbh:='' else wtbh:='___'+strtmp; wtdw:=qry1task.fieldbyname('委托单位').AsString; strtmp:=qry1task.fieldbyname('任务类型').AsString; if (1=1) then begin qry_op_seae.close; qry_op_seae.Parameters.ParamByName('编号').Value:=qry1task.FieldByName('SEA编号').AsString; qry_op_seae.Open; if not qry_op_seae.IsEmpty then begin // FNType:='计划变更'; tasktype:= qry1task.FieldByName('任务类型').AsString; // d.收件人 str:=' select d.*,c.客户名称 from t_code_cust_mailproject_detail d left join t_code_cust_mailproject c ' +' on (c.方案代码=d.方案代码) where 单据类型='''+ FNType +''' and c.客户名称='''+wtdw+''' and ' +' d.方案代码 in ' +'( SELECT distinct 客户邮件方案 from t_op_seae where 委托单位='''+wtdw+''' and isnull(客户邮件方案,'''')<>'''' ' +'and 编号='''+ qry_op_seae.FieldByName('编号').AsString +''' )'; with aQuery do begin close;sql.Clear; SQL.Add(str); Open; strsjr:=''; if aQuery.IsEmpty then begin ShowMessage('委托单位['+FNType+']邮件方案为空或者该票票业务没有选择邮件方案,无法转发!'); continue; end; aQuery.First; while not aQuery.eof do begin // if strsjr='' then strsjr := fieldbyname('收件人').AsString else strsjr := strsjr +',' +fieldbyname('收件人').AsString; Next; end; if(pos('@',strsjr)<1) then begin Application.MessageBox('邮件方案的收件人地址不正确,请确认后再转发!','信息提示',MB_OK+MB_ICONINFORMATION) ; continue; end; First; //** lsttsk.Add(qry1task.fieldbyname('任务编号').AsString ); //<--------------- {mailSend.EmptyTable; mailSend.Open; mailSend.Insert; mailSend.FieldByName('收件人').AsString:= strsjr;//fieldbyname('收件人').AsString; mailSend.FieldByName('邮件签名').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('邮件签名').AsString; } qryMailQuee.Insert; qryMailQuee.FieldByName('qid').AsString:=taskQNo; qryMailQuee.FieldByName('任务编号').AsString:=qry1task.FieldByName('任务编号').AsString; qryMailQuee.FieldByName('收件人').AsString:=strsjr; qryMailQuee.FieldByName('邮件签名').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('邮件签名').AsString; //YJ_FILEID:=m_qryTask.fieldbyname('文件编号').AsString; str:=qry1task.fieldbyname('提单号').AsString+'运输计划变更' ;// fieldbyname('主题模板').AsString +FormatDateTime('YYYYMMDDHHMMSS',now) ; qryMailQuee.fieldbyname('邮件主题').AsString :=str; qryMailQuee.FieldByName('附件名称').AsString:=qry1task.fieldbyname('电子档案路径').AsString ; if fieldbyname('邮件内容').IsNull then str:=' ' else str:=fieldbyname('邮件内容').AsString; //mailSend.FieldByName('邮件内容').AsString:=str; qryMailQuee.FieldByName('邮件内容').AsString:=str; qryMailQuee.FieldByName('任务类型').AsString:=tasktype; qryMailQuee.FieldByName('单据类型').AsString:=fieldbyname('单据类型').AsString; qryMailQuee.FieldByName('编号').AsString:=qry1task.fieldbyname('SEA编号').AsString ; qryMailQuee.FieldByName('主提单号').AsString:=qry1task.fieldbyname('提单号').AsString ; qryMailQuee.FieldByName('发件人').AsString:=employee; qryMailQuee.Post; //----------> try qry1task.Connection.BeginTrans; // sendmail(mailSend,FNType,qry1task.fieldbyname('SEA编号').AsString,ishtml) ; //更新状态 qry1task.Edit; //qry1task.FieldByName('完成时间').AsDateTime:=Now; //qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:='转发中';//'已转发'; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; // strsql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; strsql:=Format(strsql,[qry1task.fieldbyname('任务编号').asstring,'转发中',employee] ); // 已转发 qry1task.Connection.Execute(strsql); qry1task.Connection.CommitTrans; aQuery.Close(); except on ex:exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('转发失败:'+ex.Message),'信息提示',MB_OK+MB_ICONINFORMATION); continue; end; end; end ; end else begin Application.MessageBox(PChar('无业务数据无法转发!'),'信息提示',MB_OK+MB_ICONINFORMATION); end; end; end; finally FreeAndNil(aQuery); FreeAndNil(qryMail); end; qry1task.requery(); //调用邮件发送线程 // sendmailBatch(taskQNo); myThread1 := TMyThread.Create(taskQNo); // 创建线程并挂起 myThread1.OnTerminate:=MyOnTerminate; myThread1.Resume; end; procedure Tfrm_tree_main.MenuItem9Click(Sender: TObject); var optype:string; isok:Boolean; sql,strtmp:string; mainno,bsno,filename,filetype,Ofiletype:string; i:Integer; begin if(qry1task.RecordCount<1) then Exit; if( Application.MessageBox(PChar('您确实要确认并完成运输计划变更任务吗?'),'信息提示',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then Exit; Ofiletype:='运输计划变更'; for i:=0 to dxdbgrd1_task.SelectedCount-1 do begin qry1task.GotoBookmark(pointer(dxdbgrd1_task.selectedrows[i])); strtmp:=qry1task.fieldbyname('任务类型').AsString; if ((Ofiletype=strtmp)) then begin optype:='完成'; isok:=true; try qry1task.Connection.BeginTrans; //挂单 mainno:=qry1task.fieldbyname('提单号').AsString; bsno:=qry1task.fieldbyname('SEA编号').AsString; filename:=qry1task.fieldbyname('电子档案路径').AsString; filetype:=Ofiletype; //换签可以2次挂单,两次以上不可以;非换签两次及以上不可以 isok:= Guadan(mainNo,bsno, filetype,filename); if(isok=true) then begin qry1task.Edit; qry1task.FieldByName('完成时间').AsDateTime:=Now; qry1task.FieldByName('是否完成').AsInteger:=1; qry1task.FieldByName('任务状态').AsString:=optype; qry1task.FieldByName('操作人').AsString:=employee; qry1task.Post; sql:='INSERT INTO t_op_task_state ( [任务编号],[任务状态],[操作人])VALUES (''%s'' ,''%s'' ,''%s'')'; sql:=Format(sql,[qry1task.fieldbyname('任务编号').asstring,optype,employee] ); qry1task.Connection.Execute(sql); qry1task.Connection.CommitTrans; end else begin qry1task.Connection.RollbackTrans; end; except on e:Exception do begin qry1task.Connection.RollbackTrans; Application.MessageBox(PChar('处理发生错误: '+E.Message),'信息提示'); end; end; end; end; qry1task.requery(); end; procedure Tfrm_tree_main.Act418Execute(Sender: TObject); begin if not if_open('030') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_ch_invoice_jk) then frm_ch_invoice_jk:=tfrm_ch_invoice_jk.Create (self); frm_ch_invoice_jk.ManualDock(frm_main.SearchTabs('frm_ch_invoice_jk',frm_ch_invoice_jk.caption,'418'),nil,alClient); frm_ch_invoice_jk.show; end; procedure Tfrm_tree_main.Act9393Execute(Sender: TObject); begin try frm_code_goods_inv:=tfrm_code_goods_inv.Create (self); frm_code_goods_inv.ShowModal; finally frm_code_goods_inv.Free; end; end; procedure Tfrm_tree_main.Act9505Execute(Sender: TObject); begin try frm_code_trade_msc:=tfrm_code_trade_msc.Create (self); frm_code_trade_msc.ShowModal; finally frm_code_trade_msc.Free; end; end; procedure Tfrm_tree_main.bsSkinButton1Click(Sender: TObject); var aQuery:TADOQuery; str:string; begin if(qry1task.RecordCount<1) then Exit; qry_op_seae.close; qry_op_seae.Parameters.ParamByName('编号').Value:=qry1task.FieldByName('SEA编号').AsString; qry_op_seae.Open; if not qry_op_seae.IsEmpty then begin if qry_op_seae.FieldByName('客户邮件方案').AsString<>'' then begin aQuery:=CreateAdoQuery; try with aQuery do begin close;sql.Clear; SQL.Add('select * from t_code_cust_mailproject_detail where 方案代码='''+qry_op_seae.FieldByName('客户邮件方案').AsString+''' and 单据类型=''提单及下货纸'' '); Open; if not isempty then begin mailSend.EmptyTable; mailSend.Open; mailSend.Insert; mailSend.FieldByName('收件人').AsString:=fieldbyname('收件人').AsString; str:=fieldbyname('主题模板').AsString; str:=StringReplace(str,'[主提单号]',qry_op_seae.fieldbyname('主提单号').AsString,[]); // 补充委托编号 程建波 2017-07-20 str:=StringReplace(str,'[委托编号]',qry_op_seae.fieldbyname('委托编号').AsString,[]); str:=StringReplace(str,'[船名]',qry_op_seae.fieldbyname('船名').AsString,[]); str:=StringReplace(str,'[航次]',qry_op_seae.fieldbyname('航次').AsString,[]); str:=StringReplace(str,'[委托单位]',qry_op_seae.fieldbyname('委托单位').AsString,[]); mailSend.FieldByName('邮件主题').AsString:=str; str:=fieldbyname('邮件内容').AsString; str:=StringReplace(str,'[主提单号]',qry_op_seae.fieldbyname('主提单号').AsString,[]); // 补充委托编号 程建波 2017-07-22 str:=StringReplace(str,'[委托编号]',qry_op_seae.fieldbyname('委托编号').AsString,[]); str:=StringReplace(str,'[船名]',qry_op_seae.fieldbyname('船名').AsString,[]); str:=StringReplace(str,'[航次]',qry_op_seae.fieldbyname('航次').AsString,[]); str:=StringReplace(str,'[委托单位]',qry_op_seae.fieldbyname('委托单位').AsString,[]); mailSend.FieldByName('邮件内容').AsString:=str; frm_data_share.t_sys_employee.Locate('姓名',employee,[]); mailSend.FieldByName('邮件签名').AsString:=MailSignName;//frm_data_share.t_sys_employee.fieldbyname('邮件签名').AsString; str:=fieldbyname('附件名称').AsString; str:=StringReplace(str,'[主提单号]',qry_op_seae.fieldbyname('主提单号').AsString,[]); // 补充委托编号 程建波 2017-07-20 str:=StringReplace(str,'[委托编号]',qry_op_seae.fieldbyname('委托编号').AsString,[]); str:=StringReplace(str,'[船名]',qry_op_seae.fieldbyname('船名').AsString,[]); str:=StringReplace(str,'[航次]',qry_op_seae.fieldbyname('航次').AsString,[]); str:=StringReplace(str,'[委托单位]',qry_op_seae.fieldbyname('委托单位').AsString,[]); mailSend.FieldByName('附件名称').AsString:=str; mailSend.FieldByName('单据类型').AsString:=fieldbyname('单据类型').AsString; mailSend.FieldByName('编号').AsString:=qry_op_seae.fieldbyname('编号').AsString; mailSend.FieldByName('主提单号').AsString:=qry_op_seae.fieldbyname('主提单号').AsString; mailSend.Post; sys_print('海运出口单证任务台',2,qry_op_seae1,nil,nil,nil,qry_op_seae1,nil,nil,nil,nil,nil,nil,True,'',nil,nil,mailSend); end else sys_print('海运出口单证任务台',2,qry_op_seae1,nil,nil,nil,qry_op_seae1,nil,nil,nil,nil,nil,nil); end; finally FreeAndNil(aQuery); end; end else begin sys_print('海运出口单证任务台',2,qry_op_seae1,nil,nil,nil,qry_op_seae1,nil,nil,nil,nil,nil,nil); end; end else begin ShowMessage('业务信息不存在!'); end; end; procedure Tfrm_tree_main.Act9506Execute(Sender: TObject); begin try frm_code_dgunno:=tfrm_code_dgunno.Create (self); frm_code_dgunno.ShowModal; finally frm_code_dgunno.Free; end; end; procedure Tfrm_tree_main.Act9507Execute(Sender: TObject); begin try frm_code_package_dg:=tfrm_code_package_dg.Create (self); frm_code_package_dg.ShowModal; finally frm_code_package_dg.Free; end; end; procedure Tfrm_tree_main.Act5493Execute(Sender: TObject); begin if not assigned(frm_rp_nolx_ttl) then frm_rp_nolx_ttl:=tfrm_rp_nolx_ttl.Create (self); frm_rp_nolx_ttl.ManualDock(frm_main.SearchTabs('frm_rp_nolx_ttl',frm_rp_nolx_ttl.caption,'529'),nil,alClient); frm_rp_nolx_ttl.show; end; procedure Tfrm_tree_main.Act5211Execute(Sender: TObject); begin if not if_open('530') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_rp_zl_total2) then frm_rp_zl_total2:=tfrm_rp_zl_total2.Create (self); frm_rp_zl_total2.ManualDock(frm_main.SearchTabs('frm_rp_zl_total2',frm_rp_zl_total2.caption,'530'),nil,alClient); frm_rp_zl_total2.show; end; procedure Tfrm_tree_main.Act4991Execute(Sender: TObject); begin if not assigned(frm_cw_pingzheng_u8) then frm_cw_pingzheng_u8:=tfrm_cw_pingzheng_u8.Create (self); frm_cw_pingzheng_u8.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng_u8',frm_cw_pingzheng_u8.caption,'4991'),nil,alClient); frm_cw_pingzheng_u8.show; end; procedure Tfrm_tree_main.Act4992Execute(Sender: TObject); begin if not assigned(frm_cw_pingzheng_jku8) then frm_cw_pingzheng_jku8:=tfrm_cw_pingzheng_jku8.Create (self); frm_cw_pingzheng_jku8.ManualDock(frm_main.SearchTabs('frm_cw_pingzheng_jku8',frm_cw_pingzheng_jku8.caption,'4992'),nil,alClient); frm_cw_pingzheng_jku8.show; end; procedure Tfrm_tree_main.Act4302Execute(Sender: TObject); begin if not assigned(frm_rp_dui_auto) then frm_rp_dui_auto:=tfrm_rp_dui_auto.Create (self); frm_rp_dui_auto.ManualDock(frm_main.SearchTabs('frm_rp_dui_auto',frm_rp_dui_auto.caption,'4302'),nil,alClient); frm_rp_dui_auto.show; end; procedure Tfrm_tree_main.Act5365Execute(Sender: TObject); begin if not assigned(frm_rp_rp_seae2) then frm_rp_rp_seae2:=tfrm_rp_rp_seae2.Create (self); frm_rp_rp_seae2.ManualDock(frm_main.SearchTabs('frm_rp_rp_seae2',frm_rp_rp_seae2.caption,'5365'),nil,alClient); frm_rp_rp_seae2.show; end; end.