This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-07-18 16:15:41 +08:00
parent 07fc581124
commit a527b963f4
3 changed files with 165 additions and 45 deletions

View File

@ -352,7 +352,7 @@ type
{ Private declarations } { Private declarations }
FInt, PState, PrintInt, SCInitGrid, FState, FCK: Integer; FInt, PState, PrintInt, SCInitGrid, FState, FCK: Integer;
FColumn, FBanZu, FAPID, FMainId, FSubId, FFFMJID: string; FColumn, FBanZu, FAPID, FMainId, FSubId, FFFMJID: string;
FJZ, FJC, FDC: Double; FJZ, FJC, FDC, Fmachi: Double;
fRollType, fRollType1, fbaotype, fbaosx: string; fRollType, fRollType1, fbaotype, fbaosx: string;
isCommopen, IsJsMessage: boolean; isCommopen, IsJsMessage: boolean;
MValue, FCDName, MggCDFalg: string; MValue, FCDName, MggCDFalg: string;
@ -1097,7 +1097,9 @@ begin
end end
else else
begin begin
FieldByName('MJLen').Value := StrToFloatdef(trim(MJLen.Text), 0) + fjc; // FieldByName('MJLen').Value := StrToFloatdef(trim(MJLen.Text), 0) + fjc;
FieldByName('MJLen').Value := format('%.' + trim(fxsws) + 'f', [StrToFloatdef(trim(MJLen.Text), 0) * Fmachi + fjc]);
end; end;
FieldByName('MJQty1').Value := StrToFloatdef(trim(MJQty1.Text), 0); FieldByName('MJQty1').Value := StrToFloatdef(trim(MJQty1.Text), 0);
@ -2466,21 +2468,21 @@ begin
if TryStrToFloat(MJQty4.Text, FReal) = False then if TryStrToFloat(MJQty4.Text, FReal) = False then
Exit; Exit;
if Trim(MJQty3.Text) <> '' then // if Trim(MJQty3.Text) <> '' then
begin // begin
if TryStrToFloat(MJQty3.Text, FReal) = False then // if TryStrToFloat(MJQty3.Text, FReal) = False then
Exit; // Exit;
// jz := StrToFloat(MJMaoZ.Text) - StrToFloat(MJQty3.Text); //// jz := StrToFloat(MJMaoZ.Text) - StrToFloat(MJQty3.Text);
// MJQty4.Text := format('%.' + trim(fxsws1) + 'f', [jz]); //// MJQty4.Text := format('%.' + trim(fxsws1) + 'f', [jz]);
mz := StrToFloat(MJQty4.Text) + StrToFloat(MJQty3.Text); // mz := StrToFloat(MJQty4.Text) + StrToFloat(MJQty3.Text);
MJMaoZ.Text := format('%.' + trim(fxsws1) + 'f', [mz]); // MJMaoZ.Text := format('%.' + trim(fxsws1) + 'f', [mz]);
//
end // end
else // else
begin // begin
// MJQty4.Text := MJMaoZ.Text; //// MJQty4.Text := MJMaoZ.Text;
MJMaoZ.Text := MJQty4.Text; // MJMaoZ.Text := MJQty4.Text;
end; // end;
if Edit11.Text = '' then if Edit11.Text = '' then
begin begin
@ -2502,17 +2504,17 @@ begin
end; end;
if TryStrToFloat(MJMaoZ.Text, FReal) = False then if TryStrToFloat(MJMaoZ.Text, FReal) = False then
Exit; Exit;
// if Trim(MJQty3.Text) <> '' then if Trim(MJQty3.Text) <> '' then
// begin begin
// if TryStrToFloat(MJQty3.Text, FReal) = False then if TryStrToFloat(MJQty3.Text, FReal) = False then
// Exit; Exit;
// jz := StrToFloat(MJMaoZ.Text) - StrToFloat(MJQty3.Text); jz := StrToFloat(MJMaoZ.Text) - StrToFloat(MJQty3.Text);
// MJQty4.Text := format('%.' + trim(fxsws1) + 'f', [jz]); MJQty4.Text := format('%.' + trim(fxsws1) + 'f', [jz]);
// end end
// else else
// begin begin
// MJQty4.Text := MJMaoZ.Text; MJQty4.Text := MJMaoZ.Text;
// end; end;
if Edit11.Text <> '' then if Edit11.Text <> '' then
begin begin
if (strtofloatdef(trim(kmxs.Text), 0) <> 0) and (strtofloatdef(trim(MJMaoZ.Text), 0) <> 0) then if (strtofloatdef(trim(kmxs.Text), 0) <> 0) and (strtofloatdef(trim(MJMaoZ.Text), 0) <> 0) then
@ -2520,6 +2522,27 @@ begin
MJLen.Text := format('%.' + trim(fxsws) + 'f', [(strtofloatdef(trim(MJMaoZ.Text), 0) + fjZ) * strtofloatdef(trim(kmxs.Text), 0)]) MJLen.Text := format('%.' + trim(fxsws) + 'f', [(strtofloatdef(trim(MJMaoZ.Text), 0) + fjZ) * strtofloatdef(trim(kmxs.Text), 0)])
end; end;
end; end;
// if (strtofloatdef(trim(kmxs.Text), 0) = 0) then
// begin
// if Trim(MJMaoZ.Text) = '' then
// begin
// MJQty4.Text := '';
// Exit;
// end;
// if TryStrToFloat(MJMaoZ.Text, FReal) = False then
// Exit;
// if Trim(MJQty3.Text) <> '' then
// begin
// if TryStrToFloat(MJQty3.Text, FReal) = False then
// Exit;
// jz := StrToFloat(MJMaoZ.Text) - StrToFloat(MJQty3.Text);
// MJQty4.Text := format('%.' + trim(fxsws1) + 'f', [jz]);
// end
// else
// begin
// MJQty4.Text := MJMaoZ.Text;
// end;
// end;
end; end;
@ -2592,6 +2615,7 @@ begin
FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString); FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString);
FJZ := ADOTmp.fieldbyname('jiazhong').AsFloat; FJZ := ADOTmp.fieldbyname('jiazhong').AsFloat;
FJC := ADOTmp.fieldbyname('jiachang').AsFloat; FJC := ADOTmp.fieldbyname('jiachang').AsFloat;
Fmachi := ADOTmp.fieldbyname('machi').asfloat;
FDC := StrToFloatDef(ADOTmp.fieldbyname('DC').asstring, 0); FDC := StrToFloatDef(ADOTmp.fieldbyname('DC').asstring, 0);
fbaotype := Trim(ADOTmp.fieldbyname('baotype').AsString); fbaotype := Trim(ADOTmp.fieldbyname('baotype').AsString);
fbaosx := Trim(ADOTmp.fieldbyname('baosx').AsString); fbaosx := Trim(ADOTmp.fieldbyname('baosx').AsString);

