unit u_ch_prnFee_query; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BusinessSkinForm, bsSkinCtrls, wwdblook, wwdbdatetimepicker,inifiles, Mask, wwdbedit, Wwdotdot, Wwdbcomb, RxLookup, StdCtrls; type Tfrm_ch_prnfee_query = class(TForm) Label10: TLabel; Label9: TLabel; Label14: TLabel; Label15: TLabel; Label6: TLabel; Label7: TLabel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label8: TLabel; Label11: TLabel; Label20: TLabel; Label124: TLabel; Label13: TLabel; Label16: TLabel; Label28: TLabel; Label19: TLabel; Label22: TLabel; Label23: TLabel; Label26: TLabel; Label27: TLabel; Label29: TLabel; Label125: TLabel; Label30: TLabel; Label37: TLabel; Label38: TLabel; Label39: TLabel; Label40: TLabel; Label41: TLabel; Edit1: TEdit; RxDBLookupCombo2: TRxDBLookupCombo; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo4: TRxDBLookupCombo; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; wwDBComboBox1: TwwDBComboBox; wwDBComboBox2: TwwDBComboBox; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker2: TwwDBDateTimePicker; wwDBDateTimePicker3: TwwDBDateTimePicker; wwDBDateTimePicker4: TwwDBDateTimePicker; wwDBLookupCombo3: TwwDBLookupCombo; wwDBLookupCombo52: TwwDBLookupCombo; RxDBLookupCombo5: TRxDBLookupCombo; RxDBLookupCombo6: TRxDBLookupCombo; bsSkinButton10: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton1: TbsSkinButton; RxDBLookupCombo9: TRxDBLookupCombo; wwDBComboBox3: TwwDBComboBox; wwDBComboBox4: TwwDBComboBox; wwDBComboBox5: TwwDBComboBox; wwDBComboBox6: TwwDBComboBox; wwDBComboBox7: TwwDBComboBox; wwDBComboBox11: TwwDBComboBox; wwDBComboBox13: TwwDBComboBox; wwDBComboBox14: TwwDBComboBox; wwDBComboBox15: TwwDBComboBox; wwDBComboBox16: TwwDBComboBox; wwDBComboBox17: TwwDBComboBox; wwDBComboBox18: TwwDBComboBox; wwDBComboBox19: TwwDBComboBox; wwDBComboBox20: TwwDBComboBox; wwDBComboBox21: TwwDBComboBox; wwDBComboBox22: TwwDBComboBox; wwDBComboBox24: TwwDBComboBox; wwDBComboBox25: TwwDBComboBox; wwDBComboBox26: TwwDBComboBox; wwDBComboBox27: TwwDBComboBox; wwDBComboBox28: TwwDBComboBox; RxDBLookupCombo10: TRxDBLookupCombo; RxDBLookupCombo12: TRxDBLookupCombo; wwDBComboBox29: TwwDBComboBox; wwDBComboBox32: TwwDBComboBox; RxDBLookupCombo13: TRxDBLookupCombo; wwDBComboBox33: TwwDBComboBox; Edit5: TEdit; wwDBComboBox34: TwwDBComboBox; Edit6: TEdit; wwDBLookupCombo49: TwwDBLookupCombo; wwDBComboBox35: TwwDBComboBox; Edit7: TEdit; wwDBComboBox36: TwwDBComboBox; wwDBComboBox41: TwwDBComboBox; Edit10: TEdit; wwDBComboBox42: TwwDBComboBox; Edit11: TEdit; wwDBComboBox43: TwwDBComboBox; wwDBComboBox44: TwwDBComboBox; wwDBComboBox46: TwwDBComboBox; bsBusinessSkinForm1: TbsBusinessSkinForm; Label33: TLabel; Label12: TLabel; wwDBComboBox8: TwwDBComboBox; cmbbPrn: TComboBox; cmbbYwLb: TComboBox; wwDBComboBox9: TwwDBComboBox; RxDBLookupCombo16: TRxDBLookupCombo; Label17: TLabel; wwDBComboBox45: TwwDBComboBox; RxDBLookupCombo15: TRxDBLookupCombo; bsSkinCheckRadioBox1: TbsSkinCheckRadioBox; procedure FormShow(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); private { Private declarations } public { Public declarations } function getprnstr:string ; procedure loadFindIni ; procedure writeFindIni ; end; var frm_ch_prnfee_query: Tfrm_ch_prnfee_query; implementation {$R *.dfm} uses u_main,my_sys_function, u_data_share ; procedure Tfrm_ch_prnfee_query.FormShow(Sender: TObject); begin loadfindini; frm_data_share.t_code_state.Filtered:=false; frm_data_share.t_code_state.Filter:='业务种类='+''''+'海运出口'+''''; frm_data_share.t_code_state.Filtered:=true; frm_data_share.t_crm_client_ship.requery; frm_data_share.t_crm_client_changzhan.requery; frm_data_share.t_crm_client_truck.requery; frm_data_share.t_crm_client_baoguan.requery; frm_data_share.t_crm_client_weituo.requery; frm_data_share.t_crm_client_daili.requery; frm_data_share.t_crm_client_huodai.requery; frm_data_share.t_code_state.first; while not frm_data_share.t_code_state.eof do begin wwDBComboBox1.Items.Add(frm_data_share.t_code_state.fieldbyname('业务状态').asstring); frm_data_share.t_code_state.next; end; wwDBComboBox1.Items.Add('业务封帐'); end; procedure Tfrm_ch_prnfee_query.bsSkinButton10Click(Sender: TObject); begin Edit1.text:=''; Edit2.text:=''; Edit3.text:=''; Edit4.text:=''; Edit5.text:=''; Edit6.text:=''; Edit7.text:=''; Edit10.text:=''; Edit11.text:=''; wwDBComboBox1.text:=''; wwDBComboBox2.text:=''; wwDBDateTimePicker1.Clear; wwDBDateTimePicker2.Clear; wwDBDateTimePicker3.Clear; wwDBDateTimePicker4.Clear; wwDBComboBox3.text:=''; RxDBLookupCombo2.ClearValue; RxDBLookupCombo9.ClearValue; wwDBLookupCombo3.text:=''; wwDBLookupCombo49.text:=''; wwDBLookupCombo52.text:=''; RxDBLookupCombo4.ClearValue; RxDBLookupCombo3.ClearValue; RxDBLookupCombo6.ClearValue; RxDBLookupCombo5.ClearValue; RxDBLookupCombo10.ClearValue; RxDBLookupCombo12.ClearValue; RxDBLookupCombo13.ClearValue; RxDBLookupCombo16.ClearValue; RxDBLookupCombo15.ClearValue; cmbbYwLb.ItemIndex:=-1 ; cmbbPrn.ItemIndex:=-1 ; end; procedure Tfrm_ch_prnfee_query.bsSkinButton5Click(Sender: TObject); begin close; end; function Tfrm_ch_prnfee_query.getprnstr: string; var str:widestring; str_date:string; begin str:=' where 主编号=编号 '; str:=query_tiaojian(1,str,'业务编号',wwDBComboBox15.text,Edit1.text); str:=query_tiaojian(1,str,'委托编号',wwDBComboBox4.text,Edit4.text); str:=query_tiaojian(1,str,'主提单号',wwDBComboBox16.text,Edit2.text); str:=query_tiaojian(1,str,'分提单号',wwDBComboBox5.text,Edit3.text); str:=query_tiaojian(1,str,'报关单号',wwDBComboBox41.text,Edit10.text); str:=query_tiaojian(1,str,'报检单号',wwDBComboBox42.text,Edit11.text); str:=query_tiaojian(1,str,'发票号',wwDBComboBox33.text,Edit5.text); str:=query_tiaojian(1,str,'核销单号',wwDBComboBox34.text,Edit6.text); str:=query_tiaojian(1,str,'业务状态',wwDBComboBox17.text,wwDBComboBox1.text); str:=query_tiaojian(1,str,'费用状态',wwDBComboBox7.text,wwDBComboBox2.text); str:=query_tiaojian(1,str,'开船日期',wwDBComboBox18.text,wwDBDateTimePicker1.text); str:=query_tiaojian(1,str,'开船日期',wwDBComboBox6.text,wwDBDateTimePicker2.text); str:=query_tiaojian(1,str,'会计期间',wwDBComboBox19.text,wwDBDateTimePicker3.text); str:=query_tiaojian(1,str,'会计期间',wwDBComboBox11.text,wwDBDateTimePicker4.text); str:=query_tiaojian(1,str,'装运方式',wwDBComboBox20.text,wwDBComboBox3.text); str:=query_tiaojian(1,str,'委托单位',wwDBComboBox21.text,RxDBLookupCombo2.DisplayValues[1]); str:=query_tiaojian(1,str,'报关行',wwDBComboBox22.text,RxDBLookupCombo9.DisplayValues[1]); str:=query_tiaojian(1,str,'装货港',wwDBComboBox26.text,wwDBLookupCombo3.text); str:=query_tiaojian(1,str,'卸货港',wwDBComboBox27.text,wwDBLookupCombo52.text); str:=query_tiaojian(1,str,'客服员',wwDBComboBox24.text,RxDBLookupCombo4.DisplayValue); str:=query_tiaojian(1,str,'揽货人',wwDBComboBox14.text,RxDBLookupCombo3.DisplayValue); str:=query_tiaojian(1,str,'操作员',wwDBComboBox25.text,RxDBLookupCombo6.DisplayValue); str:=query_tiaojian(1,str,'录入人',wwDBComboBox13.text,RxDBLookupCombo5.DisplayValue); str:=query_tiaojian(1,str,'商品名称',wwDBComboBox32.text,RxDBLookupCombo13.DisplayValues[1]); str:=query_tiaojian(1,str,'船名',wwDBComboBox36.text,wwDBLookupCombo49.text); str:=query_tiaojian(1,str,'航次',wwDBComboBox35.text,Edit7.text); // str:=query_tiaojian(1,str,'业务类型',wwDBComboBox43.text,wwDBComboBox44.text); str:=query_tiaojian(1,str,'业务来源',wwDBComboBox9.text,RxDBLookupCombo16.DisplayValue); str:=query_tiaojian(1,str,'业务类别',wwDBComboBox46.text,cmbbYwLb.Text); str:=query_tiaojian(1,str,'销售部门',wwDBComboBox28.text,RxDBLookupCombo10.DisplayValue); str:=query_tiaojian(1,str,'操作部门',wwDBComboBox29.text,RxDBLookupCombo12.DisplayValue); str:=query_tiaojian(1,str,'分部名称',wwDBComboBox45.text,RxDBLookupCombo15.DisplayValue); if cmbbPrn.Text<>'' then if str='' then str:='where 是否打印='+inttostr(cmbbPrn.itemindex) else str:=str+'and 是否打印='+inttostr(cmbbPrn.itemindex) ; if trim(str)='' then begin str:='where '+open_data('0039','录入人', '操作员','客服员','no','no'); end else begin str:=str+' and '+open_data('0039','录入人', '操作员','客服员','no','no'); end; result:=str ; end; procedure Tfrm_ch_prnfee_query.bsSkinButton1Click(Sender: TObject); begin writeFindIni; modalresult:=mrok ; end; procedure Tfrm_ch_prnfee_query.loadFindIni; var findini:tinifile ; mysec,tmpname:string; canload:boolean ; //是否记忆 i:integer ; begin mysec:=inttostr(321) ; findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'prnFeequery.ini'); try canload:=findini.ReadBool(mysec,mysec,false); bsSkinCheckRadioBox1.Checked:=canload ; if canload then begin for i:=0 to ControlCount-1 do begin tmpname:=Controls[i].Name ; if Controls[i] is TwwDBComboBox then (Controls[i] as TwwDBComboBox).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TwwDBLookupCombo then (Controls[i] as TwwDBLookupCombo).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TEdit then (Controls[i] as TEdit).Text:=findini.ReadString(mysec,TmpName,'') else if Controls[i] is TwwDBDateTimePicker then (Controls[i] as TwwDBDateTimePicker).Date:=strtodate(findini.ReadString(mysec,TmpName,'')) else if Controls[i] is TRxDBLookupCombo then (Controls[i] as TRxDBLookupCombo).Value:=findini.ReadString(mysec,TmpName,'') ; end ; end else begin wwDBComboBox15.text:='模糊'; wwDBComboBox16.text:='模糊'; wwDBComboBox41.text:='模糊'; wwDBComboBox42.text:='模糊'; wwDBComboBox33.text:='模糊'; wwDBComboBox34.text:='模糊'; wwDBComboBox4.text:='模糊'; wwDBComboBox5.text:='模糊'; wwDBComboBox35.text:='模糊'; wwDBComboBox36.text:='模糊'; wwDBComboBox17.text:='等于'; wwDBComboBox7.text:='等于'; wwDBComboBox18.text:='大于'; wwDBComboBox6.text:='小于'; wwDBComboBox11.text:='小于'; wwDBComboBox19.text:='大于'; wwDBComboBox20.text:='等于'; wwDBComboBox21.text:='等于'; wwDBComboBox22.text:='等于'; wwDBComboBox24.text:='等于'; wwDBComboBox25.text:='等于'; wwDBComboBox26.text:='模糊'; wwDBComboBox27.text:='模糊'; wwDBComboBox13.text:='等于'; wwDBComboBox14.text:='等于'; wwDBComboBox28.text:='等于'; wwDBComboBox29.text:='等于'; wwDBComboBox32.text:='等于'; wwDBComboBox43.text:='等于'; wwDBComboBox46.text:='等于'; wwDBComboBox8.text:='等于'; wwDBComboBox9.text:='等于'; wwDBComboBox45.text:='等于'; end ; finally findini.free; end ; end; procedure Tfrm_ch_prnfee_query.writeFindIni; var findini:tinifile ; mysec,tmpname:string; canload:boolean ; //是否记忆 i:integer ; begin canload:=bsSkinCheckRadioBox1.Checked ; mysec:=inttostr(321) ; findini:=Tinifile.Create(ExtractFilePath(application.ExeName)+'prnFeequery.ini'); try findini.WriteBool(mysec,mysec,canload); if canload then begin for i:=0 to ControlCount-1 do begin tmpname:=Controls[i].Name ; if Controls[i] is TwwDBComboBox then findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBComboBox).Text) else if Controls[i] is TwwDBLookupCombo then findini.WriteString(mysec,TmpName,(Controls[i] as TwwDBLookupCombo).Text) else if Controls[i] is TEdit then findini.WriteString(mysec,TmpName,(Controls[i] as TEdit).Text) else if Controls[i] is TwwDBDateTimePicker then findini.WriteString(mysec,TmpName,datetostr((Controls[i] as TwwDBDateTimePicker).Date)) else if Controls[i] is TRxDBLookupCombo then findini.writeString(mysec,TmpName,(Controls[i] as TRxDBLookupCombo).Value) ; end ; end ; finally findini.free; end ; end; end.