2572 lines
74 KiB
ObjectPascal
2572 lines
74 KiB
ObjectPascal
|
|
unit U_MarkingInspection;
|
|||
|
|
|
|||
|
|
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, dxCore, ActiveX,
|
|||
|
|
StrUtils, 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, cxContainer, cxImage;
|
|||
|
|
{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
|
|||
|
|
TZintSymbol = packed record
|
|||
|
|
symbology: Integer;
|
|||
|
|
height: Integer;
|
|||
|
|
whitespace_width: Integer;
|
|||
|
|
border_width: Integer;
|
|||
|
|
output_options: Integer;
|
|||
|
|
fgcolour: array[0..9] of AnsiChar;
|
|||
|
|
bgcolour: array[0..9] of AnsiChar;
|
|||
|
|
outfile: array[0..255] of AnsiChar;
|
|||
|
|
scale: Single;
|
|||
|
|
option_1: Integer;
|
|||
|
|
option_2: Integer;
|
|||
|
|
option_3: Integer;
|
|||
|
|
show_hrt: Integer;
|
|||
|
|
input_mode: Integer;
|
|||
|
|
eci: Integer;
|
|||
|
|
text: array[0..127] of AnsiChar;
|
|||
|
|
rows: Integer;
|
|||
|
|
width: Integer;
|
|||
|
|
primary: array[0..127] of AnsiChar;
|
|||
|
|
encoded_data: array[0..199, 0..142] of AnsiChar;
|
|||
|
|
row_height: array[0..199] of Integer; // Largest symbol is 189 x 189
|
|||
|
|
errtxt: array[0..99] of AnsiChar;
|
|||
|
|
bitmap: PAnsiChar;
|
|||
|
|
bitmap_width: Integer;
|
|||
|
|
bitmap_height: Integer;
|
|||
|
|
bitmap_byte_length: Cardinal;
|
|||
|
|
dot_size: Single;
|
|||
|
|
rendered: Pointer;
|
|||
|
|
debug: Integer;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
PZintSymbol = ^TZintSymbol;
|
|||
|
|
|
|||
|
|
const
|
|||
|
|
// Tbarcode 7 codes
|
|||
|
|
BARCODE_QRCODE = 71;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmMarkingInspection = 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;
|
|||
|
|
SpeedButton14: TSpeedButton;
|
|||
|
|
SpeedButton15: TSpeedButton;
|
|||
|
|
SpeedButton16: TSpeedButton;
|
|||
|
|
SpeedButton22: TSpeedButton;
|
|||
|
|
SpeedButton23: TSpeedButton;
|
|||
|
|
SpeedButton24: TSpeedButton;
|
|||
|
|
SpeedButton25: TSpeedButton;
|
|||
|
|
SpeedButton31: TSpeedButton;
|
|||
|
|
SpeedButton32: TSpeedButton;
|
|||
|
|
SpeedButton33: TSpeedButton;
|
|||
|
|
SpeedButton34: TSpeedButton;
|
|||
|
|
SpeedButton40: TSpeedButton;
|
|||
|
|
SpeedButton41: TSpeedButton;
|
|||
|
|
SpeedButton42: TSpeedButton;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
ADOQueryMainDSC: TADOQuery;
|
|||
|
|
SpeedButton45: TSpeedButton;
|
|||
|
|
SpeedButton50: TSpeedButton;
|
|||
|
|
SpeedButton51: TSpeedButton;
|
|||
|
|
SpeedButton54: TSpeedButton;
|
|||
|
|
SpeedButton55: TSpeedButton;
|
|||
|
|
SpeedButton59: TSpeedButton;
|
|||
|
|
SpeedButton62: TSpeedButton;
|
|||
|
|
SpeedButton63: TSpeedButton;
|
|||
|
|
SpeedButton64: TSpeedButton;
|
|||
|
|
SpeedButton70: TSpeedButton;
|
|||
|
|
SpeedButton71: TSpeedButton;
|
|||
|
|
SpeedButton72: TSpeedButton;
|
|||
|
|
SpeedButton73: TSpeedButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
MJLen: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
MJMaoZ: 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;
|
|||
|
|
MJQty3: TEdit;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
MJQty4: TEdit;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
MovePanel1: TMovePanel;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
Label19: 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;
|
|||
|
|
SpeedButton20: TSpeedButton;
|
|||
|
|
SpeedButton27: TSpeedButton;
|
|||
|
|
SpeedButton28: TSpeedButton;
|
|||
|
|
SpeedButton35: TSpeedButton;
|
|||
|
|
SpeedButton52: TSpeedButton;
|
|||
|
|
SpeedButton53: TSpeedButton;
|
|||
|
|
SpeedButton60: TSpeedButton;
|
|||
|
|
SpeedButton61: TSpeedButton;
|
|||
|
|
SpeedButton77: TSpeedButton;
|
|||
|
|
SpeedButton78: TSpeedButton;
|
|||
|
|
SpeedButton79: TSpeedButton;
|
|||
|
|
SpeedButton80: TSpeedButton;
|
|||
|
|
v3Column4: TcxGridDBColumn;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
MJStr4: TEdit;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
v3Column5: TcxGridDBColumn;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
RM3: TRMGridReport;
|
|||
|
|
mjxh: TEdit;
|
|||
|
|
ADOTmp: TADOQuery;
|
|||
|
|
MKXS: TEdit;
|
|||
|
|
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;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
lblcolor: TLabel;
|
|||
|
|
JYY1: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
v3Column6: TcxGridDBColumn;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
KuanHao: TEdit;
|
|||
|
|
QryCheckNet: TADOQuery;
|
|||
|
|
v3Column7: TcxGridDBColumn;
|
|||
|
|
cxSplitter1: TcxSplitter;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Button6: TButton;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
LabDJTS: TLabel;
|
|||
|
|
ADOQueryTS: TADOQuery;
|
|||
|
|
Tv3Column1: TcxGridDBColumn;
|
|||
|
|
MJFK: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
MJKZ1: TEdit;
|
|||
|
|
MJKZ2: TEdit;
|
|||
|
|
MJKZ3: TEdit;
|
|||
|
|
Tv3Column2: TcxGridDBColumn;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
ComboBox2: TComboBox;
|
|||
|
|
DJPrice: TEdit;
|
|||
|
|
cxImage1: TcxImage;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
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 MJQty4Exit(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure MJMaoZChange(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 ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure MJStr4Change(Sender: TObject);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure Timer1Timer(Sender: TObject);
|
|||
|
|
procedure Label9DblClick(Sender: TObject);
|
|||
|
|
procedure ComboBox2Change(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
FColumn, FAPID, FMainId, FSubId, FFFMJID, FOperationStatus, FYXJL, FJHGZ, FXSGZ, FIsOutRange, FMF, FKZ, FUnit, FCustomerNoName: string;
|
|||
|
|
FMaxQty, FMinQty, FMaxWet, FMinWet, FMaxXS, FMinXS: Double;
|
|||
|
|
FCDName: string;
|
|||
|
|
isCommopen, IsJsMessage: boolean;
|
|||
|
|
fxsType, fRollType: string;
|
|||
|
|
KZAvg: Integer;
|
|||
|
|
function SelfConnData(): Boolean;
|
|||
|
|
procedure tsewm(); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>
|
|||
|
|
procedure tsewm4(); //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC>
|
|||
|
|
function GetEWM(Txt, TMMC: string): string; //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|||
|
|
procedure InitJP(); //ˢ<>´õ<C2B4>ѡ<EFBFBD><D1A1>
|
|||
|
|
procedure InitCDGrid(); //ˢ<>´õ<C2B4><C3B5><EFBFBD>Ϣ
|
|||
|
|
procedure InitCDGridID(); //ˢ<>¼<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(FMJID: string); //<2F><>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>ǩ
|
|||
|
|
procedure QuantityConversion(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
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;
|
|||
|
|
FKHEWM,FBZHXMS: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
const
|
|||
|
|
LibName = 'zint.dll';
|
|||
|
|
|
|||
|
|
//struct zint_symbol *ZBarcode_Create(void);
|
|||
|
|
function ZBarcode_Create(): PZintSymbol; cdecl; external LibName;
|
|||
|
|
|
|||
|
|
//void ZBarcode_Delete(struct zint_symbol *symbol);
|
|||
|
|
procedure ZBarcode_Delete(symbol: PZintSymbol); cdecl; external LibName;
|
|||
|
|
|
|||
|
|
//int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol, unsigned char *input, int length, int rotate_angle);
|
|||
|
|
function ZBarcode_Encode_and_Buffer(symbol: PZintSymbol; input: PAnsiChar; length, rotate_angle: Integer): Integer; cdecl; external LibName;
|
|||
|
|
|
|||
|
|
// create bitmap <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Bitmap<61>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>zint<6E><74><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD>zint.hͷ<68>ļ<EFBFBD><C4BC>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>zint.hͷ<68>ļ<EFBFBD><C4BC>С<EFBFBD>
|
|||
|
|
|
|||
|
|
procedure ZBarcode_To_Bitmap(symbol: PZintSymbol; const ABitmap: TBitmap);
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmMarkingInspection: TfrmMarkingInspection;
|
|||
|
|
newh, newh1: hwnd;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, U_ZDYHelp, U_iniParam, U_ProductOrderListSel, U_MFSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure ZBarcode_To_Bitmap(symbol: PZintSymbol; const ABitmap: TBitmap);
|
|||
|
|
var
|
|||
|
|
SrcRGB: PRGBTriple;
|
|||
|
|
Row, RowWidth: Integer;
|
|||
|
|
begin
|
|||
|
|
ABitmap.PixelFormat := pf24bit;
|
|||
|
|
ABitmap.Height := symbol.bitmap_height;
|
|||
|
|
ABitmap.Width := symbol.bitmap_width;
|
|||
|
|
|
|||
|
|
// ABitmap.Height := 80;
|
|||
|
|
// ABitmap.Width := 80;
|
|||
|
|
|
|||
|
|
SrcRGB := Pointer(symbol.bitmap);
|
|||
|
|
RowWidth := symbol.bitmap_width * 3;
|
|||
|
|
|
|||
|
|
for Row := 0 to symbol.bitmap_height - 1 do
|
|||
|
|
begin
|
|||
|
|
CopyMemory(ABitmap.ScanLine[Row], SrcRGB, RowWidth);
|
|||
|
|
Inc(SrcRGB, symbol.bitmap_width);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
SetBitmapBits(ABitmap.Handle, symbol.bitmap_width * symbol.bitmap_height * 3, symbol.bitmap);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.tsewm();
|
|||
|
|
var
|
|||
|
|
lvData: UTF8String; // ʹ<><CAB9>UTF8<46><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
lvBitMap: TBitmap;
|
|||
|
|
lvSymbol: PZintSymbol;
|
|||
|
|
lvErrorNumber: Integer;
|
|||
|
|
lvErrorText: string;
|
|||
|
|
bitmap: TBitmap;
|
|||
|
|
begin
|
|||
|
|
lvSymbol := ZBarcode_Create();
|
|||
|
|
if lvSymbol = nil then
|
|||
|
|
Exit;
|
|||
|
|
lvBitMap := TBitmap.Create;
|
|||
|
|
try //'010872020901234590RS9999-100R1011234567893112005160'
|
|||
|
|
lvData := UTF8String(FKHEWM);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪQRCODE
|
|||
|
|
lvSymbol.symbology := BARCODE_QRCODE;
|
|||
|
|
// lvSymbol.option_2 := 1;
|
|||
|
|
//Data Matrix <20><>ISO 16022<32><32>(and HIBC)
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
lvErrorNumber := ZBarcode_Encode_and_Buffer(lvSymbol, PAnsiChar(lvData), Length(lvData), 0);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>
|
|||
|
|
if lvErrorNumber = 0 then
|
|||
|
|
begin
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Bitmapͼ<70><CDBC>
|
|||
|
|
ZBarcode_To_Bitmap(lvSymbol, lvBitMap);
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE>Image<67><65>
|
|||
|
|
cxImage1.Picture.Bitmap.Width := 80;
|
|||
|
|
cxImage1.Picture.Bitmap.Height := 80;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.Brush.Color := clWhite;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.FillRect(Rect(0, 0, cxImage1.Width, cxImage1.Height));
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.StretchDraw(Rect(10, 10, cxImage1.Width - 10, cxImage1.Height - 10), lvBitMap);
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
cxImage1.Picture.Bitmap.Width := cxImage1.Width;
|
|||
|
|
cxImage1.Picture.Bitmap.Height := cxImage1.Height;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.Brush.Color := clWhite;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.FillRect(Rect(0, 0, cxImage1.Width, cxImage1.Height));
|
|||
|
|
lvErrorText := string(AnsiString(lvSymbol.errtxt));
|
|||
|
|
ShowMessage('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + lvErrorText);
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
lvBitMap.Free;
|
|||
|
|
lvBitMap := nil;
|
|||
|
|
ZBarcode_Delete(lvSymbol);
|
|||
|
|
end;
|
|||
|
|
bitmap := TBitmap.Create;
|
|||
|
|
try
|
|||
|
|
bitmap.Assign(cxImage1.Picture.Bitmap);
|
|||
|
|
bitmap.SaveToFile(ExtractFilePath(Application.ExeName) + 'image\temp3.bmp');
|
|||
|
|
finally
|
|||
|
|
bitmap.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.tsewm4();
|
|||
|
|
var
|
|||
|
|
lvData: UTF8String; // ʹ<><CAB9>UTF8<46><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
|||
|
|
lvBitMap: TBitmap;
|
|||
|
|
lvSymbol: PZintSymbol;
|
|||
|
|
lvErrorNumber: Integer;
|
|||
|
|
lvErrorText: string;
|
|||
|
|
bitmap: TBitmap;
|
|||
|
|
begin
|
|||
|
|
lvSymbol := ZBarcode_Create();
|
|||
|
|
if lvSymbol = nil then
|
|||
|
|
Exit;
|
|||
|
|
lvBitMap := TBitmap.Create;
|
|||
|
|
try //'010872020901234590RS9999-100R1011234567893112005160'
|
|||
|
|
lvData := UTF8String(FBZHXMS);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΪQRCODE
|
|||
|
|
lvSymbol.symbology := BARCODE_QRCODE;
|
|||
|
|
// lvSymbol.option_2 := 1;
|
|||
|
|
//Data Matrix <20><>ISO 16022<32><32>(and HIBC)
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
lvErrorNumber := ZBarcode_Encode_and_Buffer(lvSymbol, PAnsiChar(lvData), Length(lvData), 0);
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>
|
|||
|
|
if lvErrorNumber = 0 then
|
|||
|
|
begin
|
|||
|
|
// <20><><EFBFBD><EFBFBD>Bitmapͼ<70><CDBC>
|
|||
|
|
ZBarcode_To_Bitmap(lvSymbol, lvBitMap);
|
|||
|
|
// <20><>ʾ<EFBFBD><CABE>Image<67><65>
|
|||
|
|
cxImage1.Picture.Bitmap.Width := 80;
|
|||
|
|
cxImage1.Picture.Bitmap.Height := 80;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.Brush.Color := clWhite;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.FillRect(Rect(0, 0, cxImage1.Width, cxImage1.Height));
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.StretchDraw(Rect(10, 10, cxImage1.Width - 10, cxImage1.Height - 10), lvBitMap);
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
cxImage1.Picture.Bitmap.Width := cxImage1.Width;
|
|||
|
|
cxImage1.Picture.Bitmap.Height := cxImage1.Height;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.Brush.Color := clWhite;
|
|||
|
|
cxImage1.Picture.Bitmap.Canvas.FillRect(Rect(0, 0, cxImage1.Width, cxImage1.Height));
|
|||
|
|
lvErrorText := string(AnsiString(lvSymbol.errtxt));
|
|||
|
|
ShowMessage('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + lvErrorText);
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
lvBitMap.Free;
|
|||
|
|
lvBitMap := nil;
|
|||
|
|
ZBarcode_Delete(lvSymbol);
|
|||
|
|
end;
|
|||
|
|
bitmap := TBitmap.Create;
|
|||
|
|
try
|
|||
|
|
bitmap.Assign(cxImage1.Picture.Bitmap);
|
|||
|
|
bitmap.SaveToFile(ExtractFilePath(Application.ExeName) + 'image\temp4.bmp');
|
|||
|
|
finally
|
|||
|
|
bitmap.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.QuantityConversion();
|
|||
|
|
var
|
|||
|
|
MLen, MNWet, MGWet, MPWet, MCC: Double;
|
|||
|
|
begin
|
|||
|
|
MLen := StrToFloatdef(trim(MJLen.Text), 0);
|
|||
|
|
MNWet := StrToFloatdef(trim(MJQty4.Text), 0);
|
|||
|
|
MPWet := StrToFloatdef(trim(MJQty3.Text), 0);
|
|||
|
|
MGWet := StrToFloatdef(trim(MJMaoZ.Text), 0);
|
|||
|
|
MCC := StrToFloatdef(trim(MKXS.Text), 0);
|
|||
|
|
|
|||
|
|
MNWet := MGWet - MPWet;
|
|||
|
|
MJQty4.Text := FloatToStr(MNWet);
|
|||
|
|
if MCC > 0 then
|
|||
|
|
begin
|
|||
|
|
MLen := StrToFloat(format('%.1f', [MNWet * MCC]));
|
|||
|
|
MJLen.Text := FloatToStr(MLen);
|
|||
|
|
end;
|
|||
|
|
// if FXSGZ = '<27><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>' then
|
|||
|
|
// begin
|
|||
|
|
// if MNWet > 0 then
|
|||
|
|
// begin
|
|||
|
|
// MCC := StrToFloat(format('%.1f', [MLen / MNWet]));
|
|||
|
|
// MKXS.Text := FloatToStr(MCC);
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmMarkingInspection.SelfConnData(): Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
with QryCheckNet do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
//<2F><>ѯһ<D1AF><D2BB>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
SQL.Add('select getdate()');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
Result := true;
|
|||
|
|
except
|
|||
|
|
// if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>磡','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
if not Assigned(DataLink_DyeingFinishingPlan) then
|
|||
|
|
DataLink_DyeingFinishingPlan := TDataLink_DyeingFinishingPlan.Create(Application);
|
|||
|
|
try
|
|||
|
|
with DataLink_DyeingFinishingPlan.ADOLink do
|
|||
|
|
begin
|
|||
|
|
//if not Connected then
|
|||
|
|
begin
|
|||
|
|
Connected := false;
|
|||
|
|
ConnectionString := DConString;
|
|||
|
|
LoginPrompt := false;
|
|||
|
|
Connected := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Result := true;
|
|||
|
|
except
|
|||
|
|
Result := false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmMarkingInspection.CheckData(CKType: string): Boolean;
|
|||
|
|
var
|
|||
|
|
mvalue: Double;
|
|||
|
|
SJAPID: string;
|
|||
|
|
begin
|
|||
|
|
FIsOutRange := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
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
|
|||
|
|
{with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select top 1 APID from WFB_MJJY where SubId=' + quotedstr(Trim(FSubId)));
|
|||
|
|
SQL.Add(' and APID<>' + quotedstr(Trim(FAPID)));
|
|||
|
|
SQL.Add(' and MJStr4=' + quotedstr(Trim(MJStr4.Text)));
|
|||
|
|
// ShowMessage(SQL.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if not ADOTmp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
SJAPID:=Trim(ADOTmp.fieldbyname('APID').asstring);
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select MaxGangNo=Cast(Max(Cast(MJStr4 as int))+1 as varchar(20)) from WFB_MJJY where SubId=' + quotedstr(Trim(FSubId)));
|
|||
|
|
sql.Add('and ISNUMERIC(MJStr4)=1 ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox(PChar('<27><EFBFBD> '+Trim(MJStr4.Text)+' <20>ѱ<EFBFBD>' + SJAPID + 'ռ<><D5BC>,<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create(PChar('<27><EFBFBD> '+Trim(MJStr4.Text)+' <20>ѱ<EFBFBD>' + SJAPID + 'ռ<><D5BC>,<2C>Ƽ<EFBFBD><C6BC><EFBFBD> '+Trim(ADOTmp.fieldbyname('MaxGangNo').AsString)));
|
|||
|
|
end;
|
|||
|
|
end;}
|
|||
|
|
if trim(Label9.Caption) = '' then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ȵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
|
|
|||
|
|
if (strtofloatdef(trim(MJLen.Text), 0) = 0) and (strtofloatdef(trim(MJQty4.Text), 0) = 0) then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܶ<EFBFBD>Ϊ0!!');
|
|||
|
|
|
|||
|
|
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD>
|
|||
|
|
if strtofloatdef(trim(MJMaoZ.Text), 0) > FMaxWet then
|
|||
|
|
begin
|
|||
|
|
FIsOutRange := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ';
|
|||
|
|
if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + floattostr(FMaxWet) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + floattostr(FMaxWet) + '!');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJMaoZ.Text), 0) < FMinWet then
|
|||
|
|
begin
|
|||
|
|
FIsOutRange := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ';
|
|||
|
|
if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,<2C><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>' + floattostr(FMinWet) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>' + floattostr(FMinWet) + '!');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F>жϳ<D0B6><CFB3><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD>
|
|||
|
|
if strtofloatdef(trim(MJLen.Text), 0) > FMaxQty then
|
|||
|
|
begin
|
|||
|
|
FIsOutRange := '<27><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>Χ';
|
|||
|
|
if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,<2C><><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>' + floattostr(FMaxQty) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>' + floattostr(FMaxQty) + '!');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if strtofloatdef(trim(MJLen.Text), 0) < FMinQty then
|
|||
|
|
begin
|
|||
|
|
FIsOutRange := '<27><><EFBFBD>ȳ<EFBFBD><C8B3><EFBFBD>Χ';
|
|||
|
|
if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,<2C><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>' + floattostr(FMinQty) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>' + floattostr(FMinQty) + '!');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F>ж<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>Ƿ<EFBFBD><C7B7>Ϸ<EFBFBD>
|
|||
|
|
// if Trim(MKXS.Text) <> '' then
|
|||
|
|
// begin
|
|||
|
|
// if TryStrToFloat(MKXS.Text, mvalue) = False then
|
|||
|
|
// begin
|
|||
|
|
// raise Exception.Create('ϵ<><CFB5>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
|
// end
|
|||
|
|
// else
|
|||
|
|
// begin
|
|||
|
|
// if FMaxXS = 0 then
|
|||
|
|
// FMaxXS := 44;
|
|||
|
|
// if FMinXS = 0 then
|
|||
|
|
// FMinXS := 0;
|
|||
|
|
//
|
|||
|
|
// if strtofloatdef(trim(MKXS.Text), 0) > FMaxXS then
|
|||
|
|
// begin
|
|||
|
|
// FIsOutRange := 'ϵ<><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ';
|
|||
|
|
// if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,ϵ<><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + floattostr(FMaxXS) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
// begin
|
|||
|
|
// raise Exception.Create('ϵ<><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + floattostr(FMaxXS) + '!');
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// if strtofloatdef(trim(MKXS.Text), 0) < FMinXS then
|
|||
|
|
// begin
|
|||
|
|
// FIsOutRange := 'ϵ<><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ';
|
|||
|
|
// if Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣,ϵ<><CFB5>С<EFBFBD><D0A1>' + floattostr(FMinXS) + ',<2C><>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
// begin
|
|||
|
|
// raise Exception.Create('ϵ<><CFB5>С<EFBFBD><D0A1>' + floattostr(FMinXS) + '!');
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := false;
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.ClearGlobal();
|
|||
|
|
begin
|
|||
|
|
FAPID := '';
|
|||
|
|
FJHGZ := '';
|
|||
|
|
FMainId := '';
|
|||
|
|
FSubId := '';
|
|||
|
|
FFFMJID := '';
|
|||
|
|
MJFK.Text := '';
|
|||
|
|
MJKZ1.Text := '';
|
|||
|
|
MJKZ2.Text := '';
|
|||
|
|
MJKZ3.Text := '';
|
|||
|
|
lblOrderNo.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
lblMPRTCodeName.Caption := 'Ʒ<><C6B7>';
|
|||
|
|
lblcolor.Caption := '<27><>ɫ';
|
|||
|
|
MJXH.Text := '';
|
|||
|
|
MJstr4.Text := '';
|
|||
|
|
KuanHao.Text := '';
|
|||
|
|
MKXS.Text := '';
|
|||
|
|
AOrdDefNote1.Text := '';
|
|||
|
|
MJQty3.Text := '';
|
|||
|
|
MJQty4.Text := '';
|
|||
|
|
JYY1.Text := '';
|
|||
|
|
Label13.Caption := 'ʵ<><CAB5>ƽ<EFBFBD><C6BD>ϵ<EFBFBD><CFB5>:';
|
|||
|
|
Label14.Caption := '<27><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>:';
|
|||
|
|
FMaxQty := 0;
|
|||
|
|
FMinQty := 0;
|
|||
|
|
FMaxWet := 0;
|
|||
|
|
FMinWet := 0;
|
|||
|
|
FMaxXS := 0;
|
|||
|
|
FMinXS := 0;
|
|||
|
|
ComboBox2.ItemIndex := -1;
|
|||
|
|
DJPrice.Text := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C>ֿ<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 TfrmMarkingInspection.InitDDB();
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_BanCP_CR where MJID=''' + 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.MJID,D.MJXH,D.MKXS,D.MJMaoZ,D.MJQty3,D. MJQty4,D.MJLen ');
|
|||
|
|
sql.Add(',SYGH=(select Z.MJStr4 from (select top 1 max(MJStr4)MJStr4,min(filltime)filltime from WFB_MJJY X where X.mainid=B.mainid GROUP BY MJStr4 order by filltime desc)Z)');
|
|||
|
|
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('inner join WFB_MJJY D on D.APID=A.SPID');
|
|||
|
|
sql.Add('where MJType=''<27><><EFBFBD><EFBFBD>'' and MJID=''' + 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);
|
|||
|
|
FFFMJID := Trim(ADOTmp.fieldbyname('MJID').AsString);
|
|||
|
|
lblOrderNo.Caption := Trim(ADOTmp.fieldbyname('OrderNo').AsString);
|
|||
|
|
Label23.Caption := '<27><>һ<EFBFBD><D2BB>:' + Trim(ADOTmp.fieldbyname('SYGH').AsString);
|
|||
|
|
lblMPRTCodeName.Caption := Trim(ADOTmp.fieldbyname('MPRTCodeName').AsString);
|
|||
|
|
lblcolor.Caption := trim(ADOTmp.fieldbyname('PRTColor').AsString);
|
|||
|
|
MJXH.Text := Trim(ADOTmp.fieldbyname('MJXH').AsString);
|
|||
|
|
MJstr4.Text := Trim(ADOTmp.fieldbyname('rcgangNo').AsString);
|
|||
|
|
MKXS.Text := Trim(ADOTmp.fieldbyname('Xs').AsString);
|
|||
|
|
AOrdDefNote1.Text := '<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);
|
|||
|
|
// MJQty3.Text := Trim(ADOTmp.fieldbyname('PiZhong').AsString);
|
|||
|
|
MKXS.Text := Trim(ADOTmp.fieldbyname('MKXS').AsString);
|
|||
|
|
MJMaoZ.Text := Trim(ADOTmp.fieldbyname('MJMaoZ').AsString);
|
|||
|
|
MJQty3.Text := Trim(ADOTmp.fieldbyname('MJQty3').AsString);
|
|||
|
|
MJQty4.Text := Trim(ADOTmp.fieldbyname('MJQty4').AsString);
|
|||
|
|
MJLen.Text := Trim(ADOTmp.fieldbyname('MJLen').AsString);
|
|||
|
|
if Trim(ADOTmp.fieldbyname('OrderUnit').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
Label19.Caption := Label9.Caption;
|
|||
|
|
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;
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
APID.Text := '';
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.InitLCK();
|
|||
|
|
var
|
|||
|
|
FReal: Integer;
|
|||
|
|
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 and X.MJType =''<27><>Ʒ'' ),0)');
|
|||
|
|
sql.Add(',SYGH=(select Z.MJStr4 from (select top 1 max(MJStr4)MJStr4,min(filltime)filltime from WFB_MJJY X where X.mainid=B.mainid GROUP BY MJStr4 order by filltime desc)Z)');
|
|||
|
|
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;
|
|||
|
|
if ADOTmp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
FAPID := Trim(APID.Text);
|
|||
|
|
FMainId := Trim(ADOTmp.fieldbyname('ORDMainIdRK').AsString);
|
|||
|
|
FSubId := Trim(ADOTmp.fieldbyname('ORDSubIdRK').AsString);
|
|||
|
|
FYXJL := Trim(ADOTmp.fieldbyname('YXJL').AsString);
|
|||
|
|
FJHGZ := Trim(ADOTmp.fieldbyname('JHGZ').AsString);
|
|||
|
|
FXSGZ := Trim(ADOTmp.fieldbyname('XSGZ').AsString);
|
|||
|
|
FCustomerNoName := Trim(ADOTmp.fieldbyname('CustomerNoName').AsString);
|
|||
|
|
if Trim(ADOTmp.fieldbyname('IsHg').AsString) = '<27><><EFBFBD>ϸ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
if Trim(ADOTmp.fieldbyname('IsQr').AsString) <> '<27><>ȷ<EFBFBD><C8B7>' then
|
|||
|
|
begin
|
|||
|
|
APID.Text := '';
|
|||
|
|
Application.MessageBox('<27><>ɫϵͳδͨ<CEB4><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
FMF := Trim(ADOTmp.fieldbyname('MPRTMF').AsString);
|
|||
|
|
FMF := Copy(FMF, 1, 3);
|
|||
|
|
if TryStrToInt(FMF, FReal) = False then
|
|||
|
|
begin
|
|||
|
|
APID.Text := '';
|
|||
|
|
Application.MessageBox('<27><>װָʾ<D6B8><CABE><EFBFBD>ŷ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
FKZ := Trim(ADOTmp.fieldbyname('MPRTKZ').AsString);
|
|||
|
|
FKZ := Copy(FKZ, 1, Pos('G', FKZ) - 1);
|
|||
|
|
if TryStrToInt(FKZ, FReal) = False then
|
|||
|
|
begin
|
|||
|
|
APID.Text := '';
|
|||
|
|
Application.MessageBox('<27><>װָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if FJHGZ = '<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
mjxh.ReadOnly := False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
mjxh.ReadOnly := True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
MJXH.Text := Trim(ADOTmp.fieldbyname('maxRoll').AsString);
|
|||
|
|
//MJstr4.Text := Trim(ADOTmp.fieldbyname('rcgangNo').AsString);
|
|||
|
|
lblOrderNo.Caption := Trim(ADOTmp.fieldbyname('OrderNo').AsString);
|
|||
|
|
Label23.Caption := '<27><>һ<EFBFBD><D2BB>:' + Trim(ADOTmp.fieldbyname('SYGH').AsString);
|
|||
|
|
lblMPRTCodeName.Caption := Trim(ADOTmp.fieldbyname('MPRTCodeName').AsString);
|
|||
|
|
lblcolor.Caption := trim(ADOTmp.fieldbyname('PRTColor').AsString);
|
|||
|
|
Label14.Caption := '<27><><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>:' + trim(ADOTmp.fieldbyname('LLXS').AsString);
|
|||
|
|
|
|||
|
|
MKXS.Text := Trim(ADOTmp.fieldbyname('Xs').AsString);
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + '<27><>װҪ<D7B0><D2AA>:' + Trim(ADOTmp.fieldbyname('MPRTBZNote').AsString);
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + #13 + '<27>ŷ<EFBFBD>:' + Trim(ADOTmp.fieldbyname('MPRTMF').AsString);
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + #13 + '<27><><EFBFBD><EFBFBD>:' + Trim(ADOTmp.fieldbyname('MPRTKZ').AsString);
|
|||
|
|
|
|||
|
|
FMaxQty := ADOTmp.fieldbyname('MaxQty').AsFloat;
|
|||
|
|
FMinQty := ADOTmp.fieldbyname('MinQty').AsFloat;
|
|||
|
|
FMaxWet := ADOTmp.fieldbyname('MaxWet').AsFloat;
|
|||
|
|
FMinWet := ADOTmp.fieldbyname('MinWet').AsFloat;
|
|||
|
|
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + #13 + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ:' + Trim(ADOTmp.fieldbyname('MinQty').AsString) + '-' + Trim(ADOTmp.fieldbyname('MaxQty').AsString);
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + #13 + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ:' + Trim(ADOTmp.fieldbyname('MinWet').AsString) + '-' + Trim(ADOTmp.fieldbyname('MaxWet').AsString);
|
|||
|
|
|
|||
|
|
AOrdDefNote1.Text := AOrdDefNote1.Text + #13 + '<27>ر<EFBFBD><D8B1><EFBFBD>ʾ:' + Trim(ADOTmp.fieldbyname('Note').AsString);
|
|||
|
|
MJQty3.Text := Trim(ADOTmp.fieldbyname('PiZhong').AsString);
|
|||
|
|
FUnit := Trim(ADOTmp.fieldbyname('OrderUnit').AsString);
|
|||
|
|
if FUnit <> '' then
|
|||
|
|
begin
|
|||
|
|
if FUnit <> 'Kg' then
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := FUnit;
|
|||
|
|
Label9.Font.Color := clRed;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := 'M';
|
|||
|
|
label9.Font.Color := clBlue;
|
|||
|
|
end;
|
|||
|
|
Label19.Caption := Label9.Caption;
|
|||
|
|
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;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> <20><><EFBFBD><EFBFBD>
|
|||
|
|
FMaxQty := ADOTmp.fieldbyname('MaxQty').AsFloat;
|
|||
|
|
FMinQty := ADOTmp.fieldbyname('MinQty').AsFloat;
|
|||
|
|
FMaxWet := ADOTmp.fieldbyname('MaxWet').AsFloat;
|
|||
|
|
FMinWet := ADOTmp.fieldbyname('MinWet').AsFloat;
|
|||
|
|
FMaxXS := ADOTmp.fieldbyname('MaxXS').AsFloat;
|
|||
|
|
FMinXS := ADOTmp.fieldbyname('MinXS').AsFloat;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
ClearGlobal();
|
|||
|
|
end;
|
|||
|
|
if Trim(lblOrderNo.Caption) = '' then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
APID.Text := '';
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmMarkingInspection := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.InitCDGrid();
|
|||
|
|
begin
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from WFB_MJJY_CD where MJID=' + quotedstr(Trim(FFFMJID)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_MJCD);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_MJCD);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.InitCDGridID();
|
|||
|
|
var
|
|||
|
|
MMJQty4, MMJLen: double;
|
|||
|
|
begin
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.*');
|
|||
|
|
sql.Add(',JXXS=(case when MJQty4>0 then round(MJLen/MJQty4,2) else 0 end)');
|
|||
|
|
sql.Add(',PCBFB=(Case when ISNUMERIC(RTrim(CC.LLXS))=1 then Cast((MJLen/MJQty4-Cast(LLXS as decimal(18,4)))*1.00/LLXS as decimal(18,2))*100 ');
|
|||
|
|
sql.Add(' else Null end)');
|
|||
|
|
sql.Add('from WFB_MJJY A inner join JYOrder_Main CC on A.MainId=CC.MainId ');
|
|||
|
|
sql.Add(' where APID=''' + Trim(FAPID) + '''');
|
|||
|
|
// sql.Add('and A.Filler<>''Ů<><C5AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
if Trim(SCXFlag) <> '' then
|
|||
|
|
sql.Add(' and A.JTType=''' + Trim(SCXFlag) + '''');
|
|||
|
|
sql.Add(' and A.Filler=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(' and A.MJstr2=''δ<><CEB4><EFBFBD><EFBFBD>'' ');
|
|||
|
|
// showmessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_MJID);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_MJID);
|
|||
|
|
if TV3.DataController.Summary.FooterSummaryValues[1] <> NULL then
|
|||
|
|
MMJLen := TV3.DataController.Summary.FooterSummaryValues[1]
|
|||
|
|
else
|
|||
|
|
MMJLen := 0;
|
|||
|
|
if TV3.DataController.Summary.FooterSummaryValues[3] <> NULL then
|
|||
|
|
MMJQty4 := TV3.DataController.Summary.FooterSummaryValues[3]
|
|||
|
|
else
|
|||
|
|
MMJQty4 := 0;
|
|||
|
|
|
|||
|
|
if MMJQty4 > 0 then
|
|||
|
|
Label13.Caption := 'ʵ<><CAB5>ƽ<EFBFBD><C6BD>ϵ<EFBFBD><CFB5>:' + floattostr(RoundFloat(MMJLen / MMJQty4, 2))
|
|||
|
|
else
|
|||
|
|
Label13.Caption := 'ʵ<><CAB5>ƽ<EFBFBD><C6BD>ϵ<EFBFBD><CFB5>:';
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitJP();
|
|||
|
|
InitCDGrid();
|
|||
|
|
|
|||
|
|
if trim(Edit7.Text) = '<27><>' then
|
|||
|
|
IsJsMessage := true;
|
|||
|
|
|
|||
|
|
if trim(fmanage) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
|
begin
|
|||
|
|
if trim(DllName) <> '' then
|
|||
|
|
OpenCom(DllName);
|
|||
|
|
if trim(JCYDLL) <> '' then
|
|||
|
|
OpenCom(JCYDLL);
|
|||
|
|
Edit7.Visible := true;
|
|||
|
|
Label35.Visible := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 > 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 TfrmMarkingInspection.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 TfrmMarkingInspection.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno, FMJID, BZID, strsql, khewm: string;
|
|||
|
|
FMJLen: Double;
|
|||
|
|
begin
|
|||
|
|
if FOperationStatus = '<27><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
FMJID := FFFMJID;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FMJID := '';
|
|||
|
|
end;
|
|||
|
|
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 MJId=''' + Trim(FMJID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FMJID) = '' then
|
|||
|
|
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;
|
|||
|
|
Randomize;
|
|||
|
|
maxno := maxno + RightStr(inttostr(1000 + Random(100) + 1), 2);
|
|||
|
|
|
|||
|
|
if FCustomerNoName = 'Kni' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTmp, khewm, '', 'WFB_MJJYkh', 7, 0) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('khewm').value := '910200739' + Trim(khewm);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(FMJID);
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').value := Trim(FMainId);
|
|||
|
|
FieldByName('SubId').value := Trim(FSubId);
|
|||
|
|
FieldByName('FromMainId').value := Trim(FMainId);
|
|||
|
|
FieldByName('FromSubId').value := Trim(FSubId);
|
|||
|
|
FieldByName('APId').value := Trim(FAPID);
|
|||
|
|
FieldByName('MJID').Value := Trim(maxno);
|
|||
|
|
FieldByName('MJStr2').Value := 'δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('JYY1').Value := Trim(JYY1.Text) + '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
|
|||
|
|
// FieldByName('JYMF').Value := Trim(JYMF.Text); //<2F><><EFBFBD><EFBFBD><EFBFBD>ŷ<EFBFBD>
|
|||
|
|
FieldByName('MJstr4').Value := Trim(MJstr4.Text); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('KuanHao').Value := Trim(KuanHao.Text); //<2F><><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('mjxh').Value := strtointdef(trim(mjxh.Text), 0);
|
|||
|
|
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('MJLen').Value := StrToFloatdef(trim(MJLen.Text), 0);
|
|||
|
|
//Ƥ<><C6A4>
|
|||
|
|
FieldByName('MJQty3').Value := StrToFloatdef(trim(MJQty3.Text), 0);
|
|||
|
|
//ë<><C3AB>
|
|||
|
|
FieldByName('MJMaoZ').Value := StrToFloatdef(trim(MJMaoZ.Text), 0);
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('MJQty4').Value := StrToFloatdef(trim(MJMaoZ.Text), 0) - StrToFloatdef(trim(MJQty3.Text), 0);
|
|||
|
|
//ϵ<><CFB5>
|
|||
|
|
FieldByName('MKXS').Value := StrToFloatdef(trim(MKXS.Text), 0);
|
|||
|
|
//<2F><>Χ
|
|||
|
|
FieldByName('IsOutRange').Value := FIsOutRange;
|
|||
|
|
FieldByName('DJPrice').Value := StrToFloatdef(trim(DJPrice.Text), 0);
|
|||
|
|
if Trim(Edit3.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MJType').Value := '<27><>Ʒ';
|
|||
|
|
end;
|
|||
|
|
if Trim(Edit4.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MJType').Value := '<27><>Ʒ';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(FMJID) = '' 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 := Trim(SCXFlag);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
|
|||
|
|
//<2F>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
FieldByName('MJFK').Value := Trim(MJFK.Text);
|
|||
|
|
if Trim(MJKZ1.Text) <> '' then
|
|||
|
|
FieldByName('MJKZ1').Value := Trim(MJKZ1.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('MJKZ1').Value := Null;
|
|||
|
|
if Trim(MJKZ2.Text) <> '' then
|
|||
|
|
FieldByName('MJKZ2').Value := Trim(MJKZ2.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('MJKZ2').Value := Null;
|
|||
|
|
if Trim(MJKZ3.Text) <> '' then
|
|||
|
|
FieldByName('MJKZ3').Value := Trim(MJKZ3.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('MJKZ3').Value := Null;
|
|||
|
|
FieldByName('MJKZAvg').Value := KZAvg;
|
|||
|
|
//<2F>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ʵ<EFBFBD>ʿ<EFBFBD><CABF><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update WFB_MJJY Set MJSJKZ=MJMaoZ*1000/(MJFK*0.01*MJLen) where (MJFK*0.01*MJLen)>0 and MJID=''' + Trim(maxno) + ''' and isnull(MJTypeOther,'''')=''M'' ');
|
|||
|
|
sql.Add('Update WFB_MJJY Set MJSJKZ=MJMaoZ*1000/(MJFK*0.01*MJLen*0.9144) where (MJFK*0.01*MJLen*0.9144)>0 and MJID=''' + Trim(maxno) + ''' and isnull(MJTypeOther,'''')=''Y'' ');
|
|||
|
|
sql.Add('Update WFB_MJJY Set MJSJKZ=MJKZAvg where MJID=''' + Trim(maxno) + ''' and isnull(MJTypeOther,'''')=''Kg'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>ʵ<EFBFBD>ʿ<EFBFBD><CABF><EFBFBD>
|
|||
|
|
if FJHGZ = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update WFB_MJJY SET mjxh=1+isnull((select cast (max(mjxh) as int) from WFB_MJJY X where X.subID=WFB_MJJY.subID and X.MJstr4=WFB_MJJY.Mjstr4 and X.APID=WFB_MJJY.APID and X.MJID<>WFB_MJJY.MJID and X.MJType =''<27><>Ʒ''),0)');
|
|||
|
|
sql.Add('where MJID=''' + Trim(maxno) + '''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>Ʒ<EFBFBD>ľ<EFBFBD><C4BE>Ÿ<EFBFBD>Ϊ0
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update WFB_MJJY SET mjxh=0 ');
|
|||
|
|
sql.Add('where MJType =''<27><>Ʒ'' and MJID=''' + Trim(maxno) + '''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD>Ľ<DEB8><C4BD><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select MJXH from WFB_MJJY');
|
|||
|
|
sql.Add('where MJID=''' + Trim(maxno) + '''');
|
|||
|
|
open;
|
|||
|
|
if not IsEmpty then
|
|||
|
|
begin
|
|||
|
|
MJXH.Text := fieldbyname('mjxh').AsString;
|
|||
|
|
end;
|
|||
|
|
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;
|
|||
|
|
//<2F><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Update_JYFenShu @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 TfrmMarkingInspection.BTPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile, SJAPID, TJGangNo: string;
|
|||
|
|
mvalue: Double;
|
|||
|
|
i, j, KZHZ: Integer;
|
|||
|
|
begin
|
|||
|
|
APID.SetFocus;
|
|||
|
|
if SelfConnData() = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><C2B1><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
{if Trim(JYMF.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToInt(JYMF.Text,i)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>֣<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToInt(JYMF.Text)<130 then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>130<33><30>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToInt(JYMF.Text)>180 then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>180<38><30>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
//Application.MessageBox('<27>ŷ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>д<EFBFBD><D0B4>','<27><>ʾ',0);
|
|||
|
|
//Exit;
|
|||
|
|
end;}
|
|||
|
|
if Trim(ComboBox2.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(DJPrice.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MJFK.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToInt(MJFK.Text, i) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if StrToFloat(FMF) * 1.1 < StrToFloat(MJFK.Text) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToFloat(MJFK.Text) * 1.1 < StrToFloat(FMF) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
j := 0;
|
|||
|
|
KZHZ := 0;
|
|||
|
|
|
|||
|
|
if Trim(MJKZ1.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToInt(MJKZ1.Text, i) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>طǷ<D8B7><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < StrToFloat(MJKZ1.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.8 < StrToFloat(MJKZ1.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < (StrToFloat(MJKZ1.Text) * 0.3333) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + (StrToInt(MJKZ1.Text) div 3);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(MJKZ1.Text) * 1.3 < StrToFloat(FKZ) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + StrToInt(MJKZ1.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
j := j + 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(MJKZ2.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToInt(MJKZ2.Text, i) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>طǷ<D8B7><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < StrToFloat(MJKZ2.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.8 < StrToFloat(MJKZ2.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < (StrToFloat(MJKZ2.Text) * 0.3333) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + (StrToInt(MJKZ2.Text) div 3);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(MJKZ2.Text) * 1.3 < StrToFloat(FKZ) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + StrToInt(MJKZ2.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
j := j + 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(MJKZ3.Text) <> '' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToInt(MJKZ3.Text, i) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>طǷ<D8B7><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < StrToFloat(MJKZ3.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.8 < StrToFloat(MJKZ3.Text) then
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(FKZ) * 1.3 < (StrToFloat(MJKZ3.Text) * 0.3333) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + (StrToInt(MJKZ3.Text) div 3);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if StrToFloat(MJKZ3.Text) * 1.3 < StrToFloat(FKZ) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KZHZ := KZHZ + StrToInt(MJKZ3.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
j := j + 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if j = 0 then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
KZAvg := KZHZ div j;
|
|||
|
|
|
|||
|
|
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 WFB_MJJY where APID=' + quotedstr(Trim(FAPID)));
|
|||
|
|
SQL.Add(' and mjxh=' + Trim(mjxh.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;
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select top 1 APID from WFB_MJJY where SubId=' + quotedstr(Trim(FSubId)));
|
|||
|
|
SQL.Add(' and APID<>' + quotedstr(Trim(FAPID)));
|
|||
|
|
SQL.Add(' and MJStr4=' + quotedstr(Trim(MJStr4.Text)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if not ADOTmp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
SJAPID := Trim(ADOTmp.fieldbyname('APID').asstring);
|
|||
|
|
{with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select MaxGangNo=Cast(Max(Cast(MJStr4 as int))+1 as varchar(20)) from WFB_MJJY where SubId=' + quotedstr(Trim(FSubId)));
|
|||
|
|
sql.Add('and ISNUMERIC(MJStr4)=1 ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
TJGangNo:=Trim(ADOTmp.fieldbyname('MaxGangNo').AsString);
|
|||
|
|
if Application.MessageBox(PChar('<27><EFBFBD> '+Trim(MJStr4.Text)+' <20>ѱ<EFBFBD>' + SJAPID + 'ռ<><D5BC>,<2C>Ƽ<EFBFBD><C6BC><EFBFBD> '+TJGangNo+' ,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC>ţ<D7BA>'), '<27><>ʾ', 32 + 4) <> IDYES then Exit;}
|
|||
|
|
//MJStr4.Text:=Trim(TJGangNo);
|
|||
|
|
if Application.MessageBox(PChar('<27><EFBFBD> ' + Trim(MJStr4.Text) + ' <20>ѱ<EFBFBD>' + SJAPID + 'ռ<><D5BC>,ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
MJStr4.Text := '';
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
// BTPrint.Click;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
MJLen.Text := '';
|
|||
|
|
MJMaoZ.Text := '';
|
|||
|
|
MJQty4.Text := '';
|
|||
|
|
Edit3.Text := '<27><>';
|
|||
|
|
Edit4.Text := '';
|
|||
|
|
MJXH.Text := inttostr(strTointdef(trim(MJXH.Text), 0) + 1);
|
|||
|
|
//JYFenShu.ItemIndex:=-1;
|
|||
|
|
if Trim(Edit6.Text) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
PrtData(FFFMJID);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
FOperationStatus := '';
|
|||
|
|
FFFMJID := '';
|
|||
|
|
InitCDGridID();
|
|||
|
|
InitCDGrid();
|
|||
|
|
if FYXJL = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MJLen.SetFocus;
|
|||
|
|
Edit1Click(MJLen);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.SetFocus;
|
|||
|
|
Edit1Click(MJMaoZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmMarkingInspection.GetEWM(Txt, TMMC: string): string; //<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
|||
|
|
var
|
|||
|
|
fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\' + TMMC + '.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);
|
|||
|
|
Result := fImagePath;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.PrtData(FMJID: string);
|
|||
|
|
var
|
|||
|
|
fPrintFile, FBQName, FEWMID, FKHM: string;
|
|||
|
|
fImagePath1, fImagePath2, fImagePath3, fImagePath4: string;
|
|||
|
|
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;
|
|||
|
|
FBQName := Trim(ADOQueryPrint.fieldbyname('LBName').AsString);
|
|||
|
|
|
|||
|
|
FKHM := Trim(ADOQueryPrint.fieldbyname('SubNote').AsString) + RightStr(('100000' + floattostr((ADOQueryPrint.fieldbyname('MJLen').asfloat) * 100)), 5);
|
|||
|
|
fImagePath1 := GetEWM(Trim(ADOQueryPrint.fieldbyname('MJID').AsString), 'temp1');
|
|||
|
|
fImagePath2 := GetEWM(Trim(ADOQueryPrint.fieldbyname('KHEWM').AsString), 'temp2');
|
|||
|
|
// fImagePath3 := GetEWM(Trim(FKHM), 'temp3');
|
|||
|
|
if Trim(ADOQueryPrint.fieldbyname('KHEWM').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
fImagePath3 := ExtractFilePath(Application.ExeName) + 'image\temp3.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath3) then
|
|||
|
|
DeleteFile(fImagePath3);
|
|||
|
|
|
|||
|
|
FKHEWM := Trim(ADOQueryPrint.fieldbyname('KHEWM').AsString); //+ RightStr(('100000' + floattostr((ADOQueryPrint.fieldbyname('MJLen').asfloat) * 100)), 5)
|
|||
|
|
tsewm();
|
|||
|
|
// ToolButton6.Click();
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
fImagePath4 := ExtractFilePath(Application.ExeName) + 'image\temp4.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath4) then
|
|||
|
|
DeleteFile(fImagePath4);
|
|||
|
|
FBZHXMS := Trim(ADOQueryPrint.fieldbyname('SubNote').AsString)+ RightStr(('100000' + floattostr((ADOQueryPrint.fieldbyname('MJLen').asfloat) * 100)), 5);
|
|||
|
|
tsewm4();
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ExportFtErpFile(Trim(ADOQueryPrint.fieldbyname('LBName').AsString) + '.rmf', ADOTmp);
|
|||
|
|
if Trim(FBQName) <> '' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(FBQName) + '.rmf'
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
ExportFtErpFile('ͨ<><CDA8>Ӣ<EFBFBD>ı<EFBFBD>ǩ.rmf', ADOTmp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͨ<><CDA8>Ӣ<EFBFBD>ı<EFBFBD>ǩ.rmf';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath1;
|
|||
|
|
RMVariables['KHQRBARCODE'] := fImagePath2;
|
|||
|
|
RMVariables['KHMQRBARCODE'] := fImagePath3;
|
|||
|
|
RMVariables['BHMQRBARCODE'] := fImagePath4;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
Rm2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
|
|||
|
|
Sleep(500);
|
|||
|
|
RM2.PrintReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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(Edit2.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('CDQty').Value:=StrToFloat(Edit2.Text)-StrToFloat(Edit1.Text);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FieldByName('CDQty').Value:=0;
|
|||
|
|
end; }
|
|||
|
|
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Edit1.Text := '';
|
|||
|
|
Edit2.Text := '';
|
|||
|
|
CDQty.Text := '';
|
|||
|
|
MovePanel1.Visible := False;
|
|||
|
|
Panel3.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitJP();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.SpeedButton49Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
ClearGlobal();
|
|||
|
|
FOperationStatus := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
InitLCK();
|
|||
|
|
// if Pos('KK', APID.Text) > 0 then
|
|||
|
|
// begin
|
|||
|
|
//
|
|||
|
|
// end
|
|||
|
|
// else
|
|||
|
|
// begin
|
|||
|
|
// FOperationStatus := '<27><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>';
|
|||
|
|
// InitDDB();
|
|||
|
|
// end;
|
|||
|
|
//
|
|||
|
|
// MJQty4.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.Edit6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(Edit6.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Edit6.Text := '<27><>';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit6.Text := '';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.MJstr3KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
Key := #0;
|
|||
|
|
SelectNext(ActiveControl as TWinControl, True, True);
|
|||
|
|
end;
|
|||
|
|
// if Key = #13 then
|
|||
|
|
// begin
|
|||
|
|
// BTPrint.Click;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.MJQty4Exit(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if (trim(MJMaoZ.Text) = '') and (trim(MJQty4.Text) = '') then
|
|||
|
|
exit;
|
|||
|
|
if (trim(MJMaoZ.Text) = '') and (trim(MJQty3.Text) = '') then
|
|||
|
|
exit;
|
|||
|
|
if (trim(MJQty4.Text) = '') and (trim(MJQty3.Text) = '') then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if (trim(MJQty3.Text) = '') then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if (trim(MJQty4.Text) <> '') then
|
|||
|
|
begin
|
|||
|
|
MJMaoZ.Text := floattostr(strtofloatdef(trim(MJQty3.Text), 0) + strtofloatdef(trim(MJQty4.Text), 0));
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
RadioGroup1.ItemIndex := -1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.MJMaoZChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
QuantityConversion();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.Edit7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(Edit7.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Edit7.Text := '<27><>';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit7.Text := '';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.MJQty4KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
BTPrint.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IsCommopen := false;
|
|||
|
|
IsJsMessage := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.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 TfrmMarkingInspection.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 TfrmMarkingInspection.ToolButton3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
SRKOrdID, strsql: string;
|
|||
|
|
begin
|
|||
|
|
ToolButton3.Enabled := false;
|
|||
|
|
|
|||
|
|
if Trim(MJStr4.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<D7BA>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(FAPID) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1>ָʾ<D6B8><CABE><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(FSubId) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add(' exec P_Chk_DMRK' + quotedstr(trim(FAPID)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(ADOTmp.FieldByName('msg').AsString) <> '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox(PChar(Trim(ADOTmp.FieldByName('msg').AsString)), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
ToolButton3.Enabled := true;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
begin
|
|||
|
|
ToolButton3.Enabled := true;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if GetLSNo(ADOTmp, SRKOrdID, 'RK', 'CK_BanCP_CR', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
with Self.ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
|
|||
|
|
sql.Add('UPDATE CK_BanCP_CR Set ');
|
|||
|
|
sql.add('RKOrdID=' + quotedstr(trim(SRKOrdID)));
|
|||
|
|
sql.Add(' where CK_BanCP_CR.APID=' + quotedstr(trim(FAPID)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.MainId=' + quotedstr(trim(FMainId)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.SubId=' + quotedstr(trim(FSubId)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.ganghao=' + quotedstr(trim(MJStr4.Text)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.CRFlag=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
|
|||
|
|
sql.Add('UPDATE CK_BanCP_CR Set ');
|
|||
|
|
sql.add(' CRTime=getdate(),CRType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where CK_BanCP_CR.APID=' + quotedstr(trim(FAPID)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.MainId=' + quotedstr(trim(FMainId)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.SubId=' + quotedstr(trim(FSubId)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.ganghao=' + quotedstr(trim(MJStr4.Text)));
|
|||
|
|
sql.Add(' and CK_BanCP_CR.CRFlag=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
|
|||
|
|
sql.Add('UPDATE WFB_MJJY Set ');
|
|||
|
|
sql.add('RKOrdID=' + quotedstr(trim(SRKOrdID)) + ' ,MJStr2=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where WFB_MJJY.APID=' + quotedstr(trim(FAPID)));
|
|||
|
|
sql.Add(' and WFB_MJJY.MainId=' + quotedstr(trim(FMainId)));
|
|||
|
|
sql.Add(' and WFB_MJJY.SubId=' + quotedstr(trim(FSubId)));
|
|||
|
|
sql.Add(' and WFB_MJJY.MJStr4=' + quotedstr(trim(MJStr4.Text)));
|
|||
|
|
SQL.Add('and WFB_MJJY.MJStr2=''δ<><CEB4><EFBFBD><EFBFBD>'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_OrderHZ :MainId');
|
|||
|
|
Parameters.ParamByName('MainId').Value := Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
PrintCKMDG(Trim(SRKOrdID));
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
ToolButton3.Enabled := true;
|
|||
|
|
application.MessageBox('<27><><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
ToolButton3.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.Tv3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
FMJLen, FMJMaoZ, Fsunhao: Double;
|
|||
|
|
begin
|
|||
|
|
// FMJLen := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('MJLen').Index];
|
|||
|
|
// FMJMaoZ := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('MJMaoZ').Index];
|
|||
|
|
// if (FMJLen < 10) or (FMJLen > 200) then
|
|||
|
|
// begin
|
|||
|
|
// ACanvas.Brush.Color := $B5E4FF;
|
|||
|
|
// end;
|
|||
|
|
// if (FMJMaoZ < 5) or (FMJMaoZ > 40) then
|
|||
|
|
// begin
|
|||
|
|
// ACanvas.Brush.Color := $B5E4FF;
|
|||
|
|
// end
|
|||
|
|
if TcxGridDBTableView(Sender).GetColumnByFieldName('IsOutRange').Index = null then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('PCBFB').Index] = null then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('IsOutRange').Index] <> '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
ACanvas.Brush.Color := $004080FF; //$B5E4FF
|
|||
|
|
Fsunhao := AViewInfo.GridRecord.Values[TcxGridDBTableView(Sender).GetColumnByFieldName('PCBFB').Index];
|
|||
|
|
if Fsunhao < 0 then
|
|||
|
|
Fsunhao := -Fsunhao;
|
|||
|
|
if Fsunhao >= 15 then
|
|||
|
|
ACanvas.Brush.Color := clGreen;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.MJStr4Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
KuanHao.Text := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.Button6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
{try
|
|||
|
|
frmMFSel := TfrmMFSel.Create(Application);
|
|||
|
|
with frmMFSel do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.JYMF.Text := FSDPerson;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmMFSel.Free;
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.Timer1Timer(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTS do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_DJ_CarTS :CarNo');
|
|||
|
|
Parameters.ParamByName('CarNo').Value := Trim(SCXFlag);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTS.IsEmpty = false then
|
|||
|
|
begin
|
|||
|
|
LabDJTS.Visible := True;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
LabDJTS.Visible := False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.Label9DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(FUnit) <> 'Kg' then
|
|||
|
|
Exit;
|
|||
|
|
if trim(Label9.Caption) = 'M' then
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := 'Y';
|
|||
|
|
Label19.Caption := 'Y';
|
|||
|
|
Label20.Caption := 'Y';
|
|||
|
|
Label7.Caption := 'Y';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Label9.Caption := 'M';
|
|||
|
|
Label19.Caption := 'M';
|
|||
|
|
Label20.Caption := 'M';
|
|||
|
|
Label7.Caption := 'M';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMarkingInspection.ComboBox2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(ComboBox2.Text) = 'ȫ<><C8AB><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
DJPrice.Text := '1.8';
|
|||
|
|
end
|
|||
|
|
else if Trim(ComboBox2.Text) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
DJPrice.Text := '1.3';
|
|||
|
|
end
|
|||
|
|
else if Trim(ComboBox2.Text) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
DJPrice.Text := '0.7';
|
|||
|
|
end
|
|||
|
|
else if Trim(ComboBox2.Text) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
DJPrice.Text := '0.01';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|