View File

@ -129,16 +129,24 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
Wrap = True Wrap = True
OnClick = ToolButton5Click OnClick = ToolButton5Click
end end
object ToolButton6: TToolButton object ToolButton16: TToolButton
Left = 0 Left = 0
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = ' '#30721#23610' '
ImageIndex = 54
OnClick = ToolButton16Click
end
object ToolButton6: TToolButton
Left = 81
Top = 30
AutoSize = True
Caption = #38271#24230#20301#25968 Caption = #38271#24230#20301#25968
ImageIndex = 60 ImageIndex = 60
OnClick = ToolButton6Click OnClick = ToolButton6Click
end end
object ToolButton9: TToolButton object ToolButton9: TToolButton
Left = 87 Left = 168
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #37325#37327#20301#25968 Caption = #37325#37327#20301#25968
@ -146,7 +154,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton9Click OnClick = ToolButton9Click
end end
object ToolButton13: TToolButton object ToolButton13: TToolButton
Left = 174 Left = 255
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #27599#21253#21367#25968 Caption = #27599#21253#21367#25968
@ -154,7 +162,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton13Click OnClick = ToolButton13Click
end end
object ToolButton14: TToolButton object ToolButton14: TToolButton
Left = 261 Left = 342
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #27599#21367#38271#24230 Caption = #27599#21367#38271#24230
@ -162,7 +170,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton14Click OnClick = ToolButton14Click
end end
object ToolButton7: TToolButton object ToolButton7: TToolButton
Left = 348 Left = 429
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #39044#35272#21367#26631#31614 Caption = #39044#35272#21367#26631#31614
@ -170,14 +178,14 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton7Click OnClick = ToolButton7Click
end end
object ToolButton15: TToolButton object ToolButton15: TToolButton
Left = 447 Left = 528
Top = 30 Top = 30
Caption = #39044#35272#20013#25991#26631#31614 Caption = #39044#35272#20013#25991#26631#31614
ImageIndex = 57 ImageIndex = 57
OnClick = ToolButton15Click OnClick = ToolButton15Click
end end
object ToolButton8: TToolButton object ToolButton8: TToolButton
Left = 554 Left = 635
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #39044#35272#21253#26631#31614 Caption = #39044#35272#21253#26631#31614
@ -185,7 +193,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton8Click OnClick = ToolButton8Click
end end
object PiZhong: TEdit object PiZhong: TEdit
Left = 653 Left = 734
Top = 30 Top = 30
Width = 121 Width = 121
Height = 30 Height = 30
@ -198,7 +206,7 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
TabOrder = 0 TabOrder = 0
end end
object TBClose: TToolButton object TBClose: TToolButton
Left = 774 Left = 855
Top = 30 Top = 30
AutoSize = True AutoSize = True
Caption = #20851#38381 Caption = #20851#38381
@ -680,6 +688,12 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
Properties.OnEditValueChanged = Tv1Column5PropertiesEditValueChanged Properties.OnEditValueChanged = Tv1Column5PropertiesEditValueChanged
Width = 60 Width = 60
end end
object Tv1Column6: TcxGridDBColumn
Caption = #30721#23610
DataBinding.FieldName = 'machi'
HeaderAlignmentHorz = taRightJustify
Width = 60
end
end end
object cxGrid1Level1: TcxGridLevel object cxGrid1Level1: TcxGridLevel
GridView = Tv1 GridView = Tv1

