待检布加日志

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-09-25 13:21:52 +08:00
parent 05c7c64d72
commit 57b9ca0396
4 changed files with 400 additions and 310 deletions

View File

@ -245,6 +245,7 @@ begin
if Trim(FFSPID) = '' then if Trim(FFSPID) = '' then
begin begin
Append; Append;
FieldByName('BZNoteList').Value := Trim(CDS_Sub.fieldbyname('FactoryName').AsString) + ';' + Trim(CDS_Sub.fieldbyname('OrderNo').AsString) + ';' + Trim(CDS_Sub.fieldbyname('PiQty').AsString);
end end
else else
begin begin

View File

@ -437,13 +437,13 @@ object frmDJBCKOutList: TfrmDJBCKOutList
Left = 0 Left = 0
Top = 105 Top = 105
Width = 1193 Width = 1193
Height = 440 Height = 439
Align = alClient Align = alClient
PopupMenu = PopupMenu1 PopupMenu = PopupMenu1
TabOrder = 2 TabOrder = 2
object Tv1: TcxGridDBTableView object Tv1: TcxGridDBTableView
OnMouseDown = Tv1MouseDown OnMouseDown = Tv1MouseDown
NavigatorButtons.ConfirmDelete = False Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DataSource1 DataController.DataSource = DataSource1
DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = < DataController.Summary.FooterSummaryItems = <

View File

