资料 检验
This commit is contained in:
parent
04b10ae305
commit
f7618b3cc2
|
|
@ -17,7 +17,7 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
Height = 38
|
Height = 38
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
ButtonHeight = 38
|
ButtonHeight = 38
|
||||||
ButtonWidth = 91
|
ButtonWidth = 97
|
||||||
Caption = 'ToolBar1'
|
Caption = 'ToolBar1'
|
||||||
Color = clSkyBlue
|
Color = clSkyBlue
|
||||||
DisabledImages = DataLink_BaseInfo.ImageList_new32
|
DisabledImages = DataLink_BaseInfo.ImageList_new32
|
||||||
|
|
@ -88,12 +88,20 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
Left = 497
|
Left = 497
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #32465#23450#20135#21697
|
Caption = #32465#23450#20135#21697'1'
|
||||||
ImageIndex = 4
|
ImageIndex = 4
|
||||||
OnClick = tbBindProdClick
|
OnClick = tbBindProdClick
|
||||||
end
|
end
|
||||||
|
object tbBindProd2: TToolButton
|
||||||
|
Left = 598
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #32465#23450#20135#21697'2'
|
||||||
|
ImageIndex = 4
|
||||||
|
OnClick = tbBindProd2Click
|
||||||
|
end
|
||||||
object ToolButton3: TToolButton
|
object ToolButton3: TToolButton
|
||||||
Left = 592
|
Left = 699
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #25171#21360
|
Caption = #25171#21360
|
||||||
|
|
@ -101,7 +109,7 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
OnClick = ToolButton3Click
|
OnClick = ToolButton3Click
|
||||||
end
|
end
|
||||||
object ToolButton1: TToolButton
|
object ToolButton1: TToolButton
|
||||||
Left = 663
|
Left = 770
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #23548#20986
|
Caption = #23548#20986
|
||||||
|
|
@ -109,7 +117,7 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
OnClick = ToolButton1Click
|
OnClick = ToolButton1Click
|
||||||
end
|
end
|
||||||
object TBClose: TToolButton
|
object TBClose: TToolButton
|
||||||
Left = 734
|
Left = 841
|
||||||
Top = 0
|
Top = 0
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #20851#38381
|
Caption = #20851#38381
|
||||||
|
|
@ -190,13 +198,37 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
Width = 180
|
Width = 180
|
||||||
end
|
end
|
||||||
object v2Column9: TcxGridDBColumn
|
object v2Column9: TcxGridDBColumn
|
||||||
Caption = #20135#21697#32534#21495
|
Caption = #20135#21697#32534#21495'1'
|
||||||
DataBinding.FieldName = 'C_CodeName'
|
DataBinding.FieldName = 'C_CodeName'
|
||||||
DataBinding.IsNullValueType = True
|
DataBinding.IsNullValueType = True
|
||||||
PropertiesClassName = 'TcxTextEditProperties'
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Width = 140
|
Width = 140
|
||||||
end
|
end
|
||||||
|
object Tv2C_Name: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#21517#31234'1'
|
||||||
|
DataBinding.FieldName = 'C_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 150
|
||||||
|
end
|
||||||
|
object v2Column10: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#32534#21495'2'
|
||||||
|
DataBinding.FieldName = 'C_CodeName2'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 140
|
||||||
|
end
|
||||||
|
object Tv2C_Name2: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#21517#31234'2'
|
||||||
|
DataBinding.FieldName = 'C_Name2'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 150
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGridLevel1: TcxGridLevel
|
object cxGridLevel1: TcxGridLevel
|
||||||
GridView = Tv2
|
GridView = Tv2
|
||||||
|
|
@ -303,5 +335,13 @@ inherited frmMachineManage: TfrmMachineManage
|
||||||
Caption = #20840#24323
|
Caption = #20840#24323
|
||||||
OnClick = N2Click
|
OnClick = N2Click
|
||||||
end
|
end
|
||||||
|
object N3: TMenuItem
|
||||||
|
Caption = #35299#32465#20135#21697'1'
|
||||||
|
OnClick = N3Click
|
||||||
|
end
|
||||||
|
object N4: TMenuItem
|
||||||
|
Caption = #35299#32465#20135#21697'2'
|
||||||
|
OnClick = N4Click
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ type
|
||||||
PopupMenu1: TPopupMenu;
|
PopupMenu1: TPopupMenu;
|
||||||
N1: TMenuItem;
|
N1: TMenuItem;
|
||||||
N2: TMenuItem;
|
N2: TMenuItem;
|
||||||
|
N3: TMenuItem;
|
||||||
|
N4: TMenuItem;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
MCNO: TEdit;
|
MCNO: TEdit;
|
||||||
v2Column8: TcxGridDBColumn;
|
v2Column8: TcxGridDBColumn;
|
||||||
|
|
@ -50,6 +52,10 @@ type
|
||||||
tbStart: TToolButton;
|
tbStart: TToolButton;
|
||||||
tbPause: TToolButton;
|
tbPause: TToolButton;
|
||||||
tbBindProd: TToolButton;
|
tbBindProd: TToolButton;
|
||||||
|
tbBindProd2: TToolButton;
|
||||||
|
Tv2C_Name: TcxGridDBColumn;
|
||||||
|
v2Column10: TcxGridDBColumn;
|
||||||
|
Tv2C_Name2: TcxGridDBColumn;
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure TBCloseClick(Sender: TObject);
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
|
@ -60,6 +66,8 @@ type
|
||||||
procedure cxTabControl1Change(Sender: TObject);
|
procedure cxTabControl1Change(Sender: TObject);
|
||||||
procedure N1Click(Sender: TObject);
|
procedure N1Click(Sender: TObject);
|
||||||
procedure N2Click(Sender: TObject);
|
procedure N2Click(Sender: TObject);
|
||||||
|
procedure N3Click(Sender: TObject);
|
||||||
|
procedure N4Click(Sender: TObject);
|
||||||
procedure CustomerChange(Sender: TObject);
|
procedure CustomerChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure v2Column8PropertiesEditValueChanged(Sender: TObject);
|
procedure v2Column8PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
|
@ -71,8 +79,11 @@ type
|
||||||
procedure tbStartClick(Sender: TObject);
|
procedure tbStartClick(Sender: TObject);
|
||||||
procedure tbPauseClick(Sender: TObject);
|
procedure tbPauseClick(Sender: TObject);
|
||||||
procedure tbBindProdClick(Sender: TObject);
|
procedure tbBindProdClick(Sender: TObject);
|
||||||
|
procedure tbBindProd2Click(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
|
procedure BindProduct(AFieldName, ALogAction: string);
|
||||||
|
procedure UnbindProduct(AFieldName, ALogAction: string);
|
||||||
procedure InitGrid();
|
procedure InitGrid();
|
||||||
procedure EditValueT();
|
procedure EditValueT();
|
||||||
procedure EditValueF();
|
procedure EditValueF();
|
||||||
|
|
@ -102,7 +113,11 @@ begin
|
||||||
begin
|
begin
|
||||||
Close;
|
Close;
|
||||||
SQL.Clear;
|
SQL.Clear;
|
||||||
sql.Add(' select A.* from BS_Machine A ');
|
// sql.Add(' select A.* from BS_Machine A ');
|
||||||
|
sql.Add(' select A.*, ISNULL(B.C_Name,'''') as C_Name, ISNULL(C.C_Name,'''') as C_Name2 '); //null转空字符串
|
||||||
|
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 ');
|
||||||
if cxTabControl1.TabIndex = 1 then
|
if cxTabControl1.TabIndex = 1 then
|
||||||
sql.Add(' where ISNULL(A.Status,0) = 5 ');
|
sql.Add(' where ISNULL(A.Status,0) = 5 ');
|
||||||
sql.Add(' order by MCNO ');
|
sql.Add(' order by MCNO ');
|
||||||
|
|
@ -350,6 +365,16 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMachineManage.tbBindProdClick(Sender: TObject);
|
procedure TfrmMachineManage.tbBindProdClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BindProduct('C_CodeName', '绑定产品1');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMachineManage.tbBindProd2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
BindProduct('C_CodeName2', '绑定产品2');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMachineManage.BindProduct(AFieldName, ALogAction: string);
|
||||||
var
|
var
|
||||||
MMCIDS, MCodeName: string;
|
MMCIDS, MCodeName: string;
|
||||||
begin
|
begin
|
||||||
|
|
@ -403,7 +428,7 @@ begin
|
||||||
begin
|
begin
|
||||||
Close;
|
Close;
|
||||||
SQL.Clear;
|
SQL.Clear;
|
||||||
SQL.Add('update BS_Machine set C_CodeName=' + QuotedStr(MCodeName));
|
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(MCodeName));
|
||||||
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||||
SQL.Add(' , Edittime=getdate()');
|
SQL.Add(' , Edittime=getdate()');
|
||||||
SQL.Add(' where MCID in (' + MMCIDS + ')');
|
SQL.Add(' where MCID in (' + MMCIDS + ')');
|
||||||
|
|
@ -417,7 +442,7 @@ begin
|
||||||
SQL.Add(' ' + QuotedStr(Trim(DName)));
|
SQL.Add(' ' + QuotedStr(Trim(DName)));
|
||||||
SQL.Add(',getdate() ');
|
SQL.Add(',getdate() ');
|
||||||
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
|
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
|
||||||
SQL.Add(',' + QuotedStr(Trim('°ó¶¨²úÆ·')));
|
SQL.Add(',' + QuotedStr(Trim(ALogAction)));
|
||||||
SQL.Add(',' + QuotedStr(Trim(MMCIDS + ' -> ' + MCodeName)));
|
SQL.Add(',' + QuotedStr(Trim(MMCIDS + ' -> ' + MCodeName)));
|
||||||
SQL.Add(',' + QuotedStr(Trim('成功')));
|
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||||
SQL.Add(')');
|
SQL.Add(')');
|
||||||
|
|
@ -433,7 +458,7 @@ begin
|
||||||
if CDS_HZ.fieldbyname('SSel').AsBoolean then
|
if CDS_HZ.fieldbyname('SSel').AsBoolean then
|
||||||
begin
|
begin
|
||||||
CDS_HZ.Edit;
|
CDS_HZ.Edit;
|
||||||
CDS_HZ.fieldbyname('C_CodeName').AsString := MCodeName;
|
CDS_HZ.fieldbyname(AFieldName).AsString := MCodeName;
|
||||||
CDS_HZ.Post;
|
CDS_HZ.Post;
|
||||||
end;
|
end;
|
||||||
CDS_HZ.Next;
|
CDS_HZ.Next;
|
||||||
|
|
@ -441,7 +466,7 @@ begin
|
||||||
finally
|
finally
|
||||||
CDS_HZ.EnableControls;
|
CDS_HZ.EnableControls;
|
||||||
end;
|
end;
|
||||||
|
InitGrid();
|
||||||
Application.MessageBox('绑定成功!', '提示信息');
|
Application.MessageBox('绑定成功!', '提示信息');
|
||||||
except
|
except
|
||||||
ADOQueryCmd.Connection.RollbackTrans;
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
|
@ -449,6 +474,95 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMachineManage.UnbindProduct(AFieldName, ALogAction: string);
|
||||||
|
var
|
||||||
|
MMCIDS: string;
|
||||||
|
begin
|
||||||
|
if CDS_HZ.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
if not CDS_HZ.Locate('SSel', True, []) then
|
||||||
|
begin
|
||||||
|
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
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(''));
|
||||||
|
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||||
|
SQL.Add(' , Edittime=getdate()');
|
||||||
|
SQL.Add(' where MCID in (' + MMCIDS + ')');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd 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(ALogAction)));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim(MMCIDS)));
|
||||||
|
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
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmMachineManage.N1Click(Sender: TObject);
|
procedure TfrmMachineManage.N1Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if CDS_HZ.IsEmpty then
|
if CDS_HZ.IsEmpty then
|
||||||
|
|
@ -463,6 +577,16 @@ begin
|
||||||
SelOKNo(CDS_HZ, False);
|
SelOKNo(CDS_HZ, False);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMachineManage.N3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UnbindProduct('C_CodeName', '解绑产品1');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMachineManage.N4Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
UnbindProduct('C_CodeName2', '解绑产品2');
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmMachineManage.CustomerChange(Sender: TObject);
|
procedure TfrmMachineManage.CustomerChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
ToolButton2.Click;
|
ToolButton2.Click;
|
||||||
|
|
@ -606,11 +730,15 @@ end;
|
||||||
procedure TfrmMachineManage.EditValueT();
|
procedure TfrmMachineManage.EditValueT();
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
FldName: string;
|
||||||
begin
|
begin
|
||||||
for i := 0 to tv2.ColumnCount - 1 do
|
for i := 0 to tv2.ColumnCount - 1 do
|
||||||
begin
|
begin
|
||||||
if uppercase(tv2.Columns[i].DataBinding.FieldName) <> 'SSEL' then
|
FldName := uppercase(tv2.Columns[i].DataBinding.FieldName);
|
||||||
tv2.Columns[i].Options.Editing := True;
|
if FldName = 'SSEL' then
|
||||||
|
Continue;
|
||||||
|
//只有机台号、机台类型允许编辑,产品编号/名称列通过绑定按钮维护
|
||||||
|
tv2.Columns[i].Options.Editing := (FldName = 'MCNO') or (FldName = 'MCTYPE');
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@ uses
|
||||||
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
|
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
|
||||||
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
|
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
|
||||||
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
|
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
|
||||||
U_SCPersonColor5 in 'U_SCPersonColor5.pas' {frmSCPersonColor5};
|
U_SCPersonColor5 in 'U_SCPersonColor5.pas' {frmSCPersonColor5},
|
||||||
|
U_TatKnitterQuery in 'U_TatKnitterQuery.pas' {frmTatKnitterQuery};
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,9 @@
|
||||||
<Form>frmTatClothInspList</Form>
|
<Form>frmTatClothInspList</Form>
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="U_TatFlawQuery.pas">
|
||||||
|
<Form>frmTatFlawQuery</Form>
|
||||||
|
</DCCReference>
|
||||||
<DCCReference Include="..\A00通用窗体\U_LabelMapSet.pas">
|
<DCCReference Include="..\A00通用窗体\U_LabelMapSet.pas">
|
||||||
<Form>frmLabelMapSet</Form>
|
<Form>frmLabelMapSet</Form>
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
|
|
@ -157,6 +160,9 @@
|
||||||
<Form>frmSCPersonColor5</Form>
|
<Form>frmSCPersonColor5</Form>
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="U_TatKnitterQuery.pas">
|
||||||
|
<Form>frmTatKnitterQuery</Form>
|
||||||
|
</DCCReference>
|
||||||
<BuildConfiguration Include="Debug">
|
<BuildConfiguration Include="Debug">
|
||||||
<Key>Cfg_2</Key>
|
<Key>Cfg_2</Key>
|
||||||
<CfgParent>Base</CfgParent>
|
<CfgParent>Base</CfgParent>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ function GetsysParam(muserId: pchar; fparam1: pchar): Boolean;
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
U_DataLink, U_iniParam, U_TatMachInsp, U_TatClothInspList, U_TatFlawQuery;
|
U_DataLink, U_iniParam, U_TatMachInsp, U_TatClothInspList, U_TatFlawQuery,
|
||||||
|
U_TatKnitterQuery;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// 功能说明:取Dll中得窗体 //
|
// 功能说明:取Dll中得窗体 //
|
||||||
|
|
@ -151,6 +152,18 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
777: //µ²³µ¹¤²úÁ¿²éѯ
|
||||||
|
begin
|
||||||
|
with TfrmTatKnitterQuery.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
|
||||||
|
begin
|
||||||
|
fFormID := FormID;
|
||||||
|
FormStyle := mstyle;
|
||||||
|
WindowState := mstate;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
mnewHandle := Handle;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
888: //Flaw query
|
888: //Flaw query
|
||||||
begin
|
begin
|
||||||
with TfrmTatFlawQuery.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
|
with TfrmTatFlawQuery.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
|
||||||
|
|
|
||||||
|
|
@ -140,14 +140,10 @@ begin
|
||||||
begin
|
begin
|
||||||
Close;
|
Close;
|
||||||
sql.Clear;
|
sql.Clear;
|
||||||
sql.Add('select AA.*,row_number () over (order by code) as keyNo from(select DISTINCT C_CODE as code, C_NAME as cname from Bs_CLOTH_INFO ');
|
sql.Add('select AA.*,row_number () over (order by cname) as keyNo from(select DISTINCT C_CODE as code, C_NAME as cname from Bs_CLOTH_INFO ');
|
||||||
//sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT C_NAME as name from Bs_CLOTH_INFO ');
|
|
||||||
sql.Add(' WHERE ISNULL(Status,0) = 5 ');
|
sql.Add(' WHERE ISNULL(Status,0) = 5 ');
|
||||||
if C_NAME.Text <> '' then
|
if C_NAME.Text <> '' then
|
||||||
begin
|
SQL.Add(' AND C_NAME LIKE ' + QUOTEDSTR('%' + C_NAME.Text + '%'));
|
||||||
//SQL.Add(' WHERE C_NAME LIKE ' + QUOTEDSTR('%' + C_NAME.Text + '%'));
|
|
||||||
SQL.Add(' WHERE C_CODE LIKE ' + QUOTEDSTR('%' + C_NAME.Text + '%'));
|
|
||||||
end;
|
|
||||||
|
|
||||||
SQL.Add(')AA');
|
SQL.Add(')AA');
|
||||||
// showmessage(sql.text);
|
// showmessage(sql.text);
|
||||||
|
|
@ -170,9 +166,8 @@ begin
|
||||||
begin
|
begin
|
||||||
// application.MessageBox(pchar(CDS_Kuang.FieldByName('ZDYName').AsString), '提示信息', 0);
|
// application.MessageBox(pchar(CDS_Kuang.FieldByName('ZDYName').AsString), '提示信息', 0);
|
||||||
TSpeedButton(Controls[i]).Visible := True;
|
TSpeedButton(Controls[i]).Visible := True;
|
||||||
//TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('name').AsString);
|
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('cname').AsString);
|
||||||
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('CODE').AsString);
|
TSpeedButton(Controls[i]).Hint := Trim(ADOTmp.FieldByName('CODE').AsString);
|
||||||
TSpeedButton(Controls[i]).Hint := Trim(ADOTmp.FieldByName('cname').AsString);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
|
@ -302,7 +297,7 @@ const
|
||||||
LONG_PRESS_MS = 1000;
|
LONG_PRESS_MS = 1000;
|
||||||
var
|
var
|
||||||
elapse: Cardinal;
|
elapse: Cardinal;
|
||||||
sCap: string;
|
sCap, sCode: string;
|
||||||
begin
|
begin
|
||||||
if not FMouseDown then
|
if not FMouseDown then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
@ -312,6 +307,7 @@ begin
|
||||||
begin
|
begin
|
||||||
Timer1.Enabled := False; //只触发一次长按
|
Timer1.Enabled := False; //只触发一次长按
|
||||||
sCap := Trim(FPressedBtn.Caption);
|
sCap := Trim(FPressedBtn.Caption);
|
||||||
|
sCode := Trim(FPressedBtn.Hint);
|
||||||
// 弹窗前先把状态复位,防止模态消息框重入乱状态
|
// 弹窗前先把状态复位,防止模态消息框重入乱状态
|
||||||
FMouseDown := False;
|
FMouseDown := False;
|
||||||
FPressedBtn := nil;
|
FPressedBtn := nil;
|
||||||
|
|
@ -323,14 +319,13 @@ begin
|
||||||
Close;
|
Close;
|
||||||
Sql.Clear;
|
Sql.Clear;
|
||||||
//sql.Add('delete bs_cloth_info where C_Name=' + quotedstr(sCap));
|
//sql.Add('delete bs_cloth_info where C_Name=' + quotedstr(sCap));
|
||||||
sql.Add('delete bs_cloth_info where C_Code=' + quotedstr(sCap));
|
sql.Add('delete bs_cloth_info where C_Code=' + quotedstr(sCode));
|
||||||
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
||||||
sql.Add(' ' + quotedstr(trim(DName)));
|
sql.Add(' ' + quotedstr(trim(DName)));
|
||||||
sql.Add(',getdate() ');
|
sql.Add(',getdate() ');
|
||||||
sql.Add(',' + quotedstr(trim(self.Caption)));
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
||||||
sql.Add(',' + quotedstr(trim('样品删除')));
|
sql.Add(',' + quotedstr(trim('样品删除')));
|
||||||
sql.Add(',' + quotedstr(trim('±àºÅ£º' + trim(sCap))));
|
sql.Add(',' + quotedstr(trim('Ãû³Æ£º' + trim(sCap) + '£¬±àºÅ£º' + trim(sCode))));
|
||||||
//sql.Add(',' + quotedstr(trim('Ãû³Æ£º' + trim(sCap))));
|
|
||||||
sql.Add(',' + quotedstr(trim('成功')));
|
sql.Add(',' + quotedstr(trim('成功')));
|
||||||
sql.Add(')');
|
sql.Add(')');
|
||||||
|
|
||||||
|
|
@ -356,8 +351,8 @@ end;
|
||||||
|
|
||||||
procedure TfrmSCPersonColor5.btn1Click(Sender: TObject);
|
procedure TfrmSCPersonColor5.btn1Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FName := Trim(TSpeedButton(Sender).Caption);
|
FName := Trim(TSpeedButton(Sender).Hint);
|
||||||
FName2 := Trim(TSpeedButton(Sender).Hint);
|
FName2 := Trim(TSpeedButton(Sender).Caption);
|
||||||
ModalResult := 1;
|
ModalResult := 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
|
||||||
end
|
end
|
||||||
object v1Column8: TcxGridDBColumn
|
object v1Column8: TcxGridDBColumn
|
||||||
Caption = #27611#37325
|
Caption = #27611#37325
|
||||||
DataBinding.FieldName = 'GrossWeight'
|
DataBinding.FieldName = 'GrossWeightWithAdd'
|
||||||
DataBinding.IsNullValueType = True
|
DataBinding.IsNullValueType = True
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
|
|
@ -347,7 +347,7 @@ inherited frmTatClothInspList: TfrmTatClothInspList
|
||||||
end
|
end
|
||||||
object v1Column28: TcxGridDBColumn
|
object v1Column28: TcxGridDBColumn
|
||||||
Caption = #20928#37325
|
Caption = #20928#37325
|
||||||
DataBinding.FieldName = 'NetWeight'
|
DataBinding.FieldName = 'NetWeightWithAdd'
|
||||||
DataBinding.IsNullValueType = True
|
DataBinding.IsNullValueType = True
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,11 @@ type
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
FGramW: Double;
|
FGramW: Double;
|
||||||
|
FAddW: Double; //加载时的加重快照,保存时从界面毛净重中扣回
|
||||||
function SaveData(): Boolean;
|
function SaveData(): Boolean;
|
||||||
procedure GetJYXK(FJYIP: string);
|
procedure GetJYXK(FJYIP: string);
|
||||||
procedure UpdateCalcMeter();
|
procedure UpdateCalcMeter();
|
||||||
|
function RoundUpToHalf(AValue: Double): Double; //decimal 0.1-0.4 -> 0.5, 0.6-0.9 -> next integer
|
||||||
public
|
public
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
end;
|
end;
|
||||||
|
|
@ -114,9 +116,11 @@ begin
|
||||||
|
|
||||||
//gram weight snapshot first, GrossWeight OnChange recalcs CalcMeter with it
|
//gram weight snapshot first, GrossWeight OnChange recalcs CalcMeter with it
|
||||||
FGramW := StrToFloatdef(Trim(ADOTmp.fieldbyname('C_GramWeight').AsString), 0);
|
FGramW := StrToFloatdef(Trim(ADOTmp.fieldbyname('C_GramWeight').AsString), 0);
|
||||||
|
//加重快照:界面显示含加重的毛净重,保存时再扣回,保证数据库基础字段口径不变
|
||||||
|
FAddW := StrToFloatdef(Trim(ADOTmp.fieldbyname('add_weight').AsString), 0);
|
||||||
|
|
||||||
GrossWeight.Text := Trim(ADOTmp.fieldbyname('GrossWeight').AsString);
|
GrossWeight.Text := FormatFloat('0.##', StrToFloatdef(Trim(ADOTmp.fieldbyname('GrossWeight').AsString), 0) + FAddW);
|
||||||
NetWeight.Text := Trim(ADOTmp.fieldbyname('NetWeight').AsString);
|
NetWeight.Text := FormatFloat('0.##', StrToFloatdef(Trim(ADOTmp.fieldbyname('NetWeight').AsString), 0) + FAddW);
|
||||||
Meter.Text := Trim(ADOTmp.fieldbyname('Meter').AsString);
|
Meter.Text := Trim(ADOTmp.fieldbyname('Meter').AsString);
|
||||||
Yardage.Text := Trim(ADOTmp.fieldbyname('Yardage').AsString);
|
Yardage.Text := Trim(ADOTmp.fieldbyname('Yardage').AsString);
|
||||||
UpdateCalcMeter();
|
UpdateCalcMeter();
|
||||||
|
|
@ -342,8 +346,8 @@ begin
|
||||||
sql.Clear;
|
sql.Clear;
|
||||||
sql.Add(' UPdate Tat_Cloth_Inspect Set ');
|
sql.Add(' UPdate Tat_Cloth_Inspect Set ');
|
||||||
sql.Add(' PieceNo=''' + Trim(PieceNo.Text) + ''' ');
|
sql.Add(' PieceNo=''' + Trim(PieceNo.Text) + ''' ');
|
||||||
sql.Add(',GrossWeight=' + FloatToStr(Strtofloatdef(GrossWeight.Text, 0)));
|
sql.Add(',GrossWeight=' + FloatToStr(Strtofloatdef(GrossWeight.Text, 0) - FAddW));
|
||||||
sql.Add(',NetWeight=' + FloatToStr(Strtofloatdef(NetWeight.Text, 0)));
|
sql.Add(',NetWeight=' + FloatToStr(Strtofloatdef(NetWeight.Text, 0) - FAddW));
|
||||||
sql.Add(',Meter=' + FloatToStr(Strtofloatdef(Meter.Text, 0)));
|
sql.Add(',Meter=' + FloatToStr(Strtofloatdef(Meter.Text, 0)));
|
||||||
sql.Add(',Yardage=' + FloatToStr(Strtofloatdef(Yardage.Text, 0)));
|
sql.Add(',Yardage=' + FloatToStr(Strtofloatdef(Yardage.Text, 0)));
|
||||||
sql.Add(',code_table_length=' + FloatToStr(Strtofloatdef(CodeTableLen.Text, 0)));
|
sql.Add(',code_table_length=' + FloatToStr(Strtofloatdef(CodeTableLen.Text, 0)));
|
||||||
|
|
@ -412,14 +416,30 @@ procedure TfrmTatInspEdit.UpdateCalcMeter();
|
||||||
var
|
var
|
||||||
MGrossW: Double;
|
MGrossW: Double;
|
||||||
begin
|
begin
|
||||||
//CalcMeter = GrossWeight / C_GramWeight (same as TV3), read-only display
|
//CalcMeter = (GrossWeight含加重) / C_GramWeight,先取1位小数再按0.05/0.5规则进位(与TV3的CM2一致)
|
||||||
MGrossW := StrToFloatdef(Trim(GrossWeight.Text), 0);
|
MGrossW := StrToFloatdef(Trim(GrossWeight.Text), 0);
|
||||||
if FGramW > 0 then
|
if FGramW > 0 then
|
||||||
CalcMeter.Text := Format('%.1f', [MGrossW / FGramW])
|
CalcMeter.Text := FormatFloat('0.#', RoundUpToHalf(RoundFloat(MGrossW / FGramW, 1)))
|
||||||
else
|
else
|
||||||
CalcMeter.Text := '';
|
CalcMeter.Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TfrmTatInspEdit.RoundUpToHalf(AValue: Double): Double;
|
||||||
|
var
|
||||||
|
MIntPart: Double;
|
||||||
|
begin
|
||||||
|
Result := AValue;
|
||||||
|
if AValue <= 0 then
|
||||||
|
Exit;
|
||||||
|
MIntPart := Int(AValue);
|
||||||
|
if Frac(AValue) < 0.05 then
|
||||||
|
Result := MIntPart //integer, keep as is
|
||||||
|
else if Frac(AValue) <= 0.5 then
|
||||||
|
Result := MIntPart + 0.5 //decimal 0.1-0.4 -> 0.5
|
||||||
|
else
|
||||||
|
Result := MIntPart + 1; //decimal 0.6-0.9 -> next integer
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmTatInspEdit.GrossWeightChange(Sender: TObject);
|
procedure TfrmTatInspEdit.GrossWeightChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
UpdateCalcMeter();
|
UpdateCalcMeter();
|
||||||
|
|
|
||||||
612
E03梭织坯布检验/U_TatKnitterQuery.dfm
Normal file
612
E03梭织坯布检验/U_TatKnitterQuery.dfm
Normal file
|
|
@ -0,0 +1,612 @@
|
||||||
|
inherited frmTatKnitterQuery: TfrmTatKnitterQuery
|
||||||
|
Left = 160
|
||||||
|
Top = 87
|
||||||
|
Caption = #25377#36710#24037#20135#37327#26597#35810
|
||||||
|
ClientHeight = 620
|
||||||
|
ClientWidth = 1100
|
||||||
|
FormStyle = fsMDIChild
|
||||||
|
Position = poScreenCenter
|
||||||
|
Visible = True
|
||||||
|
ExplicitWidth = 1116
|
||||||
|
ExplicitHeight = 659
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar [0]
|
||||||
|
Tag = 1
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1100
|
||||||
|
Height = 38
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 38
|
||||||
|
ButtonWidth = 91
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_TatInsp.ImageList_new32
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 1
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBExpSum: TToolButton
|
||||||
|
Left = 71
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #27719#24635#23548#20986
|
||||||
|
ImageIndex = 20
|
||||||
|
OnClick = TBExpSumClick
|
||||||
|
end
|
||||||
|
object TBExpDet: TToolButton
|
||||||
|
Left = 166
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26126#32454#23548#20986
|
||||||
|
ImageIndex = 20
|
||||||
|
OnClick = TBExpDetClick
|
||||||
|
end
|
||||||
|
object TBSaveFmt: TToolButton
|
||||||
|
Left = 261
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384#26684#24335
|
||||||
|
ImageIndex = 16
|
||||||
|
OnClick = TBSaveFmtClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 356
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 7
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel [1]
|
||||||
|
Left = 0
|
||||||
|
Top = 38
|
||||||
|
Width = 1100
|
||||||
|
Height = 46
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = 16242829
|
||||||
|
ParentBackground = False
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 523
|
||||||
|
Top = 15
|
||||||
|
Width = 65
|
||||||
|
Height = 12
|
||||||
|
Caption = #25377#36710#24037#21517#31216
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 353
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 204
|
||||||
|
Top = 16
|
||||||
|
Width = 13
|
||||||
|
Height = 12
|
||||||
|
Caption = #33267
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object knitter: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 594
|
||||||
|
Top = 10
|
||||||
|
Width = 110
|
||||||
|
Height = 20
|
||||||
|
Hint = '0'
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = knitterKeyPress
|
||||||
|
end
|
||||||
|
object C_Name: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 387
|
||||||
|
Top = 12
|
||||||
|
Width = 130
|
||||||
|
Height = 20
|
||||||
|
Hint = '0'
|
||||||
|
TabOrder = 1
|
||||||
|
OnKeyPress = C_NameKeyPress
|
||||||
|
end
|
||||||
|
object IsJYTime: TCheckBox
|
||||||
|
Left = 12
|
||||||
|
Top = 15
|
||||||
|
Width = 90
|
||||||
|
Height = 17
|
||||||
|
Caption = #25353#26816#39564#26102#38388
|
||||||
|
Checked = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 108
|
||||||
|
Top = 12
|
||||||
|
Width = 90
|
||||||
|
Height = 22
|
||||||
|
Date = 44774.000000000000000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 0.464742650459811600
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 223
|
||||||
|
Top = 12
|
||||||
|
Width = 90
|
||||||
|
Height = 22
|
||||||
|
Date = 44774.000000000000000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 0.464742650459811600
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxPageControl1: TcxPageControl [2]
|
||||||
|
Left = 0
|
||||||
|
Top = 84
|
||||||
|
Width = 1100
|
||||||
|
Height = 536
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 2
|
||||||
|
Properties.ActivePage = TabDet
|
||||||
|
Properties.CustomButtons.Buttons = <>
|
||||||
|
ClientRectBottom = 534
|
||||||
|
ClientRectLeft = 2
|
||||||
|
ClientRectRight = 1098
|
||||||
|
ClientRectTop = 22
|
||||||
|
object TabSum: TcxTabSheet
|
||||||
|
Caption = #27719#24635#39029
|
||||||
|
ImageIndex = 0
|
||||||
|
object cxGridS: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 30
|
||||||
|
Width = 1096
|
||||||
|
Height = 482
|
||||||
|
Align = alClient
|
||||||
|
BorderStyle = cxcbsNone
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 0
|
||||||
|
object TvS: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
ScrollbarAnnotations.CustomAnnotations = <>
|
||||||
|
DataController.DataSource = DS_S
|
||||||
|
DataController.Filter.AutoDataSetFilter = True
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = TvSSumQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = TvSRollCount
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
OptionsView.IndicatorWidth = 30
|
||||||
|
Styles.IncSearch = DataLink_TatInsp.SHuangSe
|
||||||
|
Styles.Footer = DataLink_TatInsp.Default
|
||||||
|
Styles.Header = DataLink_TatInsp.Default
|
||||||
|
Styles.Inactive = DataLink_TatInsp.SHuangSe
|
||||||
|
Styles.Selection = DataLink_TatInsp.SHuangSe
|
||||||
|
OnCustomDrawIndicatorCell = TvSCustomDrawIndicatorCell
|
||||||
|
object TvSknitter: TcxGridDBColumn
|
||||||
|
Caption = #25377#36710#24037#21517#31216
|
||||||
|
DataBinding.FieldName = 'knitter'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 160
|
||||||
|
end
|
||||||
|
object TvSC_Name: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 160
|
||||||
|
end
|
||||||
|
object TvSSumQty: TcxGridDBColumn
|
||||||
|
Caption = #20135#37327
|
||||||
|
DataBinding.FieldName = 'SumQty'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object TvSRollCount: TcxGridDBColumn
|
||||||
|
Caption = #21367#25968
|
||||||
|
DataBinding.FieldName = 'RollCount'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridSLevel1: TcxGridLevel
|
||||||
|
GridView = TvS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object PanelS: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1096
|
||||||
|
Height = 30
|
||||||
|
Align = alTop
|
||||||
|
TabOrder = 1
|
||||||
|
object LabelS1: TLabel
|
||||||
|
Left = 10
|
||||||
|
Top = 8
|
||||||
|
Width = 78
|
||||||
|
Height = 12
|
||||||
|
Caption = #27599#39029#35760#24405#26465#25968
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object LBCPAPS: TLabel
|
||||||
|
Left = 310
|
||||||
|
Top = 8
|
||||||
|
Width = 85
|
||||||
|
Height = 12
|
||||||
|
Caption = #24403#21069#39029'/'#24635#39029#25968
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object TCBNORS: TComboBox
|
||||||
|
Tag = 2
|
||||||
|
Left = 95
|
||||||
|
Top = 5
|
||||||
|
Width = 78
|
||||||
|
Height = 20
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ItemIndex = 0
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 0
|
||||||
|
Text = '500'
|
||||||
|
OnChange = TCBNORSChange
|
||||||
|
Items.Strings = (
|
||||||
|
'500'
|
||||||
|
'1000'
|
||||||
|
'5000'
|
||||||
|
'10000')
|
||||||
|
end
|
||||||
|
object BTLPS: TButton
|
||||||
|
Left = 200
|
||||||
|
Top = 4
|
||||||
|
Width = 60
|
||||||
|
Height = 22
|
||||||
|
Caption = #19978#19968#39029
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = BTLPSClick
|
||||||
|
end
|
||||||
|
object BTNPS: TButton
|
||||||
|
Left = 400
|
||||||
|
Top = 4
|
||||||
|
Width = 60
|
||||||
|
Height = 22
|
||||||
|
Caption = #19979#19968#39029
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = BTNPSClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object TabDet: TcxTabSheet
|
||||||
|
Caption = #26126#32454#39029
|
||||||
|
ImageIndex = 1
|
||||||
|
object cxGridD: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 30
|
||||||
|
Width = 1096
|
||||||
|
Height = 482
|
||||||
|
Align = alClient
|
||||||
|
BorderStyle = cxcbsNone
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 0
|
||||||
|
object TvD: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
ScrollbarAnnotations.CustomAnnotations = <>
|
||||||
|
DataController.DataSource = DS_D
|
||||||
|
DataController.Filter.AutoDataSetFilter = True
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = TvDqty
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
OptionsView.IndicatorWidth = 30
|
||||||
|
Styles.IncSearch = DataLink_TatInsp.SHuangSe
|
||||||
|
Styles.Footer = DataLink_TatInsp.Default
|
||||||
|
Styles.Header = DataLink_TatInsp.Default
|
||||||
|
Styles.Inactive = DataLink_TatInsp.SHuangSe
|
||||||
|
Styles.Selection = DataLink_TatInsp.SHuangSe
|
||||||
|
OnCustomDrawIndicatorCell = TvDCustomDrawIndicatorCell
|
||||||
|
object TvDFillTime: TcxGridDBColumn
|
||||||
|
Caption = #26816#39564#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 140
|
||||||
|
end
|
||||||
|
object TvDCARNO: TcxGridDBColumn
|
||||||
|
Caption = #19979#24067#26426#21488#21495
|
||||||
|
DataBinding.FieldName = 'CARNO'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 110
|
||||||
|
end
|
||||||
|
object TvDknitter: TcxGridDBColumn
|
||||||
|
Caption = #25377#36710#24037#21517#31216
|
||||||
|
DataBinding.FieldName = 'knitter'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 130
|
||||||
|
end
|
||||||
|
object TvDC_Name: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 150
|
||||||
|
end
|
||||||
|
object TvDqty: TcxGridDBColumn
|
||||||
|
Caption = #20135#37327
|
||||||
|
DataBinding.FieldName = 'qty'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object TvDCIID: TcxGridDBColumn
|
||||||
|
Caption = #21367#26465#30721
|
||||||
|
DataBinding.FieldName = 'CIID'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 120
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridDLevel1: TcxGridLevel
|
||||||
|
GridView = TvD
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object PanelD: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1096
|
||||||
|
Height = 30
|
||||||
|
Align = alTop
|
||||||
|
TabOrder = 1
|
||||||
|
object LabelD1: TLabel
|
||||||
|
Left = 10
|
||||||
|
Top = 8
|
||||||
|
Width = 78
|
||||||
|
Height = 12
|
||||||
|
Caption = #27599#39029#35760#24405#26465#25968
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object LBCPAPD: TLabel
|
||||||
|
Left = 310
|
||||||
|
Top = 8
|
||||||
|
Width = 85
|
||||||
|
Height = 12
|
||||||
|
Caption = #24403#21069#39029'/'#24635#39029#25968
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object TCBNORD: TComboBox
|
||||||
|
Tag = 2
|
||||||
|
Left = 95
|
||||||
|
Top = 5
|
||||||
|
Width = 78
|
||||||
|
Height = 20
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ItemIndex = 0
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 0
|
||||||
|
Text = '500'
|
||||||
|
OnChange = TCBNORDChange
|
||||||
|
Items.Strings = (
|
||||||
|
'500'
|
||||||
|
'1000'
|
||||||
|
'5000'
|
||||||
|
'10000')
|
||||||
|
end
|
||||||
|
object BTLPD: TButton
|
||||||
|
Left = 200
|
||||||
|
Top = 4
|
||||||
|
Width = 60
|
||||||
|
Height = 22
|
||||||
|
Caption = #19978#19968#39029
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = BTLPDClick
|
||||||
|
end
|
||||||
|
object BNTPD: TButton
|
||||||
|
Left = 400
|
||||||
|
Top = 4
|
||||||
|
Width = 60
|
||||||
|
Height = 22
|
||||||
|
Caption = #19979#19968#39029
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = BNTPDClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object MovePanel2: TMovePanel [3]
|
||||||
|
Left = 592
|
||||||
|
Top = 216
|
||||||
|
Width = 289
|
||||||
|
Height = 49
|
||||||
|
BevelInner = bvLowered
|
||||||
|
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#8230#8230
|
||||||
|
Color = clSkyBlue
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -14
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 3
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object ADOQSum: TADOQuery [4]
|
||||||
|
Connection = DataLink_TatInsp.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 40
|
||||||
|
Top = 296
|
||||||
|
end
|
||||||
|
object ADOQDetail: TADOQuery [5]
|
||||||
|
Connection = DataLink_TatInsp.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 120
|
||||||
|
Top = 296
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery [6]
|
||||||
|
Connection = DataLink_TatInsp.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 280
|
||||||
|
Top = 296
|
||||||
|
end
|
||||||
|
object DS_S: TDataSource [7]
|
||||||
|
DataSet = CDS_Sum
|
||||||
|
Left = 680
|
||||||
|
Top = 324
|
||||||
|
end
|
||||||
|
object DS_D: TDataSource [8]
|
||||||
|
DataSet = CDS_Detail
|
||||||
|
Left = 720
|
||||||
|
Top = 324
|
||||||
|
end
|
||||||
|
object CDS_Sum: TClientDataSet [9]
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 616
|
||||||
|
Top = 360
|
||||||
|
end
|
||||||
|
object CDS_Detail: TClientDataSet [10]
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 656
|
||||||
|
Top = 360
|
||||||
|
end
|
||||||
|
inherited ADOQueryBaseCmd: TADOQuery
|
||||||
|
Connection = DataLink_TatInsp.ADOLink
|
||||||
|
end
|
||||||
|
inherited ADOQueryBaseTemp: TADOQuery
|
||||||
|
Connection = DataLink_TatInsp.ADOLink
|
||||||
|
end
|
||||||
|
end
|
||||||
365
E03梭织坯布检验/U_TatKnitterQuery.pas
Normal file
365
E03梭织坯布检验/U_TatKnitterQuery.pas
Normal file
|
|
@ -0,0 +1,365 @@
|
||||||
|
unit U_TatKnitterQuery;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
||||||
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
||||||
|
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar,
|
||||||
|
cxPC, Math, U_BaseList, MovePanel, cxLookAndFeels, cxLookAndFeelPainters,
|
||||||
|
cxNavigator, dxBarBuiltInMenu, dxSkinsCore, dxSkinsDefaultPainters,
|
||||||
|
dxDateRanges, System.StrUtils, dxScrollbarAnnotations, dxSkinWXI;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmTatKnitterQuery = class(TfrmBaseList)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBExpSum: TToolButton;
|
||||||
|
TBExpDet: TToolButton;
|
||||||
|
TBSaveFmt: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
knitter: TEdit;
|
||||||
|
Label2: TLabel;
|
||||||
|
C_Name: TEdit;
|
||||||
|
IsJYTime: TCheckBox;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
Label4: TLabel;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
cxPageControl1: TcxPageControl;
|
||||||
|
TabSum: TcxTabSheet;
|
||||||
|
cxGridS: TcxGrid;
|
||||||
|
TvS: TcxGridDBTableView;
|
||||||
|
TvSknitter: TcxGridDBColumn;
|
||||||
|
TvSC_Name: TcxGridDBColumn;
|
||||||
|
TvSSumQty: TcxGridDBColumn;
|
||||||
|
TvSRollCount: TcxGridDBColumn;
|
||||||
|
cxGridSLevel1: TcxGridLevel;
|
||||||
|
PanelS: TPanel;
|
||||||
|
LabelS1: TLabel;
|
||||||
|
TCBNORS: TComboBox;
|
||||||
|
BTLPS: TButton;
|
||||||
|
LBCPAPS: TLabel;
|
||||||
|
BTNPS: TButton;
|
||||||
|
TabDet: TcxTabSheet;
|
||||||
|
cxGridD: TcxGrid;
|
||||||
|
TvD: TcxGridDBTableView;
|
||||||
|
TvDCARNO: TcxGridDBColumn;
|
||||||
|
TvDknitter: TcxGridDBColumn;
|
||||||
|
TvDC_Name: TcxGridDBColumn;
|
||||||
|
TvDqty: TcxGridDBColumn;
|
||||||
|
TvDCIID: TcxGridDBColumn;
|
||||||
|
cxGridDLevel1: TcxGridLevel;
|
||||||
|
PanelD: TPanel;
|
||||||
|
LabelD1: TLabel;
|
||||||
|
TCBNORD: TComboBox;
|
||||||
|
BTLPD: TButton;
|
||||||
|
LBCPAPD: TLabel;
|
||||||
|
BNTPD: TButton;
|
||||||
|
MovePanel2: TMovePanel;
|
||||||
|
ADOQSum: TADOQuery;
|
||||||
|
ADOQDetail: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DS_S: TDataSource;
|
||||||
|
DS_D: TDataSource;
|
||||||
|
CDS_Sum: TClientDataSet;
|
||||||
|
CDS_Detail: TClientDataSet;
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBExpSumClick(Sender: TObject);
|
||||||
|
procedure TBExpDetClick(Sender: TObject);
|
||||||
|
procedure TBSaveFmtClick(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure knitterKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure C_NameKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure BTLPSClick(Sender: TObject);
|
||||||
|
procedure BTNPSClick(Sender: TObject);
|
||||||
|
procedure TCBNORSChange(Sender: TObject);
|
||||||
|
procedure BTLPDClick(Sender: TObject);
|
||||||
|
procedure BNTPDClick(Sender: TObject);
|
||||||
|
procedure TCBNORDChange(Sender: TObject);
|
||||||
|
procedure TvSCustomDrawIndicatorCell(Sender: TcxGridTableView;
|
||||||
|
ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
|
||||||
|
var ADone: Boolean);
|
||||||
|
procedure TvDCustomDrawIndicatorCell(Sender: TcxGridTableView;
|
||||||
|
ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
|
||||||
|
var ADone: Boolean);
|
||||||
|
private
|
||||||
|
FWorkshop: string;
|
||||||
|
CurrentPageS, RecordsNumberS, CurrentPageD, RecordsNumberD: Integer;
|
||||||
|
function BuildCriteria(): string;
|
||||||
|
procedure InitSum();
|
||||||
|
procedure InitDetail();
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmTatKnitterQuery: TfrmTatKnitterQuery;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_RTFun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Action := caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FWorkshop := Trim(Self.fParameters3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
CurrentPageS := 1;
|
||||||
|
RecordsNumberS := 500;
|
||||||
|
CurrentPageD := 1;
|
||||||
|
RecordsNumberD := 500;
|
||||||
|
ReadCxGrid(Trim(Self.Caption) + 'TvS', TvS, '贸易检验管理');
|
||||||
|
ReadCxGrid(Trim(Self.Caption) + 'TvD', TvD, '贸易检验管理');
|
||||||
|
EndDate.DateTime := SGetServerDate(ADOQueryTemp);
|
||||||
|
BegDate.DateTime := EndDate.DateTime;
|
||||||
|
InitSum();
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmTatKnitterQuery.BuildCriteria(): string;
|
||||||
|
var
|
||||||
|
WSql: string;
|
||||||
|
begin
|
||||||
|
WSql := SGetFilters(Panel1, 1, 2);
|
||||||
|
if Trim(WSql) <> '' then
|
||||||
|
WSql := ' and ' + Trim(WSql);
|
||||||
|
|
||||||
|
if Trim(FWorkshop) <> '' then
|
||||||
|
WSql := WSql + ' and A.Workshop=' + QuotedStr(Trim(FWorkshop));
|
||||||
|
|
||||||
|
if IsJYTime.Checked then
|
||||||
|
begin
|
||||||
|
WSql := WSql + ' and A.FillTime>' + QuotedStr(FormatDateTime('yyyy-MM-dd', BegDate.DateTime));
|
||||||
|
WSql := WSql + ' and A.FillTime<=' + QuotedStr(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1));
|
||||||
|
end
|
||||||
|
else if Trim(WSql) = '' then
|
||||||
|
WSql := ' and 1=2 ';
|
||||||
|
|
||||||
|
Result := WSql;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.InitSum();
|
||||||
|
var
|
||||||
|
WSql: string;
|
||||||
|
begin
|
||||||
|
MovePanel2.Left := (Self.Width - MovePanel2.Width) div 2;
|
||||||
|
MovePanel2.Visible := True;
|
||||||
|
MovePanel2.Refresh;
|
||||||
|
WSql := BuildCriteria();
|
||||||
|
if Trim(WSql) = 'and 1=2' then
|
||||||
|
Application.MessageBox('勾选检验时间或填入搜索条件', '提示', 0);
|
||||||
|
|
||||||
|
try
|
||||||
|
CDS_Sum.DisableControls;
|
||||||
|
with ADOQSum do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Tat_Knitter_Sum_Get_Page ');
|
||||||
|
SQL.Add('@pageIndex=' + IntToStr(CurrentPageS));
|
||||||
|
SQL.Add(',@pageSize=' + IntToStr(RecordsNumberS));
|
||||||
|
SQL.Add(',@criteria=' + QuotedStr(WSql));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS(ADOQSum, CDS_Sum);
|
||||||
|
SInitCDSData(ADOQSum, CDS_Sum);
|
||||||
|
LBCPAPS.Caption := IntToStr(CurrentPageS) + '/' + IntToStr(Ceil(ADOQSum.FieldByName('TotalCount').AsInteger / RecordsNumberS));
|
||||||
|
finally
|
||||||
|
CDS_Sum.EnableControls;
|
||||||
|
MovePanel2.Visible := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.InitDetail();
|
||||||
|
var
|
||||||
|
WSql: string;
|
||||||
|
begin
|
||||||
|
MovePanel2.Left := (Self.Width - MovePanel2.Width) div 2;
|
||||||
|
MovePanel2.Visible := True;
|
||||||
|
MovePanel2.Refresh;
|
||||||
|
WSql := BuildCriteria();
|
||||||
|
if Trim(WSql) = 'and 1=2' then
|
||||||
|
Application.MessageBox('勾选检验时间或填入搜索条件', '提示', 0);
|
||||||
|
|
||||||
|
try
|
||||||
|
CDS_Detail.DisableControls;
|
||||||
|
with ADOQDetail do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Tat_Knitter_Get_Page ');
|
||||||
|
SQL.Add('@pageIndex=' + IntToStr(CurrentPageD));
|
||||||
|
SQL.Add(',@pageSize=' + IntToStr(RecordsNumberD));
|
||||||
|
SQL.Add(',@criteria=' + QuotedStr(WSql));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS(ADOQDetail, CDS_Detail);
|
||||||
|
SInitCDSData(ADOQDetail, CDS_Detail);
|
||||||
|
LBCPAPD.Caption := IntToStr(CurrentPageD) + '/' + IntToStr(Ceil(ADOQDetail.FieldByName('TotalCount').AsInteger / RecordsNumberD));
|
||||||
|
finally
|
||||||
|
CDS_Detail.EnableControls;
|
||||||
|
MovePanel2.Visible := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CurrentPageS := 1;
|
||||||
|
CurrentPageD := 1;
|
||||||
|
InitSum();
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TBExpSumClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sum.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
TcxGridToExcel(Trim(Self.Caption) + '-汇总', cxGridS);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TBExpDetClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Detail.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
TcxGridToExcel(Trim(Self.Caption) + '-明细', cxGridD);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TBSaveFmtClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid(Trim(Self.Caption) + 'TvS', TvS, '贸易检验管理');
|
||||||
|
WriteCxGrid(Trim(Self.Caption) + 'TvD', TvD, '贸易检验管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.knitterKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key = #13 then
|
||||||
|
begin
|
||||||
|
CurrentPageS := 1;
|
||||||
|
CurrentPageD := 1;
|
||||||
|
InitSum();
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.C_NameKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key = #13 then
|
||||||
|
begin
|
||||||
|
CurrentPageS := 1;
|
||||||
|
CurrentPageD := 1;
|
||||||
|
InitSum();
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.BTLPSClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CurrentPageS > 1 then
|
||||||
|
CurrentPageS := CurrentPageS - 1;
|
||||||
|
InitSum();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.BTNPSClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CurrentPageS < ADOQSum.FieldByName('TotalCount').AsInteger / RecordsNumberS then
|
||||||
|
CurrentPageS := CurrentPageS + 1;
|
||||||
|
InitSum();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TCBNORSChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RecordsNumberS := StrToInt(TCBNORS.Text);
|
||||||
|
CurrentPageS := 1;
|
||||||
|
InitSum();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.BTLPDClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CurrentPageD > 1 then
|
||||||
|
CurrentPageD := CurrentPageD - 1;
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.BNTPDClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CurrentPageD < ADOQDetail.FieldByName('TotalCount').AsInteger / RecordsNumberD then
|
||||||
|
CurrentPageD := CurrentPageD + 1;
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TCBNORDChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RecordsNumberD := StrToInt(TCBNORD.Text);
|
||||||
|
CurrentPageD := 1;
|
||||||
|
InitDetail();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TvSCustomDrawIndicatorCell(Sender: TcxGridTableView;
|
||||||
|
ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
|
||||||
|
var ADone: Boolean);
|
||||||
|
var
|
||||||
|
FValue: string;
|
||||||
|
FBounds: TRect;
|
||||||
|
begin
|
||||||
|
FBounds := AViewInfo.Bounds;
|
||||||
|
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||||||
|
begin
|
||||||
|
ACanvas.FillRect(FBounds);
|
||||||
|
ACanvas.DrawComplexFrame(FBounds, clBlack, clBlack, [bBottom, bLeft, bRight], 1);
|
||||||
|
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||||||
|
InflateRect(FBounds, -3, -2);
|
||||||
|
ACanvas.Font.Color := clBlack;
|
||||||
|
ACanvas.Brush.Style := bsClear;
|
||||||
|
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||||||
|
ADone := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatKnitterQuery.TvDCustomDrawIndicatorCell(Sender: TcxGridTableView;
|
||||||
|
ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo;
|
||||||
|
var ADone: Boolean);
|
||||||
|
var
|
||||||
|
FValue: string;
|
||||||
|
FBounds: TRect;
|
||||||
|
begin
|
||||||
|
FBounds := AViewInfo.Bounds;
|
||||||
|
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||||||
|
begin
|
||||||
|
ACanvas.FillRect(FBounds);
|
||||||
|
ACanvas.DrawComplexFrame(FBounds, clBlack, clBlack, [bBottom, bLeft, bRight], 1);
|
||||||
|
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||||||
|
InflateRect(FBounds, -3, -2);
|
||||||
|
ACanvas.Font.Color := clBlack;
|
||||||
|
ACanvas.Brush.Style := bsClear;
|
||||||
|
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||||||
|
ADone := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -937,13 +937,13 @@
|
||||||
object Label25: TLabel
|
object Label25: TLabel
|
||||||
Left = 7
|
Left = 7
|
||||||
Top = 17
|
Top = 17
|
||||||
Width = 82
|
Width = 52
|
||||||
Height = 65
|
Height = 48
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
Caption = #20135#21697#32534#21495':'
|
Caption = #20135#21697#32534#21495':'
|
||||||
Font.Charset = ANSI_CHARSET
|
Font.Charset = ANSI_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -27
|
Font.Height = -19
|
||||||
Font.Name = 'Arial'
|
Font.Name = 'Arial'
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
|
@ -1072,6 +1072,21 @@
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
|
object Label61: TLabel
|
||||||
|
Left = 8
|
||||||
|
Top = 71
|
||||||
|
Width = 52
|
||||||
|
Height = 48
|
||||||
|
AutoSize = False
|
||||||
|
Caption = #20135#21697#21517#31216':'
|
||||||
|
Font.Charset = ANSI_CHARSET
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -19
|
||||||
|
Font.Name = 'Arial'
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
WordWrap = True
|
||||||
|
end
|
||||||
object PCId: TEdit
|
object PCId: TEdit
|
||||||
Left = 480
|
Left = 480
|
||||||
Top = 83
|
Top = 83
|
||||||
|
|
@ -1118,20 +1133,19 @@
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
object CodeName: TEdit
|
object CodeName: TEdit
|
||||||
Left = 32
|
Left = 88
|
||||||
Top = 4
|
Top = 66
|
||||||
Width = 32
|
Width = 240
|
||||||
Height = 68
|
Height = 50
|
||||||
Font.Charset = ANSI_CHARSET
|
Font.Charset = ANSI_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -53
|
Font.Height = -37
|
||||||
Font.Name = 'Arial'
|
Font.Name = 'Arial'
|
||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
ReadOnly = True
|
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Visible = False
|
|
||||||
OnClick = CIFBegClick
|
OnClick = CIFBegClick
|
||||||
|
OnExit = CodeNameExit
|
||||||
end
|
end
|
||||||
object edtScan: TEdit
|
object edtScan: TEdit
|
||||||
Left = 291
|
Left = 291
|
||||||
|
|
@ -1196,13 +1210,13 @@
|
||||||
OnClick = Button5Click
|
OnClick = Button5Click
|
||||||
end
|
end
|
||||||
object code: TEdit
|
object code: TEdit
|
||||||
Left = 86
|
Left = 88
|
||||||
Top = 14
|
Top = 10
|
||||||
Width = 242
|
Width = 240
|
||||||
Height = 68
|
Height = 50
|
||||||
Font.Charset = ANSI_CHARSET
|
Font.Charset = ANSI_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -53
|
Font.Height = -37
|
||||||
Font.Name = 'Arial'
|
Font.Name = 'Arial'
|
||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
|
@ -2664,7 +2678,7 @@
|
||||||
end
|
end
|
||||||
object v3Column5: TcxGridDBColumn
|
object v3Column5: TcxGridDBColumn
|
||||||
Caption = #20928#37325
|
Caption = #20928#37325
|
||||||
DataBinding.FieldName = 'NetWeight'
|
DataBinding.FieldName = 'NetWeightWithAdd'
|
||||||
DataBinding.IsNullValueType = True
|
DataBinding.IsNullValueType = True
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
|
|
@ -2673,7 +2687,7 @@
|
||||||
end
|
end
|
||||||
object v3Column4: TcxGridDBColumn
|
object v3Column4: TcxGridDBColumn
|
||||||
Caption = #37325#37327
|
Caption = #37325#37327
|
||||||
DataBinding.FieldName = 'GrossWeight'
|
DataBinding.FieldName = 'GrossWeightWithAdd'
|
||||||
DataBinding.IsNullValueType = True
|
DataBinding.IsNullValueType = True
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
|
|
@ -2713,6 +2727,14 @@
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
Width = 80
|
Width = 80
|
||||||
end
|
end
|
||||||
|
object Tv3c_name: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#21517#31216
|
||||||
|
DataBinding.FieldName = 'c_name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
object Tv3CalcMeter: TcxGridDBColumn
|
object Tv3CalcMeter: TcxGridDBColumn
|
||||||
Caption = #35745#31639#31859#25968
|
Caption = #35745#31639#31859#25968
|
||||||
DataBinding.FieldName = 'CalcMeter'
|
DataBinding.FieldName = 'CalcMeter'
|
||||||
|
|
@ -2903,6 +2925,10 @@
|
||||||
object 查看: TcxTabSheet
|
object 查看: TcxTabSheet
|
||||||
Caption = #26597#30475
|
Caption = #26597#30475
|
||||||
ImageIndex = 1
|
ImageIndex = 1
|
||||||
|
ExplicitLeft = 0
|
||||||
|
ExplicitTop = 0
|
||||||
|
ExplicitWidth = 0
|
||||||
|
ExplicitHeight = 0
|
||||||
object cxGrid1: TcxGrid
|
object cxGrid1: TcxGrid
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
|
|
@ -3579,6 +3605,7 @@
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 13
|
TabOrder = 13
|
||||||
|
OnChange = add_weightChange
|
||||||
OnClick = CIFBegClick
|
OnClick = CIFBegClick
|
||||||
OnKeyPress = MJstr3KeyPress
|
OnKeyPress = MJstr3KeyPress
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -349,6 +349,8 @@ type
|
||||||
BtnCon: TButton;
|
BtnCon: TButton;
|
||||||
add_weight: TEdit;
|
add_weight: TEdit;
|
||||||
Label60: TLabel;
|
Label60: TLabel;
|
||||||
|
Label61: TLabel;
|
||||||
|
Tv3c_name: TcxGridDBColumn;
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
|
|
@ -411,9 +413,11 @@ type
|
||||||
procedure Button10Click(Sender: TObject);
|
procedure Button10Click(Sender: TObject);
|
||||||
procedure codeClick(Sender: TObject);
|
procedure codeClick(Sender: TObject);
|
||||||
procedure codeExit(Sender: TObject);
|
procedure codeExit(Sender: TObject);
|
||||||
|
procedure CodeNameExit(Sender: TObject);
|
||||||
procedure weaver_nameClick(Sender: TObject);
|
procedure weaver_nameClick(Sender: TObject);
|
||||||
procedure InputWeightChange(Sender: TObject);
|
procedure InputWeightChange(Sender: TObject);
|
||||||
procedure KZChange(Sender: TObject);
|
procedure KZChange(Sender: TObject);
|
||||||
|
procedure add_weightChange(Sender: TObject);
|
||||||
procedure edtMaxClick(Sender: TObject);
|
procedure edtMaxClick(Sender: TObject);
|
||||||
procedure BtnConClick(Sender: TObject);
|
procedure BtnConClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
|
@ -482,7 +486,7 @@ end;
|
||||||
|
|
||||||
procedure TfrmTatMachInsp.CalcInputLenByWeightKZ;
|
procedure TfrmTatMachInsp.CalcInputLenByWeightKZ;
|
||||||
var
|
var
|
||||||
W, KZValue: Double;
|
W, AW, KZValue: Double;
|
||||||
begin
|
begin
|
||||||
if Trim(InputWeight.Text) = '' then
|
if Trim(InputWeight.Text) = '' then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
@ -491,6 +495,8 @@ begin
|
||||||
|
|
||||||
if not TryStrToFloat(Trim(InputWeight.Text), W) then
|
if not TryStrToFloat(Trim(InputWeight.Text), W) then
|
||||||
Exit;
|
Exit;
|
||||||
|
if not TryStrToFloat(Trim(add_weight.Text), AW) then
|
||||||
|
AW := 0;
|
||||||
if not TryStrToFloat(Trim(KZ.Text), KZValue) then
|
if not TryStrToFloat(Trim(KZ.Text), KZValue) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
|
|
@ -500,7 +506,7 @@ begin
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
InputLen.Text := FormatFloat('0.##', W / KZValue);
|
InputLen.Text := FormatFloat('0.##', (W + AW) / KZValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmTatMachInsp.SetINIFile();
|
procedure TfrmTatMachInsp.SetINIFile();
|
||||||
|
|
@ -1058,6 +1064,11 @@ begin
|
||||||
CalcInputLenByWeightKZ;
|
CalcInputLenByWeightKZ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatMachInsp.add_weightChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CalcInputLenByWeightKZ;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmTatMachInsp.InitJTM(MCIID: string);
|
procedure TfrmTatMachInsp.InitJTM(MCIID: string);
|
||||||
begin
|
begin
|
||||||
with ADOTmp do
|
with ADOTmp do
|
||||||
|
|
@ -1165,7 +1176,7 @@ begin
|
||||||
Open;
|
Open;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not ADOTmp.IsEmpty then
|
if (not ADOTmp.IsEmpty) and (ADOTmp.FieldByName('Status').AsInteger = 5) then
|
||||||
begin
|
begin
|
||||||
code.Text := Trim(ADOTmp.FieldByName('C_Code').AsString);
|
code.Text := Trim(ADOTmp.FieldByName('C_Code').AsString);
|
||||||
CodeName.Text := Trim(ADOTmp.FieldByName('C_Name').AsString);
|
CodeName.Text := Trim(ADOTmp.FieldByName('C_Name').AsString);
|
||||||
|
|
@ -1181,7 +1192,10 @@ begin
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Application.MessageBox('未找到该产品编号,请重新输入!', '提示', MB_ICONWARNING);
|
if ADOTmp.IsEmpty then
|
||||||
|
Application.MessageBox('未找到该产品编号,请重新输入!', '提示', MB_ICONWARNING)
|
||||||
|
else
|
||||||
|
Application.MessageBox('该产品已停用,不能使用!', '提示', MB_ICONWARNING);
|
||||||
CodeName.Text := '';
|
CodeName.Text := '';
|
||||||
MF.Text := '';
|
MF.Text := '';
|
||||||
KZ.Text := '';
|
KZ.Text := '';
|
||||||
|
|
@ -1191,6 +1205,50 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatMachInsp.CodeNameExit(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Trim(CodeName.Text) = '' then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
CodeName.Text := Trim(CodeName.Text);
|
||||||
|
|
||||||
|
with ADOTmp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('SELECT * FROM Bs_Cloth_Info WHERE C_Name = ' + QuotedStr(CodeName.Text));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (not ADOTmp.IsEmpty) and (ADOTmp.FieldByName('Status').AsInteger = 5) then
|
||||||
|
begin
|
||||||
|
code.Text := Trim(ADOTmp.FieldByName('C_Code').AsString);
|
||||||
|
CodeName.Text := Trim(ADOTmp.FieldByName('C_Name').AsString);
|
||||||
|
MF.Text := Trim(ADOTmp.FieldByName('C_Width').AsString);
|
||||||
|
KZ.Text := Trim(ADOTmp.FieldByName('C_GramWeight').AsString);
|
||||||
|
SPEC.Text := Trim(ADOTmp.FieldByName('C_SPEC').AsString);
|
||||||
|
C_LongitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LongitudeBatchNo').AsString);
|
||||||
|
C_LatitudeBatchNo.Text := Trim(ADOTmp.FieldByName('C_LatitudeBatchNo').AsString);
|
||||||
|
|
||||||
|
FMainId := '';
|
||||||
|
FSubId := '';
|
||||||
|
Label14.Caption := '订单号';
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if ADOTmp.IsEmpty then
|
||||||
|
Application.MessageBox('未找到该产品名称,请重新输入!', '提示', MB_ICONWARNING)
|
||||||
|
else
|
||||||
|
Application.MessageBox('该产品已停用,不能使用!', '提示', MB_ICONWARNING);
|
||||||
|
code.Text := '';
|
||||||
|
MF.Text := '';
|
||||||
|
KZ.Text := '';
|
||||||
|
SPEC.Text := '';
|
||||||
|
C_LongitudeBatchNo.Text := '';
|
||||||
|
C_LatitudeBatchNo.Text := '';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmTatMachInsp.ComboBox1Change(Sender: TObject);
|
procedure TfrmTatMachInsp.ComboBox1Change(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SetINIFile();
|
SetINIFile();
|
||||||
|
|
@ -1437,12 +1495,14 @@ begin
|
||||||
sql.Add(' ISNULL((select top 1 TRY_CAST(B.estimated_diff AS decimal(18,4)) from Bs_Cloth_Info B where B.c_code = A.c_code), 0) AS EstimatedDiff,');
|
sql.Add(' ISNULL((select top 1 TRY_CAST(B.estimated_diff AS decimal(18,4)) from Bs_Cloth_Info B where B.c_code = A.c_code), 0) AS EstimatedDiff,');
|
||||||
sql.Add(' ROUND(ABS(CM2.CalcMeter - ISNULL(TRY_CAST(A.code_table_length AS decimal(18,4)), 0)), 1) AS ActualDiff');
|
sql.Add(' ROUND(ABS(CM2.CalcMeter - ISNULL(TRY_CAST(A.code_table_length AS decimal(18,4)), 0)), 1) AS ActualDiff');
|
||||||
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.Meter AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_length AS decimal(18,4)), 0), 2) AS MeterWithAddLength');
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.Meter AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_length AS decimal(18,4)), 0), 2) AS MeterWithAddLength');
|
||||||
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS GrossWeightWithAdd');
|
||||||
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.NetWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS NetWeightWithAdd');
|
||||||
sql.Add('from Tat_Cloth_Inspect A ');
|
sql.Add('from Tat_Cloth_Inspect A ');
|
||||||
sql.Add('outer apply (select ROUND(ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM');
|
sql.Add('outer apply (select ROUND(ISNULL((ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM');
|
||||||
sql.Add('outer apply (select CASE WHEN CM.CalcMeterRaw <= 0 THEN CM.CalcMeterRaw');
|
sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))');
|
||||||
sql.Add(' WHEN CM.CalcMeterRaw - FLOOR(CM.CalcMeterRaw) < 0.05 THEN FLOOR(CM.CalcMeterRaw)');
|
sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))');
|
||||||
sql.Add(' WHEN CM.CalcMeterRaw - FLOOR(CM.CalcMeterRaw) <= 0.5 THEN FLOOR(CM.CalcMeterRaw) + 0.5');
|
sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5');
|
||||||
sql.Add(' ELSE CEILING(CM.CalcMeterRaw) END as CalcMeter) CM2');
|
sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2');
|
||||||
sql.Add('where mainid=' + quotedstr(fmainid));
|
sql.Add('where mainid=' + quotedstr(fmainid));
|
||||||
sql.Add('and filler=' + quotedstr(dname));
|
sql.Add('and filler=' + quotedstr(dname));
|
||||||
sql.Add('order by filltime desc');
|
sql.Add('order by filltime desc');
|
||||||
|
|
@ -1454,18 +1514,21 @@ begin
|
||||||
sql.Add(' ISNULL((select top 1 TRY_CAST(B.estimated_diff AS decimal(18,4)) from Bs_Cloth_Info B where B.c_code = A.c_code), 0) AS EstimatedDiff,');
|
sql.Add(' ISNULL((select top 1 TRY_CAST(B.estimated_diff AS decimal(18,4)) from Bs_Cloth_Info B where B.c_code = A.c_code), 0) AS EstimatedDiff,');
|
||||||
sql.Add(' ROUND(ABS(CM2.CalcMeter - ISNULL(TRY_CAST(A.code_table_length AS decimal(18,4)), 0)), 1) AS ActualDiff');
|
sql.Add(' ROUND(ABS(CM2.CalcMeter - ISNULL(TRY_CAST(A.code_table_length AS decimal(18,4)), 0)), 1) AS ActualDiff');
|
||||||
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.Meter AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_length AS decimal(18,4)), 0), 2) AS MeterWithAddLength');
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.Meter AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_length AS decimal(18,4)), 0), 2) AS MeterWithAddLength');
|
||||||
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS GrossWeightWithAdd');
|
||||||
|
sql.Add(' ,ROUND(ISNULL(TRY_CAST(A.NetWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0), 2) AS NetWeightWithAdd');
|
||||||
sql.Add('from Tat_Cloth_Inspect A ');
|
sql.Add('from Tat_Cloth_Inspect A ');
|
||||||
sql.Add('outer apply (select ROUND(ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM');
|
sql.Add('outer apply (select ROUND(ISNULL((ISNULL(TRY_CAST(A.GrossWeight AS decimal(18,4)), 0) + ISNULL(TRY_CAST(A.add_weight AS decimal(18,4)), 0)) / NULLIF(TRY_CAST(A.C_GramWeight AS decimal(18,4)), 0), 0), 1) as CalcMeterRaw) CM');
|
||||||
sql.Add('outer apply (select CASE WHEN CM.CalcMeterRaw <= 0 THEN CM.CalcMeterRaw');
|
sql.Add('outer apply (select CASE WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) <= 0 THEN CAST(CM.CalcMeterRaw AS decimal(18,1))');
|
||||||
sql.Add(' WHEN CM.CalcMeterRaw - FLOOR(CM.CalcMeterRaw) < 0.05 THEN FLOOR(CM.CalcMeterRaw)');
|
sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) < 0.05 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1)))');
|
||||||
sql.Add(' WHEN CM.CalcMeterRaw - FLOOR(CM.CalcMeterRaw) <= 0.5 THEN FLOOR(CM.CalcMeterRaw) + 0.5');
|
sql.Add(' WHEN CAST(CM.CalcMeterRaw AS decimal(18,1)) - FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) <= 0.5 THEN FLOOR(CAST(CM.CalcMeterRaw AS decimal(18,1))) + 0.5');
|
||||||
sql.Add(' ELSE CEILING(CM.CalcMeterRaw) END as CalcMeter) CM2');
|
sql.Add(' ELSE CEILING(CAST(CM.CalcMeterRaw AS decimal(18,1))) END as CalcMeter) CM2');
|
||||||
sql.Add('where convert(varchar(10),filltime,120)=convert(varchar(10),getdate(),120)');
|
sql.Add('where convert(varchar(10),filltime,120)=convert(varchar(10),getdate(),120)');
|
||||||
sql.Add('and filler=' + quotedstr(dname));
|
sql.Add('and filler=' + quotedstr(dname));
|
||||||
sql.Add('and mainid=''ÎÞ¶©µ¥''');
|
sql.Add('and mainid=''ÎÞ¶©µ¥''');
|
||||||
sql.Add('order by filltime desc');
|
sql.Add('order by filltime desc');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// showmessage(sql.text);
|
||||||
Open;
|
Open;
|
||||||
end;
|
end;
|
||||||
SCreateCDS(ADOQueryMain, CDS_3);
|
SCreateCDS(ADOQueryMain, CDS_3);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user