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.

441 lines
16 KiB
Plaintext

11 months ago
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;
qryprice1: TADOQuery;
qryprice2: TADOQuery;
qryprice3: TADOQuery;
qryprice01: TADOQuery;
qryprice02: TADOQuery;
t_price_shipDSDesigner: TAutoIncField;
t_price_shipDSDesigner2: TStringField;
t_price_shipDSDesigner3: TStringField;
t_price_shipDSDesigner4: TStringField;
t_price_shipDSDesigner5: TStringField;
t_price_shipDSDesigner1: TStringField;
t_price_shipDSDesigner22: TStringField;
t_price_shipDSDesigner32: TStringField;
t_price_shipDSDesigner42: TStringField;
t_price_shipDSDesigner52: TStringField;
t_price_shipDSDesigner6: TStringField;
t_price_shipDSDesigner7: TStringField;
t_price_shipDSDesigner8: TStringField;
t_price_shipDSDesigner12: TStringField;
t_price_shipDSDesigner23: TStringField;
t_price_shipDSDesigner33: TStringField;
t_price_shipDSDesigner43: TStringField;
t_price_shipDSDesigner53: TStringField;
t_price_shipDSDesigner62: TStringField;
t_price_shipDSDesigner72: TStringField;
t_price_shipDSDesigner82: TStringField;
t_price_shipDSDesigner13: TStringField;
t_price_shipDSDesigner24: TStringField;
t_price_shipDSDesigner34: TStringField;
t_price_shipDSDesigner44: TStringField;
t_price_shipDSDesigner54: TStringField;
t_price_shipDSDesigner63: TStringField;
t_price_shipDSDesigner73: TStringField;
t_price_shipDSDesigner83: TStringField;
t_price_shipDSDesigner14: TStringField;
t_price_shipDSDesigner25: TStringField;
t_price_shipDSDesigner35: TStringField;
t_price_shipDSDesigner45: TStringField;
t_price_shipDSDesigner55: TStringField;
t_price_shipDSDesigner64: TStringField;
t_price_shipDSDesigner74: TStringField;
t_price_shipDSDesigner84: TStringField;
t_price_shipDSDesigner15: TStringField;
t_price_shipDSDesigner26: TStringField;
t_price_shipDSDesigner36: TStringField;
t_price_shipDSDesigner46: TStringField;
t_price_shipDSDesigner56: TStringField;
t_price_shipDSDesigner65: TStringField;
t_price_shipDSDesigner75: TStringField;
t_price_shipDSDesigner85: TStringField;
t_price_shipDSDesigner9: TStringField;
t_price_shipDSDesigner10: TStringField;
t_price_shipDSDesigner11: TStringField;
t_price_shipDSDesigner16: TStringField;
t_price_shipDSDesigner17: TStringField;
t_price_shipDSDesigner18: TDateTimeField;
t_price_shipDSDesigner19: TDateTimeField;
t_price_shipDSDesigner20: TStringField;
t_price_shipDSDesigner21: TDateTimeField;
t_price_shipDSDesigner27: TStringField;
t_price_shipDSDesigner28: TStringField;
t_price_shipDSDesigner29: TBooleanField;
t_price_shipDSDesigner30: TStringField;
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);
procedure t_price_shipDSDesigner1GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
procedure t_price_shipDSDesigner12GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
procedure t_price_shipDSDesigner13GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
procedure t_price_shipDSDesigner14GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
procedure t_price_shipDSDesigner15GetText(Sender: TField;
var Text: String; DisplayText: Boolean);
private
procedure setbandview;
{ 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 ';
str:=Str+' and '+open_data('3001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
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
qryprice1.Close ;
qryprice1.Parameters.ParamByName('myname').Value:=employee ;
qryprice1.Open ;
qryprice2.Close ;
qryprice2.Parameters.ParamByName('myname').Value:=employee ;
qryprice2.Open ;
qryprice3.Close ;
qryprice3.Parameters.ParamByName('myname').Value:=employee ;
qryprice3.Open ;
qryprice01.Close ;
qryprice01.Parameters.ParamByName('myname').Value:=employee ;
qryprice01.Open ;
qryprice02.Close ;
qryprice02.Parameters.ParamByName('myname').Value:=employee ;
qryprice02.Open ;
setbandview;
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;
procedure Tfrm_info_price_other.setbandview;
begin
frm_data_share.t_code_price_ctn.requery;
if frm_data_share.t_code_price_ctn.IsEmpty then
exit;
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;
end;
procedure Tfrm_info_price_other.t_price_shipDSDesigner1GetText(
Sender: TField; var Text: String; DisplayText: Boolean);
var Canview :boolean ;
begin
if qryprice01.Locate('ְԱ',t_price_ship.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,[]) then
begin
Canview:=qryprice01.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean ;
if CanView then text:=sender.AsString else text:='--' ;
end ;
end;
procedure Tfrm_info_price_other.t_price_shipDSDesigner12GetText(
Sender: TField; var Text: String; DisplayText: Boolean);
var Canview :boolean ;
begin
if qryprice02.Locate('ְԱ',t_price_ship.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,[]) then
begin
Canview:=qryprice02.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean ;
if CanView then text:=sender.AsString else text:='--' ;
end ;
end;
procedure Tfrm_info_price_other.t_price_shipDSDesigner13GetText(
Sender: TField; var Text: String; DisplayText: Boolean);
var Canview :boolean ;
begin
if qryprice1.Locate('ְԱ',t_price_ship.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,[]) then
begin
Canview:=qryprice1.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean ;
if CanView then text:=sender.AsString else text:='--' ;
end ;
end;
procedure Tfrm_info_price_other.t_price_shipDSDesigner14GetText(
Sender: TField; var Text: String; DisplayText: Boolean);
var Canview :boolean ;
begin
if qryprice2.Locate('ְԱ',t_price_ship.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,[]) then
begin
Canview:=qryprice2.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean ;
if CanView then text:=sender.AsString else text:='--' ;
end ;
end;
procedure Tfrm_info_price_other.t_price_shipDSDesigner15GetText(
Sender: TField; var Text: String; DisplayText: Boolean);
var Canview :boolean ;
begin
if qryprice3.Locate('ְԱ',t_price_ship.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,[]) then
begin
Canview:=qryprice3.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsBoolean ;
if CanView then text:=sender.AsString else text:='--' ;
end ;
end;
end.