@ -4,14 +4,27 @@ interface
uses uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView, cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView, cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu, ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, cxCheckBox, RM_Common, cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, Menus, RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit,
cxCalendar, cxButtonEdit, cxTextEdit, RM_BarCode; RM_BarCode, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxNavigator;
type type
TfrmDJBCKOutList = class(TForm) TfrmDJBCKOutList = class(TForm)
@ -133,8 +146,7 @@ type
procedure TBAddClick(Sender: TObject); procedure TBAddClick(Sender: TObject);
procedure TBEditClick(Sender: TObject); procedure TBEditClick(Sender: TObject);
procedure ToolButton3Click(Sender: TObject); procedure ToolButton3Click(Sender: TObject);
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Shift: TShiftState; X, Y: Integer);
procedure PRTColorChange(Sender: TObject); procedure PRTColorChange(Sender: TObject);
procedure SOrddefstr1Change(Sender: TObject); procedure SOrddefstr1Change(Sender: TObject);
procedure PRTHXChange(Sender: TObject); procedure PRTHXChange(Sender: TObject);
@ -153,6 +165,7 @@ var
frmDJBCKOutList: TfrmDJBCKOutList; frmDJBCKOutList: TfrmDJBCKOutList;
implementation implementation
uses uses
U_DataLink, U_RTFun, U_DJBCKOutPut; U_DataLink, U_RTFun, U_DJBCKOutPut;
@ -167,7 +180,7 @@ begin
sql.Clear; sql.Clear;
sql.Add('select * from KH_Zdy where Type=''LBGANGFLAG'' '); sql.Add('select * from KH_Zdy where Type=''LBGANGFLAG'' ');
open; open;
If not isEmpty then if not isEmpty then
begin begin
while not eof do while not eof do
begin begin
@ -185,8 +198,7 @@ begin
frmDJBCKOutList := nil; frmDJBCKOutList := nil;
end; end;
procedure TfrmDJBCKOutList.FormClose(Sender: TObject; procedure TfrmDJBCKOutList.FormClose(Sender: TObject; var Action: TCloseAction);
var Action: TCloseAction);
begin begin
Action := caFree; Action := caFree;
end; end;
@ -255,7 +267,8 @@ begin
TBAdd.Visible := False; TBAdd.Visible := False;
TBDel.Visible := False; TBDel.Visible := False;
TBEdit.Visible := False; TBEdit.Visible := False;
end else end
else
begin begin
TBAdd.Visible := True; TBAdd.Visible := True;
TBDel.Visible := True; TBDel.Visible := True;
@ -268,7 +281,8 @@ end;
procedure TfrmDJBCKOutList.TBExportClick(Sender: TObject); procedure TfrmDJBCKOutList.TBExportClick(Sender: TObject);
begin begin
if ADOQueryMain.IsEmpty then exit; if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel('外加工出库列表', cxGrid2); TcxGridToExcel('外加工出库列表', cxGrid2);
end; end;
@ -291,13 +305,13 @@ procedure TfrmDJBCKOutList.SPIDChange(Sender: TObject);
begin begin
if Length(Trim(SPID.Text)) < 4 then if Length(Trim(SPID.Text)) < 4 then
begin begin
if Trim(SPID.Text)<>'' then Exit; if Trim(SPID.Text) <> '' then
Exit;
end; end;
TBFind.Click; TBFind.Click;
end; end;
procedure TfrmDJBCKOutList.SPIDKeyPress(Sender: TObject; procedure TfrmDJBCKOutList.SPIDKeyPress(Sender: TObject; var Key: Char);
var Key: Char);
begin begin
if Key = #13 then if Key = #13 then
begin begin
@ -326,7 +340,8 @@ end;
procedure TfrmDJBCKOutList.N1Click(Sender: TObject); procedure TfrmDJBCKOutList.N1Click(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
CDS_Main.DisableControls; CDS_Main.DisableControls;
with CDS_Main do with CDS_Main do
begin begin
@ -352,7 +367,8 @@ end;
procedure TfrmDJBCKOutList.TBDelClick(Sender: TObject); procedure TfrmDJBCKOutList.TBDelClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
begin begin
with ADOQueryTemp do with ADOQueryTemp do
@ -386,7 +402,8 @@ begin
end; end;
end; end;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit; if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
try try
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do with ADOQueryCmd do
@ -401,6 +418,14 @@ begin
begin begin
sql.Add(' delete CK_SXPB_CR where isnull(PYID,'''')=''' + Trim(CDS_Main.fieldbyname('PYID').AsString) + ''''); sql.Add(' delete CK_SXPB_CR where isnull(PYID,'''')=''' + Trim(CDS_Main.fieldbyname('PYID').AsString) + '''');
end; end;
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
sql.Add(' ' + quotedstr(trim(DName)));
sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('待检布出库删除')));
sql.Add(',' + quotedstr(trim('出库单号:' + trim(CDS_Main.FieldByName('SPID').AsString) + ',加工厂' + trim(CDS_Main.FieldByName('factoryName').AsString) + ',订单号' + trim(CDS_Main.FieldByName('QCorderNo').AsString) + ',匹数' + trim(CDS_Main.FieldByName('piqty').AsString))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
ExecSQL; ExecSQL;
end; end;
ADOQueryCmd.Connection.CommitTrans; ADOQueryCmd.Connection.CommitTrans;
@ -431,7 +456,8 @@ end;
procedure TfrmDJBCKOutList.TBEditClick(Sender: TObject); procedure TfrmDJBCKOutList.TBEditClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
@ -472,16 +498,16 @@ var
Moudle: THandle; Moudle: THandle;
Makebar: TMakebar; Makebar: TMakebar;
Mixtext: TMixtext; Mixtext: TMixtext;
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
//if Trim(CDS_Main.fieldbyname('CRType').AsString)<>'检验出库' then Exit; //if Trim(CDS_Main.fieldbyname('CRType').AsString)<>'检验出库' then Exit;
if CDS_Main.Locate('SSel', True, []) = False then if CDS_Main.Locate('SSel', True, []) = False then
begin begin
Application.MessageBox('没有选择数据!', '提示', 0); Application.MessageBox('没有选择数据!', '提示', 0);
Exit; Exit;
end; end;
IF Trim(LBGANG.Text)='' then if Trim(LBGANG.Text) = '' then
begin begin
Application.MessageBox('选择要打印的缸标签!', '提示', 0); Application.MessageBox('选择要打印的缸标签!', '提示', 0);
Exit; Exit;
@ -516,7 +542,8 @@ begin
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp'; fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil); CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then DeleteFile(fImagePath); if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3); Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except except
CDS_Main.EnableControls; CDS_Main.EnableControls;
@ -530,7 +557,8 @@ begin
RM1.LoadFromFile(fPrintFile); RM1.LoadFromFile(fPrintFile);
//RM1.ShowReport; //RM1.ShowReport;
RM1.PrintReport; RM1.PrintReport;
end else end
else
begin begin
CDS_Main.EnableControls; CDS_Main.EnableControls;
Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0); Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0);
@ -545,8 +573,7 @@ begin
end; end;
procedure TfrmDJBCKOutList.Tv1MouseDown(Sender: TObject; procedure TfrmDJBCKOutList.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin begin
{ if CDS_Main.IsEmpty then Exit; { if CDS_Main.IsEmpty then Exit;
if Trim(CDS_Main.fieldbyname('CRType').AsString)<>'检验出库' then if Trim(CDS_Main.fieldbyname('CRType').AsString)<>'检验出库' then
@ -573,11 +600,11 @@ begin
TBFind.Click; TBFind.Click;
end; end;
procedure TfrmDJBCKOutList.QCorderNoKeyPress(Sender: TObject; procedure TfrmDJBCKOutList.QCorderNoKeyPress(Sender: TObject; var Key: Char);
var Key: Char);
begin begin
IF trim(QCorderNo.Text)='' then exit; if trim(QCorderNo.Text) = '' then
IF Key=#13 then exit;
if Key = #13 then
begin begin
try try
ADOQueryMain.DisableControls; ADOQueryMain.DisableControls;
@ -603,11 +630,11 @@ begin
end; end;
end; end;
procedure TfrmDJBCKOutList.CKorderNoKeyPress(Sender: TObject; procedure TfrmDJBCKOutList.CKorderNoKeyPress(Sender: TObject; var Key: Char);
var Key: Char);
begin begin
IF trim(CKorderNo.Text)='' then exit; if trim(CKorderNo.Text) = '' then
IF Key=#13 then exit;
if Key = #13 then
begin begin
try try
ADOQueryMain.DisableControls; ADOQueryMain.DisableControls;
@ -634,3 +661,4 @@ begin
end; end;
end. end.

View File

@ -4,29 +4,27 @@ interface
uses uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView, cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView, cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu, ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, cxCheckBox, RM_Common, cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, Menus, RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit, cxPC,
cxCalendar, cxButtonEdit, cxTextEdit, cxPC, BtnEdit, cxLookAndFeels, BtnEdit, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,
cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinscxPCPainter, cxNavigator, dxBarBuiltInMenu;
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter,
cxNavigator, dxBarBuiltInMenu;
type type
TfrmDJBRKList = class(TForm) TfrmDJBRKList = class(TForm)
@ -174,7 +172,7 @@ type
private private
canshu1, canshu2: string; canshu1, canshu2: string;
procedure InitGrid(); procedure InitGrid();
Procedure setstatus(); procedure setstatus();
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
@ -184,18 +182,19 @@ var
frmDJBRKList: TfrmDJBRKList; frmDJBRKList: TfrmDJBRKList;
implementation implementation
uses uses
U_DataLink, U_RTFun, U_DJBCKInPut, U_ZdyAttachGYS; U_DataLink, U_RTFun, U_DJBCKInPut, U_ZdyAttachGYS;
{$R *.dfm} {$R *.dfm}
Procedure TfrmDJBRKList.setstatus(); procedure TfrmDJBRKList.setstatus();
begin begin
TBedit.Visible := false; TBedit.Visible := false;
TBdel.Visible := false; TBdel.Visible := false;
TBchk.Visible := false; TBchk.Visible := false;
TBNochk.Visible := false; TBNochk.Visible := false;
TBTSedit.Visible := false; TBTSedit.Visible := false;
IF canshu1='高权限'then if canshu1 = '高权限' then
begin begin
case cxTabControl1.TabIndex of case cxTabControl1.TabIndex of
@ -237,8 +236,7 @@ begin
frmDJBRKList := nil; frmDJBRKList := nil;
end; end;
procedure TfrmDJBRKList.FormClose(Sender: TObject; procedure TfrmDJBRKList.FormClose(Sender: TObject; var Action: TCloseAction);
var Action: TCloseAction);
begin begin
Action := caFree; Action := caFree;
end; end;
@ -272,7 +270,7 @@ begin
sql.Add(' and A.CRTime<=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''''); sql.Add(' and A.CRTime<=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
sql.Add(' and isnull(CKName,'''')=''待检布'''); sql.Add(' and isnull(CKName,'''')=''待检布''');
SQL.Add(' and CRFlag=''入库'' '); SQL.Add(' and CRFlag=''入库'' ');
IF cxTabControl1.TabIndex<2 then if cxTabControl1.TabIndex < 2 then
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' '); SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
Open; Open;
//ShowMessage(SQL.Text); //ShowMessage(SQL.Text);
@ -311,7 +309,8 @@ begin
TBAdd.Visible := False; TBAdd.Visible := False;
TBDel.Visible := False; TBDel.Visible := False;
TBEdit.Visible := False; TBEdit.Visible := False;
end else end
else
begin begin
TBAdd.Visible := True; TBAdd.Visible := True;
TBDel.Visible := True; TBDel.Visible := True;
@ -324,7 +323,8 @@ end;
procedure TfrmDJBRKList.TBExportClick(Sender: TObject); procedure TfrmDJBRKList.TBExportClick(Sender: TObject);
begin begin
if ADOQueryMain.IsEmpty then exit; if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel('待检布入库列表', cxGrid2); TcxGridToExcel('待检布入库列表', cxGrid2);
end; end;
@ -350,7 +350,8 @@ end;
procedure TfrmDJBRKList.TBDelClick(Sender: TObject); procedure TfrmDJBRKList.TBDelClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
begin begin
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
@ -371,7 +372,8 @@ begin
Application.MessageBox('已有出库记录,不能删除!', '提示', 0); Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
Exit; Exit;
end; end;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit; if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
try try
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
@ -383,6 +385,14 @@ begin
{sql.Add('Update CK_SXPB_KC Set KCKGQty=(select sum(isnull(KGQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)'); {sql.Add('Update CK_SXPB_KC Set KCKGQty=(select sum(isnull(KGQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)');
sql.Add(',KCPiQty=(select sum(isnull(PiQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)'); sql.Add(',KCPiQty=(select sum(isnull(PiQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)');
sql.Add(' where CRID='+Trim(CDS_Main.fieldbyname('CRID').AsString));} sql.Add(' where CRID='+Trim(CDS_Main.fieldbyname('CRID').AsString));}
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
sql.Add(' ' + quotedstr(trim(DName)));
sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('待检布入库删除')));
sql.Add(',' + quotedstr(trim('入库单号:' + trim(CDS_Main.FieldByName('SPID').AsString) + ',加工厂' + trim(CDS_Main.FieldByName('factoryName').AsString) + ',订单号' + trim(CDS_Main.FieldByName('QCorderNo').AsString) + ',匹数' + trim(CDS_Main.FieldByName('piqty').AsString))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
ExecSQL; ExecSQL;
end; end;
{ with ADOQueryTemp do { with ADOQueryTemp do
@ -409,7 +419,8 @@ begin
Application.MessageBox('删除异常!', '提示', 0); Application.MessageBox('删除异常!', '提示', 0);
end; end;
end else end
else
begin begin
CDS_Main.Delete; CDS_Main.Delete;
end; end;
@ -434,12 +445,26 @@ end;
procedure TfrmDJBRKList.TBEditClick(Sender: TObject); procedure TfrmDJBRKList.TBEditClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then Exit; if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
begin begin
Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0); Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
Exit; Exit;
end; end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from CK_SXPB_CR where FZSPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
sql.Add(' and CRQtyFlag=-1');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
Application.MessageBox('已有出库记录,不能修改!', '提示', 0);
Exit;
end;
try try
frmDJBCKInPut := TfrmDJBCKInPut.Create(Application); frmDJBCKInPut := TfrmDJBCKInPut.Create(Application);
with frmDJBCKInPut do with frmDJBCKInPut do
@ -490,7 +515,8 @@ procedure TfrmDJBRKList.SPIDChange(Sender: TObject);
begin begin
if Length(Trim(SPID.Text)) < 4 then if Length(Trim(SPID.Text)) < 4 then
begin begin
if Trim(SPID.Text)<>'' then Exit; if Trim(SPID.Text) <> '' then
Exit;
end; end;
TBFind.Click; TBFind.Click;
end; end;
@ -507,8 +533,9 @@ end;
procedure TfrmDJBRKList.OrderNoKeyPress(Sender: TObject; var Key: Char); procedure TfrmDJBRKList.OrderNoKeyPress(Sender: TObject; var Key: Char);
begin begin
IF trim(OrderNo.Text)='' then exit; if trim(OrderNo.Text) = '' then
IF Key=#13 then exit;
if Key = #13 then
begin begin
try try
ADOQueryMain.DisableControls; ADOQueryMain.DisableControls;
@ -527,7 +554,7 @@ begin
sql.add(' where exists(select MainID from JYOrder_Main X where X.mainID=A.ORDMainIdRK and X.orderNo like ' + quotedstr('%' + trim(OrderNo.text) + '%') + ')'); sql.add(' where exists(select MainID from JYOrder_Main X where X.mainID=A.ORDMainIdRK and X.orderNo like ' + quotedstr('%' + trim(OrderNo.text) + '%') + ')');
sql.Add(' and isnull(CKName,'''')=''待检布'''); sql.Add(' and isnull(CKName,'''')=''待检布''');
SQL.Add(' and CRFlag=''入库'' '); SQL.Add(' and CRFlag=''入库'' ');
IF cxTabControl1.TabIndex<2 then if cxTabControl1.TabIndex < 2 then
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' '); SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
Open; Open;
//ShowMessage(SQL.Text); //ShowMessage(SQL.Text);
@ -542,7 +569,8 @@ end;
procedure TfrmDJBRKList.TBCHKClick(Sender: TObject); procedure TfrmDJBRKList.TBCHKClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then exit; if CDS_Main.IsEmpty then
exit;
if CDS_Main.Locate('SSel', True, []) = False then if CDS_Main.Locate('SSel', True, []) = False then
begin begin
Application.MessageBox('没有选择数据!', '提示', 0); Application.MessageBox('没有选择数据!', '提示', 0);
@ -554,7 +582,7 @@ begin
DisableControls; DisableControls;
while not eof do while not eof do
begin begin
IF fieldbyname('ssel').AsBoolean then if fieldbyname('ssel').AsBoolean then
begin begin
with ADOQueryCmd do with ADOQueryCmd do
begin begin
@ -578,7 +606,8 @@ end;
procedure TfrmDJBRKList.TBNOchkClick(Sender: TObject); procedure TfrmDJBRKList.TBNOchkClick(Sender: TObject);
begin begin
if CDS_Main.IsEmpty then exit; if CDS_Main.IsEmpty then
exit;
if CDS_Main.Locate('SSel', True, []) = False then if CDS_Main.Locate('SSel', True, []) = False then
begin begin
Application.MessageBox('没有选择数据!', '提示', 0); Application.MessageBox('没有选择数据!', '提示', 0);
@ -590,7 +619,7 @@ begin
DisableControls; DisableControls;
while not eof do while not eof do
begin begin
IF fieldbyname('ssel').AsBoolean then if fieldbyname('ssel').AsBoolean then
begin begin
with ADOQueryCmd do with ADOQueryCmd do
begin begin
@ -621,18 +650,28 @@ end;
procedure TfrmDJBRKList.Button5Click(Sender: TObject); procedure TfrmDJBRKList.Button5Click(Sender: TObject);
begin begin
IF CDS_Main.IsEmpty then exit; if CDS_Main.IsEmpty then
IF trim(factoryName1.Text)='' then exit;
if trim(factoryName1.Text) = '' then
begin begin
application.MessageBox('加工厂不能为空!', '提示信息', 0); application.MessageBox('加工厂不能为空!', '提示信息', 0);
exit; exit;
end; end;
if Application.MessageBox('确定要修改加工厂吗?','提示',32+4)<>IDYES then Exit; if Application.MessageBox('确定要修改加工厂吗?', '提示', 32 + 4) <> IDYES then
Exit;
try try
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
sql.Add(' ' + quotedstr(trim(DName)));
sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('待检布入库修改')));
sql.Add(',' + quotedstr(trim('入库单号:' + trim(CDS_Main.FieldByName('SPID').AsString) + ',原加工厂' + Trim(CDS_Main.fieldbyname('factoryName').AsString) + ',修改后' + trim(factoryName1.Text))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
sql.Add('update CK_SXPB_CR SET factoryName=''' + trim(factoryName1.Text) + ''',edittime=getdate() where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + ''''); sql.Add('update CK_SXPB_CR SET factoryName=''' + trim(factoryName1.Text) + ''',edittime=getdate() where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
// sql.Add('update WFB_MJJY SET factoryName='''+trim(factoryName1.Text)+''' where APID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+''''); // sql.Add('update WFB_MJJY SET factoryName='''+trim(factoryName1.Text)+''' where APID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
ExecSQL; ExecSQL;
@ -647,18 +686,28 @@ end;
procedure TfrmDJBRKList.Button1Click(Sender: TObject); procedure TfrmDJBRKList.Button1Click(Sender: TObject);
begin begin
IF CDS_Main.IsEmpty then exit; if CDS_Main.IsEmpty then
IF trim(Com_CRype.Text)='' then exit;
if trim(Com_CRype.Text) = '' then
begin begin
application.MessageBox('入库类型不能为空!', '提示信息', 0); application.MessageBox('入库类型不能为空!', '提示信息', 0);
exit; exit;
end; end;
if Application.MessageBox('确定要修改入库类型吗?','提示',32+4)<>IDYES then Exit; if Application.MessageBox('确定要修改入库类型吗?', '提示', 32 + 4) <> IDYES then
Exit;
try try
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
sql.Add(' ' + quotedstr(trim(DName)));
sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('待检布入库修改')));
sql.Add(',' + quotedstr(trim('入库单号:' + trim(CDS_Main.FieldByName('SPID').AsString) + ',原入库类型' + Trim(CDS_Main.fieldbyname('CRType').AsString) + ',修改后' + trim(Com_CRype.Text))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
sql.Add('update CK_SXPB_CR SET CRType=''' + trim(Com_CRype.Text) + ''' where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + ''''); sql.Add('update CK_SXPB_CR SET CRType=''' + trim(Com_CRype.Text) + ''' where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
ExecSQL; ExecSQL;
end; end;
@ -704,13 +753,15 @@ end;
procedure TfrmDJBRKList.Button2Click(Sender: TObject); procedure TfrmDJBRKList.Button2Click(Sender: TObject);
begin begin
IF CDS_Main.IsEmpty then exit; if CDS_Main.IsEmpty then
IF trim(edit_defstr2.Text)='' then exit;
if trim(edit_defstr2.Text) = '' then
begin begin
application.MessageBox('统计单号不能为空!', '提示信息', 0); application.MessageBox('统计单号不能为空!', '提示信息', 0);
exit; exit;
end; end;
if Application.MessageBox('确定要修改统计单号吗?','提示',32+4)<>IDYES then Exit; if Application.MessageBox('确定要修改统计单号吗?', '提示', 32 + 4) <> IDYES then
Exit;
try try
with CDS_Main do with CDS_Main do
begin begin
@ -718,12 +769,20 @@ begin
first; first;
while not eof do while not eof do
begin begin
IF fieldbyName('Ssel').AsBoolean then if fieldbyName('Ssel').AsBoolean then
begin begin
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
sql.Add(' ' + quotedstr(trim(DName)));
sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('待检布入库修改')));
sql.Add(',' + quotedstr(trim('入库单号:' + trim(CDS_Main.FieldByName('SPID').AsString) + ',原统计单号' + Trim(CDS_Main.fieldbyname('defstr2').AsString) + ',修改后' + trim(edit_defstr2.Text))));
sql.Add(',' + quotedstr(trim('成功')));
sql.Add(')');
sql.Add('update CK_SXPB_CR SET defstr2=''' + trim(edit_defstr2.Text) + ''' where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + ''''); sql.Add('update CK_SXPB_CR SET defstr2=''' + trim(edit_defstr2.Text) + ''' where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
ExecSQL; ExecSQL;
end; end;
@ -743,8 +802,9 @@ end;
procedure TfrmDJBRKList.defstr2KeyPress(Sender: TObject; var Key: Char); procedure TfrmDJBRKList.defstr2KeyPress(Sender: TObject; var Key: Char);
begin begin
IF trim(defstr2.Text)='' then exit; if trim(defstr2.Text) = '' then
IF Key=#13 then exit;
if Key = #13 then
begin begin
try try
ADOQueryMain.DisableControls; ADOQueryMain.DisableControls;
@ -763,7 +823,7 @@ begin
sql.add(' where A.defstr2 like ' + quotedstr('%' + trim(OrderNo.text) + '%')); sql.add(' where A.defstr2 like ' + quotedstr('%' + trim(OrderNo.text) + '%'));
sql.Add(' and isnull(CKName,'''')=''待检布'''); sql.Add(' and isnull(CKName,'''')=''待检布''');
SQL.Add(' and CRFlag=''入库'' '); SQL.Add(' and CRFlag=''入库'' ');
IF cxTabControl1.TabIndex<2 then if cxTabControl1.TabIndex < 2 then
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' '); SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
Open; Open;
//ShowMessage(SQL.Text); //ShowMessage(SQL.Text);
@ -777,3 +837,4 @@ begin
end; end;
end. end.