待检布加日志
This commit is contained in:
parent
05c7c64d72
commit
57b9ca0396
|
|
@ -245,6 +245,7 @@ begin
|
|||
if Trim(FFSPID) = '' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('BZNoteList').Value := Trim(CDS_Sub.fieldbyname('FactoryName').AsString) + ';' + Trim(CDS_Sub.fieldbyname('OrderNo').AsString) + ';' + Trim(CDS_Sub.fieldbyname('PiQty').AsString);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -437,13 +437,13 @@ object frmDJBCKOutList: TfrmDJBCKOutList
|
|||
Left = 0
|
||||
Top = 105
|
||||
Width = 1193
|
||||
Height = 440
|
||||
Height = 439
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnMouseDown = Tv1MouseDown
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
|
|
|
|||
|
|
@ -4,14 +4,27 @@ interface
|
|||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu,
|
||||
cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, cxCheckBox, RM_Common,
|
||||
RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, Menus,
|
||||
cxCalendar, cxButtonEdit, cxTextEdit, RM_BarCode;
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
||||
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
||||
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
|
||||
RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit,
|
||||
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
|
||||
TfrmDJBCKOutList = class(TForm)
|
||||
|
|
@ -133,15 +146,14 @@ type
|
|||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
procedure PRTColorChange(Sender: TObject);
|
||||
procedure SOrddefstr1Change(Sender: TObject);
|
||||
procedure PRTHXChange(Sender: TObject);
|
||||
procedure QCorderNoKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CKorderNoKeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
canshu1,canshu2:string;
|
||||
canshu1, canshu2: string;
|
||||
procedure InitGrid();
|
||||
procedure GetGangLb();
|
||||
{ Private declarations }
|
||||
|
|
@ -153,8 +165,9 @@ var
|
|||
frmDJBCKOutList: TfrmDJBCKOutList;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_DJBCKOutPut;
|
||||
U_DataLink, U_RTFun, U_DJBCKOutPut;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmDJBCKOutList.GetGangLb();
|
||||
|
|
@ -167,14 +180,14 @@ begin
|
|||
sql.Clear;
|
||||
sql.Add('select * from KH_Zdy where Type=''LBGANGFLAG'' ');
|
||||
open;
|
||||
If not isEmpty then
|
||||
if not isEmpty then
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
LBGANG.Items.Add(trim(fieldbyname('zdyName').AsString));
|
||||
next;
|
||||
end;
|
||||
LBGANG.ItemIndex:=0;
|
||||
LBGANG.ItemIndex := 0;
|
||||
end;
|
||||
end;
|
||||
ADOQueryTemp.EnableControls;
|
||||
|
|
@ -182,22 +195,21 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmDJBCKOutList:=nil;
|
||||
frmDJBCKOutList := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
procedure TfrmDJBCKOutList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
Action := caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
//cxGrid1.Align:=alClient;
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||
BegDate.DateTime:=EndDate.DateTime-1;
|
||||
canshu1 := Trim(DParameters1);
|
||||
canshu2 := Trim(DParameters2);
|
||||
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
||||
BegDate.DateTime := EndDate.DateTime - 1;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.InitGrid();
|
||||
|
|
@ -206,7 +218,7 @@ begin
|
|||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ,B.SOrddefstr1,B.PRTColor,B.PRTHX,B.PrtkuanNo');
|
||||
|
|
@ -216,13 +228,13 @@ begin
|
|||
SQL.Add(' and CRFlag=''出库'' ');
|
||||
SQL.Add(' and isnull(CKName,'''')=''待检布'' ');
|
||||
|
||||
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',enddate.DateTime+1));
|
||||
Parameters.ParamByName('begdate').Value := Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime));
|
||||
Parameters.ParamByName('enddate').Value := Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1));
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
|
@ -238,47 +250,49 @@ procedure TfrmDJBCKOutList.ConNoMChange(Sender: TObject);
|
|||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('外加工出库列表PMD',Tv1,'外加工仓库');
|
||||
WriteCxGrid('外加工出库列表PMD', Tv1, '外加工仓库');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.FormShow(Sender: TObject);
|
||||
begin
|
||||
if Trim(canshu2)='查看' then
|
||||
if Trim(canshu2) = '查看' then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
end else
|
||||
TBAdd.Visible := False;
|
||||
TBDel.Visible := False;
|
||||
TBEdit.Visible := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TBAdd.Visible:=True;
|
||||
TBDel.Visible:=True;
|
||||
TBEdit.Visible:=True;
|
||||
TBAdd.Visible := True;
|
||||
TBDel.Visible := True;
|
||||
TBEdit.Visible := True;
|
||||
end;
|
||||
GetGangLb();
|
||||
ReadCxGrid('外加工出库列表PMD',Tv1,'外加工仓库');
|
||||
ReadCxGrid('外加工出库列表PMD', Tv1, '外加工仓库');
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.IsEmpty then exit;
|
||||
TcxGridToExcel('外加工出库列表',cxGrid2);
|
||||
if ADOQueryMain.IsEmpty then
|
||||
exit;
|
||||
TcxGridToExcel('外加工出库列表', cxGrid2);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -289,17 +303,17 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.SPIDChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(SPID.Text))<4 then
|
||||
if Length(Trim(SPID.Text)) < 4 then
|
||||
begin
|
||||
if Trim(SPID.Text)<>'' then Exit;
|
||||
if Trim(SPID.Text) <> '' then
|
||||
Exit;
|
||||
end;
|
||||
TBFind.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.SPIDKeyPress(Sender: TObject;
|
||||
var Key: Char);
|
||||
procedure TfrmDJBCKOutList.SPIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
if Key = #13 then
|
||||
begin
|
||||
{if Length(Trim(SPID.Text))<4 then Exit;
|
||||
try
|
||||
|
|
@ -326,17 +340,18 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.N1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)='检验出库' then
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '检验出库' then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('SSel').Value:=True;
|
||||
FieldByName('SSel').Value := True;
|
||||
Post;
|
||||
end;
|
||||
Next;
|
||||
|
|
@ -347,66 +362,76 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,False);
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('SPID').AsString)<>'' then
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select Top 1 * from WFB_MJJY where isnull(APID,'''')='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
sql.Add('select Top 1 * from WFB_MJJY where isnull(APID,'''')=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
Application.MessageBox('已检验不能删除数据!','提示',0);
|
||||
Application.MessageBox('已检验不能删除数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)='平移出库' then
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移出库' then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_SXPB_CR where FZSPID=');
|
||||
sql.Add('(select SPID from CK_SXPB_CR where PYID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
sql.Add('(select SPID from CK_SXPB_CR where PYID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
|
||||
sql.Add(' and isnull(CRType,'''')=''平移入库'')');
|
||||
sql.Add(' and CRQtyFlag=-1');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
Application.MessageBox('已有出库记录,不能删除!','提示',0);
|
||||
Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' delete CK_SXPB_CR where SPID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
sql.Add(' delete CK_SXPB_CR where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
|
||||
sql.Add(' Update CK_SXPB_CR Set MXKCQty=(select sum(isnull(Qty,0)*CRQtyFlag) from CK_SXPB_CR A where A.FZSPID=CK_SXPB_CR.SPID)');
|
||||
sql.Add(',MXKCPiQty=(select sum(isnull(PiQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.FZSPID=CK_SXPB_CR.SPID)');
|
||||
sql.Add(' where SPID='''+Trim(CDS_Main.fieldbyname('FZSPID').AsString)+'''');
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)='平移出库' then
|
||||
sql.Add(' where SPID=''' + Trim(CDS_Main.fieldbyname('FZSPID').AsString) + '''');
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移出库' then
|
||||
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;
|
||||
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;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('删除异常!','提示',0);
|
||||
Application.MessageBox('删除异常!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
CDS_Main.Delete;
|
||||
|
|
@ -415,11 +440,11 @@ end;
|
|||
procedure TfrmDJBCKOutList.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmDJBCKOutPut:=TfrmDJBCKOutPut.Create(Application);
|
||||
frmDJBCKOutPut := TfrmDJBCKOutPut.Create(Application);
|
||||
with frmDJBCKOutPut do
|
||||
begin
|
||||
FBCId:='';
|
||||
if ShowModal=1 then
|
||||
FBCId := '';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
end;
|
||||
|
|
@ -431,30 +456,31 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_SXPB_CR where FZSPID=');
|
||||
sql.Add('(select SPID from CK_SXPB_CR where PYID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
sql.Add('(select SPID from CK_SXPB_CR where PYID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
|
||||
sql.Add(' and isnull(CRType,'''')=''平移入库'')');
|
||||
sql.Add(' and CRQtyFlag=-1');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
Application.MessageBox('已有出库记录,不能修改!','提示',0);
|
||||
Application.MessageBox('已有出库记录,不能修改!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
frmDJBCKOutPut:=TfrmDJBCKOutPut.Create(Application);
|
||||
frmDJBCKOutPut := TfrmDJBCKOutPut.Create(Application);
|
||||
with frmDJBCKOutPut do
|
||||
begin
|
||||
FBCId:=Trim(CDS_Main.fieldbyname('SPID').AsString);
|
||||
TBDel.Visible:=False;
|
||||
TBAdd.Visible:=False;
|
||||
if ShowModal=1 then
|
||||
FBCId := Trim(CDS_Main.fieldbyname('SPID').AsString);
|
||||
TBDel.Visible := False;
|
||||
TBAdd.Visible := False;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
end;
|
||||
|
|
@ -467,31 +493,31 @@ end;
|
|||
|
||||
procedure TfrmDJBCKOutList.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
Txt,fImagePath:string;
|
||||
Moudle: THandle;
|
||||
Makebar:TMakebar;
|
||||
Mixtext:TMixtext;
|
||||
|
||||
fPrintFile: string;
|
||||
Txt, fImagePath: string;
|
||||
Moudle: THandle;
|
||||
Makebar: TMakebar;
|
||||
Mixtext: TMixtext;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if CDS_Main.IsEmpty 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
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
IF Trim(LBGANG.Text)='' then
|
||||
if Trim(LBGANG.Text) = '' then
|
||||
begin
|
||||
Application.MessageBox('选择要打印的缸标签!','提示',0);
|
||||
Application.MessageBox('选择要打印的缸标签!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(LBGANG.Text)+'.rmf' ;
|
||||
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBGANG.Text) + '.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while CDS_Main.Locate('SSel',True,[]) do
|
||||
while CDS_Main.Locate('SSel', True, []) do
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
|
|
@ -503,41 +529,43 @@ begin
|
|||
sql.Add(' from CK_SXPB_CR A');
|
||||
sql.Add(' left join JYOrder_Main B on A.ORDmainIdCK=B.mainID');
|
||||
sql.Add(' left join JYOrder_Sub C on A.ORDSubIdCK=C.subID');
|
||||
sql.Add(' where A.SPId='''+Trim(CDS_Main.fieldbyname('SPId').AsString)+'''');
|
||||
sql.Add(' where A.SPId=''' + Trim(CDS_Main.fieldbyname('SPId').AsString) + '''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryPrint,CDS_PRT);
|
||||
SInitCDSData20(ADOQueryPrint,CDS_PRT);
|
||||
SCreateCDS20(ADOQueryPrint, CDS_PRT);
|
||||
SInitCDSData20(ADOQueryPrint, CDS_PRT);
|
||||
try
|
||||
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||
Txt:=Trim(CDS_PRT.fieldbyname('SPID').AsString);
|
||||
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp' ;
|
||||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
||||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
||||
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
||||
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
||||
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
||||
@Makebar := GetProcAddress(Moudle, 'Make');
|
||||
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
||||
Txt := Trim(CDS_PRT.fieldbyname('SPID').AsString);
|
||||
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
||||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
||||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
||||
if FileExists(fImagePath) then
|
||||
DeleteFile(fImagePath);
|
||||
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
application.MessageBox('条形码生成失败!','提示信息',MB_ICONERROR);
|
||||
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RMVariables['QRBARCODE']:=fImagePath;
|
||||
RMVariables['QRBARCODE'] := fImagePath;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
end
|
||||
else
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
Application.MessageBox(PChar('没有找'+fPrintFile),'提示',0);
|
||||
Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('SSel').Value:=False;
|
||||
FieldByName('SSel').Value := False;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -545,8 +573,7 @@ begin
|
|||
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.Tv1MouseDown(Sender: TObject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
procedure TfrmDJBCKOutList.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
{ if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)<>'检验出库' then
|
||||
|
|
@ -573,60 +600,60 @@ begin
|
|||
TBFind.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.QCorderNoKeyPress(Sender: TObject;
|
||||
var Key: Char);
|
||||
procedure TfrmDJBCKOutList.QCorderNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
IF trim(QCorderNo.Text)='' then exit;
|
||||
IF Key=#13 then
|
||||
if trim(QCorderNo.Text) = '' then
|
||||
exit;
|
||||
if Key = #13 then
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ,B.SOrddefstr1,B.PRTColor,B.PRTHX,B.PrtkuanNo');
|
||||
sql.Add(' from CK_SXPB_CR A');
|
||||
sql.Add(' left join JYOrder_Sub B on A.ORDSubIdCK=B.SubId');
|
||||
sql.add(' where A.QCorderNo like '+quotedstr('%'+trim(QCorderNo.text)+'%'));
|
||||
sql.add(' where A.QCorderNo like ' + quotedstr('%' + trim(QCorderNo.text) + '%'));
|
||||
SQL.Add(' and CRFlag=''出库'' ');
|
||||
SQL.Add(' and isnull(CKName,'''')=''待检布'' ');
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKOutList.CKorderNoKeyPress(Sender: TObject;
|
||||
var Key: Char);
|
||||
procedure TfrmDJBCKOutList.CKorderNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
IF trim(CKorderNo.Text)='' then exit;
|
||||
IF Key=#13 then
|
||||
if trim(CKorderNo.Text) = '' then
|
||||
exit;
|
||||
if Key = #13 then
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ,B.SOrddefstr1,B.PRTColor,B.PRTHX,B.PrtkuanNo');
|
||||
sql.Add(' from CK_SXPB_CR A');
|
||||
sql.Add(' left join JYOrder_Sub B on A.ORDSubIdCK=B.SubId');
|
||||
sql.add(' where A.CKorderNo like '+quotedstr('%'+trim(CKorderNo.text)+'%'));
|
||||
sql.add(' where A.CKorderNo like ' + quotedstr('%' + trim(CKorderNo.text) + '%'));
|
||||
SQL.Add(' and CRFlag=''出库'' ');
|
||||
SQL.Add(' and isnull(CKName,'''')=''待检布'' ');
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
|
@ -634,3 +661,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,29 +4,27 @@ interface
|
|||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu,
|
||||
cxGridPopupMenu, ADODB, DBClient, cxDropDownEdit, cxCheckBox, RM_Common,
|
||||
RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, Menus,
|
||||
cxCalendar, cxButtonEdit, cxTextEdit, cxPC, BtnEdit, 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, dxBarBuiltInMenu;
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
||||
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
||||
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
|
||||
RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit, cxPC,
|
||||
BtnEdit, 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, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmDJBRKList = class(TForm)
|
||||
|
|
@ -172,9 +170,9 @@ type
|
|||
procedure Button2Click(Sender: TObject);
|
||||
procedure defstr2KeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
canshu1,canshu2:string;
|
||||
canshu1, canshu2: string;
|
||||
procedure InitGrid();
|
||||
Procedure setstatus();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
|
|
@ -184,33 +182,34 @@ var
|
|||
frmDJBRKList: TfrmDJBRKList;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_DJBCKInPut, U_ZdyAttachGYS;
|
||||
U_DataLink, U_RTFun, U_DJBCKInPut, U_ZdyAttachGYS;
|
||||
|
||||
{$R *.dfm}
|
||||
Procedure TfrmDJBRKList.setstatus();
|
||||
procedure TfrmDJBRKList.setstatus();
|
||||
begin
|
||||
TBedit.Visible:=false;
|
||||
TBdel.Visible:=false;
|
||||
TBchk.Visible:=false;
|
||||
TBNochk.Visible:=false;
|
||||
TBTSedit.Visible:=false;
|
||||
IF canshu1='高权限'then
|
||||
TBedit.Visible := false;
|
||||
TBdel.Visible := false;
|
||||
TBchk.Visible := false;
|
||||
TBNochk.Visible := false;
|
||||
TBTSedit.Visible := false;
|
||||
if canshu1 = '高权限' then
|
||||
begin
|
||||
|
||||
case cxTabControl1.TabIndex of
|
||||
0:
|
||||
begin
|
||||
TBedit.Visible:=true;
|
||||
TBdel.Visible:=true;
|
||||
TBchk.Visible:=true;
|
||||
TBTSedit.Visible:=true;
|
||||
end;
|
||||
begin
|
||||
TBedit.Visible := true;
|
||||
TBdel.Visible := true;
|
||||
TBchk.Visible := true;
|
||||
TBTSedit.Visible := true;
|
||||
end;
|
||||
1:
|
||||
begin
|
||||
TBNochk.Visible:=True;
|
||||
TBTSedit.Visible:=true;
|
||||
end;
|
||||
begin
|
||||
TBNochk.Visible := True;
|
||||
TBTSedit.Visible := true;
|
||||
end;
|
||||
|
||||
end;
|
||||
end
|
||||
|
|
@ -218,15 +217,15 @@ begin
|
|||
begin
|
||||
case cxTabControl1.TabIndex of
|
||||
0:
|
||||
begin
|
||||
TBedit.Visible:=true;
|
||||
TBdel.Visible:=true;
|
||||
begin
|
||||
TBedit.Visible := true;
|
||||
TBdel.Visible := true;
|
||||
// TBchk.Visible:=true;
|
||||
end;
|
||||
end;
|
||||
1:
|
||||
begin
|
||||
begin
|
||||
// TBNochk.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
|
@ -234,22 +233,21 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmDJBRKList:=nil;
|
||||
frmDJBRKList := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
procedure TfrmDJBRKList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
Action := caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
//cxGrid1.Align:=alClient;
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||
BegDate.DateTime:=EndDate.DateTime;
|
||||
canshu1 := Trim(DParameters1);
|
||||
canshu2 := Trim(DParameters2);
|
||||
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
||||
BegDate.DateTime := EndDate.DateTime;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.InitGrid();
|
||||
|
|
@ -258,7 +256,7 @@ begin
|
|||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ,AvgQty=case when piQty<>0 then cast(Qty/piQty as decimal(18,2)) else 0 end');
|
||||
|
|
@ -268,17 +266,17 @@ begin
|
|||
sql.Add(' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' from CK_SXPB_CR A');
|
||||
sql.add(' where A.CRTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
|
||||
sql.Add(' and A.CRTime<='''+Trim(FormatDateTime('yyyy-MM-dd',enddate.DateTime+1))+'''');
|
||||
sql.add(' where A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
|
||||
sql.Add(' and A.CRTime<=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
||||
sql.Add(' and isnull(CKName,'''')=''´ý¼ì²¼''');
|
||||
SQL.Add(' and CRFlag=''Èë¿â'' ');
|
||||
IF cxTabControl1.TabIndex<2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')='''+inttostr(cxTabControl1.TabIndex)+''' ');
|
||||
if cxTabControl1.TabIndex < 2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
|
@ -294,84 +292,88 @@ procedure TfrmDJBRKList.ConNoMChange(Sender: TObject);
|
|||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('待检布入库列表',Tv1,'待检布仓库');
|
||||
WriteCxGrid('待检布入库列表', Tv1, '待检布仓库');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.FormShow(Sender: TObject);
|
||||
begin
|
||||
if Trim(canshu2)='查看' then
|
||||
if Trim(canshu2) = '查看' then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
end else
|
||||
TBAdd.Visible := False;
|
||||
TBDel.Visible := False;
|
||||
TBEdit.Visible := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TBAdd.Visible:=True;
|
||||
TBDel.Visible:=True;
|
||||
TBEdit.Visible:=True;
|
||||
TBAdd.Visible := True;
|
||||
TBDel.Visible := True;
|
||||
TBEdit.Visible := True;
|
||||
end;
|
||||
ReadCxGrid('待检布入库列表',Tv1,'待检布仓库');
|
||||
ReadCxGrid('待检布入库列表', Tv1, '待检布仓库');
|
||||
setstatus();
|
||||
// InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.IsEmpty then exit;
|
||||
TcxGridToExcel('待检布入库列表',cxGrid2);
|
||||
if ADOQueryMain.IsEmpty then
|
||||
exit;
|
||||
TcxGridToExcel('待检布入库列表', cxGrid2);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,True);
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,False);
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('SPID').AsString)<>'' then
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
|
||||
begin
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)='平移入库' then
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
|
||||
begin
|
||||
Application.MessageBox('平移入库的数据为自动生成,不能删除!','提示',0);
|
||||
Application.MessageBox('平移入库的数据为自动生成,不能删除!', '提示', 0);
|
||||
Exit;
|
||||
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('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
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
Application.MessageBox('已有出库记录,不能删除!','提示',0);
|
||||
Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
||||
|
|
@ -379,10 +381,18 @@ begin
|
|||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' delete CK_SXPB_CR where SPID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
sql.Add(' delete CK_SXPB_CR where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
|
||||
{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(' 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;
|
||||
end;
|
||||
{ with ADOQueryTemp do
|
||||
|
|
@ -406,10 +416,11 @@ begin
|
|||
CDS_Main.Delete;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('删除异常!','提示',0);
|
||||
Application.MessageBox('删除异常!', '提示', 0);
|
||||
end;
|
||||
|
||||
end else
|
||||
end
|
||||
else
|
||||
begin
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
|
|
@ -418,11 +429,11 @@ end;
|
|||
procedure TfrmDJBRKList.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmDJBCKInPut:=TfrmDJBCKInPut.Create(Application);
|
||||
frmDJBCKInPut := TfrmDJBCKInPut.Create(Application);
|
||||
with frmDJBCKInPut do
|
||||
begin
|
||||
FBCId:='';
|
||||
if ShowModal=1 then
|
||||
FBCId := '';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
end;
|
||||
|
|
@ -434,20 +445,34 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString)='平移入库' then
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
|
||||
begin
|
||||
Application.MessageBox('平移入库的数据为自动生成,不能修改!','提示',0);
|
||||
Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
|
||||
Exit;
|
||||
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
|
||||
frmDJBCKInPut:=TfrmDJBCKInPut.Create(Application);
|
||||
frmDJBCKInPut := TfrmDJBCKInPut.Create(Application);
|
||||
with frmDJBCKInPut do
|
||||
begin
|
||||
FBCId:=Trim(CDS_Main.fieldbyname('SPID').AsString);
|
||||
TBDel.Visible:=False;
|
||||
TBAdd.Visible:=False;
|
||||
if ShowModal=1 then
|
||||
FBCId := Trim(CDS_Main.fieldbyname('SPID').AsString);
|
||||
TBDel.Visible := False;
|
||||
TBAdd.Visible := False;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
end;
|
||||
|
|
@ -459,7 +484,7 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.SPIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
if Key = #13 then
|
||||
begin
|
||||
{if Length(Trim(SPID.Text))<4 then Exit;
|
||||
try
|
||||
|
|
@ -488,9 +513,10 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.SPIDChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(SPID.Text))<4 then
|
||||
if Length(Trim(SPID.Text)) < 4 then
|
||||
begin
|
||||
if Trim(SPID.Text)<>'' then Exit;
|
||||
if Trim(SPID.Text) <> '' then
|
||||
Exit;
|
||||
end;
|
||||
TBFind.Click;
|
||||
end;
|
||||
|
|
@ -507,15 +533,16 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.OrderNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
IF trim(OrderNo.Text)='' then exit;
|
||||
IF Key=#13 then
|
||||
if trim(OrderNo.Text) = '' then
|
||||
exit;
|
||||
if Key = #13 then
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
sql.Add(',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)');
|
||||
|
|
@ -524,16 +551,16 @@ begin
|
|||
sql.Add(' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' from CK_SXPB_CR A');
|
||||
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 CRFlag=''Èë¿â'' ');
|
||||
IF cxTabControl1.TabIndex<2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')='''+inttostr(cxTabControl1.TabIndex)+''' ');
|
||||
if cxTabControl1.TabIndex < 2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
|
@ -542,10 +569,11 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.TBCHKClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then exit;
|
||||
if CDS_Main.Locate('SSel',True,[])=False then
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if CDS_Main.Locate('SSel', True, []) = False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
|
|
@ -554,14 +582,14 @@ begin
|
|||
DisableControls;
|
||||
while not eof do
|
||||
begin
|
||||
IF fieldbyname('ssel').AsBoolean then
|
||||
if fieldbyname('ssel').AsBoolean then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_SXPB_CR SET chkstatus=''1'',chker='''+trim(DName)+''',chkTime=getdate() ');
|
||||
sql.Add('where SPID='+quotedstr(trim(CDS_Main.fieldbyname('SPID').AsString)));
|
||||
sql.Add('update CK_SXPB_CR SET chkstatus=''1'',chker=''' + trim(DName) + ''',chkTime=getdate() ');
|
||||
sql.Add('where SPID=' + quotedstr(trim(CDS_Main.fieldbyname('SPID').AsString)));
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -569,19 +597,20 @@ begin
|
|||
end;
|
||||
EnableControls;
|
||||
end;
|
||||
application.MessageBox('审核成功!','提示信息');
|
||||
application.MessageBox('审核成功!', '提示信息');
|
||||
TBRafresh.Click;
|
||||
except
|
||||
application.MessageBox('审核失败!','提示信息',0);
|
||||
application.MessageBox('审核失败!', '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.TBNOchkClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then exit;
|
||||
if CDS_Main.Locate('SSel',True,[])=False then
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if CDS_Main.Locate('SSel', True, []) = False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
|
|
@ -590,14 +619,14 @@ begin
|
|||
DisableControls;
|
||||
while not eof do
|
||||
begin
|
||||
IF fieldbyname('ssel').AsBoolean then
|
||||
if fieldbyname('ssel').AsBoolean then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_SXPB_CR SET chkstatus=''0'',chker='''+trim(DName)+''',chkTime=getdate() ');
|
||||
sql.Add('where SPID='+quotedstr(trim(CDS_Main.fieldbyname('SPID').AsString)));
|
||||
sql.Add('update CK_SXPB_CR SET chkstatus=''0'',chker=''' + trim(DName) + ''',chkTime=getdate() ');
|
||||
sql.Add('where SPID=' + quotedstr(trim(CDS_Main.fieldbyname('SPID').AsString)));
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -605,10 +634,10 @@ begin
|
|||
end;
|
||||
EnableControls;
|
||||
end;
|
||||
application.MessageBox('撤销审核成功!','提示信息');
|
||||
application.MessageBox('撤销审核成功!', '提示信息');
|
||||
TBRafresh.Click;
|
||||
except
|
||||
application.MessageBox('撤销审核失败!','提示信息',0);
|
||||
application.MessageBox('撤销审核失败!', '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -621,64 +650,84 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.Button5Click(Sender: TObject);
|
||||
begin
|
||||
IF CDS_Main.IsEmpty then exit;
|
||||
IF trim(factoryName1.Text)='' then
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if trim(factoryName1.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('加工厂不能为空!','提示信息',0);
|
||||
application.MessageBox('加工厂不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要修改加工厂吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Application.MessageBox('确定要修改加工厂吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_SXPB_CR SET factoryName='''+trim(factoryName1.Text)+''',edittime=getdate() where SPID='''+Trim(CDS_Main.fieldbyname('SPID').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(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 WFB_MJJY SET factoryName='''+trim(factoryName1.Text)+''' where APID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
Panel5.Visible:=false;
|
||||
Application.MessageBox('保存成功!', '提示', 0);
|
||||
Panel5.Visible := false;
|
||||
TBRafresh.Click;
|
||||
except
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.Button1Click(Sender: TObject);
|
||||
begin
|
||||
IF CDS_Main.IsEmpty then exit;
|
||||
IF trim(Com_CRype.Text)='' then
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if trim(Com_CRype.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('入库类型不能为空!','提示信息',0);
|
||||
application.MessageBox('入库类型不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要修改入库类型吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Application.MessageBox('确定要修改入库类型吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_SXPB_CR SET CRType='''+trim(Com_CRype.Text)+''' where SPID='''+Trim(CDS_Main.fieldbyname('SPID').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('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) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
Panel5.Visible:=false;
|
||||
Application.MessageBox('保存成功!', '提示', 0);
|
||||
Panel5.Visible := false;
|
||||
TBRafresh.Click;
|
||||
except
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.factoryName1BtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS:=TfrmZdyAttachGYS.Create(Application);
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
factoryName1.Text:=Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString);
|
||||
factoryName1.Text := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
|
|
@ -688,29 +737,31 @@ end;
|
|||
|
||||
procedure TfrmDJBRKList.TBTSeditClick(Sender: TObject);
|
||||
begin
|
||||
factoryName1.Text:='';
|
||||
Com_CRype.Text:='';
|
||||
edit_defstr2.Text:='';
|
||||
edit_gangNo.Text:='';
|
||||
edit_note.Text:='';
|
||||
Panel5.Left:=(self.Width-Panel5.Width) div 2;
|
||||
Panel5.Visible:=true;
|
||||
factoryName1.Text := '';
|
||||
Com_CRype.Text := '';
|
||||
edit_defstr2.Text := '';
|
||||
edit_gangNo.Text := '';
|
||||
edit_note.Text := '';
|
||||
Panel5.Left := (self.Width - Panel5.Width) div 2;
|
||||
Panel5.Visible := true;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.Button6Click(Sender: TObject);
|
||||
begin
|
||||
Panel5.Visible:=false;
|
||||
Panel5.Visible := false;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.Button2Click(Sender: TObject);
|
||||
begin
|
||||
IF CDS_Main.IsEmpty then exit;
|
||||
IF trim(edit_defstr2.Text)='' then
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if trim(edit_defstr2.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('统计单号不能为空!','提示信息',0);
|
||||
application.MessageBox('统计单号不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要修改统计单号吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Application.MessageBox('确定要修改统计单号吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
with CDS_Main do
|
||||
begin
|
||||
|
|
@ -718,13 +769,21 @@ begin
|
|||
first;
|
||||
while not eof do
|
||||
begin
|
||||
IF fieldbyName('Ssel').AsBoolean then
|
||||
if fieldbyName('Ssel').AsBoolean then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_SXPB_CR SET defstr2='''+trim(edit_defstr2.Text)+''' where SPID='''+Trim(CDS_Main.fieldbyname('SPID').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('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) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -733,25 +792,26 @@ begin
|
|||
EnableControls;
|
||||
end;
|
||||
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
Panel5.Visible:=false;
|
||||
Application.MessageBox('保存成功!', '提示', 0);
|
||||
Panel5.Visible := false;
|
||||
TBRafresh.Click;
|
||||
except
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBRKList.defstr2KeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
IF trim(defstr2.Text)='' then exit;
|
||||
IF Key=#13 then
|
||||
if trim(defstr2.Text) = '' then
|
||||
exit;
|
||||
if Key = #13 then
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
Filtered := False;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
sql.Add(',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)');
|
||||
|
|
@ -760,16 +820,16 @@ begin
|
|||
sql.Add(' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )');
|
||||
sql.Add(' from CK_SXPB_CR A');
|
||||
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 CRFlag=''Èë¿â'' ');
|
||||
IF cxTabControl1.TabIndex<2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')='''+inttostr(cxTabControl1.TabIndex)+''' ');
|
||||
if cxTabControl1.TabIndex < 2 then
|
||||
SQL.Add(' and isnull(A.chkstatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
||||
Open;
|
||||
//ShowMessage(SQL.Text);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain, CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
|
@ -777,3 +837,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user