From beb243df869d932fa0a0e3f83d127183ac63b278 Mon Sep 17 00:00:00 2001 From: cz_012273 Date: Sat, 8 Jun 2024 09:49:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=95=B0=E6=8D=AE=E5=BA=93=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=88=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChaXun.dfm | 122 +++++++++++++++++++++++++++++++++++++-------------- ChaXun.pas | 12 +++-- DataUnit.pas | 8 ++-- main.pas | 1 - 4 files changed, 101 insertions(+), 42 deletions(-) diff --git a/ChaXun.dfm b/ChaXun.dfm index 3130615..7819c0b 100644 --- a/ChaXun.dfm +++ b/ChaXun.dfm @@ -31,7 +31,7 @@ object Form4: TForm4 ParentFont = False end object Label2: TLabel - Left = 231 + Left = 219 Top = 24 Width = 30 Height = 16 @@ -57,7 +57,7 @@ object Form4: TForm4 ParentFont = False end object Label4: TLabel - Left = 420 + Left = 351 Top = 24 Width = 30 Height = 16 @@ -83,8 +83,8 @@ object Form4: TForm4 ParentFont = False end object Label6: TLabel - Left = 165 - Top = 104 + Left = 469 + Top = 62 Width = 45 Height = 16 Caption = #20445#31649#20154 @@ -96,7 +96,7 @@ object Form4: TForm4 ParentFont = False end object Label7: TLabel - Left = 292 + Left = 151 Top = 104 Width = 60 Height = 16 @@ -119,13 +119,13 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object DBText2: TDBText - Left = 267 + Left = 255 Top = 24 - Width = 147 + Width = 90 Height = 17 DataField = #21697#21517 DataSource = DM1.DataSource4 @@ -133,7 +133,7 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object DBText3: TDBText @@ -147,21 +147,23 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object DBText4: TDBText - Left = 456 + Left = 387 Top = 24 - Width = 133 + Width = 91 Height = 17 + Color = clBtnFace DataField = #35268#26684 DataSource = DM1.DataSource4 Font.Charset = DEFAULT_CHARSET Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] + ParentColor = False ParentFont = False end object DBText5: TDBText @@ -175,12 +177,12 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object DBText6: TDBText - Left = 216 - Top = 104 + Left = 520 + Top = 62 Width = 70 Height = 17 DataField = #20445#31649#20154 @@ -189,11 +191,11 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object DBText7: TDBText - Left = 358 + Left = 217 Top = 104 Width = 74 Height = 17 @@ -203,7 +205,7 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object Label8: TLabel @@ -230,15 +232,15 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object Label9: TLabel - Left = 134 + Left = 122 Top = 62 - Width = 60 + Width = 30 Height = 16 - Caption = #35745#37327#21333#20301 + Caption = #21333#20301 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 @@ -247,7 +249,7 @@ object Form4: TForm4 ParentFont = False end object DBText9: TDBText - Left = 200 + Left = 158 Top = 62 Width = 55 Height = 17 @@ -257,11 +259,11 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object Label10: TLabel - Left = 261 + Left = 219 Top = 62 Width = 30 Height = 16 @@ -274,9 +276,9 @@ object Form4: TForm4 ParentFont = False end object DBText10: TDBText - Left = 297 + Left = 255 Top = 62 - Width = 95 + Width = 82 Height = 17 DataField = #21333#20215 DataSource = DM1.DataSource4 @@ -284,11 +286,11 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object Label11: TLabel - Left = 398 + Left = 343 Top = 62 Width = 30 Height = 16 @@ -301,9 +303,9 @@ object Form4: TForm4 ParentFont = False end object DBText11: TDBText - Left = 434 + Left = 379 Top = 62 - Width = 155 + Width = 76 Height = 17 DataField = #37329#39069 DataSource = DM1.DataSource4 @@ -311,7 +313,7 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' - Font.Style = [] + Font.Style = [fsBold] ParentFont = False end object Label12: TLabel @@ -338,9 +340,63 @@ object Form4: TForm4 Font.Color = clBlue Font.Height = -13 Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + end + object Label13: TLabel + Left = 278 + Top = 104 + Width = 105 + Height = 16 + Caption = #20351#29992#21608#26399#65288#22825#65289 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' Font.Style = [] ParentFont = False end + object DBText13: TDBText + Left = 381 + Top = 104 + Width = 51 + Height = 17 + DataField = #20351#29992#21608#26399#65288#22825#65289 + DataSource = DM1.DataSource4 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + end + object Label14: TLabel + Left = 484 + Top = 24 + Width = 30 + Height = 16 + Caption = #20179#24211 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object DBText14: TDBText + Left = 520 + Top = 24 + Width = 70 + Height = 17 + DataField = #20179#24211 + DataSource = DM1.DataSource4 + Font.Charset = DEFAULT_CHARSET + Font.Color = clBlue + Font.Height = -13 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentFont = False + end object Button1: TButton Left = 130 Top = 343 diff --git a/ChaXun.pas b/ChaXun.pas index a93d954..7fbfa29 100644 --- a/ChaXun.pas +++ b/ChaXun.pas @@ -37,6 +37,10 @@ type DBText11: TDBText; Label12: TLabel; DBText12: TDBText; + Label13: TLabel; + DBText13: TDBText; + Label14: TLabel; + DBText14: TDBText; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormShow(Sender: TObject); @@ -83,12 +87,12 @@ begin with dm1.FDQuery4 do begin close; - Open('SELECT * FROM 库存表'); + Open('SELECT 序号,品名代号,品名,规格,数量,计量单位,单价,金额,入库日期,保管人,仓库,生产日期,保质期(天),使用周期(天) FROM 库存表'); Fields[0].DisplayWidth := 4; // 这个宽度指字符数 - Fields[1].DisplayWidth := 20; - Fields[2].DisplayWidth := 6; + Fields[1].DisplayWidth := 10; + Fields[2].DisplayWidth := 25; Fields[3].DisplayWidth := 20; - Fields[4].DisplayWidth := 10; + Fields[4].DisplayWidth := 6; Fields[5].DisplayWidth := 6; end; end; diff --git a/DataUnit.pas b/DataUnit.pas index 6f87cb0..35d5cc9 100644 --- a/DataUnit.pas +++ b/DataUnit.pas @@ -89,16 +89,16 @@ begin DM1.FDConnection1.Params.Add('Database=' + dbName); DM1.FDConnection1.Connected := True; DM1.FDConnection1.ExecSQL - ('CREATE TABLE 入库表(序号 int PRIMARY KEY, 品名 string(20), 数量 int, 规格 string(10),入库日期 date,保管人 string(8),使用周期(天) int,保质期(天) int)'); + ('CREATE TABLE 入库表(序号 int PRIMARY KEY, 品名 string(20), 数量 decimal(10,4), 规格 string(30),入库日期 date,保管人 string(8),使用周期(天) int,保质期(天) int,计量单位 string(6),单价 decimal(12,4),金额 decimal(12,2),仓库 string(8),品名代号 string(10),生产日期 date)'); { 执行SQL语句 } DM1.FDConnection1.ExecSQL - ('CREATE TABLE 品名表(序号 int PRIMARY KEY, 品名代号 string(10),品名 string(20), 规格 string(10),使用周期(天) int,保质期(天) int)'); + ('CREATE TABLE 品名表(序号 int PRIMARY KEY, 品名代号 string(10),品名 string(20), 规格 string(30),使用周期(天) int,保质期(天) int,计量单位 string(6),单价 decimal(12,4),生产日期 date)'); { 执行SQL语句 } DM1.FDConnection1.ExecSQL - ('CREATE TABLE 出库表(序号 int PRIMARY KEY, 品名 string(20), 数量 int, 规格 string(10),出库日期 date,领取人 string(8),所在部门(班组) string(12),使用周期(天) int,发放理由 string)'); + ('CREATE TABLE 出库表(序号 int PRIMARY KEY, 品名 string(20), 数量 decimal(10,4), 规格 string(30),出库日期 date,领取人 string(8),所在部门(班组) string(12),使用周期(天) int,发放理由 string,计量单位 string(6),单价 decimal(12,4),金额 decimal(12,2),仓库 string(8),品名代号 string(10),生产日期 date)'); { 执行SQL语句 } DM1.FDConnection1.ExecSQL - ('CREATE TABLE 库存表(序号 int PRIMARY KEY, 品名 string(20), 数量 int, 规格 string(10),入库日期 date,保管人 string(8),使用周期(天) int,保质期(天) int)'); + ('CREATE TABLE 库存表(序号 int PRIMARY KEY, 品名 string(20), 数量 decimal(10,4), 规格 string(30),入库日期 date,保管人 string(8),使用周期(天) int,保质期(天) int,计量单位 string(6),单价 decimal(12,4),金额 decimal(12,2),仓库 string(8),品名代号 string(10),生产日期 date)'); { 执行SQL语句 } DM1.FDConnection1.ExecSQL ('CREATE TABLE 人员表(序号 int PRIMARY KEY, 所在部门(班组) string(12),姓名 string(8),职名 string(12))'); diff --git a/main.pas b/main.pas index 4e1be86..5587026 100644 --- a/main.pas +++ b/main.pas @@ -71,7 +71,6 @@ begin end; end; end; - function GetBuildInfoAsString: string; var V1, V2, V3, V4: word; -- GitLab