📄 p_jiayin.~pas
字号:
unit p_jiayin;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, ExtCtrls, Buttons, ToolWin, ComCtrls, Grids, DBGrids,
QRCtrls, QuickRpt, StdCtrls;
type
TF_jiayin = class(TForm)
ToolBar1: TToolBar;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
Panel2: TPanel;
Panel1: TPanel;
Panel3: TPanel;
Panel8: TPanel;
Query_jy: TADOQuery;
Source_jy: TDataSource;
Panel4: TPanel;
Panel5: TPanel;
Panel7: TPanel;
Panel9: TPanel;
Grid_jy: TDBGrid;
StatusBar1: TStatusBar;
QuickRep1: TQuickRep;
DetailBand1: TQRBand;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRDBText1: TQRDBText;
QRLabel5: TQRLabel;
QRDBText2: TQRDBText;
QRLabel6: TQRLabel;
QRDBText3: TQRDBText;
QRLabel7: TQRLabel;
QRDBText4: TQRDBText;
QRLabel8: TQRLabel;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRShape9: TQRShape;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape19: TQRShape;
QRLabel18: TQRLabel;
QRLabel31: TQRLabel;
QRLabel34: TQRLabel;
QRLabel36: TQRLabel;
QRLabel39: TQRLabel;
QRLabel40: TQRLabel;
QRRichText1: TQRRichText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRDBText11: TQRDBText;
QRDBText12: TQRDBText;
QRDBText19: TQRDBText;
QRDBText20: TQRDBText;
QRDBText30: TQRDBText;
QRDBText31: TQRDBText;
QRDBText32: TQRDBText;
QRDBText33: TQRDBText;
QRDBText34: TQRDBText;
QRDBText35: TQRDBText;
QRDBText37: TQRDBText;
QRDBText38: TQRDBText;
QRDBText36: TQRDBText;
QRDBText39: TQRDBText;
QRDBText40: TQRDBText;
QRDBText41: TQRDBText;
QRDBText44: TQRDBText;
QRDBText45: TQRDBText;
QRDBText46: TQRDBText;
QRDBText48: TQRDBText;
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
QRDBText13: TQRDBText;
QRDBText14: TQRDBText;
QRLabel19: TQRLabel;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
procedure FormShow(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure SpeedButton7Click(Sender: TObject);
procedure SpeedButton8Click(Sender: TObject);
procedure SpeedButton9Click(Sender: TObject);
procedure SpeedButton10Click(Sender: TObject);
procedure SpeedButton11Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
change_jy:boolean;
end;
var
F_jiayin: TF_jiayin;
implementation
uses p_main, p_addjiayin, p_jysp, p_yuedan, p_jyzj, p_jysearch,
P_information;
{$R *.dfm}
procedure TF_jiayin.FormShow(Sender: TObject);
begin
statusbar1.Panels[1].Text:=f_main.StatusBar1.Panels[1].Text;
statusbar1.Panels[3].Text:=f_main.StatusBar1.Panels[3].Text;
statusbar1.Panels[5].Text:=f_main.StatusBar1.Panels[5].Text;
if (f_main.qx=1) or (f_main.qx=2) or (f_main.qx=3) then
speedbutton5.Enabled:=true;
if (f_main.qx=7) or (f_main.qx=8) then
begin
speedbutton4.Enabled:=true;
speedbutton6.Enabled:=true;
speedbutton9.Enabled:=true;
end;
if (f_main.qx=90) or (f_main.qx=100) then
speedbutton11.Enabled:=true;
with query_jy do
begin
close;
sql.Clear;
//sql.Add('select * from 加印图书质检 where datediff("d",质检开始时间,now)<=7 order by 质检开始时间 desc');
sql.Add('select * from 加印图书质检 order by 质检开始时间 desc');
open;
end;
end;
procedure TF_jiayin.SpeedButton1Click(Sender: TObject);
begin
if (f_main.qx=7) or (f_main.qx=8) then
begin
application.CreateForm(Tf_addjiayin,f_addjiayin);
f_addjiayin.ShowModal;
f_addjiayin.Free;
end;
end;
procedure TF_jiayin.SpeedButton2Click(Sender: TObject);
begin
change_jy:=true;
application.CreateForm(Tf_addjiayin,f_addjiayin);
f_addjiayin.ShowModal;
f_addjiayin.Free;
end;
procedure TF_jiayin.SpeedButton3Click(Sender: TObject);
begin
try
if Application.MessageBox('是否删除当前记录?','提示',mb_yesno)=id_yes then
query_jy.Delete;
except
Application.MessageBox('不能删除','提示',mb_yesno);
end;
end;
procedure TF_jiayin.SpeedButton4Click(Sender: TObject);
begin
//
end;
procedure TF_jiayin.SpeedButton5Click(Sender: TObject);
begin
if (f_main.qx=1) and (query_jy.fieldbyname('质检状态1').AsString='未检') then
begin
application.CreateForm(TF_jyzj,F_jyzj);
f_jyzj.ShowModal;
f_jyzj.Free;
end;
if (f_main.qx=1) and (query_jy.fieldbyname('质检状态1').AsString='已检') then
begin
Application.MessageBox('此书已经质检!','提示',mb_ok);
Exit;
end;
if (f_main.qx=2) and (query_jy.FieldByName('质检状态2').AsString='未检') then
begin
application.CreateForm(TF_jyzj,F_jyzj);
f_jyzj.ShowModal;
f_jyzj.Free;
end;
if (f_main.qx=2) and (query_jy.FieldByName('质检状态2').AsString='已检') then
begin
Application.MessageBox('你已经质检!','提示',mb_ok);
Exit;
end;
if (f_main.qx=6) and (query_jy.FieldByName('质检状态6').AsString='未检') then
begin
application.CreateForm(TF_jyzj,F_jyzj);
f_jyzj.ShowModal;
f_jyzj.Free;
end;
if (f_main.qx=6) and (query_jy.FieldByName('质检状态6').AsString='已检') then
begin
Application.MessageBox('你已经质检!','提示',mb_ok);
Exit;
end;
if (f_main.qx=7) and (query_jy.FieldByName('质检状态7').AsString='未检') then
begin
application.CreateForm(TF_jyzj,F_jyzj);
f_jyzj.ShowModal;
f_jyzj.Free;
end;
if (f_main.qx=7) and (query_jy.FieldByName('质检状态7').AsString='已检') then
begin
Application.MessageBox('你已经质检!','提示',mb_ok);
Exit;
end;
end;
procedure TF_jiayin.SpeedButton6Click(Sender: TObject);
begin
if (f_main.qx=8) and (query_jy.fieldbyname('质检状态8').AsString='未批') then
begin
if (query_jy.fieldbyname('质检状态1').AsString='已检') and (query_jy.fieldbyname('质检状态2').AsString='已检') and (query_jy.fieldbyname('质检状态6').AsString='已检') and (query_jy.fieldbyname('质检状态7').AsString='已检') then
begin
application.CreateForm(TF_jysp,F_jysp);
f_jysp.ShowModal;
f_jysp.Free;
end;
if (query_jy.fieldbyname('质检状态1').AsString='未检') or (query_jy.fieldbyname('质检状态2').AsString='未检') or (query_jy.fieldbyname('质检状态6').AsString='未检') or (query_jy.fieldbyname('质检状态7').AsString='未检') then
begin
Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
Exit;
end;
end;
if (f_main.qx=8) and (query_jy.fieldbyname('质检状态8').AsString='已批') then
begin
Application.MessageBox('此书已经审批!','提示',mb_ok);
Exit;
end;
if (f_main.qx=9) and (query_jy.fieldbyname('质检状态9').AsString='未批') then
begin
if query_jy.fieldbyname('质检状态8').AsString='已批' then
begin
application.CreateForm(TF_jysp,F_jysp);
f_jysp.ShowModal;
f_jysp.Free;
end;
if query_jy.fieldbyname('质检状态8').AsString='未批' then
begin
Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
Exit;
end;
end;
if (f_main.qx=9) and (query_jy.fieldbyname('质检状态9').AsString='已批') then
begin
Application.MessageBox('此书已经审批!','提示',mb_ok);
Exit;
end;
end;
procedure TF_jiayin.SpeedButton7Click(Sender: TObject);
begin
quickrep1.Preview;
end;
procedure TF_jiayin.SpeedButton8Click(Sender: TObject);
begin
application.CreateForm(TF_jysearch,F_jysearch);
f_jysearch.ShowModal;
f_jysearch.Free;
end;
procedure TF_jiayin.SpeedButton9Click(Sender: TObject);
begin
if (query_jy.fieldbyname('发货').AsString='否') and (query_jy.fieldbyname('质检状态9').AsString='已批') then
begin
query_jy.fieldbyname('发货').AsString:='可';
Application.MessageBox('确认可发货成功!','提示',mb_ok);
end;
if (query_jy.fieldbyname('发货').AsString='否') and (query_jy.fieldbyname('质检状态9').AsString='未批') then
Application.MessageBox('主管领导未审批!','提示',mb_ok);
if query_jy.fieldbyname('发货').AsString='可' then
Application.MessageBox('此书已标记为可发货状态!','提示',mb_ok);
end;
procedure TF_jiayin.SpeedButton10Click(Sender: TObject);
begin
with query_jy do
begin
close;
sql.Clear;
sql.add('select * from 加印图书质检 order by 质检开始时间 desc');
//sql.Add('select * from 成书质检表 where datediff("d",质检开始时间,now)<=7 order by 质检开始时间 desc');
open;
end;
f_main.timer1.Enabled:=true;
end;
procedure TF_jiayin.SpeedButton11Click(Sender: TObject);
begin
if (f_main.qx=90) and (query_jy.fieldbyname('质检状态9').AsString='未批') then
begin
if query_jy.fieldbyname('质检状态8').AsString='已批' then
begin
application.CreateForm(TF_jysp,F_jysp);
f_jysp.ShowModal;
f_jysp.Free;
end;
if query_jy.fieldbyname('质检状态8').AsString='未批' then
begin
Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
Exit;
end;
end;
if (f_main.qx=90) and (query_jy.fieldbyname('质检状态9').AsString='已批') then
begin
Application.MessageBox('此书已经审批!','提示',mb_ok);
Exit;
end;
if (f_main.qx=100) and (query_jy.fieldbyname('质检状态10').AsString='未批') then
begin
if query_jy.fieldbyname('质检状态9').AsString='已批' then
begin
application.CreateForm(TF_jysp,F_jysp);
f_jysp.ShowModal;
f_jysp.Free;
end;
if query_jy.fieldbyname('质检状态9').AsString='未批' then
begin
Application.MessageBox('上一质检环节没结束!','提示',mb_ok);
Exit;
end;
end;
if (f_main.qx=100) and (query_jy.fieldbyname('质检状态10').AsString='已批') then
begin
Application.MessageBox('此书已经审批!','提示',mb_ok);
Exit;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -