unit u_open_info; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, DB, ADODB,DateUtils; type Tfrm_open_info = class(TForm) bsSkinPanel1: TbsSkinPanel; bsSkinGroupBox1: TbsSkinGroupBox; bsSkinButton1: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton13: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton12: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinGroupBox2: TbsSkinGroupBox; bsSkinButton16: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton17: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton15: TbsSkinButton; bsSkinPanel2: TbsSkinPanel; bsSkinButton28: TbsSkinButton; bsSkinGroupBox3: TbsSkinGroupBox; bsSkinButton6: TbsSkinButton; bsSkinButton14: TbsSkinButton; bsSkinButton18: TbsSkinButton; bsSkinButton19: TbsSkinButton; bsSkinButton20: TbsSkinButton; bsSkinGroupBox4: TbsSkinGroupBox; bsSkinButton23: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; bsSkinButton30: TbsSkinButton; bsSkinGroupBox5: TbsSkinGroupBox; bsSkinButton21: TbsSkinButton; bsSkinButton22: TbsSkinButton; bsSkinButton26: TbsSkinButton; bsSkinButton27: TbsSkinButton; bsSkinButton29: TbsSkinButton; bsSkinButton31: TbsSkinButton; bsSkinButton32: TbsSkinButton; p_kaoqin: TADOStoredProc; bsSkinButton33: TbsSkinButton; bsSkinButton34: TbsSkinButton; bsSkinButton35: TbsSkinButton; bsSkinButton36: TbsSkinButton; bsSkinButton37: TbsSkinButton; bsSkinButton38: TbsSkinButton; bsSkinButton39: TbsSkinButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure bsSkinButton28Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); procedure bsSkinButton20Click(Sender: TObject); procedure bsSkinButton19Click(Sender: TObject); procedure bsSkinPanel1Resize(Sender: TObject); procedure bsSkinButton30Click(Sender: TObject); procedure bsSkinButton31Click(Sender: TObject); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton24Click(Sender: TObject); procedure bsSkinButton25Click(Sender: TObject); procedure bsSkinButton27Click(Sender: TObject); procedure bsSkinButton32Click(Sender: TObject); procedure bsSkinButton29Click(Sender: TObject); procedure bsSkinButton33Click(Sender: TObject); procedure bsSkinButton34Click(Sender: TObject); procedure bsSkinButton35Click(Sender: TObject); procedure bsSkinButton36Click(Sender: TObject); procedure bsSkinButton37Click(Sender: TObject); procedure bsSkinButton38Click(Sender: TObject); procedure bsSkinButton39Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_open_info: Tfrm_open_info; implementation uses u_main, u_crm_client, u_info_price_manage, u_crm_client_sales, u_crm_client_check, u_crm_client_report, u_crm_client_contract, u_info_price_agreement, u_crm_client_pet, u_info_plan_brother, u_info_price_ask, u_info_price_release, u_info_price_other, u_crm_client_ship, u_crm_client_brother, u_info_price_person, my_sys_function, u_info_rules, u_info_criterion, u_info_bulletin_manage, u_info_render_manager, u_info_plan_manage, u_info_card, u_info_yijian_manage, u_info_kaoqin_shouquan, u_info_kaoqin_report, u_info_law, u_crm_client_special, u_info_custom, u_info_price_cust, u_sys_progress, u_info_price_managelist, u_crm_client_ty; {$R *.dfm} procedure Tfrm_open_info.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_open_info.Hide; frm_open_info.ManualFloat(frm_open_info.BoundsRect ); frm_open_info:=nil; end; procedure Tfrm_open_info.bsSkinButton1Click(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),nil,alClient); frm_crm_client.show; end; procedure Tfrm_open_info.bsSkinButton3Click(Sender: TObject); begin 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),nil,alClient); frm_info_price_manage.show; end; procedure Tfrm_open_info.bsSkinButton2Click(Sender: TObject); begin 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),nil,alClient); frm_crm_client_sales.show; end; procedure Tfrm_open_info.bsSkinButton9Click(Sender: TObject); begin if not if_open('092') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_check) then frm_crm_client_check:=tfrm_crm_client_check.Create (self); frm_crm_client_check.ManualDock(frm_main.SearchTabs('frm_crm_client_check',frm_crm_client_check.caption),nil,alClient); frm_crm_client_check.show; end; procedure Tfrm_open_info.bsSkinButton10Click(Sender: TObject); begin 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),nil,alClient); frm_crm_client_report.show; end; procedure Tfrm_open_info.bsSkinButton12Click(Sender: TObject); begin if not if_open('094') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_contract) then frm_crm_client_contract:=tfrm_crm_client_contract.Create (self); frm_crm_client_contract.ManualDock(frm_main.SearchTabs('frm_crm_client_contract',frm_crm_client_contract.caption),nil,alClient); frm_crm_client_contract.show; end; procedure Tfrm_open_info.bsSkinButton16Click(Sender: TObject); begin if not if_open('118') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_agreement) then frm_info_price_agreement:=tfrm_info_price_agreement.Create (self); frm_info_price_agreement.ManualDock(frm_main.SearchTabs('frm_info_price_agreement',frm_info_price_agreement.caption),nil,alClient); frm_info_price_agreement.show; end; procedure Tfrm_open_info.bsSkinButton4Click(Sender: TObject); begin if not if_open('120') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_pet) then frm_crm_client_pet:=tfrm_crm_client_pet.Create (self); frm_crm_client_pet.ManualDock(frm_main.SearchTabs('frm_crm_client_pet',frm_crm_client_pet.caption),nil,alClient); frm_crm_client_pet.show; end; procedure Tfrm_open_info.bsSkinButton17Click(Sender: TObject); begin if not if_open('123') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_brother) then frm_info_price_brother:=tfrm_info_price_brother.Create (self); frm_info_price_brother.ManualDock(frm_main.SearchTabs('frm_info_price_brother',frm_info_price_brother.caption),nil,alClient); frm_info_price_brother.show; end; procedure Tfrm_open_info.bsSkinButton5Click(Sender: TObject); begin if not if_open('124') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_ask) then frm_info_price_ask:=tfrm_info_price_ask.Create (self); frm_info_price_ask.ManualDock(frm_main.SearchTabs('frm_info_price_ask',frm_info_price_ask.caption),nil,alClient); frm_info_price_ask.show; end; procedure Tfrm_open_info.bsSkinButton11Click(Sender: TObject); begin 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),nil,alClient); frm_info_price_release.show; end; procedure Tfrm_open_info.bsSkinButton7Click(Sender: TObject); begin 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),nil,alClient); frm_info_price_other.show; end; procedure Tfrm_open_info.bsSkinButton8Click(Sender: TObject); begin if not if_open('127') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_ship) then frm_crm_client_ship:=tfrm_crm_client_ship.Create (self); frm_crm_client_ship.ManualDock(frm_main.SearchTabs('frm_crm_client_ship',frm_crm_client_ship.caption),nil,alClient); frm_crm_client_ship.show; end; procedure Tfrm_open_info.bsSkinButton13Click(Sender: TObject); begin if not if_open('128') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_brother) then frm_crm_client_brother:=tfrm_crm_client_brother.Create (self); frm_crm_client_brother.ManualDock(frm_main.SearchTabs('frm_crm_client_brother',frm_crm_client_brother.caption),nil,alClient); frm_crm_client_brother.show; end; procedure Tfrm_open_info.bsSkinButton15Click(Sender: TObject); begin if not assigned(frm_info_price_release) then frm_info_price_person:=tfrm_info_price_person.Create (self); frm_info_price_person.ManualDock(frm_main.SearchTabs('frm_info_price_person',frm_info_price_person.caption),nil,alClient); frm_info_price_person.show; end; procedure Tfrm_open_info.bsSkinButton28Click(Sender: TObject); begin close; end; procedure Tfrm_open_info.bsSkinButton6Click(Sender: TObject); begin 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),nil,alClient); frm_info_rules.show; end; procedure Tfrm_open_info.bsSkinButton14Click(Sender: TObject); begin 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),nil,alClient); frm_info_criterion.show; end; procedure Tfrm_open_info.bsSkinButton18Click(Sender: TObject); begin 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),nil,alClient); frm_info_bulletin_manage.show; end; procedure Tfrm_open_info.bsSkinButton20Click(Sender: TObject); begin 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; end; procedure Tfrm_open_info.bsSkinButton19Click(Sender: TObject); begin if not if_open('019') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_plan_manage) then frm_info_plan_manage:=tfrm_info_plan_manage.Create (self); frm_info_plan_manage.ManualDock(frm_main.SearchTabs('frm_info_plan_manage',frm_info_plan_manage.caption),nil,alClient); frm_info_plan_manage.show; end; procedure Tfrm_open_info.bsSkinPanel1Resize(Sender: TObject); var i:integer; begin i:=round((bsSkinPanel1.width-bsSkinPanel2.width)/5); bsSkinGroupBox1.width:=i; bsSkinGroupBox2.width:=i; bsSkinGroupBox3.width:=i; bsSkinGroupBox5.width:=i; begin limited_button('018',bsSkinButton1); limited_button('053',bsSkinButton3); limited_button('091',bsSkinButton2); limited_button('092',bsSkinButton9); limited_button('093',bsSkinButton10); limited_button('094',bsSkinButton12); limited_button('118',bsSkinButton16); limited_button('120',bsSkinButton4); limited_button('123',bsSkinButton17); limited_button('124',bsSkinButton5); limited_button('125',bsSkinButton11); limited_button('126',bsSkinButton7); limited_button('127',bsSkinButton8); limited_button('128',bsSkinButton13); limited_button('020',bsSkinButton20); limited_button('019',bsSkinButton19); limited_button('166',bsSkinButton18); limited_button('167',bsSkinButton31); limited_button('168',bsSkinButton32); limited_button('169',bsSkinButton29); limited_button('181',bsSkinButton34); limited_button('125',bsSkinButton36); limited_button('234',bsSkinButton38); end; end; procedure Tfrm_open_info.bsSkinButton30Click(Sender: TObject); begin 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),nil,alClient); frm_info_card.show; end; procedure Tfrm_open_info.bsSkinButton31Click(Sender: TObject); begin 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),nil,alClient); frm_info_yijian_manage.show; end; procedure Tfrm_open_info.bsSkinButton23Click(Sender: TObject); begin p_kaoqin.Parameters.ParamByName('emp').value:=employee; p_kaoqin.Parameters.ParamByName('lei').value:='上午签到'; p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; p_kaoqin.Parameters.ParamByName('sh').value:=''; p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; p_kaoqin.Parameters.ParamByName('shouquan_date').value:=date; p_kaoqin.ExecProc; if p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('上午签到成功!!'); end else begin showmessage('上午您已经签到!!'); end; end; procedure Tfrm_open_info.bsSkinButton24Click(Sender: TObject); begin p_kaoqin.Parameters.ParamByName('emp').value:=employee; p_kaoqin.Parameters.ParamByName('lei').value:='上午签退'; p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; p_kaoqin.Parameters.ParamByName('sh').value:=''; p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; p_kaoqin.Parameters.ParamByName('shouquan_date').value:=date; p_kaoqin.ExecProc; if p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('上午签退成功!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('上午您已经签退!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=4 then begin showmessage('上午您还没有签到不能签退!!'); exit; end; end; procedure Tfrm_open_info.bsSkinButton25Click(Sender: TObject); begin p_kaoqin.Parameters.ParamByName('emp').value:=employee; p_kaoqin.Parameters.ParamByName('lei').value:='下午签到'; p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; p_kaoqin.Parameters.ParamByName('sh').value:=''; p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; p_kaoqin.Parameters.ParamByName('shouquan_date').value:=date; p_kaoqin.ExecProc; if p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('下午签到成功!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('下午您已经签到!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=3 then begin showmessage('下午签到只能在13:00以后才能操作!!'); end; end; procedure Tfrm_open_info.bsSkinButton27Click(Sender: TObject); begin p_kaoqin.Parameters.ParamByName('emp').value:=employee; p_kaoqin.Parameters.ParamByName('lei').value:='下午签退'; p_kaoqin.Parameters.ParamByName('cmp').value:=LocalIP; p_kaoqin.Parameters.ParamByName('sh').value:=''; p_kaoqin.Parameters.ParamByName('sh_emp').value:=''; p_kaoqin.Parameters.ParamByName('shouquan_date').value:=date; p_kaoqin.ExecProc; if p_kaoqin.Parameters.ParamByName('i').value=1 then begin showmessage('下午签退成功!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=2 then begin showmessage('下午您已经签退!!'); exit; end; if p_kaoqin.Parameters.ParamByName('i').value=5 then begin showmessage('下午您还没有签到不能签退!!'); exit; end; end; procedure Tfrm_open_info.bsSkinButton32Click(Sender: TObject); begin 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; end; procedure Tfrm_open_info.bsSkinButton29Click(Sender: TObject); begin 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),nil,alClient); frm_info_kaoqin_report.show; end; procedure Tfrm_open_info.bsSkinButton33Click(Sender: TObject); begin if not assigned(frm_info_law) then frm_info_law:=tfrm_info_law.Create (self); frm_info_law.ManualDock(frm_main.SearchTabs('frm_info_law',frm_info_law.caption),nil,alClient); frm_info_law.show; end; procedure Tfrm_open_info.bsSkinButton34Click(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_open_info.bsSkinButton35Click(Sender: TObject); begin if not assigned(frm_info_custom) then frm_info_custom:=tfrm_info_custom.Create (self); frm_info_custom.ManualDock(frm_main.SearchTabs('frm_info_custom',frm_info_custom.caption),nil,alClient); frm_info_custom.show; end; procedure Tfrm_open_info.bsSkinButton36Click(Sender: TObject); begin if not if_open('125') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_cust) then frm_info_price_cust:=tfrm_info_price_cust.Create (self); frm_info_price_cust.ManualDock(frm_main.SearchTabs('frm_info_price_cust',frm_info_price_cust.caption),nil,alClient); frm_info_price_cust.show; end; procedure Tfrm_open_info.bsSkinButton37Click(Sender: TObject); var aQuery,aQuery3:TADOQuery; function getstlDate(aetd:TDateTime;Cust,SaleID:String):TDate; var aQuery2:TADOQuery; aYear,aMonth,aDay,bDay:word; aStlDate:TDateTime; begin aQuery2:=CreateAdoQuery; aStlDate:=aetd; result:=aetd; try with aQuery2 do begin Close;SQL.Clear; SQL.Add('Select * from t_crm_client_sales where 状态=''审核'' and 开始日期<='''+FormatDateTime('YYYY-MM-DD',aetd)+''' and 结束日期>='''+FormatDateTime('YYYY-MM-DD',aetd)+''' and 客户简称='''+Cust+''' and 揽货人='''+SaleID+''''); Open; if not IsEmpty then begin if FieldByName('结费类型').AsString='现结买单' then begin Result:=aetd; end else if FieldByName('结费类型').AsString='约定天数' then begin if not fieldByName('结费期限').IsNull then result:=aetd+fieldByName('结费期限').AsInteger; end else if FieldByName('结费类型').AsString='约定时间' then begin if FieldByName('日期模式').AsString='固定' then begin DecodeDate(IncMonth(aStlDate,StrToIntDef(FieldByName('类型模式').AsString,0)),aYear,aMonth,aDay); bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1)); if fieldByName('结费日期').AsInteger>bDay then result:=EncodeDate(aYear,aMonth,bDay) else result:=EncodeDate(aYear,aMonth,fieldByName('结费日期').AsInteger); end else result:=IncMonth(aStlDate,StrToIntDef(FieldByName('类型模式').AsString,0)); end else if FieldByName('结费类型').AsString='分阶段付费' then begin DecodeDate(IncMonth(aStlDate,StrToIntDef(FieldByName('类型模式').AsString,0)),aYear,aMonth,aDay); if aDay>fieldByName('结束日期').AsInteger then begin bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1)); if fieldByName('结费日期2').AsInteger>bDay then result:=EncodeDate(aYear,aMonth,bDay) else result:=EncodeDate(aYear,aMonth,fieldByName('结费日期2').AsInteger); end else begin bDay:=DaysInMonth(EncodeDate(aYear,aMonth,1)); if fieldByName('结费日期').AsInteger>bDay then result:=EncodeDate(aYear,aMonth,bDay) else result:=EncodeDate(aYear,aMonth,fieldByName('结费日期').AsInteger); result:=EncodeDate(aYear,aMonth,fieldByName('结费日期').AsInteger); end; end else begin Result:=aetd; end; end else begin Result:=aetd; end; end; finally FreeAndNil(aQuery2); end; end; begin if not if_open('018') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; aQuery:=CreateAdoQuery; aQuery3:=CreateAdoQuery; try try with aQuery do begin Close;SQL.Clear; SQL.Add('SELECT * FROM T_CH_FEE WHERE (t_ch_fee.金额<>t_ch_fee.结算金额) '); Open; if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(application); frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=aQuery.RecordCount; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; First; while not eof do begin frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; aQuery3.Close; aQuery3.SQL.Clear; aQuery3.SQL.Add('select 开船日期,预抵日期,揽货人 from t_op_seae where 编号='''+aQuery.fieldbyName('编号').AsString+''''); aQuery3.Open; if not aQuery3.IsEmpty then begin Edit; FieldByName('应结日期').AsDateTime:=getstlDate(aQuery3['预抵日期'],fieldbyName('客户名称').AsString,aQuery3['揽货人']); Post; end; Next; end; end; finally FreeAndNil(aQuery); FreeAndNil(aQuery3); freeAndNil(frm_sys_progress); end; showmessage('执行完成!'); except showmessage('执行过程中出现错误!'); end; end; procedure Tfrm_open_info.bsSkinButton38Click(Sender: TObject); begin if not if_open('234') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_info_price_managelist) then frm_info_price_managelist:=tfrm_info_price_managelist.Create (self); frm_info_price_managelist.ManualDock(frm_main.SearchTabs('frm_info_price_managelist',frm_info_price_managelist.caption),nil,alClient); frm_info_price_managelist.show; end; procedure Tfrm_open_info.bsSkinButton39Click(Sender: TObject); begin if not if_open('250') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if not assigned(frm_crm_client_ty) then frm_crm_client_ty:=tfrm_crm_client_ty.Create (self); frm_crm_client_ty.ManualDock(frm_main.SearchTabs('frm_crm_client_ty',frm_crm_client_ty.caption),nil,alClient); frm_crm_client_ty.show; end; end.