1745 lines
51 KiB
ObjectPascal
1745 lines
51 KiB
ObjectPascal
|
|
unit U_QCRKInPut_TJML;
|
|||
|
|
|
|||
|
|
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,ShellAPI,IniFiles,
|
|||
|
|
Menus, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmQCRKInPut_TJML = 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;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
LIUCeng: TEdit;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
MYKZ: TEdit;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
MYMF: TEdit;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
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;
|
|||
|
|
v1Liuceng: 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;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
MXDYID: TEdit;
|
|||
|
|
MXMLID: TEdit;
|
|||
|
|
MXBPID: TEdit;
|
|||
|
|
MXPTID: TEdit;
|
|||
|
|
Image2: TImage;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
TPID: TEdit;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
Panel16: TPanel;
|
|||
|
|
MYName: TEdit;
|
|||
|
|
MLCode: TEdit;
|
|||
|
|
MLName: TEdit;
|
|||
|
|
Image11: TImage;
|
|||
|
|
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 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 Button9Click(Sender: TObject);
|
|||
|
|
procedure Button10Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure Image2DblClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
lstPat:TStringList;
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure InitMXData();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure GetHZData();
|
|||
|
|
procedure InitColor();
|
|||
|
|
procedure ShowImage();
|
|||
|
|
procedure ReadINIFile10();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1,FileName:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
FRead:String;
|
|||
|
|
FSaveFlag:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmQCRKInPut_TJML: TfrmQCRKInPut_TJML;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel, U_GYSList,U_SCPerson,U_KuWeiList,U_MLMangeTJCX
|
|||
|
|
,U_QCRKJLList,U_RSColorBig,U_MLMangeRS_GYCX,U_MLMangeRS_CX,U_KuWeiKCList,U_RTPTColor;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.ShowImage();
|
|||
|
|
var
|
|||
|
|
jpg:TJpegImage;
|
|||
|
|
myStream: TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
with adoqueryPicture do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Image_Info A');
|
|||
|
|
sql.Add(' inner join Image_File B on A.IMID=B.IMID');
|
|||
|
|
sql.Add(' and A.WBID='''+Trim(TPID.Text)+'''');
|
|||
|
|
sql.Add(' and A.Valid=''Y'' ');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if adoqueryPicture.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
FileName:=Trim(adoqueryPicture.fieldbyname('ImagePath').AsString);
|
|||
|
|
jpg:=TJpegImage.Create();
|
|||
|
|
myStream:=tadoblobstream.Create(tblobfield(adoqueryPicture.fieldbyname('ImageFile')),bmread);
|
|||
|
|
jpg.LoadFromStream(myStream);
|
|||
|
|
Image11.Picture.Assign(jpg);
|
|||
|
|
Image11.Width:=adoqueryPicture.fieldbyname('ImageWidth').Value;
|
|||
|
|
Image11.Height:=adoqueryPicture.fieldbyname('ImageHeight').Value;
|
|||
|
|
if Trim(adoqueryPicture.fieldbyname('FangXiang').AsString)='<27><>ֱ' then
|
|||
|
|
begin
|
|||
|
|
Image11.Top:=1;
|
|||
|
|
Image11.Left:=Round((Panel6.Width-Image11.Width)/2);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Image11.Left:=1;
|
|||
|
|
Image11.Top:=Round((Panel6.Height-Image11.Height)/2);
|
|||
|
|
end;
|
|||
|
|
Image11.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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 PState=0 then
|
|||
|
|
begin
|
|||
|
|
CRTime.Date:=SGetServerDate(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
InitMXData();
|
|||
|
|
GetHZData();
|
|||
|
|
Edit1.SetFocus;
|
|||
|
|
if Trim(TPID.Text)<>'' then
|
|||
|
|
ShowImage();
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.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_TJML.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_TJML.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('MLCode').Value:=Trim(ClientDataSet1.fieldbyname('MLCode').AsString);
|
|||
|
|
FieldByName('MLName').Value:=Trim(ClientDataSet1.fieldbyname('MLName').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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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('LiuCeng').Value:=Trim(LiuCeng.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_TJML.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('LiuCeng').Value:=Trim(LiuCeng.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_TJML.BtnQXClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.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.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_TJML.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('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_TJML.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_TJML.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_TJML.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.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_TJML.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('select A.*,B.*,B.TJTPID TJ,MLDLNo SKID ');
|
|||
|
|
sql.Add(' from ML_Manage A ');
|
|||
|
|
sql.Add(' left join Image_Info B on B.TJML=A.TJML ');
|
|||
|
|
sql.Add(' left join BP_DY C on C.TFID=B.IMID and C.MLID=A.MLID');
|
|||
|
|
sql.Add(' left join BP_DY D on D.TFID=A.PTID and D.MLID=A.MLID');
|
|||
|
|
sql.Add(' where isnull(A.MLType,'''')=''<27>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(C.DYID,'''')='''+trim(edit1.Text)+'''');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
MYCode.Text:=Trim(ADOTemp.fieldbyname('TJHX').AsString);
|
|||
|
|
MYCode.Hint:=Trim(ADOTemp.fieldbyname('TJHX').AsString);
|
|||
|
|
MYType.Text:=Trim(ADOTemp.fieldbyname('MLType').AsString);
|
|||
|
|
MYName.Text:=Trim(ADOTemp.fieldbyname('MLName').AsString);
|
|||
|
|
MLCode.Text:=Trim(ADOTemp.fieldbyname('MLXXNO').AsString);
|
|||
|
|
MLName.Text:=Trim(ADOTemp.fieldbyname('MLXXName').AsString);
|
|||
|
|
MYMF.Text:=Trim(ADOTemp.fieldbyname('MLMF').AsString);
|
|||
|
|
MYKZ.Text:=Trim(ADOTemp.fieldbyname('MLKZ').AsString);
|
|||
|
|
LIUCeng.Text:=Trim(ADOTemp.fieldbyname('HXType').AsString);
|
|||
|
|
DYID.Text:=Trim(edit1.Text);
|
|||
|
|
MLID.Text:=Trim(ADOTemp.fieldbyname('MLID').AsString);
|
|||
|
|
BPID.Text:=Trim(ADOTemp.fieldbyname('MBPID').AsString);
|
|||
|
|
//PTID.Text:=Trim(ADOTemp.fieldbyname('PTID').AsString);
|
|||
|
|
TPID.Text:=Trim(ADOTemp.fieldbyname('TJ').AsString);
|
|||
|
|
GYLXName.Text:=Trim(ADOTemp.fieldbyname('TJGYName').AsString);
|
|||
|
|
labMYType.Caption:=Trim(ADOTemp.fieldbyname('MLType').AsString);
|
|||
|
|
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;
|
|||
|
|
if PTID.Text<>'' then
|
|||
|
|
InitColor();
|
|||
|
|
if TPID.Text<>'' then
|
|||
|
|
ShowImage();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.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('LiuCeng').Value:=Trim(LiuCeng.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_TJML.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('LiuCeng').Value:=Trim(LiuCeng.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_TJML.Button3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.Button2Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeTJCX:=TfrmMLMangeTJCX.create(self);
|
|||
|
|
with frmMLMangeTJCX 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,'SCTJ','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(FFTJHX);
|
|||
|
|
Self.MYCode.Hint:=Trim(FFTJHX);
|
|||
|
|
Self.MLCode.Text:=Trim(CDS_Main.fieldbyname('MLXXNO').AsString);
|
|||
|
|
Self.MLName.Text:=Trim(CDS_Main.fieldbyname('MLXXName').AsString);
|
|||
|
|
Self.LIUCeng.Text:=Trim(CDS_Main.fieldbyname('HXType').AsString);
|
|||
|
|
Self.MYType.Text:='<27>̽<EFBFBD><CCBD><EFBFBD><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.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('TJGYName').AsString);
|
|||
|
|
Self.TPID.Text:=Trim(FTJTPID);
|
|||
|
|
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;
|
|||
|
|
if TPID.Text<>'' then
|
|||
|
|
ShowImage();
|
|||
|
|
if PTID.Text<>'' then
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.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_TJML.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.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.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.LIUCeng.Text:=Trim(CDS_Main.fieldbyname('LIUCeng').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_TJML.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_TJML.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_TJML.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.Liuceng.Text:=Trim(ClientDataSet1.fieldbyname('Liuceng').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;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
lstPat := TStringList.Create;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.ReadINIFile10();
|
|||
|
|
var
|
|||
|
|
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
|
FileName5:string;
|
|||
|
|
begin
|
|||
|
|
FileName5:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
|||
|
|
programIni:=Tinifile.create(FileName5);
|
|||
|
|
server:=programIni.ReadString('SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
programIni.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_TJML.Image2DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
FPath,FFName:string;
|
|||
|
|
FInt:integer;
|
|||
|
|
maxno:string;
|
|||
|
|
j,i:Integer;
|
|||
|
|
fPrintFile,fFileName:string;
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ԭͼ<D4AD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ȴ<EFBFBD>ʱ<EFBFBD>䣬ȷ<E4A3AC><C8B7>Ҫ<EFBFBD>鿴ԭͼ<D4AD><CDBC><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ReadINIFile10();
|
|||
|
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
IdFTP1:=TIdFTP.Create(self);
|
|||
|
|
IdFTP1.Host :=server;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
IdFTP1.Free;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel16.Visible:=true;
|
|||
|
|
Panel16.Refresh;
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName)+'Photo\';
|
|||
|
|
if not DirectoryExists(ExtractFileDir(FPrintFile)) then
|
|||
|
|
CreateDir(ExtractFileDir(fPrintFile));
|
|||
|
|
FFName:=Trim(FileName);
|
|||
|
|
FFName:=fPrintFile+FFName+'.jpg';
|
|||
|
|
if not FileExists(FFName) then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Get('TJ\'+FileName,FFName);
|
|||
|
|
end;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
IdFTP1.Free;
|
|||
|
|
end;
|
|||
|
|
Panel16.Visible:=false;
|
|||
|
|
ShellExecute(Handle, 'open',PChar(FFName),'', '', SW_SHOWNORMAL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|