资料 合同 检验

This commit is contained in:
funa 2026-10-16 17:21:20 +08:00
parent f7618b3cc2
commit bc39968fb1
12 changed files with 133 additions and 66 deletions

View File

@ -17,7 +17,7 @@ inherited frmMachineManage: TfrmMachineManage
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 97
ButtonWidth = 98
Caption = 'ToolBar1'
Color = clSkyBlue
DisabledImages = DataLink_BaseInfo.ImageList_new32
@ -93,7 +93,7 @@ inherited frmMachineManage: TfrmMachineManage
OnClick = tbBindProdClick
end
object tbBindProd2: TToolButton
Left = 598
Left = 599
Top = 0
AutoSize = True
Caption = #32465#23450#20135#21697'2'
@ -101,7 +101,7 @@ inherited frmMachineManage: TfrmMachineManage
OnClick = tbBindProd2Click
end
object ToolButton3: TToolButton
Left = 699
Left = 701
Top = 0
AutoSize = True
Caption = #25171#21360
@ -109,15 +109,23 @@ inherited frmMachineManage: TfrmMachineManage
OnClick = ToolButton3Click
end
object ToolButton1: TToolButton
Left = 770
Left = 772
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 20
OnClick = ToolButton1Click
end
object TbSaveFormat: TToolButton
Left = 843
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = TbSaveFormatClick
end
object TBClose: TToolButton
Left = 841
Left = 938
Top = 0
AutoSize = True
Caption = #20851#38381
@ -206,7 +214,7 @@ inherited frmMachineManage: TfrmMachineManage
Width = 140
end
object Tv2C_Name: TcxGridDBColumn
Caption = #20135#21697#21517#31234'1'
Caption = #20135#21697#21517#31216'1'
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -222,7 +230,7 @@ inherited frmMachineManage: TfrmMachineManage
Width = 140
end
object Tv2C_Name2: TcxGridDBColumn
Caption = #20135#21697#21517#31234'2'
Caption = #20135#21697#21517#31216'2'
DataBinding.FieldName = 'C_Name2'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter

View File