View File

@ -10,7 +10,21 @@ uses
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, StrUtils, Menus, cxDropDownEdit, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, StrUtils, Menus, cxDropDownEdit,
cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator; 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 type
TfrmProductOrderLBNameSet = class(TForm) TfrmProductOrderLBNameSet = class(TForm)
@ -117,6 +131,8 @@ type
ToolButton13: TToolButton; ToolButton13: TToolButton;
ToolButton14: TToolButton; ToolButton14: TToolButton;
ToolButton15: TToolButton; ToolButton15: TToolButton;
ToolButton16: TToolButton;
Tv1Column6: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -153,6 +169,7 @@ type
procedure Tv1Column2PropertiesEditValueChanged(Sender: TObject); procedure Tv1Column2PropertiesEditValueChanged(Sender: TObject);
procedure Tv1Column5PropertiesEditValueChanged(Sender: TObject); procedure Tv1Column5PropertiesEditValueChanged(Sender: TObject);
procedure ToolButton15Click(Sender: TObject); procedure ToolButton15Click(Sender: TObject);
procedure ToolButton16Click(Sender: TObject);
private private
DQdate: TDateTime; DQdate: TDateTime;
procedure InitGrid(); procedure InitGrid();
@ -1554,5 +1571,70 @@ begin
end; end;
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 machi=' + Trim(PiZhong.Text));
sql.Add(' where Subid=''' + Trim(Order_Main.fieldbyname('Subid').AsString) + '''');
ExecSQL;
end;
with Order_Main do
begin
Edit;
FieldByName('machi').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. end.