You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

357 lines
12 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_info_price_other;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, DB, ADODB, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms,
dxTL, dxDBCtrl, dxCntner, wwdbdatetimepicker, StdCtrls, RxLookup,
wwdblook;
type
Tfrm_info_price_other = class(TForm)
bsSkinPanel1: TbsSkinPanel;
t_price_ship: TADOQuery;
t_price_ship1: TDataSource;
Label124: TLabel;
Label20: TLabel;
Label9: TLabel;
Label21: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
wwDBLookupCombo52: TwwDBLookupCombo;
bsSkinButton1: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
RxDBLookupCombo2: TRxDBLookupCombo;
RxDBLookupCombo20: TRxDBLookupCombo;
dxDBGrid2: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGridMaskColumn2: TdxDBGridMaskColumn;
dxDBGridMaskColumn3: TdxDBGridMaskColumn;
dxDBGridMaskColumn4: TdxDBGridMaskColumn;
dxDBGridMaskColumn5: TdxDBGridMaskColumn;
dxDBGridMaskColumn6: TdxDBGridMaskColumn;
dxDBGridMaskColumn7: TdxDBGridMaskColumn;
dxDBGridMaskColumn8: TdxDBGridMaskColumn;
dxDBGridMaskColumn9: TdxDBGridMaskColumn;
dxDBGridMaskColumn10: TdxDBGridMaskColumn;
dxDBGridMaskColumn11: TdxDBGridMaskColumn;
dxDBGrid1Column12: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridMaskColumn;
dxDBGrid1Column17: TdxDBGridMaskColumn;
dxDBGrid1Column18: TdxDBGridMaskColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGridMaskColumn12: TdxDBGridMaskColumn;
dxDBGridMaskColumn13: TdxDBGridMaskColumn;
dxDBGridMaskColumn14: TdxDBGridMaskColumn;
dxDBGrid1Column23: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column25: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridMaskColumn;
dxDBGrid1Column27: TdxDBGridMaskColumn;
dxDBGrid1Column28: TdxDBGridMaskColumn;
dxDBGrid1Column29: TdxDBGridMaskColumn;
dxDBGrid1Column30: TdxDBGridMaskColumn;
dxDBGrid1Column31: TdxDBGridMaskColumn;
dxDBGrid1Column32: TdxDBGridMaskColumn;
dxDBGrid1Column33: TdxDBGridMaskColumn;
dxDBGrid1Column34: TdxDBGridMaskColumn;
dxDBGrid1Column35: TdxDBGridMaskColumn;
dxDBGridMaskColumn15: TdxDBGridMaskColumn;
dxDBGridMaskColumn16: TdxDBGridMaskColumn;
dxDBGridMaskColumn17: TdxDBGridMaskColumn;
dxDBGridMaskColumn18: TdxDBGridMaskColumn;
dxDBGrid1Column40: TdxDBGridMaskColumn;
dxDBGridDateColumn1: TdxDBGridDateColumn;
dxDBGridDateColumn2: TdxDBGridDateColumn;
dxDBGridMaskColumn19: TdxDBGridMaskColumn;
dxDBGridDateColumn3: TdxDBGridDateColumn;
dxDBGrid1Column45: TdxDBGridColumn;
dxDBGrid1Column46: TdxDBGridColumn;
dxDBGrid1Column47: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
dxDBGrid1Column49: TdxDBGridColumn;
dxDBGrid1Column50: TdxDBGridColumn;
dxDBGrid1Column51: TdxDBGridColumn;
dxDBGrid1Column52: TdxDBGridColumn;
dxDBGrid1Column53: TdxDBGridColumn;
dxDBGrid1Column54: TdxDBGridColumn;
bsSkinButton2: TbsSkinButton;
Label11: TLabel;
Edit1: TEdit;
bsSkinButton3: TbsSkinButton;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
procedure wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid2ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure bsSkinButton3Click(Sender: TObject);
procedure dxDBGrid2CustomDrawCell(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);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_info_price_other: Tfrm_info_price_other;
implementation
uses u_main, u_data_share, my_sys_function;
{$R *.dfm}
procedure Tfrm_info_price_other.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_price_other.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_info_price_other.Hide;
frm_info_price_other.ManualFloat(frm_info_price_other.BoundsRect );
frm_main.freeTabs('frm_info_price_other');
action:=cafree;
frm_info_price_other:=nil;
end;
procedure Tfrm_info_price_other.bsSkinButton10Click(Sender: TObject);
begin
wwDBLookupCombo3.Clear;
wwDBLookupCombo52.Clear;
RxDBLookupCombo2.ClearValue;
RxDBLookupCombo20.ClearValue;
end;
procedure Tfrm_info_price_other.bsSkinButton2Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD><EFBFBD><EFBFBD>˼۴<CBBC>ӡ',2,t_price_ship1,frm_data_share.t_code_price_ctn1,nil,nil,t_price_ship1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_info_price_other.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
begin
str:='SELECT * FROM t_price_ship where 1=1 ';
if wwDBLookupCombo3.text<>''then
str:=str+' and <20><><EFBFBD>˸<EFBFBD> like '+''''+'%'+wwDBLookupCombo3.text+'%'+'''';
if wwDBLookupCombo52.text<>''then
str:=str+' and Ŀ<>ĸ<EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+'''';
if RxDBLookupCombo2.DisplayValue<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>˾='+''''+RxDBLookupCombo2.KeyValue+'''';
if RxDBLookupCombo20.DisplayValue<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo20.KeyValue+'''';
t_price_ship.close;
t_price_ship.sql.Clear;
t_price_ship.sql.add(str);
t_price_ship.sql.add(' order by <20>˼۱<CBBC><DBB1><EFBFBD>');
t_price_ship.open;
end;
procedure Tfrm_info_price_other.FormShow(Sender: TObject);
begin
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>1').asstring)<>'' then
begin
dxDBGrid2.Bands[1].Visible:=true;
dxDBGrid2.Bands[1].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>1').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>2').asstring)<>'' then
begin
dxDBGrid2.Bands[2].Visible:=true;
dxDBGrid2.Bands[2].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>2').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>3').asstring)<>'' then
begin
dxDBGrid2.Bands[3].Visible:=true;
dxDBGrid2.Bands[3].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>3').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>4').asstring)<>'' then
begin
dxDBGrid2.Bands[4].Visible:=true;
dxDBGrid2.Bands[4].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>4').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>5').asstring)<>'' then
begin
dxDBGrid2.Bands[5].Visible:=true;
dxDBGrid2.Bands[5].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>5').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>6').asstring)<>'' then
begin
dxDBGrid2.Bands[6].Visible:=true;
dxDBGrid2.Bands[6].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>6').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>7').asstring)<>'' then
begin
dxDBGrid2.Bands[7].Visible:=true;
dxDBGrid2.Bands[7].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>7').asstring);
end;
if trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>8').asstring)<>'' then
begin
dxDBGrid2.Bands[8].Visible:=true;
dxDBGrid2.Bands[8].Caption:=trim(frm_data_share.t_code_price_ctn.fieldbyname('<27>˼<EFBFBD><CBBC><EFBFBD><EFBFBD><EFBFBD>8').asstring);
end;
frm_data_share.t_sys_code_data.Filtered:=false;
frm_data_share.t_sys_code_data.Filter:='<27><><EFBFBD><EFBFBD>='+''''+'3006'+'''';
frm_data_share.t_sys_code_data.Filtered:=true;
if frm_data_share.t_sys_code_data.IsEmpty then
exit;
if frm_data_share.t_sys_code_data.Locate('ְԱ','ȫ<><C8AB><EFBFBD>׼<EFBFBD>',[])then
begin
if frm_data_share.t_sys_code_data.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
begin
dxDBGridMaskColumn6.Visible:=true;
dxDBGridMaskColumn7.Visible:=true;
dxDBGridMaskColumn8.Visible:=true;
dxDBGridMaskColumn9.Visible:=true;
dxDBGridMaskColumn10.Visible:=true;
dxDBGridMaskColumn11.Visible:=true;
dxDBGrid1Column45.Visible:=true;
dxDBGrid1Column50.Visible:=true;
end;
end;
if frm_data_share.t_sys_code_data.Locate('ְԱ','<27>׼۹<D7BC><DBB9><EFBFBD>',[])then
begin
if frm_data_share.t_sys_code_data.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
begin
dxDBGrid1Column12.Visible:=true;
dxDBGrid1Column13.Visible:=true;
dxDBGrid1Column14.Visible:=true;
dxDBGrid1Column15.Visible:=true;
dxDBGrid1Column16.Visible:=true;
dxDBGrid1Column17.Visible:=true;
dxDBGrid1Column46.Visible:=true;
dxDBGrid1Column51.Visible:=true;
end;
end;
if frm_data_share.t_sys_code_data.Locate('ְԱ','һ<><D2BB><EFBFBD>ۼ<EFBFBD>',[])then
begin
if frm_data_share.t_sys_code_data.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
begin
dxDBGrid1Column18.Visible:=true;
dxDBGrid1Column19.Visible:=true;
dxDBGridMaskColumn12.Visible:=true;
dxDBGridMaskColumn13.Visible:=true;
dxDBGridMaskColumn14.Visible:=true;
dxDBGrid1Column23.Visible:=true;
dxDBGrid1Column47.Visible:=true;
dxDBGrid1Column52.Visible:=true;
end;
end;
if frm_data_share.t_sys_code_data.Locate('ְԱ','<27><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>',[])then
begin
if frm_data_share.t_sys_code_data.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
begin
dxDBGrid1Column24.Visible:=true;
dxDBGrid1Column25.Visible:=true;
dxDBGrid1Column26.Visible:=true;
dxDBGrid1Column27.Visible:=true;
dxDBGrid1Column28.Visible:=true;
dxDBGrid1Column29.Visible:=true;
dxDBGrid1Column48.Visible:=true;
dxDBGrid1Column53.Visible:=true;
end;
end;
if frm_data_share.t_sys_code_data.Locate('ְԱ','<27><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>',[])then
begin
if frm_data_share.t_sys_code_data.fieldbyname('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').asboolean then
begin
dxDBGrid1Column30.Visible:=true;
dxDBGrid1Column31.Visible:=true;
dxDBGrid1Column32.Visible:=true;
dxDBGrid1Column33.Visible:=true;
dxDBGrid1Column34.Visible:=true;
dxDBGrid1Column35.Visible:=true;
dxDBGrid1Column49.Visible:=true;
dxDBGrid1Column54.Visible:=true;
end;
end;
end;
procedure Tfrm_info_price_other.wwDBLookupCombo3KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBLookupCombo(Key,wwDBLookupCombo52);
end;
procedure Tfrm_info_price_other.wwDBLookupCombo52KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo2);
end;
procedure Tfrm_info_price_other.RxDBLookupCombo2KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo20);
end;
procedure Tfrm_info_price_other.RxDBLookupCombo20KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_info_price_other.bsSkinButton1Click(Sender);
end;
end;
procedure Tfrm_info_price_other.dxDBGrid2ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_price_ship,'<27>˼۱<CBBC><DBB1><EFBFBD>');
end;
procedure Tfrm_info_price_other.bsSkinButton3Click(Sender: TObject);
var
str,str_tiaojian:String;
begin
IF TRIM(Edit1.TEXT)=''THEN
EXIT;
str_tiaojian:=' like '+''''+'%'+TRIM(Edit1.TEXT)+'%'+'''';
str:='where Ŀ<>ĸ<EFBFBD>'+str_tiaojian;
str:=str+' or Ŀ<>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD>˸<EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>˾'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>'+str_tiaojian;
str:=str+' or <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>'+str_tiaojian;
// str:=str+' or ʡ<><CAA1>'+str_tiaojian;
t_price_ship.close;
t_price_ship.sql.Clear;
t_price_ship.sql.add('select * from t_price_ship ');
t_price_ship.sql.add(str);
t_price_ship.sql.add(' order by <20>˼۱<CBBC><DBB1><EFBFBD>');
t_price_ship.open;
end;
procedure Tfrm_info_price_other.dxDBGrid2CustomDrawCell(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 strtodatetime(ANode.Strings[dxDBGridDateColumn2.Index])<date then
AColor:=clBtnFace;
end;
end.