@ -56,6 +56,7 @@ type
Tv2C_Name: TcxGridDBColumn;
v2Column10: TcxGridDBColumn;
Tv2C_Name2: TcxGridDBColumn;
TbSaveFormat: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
@ -80,6 +81,7 @@ type
procedure tbPauseClick(Sender: TObject);
procedure tbBindProdClick(Sender: TObject);
procedure tbBindProd2Click(Sender: TObject);
procedure TbSaveFormatClick(Sender: TObject);
private
{ Private declarations }
procedure BindProduct(AFieldName, ALogAction: string);
@ -167,6 +169,12 @@ begin
InitGrid();
end;
procedure TfrmMachineManage.TbSaveFormatClick(Sender: TObject);
begin
inherited;
writeCxGrid(Trim(Self.Caption), Tv2, '机台管理');
end;
procedure TfrmMachineManage.ToolButton2Click(Sender: TObject);
var
sql: string;
@ -476,39 +484,25 @@ end;
procedure TfrmMachineManage.UnbindProduct(AFieldName, ALogAction: string);
var
MMCIDS: string;
MMCID, MCodeName: string;
begin
if CDS_HZ.IsEmpty then
Exit;
if not CDS_HZ.Locate('SSel', True, []) then
//解绑针对焦点行(光标所在机台),不用勾选
MMCID := Trim(CDS_HZ.fieldbyname('MCID').AsString);
if MMCID = '' then
Exit;
MCodeName := Trim(CDS_HZ.fieldbyname(AFieldName).AsString);
if MCodeName = '' then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Application.MessageBox('当前焦点行没有绑定该产品,无需解绑!', '提示', 0);
Exit;
end;
MMCIDS := '';
CDS_HZ.DisableControls;
try
CDS_HZ.First;
while not CDS_HZ.Eof do
begin
if CDS_HZ.fieldbyname('SSel').AsBoolean then
begin
if MMCIDS <> '' then
MMCIDS := MMCIDS + ',' + QuotedStr(Trim(CDS_HZ.fieldbyname('MCID').AsString))
else
MMCIDS := QuotedStr(Trim(CDS_HZ.fieldbyname('MCID').AsString));
end;
CDS_HZ.Next;
end;
finally
CDS_HZ.EnableControls;
end;
if MMCIDS = '' then
Exit;
if Application.MessageBox(PChar('确定要' + ALogAction + '吗?'), '提示', 32 + 4) <> IDYES then
if Application.MessageBox(PChar('确定要解绑机台 ' + Trim(CDS_HZ.fieldbyname('MCNO').AsString)
+ ' 绑定的产品 ' + MCodeName + ' 吗?'), '提示', 32 + 4) <> IDYES then
Exit;
try
@ -520,7 +514,7 @@ begin
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(''));
SQL.Add(' , Editer=''' + Trim(DName) + '''');
SQL.Add(' , Edittime=getdate()');
SQL.Add(' where MCID in (' + MMCIDS + ')');
SQL.Add(' where MCID=' + QuotedStr(MMCID));
ExecSQL;
end;
with ADOQueryCmd do
@ -532,29 +526,16 @@ begin
SQL.Add(',getdate() ');
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
SQL.Add(',' + QuotedStr(Trim(ALogAction)));
SQL.Add(',' + QuotedStr(Trim(MMCIDS)));
SQL.Add(',' + QuotedStr(Trim(MMCID + ' -> ' + MCodeName)));
SQL.Add(',' + QuotedStr(Trim('成功')));
SQL.Add(')');
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
CDS_HZ.DisableControls;
try
CDS_HZ.First;
while not CDS_HZ.Eof do
begin
if CDS_HZ.fieldbyname('SSel').AsBoolean then
begin
CDS_HZ.Edit;
CDS_HZ.fieldbyname(AFieldName).AsString := '';
CDS_HZ.Post;
end;
CDS_HZ.Next;
end;
finally
CDS_HZ.EnableControls;
end;
InitGrid();
Application.MessageBox('解绑成功!', '提示信息');
except

View File

@ -11,6 +11,7 @@ inherited frmSalesConInPut: TfrmSalesConInPut
OldCreateOrder = True
Position = poScreenCenter
WindowState = wsMaximized
ExplicitLeft = -200
ExplicitWidth = 1522
ExplicitHeight = 730
PixelsPerInch = 96
@ -362,6 +363,7 @@ inherited frmSalesConInPut: TfrmSalesConInPut
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label23: TLabel
Left = 39
@ -614,6 +616,7 @@ inherited frmSalesConInPut: TfrmSalesConInPut
StyleHot.LookAndFeel.NativeStyle = True
StyleReadOnly.LookAndFeel.NativeStyle = True
TabOrder = 17
Visible = False
OnDblClick = cxDBImage1DblClick
Height = 281
Width = 192
@ -649,6 +652,7 @@ inherited frmSalesConInPut: TfrmSalesConInPut
Width = 125
Height = 20
TabOrder = 20
Visible = False
OnBtnUpClick = PackSealBtnUpClick
OnBtnDnClick = BuyNameBtnDnClick
end
@ -949,6 +953,13 @@ inherited frmSalesConInPut: TfrmSalesConInPut
HeaderAlignmentHorz = taCenter
Width = 58
end
object Tv1c_p_length: TcxGridDBColumn
Caption = #21305#38271
DataBinding.FieldName = 'c_p_length'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1PRTPrice: TcxGridDBColumn
Caption = #21333#20215
DataBinding.FieldName = 'ConPrice'
@ -991,6 +1002,7 @@ inherited frmSalesConInPut: TfrmSalesConInPut
Properties.ShowFocusRect = False
Style.BorderStyle = ebsSingle
TabOrder = 4
Visible = False
OnDblClick = Pic_Image1DblClick
Height = 257
Width = 217

View File

@ -131,6 +131,7 @@ type
Label25: TLabel;
SalesId: TEdit;
TallyId: TEdit;
Tv1c_p_length: TcxGridDBColumn;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);

View File

@ -701,6 +701,7 @@ inherited frmSalesContractList: TfrmSalesContractList
Align = alBottom
BorderStyle = cxcbsNone
TabOrder = 5
ExplicitTop = 470
object TV2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -897,6 +898,14 @@ inherited frmSalesContractList: TfrmSalesContractList
Options.Editing = False
Width = 58
end
object TV2c_p_length: TcxGridDBColumn
Caption = #21305#38271
DataBinding.FieldName = 'c_p_length'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80
end
object v1PRTPrice: TcxGridDBColumn
Caption = #21333#20215
DataBinding.FieldName = 'ConPrice'

View File

@ -141,6 +141,7 @@ type
cxGridLevel1: TcxGridLevel;
N5: TMenuItem;
N6: TMenuItem;
TV2c_p_length: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);

View File

@ -32,7 +32,8 @@ uses
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
U_SCPersonColor5 in 'U_SCPersonColor5.pas' {frmSCPersonColor5},
U_TatKnitterQuery in 'U_TatKnitterQuery.pas' {frmTatKnitterQuery};
U_TatKnitterQuery in 'U_TatKnitterQuery.pas' {frmTatKnitterQuery},
U_SCPersonColor in 'U_SCPersonColor.pas' {frmSCPersonColor};
{$R *.res}

View File

@ -163,6 +163,10 @@
<DCCReference Include="U_TatKnitterQuery.pas">
<Form>frmTatKnitterQuery</Form>
</DCCReference>
<DCCReference Include="U_SCPersonColor.pas">
<Form>frmSCPersonColor</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -9,9 +9,9 @@
启用码表单位=0
标签份数=
米数下限=1
米数上限=100
米数上限=200
重量下限=1
重量上限=100
米数小数位=1
码数小数位=1
重量小数位=1
重量小数位=2

View File

@ -83,6 +83,10 @@ begin
begin
Close;
sql.Clear;
if ftype = '机台产品' then
//列出该机台绑定的产品(FlagStr传机台号),按钮Hint存产品编号
sql.Add('select AA.*,row_number () over (order by code) as keyNo from(select DISTINCT B.C_Code as code, B.C_Name as name from Bs_Machine A join Bs_Cloth_Info B on B.C_Code in (A.C_CodeName, A.C_CodeName2) where A.MCNO=' + QuotedStr(Trim(FlagStr)) + ')AA')
else
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT MCNO as name from Bs_Machine where ISNULL(Status,0)=5 )AA');
// showmessage(sql.text);
Open;
@ -104,6 +108,12 @@ begin
begin
// application.MessageBox(pchar(CDS_Kuang.FieldByName('ZDYName').AsString), 'ÌáʾÐÅÏ¢', 0);
TSpeedButton(Controls[i]).Visible := True;
if ftype = '机台产品' then
begin
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('name').AsString);
TSpeedButton(Controls[i]).Hint := Trim(ADOTmp.FieldByName('code').AsString);
end
else
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('name').AsString);
end
else
@ -162,6 +172,10 @@ end;
procedure TfrmSCPersonColor.btn1Click(Sender: TObject);
begin
//机台产品模式下按钮Hint存的是产品编号,其余模式返回按钮文字
if Trim(TSpeedButton(Sender).Hint) <> '' then
FName := Trim(TSpeedButton(Sender).Hint)
else
FName := Trim(TSpeedButton(Sender).Caption);
ModalResult := 1;
end;

View File

@ -2925,10 +2925,6 @@
object 查看: TcxTabSheet
Caption = #26597#30475
ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object cxGrid1: TcxGrid
Left = 0
Top = 0

View File

@ -455,6 +455,7 @@ type
procedure AllocWeaverMeter(AIdx: Integer);
function RoundUpToHalf(AValue: Double): Double; //decimal 0.1-0.4 -> 0.5, 0.6-0.9 -> next integer
function FormatQty2(AValue: Double): string;
function SelBoundProduct(AMCNO: string): string; //弹出选择机台绑定的产品,返回产品编号
public
fmanage: string;
fFlileFlag: string;
@ -506,7 +507,8 @@ begin
Exit;
end;
InputLen.Text := FormatFloat('0.##', (W + AW) / KZValue);
// InputLen.Text := FormatFloat('0.##', (W + AW) / KZValue);
InputLen.Text := FormatFloat('0.#', RoundUpToHalf(RoundFloat((W + AW) / KZValue, 1)));
end;
procedure TfrmTatMachInsp.SetINIFile();
@ -1385,7 +1387,8 @@ begin
if (trim(edtMaBiao.Text) = '¡Ì') then
begin
// InputLen.Text := format('%.1f', [i1 / 100000]);
MLen := Format('%.1f', [i1 / 100000]);
// MLen := Format('%.1f', [i1 / 100000]);
MLen := FormatFloat('0.#', RoundUpToHalf(RoundFloat(i1 / 100000, 1)));
if Trim(edtMax.Text) = '¡Ì' then
begin
code_table_length.Text := MLen;
@ -2798,9 +2801,29 @@ begin
// Panel7.Visible := True;
end;
function TfrmTatMachInsp.SelBoundProduct(AMCNO: string): string;
var
frm, OldFrm: TfrmSCPersonColor;
begin
Result := '';
OldFrm := frmSCPersonColor;
frm := TfrmSCPersonColor.Create(Self);
try
frm.FType := '机台产品';
frm.FlagStr := Trim(AMCNO);
frm.Caption := '请选择带入的产品';
if frm.ShowModal = 1 then
Result := Trim(frm.FName);
finally
frm.Free;
//还原全局变量:FormDestroy会把它置nil,外层with frmSCPersonColor的finally还在用它
frmSCPersonColor := OldFrm;
end;
end;
procedure TfrmTatMachInsp.Button9Click(Sender: TObject);
var
MCode: string;
MCode, MCode2: string;
begin
try
@ -2812,17 +2835,34 @@ begin
begin
carno.text := trim(fname);
//带出机台绑定的产品信息,有值直接覆盖
//带出机台绑定的产品信息,有值直接覆盖;绑定两个产品时让用户选择带入哪个
MCode := '';
MCode2 := '';
with Self.ADOTmp do
begin
Close;
SQL.Clear;
SQL.Add('SELECT C_CodeName FROM Bs_Machine WHERE MCNO=' + QuotedStr(Trim(fname)));
SQL.Add('SELECT A.C_CodeName, ISNULL(B.C_Name,'''') AS C_Name, ');
SQL.Add(' A.C_CodeName2, ISNULL(C.C_Name,'''') AS C_Name2 ');
SQL.Add('FROM Bs_Machine A ');
SQL.Add('LEFT JOIN Bs_Cloth_Info B ON B.C_Code = A.C_CodeName ');
SQL.Add('LEFT JOIN Bs_Cloth_Info C ON C.C_Code = A.C_CodeName2 ');
SQL.Add('WHERE A.MCNO=' + QuotedStr(Trim(fname)));
Open;
if not IsEmpty then
begin
MCode := Trim(FieldByName('C_CodeName').AsString);
MCode2 := Trim(FieldByName('C_CodeName2').AsString);
end;
end;
//只在产品2绑定时,同样直接带入
if (MCode = '') and (MCode2 <> '') then
MCode := MCode2;
//两个产品都绑定时弹出大按钮选择窗,点选哪个带入哪个,取消则不带入
if (MCode <> '') and (MCode2 <> '') then
MCode := SelBoundProduct(Trim(fname));
if MCode <> '' then
begin