增加码尺

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-07-23 14:39:21 +08:00
parent f0ef50a40f
commit 6a9ac5cf47
3 changed files with 110 additions and 27 deletions

View File

@ -400,7 +400,7 @@ type
{ Private declarations }
FInt, PState, PrintInt, SCInitGrid, FState, FCK: Integer;
FColumn, FBanZu, FAPID, FMainId, FSubId, FFFMJID: string;
FJZ, FJC, FDC: Double;
FJZ, FJC, FDC, FPRTmachi: Double;
fRollType, fRollType1, fbaotype, fbaosx: string;
isCommopen, IsJsMessage: boolean;
MValue, FCDName, MggCDFalg: string;
@ -696,7 +696,7 @@ begin
// closeCom(FComFile);
Th := LoadLibrary(Pchar(trim(DllNameT)));
if Th > 0 then
begin
begin
try
Tp := GetProcAddress(Th, 'CommOpen');
if Tp <> nil then
@ -710,7 +710,7 @@ begin
else
IsCommOpen := true;
end
else
else
begin
IsCommOpen := false;
end;
@ -1229,7 +1229,8 @@ begin
end
else
begin
FieldByName('MJLen').Value := StrToFloatdef(trim(MJLen.Text), 0) - StrToFloatdef(trim(MJQty2.Text), 0) + fjc;
FieldByName('MJLen').Value := format('%.' + trim(fxsws) + 'f', [(StrToFloatdef(trim(MJLen.Text), 0) / FPRTmachi) - StrToFloatdef(trim(MJQty2.Text), 0) + fjc]);
end;
FieldByName('MJQty1').Value := StrToFloatdef(trim(MJQty1.Text), 0);
@ -2647,6 +2648,7 @@ begin
FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString);
FJZ := ADOTmp.fieldbyname('jiazhong').AsFloat;
FJC := ADOTmp.fieldbyname('jiachang').AsFloat;
FPRTmachi := ADOTmp.fieldbyname('PRTmachi').AsFloat;
FDC := StrToFloatDef(ADOTmp.fieldbyname('DC').asstring, 0);
fbaotype := Trim(ADOTmp.fieldbyname('baotype').AsString);
fbaosx := Trim(ADOTmp.fieldbyname('baosx').AsString);

View File

@ -164,23 +164,31 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
Visible = False
OnClick = ToolButton14Click
end
object ToolButton7: TToolButton
object ToolButton16: TToolButton
Left = 348
Top = 30
AutoSize = True
Caption = #30721#23610#35774#32622
ImageIndex = 60
OnClick = ToolButton16Click
end
object ToolButton7: TToolButton
Left = 435
Top = 30
AutoSize = True
Caption = #39044#35272#21367#26631#31614
ImageIndex = 12
OnClick = ToolButton7Click
end
object ToolButton15: TToolButton
Left = 447
Left = 534
Top = 30
Caption = #39044#35272#20013#25991#26631#31614
ImageIndex = 57
OnClick = ToolButton15Click
end
object ToolButton8: TToolButton
Left = 554
Left = 641
Top = 30
AutoSize = True
Caption = #39044#35272#21253#26631#31614
@ -189,7 +197,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton8Click
end
object PiZhong: TEdit
Left = 653
Left = 740
Top = 30
Width = 121
Height = 30
@ -202,7 +210,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
TabOrder = 0
end
object TBClose: TToolButton
Left = 774
Left = 861
Top = 30
AutoSize = True
Caption = #20851#38381
@ -688,6 +696,12 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
Visible = False
Width = 60
end
object Tv1Column6: TcxGridDBColumn
Caption = #30721#23610
DataBinding.FieldName = 'PRTmachi'
HeaderAlignmentHorz = taCenter
Width = 60
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1

View File

@ -1,7 +1,7 @@
unit U_ProductOrderLBNameSet;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
@ -10,21 +10,20 @@ uses
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, StrUtils, Menus, cxDropDownEdit,
cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter;
cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore,
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter;
type
TfrmProductOrderLBNameSet = class(TForm)
@ -42,7 +41,7 @@ type
cxGrid1: TcxGrid;
cxGridPopupMenu1: TcxGridPopupMenu;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
Label3: TLabel;
@ -131,6 +130,8 @@ type
ToolButton13: TToolButton;
ToolButton14: TToolButton;
ToolButton15: TToolButton;
ToolButton16: TToolButton;
Tv1Column6: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -167,6 +168,7 @@ type
procedure Tv1Column2PropertiesEditValueChanged(Sender: TObject);
procedure Tv1Column5PropertiesEditValueChanged(Sender: TObject);
procedure ToolButton15Click(Sender: TObject);
procedure ToolButton16Click(Sender: TObject);
private
DQdate: TDateTime;
procedure InitGrid();
@ -1522,7 +1524,7 @@ var
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
Mixtext: TMixtext;
begin
if Order_Main.IsEmpty then
exit;
@ -1568,5 +1570,70 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.ToolButton16Click(Sender: TObject);
var
FPiZhong: string;
FReal: Double;
begin
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Exit;
end;
if Trim(PiZhong.Text) = '' then
begin
Application.MessageBox('码尺不能为空!', '提示', 0);
Exit;
end;
if TryStrToFloat(PiZhong.Text, FReal) = False then
begin
Application.MessageBox('码尺非法数字!', '提示', 0);
Exit;
end;
with order_Main do
begin
first;
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Sub Set PRTmachi=' + Trim(PiZhong.Text));
sql.Add(' where Subid=''' + Trim(Order_Main.fieldbyname('Subid').AsString) + '''');
ExecSQL;
end;
with Order_Main do
begin
Edit;
FieldByName('PRTmachi').Value := PiZhong.Text;
Post;
end;
end;
next;
end;
end;
CheckBox1.Checked := False;
with Order_Main do
begin
DisableControls;
first;
while not Eof do
begin
edit;
fieldbyname('Ssel').AsBoolean := False;
post;
next;
end;
first;
EnableControls;
end;
end;
end.