2032 lines
53 KiB
ObjectPascal
2032 lines
53 KiB
ObjectPascal
![]() |
unit U_SDRKInspection;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
|||
|
Forms, Dialogs, StdCtrls, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
cxDataStorage, cxEdit, DB, cxDBData, cxCalendar, cxGridLevel,
|
|||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
|||
|
cxControls, cxGridCustomView, cxGrid, RM_Common, RM_Class, RM_GridReport,
|
|||
|
RM_System, RM_Dataset, ADODB, DBClient, cxGridCustomPopupMenu, cxGridPopupMenu,
|
|||
|
ExtCtrls, ComCtrls, ToolWin, cxTextEdit, Buttons, cxSplitter, cxCheckBox,
|
|||
|
MovePanel, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, Menus,
|
|||
|
U_BaseList, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
|
|||
|
dxBarBuiltInMenu, cxContainer, cxImage, cxDBEdit, IdBaseComponent, IdComponent,
|
|||
|
IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase, ShellAPI, IdFTP,
|
|||
|
FireDAC.Stan.StorageXML;
|
|||
|
|
|||
|
type
|
|||
|
TfrmSDRKInspection = class(TfrmBaseList)
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
DataSource1: TDataSource;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOCmd: TADOQuery;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
RM2: TRMGridReport;
|
|||
|
cxGrid3: TcxGrid;
|
|||
|
Tv3: TcxGridDBTableView;
|
|||
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
cxGridLevel2: TcxGridLevel;
|
|||
|
DS_2: TDataSource;
|
|||
|
CDS_MJCD: TClientDataSet;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
ADOQueryMainDSC: TADOQuery;
|
|||
|
Panel2: TPanel;
|
|||
|
Label9: TLabel;
|
|||
|
JYLen: TEdit;
|
|||
|
Label4: TLabel;
|
|||
|
JYGW: TEdit;
|
|||
|
Label5: TLabel;
|
|||
|
Label11: TLabel;
|
|||
|
BTPrint: TButton;
|
|||
|
Button5: TButton;
|
|||
|
Edit3: TEdit;
|
|||
|
Label10: TLabel;
|
|||
|
Edit4: TEdit;
|
|||
|
Label12: TLabel;
|
|||
|
Panel3: TPanel;
|
|||
|
SpeedButton1: TSpeedButton;
|
|||
|
SpeedButton2: TSpeedButton;
|
|||
|
SpeedButton3: TSpeedButton;
|
|||
|
SpeedButton4: TSpeedButton;
|
|||
|
SpeedButton5: TSpeedButton;
|
|||
|
SpeedButton6: TSpeedButton;
|
|||
|
SpeedButton7: TSpeedButton;
|
|||
|
SpeedButton8: TSpeedButton;
|
|||
|
SpeedButton9: TSpeedButton;
|
|||
|
SpeedButton10: TSpeedButton;
|
|||
|
SpeedButton11: TSpeedButton;
|
|||
|
SpeedButton12: TSpeedButton;
|
|||
|
SpeedButton49: TSpeedButton;
|
|||
|
v3Column1: TcxGridDBColumn;
|
|||
|
v3Column2: TcxGridDBColumn;
|
|||
|
v3Column3: TcxGridDBColumn;
|
|||
|
Label26: TLabel;
|
|||
|
Edit6: TEdit;
|
|||
|
Label30: TLabel;
|
|||
|
JYTare: TEdit;
|
|||
|
Label31: TLabel;
|
|||
|
Label32: TLabel;
|
|||
|
JYNW: TEdit;
|
|||
|
MovePanel1: TMovePanel;
|
|||
|
Label17: TLabel;
|
|||
|
Label18: TLabel;
|
|||
|
Label20: TLabel;
|
|||
|
Label21: TLabel;
|
|||
|
Label7: TLabel;
|
|||
|
Label8: TLabel;
|
|||
|
Edit1: TEdit;
|
|||
|
Button1: TButton;
|
|||
|
Button4: TButton;
|
|||
|
Edit2: TEdit;
|
|||
|
CDQty: TEdit;
|
|||
|
RadioGroup1: TRadioGroup;
|
|||
|
Button2: TButton;
|
|||
|
Panel7: TPanel;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv2: TcxGridDBTableView;
|
|||
|
tv2CDType: TcxGridDBColumn;
|
|||
|
tv2CDWZ: TcxGridDBColumn;
|
|||
|
v2Column2: TcxGridDBColumn;
|
|||
|
Tv2CDQty: TcxGridDBColumn;
|
|||
|
Tv2CDReason: TcxGridDBColumn;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
v2Column3: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
Panel8: TPanel;
|
|||
|
AOrdDefNote1: TRichEdit;
|
|||
|
Label34: TLabel;
|
|||
|
ComboBox1: TComboBox;
|
|||
|
v3Column4: TcxGridDBColumn;
|
|||
|
Label36: TLabel;
|
|||
|
Label37: TLabel;
|
|||
|
v3Column5: TcxGridDBColumn;
|
|||
|
Label38: TLabel;
|
|||
|
RM3: TRMGridReport;
|
|||
|
JYXH: TEdit;
|
|||
|
JYXs: TEdit;
|
|||
|
Panel5: TPanel;
|
|||
|
Panel6: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
Label35: TLabel;
|
|||
|
Label39: TLabel;
|
|||
|
APID: TEdit;
|
|||
|
edtChen: TEdit;
|
|||
|
Edit8: TEdit;
|
|||
|
ToolBar1: TToolBar;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
TBCD: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
v3Column6: TcxGridDBColumn;
|
|||
|
edtYJ: TEdit;
|
|||
|
Label2: TLabel;
|
|||
|
v2Column4: TcxGridDBColumn;
|
|||
|
ADOTmp: TADOQuery;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
Button3: TButton;
|
|||
|
JYPerson: TEdit;
|
|||
|
Label15: TLabel;
|
|||
|
Label16: TLabel;
|
|||
|
edtMaBiao: TEdit;
|
|||
|
lblbq: TLabel;
|
|||
|
Button6: TButton;
|
|||
|
Label19: TLabel;
|
|||
|
KuangHao: TEdit;
|
|||
|
v3Column7: TcxGridDBColumn;
|
|||
|
v3Column8: TcxGridDBColumn;
|
|||
|
ToolButton4: TToolButton;
|
|||
|
Button7: TButton;
|
|||
|
ScrollBox1: TScrollBox;
|
|||
|
SpeedButton13: TSpeedButton;
|
|||
|
SpeedButton14: TSpeedButton;
|
|||
|
SpeedButton15: TSpeedButton;
|
|||
|
SpeedButton16: TSpeedButton;
|
|||
|
SpeedButton17: TSpeedButton;
|
|||
|
SpeedButton18: TSpeedButton;
|
|||
|
SpeedButton21: TSpeedButton;
|
|||
|
SpeedButton22: TSpeedButton;
|
|||
|
SpeedButton23: TSpeedButton;
|
|||
|
SpeedButton24: TSpeedButton;
|
|||
|
SpeedButton25: TSpeedButton;
|
|||
|
SpeedButton26: TSpeedButton;
|
|||
|
SpeedButton29: TSpeedButton;
|
|||
|
SpeedButton30: TSpeedButton;
|
|||
|
SpeedButton31: TSpeedButton;
|
|||
|
SpeedButton32: TSpeedButton;
|
|||
|
SpeedButton33: TSpeedButton;
|
|||
|
SpeedButton34: TSpeedButton;
|
|||
|
SpeedButton37: TSpeedButton;
|
|||
|
SpeedButton38: TSpeedButton;
|
|||
|
SpeedButton39: TSpeedButton;
|
|||
|
SpeedButton40: TSpeedButton;
|
|||
|
SpeedButton41: TSpeedButton;
|
|||
|
SpeedButton42: TSpeedButton;
|
|||
|
SpeedButton45: TSpeedButton;
|
|||
|
SpeedButton46: TSpeedButton;
|
|||
|
SpeedButton47: TSpeedButton;
|
|||
|
SpeedButton48: TSpeedButton;
|
|||
|
SpeedButton50: TSpeedButton;
|
|||
|
SpeedButton51: TSpeedButton;
|
|||
|
SpeedButton54: TSpeedButton;
|
|||
|
SpeedButton55: TSpeedButton;
|
|||
|
SpeedButton56: TSpeedButton;
|
|||
|
SpeedButton57: TSpeedButton;
|
|||
|
SpeedButton58: TSpeedButton;
|
|||
|
SpeedButton59: TSpeedButton;
|
|||
|
SpeedButton62: TSpeedButton;
|
|||
|
SpeedButton63: TSpeedButton;
|
|||
|
SpeedButton64: TSpeedButton;
|
|||
|
SpeedButton65: TSpeedButton;
|
|||
|
SpeedButton66: TSpeedButton;
|
|||
|
SpeedButton67: TSpeedButton;
|
|||
|
SpeedButton70: TSpeedButton;
|
|||
|
SpeedButton71: TSpeedButton;
|
|||
|
SpeedButton72: TSpeedButton;
|
|||
|
SpeedButton73: TSpeedButton;
|
|||
|
SpeedButton74: TSpeedButton;
|
|||
|
SpeedButton75: TSpeedButton;
|
|||
|
SpeedButton19: TSpeedButton;
|
|||
|
SpeedButton20: TSpeedButton;
|
|||
|
SpeedButton27: TSpeedButton;
|
|||
|
SpeedButton28: TSpeedButton;
|
|||
|
SpeedButton35: TSpeedButton;
|
|||
|
SpeedButton36: TSpeedButton;
|
|||
|
SpeedButton43: TSpeedButton;
|
|||
|
SpeedButton44: TSpeedButton;
|
|||
|
SpeedButton52: TSpeedButton;
|
|||
|
SpeedButton53: TSpeedButton;
|
|||
|
SpeedButton60: TSpeedButton;
|
|||
|
SpeedButton61: TSpeedButton;
|
|||
|
SpeedButton68: TSpeedButton;
|
|||
|
SpeedButton69: TSpeedButton;
|
|||
|
SpeedButton76: TSpeedButton;
|
|||
|
SpeedButton77: TSpeedButton;
|
|||
|
SpeedButton78: TSpeedButton;
|
|||
|
SpeedButton79: TSpeedButton;
|
|||
|
SpeedButton80: TSpeedButton;
|
|||
|
SpeedButton81: TSpeedButton;
|
|||
|
SpeedButton82: TSpeedButton;
|
|||
|
SpeedButton83: TSpeedButton;
|
|||
|
Order_MJ: TClientDataSet;
|
|||
|
CDS_3: TClientDataSet;
|
|||
|
DS_3: TDataSource;
|
|||
|
ADOQueryImage: TADOQuery;
|
|||
|
DataSource2: TDataSource;
|
|||
|
Panel1: TPanel;
|
|||
|
Pic_Image1: TcxDBImage;
|
|||
|
IdFTP1: TIdFTP;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
ToolButton5: TToolButton;
|
|||
|
Edit5: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
GangNo: TComboBox;
|
|||
|
Label6: TLabel;
|
|||
|
Edit7: TEdit;
|
|||
|
Button8: TButton;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure TBCDClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure BTPrintClick(Sender: TObject);
|
|||
|
procedure SpeedButton1Click(Sender: TObject);
|
|||
|
procedure SpeedButton12Click(Sender: TObject);
|
|||
|
procedure SpeedButton13Click(Sender: TObject);
|
|||
|
procedure cxGridDBColumn2PropertiesChange(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure Button5Click(Sender: TObject);
|
|||
|
procedure SpeedButton49Click(Sender: TObject);
|
|||
|
procedure APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure Edit1Click(Sender: TObject);
|
|||
|
procedure Edit2Change(Sender: TObject);
|
|||
|
procedure Edit3Click(Sender: TObject);
|
|||
|
procedure Edit4Click(Sender: TObject);
|
|||
|
procedure Edit6Click(Sender: TObject);
|
|||
|
procedure MJstr3KeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure JYNWExit(Sender: TObject);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure JYGWChange(Sender: TObject);
|
|||
|
procedure APIDClick(Sender: TObject);
|
|||
|
procedure JYNWKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
procedure Edit8Click(Sender: TObject);
|
|||
|
procedure JYLenChange(Sender: TObject);
|
|||
|
procedure Button4Click(Sender: TObject);
|
|||
|
procedure edtYJClick(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure Button3Click(Sender: TObject);
|
|||
|
procedure edtChenClick(Sender: TObject);
|
|||
|
procedure Button6Click(Sender: TObject);
|
|||
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
procedure Button7Click(Sender: TObject);
|
|||
|
procedure Pic_Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
procedure Pic_Image1DblClick(Sender: TObject);
|
|||
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure Edit7Click(Sender: TObject);
|
|||
|
procedure Button8Click(Sender: TObject);
|
|||
|
private
|
|||
|
{ Private declarations }
|
|||
|
FFFJYID, FOperationStatus, FCDName, FYXJL, FJHGZ, FClothDegree: string;
|
|||
|
FAPID, FOrderNo, FMainId, FSubId, FTPId, FConNo, FConMainId, FConSubId: string;
|
|||
|
FP_Code, FP_CodeName, FP_Spec, FP_Color, FP_ColorNo, FP_KuanNo, FP_MF, FP_KZ, FP_HX, FP_KHHX, FP_TPColorNo: string;
|
|||
|
FRCGangNo, FGangNo: string;
|
|||
|
isCommopen, IsJsMessage: boolean;
|
|||
|
fxsType, fRollType: string;
|
|||
|
procedure InitCDPanel(); //ˢ<>´õ<C2B4>ѡ<EFBFBD><D1A1>
|
|||
|
procedure InitCDGrid(); //ˢ<>´õ<C2B4><C3B5><EFBFBD>Ϣ
|
|||
|
procedure InitJYGrid(); //ˢ<>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
function CheckData(CKType: string): Boolean; //У<><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
function SaveData(): Boolean; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
procedure InitLCK(); //ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD>
|
|||
|
procedure InitDDB(); //ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
procedure ClearGlobal(); //<2F><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>ID
|
|||
|
procedure PrintCKMDG(MRKOrdID: string); //<2F><>ӡ<EFBFBD><D3A1><EFBFBD>ⵥ
|
|||
|
procedure PrtData(FJYID: string); //<2F><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>ǩ
|
|||
|
procedure QuantityConversion(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
procedure InitImage(YFTPName: string);
|
|||
|
procedure LookImage(FileName: string);
|
|||
|
procedure OpenCom(DllName: string);
|
|||
|
procedure CloseCom(DllName: string);
|
|||
|
procedure On1201(var Message: Tmessage); message 1201;
|
|||
|
procedure On1301(var Message: Tmessage); message 1301;
|
|||
|
public
|
|||
|
fmanage: string;
|
|||
|
fFlileFlag: string;
|
|||
|
FXIUGAI: string;
|
|||
|
{ Public declarations }
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmSDRKInspection: TfrmSDRKInspection;
|
|||
|
newh, newh1: hwnd;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_RTFun, U_ZDYHelp, U_iniParam, U_ProductOrderListSel, U_JYG,
|
|||
|
U_ZdyMapSel, U_DJBCKOutListSEL;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmSDRKInspection.InitImage(YFTPName: string);
|
|||
|
begin
|
|||
|
with ADOQueryImage do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from TP_File A');
|
|||
|
sql.Add('where isnull(WBID,'''')<>'''' and WBID=' + quotedstr(YFTPName));
|
|||
|
// showmessage(sql.text);
|
|||
|
open;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.QuantityConversion();
|
|||
|
var
|
|||
|
MLen, MNWet, MGWet, MPWet, MCC, FYJZQty: Double;
|
|||
|
begin
|
|||
|
MLen := StrToFloatdef(trim(JYLen.Text), 0);
|
|||
|
MNWet := StrToFloatdef(trim(JYNW.Text), 0);
|
|||
|
MPWet := StrToFloatdef(trim(JYTare.Text), 0);
|
|||
|
MGWet := StrToFloatdef(trim(JYGW.Text), 0);
|
|||
|
MCC := StrToFloatdef(trim(JYXs.Text), 0);
|
|||
|
|
|||
|
//<2F><><EFBFBD><EFBFBD> <20><> <20><>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD>
|
|||
|
if TV2.DataController.Summary.FooterSummaryValues[2] <> NULL then
|
|||
|
begin
|
|||
|
FYJZQty := StrToFloatdef(TV2.DataController.Summary.FooterSummaryValues[2], 0);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FYJZQty := 0;
|
|||
|
end;
|
|||
|
{ // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if MCC > 0 then
|
|||
|
begin
|
|||
|
MGWet := StrToFloat(format('%.1f', [(MLen - FYJZQty) * MCC]));
|
|||
|
MNWet := MGWet - MPWet;
|
|||
|
JYGW.Text := FloatToStr(MGWet);
|
|||
|
JYNW.Text := FloatToStr(MNWet);
|
|||
|
end; }
|
|||
|
|
|||
|
MNWet := MGWet - MPWet;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if MCC > 0 then
|
|||
|
begin
|
|||
|
// MLen := RoundFloat(MNWet * MCC, StrToIntDef(edit5.Text, 1));
|
|||
|
// JYLen.Text := FloatToStr(MLen);
|
|||
|
|
|||
|
if Edit5.Text = '0' then
|
|||
|
begin
|
|||
|
JYLen.Text := FloatToStr(trunc(MNWet * MCC));
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
MLen := RoundFloat(MNWet * MCC, StrToIntDef(edit5.Text, 1));
|
|||
|
JYLen.Text := FloatToStr(MLen);
|
|||
|
end;
|
|||
|
end;
|
|||
|
JYNW.Text := FloatToStr(MNWet);
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmSDRKInspection.CheckData(CKType: string): Boolean;
|
|||
|
var
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
try
|
|||
|
if Trim(FAPID) = '' then
|
|||
|
raise Exception.Create('<27><>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>');
|
|||
|
// if Trim(FMainId) = '' then
|
|||
|
// raise Exception.Create('<27><>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>');
|
|||
|
// if Trim(FSubId) = '' then
|
|||
|
// raise Exception.Create('<27><>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>');
|
|||
|
|
|||
|
if Trim(CKType) = '<27>ύ' then
|
|||
|
begin
|
|||
|
// if Trim(KuangHao.Text) = '' then
|
|||
|
// raise Exception.Create('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|||
|
// if Trim(JYPerson.Text) = '' then
|
|||
|
// raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鲼<EFBFBD><E9B2BC><EFBFBD><EFBFBD>');
|
|||
|
|
|||
|
if trim(Label9.Caption) = '' then
|
|||
|
raise Exception.Create('<27><><EFBFBD>ȵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
|
|||
|
if Trim(JYGW.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(JYGW.Text, mvalue) = False then
|
|||
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
|
|||
|
if strtofloatdef(trim(JYGW.Text), 0) > 80 then
|
|||
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>80!');
|
|||
|
end;
|
|||
|
|
|||
|
if strtofloatdef(trim(JYNW.Text), 0) < 0.00 then
|
|||
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>0!');
|
|||
|
|
|||
|
if strtofloatdef(trim(JYLen.Text), 0) < 0.00 then
|
|||
|
raise Exception.Create('<27><><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD>С<EFBFBD><D0A1>0!');
|
|||
|
|
|||
|
if Trim(JYLen.Text) <> '' then
|
|||
|
begin
|
|||
|
if strtofloatdef(trim(JYLen.Text), 0) > 400 then
|
|||
|
raise Exception.Create('<27><><EFBFBD>Ȳ<EFBFBD><C8B2>ܴ<EFBFBD><DCB4><EFBFBD>400!');
|
|||
|
end;
|
|||
|
|
|||
|
if (strtofloatdef(trim(JYLen.Text), 0) = 0) and (strtofloatdef(trim(JYNW.Text), 0) = 0) then
|
|||
|
raise Exception.Create('<27><><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD>Ϊ0!!');
|
|||
|
|
|||
|
end;
|
|||
|
Result := True;
|
|||
|
except
|
|||
|
Result := false;
|
|||
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ClearGlobal();
|
|||
|
begin
|
|||
|
FAPID := '';
|
|||
|
FJHGZ := '';
|
|||
|
FOrderNo := '';
|
|||
|
FConNo := '';
|
|||
|
FConMainId := '';
|
|||
|
FConSubId := '';
|
|||
|
FMainId := '';
|
|||
|
FSubId := '';
|
|||
|
FTPId := '';
|
|||
|
FP_KHHX := '';
|
|||
|
FP_TPColorNo := '';
|
|||
|
FRCGangNo := '';
|
|||
|
FGangNo := '';
|
|||
|
FP_Code := '';
|
|||
|
FP_CodeName := '';
|
|||
|
FP_Spec := '';
|
|||
|
FP_Color := '';
|
|||
|
FP_ColorNo := '';
|
|||
|
FP_KuanNo := '';
|
|||
|
FP_MF := '';
|
|||
|
FP_KZ := '';
|
|||
|
FP_HX := '';
|
|||
|
FFFJYID := '';
|
|||
|
FClothDegree := '';
|
|||
|
JYXH.Text := '';
|
|||
|
GangNo.Text := '';
|
|||
|
|
|||
|
JYXS.Text := '';
|
|||
|
AOrdDefNote1.Text := '';
|
|||
|
JYTare.Text := '';
|
|||
|
JYNW.Text := '';
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Pic_Image1DblClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if TcxDBImage(Sender).Picture.Height = 0 then
|
|||
|
exit;
|
|||
|
LookImage(ADOQueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.LookImage(FileName: string);
|
|||
|
var
|
|||
|
sFieldName: string;
|
|||
|
begin
|
|||
|
|
|||
|
sFieldName := leftbstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ<CDBC>鿴';
|
|||
|
|
|||
|
if not DirectoryExists(pchar(sFieldName)) then
|
|||
|
CreateDirectory(pchar(sFieldName), nil);
|
|||
|
|
|||
|
sFieldName := sFieldName + '\' + trim(FileName);
|
|||
|
|
|||
|
try
|
|||
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
|||
|
IdFTP1.Username := 'three';
|
|||
|
IdFTP1.Password := '641010';
|
|||
|
IdFTP1.Connect();
|
|||
|
except
|
|||
|
;
|
|||
|
end;
|
|||
|
|
|||
|
if IdFTP1.Connected then
|
|||
|
begin
|
|||
|
try
|
|||
|
IdFTP1.Get(fFlileFlag + '\' + Trim(FileName), sFieldName, true, false);
|
|||
|
except
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
IdFTP1.Quit;
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
IdFTP1.Quit;
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if IdFTP1.Connected then
|
|||
|
IdFTP1.Quit;
|
|||
|
ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Pic_Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
begin
|
|||
|
ReleaseCapture;
|
|||
|
SendMessage(Panel1.Handle, wm_SysCommand, $F012, 0);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.PrintCKMDG(MRKOrdID: string);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
Txt, fImagePath: string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar: TMakebar;
|
|||
|
Mixtext: TMixtext;
|
|||
|
begin
|
|||
|
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' exec P_Print_RKMDGangNo ');
|
|||
|
SQL.Add(' @RKOrdID=''' + Trim(MRKOrdID) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
try
|
|||
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
Txt := Trim(ADOQueryPrint.fieldbyname('RKOrdID').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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
ExportFtErpFile('<27>鲼<EFBFBD><E9B2BC><EFBFBD>ֿ<EFBFBD><D6BF>뵥.rmf', ADOTmp);
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C>鲼<EFBFBD><E9B2BC><EFBFBD>ֿ<EFBFBD><D6BF>뵥.rmf';
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
Rm2.DefaultCopies := 1;
|
|||
|
RM2.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.InitDDB();
|
|||
|
begin
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR where JYID=''' + Trim(APID.Text) + ''' and CRFlag=''<27><><EFBFBD><EFBFBD>''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty = False then
|
|||
|
begin
|
|||
|
APID.Text := '';
|
|||
|
Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.*,C.*,D.JYID,D.JYXH,D.JYXS,D.JYGW,D.JYTare,D. JYNW,D.JYLen ');
|
|||
|
sql.Add('from CK_SXPB_CR A');
|
|||
|
sql.Add('inner join JYOrder_Main B on A.ORDMainIdCK=B.MainId');
|
|||
|
sql.Add('inner join JYOrder_Sub C on A.ORDSubIdCK=C.SubId');
|
|||
|
sql.Add('inner join JY_Cloth D on D.APID=A.SPID');
|
|||
|
sql.Add('where JYType=''<27><><EFBFBD><EFBFBD>'' and JYID=''' + Trim(APID.Text) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
ClearGlobal();
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>״̬<D7B4><EFBFBD><DEB7><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>飡', '<27><>ʾ', 0);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FAPID := Trim(ADOTmp.fieldbyname('SPID').AsString);
|
|||
|
FMainId := Trim(ADOTmp.fieldbyname('ORDMainIdRK').AsString);
|
|||
|
FSubId := Trim(ADOTmp.fieldbyname('ORDSubIdRK').AsString);
|
|||
|
FFFJYID := Trim(ADOTmp.fieldbyname('JYID').AsString);
|
|||
|
FClothDegree := Trim(ADOTmp.fieldbyname('ClothDegree').AsString);
|
|||
|
JYXH.Text := Trim(ADOTmp.fieldbyname('JYXH').AsString);
|
|||
|
GangNo.Text := Trim(ADOTmp.fieldbyname('rcgangNo').AsString);
|
|||
|
JYXS.Text := Trim(ADOTmp.fieldbyname('Xs').AsString);
|
|||
|
AOrdDefNote1.Text := '<27>ƻ<EFBFBD><C6BB><EFBFBD>:' + Trim(ADOTmp.fieldbyname('OrderNo').AsString) + #13 + 'Ʒ<><C6B7>:' + Trim(ADOTmp.fieldbyname('MPRTCodeName').AsString) + #13 + '<27><>ɫ:' + trim(ADOTmp.fieldbyname('PRTColor').AsString) + #13 + '<27><>װҪ<D7B0><D2AA>:' + Trim(ADOTmp.fieldbyname('MPRTBZNote').AsString) + #13 + '<27>ŷ<EFBFBD>:' + Trim(ADOTmp.fieldbyname('MPRTMF').AsString) + #13 + '<27><><EFBFBD><EFBFBD>:' + Trim(ADOTmp.fieldbyname('MPRTKZ').AsString) + #13 + '<27>ر<EFBFBD><D8B1><EFBFBD>ʾ:' + Trim(ADOTmp.fieldbyname('Note').AsString);
|
|||
|
// JYTare.Text := Trim(ADOTmp.fieldbyname('PiZhong').AsString);
|
|||
|
JYXS.Text := Trim(ADOTmp.fieldbyname('JYXS').AsString);
|
|||
|
JYGW.Text := Trim(ADOTmp.fieldbyname('JYGW').AsString);
|
|||
|
JYTare.Text := Trim(ADOTmp.fieldbyname('JYTare').AsString);
|
|||
|
JYNW.Text := Trim(ADOTmp.fieldbyname('JYNW').AsString);
|
|||
|
JYLen.Text := Trim(ADOTmp.fieldbyname('JYLen').AsString);
|
|||
|
if Trim(ADOTmp.fieldbyname('OrderUnit').AsString) <> '' then
|
|||
|
begin
|
|||
|
|
|||
|
Label20.Caption := Label9.Caption;
|
|||
|
Label7.Caption := Label9.Caption;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD>ţ<EFBFBD>' + trim(APID.Text))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
InitJYGrid();
|
|||
|
InitCDGrid();
|
|||
|
APID.Text := '';
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.InitLCK();
|
|||
|
begin
|
|||
|
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('EXEC P_JY_Get_LCK @SPID=''' + Trim(APID.Text) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty = False then
|
|||
|
begin
|
|||
|
InitImage(Trim(ADOTmp.fieldbyname('YFTPName').AsString));
|
|||
|
FAPID := Trim(APID.Text);
|
|||
|
FConMainId := Trim(ADOTmp.fieldbyname('CKConMainId').AsString);
|
|||
|
FConSubId := Trim(ADOTmp.fieldbyname('CKConSubId').AsString);
|
|||
|
FConNo := Trim(ADOTmp.fieldbyname('CKConNo').AsString);
|
|||
|
|
|||
|
if Trim(ADOTmp.fieldbyname('ORDMainIdCK').AsString) = '' then
|
|||
|
begin
|
|||
|
FOrderNo := Trim(ADOTmp.fieldbyname('QCOrderNo').AsString);
|
|||
|
FMainId := Trim(ADOTmp.fieldbyname('ORDMainIdRK').AsString);
|
|||
|
FSubId := Trim(ADOTmp.fieldbyname('ORDSubIdRK').AsString);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FOrderNo := Trim(ADOTmp.fieldbyname('CKOrderNo').AsString);
|
|||
|
FMainId := Trim(ADOTmp.fieldbyname('ORDMainIdCK').AsString);
|
|||
|
FSubId := Trim(ADOTmp.fieldbyname('ORDSubIdCK').AsString);
|
|||
|
end;
|
|||
|
|
|||
|
FTPId := Trim(ADOTmp.fieldbyname('TPId').AsString);
|
|||
|
FP_KHHX := Trim(ADOTmp.fieldbyname('sphx').AsString);
|
|||
|
FP_TPColorNo := Trim(ADOTmp.fieldbyname('TPColorNo').AsString);
|
|||
|
FClothDegree := Trim(ADOTmp.fieldbyname('ClothDegree').AsString);
|
|||
|
FP_Code := Trim(ADOTmp.fieldbyname('SPCode').AsString);
|
|||
|
FP_CodeName := Trim(ADOTmp.fieldbyname('SPName').AsString);
|
|||
|
FP_Spec := Trim(ADOTmp.fieldbyname('SPSpec').AsString);
|
|||
|
FP_Color := Trim(ADOTmp.fieldbyname('SPColor').AsString);
|
|||
|
FP_ColorNo := Trim(ADOTmp.fieldbyname('SPColorNo').AsString);
|
|||
|
FP_MF := Trim(ADOTmp.fieldbyname('SPMF').AsString);
|
|||
|
FP_KZ := Trim(ADOTmp.fieldbyname('SPKZ').AsString);
|
|||
|
FP_HX := Trim(ADOTmp.fieldbyname('SPHX').AsString);
|
|||
|
|
|||
|
FRCGangNo := Trim(ADOTmp.fieldbyname('RCGangNo').AsString);
|
|||
|
FGangNo := Trim(ADOTmp.fieldbyname('GangNo').AsString);
|
|||
|
if FJHGZ = '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
JYXH.ReadOnly := False;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JYXH.ReadOnly := True;
|
|||
|
end;
|
|||
|
|
|||
|
JYXH.Text := Trim(ADOTmp.fieldbyname('maxRoll').AsString);
|
|||
|
GangNo.Text := Trim(ADOTmp.fieldbyname('gangNo').AsString);
|
|||
|
KuangHao.Text := '';
|
|||
|
JYXS.Text := Trim(ADOTmp.fieldbyname('ORDXS').AsString);
|
|||
|
|
|||
|
AOrdDefNote1.Text := '<27>ƻ<EFBFBD><C6BB><EFBFBD>:' + FOrderNo + #13;
|
|||
|
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + 'Ʒ<><C6B7>:' + FP_CodeName + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><>ɫ:' + FP_Color + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><><EFBFBD><EFBFBD>:' + FP_KHHX + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + 'ɫ<><C9AB>:' + FP_ColorNo + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + 'Ⱦ<><C8BE><EFBFBD><EFBFBD>:' + FRCGangNo + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:' + FGangNo + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><>װҪ<D7B0><D2AA>:' + Trim(ADOTmp.fieldbyname('PZFYNote').AsString) + #13;
|
|||
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><><EFBFBD><EFBFBD>:' + Trim(ADOTmp.fieldbyname('TieJing').AsString);
|
|||
|
JYTare.Text := Trim(ADOTmp.fieldbyname('PiZhong').AsString);
|
|||
|
// if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
// begin
|
|||
|
// JYLen.SetFocus;
|
|||
|
// Edit1Click(JYLen);
|
|||
|
// end
|
|||
|
// else
|
|||
|
// begin
|
|||
|
// JYGW.SetFocus;
|
|||
|
// Edit1Click(JYGW);
|
|||
|
// end;
|
|||
|
JYLen.SetFocus;
|
|||
|
Edit1Click(JYLen);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
ClearGlobal();
|
|||
|
end;
|
|||
|
|
|||
|
InitJYGrid();
|
|||
|
InitCDGrid();
|
|||
|
APID.Text := '';
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.CloseCom(DllName: string);
|
|||
|
type
|
|||
|
TMyFunc = function(sCommName: PAnsiChar): HWND; stdcall;
|
|||
|
var
|
|||
|
Tf1: TMyFunc;
|
|||
|
Tp1: TFarProc;
|
|||
|
Th1: Thandle;
|
|||
|
begin
|
|||
|
Th1 := LoadLibrary(Pchar(trim(DllName)));
|
|||
|
if Th1 > 0 then
|
|||
|
begin
|
|||
|
try
|
|||
|
Tp1 := GetProcAddress(Th1, 'CommClose');
|
|||
|
if Tp1 <> nil then
|
|||
|
begin
|
|||
|
Tf1 := TMyFunc(Tp1);
|
|||
|
newh1 := Tf1('Comm1');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
finally
|
|||
|
// FreeLibrary(Th1);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
application.MessageBox(Pchar('<27>Ҳ<EFBFBD><D2B2><EFBFBD> ' + trim(DllName) + ' <20>ļ<EFBFBD><C4BC><EFBFBD>'), '<27><>ʾ');
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.OpenCom(DllName: string);
|
|||
|
type
|
|||
|
TMyFunc = function(fhandle: hwnd; sCommName: PAnsiChar; IntTime: integer; IsMessage: integer): HWND; stdcall;
|
|||
|
var
|
|||
|
Tf: TMyFunc;
|
|||
|
Tp: TFarProc;
|
|||
|
Th: Thandle;
|
|||
|
begin
|
|||
|
// closeCom(FComFile);
|
|||
|
Th := LoadLibrary(Pchar(trim(DllName)));
|
|||
|
if Th > 0 then
|
|||
|
begin
|
|||
|
try
|
|||
|
Tp := GetProcAddress(Th, 'CommOpen');
|
|||
|
if Tp <> nil then
|
|||
|
begin
|
|||
|
Tf := TMyFunc(Tp);
|
|||
|
newh := Tf(self.Handle, 'Comm1', 500, 1);
|
|||
|
if newh < 1 then
|
|||
|
begin
|
|||
|
application.MessageBox(Pchar('<27><EFBFBD><F2BFAAB4><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>'), '<27><>ʾ');
|
|||
|
end
|
|||
|
else
|
|||
|
IsCommOpen := true;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
IsCommOpen := false;
|
|||
|
end;
|
|||
|
finally
|
|||
|
// FreeLibrary(Th);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
IsCommOpen := false;
|
|||
|
application.MessageBox(Pchar('<27>Ҳ<EFBFBD><D2B2><EFBFBD> ' + trim(DllName) + ' <20>ļ<EFBFBD><C4BC><EFBFBD>'), '<27><>ʾ');
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
frmSDRKInspection := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.On1301(var Message: Tmessage);
|
|||
|
var
|
|||
|
i1, i2: integer;
|
|||
|
unitname: string;
|
|||
|
fdata: double;
|
|||
|
begin
|
|||
|
i1 := Message.WParam;
|
|||
|
i2 := Message.LParam;
|
|||
|
|
|||
|
if (trim(edtMaBiao.Text) = '<27><>') then
|
|||
|
begin
|
|||
|
// fdata := format('%.' + trim(Edit1.Text) + 'f', [i1 / 100000]);
|
|||
|
if Edit5.Text = '0' then
|
|||
|
begin
|
|||
|
// JYLen.Text := FloatToStr(trunc(i1 / 100000));
|
|||
|
JYLen.Text := format('%.0f', [i1 / 100000]);
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JYLen.Text := format('%.' + trim(Edit1.Text) + 'f', [i1 / 100000]);
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
// format('%.1f', [i1 / 100000]);
|
|||
|
if i2 = 0 then
|
|||
|
Label9.Caption := 'M'
|
|||
|
else
|
|||
|
Label9.Caption := 'Y';
|
|||
|
|
|||
|
if Edit5.Text = '0' then
|
|||
|
begin
|
|||
|
edit1.Text := FloatToStr(trunc(i1 / 100000));
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
edit1.Text := format('%.' + trim(Edit1.Text) + 'f', [i1 / 100000]);
|
|||
|
end;
|
|||
|
// edit1.Text := format('%.' + trim(Edit1.Text) + 'f', [i1 / 100000]);
|
|||
|
// edit1.Text := format('%.1f', [i1 / 100000]);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.On1201(var Message: Tmessage);
|
|||
|
var
|
|||
|
i1, i2: integer;
|
|||
|
unitname: string;
|
|||
|
fdata: double;
|
|||
|
begin
|
|||
|
i1 := Message.WParam;
|
|||
|
i2 := Message.LParam;
|
|||
|
|
|||
|
if trim(edtChen.Text) = '<27><>' then
|
|||
|
begin
|
|||
|
JYGW.Text := format('%.1f', [i1 / 100000]);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
if isCommopen then
|
|||
|
begin
|
|||
|
closeCom(DZCDYDllName);
|
|||
|
closeCom(MBDYDllName);
|
|||
|
end;
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.InitCDGrid();
|
|||
|
begin
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JY_Cloth_CD where JYID=' + quotedstr(Trim(FFFJYID)));
|
|||
|
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS(ADOQueryMain, CDS_MJCD);
|
|||
|
SInitCDSData(ADOQueryMain, CDS_MJCD);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.InitJYGrid();
|
|||
|
var
|
|||
|
MJYNW, MJYLen: double;
|
|||
|
begin
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select A.*');
|
|||
|
sql.Add('from JY_Cloth A where APID=''' + Trim(FAPID) + '''');
|
|||
|
// if Trim(SCXFlag) <> '' then
|
|||
|
// sql.Add(' and JTType=''' + Trim(SCXFlag) + '''');
|
|||
|
// sql.Add(' and Filler=''' + Trim(DName) + '''');
|
|||
|
// sql.Add('and convert(varchar(10),filltime,120)=convert(varchar(10),getdate(),120)');
|
|||
|
sql.Add(' order by filltime desc');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS(ADOQueryMain, CDS_3);
|
|||
|
SInitCDSData(ADOQueryMain, CDS_3);
|
|||
|
// if TV3.DataController.Summary.FooterSummaryValues[1] <> NULL then
|
|||
|
// MJYLen := TV3.DataController.Summary.FooterSummaryValues[1]
|
|||
|
// else
|
|||
|
// MJYLen := 0;
|
|||
|
// if TV3.DataController.Summary.FooterSummaryValues[3] <> NULL then
|
|||
|
// MJYNW := TV3.DataController.Summary.FooterSummaryValues[3]
|
|||
|
// else
|
|||
|
// MJYNW := 0;
|
|||
|
/////////////////////// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> ////////////////////////////////
|
|||
|
// with ADOTmp do
|
|||
|
// begin
|
|||
|
// Close;
|
|||
|
// SQL.Clear;
|
|||
|
// sql.Add('select COUNT(mjid) PS,SUM(JYGW) MZ,SUM(JYLen) ZD,SUM(JYNW) JZ ');
|
|||
|
// sql.Add('from JY_Cloth where CONVERT(varchar(10),Filltime,120)=CONVERT(varchar(10),GETDATE(),120)');
|
|||
|
// if Trim(SCXFlag) <> '' then
|
|||
|
// sql.Add(' and JTType=''' + Trim(SCXFlag) + '''');
|
|||
|
// sql.Add(' and Filler=''' + Trim(DName) + '''');
|
|||
|
// Open;
|
|||
|
// end;
|
|||
|
// lblbq.Caption := 'ƥ<><C6A5><EFBFBD><EFBFBD>' + ADOTmp.FieldByname('PS').AsString;
|
|||
|
// lblbq.Caption := lblbq.Caption + ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + ADOTmp.FieldByname('ZD').AsString;
|
|||
|
// lblbq.Caption := lblbq.Caption + ' ë<>أ<EFBFBD>' + ADOTmp.FieldByname('MZ').AsString;
|
|||
|
// lblbq.Caption := lblbq.Caption + ' <20><><EFBFBD>أ<EFBFBD>' + ADOTmp.FieldByname('JZ').AsString;
|
|||
|
/////////////////////// <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD> ////////////////////////////////
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.TBCDClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'WFBCD';
|
|||
|
flagname := '<27>õ<EFBFBD>';
|
|||
|
fnote := True;
|
|||
|
V1Note.Caption := 'Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitCDPanel();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
fFlileFlag := UserDataFlag + 'HX';
|
|||
|
InitCDPanel();
|
|||
|
InitCDGrid();
|
|||
|
|
|||
|
if IsINIFile() then
|
|||
|
ReadINIFile()
|
|||
|
else
|
|||
|
WriteINIFile;
|
|||
|
|
|||
|
if trim(fmanage) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
if trim(DZCDYDllName) <> '' then
|
|||
|
OpenCom(DZCDYDllName);
|
|||
|
if trim(MBDYDllName) <> '' then
|
|||
|
OpenCom(MBDYDllName);
|
|||
|
// edtChen.Visible := true;
|
|||
|
// edtMaBiao.Visible := true;
|
|||
|
// Label35.Visible := true;
|
|||
|
end;
|
|||
|
APID.SetFocus();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.InitCDPanel();
|
|||
|
var
|
|||
|
AA: array[0..100] of string;
|
|||
|
i, j: Integer;
|
|||
|
begin
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select ZDYName from KH_Zdy where Type=''WFBCD'' order by ZDYNO ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>õ㣡', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
First;
|
|||
|
i := 0;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
AA[i] := Trim(fieldbyname('ZDYName').AsString);
|
|||
|
i := i + 1;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
i := i - 1;
|
|||
|
if i > 69 then
|
|||
|
begin
|
|||
|
i := 69;
|
|||
|
end;
|
|||
|
for j := 0 to i do
|
|||
|
begin
|
|||
|
with ScrollBox1 do
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[j]).Visible := True;
|
|||
|
TSpeedButton(Controls[j]).Hint := AA[j];
|
|||
|
if Length(AA[j]) > 4 then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[j]).Caption := Copy(Trim(AA[j]), 1, 4) + #13 + Copy(Trim(AA[j]), 5, Length(AA[j]) - 4);
|
|||
|
end
|
|||
|
else
|
|||
|
TSpeedButton(Controls[j]).Caption := AA[j];
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
if CDS_MJCD.IsEmpty then
|
|||
|
Exit;
|
|||
|
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MCID').AsString) = '' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
CDS_MJCD.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmSDRKInspection.SaveData(): Boolean;
|
|||
|
var
|
|||
|
maxno, FJYID, BZID, strsql: string;
|
|||
|
FJYLen, FYJZQty: Double;
|
|||
|
begin
|
|||
|
if FOperationStatus = '<27><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>' then
|
|||
|
begin
|
|||
|
FJYID := FFFJYID;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FJYID := '';
|
|||
|
end;
|
|||
|
if fxiugai <> '' then
|
|||
|
begin
|
|||
|
FJYID := CDS_3.fieldbyname('JYID').AsString;
|
|||
|
end;
|
|||
|
try
|
|||
|
ADOCmd.Connection.BeginTrans;
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JY_Cloth where JYID=''' + Trim(FJYID) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(FJYID) = '' then
|
|||
|
begin
|
|||
|
Append;
|
|||
|
if GetLSNo(ADOTmp, maxno, '0', 'JY_Cloth', 4, 1) = False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
maxno := Trim(FJYID);
|
|||
|
Edit;
|
|||
|
end;
|
|||
|
FieldByName('OrderNo').value := Trim(FOrderNo);
|
|||
|
FieldByName('MainId').value := Trim(FMainId);
|
|||
|
FieldByName('SubId').value := Trim(FSubId);
|
|||
|
FieldByName('ConNo').value := Trim(FConNo);
|
|||
|
FieldByName('ConMainId').value := Trim(FConMainId);
|
|||
|
FieldByName('ConSubId').value := Trim(FConSubId);
|
|||
|
FieldByName('TPId').value := Trim(FTPId);
|
|||
|
FieldByName('ClothDegree').value := Trim(FClothDegree);
|
|||
|
FieldByName('APId').value := Trim(FAPID);
|
|||
|
FieldByName('JYID').Value := Trim(maxno);
|
|||
|
FieldByName('JYCRType').Value := 'δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
FieldByName('RCGangNo').value := FRCGangNo;
|
|||
|
FieldByName('GangNo').Value := Trim(GangNo.Text); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FieldByName('P_Code').value := FP_Code;
|
|||
|
FieldByName('P_CodeName').value := FP_CodeName;
|
|||
|
FieldByName('P_Spec').value := FP_Spec;
|
|||
|
FieldByName('P_Color').value := FP_Color;
|
|||
|
FieldByName('P_ColorNo').value := FP_ColorNo;
|
|||
|
FieldByName('P_KuanNo').value := FP_KuanNo;
|
|||
|
FieldByName('P_MF').value := FP_MF;
|
|||
|
FieldByName('P_KZ').value := FP_KZ;
|
|||
|
FieldByName('P_HX').value := FP_HX;
|
|||
|
FieldByName('P_KHHX').value := FP_KHHX;
|
|||
|
FieldByName('P_TPColorNo').value := FP_TPColorNo;
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><> <20><>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD>
|
|||
|
if TV2.DataController.Summary.FooterSummaryValues[2] <> NULL then
|
|||
|
begin
|
|||
|
FYJZQty := StrToFloatdef(TV2.DataController.Summary.FooterSummaryValues[2], 0);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FYJZQty := 0;
|
|||
|
end;
|
|||
|
FieldByName('YJZQty').Value := FYJZQty;
|
|||
|
if label9.Caption = 'M' then
|
|||
|
begin
|
|||
|
FieldByName('JYLen').Value := RoundFloat(StrToFloatdef(trim(JYLen.Text), 0), 1);
|
|||
|
FieldByName('JYYLen').Value := RoundFloat(StrToFloatdef(trim(JYLen.Text), 0) / 0.9144, 1);
|
|||
|
end
|
|||
|
else if label9.Caption = 'Y' then
|
|||
|
begin
|
|||
|
FieldByName('JYYLen').Value := RoundFloat(StrToFloatdef(trim(JYLen.Text), 0), 1);
|
|||
|
FieldByName('JYLen').Value := RoundFloat(StrToFloatdef(trim(JYLen.Text), 0) * 0.9144, 1);
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
//Ƥ<><C6A4>
|
|||
|
FieldByName('JYTare').Value := StrToFloatdef(trim(JYTare.Text), 0);
|
|||
|
//ë<><C3AB>
|
|||
|
FieldByName('JYGW').Value := StrToFloatdef(trim(JYGW.Text), 0);
|
|||
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
FieldByName('JYNW').Value := StrToFloatdef(trim(JYGW.Text), 0) - StrToFloatdef(trim(JYTare.Text), 0);
|
|||
|
//ϵ<><CFB5>
|
|||
|
FieldByName('JYXS').Value := StrToFloatdef(trim(JYXS.Text), 0);
|
|||
|
|
|||
|
if Trim(Edit3.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('JYXH').Value := strtointdef(trim(JYXH.Text), 0);
|
|||
|
FieldByName('JYType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit4.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('JYXH').Value := 0;
|
|||
|
FieldByName('JYType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
FieldByName('JYUnit').Value := Label9.Caption;
|
|||
|
if Trim(FJYID) = '' then
|
|||
|
begin
|
|||
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTmp);
|
|||
|
end;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>
|
|||
|
// if Trim(SCXFlag) <> '' then
|
|||
|
// begin
|
|||
|
FieldByName('JTType').Value := '0';
|
|||
|
// end;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
//////// <20><><EFBFBD>¾<EFBFBD><C2BE><EFBFBD> ////////
|
|||
|
///
|
|||
|
if FXIUGAI <> '<27><EFBFBD>' then
|
|||
|
begin
|
|||
|
if FJHGZ <> '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_JY_UP_JYXH');
|
|||
|
sql.Add('@JYID=''' + Trim(maxno) + '''');
|
|||
|
open;
|
|||
|
if not IsEmpty then
|
|||
|
begin
|
|||
|
JYXH.Text := fieldbyname('JYXH').AsString;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
//////// <20><><EFBFBD>¾<EFBFBD><C2BE><EFBFBD> ////////
|
|||
|
FJYID := Trim(maxno);
|
|||
|
FFFJYID := Trim(maxno);
|
|||
|
///<2F><><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.fieldbyname('JCID').AsString) = '' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOTmp, maxno, 'JC', 'JY_Cloth_CD', 5, 1) = False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
maxno := Trim(CDS_MJCD.fieldbyname('JCID').AsString);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JY_Cloth_CD ');
|
|||
|
sql.Add(' where JCID=''' + Trim(maxno) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.fieldbyname('JYID').AsString) = '' then
|
|||
|
Append
|
|||
|
else
|
|||
|
Edit;
|
|||
|
FieldByName('JYID').Value := Trim(FJYID);
|
|||
|
FieldByName('JCID').Value := Trim(maxno);
|
|||
|
RTSetSaveDataCDS(ADOCmd, Tv2, CDS_MJCD, 'JY_Cloth_CD', 0);
|
|||
|
FieldByName('KouFenType').Value := CDS_MJCD.fieldbyname('KouFenType').Value;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
CDS_MJCD.Edit;
|
|||
|
CDS_MJCD.FieldByName('JCID').Value := Trim(maxno);
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_JY_UP_CDList @JYID=''' + Trim(FJYID) + ''' ');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>⼰<EFBFBD><E2BCB0><EFBFBD><EFBFBD>
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_JY_Cloth_CRK @JYID=''' + trim(FJYID) + '''');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
|
|||
|
//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD>
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_JY_UP_LCK @APID=''' + trim(FAPID) + '''');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
ADOCmd.Connection.CommitTrans;
|
|||
|
Result := True;
|
|||
|
except
|
|||
|
Result := False;
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.BTPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
mvalue: Double;
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
APID.SetFocus;
|
|||
|
if CheckData('<27>ύ') = False then
|
|||
|
exit;
|
|||
|
|
|||
|
if FJHGZ = '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JY_Cloth where APID=' + quotedstr(Trim(FAPID)));
|
|||
|
SQL.Add(' and JYXH=' + Trim(JYXH.Text));
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if not ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
if Application.MessageBox('<27><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4>ڣ<EFBFBD><DAA3>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棿', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
if SaveData() then
|
|||
|
begin
|
|||
|
if edtMaBiao.Text <> '' then
|
|||
|
begin
|
|||
|
JYLen.Text := '';
|
|||
|
end;
|
|||
|
|
|||
|
JYGW.Text := '';
|
|||
|
JYNW.Text := '';
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
JYXH.Text := inttostr(strTointdef(trim(JYXH.Text), 0) + 1);
|
|||
|
if Trim(Edit6.Text) = '<27><>' then
|
|||
|
begin
|
|||
|
PrtData(FFFJYID);
|
|||
|
end;
|
|||
|
end;
|
|||
|
FOperationStatus := '';
|
|||
|
FFFJYID := '';
|
|||
|
fxiugai := '';
|
|||
|
InitJYGrid();
|
|||
|
InitCDGrid();
|
|||
|
|
|||
|
JYLen.SetFocus;
|
|||
|
Edit1Click(JYLen);
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.PrtData(FJYID: string);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
Txt, fImagePath, Txt2, fImagePath2: string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar: TMakebar;
|
|||
|
Mixtext: TMixtext;
|
|||
|
begin
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' EXEC P_JY_Print_Lab ');
|
|||
|
SQL.Add(' @JYID=''' + Trim(FJYID) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryPrint.IsEmpty then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>δ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
ExportFtErpFile(Trim(ADOQueryPrint.fieldbyname('LBName').AsString) + '.rmf', ADOTmp);
|
|||
|
if Trim(ADOQueryPrint.fieldbyname('LBName').AsString) <> '' then
|
|||
|
begin
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('LBName').AsString) + '.rmf'
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
ExportFtErpFile('ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>ǩ.rmf', ADOTmp);
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD>ǩ.rmf';
|
|||
|
end;
|
|||
|
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
if Trim(ADOQueryPrint.fieldbyname('LBName').AsString) <> '<27><>Ʒ<EFBFBD><C6B7>ǩ' then
|
|||
|
Rm2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1)
|
|||
|
else
|
|||
|
Rm2.DefaultCopies := 1;
|
|||
|
RM2.PrintReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.SpeedButton1Click(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
fsj := Trim(TSpeedButton(Sender).Hint);
|
|||
|
if Trim(fsj) = '' then
|
|||
|
Exit;
|
|||
|
if TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Name = 'KuangHao' then
|
|||
|
Exit;
|
|||
|
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.SpeedButton12Click(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
|||
|
if Trim(fsj) = '' then
|
|||
|
Exit;
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.SpeedButton13Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
if CheckData('<27>õ<EFBFBD>') = False then
|
|||
|
exit;
|
|||
|
|
|||
|
FCDName := Trim(TSpeedButton(Sender).Hint);
|
|||
|
MovePanel1.Visible := True;
|
|||
|
Label21.Caption := Trim(FCDName);
|
|||
|
|
|||
|
//<2F><>ʾ<EFBFBD><CABE><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD>
|
|||
|
Edit1.SetFocus;
|
|||
|
Panel3.Visible := True;
|
|||
|
with Panel3 do
|
|||
|
begin
|
|||
|
for i := 0 to ControlCount - 1 do
|
|||
|
begin
|
|||
|
if Controls[i] is TSpeedButton then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[i]).Hint := Trim(Edit1.Name);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.cxGridDBColumn2PropertiesChange(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
|
|||
|
fsj := Trim(Order_MJ.fieldbyname('SubId').AsString);
|
|||
|
Order_MJ.DisableControls;
|
|||
|
with Order_MJ do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(Order_MJ.fieldbyname('SubId').AsString) <> fsj then
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value := False;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Order_MJ.EnableControls;
|
|||
|
Order_MJ.Locate('SubId', fsj, []);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button1Click(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
{ if Trim(Edit1.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('λ<>ò<EFBFBD><C3B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end; }
|
|||
|
if Trim(Edit1.Text) <> '' then
|
|||
|
begin
|
|||
|
if Trim(Edit2.Text) <> '' then
|
|||
|
begin
|
|||
|
if StrToFloat(Edit2.Text) < StrToFloat(Edit1.Text) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>õ<EFBFBD>λ<EFBFBD><CEBB>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if CDQty.Text <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(CDQty.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('cdname').Value := Trim(FCDName);
|
|||
|
FieldByName('CDbeg').Value := Trim(Edit1.Text);
|
|||
|
FieldByName('CDEnd').Value := Trim(Edit2.Text);
|
|||
|
FieldByName('KouFenQty').Value := 0;
|
|||
|
if RadioGroup1.ItemIndex > -1 then
|
|||
|
FieldByName('KouFenType').Value := RadioGroup1.Items.Strings[RadioGroup1.ItemIndex];
|
|||
|
if RadioGroup1.ItemIndex > -1 then
|
|||
|
begin
|
|||
|
if RadioGroup1.ItemIndex < 3 then
|
|||
|
begin
|
|||
|
FieldByName('KouFenQty').Value := RadioGroup1.ItemIndex + 1;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName('KouFenQty').Value := 4;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(FCDName) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
FieldByName('KouFenQty').Value := 0;
|
|||
|
FieldByName('CDQty').Value := StrToFloatdef(trim(CDQty.Text), 0);
|
|||
|
if Trim(edtYJ.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('YJQty').Value := StrToFloatdef(trim(CDQty.Text), 0);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName('YJQty').Value := 0;
|
|||
|
end;
|
|||
|
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Edit1.Text := '';
|
|||
|
Edit2.Text := '';
|
|||
|
CDQty.Text := '';
|
|||
|
MovePanel1.Visible := False;
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
InitCDPanel();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button5Click(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
i: Integer;
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
if CDS_3.IsEmpty then
|
|||
|
Exit;
|
|||
|
PrtData(CDS_3.fieldbyname('JYID').AsString);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.SpeedButton49Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
if APID.Text = '' then
|
|||
|
exit;
|
|||
|
if StrToIntDef(APID.Text, 0) > 0 then
|
|||
|
APID.Text := 'DC' + APID.Text;
|
|||
|
ClearGlobal();
|
|||
|
FOperationStatus := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
InitLCK();
|
|||
|
APID.Text := '';
|
|||
|
JYPerson.Text := '';
|
|||
|
if edit7.Text <> '' then
|
|||
|
begin
|
|||
|
FJHGZ := '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit1Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
Panel3.Visible := True;
|
|||
|
with Panel3 do
|
|||
|
begin
|
|||
|
for i := 0 to ControlCount - 1 do
|
|||
|
begin
|
|||
|
if Controls[i] is TSpeedButton then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[i]).Hint := Trim(TEdit(Sender).Name);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit2Change(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
if Trim(Edit1.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(Edit1.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(Edit2.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(Edit2.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
CDQty.Text := FloatToStr(StrToFloat(Edit2.Text) - StrToFloat(Edit1.Text));
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit3.Text) = '' then
|
|||
|
begin
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit3.Text := '';
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit4.Text) = '' then
|
|||
|
begin
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
Edit3.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit4.Text := '';
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit6.Text) = '' then
|
|||
|
begin
|
|||
|
Edit6.Text := '<27><>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit6.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
if Trim(Edit7.Text) = '' then
|
|||
|
begin
|
|||
|
Edit7.Text := '<27><>';
|
|||
|
FJHGZ := '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
FJHGZ := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.MJstr3KeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
Key := #0;
|
|||
|
SelectNext(ActiveControl as TWinControl, True, True);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.JYNWExit(Sender: TObject);
|
|||
|
begin
|
|||
|
if (trim(JYGW.Text) = '') and (trim(JYNW.Text) = '') then
|
|||
|
exit;
|
|||
|
if (trim(JYGW.Text) = '') and (trim(JYTare.Text) = '') then
|
|||
|
exit;
|
|||
|
if (trim(JYNW.Text) = '') and (trim(JYTare.Text) = '') then
|
|||
|
exit;
|
|||
|
|
|||
|
if (trim(JYTare.Text) = '') then
|
|||
|
exit;
|
|||
|
|
|||
|
if (trim(JYNW.Text) <> '') then
|
|||
|
begin
|
|||
|
JYGW.Text := floattostr(strtofloatdef(trim(JYTare.Text), 0) + strtofloatdef(trim(JYNW.Text), 0));
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
RadioGroup1.ItemIndex := -1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.JYGWChange(Sender: TObject);
|
|||
|
begin
|
|||
|
QuantityConversion();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.APIDClick(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
Panel3.Visible := True;
|
|||
|
with Panel3 do
|
|||
|
begin
|
|||
|
for i := 0 to ControlCount - 1 do
|
|||
|
begin
|
|||
|
if Controls[i] is TSpeedButton then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[i]).Hint := Trim(TEdit(Sender).Name);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.JYNWKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
BTPrint.Click;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
IsCommopen := false;
|
|||
|
IsJsMessage := false;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Edit8Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit8.Text) = '' then
|
|||
|
begin
|
|||
|
Edit8.Text := '<27><>';
|
|||
|
Button5.Visible := true;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit8.Text := '';
|
|||
|
Button5.Visible := false;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.JYLenChange(Sender: TObject);
|
|||
|
begin
|
|||
|
//QuantityConversion();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
MovePanel1.Visible := false;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.edtYJClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(TEdit(Sender).Text) = '' then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := '<27><>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'JYPerson';
|
|||
|
flagname := '<27>鲼<EFBFBD><E9B2BC>';
|
|||
|
// fnote := True;
|
|||
|
// V1Note.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
if cds_3.IsEmpty then
|
|||
|
exit;
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JY_Cloth A WHERE A.JYid=' + QuotedStr(trim(CDS_3.fieldbyName('JYID').AsString)));
|
|||
|
OPEN;
|
|||
|
end;
|
|||
|
if ADOTmp.fieldbyName('JYCRType').Asstring = '<27>ѳ<EFBFBD><D1B3><EFBFBD>' then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѳ<EFBFBD><D1B3><EFBFBD>,<2C><>ֹ<EFBFBD>ģ<DEB8>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox(PChar('ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>š<EFBFBD>' + trim(CDS_3.fieldbyName('JYXH').AsString) + '<27><><EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>'), '', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JY_CLOTH where jyid=''' + Trim(CDS_3.fieldbyName('jyid').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCSHData(ADOCmd, PANEL2, 0);
|
|||
|
if ADOCmd.fieldbyName('jytype').AsString = '<27><>Ʒ' then
|
|||
|
begin
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
Edit3.Text := '';
|
|||
|
end;
|
|||
|
|
|||
|
// MJType.ItemIndex:='1'
|
|||
|
// edit5.Text := '';
|
|||
|
// edit9.Text := '';
|
|||
|
// edit10.Text := '';
|
|||
|
// edit11.Text := '';
|
|||
|
// edit12.Text := '';
|
|||
|
// edit13.Text := '';
|
|||
|
// edit14.Text := '';
|
|||
|
// edit15.Text := '';
|
|||
|
|
|||
|
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JY_Cloth_CD where JYID=' + quotedstr(Trim(CDS_3.fieldbyName('jyid').AsString)));
|
|||
|
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS(ADOQueryMain, CDS_MJCD);
|
|||
|
SInitCDSData(ADOQueryMain, CDS_MJCD);
|
|||
|
fxiugai := '<27><EFBFBD>';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmJYG := TfrmJYG.Create(self);
|
|||
|
with frmJYG do
|
|||
|
begin
|
|||
|
FlagStr := 'JYPerson';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
JYPerson.Text := frmJYG.FSDPerson;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmJYG.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.edtChenClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(TEdit(Sender).Text) = '' then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := '<27><>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if ScrollBox1.Visible then
|
|||
|
ScrollBox1.Visible := False
|
|||
|
else
|
|||
|
ScrollBox1.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ToolButton4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'KuangHao';
|
|||
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitCDPanel();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.ToolButton5Click(Sender: TObject);
|
|||
|
var
|
|||
|
FSCRZ: string;
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
|
|||
|
if CDS_3.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JY_Cloth A WHERE A.JYid=' + QuotedStr(trim(CDS_3.fieldbyName('JYID').AsString)));
|
|||
|
OPEN;
|
|||
|
end;
|
|||
|
if ADOTmp.fieldbyName('JYCRType').Asstring = '<27>ѳ<EFBFBD><D1B3><EFBFBD>' then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѳ<EFBFBD><D1B3><EFBFBD>,<2C><>ֹɾ<D6B9><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox(PChar('ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>š<EFBFBD>' + trim(CDS_3.fieldbyName('JYXH').AsString) + '<27><>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'), '', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
|
|||
|
FSCRZ := '';
|
|||
|
FSCRZ := '<27><><EFBFBD><EFBFBD><EFBFBD>룺' + trim(CDS_3.fieldbyname('JYID').AsString);
|
|||
|
FSCRZ := FSCRZ + ' <20><><EFBFBD>ţ<EFBFBD>' + trim(CDS_3.fieldbyname('JYXH').AsString);
|
|||
|
FSCRZ := FSCRZ + ' <20><><EFBFBD>ţ<EFBFBD>' + trim(CDS_3.fieldbyname('apid').AsString);
|
|||
|
FSCRZ := FSCRZ + ' ë<>أ<EFBFBD>' + trim(CDS_3.fieldbyname('jygw').AsString);
|
|||
|
FSCRZ := FSCRZ + ' <20><><EFBFBD>أ<EFBFBD>' + trim(CDS_3.fieldbyname('jynw').AsString);
|
|||
|
FSCRZ := FSCRZ + ' <20><><EFBFBD>ȣ<EFBFBD>' + trim(CDS_3.fieldbyname('jylen').AsString);
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JY_Cloth where jyid=''' + Trim(CDS_3.fieldbyname('jyid').AsString) + '''');
|
|||
|
sql.Add('delete CK_Cloth_CR where jyid=''' + Trim(CDS_3.fieldbyname('jyid').AsString) + '''');
|
|||
|
sql.Add('delete CK_Cloth_kc where jyid=''' + Trim(CDS_3.fieldbyname('jyid').AsString) + '''');
|
|||
|
sql.Add('delete JY_Cloth_CD where jyid=''' + Trim(CDS_3.fieldbyname('jyid').AsString) + '''');
|
|||
|
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(FSCRZ));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
InitCDGrid();
|
|||
|
InitJYGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZdyMapSel := TfrmZdyMapSel.Create(self);
|
|||
|
with frmZdyMapSel do
|
|||
|
begin
|
|||
|
FlagStr := 'KuangHao';
|
|||
|
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
self.KuangHao.Text := frmZdyMapSel.FSDPerson;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZdyMapSel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmSDRKInspection.Button8Click(Sender: TObject);
|
|||
|
var
|
|||
|
MKey: Char;
|
|||
|
begin
|
|||
|
inherited;
|
|||
|
MKey := #13;
|
|||
|
try
|
|||
|
frmDJBCKOutListsel := TfrmDJBCKOutListsel.Create(Application);
|
|||
|
with frmDJBCKOutListsel do
|
|||
|
begin
|
|||
|
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
APID.Text := trim(cds_main.fieldbyname('spid').asstring);
|
|||
|
APIDKeyPress(apid, MKey);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmDJBCKOutListsel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|