1729 lines
47 KiB
ObjectPascal
1729 lines
47 KiB
ObjectPascal
|
|
unit U_TableInspection;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, 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, dxSkinsCore,
|
|||
|
|
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
|
|||
|
|
dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|||
|
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
|
|||
|
|
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
|
|||
|
|
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
|||
|
|
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
|||
|
|
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
|||
|
|
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
|
|||
|
|
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
|
|||
|
|
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
|
|||
|
|
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
|||
|
|
dxSkinXmas2008Blue, dxSkinscxPCPainter;
|
|||
|
|
{function CommOpen(fhandle:hwnd;sCommName:PAnsiChar;
|
|||
|
|
IntTime:integer):integer;stdcall;external 'JCYData.DLL';
|
|||
|
|
function CommClose(sCommName:PAnsiChar):integer;stdcall;external 'JCYData.DLL';
|
|||
|
|
function CommOpen(fhandle:hwnd;sCommName:PAnsiChar;
|
|||
|
|
IntTime:integer;IsMessage:integer):integer;stdcall;external 'JCYData.DLL';
|
|||
|
|
function CommClose(sCommName:PAnsiChar):integer;stdcall;external 'JCYData.DLL';
|
|||
|
|
function CommOpen(fhandle:hwnd;sCommName:PAnsiChar;
|
|||
|
|
IntTime:integer;IsMessage:integer):integer;stdcall;external 'JZCRS323C.DLL';
|
|||
|
|
function CommClose(sCommName:PAnsiChar):integer;stdcall;external 'JZCRS323C.DLL';
|
|||
|
|
|
|||
|
|
function GetCommData(fhandle:hwnd;var defnum1,defnum2:double;var fisjz:integer):integer;stdcall;external 'JZCRS323C.DLL';
|
|||
|
|
|
|||
|
|
function CommOpen1301(fhandle:hwnd;sCommName:PAnsiChar;
|
|||
|
|
IntTime:integer;IsMessage:integer):integer;stdcall;external 'JZCRS323C.DLL';
|
|||
|
|
function CommClose1301(sCommName:PAnsiChar):integer;stdcall;external 'JZCRS323C.DLL';
|
|||
|
|
|
|||
|
|
function GetCommData1301(fhandle:hwnd;var defnum1,defnum2:double;var fisjz:integer):integer;stdcall;external 'JZCRS323C.DLL'; }
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmTableInspection = class(TForm)
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
cxStyle2: TcxStyle;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Order_MJ: TClientDataSet;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
RM2: TRMGridReport;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
CDS_MJCD: TClientDataSet;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
CDS_MJID: TClientDataSet;
|
|||
|
|
Timer1: TTimer;
|
|||
|
|
ADOQueryPrint: TADOQuery;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
SpeedButton13: TSpeedButton;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
ADOQueryMainDSC: TADOQuery;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
MJLen: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
MJMaoZ: TEdit;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
BTPrint: TButton;
|
|||
|
|
Button5: TButton;
|
|||
|
|
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;
|
|||
|
|
MovePanel1: TMovePanel;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Button4: TButton;
|
|||
|
|
Edit2: TEdit;
|
|||
|
|
CDQty: TEdit;
|
|||
|
|
RadioGroup1: TRadioGroup;
|
|||
|
|
Button2: TButton;
|
|||
|
|
v3Column4: TcxGridDBColumn;
|
|||
|
|
v3Column5: TcxGridDBColumn;
|
|||
|
|
RM3: TRMGridReport;
|
|||
|
|
ADOTmp: TADOQuery;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Panel6: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
lblOrderNo: TLabel;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
Label39: TLabel;
|
|||
|
|
APID: TEdit;
|
|||
|
|
Edit7: TEdit;
|
|||
|
|
Edit8: TEdit;
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
TBCD: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
lblMPRTCodeName: TLabel;
|
|||
|
|
lblcolor: TLabel;
|
|||
|
|
SpeedButton14: TSpeedButton;
|
|||
|
|
SpeedButton15: TSpeedButton;
|
|||
|
|
SpeedButton16: TSpeedButton;
|
|||
|
|
SpeedButton17: TSpeedButton;
|
|||
|
|
SpeedButton18: TSpeedButton;
|
|||
|
|
SpeedButton19: TSpeedButton;
|
|||
|
|
SpeedButton20: TSpeedButton;
|
|||
|
|
SpeedButton21: TSpeedButton;
|
|||
|
|
SpeedButton22: TSpeedButton;
|
|||
|
|
SpeedButton23: TSpeedButton;
|
|||
|
|
SpeedButton24: TSpeedButton;
|
|||
|
|
SpeedButton25: TSpeedButton;
|
|||
|
|
SpeedButton26: TSpeedButton;
|
|||
|
|
SpeedButton27: TSpeedButton;
|
|||
|
|
SpeedButton28: TSpeedButton;
|
|||
|
|
SpeedButton29: TSpeedButton;
|
|||
|
|
SpeedButton30: TSpeedButton;
|
|||
|
|
SpeedButton31: TSpeedButton;
|
|||
|
|
SpeedButton32: TSpeedButton;
|
|||
|
|
SpeedButton33: TSpeedButton;
|
|||
|
|
lblrcgangNo: TLabel;
|
|||
|
|
lblPiQty: TLabel;
|
|||
|
|
lblPBFactoryName: TLabel;
|
|||
|
|
lblFactoryName: TLabel;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
tv2CDType: TcxGridDBColumn;
|
|||
|
|
tv2CDWZ: TcxGridDBColumn;
|
|||
|
|
v2Column2: TcxGridDBColumn;
|
|||
|
|
Tv2CDQty: TcxGridDBColumn;
|
|||
|
|
Tv2CDReason: TcxGridDBColumn;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
v2Column3: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
JYY1: TEdit;
|
|||
|
|
SpeedButton34: TSpeedButton;
|
|||
|
|
SpeedButton35: TSpeedButton;
|
|||
|
|
SpeedButton36: TSpeedButton;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Button6: TButton;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
edtDuanMa: TEdit;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
edtPinPi: TEdit;
|
|||
|
|
SpeedButton37: TSpeedButton;
|
|||
|
|
SpeedButton38: TSpeedButton;
|
|||
|
|
SpeedButton39: TSpeedButton;
|
|||
|
|
Button7: TButton;
|
|||
|
|
Button8: TButton;
|
|||
|
|
CDS_WXTS: TClientDataSet;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
SpeedButton40: TSpeedButton;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCDClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure MJMaoZClick(Sender: TObject);
|
|||
|
|
procedure MJLenClick(Sender: TObject);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Tv3CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure FormClick(Sender: TObject);
|
|||
|
|
procedure Button12Click(Sender: TObject);
|
|||
|
|
procedure BTPrintClick(Sender: TObject);
|
|||
|
|
procedure Tv2CDQtyPropertiesEditValueChanged(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 MJstr3KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Label9Click(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure APIDClick(Sender: TObject);
|
|||
|
|
procedure Edit7Click(Sender: TObject);
|
|||
|
|
procedure MJQty4KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure MJQty2Change(Sender: TObject);
|
|||
|
|
procedure Edit8Click(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure edtDuanMaClick(Sender: TObject);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure Timer1Timer(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
FInt, PState, PrintInt, SCInitGrid, FState, FCK: Integer;
|
|||
|
|
FColumn, FAPID, FMainId, FSubId, FFFMJID, FYXJL: string;
|
|||
|
|
MValue, FCDName: string;
|
|||
|
|
isCommopen, IsJsMessage: boolean;
|
|||
|
|
fxsType, fRollType, FOrderNo, FGangNo: string;
|
|||
|
|
procedure InitJP();
|
|||
|
|
procedure InitCDGrid();
|
|||
|
|
procedure InitCDGridID();
|
|||
|
|
function SaveData(MMJType: string): Boolean;
|
|||
|
|
procedure InitLCK(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD>
|
|||
|
|
procedure ClearGlobal(); //<2F><><EFBFBD><EFBFBD>ȫ<EFBFBD><C8AB>ID
|
|||
|
|
function CheckData(CKType: string): Boolean;
|
|||
|
|
procedure PrintCKMDG(MRKOrdID: string);
|
|||
|
|
procedure PrtData(FMJID: string);
|
|||
|
|
procedure PrtDataG(FSPID: string);
|
|||
|
|
procedure OpenCom(DllName: string);
|
|||
|
|
procedure CloseCom(DllName: string);
|
|||
|
|
procedure On1201(var Message: Tmessage); message 1201;
|
|||
|
|
procedure On1301(var Message: Tmessage); message 1301;
|
|||
|
|
procedure SendMessage(Mfsid, MFactory, MorderNo, key2str: string);
|
|||
|
|
public
|
|||
|
|
fmanage: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmTableInspection: TfrmTableInspection;
|
|||
|
|
newh, newh1: hwnd;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, U_ZDYHelp, U_iniParam, U_ProductOrderListSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.ClearGlobal();
|
|||
|
|
begin
|
|||
|
|
FAPID := '';
|
|||
|
|
FMainId := '';
|
|||
|
|
FSubId := '';
|
|||
|
|
lblOrderNo.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
lblMPRTCodeName.Caption := 'Ʒ<><C6B7>';
|
|||
|
|
lblcolor.Caption := '<27><>ɫ';
|
|||
|
|
lblrcgangNo.Caption := '<27><EFBFBD>';
|
|||
|
|
lblPBFactoryName.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
lblFactoryName.Caption := 'Ⱦ<><C8BE>';
|
|||
|
|
lblPiQty.Caption := 'ƥ<><C6A5>';
|
|||
|
|
APID.SetFocus;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmTableInspection.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 CDS_MJCD.IsEmpty then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>!');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if ((Trim(CKType) = '<27><>Ʒ') or (Trim(CKType) = '<27><>ͷ<EFBFBD><CDB7>') or (Trim(CKType) = '<27><><EFBFBD><EFBFBD>Ʒ')) then
|
|||
|
|
begin
|
|||
|
|
if trim(JYY1.Text) = '' then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
|
|
|||
|
|
if trim(Label9.Caption) = '' then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ȵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
|
|
|||
|
|
if Trim(MJMaoZ.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(MJMaoZ.Text, mvalue) = False then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
|
|
|||
|
|
if Length(trim(MJMaoZ.Text)) <> 4 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD> XX.X!');
|
|||
|
|
if pos('.', trim(MJMaoZ.Text)) <> 3 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD> XX.X!');
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJMaoZ.Text), 0) > 80 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>80!');
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJMaoZ.Text), 0) < 0 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>0!');
|
|||
|
|
end;
|
|||
|
|
if Trim(MJLen.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(MJLen.Text, mvalue) = False then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
|
|
|||
|
|
if Length(trim(MJLen.Text)) <> 5 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ȸ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD> XXX.X!');
|
|||
|
|
|
|||
|
|
if pos('.', trim(MJLen.Text)) <> 4 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ȸ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD> XXX.X!');
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJLen.Text), 0) > 400 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>Ȳ<EFBFBD><C8B2>ܴ<EFBFBD><DCB4><EFBFBD>400!');
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJLen.Text), 0) < 0.00 then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD>С<EFBFBD><D0A1>0!');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if (strtofloatdef(trim(MJLen.Text), 0) = 0) and (strtofloatdef(trim(MJMaoZ.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 TfrmTableInspection.PrintCKMDG(MRKOrdID: string);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.InitLCK();
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.*,C.* ');
|
|||
|
|
sql.Add(',maxRoll=1+isnull((select cast (max(mjxh) as int) from WFB_MJJY X where X.APID=A.SPID),0)');
|
|||
|
|
sql.Add('from CK_SXPB_CR A');
|
|||
|
|
sql.Add('inner join JYOrder_Main B on A.ORDMainIdRK=B.MainId');
|
|||
|
|
sql.Add('inner join JYOrder_Sub C on A.ORDSubIdRK=C.SubId');
|
|||
|
|
sql.Add('where SPID=''' + Trim(APID.Text) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOTmp.FieldByName('DJLockFlag').AsBoolean = True then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
APID.Text := '';
|
|||
|
|
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FOrderNo := Trim(ADOTmp.fieldbyname('ConNo').AsString);
|
|||
|
|
FGangNo := Trim(ADOTmp.fieldbyname('RCGangNo').AsString);
|
|||
|
|
if ADOTmp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
FAPID := Trim(APID.Text);
|
|||
|
|
APID.Text := '';
|
|||
|
|
FMainId := Trim(ADOTmp.fieldbyname('ORDMainIdRK').AsString);
|
|||
|
|
FSubId := Trim(ADOTmp.fieldbyname('ORDSubIdRK').AsString);
|
|||
|
|
FYXJL := Trim(ADOTmp.fieldbyname('YXJL').AsString);
|
|||
|
|
|
|||
|
|
lblOrderNo.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>' + Trim(ADOTmp.fieldbyname('conno').AsString);
|
|||
|
|
lblMPRTCodeName.Caption := 'Ʒ<><C6B7><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('MPRTCodeName').AsString);
|
|||
|
|
lblcolor.Caption := '<27><>ɫ<EFBFBD><C9AB>' + trim(ADOTmp.fieldbyname('PRTColor').AsString);
|
|||
|
|
lblrcgangNo.Caption := '<27>ţ<D7BA>' + Trim(ADOTmp.fieldbyname('rcgangNo').AsString);
|
|||
|
|
lblPBFactoryName.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('PBFactoryName').AsString);
|
|||
|
|
lblFactoryName.Caption := 'Ⱦ<><C8BE><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('FactoryName').AsString);
|
|||
|
|
lblPiQty.Caption := 'ƥ<><C6A5><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('PiQty').AsString);
|
|||
|
|
if Trim(ADOTmp.fieldbyname('OrderUnit').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
Label20.Caption := Label9.Caption;
|
|||
|
|
Label7.Caption := Label9.Caption;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MJLen.SetFocus;
|
|||
|
|
Edit1Click(MJLen);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.SetFocus;
|
|||
|
|
Edit1Click(MJMaoZ);
|
|||
|
|
end;
|
|||
|
|
Timer1.Enabled := True;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
ClearGlobal();
|
|||
|
|
end;
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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 TfrmTableInspection.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 TfrmTableInspection.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmTableInspection := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.On1301(var Message: Tmessage);
|
|||
|
|
var
|
|||
|
|
i1, i2: integer;
|
|||
|
|
unitname: string;
|
|||
|
|
fdata: double;
|
|||
|
|
begin
|
|||
|
|
i1 := Message.WParam;
|
|||
|
|
i2 := Message.LParam;
|
|||
|
|
if IsJsMessage then
|
|||
|
|
begin
|
|||
|
|
if (trim(Edit7.Text) = '<27><>') then
|
|||
|
|
begin
|
|||
|
|
MJLen.Text := format('%.f', [i1 / 100000]);
|
|||
|
|
if i2 = 0 then
|
|||
|
|
Label9.Caption := 'M'
|
|||
|
|
else
|
|||
|
|
Label9.Caption := 'Y';
|
|||
|
|
edit1.Text := format('%.1f', [i1 / 100000]);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.On1201(var Message: Tmessage);
|
|||
|
|
var
|
|||
|
|
i1, i2: integer;
|
|||
|
|
unitname: string;
|
|||
|
|
fdata: double;
|
|||
|
|
begin
|
|||
|
|
i1 := Message.WParam;
|
|||
|
|
i2 := Message.LParam;
|
|||
|
|
if IsJsMessage then
|
|||
|
|
begin
|
|||
|
|
if trim(Edit7.Text) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.Text := format('%.1f', [i1 / 100000]);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
//DataLink_WFBProducttion.ADOLink.Connected:=False;
|
|||
|
|
|
|||
|
|
if isCommopen then
|
|||
|
|
begin
|
|||
|
|
closeCom(DllName);
|
|||
|
|
closeCom(JCYDLL);
|
|||
|
|
end;
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.InitCDGrid();
|
|||
|
|
begin
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from WFB_MJJY_CD where MJID='''' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_MJCD);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_MJCD);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.InitCDGridID();
|
|||
|
|
begin
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.*');
|
|||
|
|
sql.Add('from WFB_MJJY A where APID=''' + Trim(FAPID) + '''');
|
|||
|
|
if Trim(SCXFlag) <> '' then
|
|||
|
|
sql.Add(' and JTType=''' + Trim(SCXFlag) + '''');
|
|||
|
|
sql.Add(' and Filler=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(' and MJstr2=''δ<><CEB4><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_MJID);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_MJID);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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.InitJP();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitJP();
|
|||
|
|
|
|||
|
|
if trim(Edit7.Text) = '<27><>' then
|
|||
|
|
IsJsMessage := true;
|
|||
|
|
|
|||
|
|
if trim(fmanage) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
|
begin
|
|||
|
|
// SHOWMESSAGE(dllName);
|
|||
|
|
// SHOWMESSAGE(JCYDLL);
|
|||
|
|
if trim(DllName) <> '' then
|
|||
|
|
OpenCom(DllName);
|
|||
|
|
if trim(JCYDLL) <> '' then
|
|||
|
|
OpenCom(JCYDLL);
|
|||
|
|
Edit7.Visible := true;
|
|||
|
|
Label35.Visible := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.InitJP();
|
|||
|
|
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 > 24 then
|
|||
|
|
// begin
|
|||
|
|
// i := 24;
|
|||
|
|
// 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;
|
|||
|
|
|
|||
|
|
SpeedButton13.Caption := '<27><>˿';
|
|||
|
|
SpeedButton14.Caption := '<27>ϰ<EFBFBD>' + #13 + '<27><>';
|
|||
|
|
SpeedButton15.Caption := '<27>ƶ<EFBFBD>';
|
|||
|
|
SpeedButton16.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + #13 + '<27><EFBFBD>';
|
|||
|
|
SpeedButton17.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton18.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton19.Caption := '<27><>ϸ' + #13 + 'ɴ';
|
|||
|
|
SpeedButton20.Caption := '<27>Ͼ<EFBFBD>' + #13 + '/<2F><>γ';
|
|||
|
|
SpeedButton21.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><>';
|
|||
|
|
SpeedButton22.Caption := 'ҳ<><D2B3>';
|
|||
|
|
SpeedButton23.Caption := '<27>ŷ<EFBFBD>' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton24.Caption := 'ɫ<><C9AB>';
|
|||
|
|
SpeedButton25.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton26.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton27.Caption := '<27>ָ<EFBFBD>' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton28.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton29.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton30.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><>';
|
|||
|
|
SpeedButton31.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27><>';
|
|||
|
|
SpeedButton32.Caption := '<27><>ɫ' + #13 + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton33.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '<27>ᵵ';
|
|||
|
|
SpeedButton34.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton35.Caption := '<27>ᵵ';
|
|||
|
|
SpeedButton36.Caption := '<27><>·';
|
|||
|
|
SpeedButton37.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton38.Caption := 'ù<><C3B9>';
|
|||
|
|
SpeedButton39.Caption := '<27><><EFBFBD><EFBFBD>' + #13 + '˿';
|
|||
|
|
SpeedButton40.Caption := '<27><>ͷ' + #13 + '<27><>';
|
|||
|
|
|
|||
|
|
SpeedButton13.hint := '<27><>˿';
|
|||
|
|
SpeedButton14.hint := '<27>ϰ<EFBFBD><CFB0><EFBFBD>';
|
|||
|
|
SpeedButton15.hint := '<27>ƶ<EFBFBD>';
|
|||
|
|
SpeedButton16.hint := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton17.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton18.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton19.hint := '<27><>ϸɴ';
|
|||
|
|
SpeedButton20.hint := '<27>Ͼ<EFBFBD>/<2F><>γ';
|
|||
|
|
SpeedButton21.hint := '<27><><EFBFBD>в<EFBFBD>';
|
|||
|
|
SpeedButton22.hint := 'ҳ<><D2B3>';
|
|||
|
|
SpeedButton23.hint := '<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton24.hint := 'ɫ<><C9AB>';
|
|||
|
|
SpeedButton25.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton26.hint := '<27><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>';
|
|||
|
|
SpeedButton27.hint := '<27>ָв<D6B8><D0B2><EFBFBD>';
|
|||
|
|
SpeedButton28.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton29.hint := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton30.hint := '<27><><EFBFBD>ϵ<EFBFBD>';
|
|||
|
|
SpeedButton31.hint := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton32.hint := '<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton33.hint := '<27><><EFBFBD><EFBFBD><EFBFBD>ᵵ';
|
|||
|
|
SpeedButton34.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton35.hint := '<27>ᵵ';
|
|||
|
|
SpeedButton36.hint := '<27><>·';
|
|||
|
|
SpeedButton37.hint := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SpeedButton38.hint := 'ù<><C3B9>';
|
|||
|
|
SpeedButton39.hint := '<27><><EFBFBD><EFBFBD>˿'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
SpeedButton40.hint := '<27><>ͷ<EFBFBD><CDB7>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.MJMaoZClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FInt := 1;
|
|||
|
|
FColumn := '';
|
|||
|
|
panel3.Visible := True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.MJLenClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FInt := 2;
|
|||
|
|
FColumn := '';
|
|||
|
|
panel3.Visible := True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitCDGridID();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Tv3CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
exit;
|
|||
|
|
if CDS_MJCD.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_MJCD.fieldbyname('MJID').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitCDGrid();
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from WFB_MJJY where MJID=''' + Trim(CDS_MJID.fieldbyname('MJID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
MJMaoZ.Text := Trim(ADOTmp.fieldbyname('MJMaoZ').AsString);
|
|||
|
|
MJLen.Text := Trim(ADOTmp.fieldbyname('MJLen').AsString);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.FormClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FInt := 4;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button12Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj: string;
|
|||
|
|
begin
|
|||
|
|
if PState < 1 then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(FAPID) = '' then
|
|||
|
|
Exit;
|
|||
|
|
if FInt = 4 then
|
|||
|
|
Exit;
|
|||
|
|
begin
|
|||
|
|
FColumn := Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
|
if Trim(FColumn) <> '' then
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_MJCD.FieldByName(FColumn).AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
with CDS_MJCD do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
if Length(CDS_MJCD.FieldByName(FColumn).AsString) = 1 then
|
|||
|
|
begin
|
|||
|
|
FieldByName(FColumn).Value := null;
|
|||
|
|
FieldByName('CDQty').Value := 0;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName(FColumn).Value := Copy(Trim(FieldByName(FColumn).AsString), 1, Length(Trim(FieldByName(FColumn).AsString)) - 1);
|
|||
|
|
FieldByName('CDQty').Value := FieldByName(FColumn).Value;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmTableInspection.SaveData(MMJType: string): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno, FMJID, BZID, strsql: string;
|
|||
|
|
FMJLen: Double;
|
|||
|
|
FOrder: Integer;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from WFB_MJJY where 1=2');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
if GetLSNo(ADOTmp, maxno, Trim(SCXFlag), 'WFB_MJJY', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').value := Trim(FMainId);
|
|||
|
|
FieldByName('SubId').value := Trim(FSubId);
|
|||
|
|
FieldByName('FromMainId').value := Trim(FMainId);
|
|||
|
|
FieldByName('FromSubId').value := Trim(FSubId);
|
|||
|
|
|
|||
|
|
if Trim(edtDuanMa.Text) <> '' then
|
|||
|
|
FieldByName('DuanMa').value := 'Ⱦ<><C8BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if Trim(edtPinPi.Text) <> '' then
|
|||
|
|
FieldByName('PinPi').value := '<27><>ƴƥ';
|
|||
|
|
|
|||
|
|
FieldByName('APID').value := Trim(FAPID);
|
|||
|
|
FieldByName('MJID').Value := Trim(maxno);
|
|||
|
|
FieldByName('MJStr2').Value := 'δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('MJType').Value := MMJType;
|
|||
|
|
FieldByName('MJXH').Value := 0;
|
|||
|
|
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
|
|||
|
|
FieldByName('JYY1').Value := Trim(JYY1.Text) + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('MJLen').Value := StrToFloatdef(trim(MJLen.Text), 0);
|
|||
|
|
//ë<><C3AB>
|
|||
|
|
FieldByName('MJMaoZ').Value := StrToFloatdef(trim(MJMaoZ.Text), 0);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('MJQty4').Value := StrToFloatdef(trim(MJMaoZ.Text), 0);
|
|||
|
|
|
|||
|
|
if Trim(FMJID) = '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTmp);
|
|||
|
|
end;
|
|||
|
|
if Trim(SCXFlag) <> '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('JTType').Value := Trim(SCXFlag);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
FMJID := Trim(maxno);
|
|||
|
|
FFFMJID := 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('MCID').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTmp, maxno, 'MC', 'WFB_MJJY_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('MCID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from WFB_MJJY_CD ');
|
|||
|
|
sql.Add(' where MCID=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_MJCD.fieldbyname('MCID').AsString) = '' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MJId').Value := Trim(FMJID);
|
|||
|
|
FieldByName('MCID').Value := Trim(maxno);
|
|||
|
|
SSetSaveDataCDSNew(ADOCmd, Tv2, CDS_MJCD, 'WFB_MJJY_CD', 0);
|
|||
|
|
FieldByName('KouFenType').Value := CDS_MJCD.fieldbyname('KouFenType').Value;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
CDS_MJCD.Edit;
|
|||
|
|
CDS_MJCD.FieldByName('MCID').Value := Trim(maxno);
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update WFB_MJJY SET CDList= dbo.F_Get_Order_SubStr(MJID,''MJCDHZSL'')');
|
|||
|
|
sql.Add('where MJID=''' + Trim(FMJID) + ''' ');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>⼰<EFBFBD><E2BCB0><EFBFBD><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Do_JYCRK @MJID=''' + trim(FMJID) + '''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_UPdate_LCKJY @APID=''' + trim(FAPID) + '''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
PState := 0;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.BTPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
mvalue: Double;
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
APID.SetFocus;
|
|||
|
|
Timer1.Enabled := False;
|
|||
|
|
if CheckData('<27><>Ʒ') = False then
|
|||
|
|
exit;
|
|||
|
|
if SaveData('<27><>Ʒ') then
|
|||
|
|
begin
|
|||
|
|
MJLen.Text := '';
|
|||
|
|
MJMaoZ.Text := '';
|
|||
|
|
JYY1.Text := '';
|
|||
|
|
edtDuanMa.Text := '';
|
|||
|
|
edtPinPi.Text := '';
|
|||
|
|
end;
|
|||
|
|
PrtData(FFFMJID);
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
|
|||
|
|
if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MJLen.SetFocus;
|
|||
|
|
Edit1Click(MJLen);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.SetFocus;
|
|||
|
|
Edit1Click(MJMaoZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.PrtData(FMJID: 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_JYLab ');
|
|||
|
|
SQL.Add(' @MJID=''' + Trim(FMJID) + '''');
|
|||
|
|
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;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(ADOQueryPrint.fieldbyname('MJID').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><C6B7>ǩ.rmf', ADOTmp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><>Ʒ<EFBFBD><C6B7>ǩ.rmf';
|
|||
|
|
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
Rm2.DefaultCopies := 2;
|
|||
|
|
RM2.PrintReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.PrtDataG(FSPID: string);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
Txt, fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.*,B.*,C.*,PBFactoryName1=A.PBFactoryName ');
|
|||
|
|
sql.Add('from CK_SXPB_CR A');
|
|||
|
|
sql.Add('inner join JYOrder_Main B on A.ORDMainIdRK=B.MainId');
|
|||
|
|
sql.Add('inner join JYOrder_Sub C on A.ORDSubIdRK=C.SubId');
|
|||
|
|
sql.Add('where SPID=''' + Trim(FAPID) + '''');
|
|||
|
|
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;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(FAPID);
|
|||
|
|
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><C6B7>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>.rmf', ADOTmp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><>Ʒ<EFBFBD><C6B7>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>.rmf';
|
|||
|
|
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
Rm2.DefaultCopies := 2;
|
|||
|
|
RM2.PrintReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Tv2CDQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) <> '' then
|
|||
|
|
begin
|
|||
|
|
CDS_MJCD.Edit;
|
|||
|
|
CDS_MJCD.FieldByName('CDQty').Value := mvalue;
|
|||
|
|
CDS_MJCD.Post;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
CDS_MJCD.Edit;
|
|||
|
|
CDS_MJCD.FieldByName('CDQty').Value := 0;
|
|||
|
|
CDS_MJCD.Post;
|
|||
|
|
end;
|
|||
|
|
CDS_MJCD.Edit;
|
|||
|
|
CDS_MJCD.FieldByName('CDQtyS').Value := mvalue;
|
|||
|
|
except
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>֣<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.SpeedButton1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj: string;
|
|||
|
|
begin
|
|||
|
|
fsj := Trim(TSpeedButton(Sender).Hint);
|
|||
|
|
if Trim(fsj) = '' then
|
|||
|
|
Exit;
|
|||
|
|
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
|||
|
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
|
|||
|
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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 TfrmTableInspection.SpeedButton13Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if CheckData('<27>õ<EFBFBD>') = False then
|
|||
|
|
exit;
|
|||
|
|
Timer1.Enabled := False;
|
|||
|
|
Timer1.Enabled := True;
|
|||
|
|
//<2F><>ʾ<EFBFBD>õ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FCDName := Trim(TSpeedButton(Sender).Hint);
|
|||
|
|
// MovePanel1.Visible := True;
|
|||
|
|
Label21.Caption := Trim(FCDName);
|
|||
|
|
Button1.Click;
|
|||
|
|
//<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 TfrmTableInspection.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 TfrmTableInspection.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);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Edit1.Text := '';
|
|||
|
|
Edit2.Text := '';
|
|||
|
|
CDQty.Text := '';
|
|||
|
|
MovePanel1.Visible := False;
|
|||
|
|
Panel3.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitJP();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button5Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
i: Integer;
|
|||
|
|
mvalue: Double;
|
|||
|
|
begin
|
|||
|
|
if CDS_MJID.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
PrtData(CDS_MJID.fieldbyname('MJID').AsString);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.SpeedButton49Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
InitLCK();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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 TfrmTableInspection.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 TfrmTableInspection.MJstr3KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
Key := #0;
|
|||
|
|
SelectNext(ActiveControl as TWinControl, True, True);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Label9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if trim(Label9.Caption) = 'M' then
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := 'Y';
|
|||
|
|
Label20.Caption := 'Y';
|
|||
|
|
Label7.Caption := 'Y';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := 'M';
|
|||
|
|
Label20.Caption := 'M';
|
|||
|
|
Label7.Caption := 'M';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
RadioGroup1.ItemIndex := -1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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 TfrmTableInspection.Edit7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(Edit7.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Edit7.Text := '<27><>';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit7.Text := '';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.MJQty4KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
BTPrint.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IsCommopen := false;
|
|||
|
|
IsJsMessage := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.MJQty2Change(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal: double;
|
|||
|
|
begin
|
|||
|
|
// MJLen.Text:=format('%.1f',[StrToFloatdef(trim(MJLen.Text),0)- StrToFloatdef(trim(MJQty2.Text),0)]);
|
|||
|
|
{ IF trim(MKXS.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(MKXS.Text,FReal)=true then
|
|||
|
|
begin
|
|||
|
|
// MJLen.Text:=format('%.1f',[StrToFloatdef(trim(MJQty4.Text),0)* StrToFloatdef(trim(MKXS.Text),0)]);
|
|||
|
|
MJLen.Text:=format('%.1f',[StrToFloatdef(trim(MJLen.Text),0)- StrToFloatdef(trim(MJQty2.Text),0)]);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if Trim(MJSJKZ.Text)='' then Exit;
|
|||
|
|
if TryStrToFloat(MJSJKZ.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MJFK.Text)='' then Exit;
|
|||
|
|
if TryStrToFloat(MJFK.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToFloat(MJSJKZ.Text)*StrToFloat(MJFK.Text)=0 then Exit;
|
|||
|
|
if Trim(Label9.Caption)='M' then
|
|||
|
|
begin
|
|||
|
|
//MJLen.Text:=FloatToStr(StrToFloat(MJQty4.Text)*1000*100/StrToFloat(MJSJKZ.Text)/StrToFloat(MJFK.Text));
|
|||
|
|
MJLen.Text:=format('%.1f',[StrToFloat(MJQty4.Text)*1000*100/StrToFloat(MJSJKZ.Text)/StrToFloat(MJFK.Text)]);
|
|||
|
|
MJLen.Text:=format('%.1f',[StrToFloatdef(trim(MJLen.Text),0)- StrToFloatdef(trim(MJQty2.Text),0)]);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
MJLen.Text:=format('%.1f',[StrToFloat(MJQty4.Text)*1000*100/StrToFloat(MJSJKZ.Text)/StrToFloat(MJFK.Text)*1.0936]);
|
|||
|
|
MJLen.Text:=format('%.1f',[StrToFloatdef(trim(MJLen.Text),0)- StrToFloatdef(trim(MJQty2.Text),0)]);
|
|||
|
|
//MJLen.Text:=FloatToStr(StrToFloat(MJQty4.Text)*1000*100/StrToFloat(MJSJKZ.Text)/StrToFloat(MJFK.Text)*1.0936);
|
|||
|
|
// MJLen.Text:=floatToStr(Round(StrToFloat(MJQty4.Text)*1000*100/StrToFloat(MJSJKZ.Text)/StrToFloat(MJFK.Text)*1.0936));
|
|||
|
|
end;
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.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 TfrmTableInspection.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
mvalue: Double;
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
APID.SetFocus;
|
|||
|
|
Timer1.Enabled := False;
|
|||
|
|
if CheckData('<27><>ͷ<EFBFBD><CDB7>') = False then
|
|||
|
|
exit;
|
|||
|
|
if SaveData('<27><>ͷ<EFBFBD><CDB7>') then
|
|||
|
|
begin
|
|||
|
|
MJLen.Text := '';
|
|||
|
|
MJMaoZ.Text := '';
|
|||
|
|
JYY1.Text := '';
|
|||
|
|
edtDuanMa.Text := '';
|
|||
|
|
edtPinPi.Text := '';
|
|||
|
|
end;
|
|||
|
|
PrtData(FFFMJID);
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
|
|||
|
|
if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MJLen.SetFocus;
|
|||
|
|
Edit1Click(MJLen);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.SetFocus;
|
|||
|
|
Edit1Click(MJMaoZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
mvalue: Double;
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
APID.SetFocus;
|
|||
|
|
Timer1.Enabled := False;
|
|||
|
|
if CheckData('<27><><EFBFBD><EFBFBD>Ʒ') = False then
|
|||
|
|
exit;
|
|||
|
|
if SaveData('<27><><EFBFBD><EFBFBD>Ʒ') then
|
|||
|
|
begin
|
|||
|
|
MJLen.Text := '';
|
|||
|
|
MJMaoZ.Text := '';
|
|||
|
|
JYY1.Text := '';
|
|||
|
|
edtDuanMa.Text := '';
|
|||
|
|
edtPinPi.Text := '';
|
|||
|
|
end;
|
|||
|
|
PrtData(FFFMJID);
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
|
|||
|
|
if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MJLen.SetFocus;
|
|||
|
|
Edit1Click(MJLen);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.SetFocus;
|
|||
|
|
Edit1Click(MJMaoZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.edtDuanMaClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(TEdit(Sender).Text) = '' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text := '<27><>';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text := '';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Button7Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
strsql: string;
|
|||
|
|
FCDHZ: string;
|
|||
|
|
begin
|
|||
|
|
if Trim(FAPID) = '' then
|
|||
|
|
Exit;
|
|||
|
|
if CDS_MJCD.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>õ㣬<C3B5><E3A3AC><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Timer1.Enabled := False;
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_SXPB_CR where SPID=''' + Trim(FAPID) + ''' and isnull(CiPinNote,'''')=''' + Trim(TButton(Sender).Caption) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOTmp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ִ<EFBFBD>й<EFBFBD><D0B9>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٴβ<D9B4><CEB2><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>ײ<EFBFBD><D7B2><EFBFBD>Ϊ<EFBFBD><CEAA>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
Panel1.Visible := True;
|
|||
|
|
Panel1.Refresh;
|
|||
|
|
strsql := '<27><><EFBFBD>̿<EFBFBD><CCBF>ţ<EFBFBD>' + FAPID;
|
|||
|
|
TButton(Sender).Enabled := False;
|
|||
|
|
with CDS_MJCD do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(FCDHZ) = '' then
|
|||
|
|
begin
|
|||
|
|
FCDHZ := Trim(fieldbyname('CDName').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FCDHZ := FCDHZ + ',' + Trim(fieldbyname('CDName').AsString);
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update CK_SXPB_CR set SPType=''<27><>Ʒ'',CiPinNote=''' + Trim(TButton(Sender).Caption) + ''',GangCD=''' + FCDHZ + ''' where SPID=' + quotedstr(Trim(FAPID)));
|
|||
|
|
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(TButton(Sender).Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(trim(strsql)));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('Update JYorder_Sub Set CPNoteS1=Null,CPNoteS2=Null where Subid=''' + Trim(FSubId) + '''');
|
|||
|
|
SQL.Add('Update JYorder_Main Set CPNoteM1=Null,CPNoteM2=Null where Mainid=''' + Trim(FMainId) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
if Trim(TButton(Sender).Caption) = '<27><><EFBFBD>״<EFBFBD>Ʒ,<2C><><EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('Update JYorder_Sub Set CPNoteS1=dbo.F_Get_Order_SubStr(''' + Trim(FSubId) + ''',''CPNoteS1'')');
|
|||
|
|
sql.Add(' where subid=''' + Trim(FSubId) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('Update JYorder_Main Set CPNoteM1=dbo.F_Get_Order_SubStr(''' + Trim(FMainId) + ''',''CPNoteM1'')');
|
|||
|
|
sql.Add(' where Mainid=''' + Trim(FMainId) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(TButton(Sender).Caption) = '<27><><EFBFBD>ײ<EFBFBD><D7B2>ֺܲ<DCB2><EEA3AC><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('Update JYorder_Sub Set CPNoteS2=dbo.F_Get_Order_SubStr(''' + Trim(FSubId) + ''',''CPNoteS2'')');
|
|||
|
|
sql.Add(' where subid=''' + Trim(FSubId) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('Update JYorder_Main Set CPNoteM2=dbo.F_Get_Order_SubStr(''' + Trim(FMainId) + ''',''CPNoteM2'')');
|
|||
|
|
sql.Add(' where Mainid=''' + Trim(FMainId) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
SendMessage(FAPID, Trim(lblFactoryName.Caption), Trim(FOrderNo), trim(TButton(Sender).Caption) + ' <20>õ㣺' + FCDHZ);
|
|||
|
|
PrtDataG(FAPID);
|
|||
|
|
TButton(Sender).Enabled := True;
|
|||
|
|
Panel1.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.SendMessage(Mfsid, MFactory, MorderNo, key2str: string);
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' exec P_View_ZJCPTS ' + quotedstr(Trim(Mfsid)));
|
|||
|
|
// ShowMessage(SQL.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTmp, CDS_WXTS);
|
|||
|
|
SInitCDSData20(ADOTmp, CDS_WXTS);
|
|||
|
|
|
|||
|
|
CDS_WXTS.First;
|
|||
|
|
while not CDS_WXTS.eof do
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('select * from WeixinMessage where 1<>1');
|
|||
|
|
Open;
|
|||
|
|
Append;
|
|||
|
|
FieldByName('MessageType').Value := 'OrderProgress';
|
|||
|
|
FieldByName('MessageName').Value := '<27><><EFBFBD>ײ<EFBFBD><D7B2>ܲ<EFBFBD>';
|
|||
|
|
FieldByName('Title').Value := '<27><><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ײ<EFBFBD><D7B2>ܲ<EFBFBD>'; //first data
|
|||
|
|
//FieldByName('URL').Value := 'pages/grayfabric-repairOut/gdConfirm?spid=' + Trim(Mfsid);
|
|||
|
|
FieldByName('OpenId').Value := Trim(CDS_WXTS.FieldByName('wxid').AsString);
|
|||
|
|
FieldByName('Status').Value := '0';
|
|||
|
|
FieldByName('CreateDate').Value := FormatDateTime('yyyymmdd', SGetServerDateTime(ADOTmp));
|
|||
|
|
FieldByName('CreateTime').Value := FormatDateTime('HH:mm:ss', SGetServerDateTime(ADOTmp));
|
|||
|
|
FieldByName('BusinessId').Value := Trim(Mfsid); //
|
|||
|
|
FieldByName('KeyWord1').Value := Trim(MorderNo); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('KeyWord2').Value := Trim(key2str); //
|
|||
|
|
FieldByName('remark').Value := Trim(MFactory + ',<2C>ţ<D7BA>' + FGangNo); //remark
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
CDS_WXTS.Next;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTableInspection.Timer1Timer(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|