D10gmBitao/F04染色刷卡/U_DyeOutput.pas
“username” cebba7d3b2 111
2025-04-15 20:16:06 +08:00

658 lines
20 KiB
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_DyeOutput;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Menus, cxLookAndFeelPainters, cxButtons,
cxControls, cxContainer, cxEdit, cxTextEdit, Buttons, DB, ADODB, cxGraphics,
cxLookAndFeels, cxCheckBox, cxMaskEdit, cxDropDownEdit, cxCheckComboBox,
cxGroupBox, cxRadioGroup, CheckLst, cxCheckListBox, U_BaseList, dxSkinsCore,
dxSkinsDefaultPainters, Datasnap.DBClient, MovePanel;
type
TfrmDyeOutput = class(TfrmBaseList)
Panel1: TPanel;
Label1: TLabel;
Panel2: TPanel;
Scan: TcxTextEdit;
Label2: TLabel;
LCKID: TcxTextEdit;
Label3: TLabel;
custName: TcxTextEdit;
Label4: TLabel;
Label5: TLabel;
C_Name: TcxTextEdit;
C_I_Name: TcxTextEdit;
Label7: TLabel;
C_Color: TcxTextEdit;
Label12: TLabel;
Panel_JP: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton12: TSpeedButton;
SpeedButton49: TSpeedButton;
ADOQueryCmd: TADOQuery;
ADO_Car: TADOQuery;
ADO_YG: TADOQuery;
ADO_Cmd: TADOQuery;
ADO_Tmp: TADOQuery;
SpeedButton14: TSpeedButton;
SpeedButton15: TSpeedButton;
SpeedButton16: TSpeedButton;
SpeedButton17: TSpeedButton;
SpeedButton19: TSpeedButton;
GlideMsg: TComboBox;
CDS_GX: TClientDataSet;
SpeedButton13: TSpeedButton;
SpeedButton21: TSpeedButton;
cxButton3: TcxButton;
Label9: TLabel;
Label10: TLabel;
C_Width: TcxTextEdit;
C_GramWeight: TcxTextEdit;
Label13: TLabel;
KKPS: TcxTextEdit;
SpeedButton11: TSpeedButton;
SpeedButton22: TSpeedButton;
SpeedButton23: TSpeedButton;
SpeedButton24: TSpeedButton;
SpeedButton25: TSpeedButton;
SpeedButton26: TSpeedButton;
Label14: TLabel;
rollnum: TcxTextEdit;
Label54: TLabel;
Label55: TLabel;
Edit16: TEdit;
Edit17: TEdit;
MovePanel1: TMovePanel;
tishi: TLabel;
Button1: TButton;
Timer1: TTimer;
lbl1: TLabel;
OutNumber: TcxTextEdit;
MachineNo: TcxTextEdit;
lbl2: TLabel;
ADOQueryTemp: TADOQuery;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton12Click(Sender: TObject);
procedure SpeedButton49Click(Sender: TObject);
procedure GlideRateClick(Sender: TObject);
procedure ScanKeyPress(Sender: TObject; var Key: Char);
procedure Sel1Click(Sender: TObject);
procedure SpeedButton14Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure cxButton3Click(Sender: TObject);
procedure TSNOTEExit(Sender: TObject);
procedure GlideMsgChange(Sender: TObject);
procedure Edit16Click(Sender: TObject);
procedure Edit17Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
fGlideName, fSCunit, fJPUnit: string;
procedure InitCar(fPCID: string);
{ Private declarations }
public
fflag: Integer;
fKeyNo: string;
{ Public declarations }
end;
var
frmDyeOutput: TfrmDyeOutput;
implementation
uses
U_DataLink, U_RTFun;
{$R *.dfm}
procedure SOutData(mParent: TWinControl; FTag: Integer);
var
i, idx: integer;
begin
with mParent do
begin
for i := 0 to ControlCount - 1 do
begin
if Controls[i] is TLabel then
continue;
if Controls[i].Tag <> FTag then
continue;
if Controls[i] is TEdit then
begin
TEdit(Controls[i]).Text := '';
end
else if Controls[i] is TcxTextEdit then
begin
TcxTextEdit(Controls[i]).Text := '';
end;
end;
end;
end;
procedure SInData(ADOQueryTmp: TADOQuery; mParent: TWinControl; FTag: Integer);
var
i, idx: integer;
mfield, mfieldCode: string;
begin
with ADOQueryTmp do
begin
if isEmpty then
exit;
with mParent do
begin
for i := 0 to ControlCount - 1 do
begin
if Controls[i] is TLabel then
continue;
if Controls[i].Tag <> FTag then
continue;
mfield := Controls[i].Name;
if Controls[i] is TEdit then
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString)
else
TEdit(Controls[i]).Text := '';
end
else if Controls[i] is TcxTextEdit then
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TcxTextEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString)
else
TcxTextEdit(Controls[i]).Text := '';
end;
end; // end for
end; // end with
end; //end for with
end;
procedure TfrmDyeOutput.InitCar(fPCID: string);
begin
try
with ADO_Car do
begin
close;
sql.Clear;
sql.Add(' select OutNumber=(select count(C.LCKID) OutNumber from PB_LCK C,PB_CK_LCK B where B.LCKID = C.LCKID and C.LCKID = A.LCKID),* from PB_LCK A INNER JOIN Knit_Plan_Sub B ON A.SUBID=B.SUBID ');
SQL.Add('INNER JOIN Knit_Plan_MAIN C ON A.MAINID=B.MAINID');
sql.Add('where LCKID=' + quotedstr(trim(fPCID)));
// showmessage(sql.Text);
open;
end;
// if trim(ADO_Car.fieldbyname('ShowMsg').AsString) <> '' then
// begin
// Scan.text := '';
// Application.MessageBox(pchar(trim(ADO_Car.fieldbyname('ShowMsg').AsString)), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
// ADO_Car.Close;
// exit;
// end
// else
SInData(ADO_Car, Panel2, 2);
ROLLNUM.text := ADO_Car.FieldByName('OutNumber').AsString;
Scan.text := '';
Scan.OnClick(Scan);
except
Scan.text := '';
Scan.OnClick(Scan);
end;
end;
procedure TfrmDyeOutput.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := cafree;
end;
procedure TfrmDyeOutput.FormDestroy(Sender: TObject);
begin
inherited;
frmDyeOutput := nil;
end;
procedure TfrmDyeOutput.FormCreate(Sender: TObject);
begin
inherited;
Panel2.Align := alclient;
SOutData(Panel2, 2);
SOutData(Panel2, 0);
end;
procedure TfrmDyeOutput.SpeedButton1Click(Sender: TObject);
var
fsj: string;
begin
fsj := Trim(TSpeedButton(Sender).Hint);
if Trim(fsj) = '' then
Exit;
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelStart := length(TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
end;
procedure TfrmDyeOutput.SpeedButton12Click(Sender: TObject);
var
fsj: string;
begin
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
if Trim(fsj) = '' then
Exit;
TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1);
TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelStart := length(TcxTextEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
end;
procedure TfrmDyeOutput.SpeedButton49Click(Sender: TObject);
begin
Panel_JP.Visible := false;
end;
procedure TfrmDyeOutput.Edit16Click(Sender: TObject);
begin
inherited;
if Trim(Edit16.Text) = '' then
begin
Edit16.Text := '<27><>';
Edit17.Text := '';
end
else
begin
Edit16.Text := '';
end;
end;
procedure TfrmDyeOutput.Edit17Click(Sender: TObject);
begin
inherited;
if Trim(Edit17.Text) = '' then
begin
Edit16.Text := '';
Edit17.Text := '<27><>';
end
else
begin
Edit17.Text := '';
end;
end;
procedure TfrmDyeOutput.Timer1Timer(Sender: TObject);
begin
inherited;
Button1.Click();
Timer1.Enabled := False;
end;
procedure TfrmDyeOutput.TSNOTEExit(Sender: TObject);
var
fsj: string;
str: string;
begin
// with ADO_Tmp do
// begin
// close;
// sql.Clear;
// sql.Add('select * from SY_Employee ');
// sql.Add('where EECode =' + quotedstr(EECode.Text));
// open;
// end;
// EEName.Text := trim(ADO_Tmp.fieldbyname('EEName').AsString);
end;
procedure TfrmDyeOutput.GlideMsgChange(Sender: TObject);
begin
inherited;
// if CDS_GX.Locate('Name', GlideMsg.Text, []) then
// begin
// with ADO_Tmp do
// begin
// Close;
// sql.Clear;
// sql.Add('SELECT yyps=isnull(clps,0) from Dye_Plan_Glide X where pcid=' + QuotedStr(PCID.Text));
//
// sql.Add('and X.GlideNo=' + QuotedStr(trim(CDS_GX.FieldByName('GlideNo').AsString)));
// sql.Add('and X.GlideName=' + QuotedStr(trim(CDS_GX.FieldByName('GlideName').AsString)));
// Open;
// end;
//
// if ADO_Tmp.IsEmpty = false then
// begin
// KYPS.Text := FloatToStr(strtofloatdef(PCPIECE.Text, 0) - ADO_Tmp.FieldByName('yyps').asfloat);
// rollnum.text := KYPS.Text;
// end;
// end;
end;
procedure TfrmDyeOutput.GlideRateClick(Sender: TObject);
var
i: Integer;
begin
Panel_JP.Visible := True;
with Panel_JP do
begin
for i := 0 to ControlCount - 1 do
begin
if Controls[i] is TSpeedButton then
begin
TSpeedButton(Controls[i]).Hint := Trim(TEdit(Sender).Name);
end;
end;
end;
end;
procedure TfrmDyeOutput.ScanKeyPress(Sender: TObject; var Key: Char);
var
fsj: string;
str: string;
begin
if trim(Scan.Text) = '' then
exit;
if Key = #13 then
begin
InitCar(Scan.Text);
fsj := 'exec P_Dye_Glide_Get_Idx ' + quotedstr(LCKID.Text);
SInitComBoxBySql(ADO_Cmd, GlideMsg, False, fsj);
with ADO_Tmp do
begin
Close;
sql.Clear;
sql.Add('exec P_Dye_Glide_Get_Idx ' + quotedstr(LCKID.Text));
Open;
end;
SCreateCDS(ADO_Tmp, CDS_GX);
SInitCDSData(ADO_Tmp, CDS_GX);
CDS_GX.First;
GlideMsg.ItemIndex := 0;
GlideMsgChange(Sender);
end;
end;
procedure TfrmDyeOutput.Button1Click(Sender: TObject);
begin
inherited;
MovePanel1.Visible := false;
end;
procedure TfrmDyeOutput.cxButton3Click(Sender: TObject);
var
key: Char;
begin
key := #13;
ScanKeyPress(Scan, key);
end;
procedure TfrmDyeOutput.Sel1Click(Sender: TObject);
begin
if trim(TcxTextEdit(Sender).Text) = '<27><>' then
begin
TcxTextEdit(Sender).Text := '';
end
else
begin
TcxTextEdit(Sender).Text := '<27><>';
end;
end;
procedure TfrmDyeOutput.SpeedButton14Click(Sender: TObject);
var
Maxno: string;
begin
try
SpeedButton14.Enabled := False;
// if PCID.Text = '' then
// begin
// raise Exception.Create(pchar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD>'));
// end;
if LCKID.Text = '' then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2>';
Timer1.Enabled := true;
exit;
end;
if strtofloatdef(trim(ROLLNUM.Text), 0) = 0 then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD><EFBFBD>';
Timer1.Enabled := true;
exit;
end;
if not CDS_GX.Locate('Name', GlideMsg.Text, []) then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>';
Timer1.Enabled := true;
exit;
end;
// raise Exception.Create(pchar('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>ջ<EFBFBD><D5BB><EFBFBD><EFBFBD>㣡'));
// if not CDS_GX.Locate('Name', GlideMsg.Text, []) then
// raise Exception.Create(pchar('<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!'));
if GetLSNo(ADO_Tmp, fkeyNo, 'CL', 'CL_Group', 4, 1) = False then
raise Exception.Create(pchar(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!'));
// if (Edit16.Text = '') and (Edit17.Text = '') then
// begin
// raise Exception.Create(pchar('<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>飡'));
// end;
if (Edit16.Text = '') and (Edit17.Text = '') then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
Timer1.Enabled := true;
exit;
end;
if StrToFloatDef(ROLLNUM.Text, 0) > StrToFloatDef(OutNumber.Text, 0) then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27>Ǽ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>ƥ<EFBFBD><C6A5>';
Timer1.Enabled := true;
exit;
end;
// if StrToFloatDef(ROLLNUM.Text, 0) > StrToFloatDef(KYPS.Text, 0) then
// begin
// Application.MessageBox('<27>Ǽ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
// SpeedButton14.Enabled := True;
// Exit;
// end;
if (CDS_GX.FieldByName('GlideNo').AsString = CDS_GX.FieldByName('maxGlideNo').AsString) and (MachineNo.Text = '') then
begin
MovePanel1.Visible := true;
SpeedButton14.Enabled := True;
tishi.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>';
Timer1.Enabled := true;
Exit;
end;
with ADO_Cmd do
begin
close;
sql.Clear;
sql.Add(' select * from Dye_Plan_Glide_OutPut where 1=2 ');
open;
Append;
FieldByName('GOID').Value := fkeyNo;
FieldByName('PCID').Value := trim(LCKID.text);
FieldByName('GlideNo').Value := trim(CDS_GX.FieldByName('GlideNo').AsString);
FieldByName('GlideName').Value := trim(CDS_GX.FieldByName('GlideName').AsString);
if Edit16.Text <> '' then
begin
FieldByName('StaffName').Value := trim('<27><>');
end;
if Edit17.Text <> '' then
begin
FieldByName('StaffName').Value := trim('<27><>');
end;
FieldByName('Qty').Value := 0;
FieldByName('MachineNo').Value := trim(MachineNo.text);
FieldByName('RollNum').Value := trim(ROLLNUM.text);
FieldByName('Filler').Value := trim(DName);
Post;
end;
//<2F><><EFBFBD>͹<EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD><E1BDBB>֮<EFBFBD><D6AE><EFBFBD>ѿ<EFBFBD><D1BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
if CDS_GX.FieldByName('GlideNo').AsString = CDS_GX.FieldByName('maxGlideNo').AsString then
begin
if not GetLSNo(ADOQueryCmd, Maxno, 'PC', 'BS_Cloth_IO', 3, 1) then
raise Exception.Create('ȡȾɫ<C8BE><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
with ADOQueryTemp do
begin
close;
sql.Clear;
sql.Add(' select * from BS_Cloth_IO where IOFlag = ''<27><><EFBFBD><EFBFBD>'' and StkID = ' + quotedstr(trim(LCKID.text)));
// showmessage(sql.Text);
open;
end;
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add(' select * from BS_Cloth_IO where IOFlag = ''<27><><EFBFBD><EFBFBD>'' and StkID = ' + quotedstr(trim(LCKID.text)));
// showmessage(sql.Text);
open;
end;
with ADOQueryCmd do
begin
Append;
FieldByName('BCIOID').Value := Trim(Maxno);
FieldByName('STKName').Value := ADOQueryTemp.fieldbyname('STKName').Value;
FieldByName('Workshop').Value := ADOQueryTemp.fieldbyname('Workshop').Value;
FieldByName('IOTime').Value := Trim(FormatDateTime('yyyy-MM-dd', Now));
FieldByName('IOQtyFlag').Value := -1;
FieldByName('STKID').Value := ADOQueryTemp.fieldbyname('STKID').Value;
FieldByName('IOFlag').Value := '<27><><EFBFBD><EFBFBD>';
FieldByName('IOType').Value := '<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>';
FieldByName('C_code').Value := ADOQueryTemp.fieldbyname('C_code').Value;
FieldByName('C_Name').Value := ADOQueryTemp.fieldbyname('C_Name').Value;
FieldByName('C_Composition').Value := ADOQueryTemp.fieldbyname('C_Composition').Value;
FieldByName('C_Spec').Value := ADOQueryTemp.fieldbyname('C_Spec').Value;
FieldByName('C_Width').Value := ADOQueryTemp.fieldbyname('C_Width').Value;
FieldByName('C_GramWeight').Value := ADOQueryTemp.fieldbyname('C_GramWeight').Value;
FieldByName('C_Color').Value := ADOQueryTemp.fieldbyname('C_Color').Value;
FieldByName('C_ColorNo').Value := ADOQueryTemp.fieldbyname('C_ColorNo').Value;
FieldByName('C_EColor').Value := ADOQueryTemp.fieldbyname('C_EColor').Value;
FieldByName('C_Pattern').Value := ADOQueryTemp.fieldbyname('C_Pattern').Value;
FieldByName('C_StyleNo').Value := ADOQueryTemp.fieldbyname('C_StyleNo').Value;
FieldByName('C_ColorDepth').Value := ADOQueryTemp.fieldbyname('C_ColorDepth').Value;
FieldByName('BatchNO').Value := ADOQueryTemp.fieldbyname('BatchNo').Value;
FieldByName('StkCoNo').Value := ADOQueryTemp.fieldbyname('StkCoNo').Value;
FieldByName('StkCoName').Value := ADOQueryTemp.fieldbyname('StkCoName').Value;
FieldByName('FromCoNo').Value := ADOQueryTemp.fieldbyname('FromCoNo').Value;
FieldByName('FromCoName').Value := ADOQueryTemp.fieldbyname('FromCoName').Value;
FieldByName('ToCoNo').Value := ADOQueryTemp.fieldbyname('ToCoNo').Value;
FieldByName('ToCoName').Value := ADOQueryTemp.fieldbyname('ToCoName').Value;
FieldByName('FromOrdNo').Value := ADOQueryTemp.fieldbyname('FromOrdNo').Value;
FieldByName('FromMainId').Value := ADOQueryTemp.fieldbyname('FromMainId').Value;
FieldByName('FromSubId').Value := ADOQueryTemp.fieldbyname('FromSubId').Value;
FieldByName('ToOrdNo').Value := ADOQueryTemp.fieldbyname('ToOrdNo').Value;
FieldByName('ToMainId').Value := ADOQueryTemp.fieldbyname('ToMainId').Value;
FieldByName('ToSubId').Value := ADOQueryTemp.fieldbyname('ToSubId').Value;
FieldByName('PieceWeight').Value := ADOQueryTemp.fieldbyname('PieceWeight').Value;
FieldByName('PieceLen').Value := ADOQueryTemp.fieldbyname('PieceLen').Value;
FieldByName('StkPosition').Value := ADOQueryTemp.fieldbyname('StkPosition').Value;
FieldByName('BZSpec').Value := ADOQueryTemp.fieldbyname('BZSpec').Value;
FieldByName('QtyUnit').Value := ADOQueryTemp.fieldbyname('QtyUnit').Value;
FieldByName('Qty').Value := ADOQueryTemp.fieldbyname('STKQTY').Value;
FieldByName('Piece').Value := RollNum.Text;
FieldByName('Filler').Value := Trim(DName);
FieldByName('C_XINHAO').Value := ADOQueryTemp.fieldbyname('C_XINHAO').Value;
FieldByName('C_GONGYI').Value := ADOQueryTemp.fieldbyname('C_GONGYI').Value;
FieldByName('C_JITAI').Value := ADOQueryTemp.fieldbyname('C_JITAI').Value;
FieldByName('C_ZHUANGKUANG').Value := ADOQueryTemp.fieldbyname('C_ZHUANGKUANG').Value;
FieldByName('C_JIAJI').Value := ADOQueryTemp.fieldbyname('C_JIAJI').Value;
FieldByName('JIAZINO').Value := MachineNo.Text;
Post;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update BS_Cloth_IO Set StkPiece=(select Sum(isnull(Piece,0)*IOQtyFlag) from BS_Cloth_IO A where A.STKID=BS_Cloth_IO.BCIOID)');
sql.Add(',STKQty=(select Sum(isnull(Qty,0)*IOQtyFlag) from BS_Cloth_IO A where A.STKID=BS_Cloth_IO.BCIOID )');
sql.Add('where BCIOID=''' + Trim(ADOQueryTemp.fieldbyname('STKID').AsString) + '''');
ExecSQL;
end;
end;
////////////////// <20><><EFBFBD>½<EFBFBD><C2BD><EFBFBD> //////////////////
// with ADO_Cmd do
// begin
// Close;
// sql.Clear;
// sql.Add('insert into Dye_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) ');
// sql.Add('values(''<27><>̨ˢ<CCA8><CBA2>'' ');
// sql.Add(',' + quotedstr(LCKID.text));
// sql.Add(',''PCˢ<43><CBA2>'' ');
// sql.Add(',' + quotedstr(DName));
// sql.Add(',' + quotedstr(trim(self.Caption)));
// sql.Add(',' + quotedstr(fkeyNo));
// sql.Add(') ');
// execsql;
// end;
////////////////// <20><><EFBFBD>½<EFBFBD><C2BD><EFBFBD> //////////////////
Scan.SetFocus;
SpeedButton14.Enabled := True;
// Application.MessageBox('ˢ<><CBA2><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
MovePanel1.Visible := true;
tishi.Caption := <><CBA2><EFBFBD>ɹ<EFBFBD>';
Timer1.Enabled := true;
LCKID.TEXT := '';
except
Scan.SetFocus;
SpeedButton14.Enabled := True;
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
Exit;
end;
end;
procedure TfrmDyeOutput.FormShow(Sender: TObject);
begin
inherited;
Scan.OnClick(Scan);
end;
end.