1695 lines
49 KiB
ObjectPascal
1695 lines
49 KiB
ObjectPascal
|
|
unit U_QCRKInPut;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
|||
|
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
|||
|
|
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
|||
|
|
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
|||
|
|
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxDropDownEdit,jpeg,
|
|||
|
|
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, cxPC,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGroupBox, cxCheckBox,
|
|||
|
|
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, Menus;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmQCRKInPut = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
Label34: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
MYCode: TEdit;
|
|||
|
|
CRTime: TDateTimePicker;
|
|||
|
|
MYName: TEdit;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
MYColor: TEdit;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
MYKZ: TEdit;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
MYMF: TEdit;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
MYColorNo: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
GangQty: TEdit;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
MXHZPS: TEdit;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
MXHZKGQty: TEdit;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
MYType: TBtnEditA;
|
|||
|
|
BtnDel: TButton;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
KgQty1: TEdit;
|
|||
|
|
MQty1: TEdit;
|
|||
|
|
Button6: TButton;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
RCGangNO1: TEdit;
|
|||
|
|
MLID: TEdit;
|
|||
|
|
BPID: TEdit;
|
|||
|
|
DYID: TEdit;
|
|||
|
|
PTID: TEdit;
|
|||
|
|
KgQtyAvg: TEdit;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
QtyAvg: TEdit;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
labMYType: TLabel;
|
|||
|
|
MXHZQty: TEdit;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
CDS_Print: TClientDataSet;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
ComboBox2: TComboBox;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
ComboBox1: TComboBox;
|
|||
|
|
BtnPrt: TButton;
|
|||
|
|
BtnQX: TButton;
|
|||
|
|
Label30: TLabel;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Panel6: TPanel;
|
|||
|
|
Button2: TButton;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
Note2: TEdit;
|
|||
|
|
v1MXNote: TcxGridDBColumn;
|
|||
|
|
v1MXGYLXName: TcxGridDBColumn;
|
|||
|
|
v1KuWei: TcxGridDBColumn;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
MXGYLXName: TEdit;
|
|||
|
|
Button5: TButton;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
MXKuWeI: TEdit;
|
|||
|
|
Button8: TButton;
|
|||
|
|
v1MYCode: TcxGridDBColumn;
|
|||
|
|
v1MYName: TcxGridDBColumn;
|
|||
|
|
v1MYMF: TcxGridDBColumn;
|
|||
|
|
v1MYKZ: TcxGridDBColumn;
|
|||
|
|
v1MYColorNo: TcxGridDBColumn;
|
|||
|
|
v1MYColor: TcxGridDBColumn;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
RKNo: TEdit;
|
|||
|
|
cxGroupBox1: TcxGroupBox;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
QtyLRM: TEdit;
|
|||
|
|
UnitM: TEdit;
|
|||
|
|
UnitKg: TEdit;
|
|||
|
|
RCGangNo: TEdit;
|
|||
|
|
QtyLRKg: TEdit;
|
|||
|
|
BtnM: TButton;
|
|||
|
|
BtnKg: TButton;
|
|||
|
|
MXNote: TEdit;
|
|||
|
|
KuWei: TEdit;
|
|||
|
|
GYLXName: TEdit;
|
|||
|
|
Button4: TButton;
|
|||
|
|
Button7: TButton;
|
|||
|
|
Button9: TButton;
|
|||
|
|
Button10: TButton;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
MXMYName: TEdit;
|
|||
|
|
Button11: TButton;
|
|||
|
|
MXMYCode: TEdit;
|
|||
|
|
MXMYMF: TEdit;
|
|||
|
|
MXMYKZ: TEdit;
|
|||
|
|
MXMYColor: TEdit;
|
|||
|
|
MXMYColorNo: TEdit;
|
|||
|
|
Label39: TLabel;
|
|||
|
|
Label40: TLabel;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
MXDYID: TEdit;
|
|||
|
|
MXMLID: TEdit;
|
|||
|
|
MXBPID: TEdit;
|
|||
|
|
MXPTID: TEdit;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure ShuiXiSuoLvClick(Sender: TObject);
|
|||
|
|
procedure ShuiXiSuoLvJGMouseDown(Sender: TObject; Button: TMouseButton;
|
|||
|
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure UnitMClick(Sender: TObject);
|
|||
|
|
procedure UnitKgClick(Sender: TObject);
|
|||
|
|
procedure QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure BtnQXClick(Sender: TObject);
|
|||
|
|
procedure MYNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure BtnDelClick(Sender: TObject);
|
|||
|
|
procedure v1Column7PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure BtnPrtClick(Sender: TObject);
|
|||
|
|
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure BtnMClick(Sender: TObject);
|
|||
|
|
procedure BtnKgClick(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure Panel6DblClick(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button4Click(Sender: TObject);
|
|||
|
|
procedure UnitMChange(Sender: TObject);
|
|||
|
|
procedure UnitKgChange(Sender: TObject);
|
|||
|
|
procedure KuWeiKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure MXKuWeIKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button5Click(Sender: TObject);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure Button8Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure Button11Click(Sender: TObject);
|
|||
|
|
procedure MenuItem1Click(Sender: TObject);
|
|||
|
|
procedure Button9Click(Sender: TObject);
|
|||
|
|
procedure Button10Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
private
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure InitMXData();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure GetHZData();
|
|||
|
|
procedure InitColor();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
FRead:String;
|
|||
|
|
FSaveFlag:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmQCRKInPut: TfrmQCRKInPut;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel, U_GYSList,U_SCPerson,U_KuWeiList
|
|||
|
|
,U_QCRKJLList,U_RSColorBig,U_MLMangeRS_GYCX,U_MLMangeRS_CX,U_KuWeiKCList,U_RTPTColor;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27>ڳ<EFBFBD><DAB3><EFBFBD>ϸ¼<CFB8><C2BC>1',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.InitData();
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.*');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where A.RKNo='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel3,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel2,2);
|
|||
|
|
MYCode.Hint:=Trim(ADOQuery1.fieldbyname('MYCode').AsString);
|
|||
|
|
labMYType.Caption:=Trim(ADOQuery1.fieldbyname('MYType').AsString);
|
|||
|
|
if Trim(labMYType.Caption)='' then
|
|||
|
|
begin
|
|||
|
|
labMYType.Caption:=' ';
|
|||
|
|
end;
|
|||
|
|
if PState=0 then
|
|||
|
|
begin
|
|||
|
|
CRTime.Date:=SGetServerDate(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
InitMXData();
|
|||
|
|
GetHZData();
|
|||
|
|
Edit1.SetFocus;
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.InitMXData();
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.*,Laster=isnull(A.Editer,A.Filler) ');
|
|||
|
|
sql.Add(',RCGangNo1=(case when isnull(A.RCGangNo,'''')='''' then A.GangNo else A.RCGangNo end)');
|
|||
|
|
sql.Add(' from CK_MYSC_CR_MX A inner join CK_MYSC_CR B on B.MYID=A.MYID ');
|
|||
|
|
SQL.Add('where isnull(B.RKNo,'''')='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and isnull(B.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOTemp,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.GetHZData();
|
|||
|
|
var
|
|||
|
|
FKG,FM,FPS:String;
|
|||
|
|
begin
|
|||
|
|
FKG:=Tv1.DataController.Summary.FooterSummaryTexts[0];
|
|||
|
|
FM:=Tv1.DataController.Summary.FooterSummaryTexts[1];
|
|||
|
|
FPS:=Tv1.DataController.Summary.FooterSummaryTexts[2];
|
|||
|
|
MXHZPS.Text:=FPS;
|
|||
|
|
MXHZKGQty.Text:=FKG;
|
|||
|
|
MXHZQty.Text:=FM;
|
|||
|
|
if (Trim(FPS)='') or (Trim(FPS)='0') then
|
|||
|
|
begin
|
|||
|
|
SClearData(Panel2,2);
|
|||
|
|
SClearData(Panel2,99);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Avg_JS :KgQty,:MQty,:PS');
|
|||
|
|
if Trim(FKG)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=FKG;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
if Trim(FM)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=FM;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
Parameters.ParamByName('PS').Value:=FPS;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
KgQtyAvg.Text:=ADOTemp.fieldbyname('KgQtyAvg').Value;
|
|||
|
|
QtyAvg.Text:=ADOTemp.fieldbyname('QtyAvg').Value;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27>ڳ<EFBFBD><DAB3><EFBFBD>ϸ¼<CFB8><C2BC>1',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmQCRKInPut.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,maxmxno,maxnoflag,fsj,FMXID,FRKNo:String;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
if RKNo.text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FRKNo,'RK','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
RKNo.text:=Trim(FRKNo);
|
|||
|
|
FMainId:=Trim(FRKNo);
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(fieldbyname('MYID').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'QC','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(fieldbyname('MYID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR where MYId='''+Trim(maxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditerCode').Value:=Trim(DCode);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYId').Value:=Trim(maxno);
|
|||
|
|
FieldByName('CRType').Value:='<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('MYType').Value:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRQtyFlag').Value:=1;
|
|||
|
|
FieldByName('RKNo').Value:=Trim(RKNo.Text);
|
|||
|
|
FieldByName('CRTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
FieldByName('MYName').Value:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
FieldByName('GYLXName').Value:=Trim(ClientDataSet1.fieldbyname('MXGYLXName').AsString);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
FieldByName('Note').Value:=Trim(ClientDataSet1.fieldbyname('KuWei').AsString);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
FieldByName('DYID').Value:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('UPdate CK_MYSC_CR Set KHDayCS=isnull((select isnull(max(KHDayCS),0) from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where A.CRTime=CK_MYSC_CR.CRTime and isnull(A.KHName,'''')=isnull(CK_MYSC_CR.KHName,'''') ');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>''),'''')');
|
|||
|
|
SQL.Add(' where RKNo='''+Trim(RKNo.Text)+''' and isnull(KHName,'''')<>'''' and isnull(CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
{with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from CK_MYSC_CR_MX where MYID='''+Trim(maxno)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;}
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MYID').AsString:=Trim(maxno);
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
i:=1;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('MXID').AsString='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FMXID,'QM','CK_MYSC_CR_MX',5,1)=False then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FMXID:=Trim(FieldByName('MXID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(FMXID)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if IsEmpty then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
FieldByName('MXID').Value:=Trim(FMXID);
|
|||
|
|
FieldByName('JH').Value:=i;
|
|||
|
|
FieldByName('RCGangNo').Value:=ClientDataSet1.fieldbyname('RCGangNo1').Value;
|
|||
|
|
FieldByName('KuWei').Value:=ClientDataSet1.fieldbyname('KuWei').Value;
|
|||
|
|
FieldByName('MXGYLXName').Value:=ClientDataSet1.fieldbyname('MXGYLXName').Value;
|
|||
|
|
FieldByName('MXNote').Value:=ClientDataSet1.fieldbyname('MXNote').Value;
|
|||
|
|
FieldByName('KgQty').Value:=ClientDataSet1.fieldbyname('KgQty').Value;
|
|||
|
|
FieldByName('MQty').Value:=ClientDataSet1.fieldbyname('MQty').Value;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
i:=i+1;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_GangNo :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MXID').Value:=Trim(FMXID);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_Qty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
InitData();
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.TBSaveClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if Trim(MYName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(PTID.Text)='' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ɫ','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(FSaveFlag)<>'99' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
TBSave.Caption:='<27>ѱ<EFBFBD><D1B1><EFBFBD>';
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.ShuiXiSuoLvClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(TEdit(Sender).Text)='' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:='<27><>';
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.ShuiXiSuoLvJGMouseDown(Sender: TObject;
|
|||
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
if Trim(FRead)='' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).ReadOnly:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).ReadOnly:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.UnitMClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='';
|
|||
|
|
QtyLRM.Visible:=False;
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.UnitKgClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='<27><>';
|
|||
|
|
QtyLRKg.Visible:=True;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='';
|
|||
|
|
QtyLRKg.Visible:=False;
|
|||
|
|
BtnKg.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.BtnQXClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.MYNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(MYType.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
if BtnDel.Visible=False then Exit;
|
|||
|
|
Panel4.Visible:=True;
|
|||
|
|
RCGangNO1.Text:=ClientDataSet1.fieldbyname('RCGangNO1').AsString;
|
|||
|
|
MXGYLXName.Text:=ClientDataSet1.fieldbyname('MXGYLXName').AsString;
|
|||
|
|
MXKuWeI.Text:=ClientDataSet1.fieldbyname('KuWeI').AsString;
|
|||
|
|
Self.MXMYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Self.MXMYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
Self.MXMYMF.Text:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
Self.MXMYKZ.Text:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
Self.MXMYColor.Text:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
Self.MXMYColorNo.Text:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
Self.MXDYID.Text:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
Self.MXMLID.Text:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
Self.MXBPID.Text:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
Self.MXPTID.Text:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('KgQty').AsString)<>'' then
|
|||
|
|
KgQty1.Text:=ClientDataSet1.fieldbyname('KgQty').Value
|
|||
|
|
else
|
|||
|
|
KgQty1.Text:='';
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('MQty').AsString)<>'' then
|
|||
|
|
MQty1.Text:=ClientDataSet1.fieldbyname('MQty').Value
|
|||
|
|
else
|
|||
|
|
MQty1.Text:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(KgQty1.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(KgQty1.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Trim(MQty1.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(MQty1.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo1.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo1.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(MXGYLXName.Text);
|
|||
|
|
FieldByName('KuWeI').Value:=Trim(MXKuWeI.Text);
|
|||
|
|
if Trim(MQty1.Text)<>'' then
|
|||
|
|
FieldByName('MQty').Value:=Trim(MQty1.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('MQty').Value:=Null;
|
|||
|
|
if Trim(KgQty1.Text)<>'' then
|
|||
|
|
FieldByName('KgQty').Value:=Trim(KgQty1.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('KgQty').Value:=Null;
|
|||
|
|
FieldByName('Laster').Value:=Trim(DName);
|
|||
|
|
|
|||
|
|
fieldbyname('MXGYLXName').AsString:=MXGYLXName.Text;
|
|||
|
|
fieldbyname('KuWeI').AsString:=MXKuWeI.Text;
|
|||
|
|
fieldbyname('MYCode').AsString:=Trim(Self.MXMYCode.Text);
|
|||
|
|
fieldbyname('MYName').AsString:=Trim(Self.MXMYName.Text);
|
|||
|
|
fieldbyname('MYMF').AsString:=Trim(Self.MXMYMF.Text);
|
|||
|
|
fieldbyname('MYKZ').AsString:=Trim(Self.MXMYKZ.Text);
|
|||
|
|
fieldbyname('MYColor').AsString:=Trim(Self.MXMYColor.Text);
|
|||
|
|
fieldbyname('MYColorNo').AsString:=Trim(Self.MXMYColorNo.Text);
|
|||
|
|
fieldbyname('DYID').AsString:=Trim(Self.MXDYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MXMLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.MXBPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.MXPTID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Panel4.Visible:=False;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.BtnDelClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' insert into CK_MYSC_CR_MX_Log ');
|
|||
|
|
sql.Add(' select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX_Log Set DelTime=getdate(),DelerCode='''+Trim(DCode)+''',Deler='''+Trim(DName)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' Delete CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' Delete CK_MYSC_CR where MYID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
GetHZData();
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.v1Column7PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmQCRKJLList:=TfrmQCRKJLList.Create(Application);
|
|||
|
|
with frmQCRKJLList do
|
|||
|
|
begin
|
|||
|
|
FMXID:=Trim(Self.ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmQCRKJLList.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.BtnPrtClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile,Txt,fImagePath:string;
|
|||
|
|
i,j:Integer;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar:TMakebar;
|
|||
|
|
Mixtext:TMixtext;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('GangNo',null,[])=true then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox2.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD>ߴ<EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ97.rmf';
|
|||
|
|
end else
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ85.rmf';
|
|||
|
|
end;
|
|||
|
|
if FileExists(fPrintFile)=False then
|
|||
|
|
begin
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ97.rmf'),'<27><>ʾ',0);
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ85.rmf'),'<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' Exec P_PRT_QCRK_RSML :MXID');
|
|||
|
|
Parameters.ParamByName('MXID').Value:=Trim(ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp,CDS_Print);
|
|||
|
|
SInitCDSData20(ADOTemp,CDS_Print);
|
|||
|
|
try
|
|||
|
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
|
Txt:=Trim(ClientDataSet1.fieldbyname('MXID').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
|
|||
|
|
application.MessageBox('<27><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=False;
|
|||
|
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
//RM1.ShowReport;
|
|||
|
|
for i:=1 to StrToInt(ComboBox2.Text) do
|
|||
|
|
begin
|
|||
|
|
RM1.PrintReport;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ComboBox2.ItemIndex:=0;
|
|||
|
|
ComboBox1.ItemIndex:=-1;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.InitColor();
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from RT_PTColor where PTID='''+Trim(PTID.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
fsj:=Trim(ADOTemp.fieldbyname('ColDaiMa').AsString);
|
|||
|
|
if fsj<>'' then
|
|||
|
|
Panel6.Color:=StrToInt('$'+Trim(fsj));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Edit1KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
FDate:TDateTime;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('GangNo',Null,[])=True then
|
|||
|
|
begin
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
TBSave.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_View_RSML :DYID');
|
|||
|
|
Parameters.ParamByName('DYID').Value:=Trim(Edit1.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
MYCode.Text:=Trim(ADOTemp.fieldbyname('MLNo').AsString);
|
|||
|
|
MYCode.Hint:=Trim(ADOTemp.fieldbyname('MLNo').AsString);
|
|||
|
|
MYType.Text:=Trim(ADOTemp.fieldbyname('MLType').AsString);
|
|||
|
|
MYName.Text:=Trim(ADOTemp.fieldbyname('MLName').AsString);
|
|||
|
|
MYMF.Text:=Trim(ADOTemp.fieldbyname('MLMF').AsString);
|
|||
|
|
MYKZ.Text:=Trim(ADOTemp.fieldbyname('MLKZ').AsString);
|
|||
|
|
MYColor.Text:=Trim(ADOTemp.fieldbyname('ColNamekh').AsString);
|
|||
|
|
MYColorNo.Text:=Trim(ADOTemp.fieldbyname('ColNo').AsString);
|
|||
|
|
DYID.Text:=Trim(ADOTemp.fieldbyname('DYID').AsString);
|
|||
|
|
MLID.Text:=Trim(ADOTemp.fieldbyname('MLID').AsString);
|
|||
|
|
BPID.Text:=Trim(ADOTemp.fieldbyname('MBPID').AsString);
|
|||
|
|
PTID.Text:=Trim(ADOTemp.fieldbyname('PTID').AsString);
|
|||
|
|
labMYType.Caption:=Trim(ADOTemp.fieldbyname('MLType').AsString);
|
|||
|
|
if Trim(MYType.Text)='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MYType.TxtCode:='RS';
|
|||
|
|
end;
|
|||
|
|
if Trim(MYType.Text)='<27>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MYType.TxtCode:='TJ';
|
|||
|
|
end;
|
|||
|
|
Edit1.Text:='';
|
|||
|
|
FDate:=SGetServerDate(ADOTemp);
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set RCGangNo='''+Trim(RCGangNO1.Text)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNO1.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNO1.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
TBSave.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
GetHZData();
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.BtnMClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.BtnKgClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Panel6DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmRSColorBig:=TfrmRSColorBig.Create(Application);
|
|||
|
|
with frmRSColorBig do
|
|||
|
|
begin
|
|||
|
|
frmRSColorBig.Label1.Caption:=Self.MYColorNo.Text+'#';
|
|||
|
|
frmRSColorBig.Label2.Caption:=Self.MYColor.Text;
|
|||
|
|
frmRSColorBig.Color:=Self.Panel6.Color;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button2Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_CX:=TfrmMLMangeRS_CX.create(self);
|
|||
|
|
with frmMLMangeRS_CX do
|
|||
|
|
begin
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
if Self.ClientDataSet1.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
if Self.ClientDataSet1.Locate('GangNo',Null,[])=True then
|
|||
|
|
begin
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
TBSave.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if GetLSNo(ADOCmd,SXMaxno,'SX','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Self.MYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYCode.Hint:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYType.Text:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
Self.MYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.GYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
labMYType.Caption:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
if Trim(MYType.Text)='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MYType.TxtCode:='RS';
|
|||
|
|
end;
|
|||
|
|
Edit1.Text:='';
|
|||
|
|
FDate:=SGetServerDate(ADOTemp);
|
|||
|
|
{with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MLID='''+Trim(MLID.Text)+'''');
|
|||
|
|
sql.Add(' and BPID='''+Trim(BPID.Text)+'''');
|
|||
|
|
sql.Add(' and PTID='''+Trim(PTID.Text)+'''');
|
|||
|
|
sql.Add(' and CRTime='''+Trim(FormatDateTime('yyyy-MM-dd',FDate))+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FMainId:=Trim(ADOTemp.fieldbyname('MYID').AsString);
|
|||
|
|
InitMXData();}
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button4Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_GYCX:=TfrmMLMangeRS_GYCX.create(self);
|
|||
|
|
with frmMLMangeRS_GYCX do
|
|||
|
|
begin
|
|||
|
|
MLNo.Text:=Trim(MYCode.Text);
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.GYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.UnitMChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitM.Text='<27><>' then
|
|||
|
|
begin
|
|||
|
|
v1Column3.Visible:=true;
|
|||
|
|
Label18.Visible:=true;
|
|||
|
|
MXHZQty.Visible:=true;
|
|||
|
|
Label24.Visible:=true;
|
|||
|
|
MQty1.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1Column3.Visible:=false;
|
|||
|
|
Label18.Visible:=false;
|
|||
|
|
MXHZQty.Visible:=false;
|
|||
|
|
Label24.Visible:=false;
|
|||
|
|
MQty1.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.UnitKgChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitKG.Text='<27><>' then
|
|||
|
|
begin
|
|||
|
|
v1Column17.Visible:=true;
|
|||
|
|
label17.Visible:=true;
|
|||
|
|
MXHZKGQty.Visible:=true;
|
|||
|
|
Label23.Visible:=true;
|
|||
|
|
KgQty1.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1Column17.Visible:=false;
|
|||
|
|
label17.Visible:=false;
|
|||
|
|
MXHZKGQty.Visible:=false;
|
|||
|
|
Label23.Visible:=false;
|
|||
|
|
KgQty1.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.KuWeiKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' ');
|
|||
|
|
sql.Add(' and KWID='''+trim(KuWei.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
KuWei.Text:=Trim(ADOQuery1.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.MXKuWeIKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' ');
|
|||
|
|
sql.Add(' and KWID='''+trim(MXKuWeI.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
MXKuWeI.Text:=Trim(ADOQuery1.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button5Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_GYCX:=TfrmMLMangeRS_GYCX.create(self);
|
|||
|
|
with frmMLMangeRS_GYCX do
|
|||
|
|
begin
|
|||
|
|
MLNo.Text:=Trim(MYCode.Text);
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MXGYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmKuWeiList:=TfrmKuWeiList.Create(Self);
|
|||
|
|
with frmKuWeiList do
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible:=false;
|
|||
|
|
TBDel.Visible:=false;
|
|||
|
|
ToolButton4.Visible:=false;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
KuWei.Text:=Trim(Order_Main.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button8Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmKuWeiList:=TfrmKuWeiList.Create(Self);
|
|||
|
|
with frmKuWeiList do
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible:=false;
|
|||
|
|
TBDel.Visible:=false;
|
|||
|
|
ToolButton4.Visible:=false;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
MXKuWeI.Text:=Trim(Order_Main.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button11Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_CX:=TfrmMLMangeRS_CX.create(self);
|
|||
|
|
with frmMLMangeRS_CX do
|
|||
|
|
begin
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MXMYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MXMYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MXMYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MXMYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MXMYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MXMYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.MXDYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MXMLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.MXBPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.MXPTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.MXGYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
|
|||
|
|
Self.MYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYCode.Hint:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYType.Text:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
Self.MYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.GYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
InitColor();
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.MenuItem1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmRTPTColor:=TfrmRTPTColor.Create(Application);
|
|||
|
|
with frmRTPTColor do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.PTID.Text:=Trim(frmRTPTColor.FPTID);
|
|||
|
|
Self.MYColor.Text:=Trim(frmRTPTColor.FColNameKH);
|
|||
|
|
Self.MYColorNo.Text:=Trim(frmRTPTColor.FColName);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmRTPTColor.Free;
|
|||
|
|
end;
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button9Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR where MYID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MYID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR Set MYName='''+Trim(MXMYName.Text)+'''');
|
|||
|
|
sql.Add(' where MYID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('MYName').Value:=Trim(MXMYName.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Button10Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set KuWeI='''+Trim(MXKuWeI.Text)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('KuWeI').Value:=Trim(MXKuWeI.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut.Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
Self.MYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Self.MYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
Self.MLID.Text:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|