📄 u_form_datacheck_3.pas
字号:
unit U_Form_DataCheck_3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Mask, EasyGrid, ButtonExCtl,uAdoSet,
uCheckValidate,uString, DB, ADODB;
type
TForm_DataCheck_3 = class(TForm)
GroupBox1: TGroupBox;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
GroupBox3: TGroupBox;
Label23: TLabel;
Label1: TLabel;
Label2: TLabel;
BtnFind: TButtonExCtl;
Grid1: TEasyGrid;
beginDate: TMaskEdit;
_beginDate: TDateTimePicker;
endDate: TMaskEdit;
_endDate: TDateTimePicker;
ComboBox2: TComboBox;
TabSheet2: TTabSheet;
GroupBox2: TGroupBox;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
BtnFind1: TButtonExCtl;
Grid2: TEasyGrid;
begindate1: TMaskEdit;
_beginDate1: TDateTimePicker;
endDate1: TMaskEdit;
_endDate1: TDateTimePicker;
ComboBox1: TComboBox;
TabSheet3: TTabSheet;
GroupBox4: TGroupBox;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
ButtonExCtl1: TButtonExCtl;
Grid3: TEasyGrid;
beginDate2: TMaskEdit;
_beginDate2: TDateTimePicker;
endDate2: TMaskEdit;
_endDate2: TDateTimePicker;
ComboBox3: TComboBox;
TabSheet4: TTabSheet;
GroupBox5: TGroupBox;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
ButtonExCtl2: TButtonExCtl;
Grid4: TEasyGrid;
beginDate3: TMaskEdit;
_beginDate3: TDateTimePicker;
endDate3: TMaskEdit;
_enddate3: TDateTimePicker;
ComboBox4: TComboBox;
ADOQuery1: TADOQuery;
procedure FormCreate(Sender: TObject);
procedure _beginDateCloseUp(Sender: TObject);
procedure _endDateCloseUp(Sender: TObject);
procedure _beginDate1CloseUp(Sender: TObject);
procedure _endDate1CloseUp(Sender: TObject);
procedure BtnFindClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BtnFind1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure ButtonExCtl1Click(Sender: TObject);
procedure ButtonExCtl2Click(Sender: TObject);
private
{ Private declarations }
_AdoNewproduce:TuAdoSet;
_AdoRongPin:TuAdoSet;
_Check:TCheckvalidate;
_Str:TuString;
public
{ Public declarations }
end;
var
Form_DataCheck_3: TForm_DataCheck_3;
//_whichStore:string;
//_whichStore1:string;
//_whichStore2:string;
//_whichStore3:string;
implementation
uses U_Form_MainMenu,uGlobal, U_Form_DataCheck;
{$R *.dfm}
procedure TForm_DataCheck_3.FormCreate(Sender: TObject);
var
param:TStringList;
strsql:string;
i:integer;
begin
_AdoNewproduce:=TuAdoSet.Create('newProduce',1);
_AdoRongPin:=TuAdoSet.Create('RongPin2004',1);
_Check:=TCheckValidate.create;
_Str:=TuString.Create;
param:=TStringList.Create;
param.clear;
beginDate.Text:=_str.formatDate(2);
_beginDate.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
beginDate1.Text:=_str.formatDate(2);
_beginDate1.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
endDate.Text:=_str.formatDate(2);
_endDate.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
endDate1.Text:=_str.formatDate(2);
_endDate1.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
beginDate2.Text:=_str.formatDate(2);
_beginDate2.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
beginDate3.Text:=_str.formatDate(2);
_beginDate3.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
endDate2.Text:=_str.formatDate(2);
_endDate2.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
endDate3.Text:=_str.formatDate(2);
_endDate3.date:=strTodate(formatdateTime('yyyy-mm-dd',now));
combobox1.text:='一线酒库';
combobox2.text:='一线酒库';
combobox3.text:='一线酒库';
combobox4.text:='一线酒库';
{/*
给grid1添加标题
*/}
grid1.SetMerges(rect(1,1,1,2));
grid1.Cells[1,1].ForeText:='序号';
grid1.colwidths[1]:=50;
grid1.SetMerges(rect(2,1,2,2));
grid1.Cells[2,1].ForeText:='产品名称';
grid1.colwidths[2]:=110;
grid1.SetMerges(rect(3,1,3,2));
grid1.Cells[3,1].ForeText:='规格';
grid1.colwidths[3]:=80;
grid1.SetMerges(rect(4,1,4,2));
grid1.Cells[4,1].ForeText:='包装';
grid1.colwidths[4]:=80;
grid1.Cells[5,1].ForeText:=' 保 卫 ';
grid1.Cells[5,2].ForeText:=' 数 量 ';
grid1.ColWidths[5]:=90;
grid1.Cells[6,1].ForeText:=' 酒 库 ';
grid1.Cells[6,2].ForeText:=' 数 量 ';
grid1.ColWidths[6]:=90;
grid1.Cells[7,1].ForeText:=' 差 数 ';
grid1.Cells[7,2].ForeText:=' 数 量 ';
grid1.ColWidths[7]:=90;
for i:=1 to grid1.ColCount-1 do
begin
grid1.Cells[i,1].Color:=rgb(0,143,247);
grid1.Cells[i,1].FontColor:=rgb(255,255,255);
grid1.Cells[i,2].Color:=rgb(0,143,247);
grid1.Cells[i,2].FontColor:=rgb(255,255,255);
end;
{/*
设置包装物的标题
*/}
grid2.SetMerges(rect(1,1,1,2));
grid2.Cells[1,1].ForeText:='序号';
grid2.ColWidths[1]:=60;
grid2.SetMerges(rect(2,1,2,2));
grid2.Cells[2,1].ForeText:='包装物名称';
grid2.ColWidths[2]:=120;
grid2.SetMerges(rect(3,1,6,1));
grid2.Cells[3,1].ForeText:='保卫包装';
grid2.Cells[3,2].ForeText:='酒桶数';
grid2.ColWidths[3]:=60;
grid2.Cells[4,2].ForeText:='成套数';
grid2.ColWidths[4]:=60;
grid2.Cells[5,2].ForeText:='空箱数';
grid2.ColWidths[5]:=60;
grid2.Cells[6,2].ForeText:='空瓶数';
grid2.ColWidths[6]:=60;
grid2.SetMerges(rect(7,1,10,1));
grid2.Cells[7,1].ForeText:='酒库包装';
grid2.Cells[7,2].ForeText:='酒桶数';
grid2.ColWidths[7]:=60;
grid2.Cells[8,2].ForeText:='成套数';
grid2.ColWidths[8]:=60;
grid2.Cells[9,2].ForeText:='空箱数';
grid2.ColWidths[9]:=60;
grid2.Cells[10,2].ForeText:='空瓶数';
grid2.ColWidths[10]:=60;
grid2.SetMerges(rect(11,1,14,1));
grid2.Cells[11,1].ForeText:='包装差值';
grid2.Cells[11,2].ForeText:='酒桶数';
grid2.ColWidths[11]:=60;
grid2.Cells[12,2].ForeText:='成套数';
grid2.ColWidths[12]:=60;
grid2.Cells[13,2].ForeText:='空箱数';
grid2.ColWidths[13]:=60;
grid2.Cells[14,2].ForeText:='空瓶数';
grid2.ColWidths[14]:=60;
{/*
设置表格grid2的标题颜色
*/}
for i:=1 to grid2.ColCount-1 do
begin
grid2.Cells[i,1].Color:=rgb(0,143,247);
grid2.Cells[i,1].FontColor:=rgb(255,255,255);
grid2.Cells[i,2].Color:=rgb(0,143,247);
grid2.Cells[i,2].FontColor:=rgb(255,255,255);
end;
{/*
给grid3添加标题
*/}
grid3.SetMerges(rect(1,1,1,2));
grid3.Cells[1,1].ForeText:='序号';
grid3.colwidths[1]:=50;
grid3.SetMerges(rect(2,1,2,2));
grid3.Cells[2,1].ForeText:='产品名称';
grid3.colwidths[2]:=110;
grid3.SetMerges(rect(3,1,3,2));
grid3.Cells[3,1].ForeText:='规格';
grid3.colwidths[3]:=80;
grid3.SetMerges(rect(4,1,4,2));
grid3.Cells[4,1].ForeText:='包装';
grid3.colwidths[4]:=80;
grid3.Cells[5,1].ForeText:=' 保 卫 ';
grid3.Cells[5,2].ForeText:=' 数 量 ';
grid3.ColWidths[5]:=90;
grid3.Cells[6,1].ForeText:=' 酒 库 ';
grid3.Cells[6,2].ForeText:=' 数 量 ';
grid3.ColWidths[6]:=90;
grid3.Cells[7,1].ForeText:=' 差 数 ';
grid3.Cells[7,2].ForeText:=' 数 量 ';
grid3.ColWidths[7]:=90;
for i:=1 to grid3.ColCount-1 do
begin
grid3.Cells[i,1].Color:=rgb(0,143,247);
grid3.Cells[i,1].FontColor:=rgb(255,255,255);
grid3.Cells[i,2].Color:=rgb(0,143,247);
grid3.Cells[i,2].FontColor:=rgb(255,255,255);
end;
{/*
给grid4添加标题
*/}
grid4.SetMerges(rect(1,1,1,2));
grid4.Cells[1,1].ForeText:='序号';
grid4.colwidths[1]:=50;
grid4.SetMerges(rect(2,1,2,2));
grid4.Cells[2,1].ForeText:='产品名称';
grid4.colwidths[2]:=110;
grid4.SetMerges(rect(3,1,3,2));
grid4.Cells[3,1].ForeText:='规格';
grid4.colwidths[3]:=80;
grid4.SetMerges(rect(4,1,4,2));
grid4.Cells[4,1].ForeText:='包装';
grid4.colwidths[4]:=80;
grid4.Cells[5,1].ForeText:=' 保 卫 ';
grid4.Cells[5,2].ForeText:=' 数 量 ';
grid4.ColWidths[5]:=90;
grid4.Cells[6,1].ForeText:=' 酒 库 ';
grid4.Cells[6,2].ForeText:=' 数 量 ';
grid4.ColWidths[6]:=90;
grid4.Cells[7,1].ForeText:=' 差 数 ';
grid4.Cells[7,2].ForeText:=' 数 量 ';
grid4.ColWidths[7]:=90;
for i:=1 to grid4.ColCount-1 do
begin
grid4.Cells[i,1].Color:=rgb(0,143,247);
grid4.Cells[i,1].FontColor:=rgb(255,255,255);
grid4.Cells[i,2].Color:=rgb(0,143,247);
grid4.Cells[i,2].FontColor:=rgb(255,255,255);
end;
end;
procedure TForm_DataCheck_3._beginDateCloseUp(Sender: TObject);
begin
beginDate.Text:=formatDateTime('yyyy-mm-dd',_begindate.Date);
end;
procedure TForm_DataCheck_3._endDateCloseUp(Sender: TObject);
begin
endDate.Text:=formatDateTime('yyyy-mm-dd',_enddate.Date);
end;
procedure TForm_DataCheck_3._beginDate1CloseUp(Sender: TObject);
begin
beginDate1.Text:=formatDateTime('yyyy-mm-dd',_begindate1.Date);
end;
procedure TForm_DataCheck_3._endDate1CloseUp(Sender: TObject);
begin
endDate1.Text:=formatDateTime('yyyy-mm-dd',_enddate1.Date);
end;
procedure TForm_DataCheck_3.BtnFindClick(Sender: TObject);
var
param:TStringList;
strsql:string;
i,j:integer;
_col5,_col6:string;
_Total:double;
begin
param:=TStringList.Create;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -