1086 lines
30 KiB
ObjectPascal
1086 lines
30 KiB
ObjectPascal
|
|
unit U_ClothGongYi;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|||
|
|
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
|||
|
|
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
|
|||
|
|
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
|
|||
|
|
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxDropDownEdit,
|
|||
|
|
StrUtils, cxPC, ShellAPI, cxCalendar, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, dxBarBuiltInMenu, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmClothGongYi = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
CDS_YuanLiao: TClientDataSet;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
cxPageControl1: TcxPageControl;
|
|||
|
|
cxTabSheet1: TcxTabSheet;
|
|||
|
|
cxTabSheet2: TcxTabSheet;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
v2Column2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
v2Column4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
cxTabSheet4: TcxTabSheet;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
v3Column1: TcxGridDBColumn;
|
|||
|
|
v3Column2: TcxGridDBColumn;
|
|||
|
|
v3Column3: TcxGridDBColumn;
|
|||
|
|
v3Column4: TcxGridDBColumn;
|
|||
|
|
v3Column5: TcxGridDBColumn;
|
|||
|
|
v3Column6: TcxGridDBColumn;
|
|||
|
|
v3Column7: TcxGridDBColumn;
|
|||
|
|
v3Column8: TcxGridDBColumn;
|
|||
|
|
v3Column9: TcxGridDBColumn;
|
|||
|
|
v3Column10: TcxGridDBColumn;
|
|||
|
|
v3Column11: TcxGridDBColumn;
|
|||
|
|
v3Column12: TcxGridDBColumn;
|
|||
|
|
v3Column13: TcxGridDBColumn;
|
|||
|
|
v3Column14: TcxGridDBColumn;
|
|||
|
|
v3Column15: TcxGridDBColumn;
|
|||
|
|
v3Column16: TcxGridDBColumn;
|
|||
|
|
v3Column17: TcxGridDBColumn;
|
|||
|
|
v3Column18: TcxGridDBColumn;
|
|||
|
|
v3Column19: TcxGridDBColumn;
|
|||
|
|
v3Column20: TcxGridDBColumn;
|
|||
|
|
v3Column21: TcxGridDBColumn;
|
|||
|
|
v3Column22: TcxGridDBColumn;
|
|||
|
|
v3Column23: TcxGridDBColumn;
|
|||
|
|
v3Column24: TcxGridDBColumn;
|
|||
|
|
cxGrid5: TcxGrid;
|
|||
|
|
Tv5: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn8: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn13: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn14: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn15: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn16: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn17: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn18: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn19: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn20: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn21: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn22: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn23: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn24: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn25: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn26: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn27: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn28: TcxGridDBColumn;
|
|||
|
|
cxGridLevel3: TcxGridLevel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
cxGrid6: TcxGrid;
|
|||
|
|
Tv6: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn41: TcxGridDBColumn;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn42: TcxGridDBColumn;
|
|||
|
|
cxGridLevel4: TcxGridLevel;
|
|||
|
|
ClientDataSet6: TClientDataSet;
|
|||
|
|
DataSource6: TDataSource;
|
|||
|
|
ClientDataSet5: TClientDataSet;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ClientDataSet3: TClientDataSet;
|
|||
|
|
DataSource5: TDataSource;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
v2Column3: TcxGridDBColumn;
|
|||
|
|
v2Column5: TcxGridDBColumn;
|
|||
|
|
v2Column6: TcxGridDBColumn;
|
|||
|
|
v2Column7: TcxGridDBColumn;
|
|||
|
|
v2Column8: TcxGridDBColumn;
|
|||
|
|
v2Column9: TcxGridDBColumn;
|
|||
|
|
v2Column10: TcxGridDBColumn;
|
|||
|
|
v2Column11: TcxGridDBColumn;
|
|||
|
|
ClientDataSet7: TClientDataSet;
|
|||
|
|
DataSource7: TDataSource;
|
|||
|
|
v3Column25: TcxGridDBColumn;
|
|||
|
|
v3Column26: TcxGridDBColumn;
|
|||
|
|
v3Column27: TcxGridDBColumn;
|
|||
|
|
v3Column28: TcxGridDBColumn;
|
|||
|
|
v3Column29: TcxGridDBColumn;
|
|||
|
|
v3Column30: TcxGridDBColumn;
|
|||
|
|
v3Column31: TcxGridDBColumn;
|
|||
|
|
v3Column32: TcxGridDBColumn;
|
|||
|
|
v3Column33: TcxGridDBColumn;
|
|||
|
|
v3Column34: TcxGridDBColumn;
|
|||
|
|
v3Column35: TcxGridDBColumn;
|
|||
|
|
v3Column36: TcxGridDBColumn;
|
|||
|
|
v5Column1: TcxGridDBColumn;
|
|||
|
|
v5Column2: TcxGridDBColumn;
|
|||
|
|
v5Column3: TcxGridDBColumn;
|
|||
|
|
v5Column4: TcxGridDBColumn;
|
|||
|
|
v5Column5: TcxGridDBColumn;
|
|||
|
|
v5Column6: TcxGridDBColumn;
|
|||
|
|
v5Column7: TcxGridDBColumn;
|
|||
|
|
v5Column8: TcxGridDBColumn;
|
|||
|
|
v5Column9: TcxGridDBColumn;
|
|||
|
|
v5Column10: TcxGridDBColumn;
|
|||
|
|
v5Column11: TcxGridDBColumn;
|
|||
|
|
v5Column12: TcxGridDBColumn;
|
|||
|
|
v3Column37: TcxGridDBColumn;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
Label42: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
CarType: TcxButtonEdit;
|
|||
|
|
C_Note: TRichEdit;
|
|||
|
|
LabName: TComboBox;
|
|||
|
|
C_Spec: TRichEdit;
|
|||
|
|
KZ: TEdit;
|
|||
|
|
MF: TEdit;
|
|||
|
|
C_CodeName: TcxButtonEdit;
|
|||
|
|
C_Code: TEdit;
|
|||
|
|
C_Color: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
SJNote: TRichEdit;
|
|||
|
|
ISKF: TCheckBox;
|
|||
|
|
ISYT: TCheckBox;
|
|||
|
|
ISCZ: TCheckBox;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
GongYiCode: TEdit;
|
|||
|
|
ToolBar3: TToolBar;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
JTZB: TcxButtonEdit;
|
|||
|
|
ZhenCun: TEdit;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Price: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
PBFactoryNoName: TcxButtonEdit;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure PiQtyChange(Sender: TObject);
|
|||
|
|
procedure Tv6DblClick(Sender: TObject);
|
|||
|
|
procedure Tv3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure Tv5MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column11PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure SJCarNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure C_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure ISCZClick(Sender: TObject);
|
|||
|
|
procedure ISKFClick(Sender: TObject);
|
|||
|
|
procedure cxButtonEdit1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure CarTypePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure PBFactoryNoNameClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
FXS, Fint: Integer;
|
|||
|
|
procedure InitData();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
PState, FCopyInt: Integer;
|
|||
|
|
FMainId, FConNo, PType, FSubId: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmClothGongYi: TfrmClothGongYi;
|
|||
|
|
newh: hwnd;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_ZDYHelp, U_RTFun, U_CompressionFun, U_ZdyAttachGYS,
|
|||
|
|
U_ShaKCSelList, U_SCPerson, U_ContractListNXSel, U_FjList_RZ, U_JTAllSel,
|
|||
|
|
U_CPManageFMSel, U_ZdyAttachment, U_MachineTypeSel, U_YCLViewSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
function TfrmClothGongYi.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno, maxsubno, maxpbno, maxpzno, maxsjno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd, maxno, 'CM', 'Cloth_Main', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(FMainId);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from Cloth_Main where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('status').Value := -1;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
RTSetsavedata(ADOCmd, 'Cloth_Main', ScrollBox1, 0);
|
|||
|
|
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
//FMainId:=Trim(maxno);
|
|||
|
|
|
|||
|
|
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|||
|
|
if Trim(FSubId) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, maxsubno, '9', 'Cloth_Sub', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxsubno := Trim(FSubId);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from Cloth_Sub where ');
|
|||
|
|
sql.Add(' SubId=''' + Trim(maxsubno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FSubId) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('IsGongYi').Value := 1;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxsubno);
|
|||
|
|
RTSetsavedata(ADOCmd, 'Cloth_Sub', ScrollBox1, 2);
|
|||
|
|
FieldByName('IsGongYi').Value := 1;
|
|||
|
|
|
|||
|
|
FieldByName('ISYT').Value := ISYT.Checked;
|
|||
|
|
FieldByName('ISKF').Value := ISKF.Checked;
|
|||
|
|
FieldByName('ISCZ').Value := ISCZ.Checked;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>
|
|||
|
|
with CDS_YuanLiao do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_YuanLiao.fieldbyname('PBId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, maxpbno, 'PB', 'Cloth_YCL_PB', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxpbno := Trim(CDS_YuanLiao.fieldbyname('PBId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from Cloth_YCL_PB where ');
|
|||
|
|
sql.Add(' PBId=''' + Trim(maxpbno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_YuanLiao.fieldbyname('PBId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxsubno);
|
|||
|
|
FieldByName('PBId').Value := Trim(maxpbno);
|
|||
|
|
FieldByName('SPId').Value := Trim(CDS_YuanLiao.fieldbyname('SPId').AsString);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv2, CDS_YuanLiao, 'Cloth_YCL_PB', 0);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
CDS_YuanLiao.Edit;
|
|||
|
|
CDS_YuanLiao.FieldByName('SubId').Value := Trim(maxsubno);
|
|||
|
|
CDS_YuanLiao.FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
CDS_YuanLiao.FieldByName('PBId').Value := Trim(maxpbno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȱ<EFBFBD>
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
ClientDataSet3.DisableControls;
|
|||
|
|
with ClientDataSet3 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(ClientDataSet3.fieldbyname('PZId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd, maxpzno, 'PZ', 'Cloth_PaiZhen', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxpzno := Trim(ClientDataSet3.fieldbyname('PZId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from Cloth_PaiZhen where ');
|
|||
|
|
sql.Add(' PZId=''' + Trim(maxpzno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(ClientDataSet3.fieldbyname('PZId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxsubno);
|
|||
|
|
FieldByName('PZId').Value := Trim(maxpzno);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv3, ClientDataSet3, 'Cloth_PaiZhen', 0);
|
|||
|
|
FieldByName('PZType').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('PZName').Value := ClientDataSet3.fieldbyname('PZName').AsString;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet3.Edit;
|
|||
|
|
ClientDataSet3.FieldByName('PZId').Value := Trim(maxpzno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet3.EnableControls;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>
|
|||
|
|
ClientDataSet5.DisableControls;
|
|||
|
|
with ClientDataSet5 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(ClientDataSet5.fieldbyname('PZId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd, maxsjno, 'PZ', 'Cloth_PaiZhen', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxsjno := Trim(ClientDataSet5.fieldbyname('PZId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from Cloth_PaiZhen where ');
|
|||
|
|
sql.Add(' PZId=''' + Trim(maxsjno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(ClientDataSet5.fieldbyname('PZId').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxsubno);
|
|||
|
|
FieldByName('PZId').Value := Trim(maxsjno);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv5, ClientDataSet5, 'Cloth_PaiZhen', 0);
|
|||
|
|
FieldByName('PZType').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet5.Edit;
|
|||
|
|
ClientDataSet5.FieldByName('PZId').Value := Trim(maxsjno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet5.EnableControls;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DZ<EFBFBD>
|
|||
|
|
///<2F><><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
ClientDataSet6.DisableControls;
|
|||
|
|
with ClientDataSet6 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update TP_File Set WBID=''' + Trim(maxno) + '''');
|
|||
|
|
sql.Add(' where TFID=''' + Trim(ClientDataSet6.fieldbyname('TFID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet6.EnableControls;
|
|||
|
|
///<2F><><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FMainId := Trim(maxno);
|
|||
|
|
FSubId := Trim(maxsubno);
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
ClientDataSet3.EnableControls;
|
|||
|
|
ClientDataSet5.EnableControls;
|
|||
|
|
ClientDataSet6.EnableControls;
|
|||
|
|
CDS_YuanLiao.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.InitData();
|
|||
|
|
var
|
|||
|
|
PBNO, PBFlag: string;
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from Cloth_Main OM Left join Cloth_Sub OS on OM.MainId=OS.MainId ');
|
|||
|
|
sql.Add(' where OM.MainId= ' + quotedstr(Trim(FMainId)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHData(ADOQuery1, ScrollBox1, 0);
|
|||
|
|
SCSHData(ADOQuery1, ScrollBox1, 2);
|
|||
|
|
ISYT.Checked := ADOQuery1.FieldByName('ISYT').AsBoolean;
|
|||
|
|
ISKF.Checked := ADOQuery1.FieldByName('ISKF').AsBoolean;
|
|||
|
|
ISCZ.Checked := ADOQuery1.FieldByName('ISCZ').AsBoolean;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.* ');
|
|||
|
|
sql.Add('from Cloth_YCL_PB A ');
|
|||
|
|
sql.Add('inner join Cloth_Sub B on A.SubId=B.SubId');
|
|||
|
|
SQL.Add(' inner join Cloth_Main C on B.Mainid=C.MainId');
|
|||
|
|
sql.Add(' where A.MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
SCreateCDS20(ADOTemp, CDS_YuanLiao);
|
|||
|
|
SInitCDSData20(ADOTemp, CDS_YuanLiao);
|
|||
|
|
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Cloth_PaiZhen where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and PZType=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
SCreateCDS20(ADOTemp, ClientDataSet3);
|
|||
|
|
SInitCDSData20(ADOTemp, ClientDataSet3);
|
|||
|
|
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Cloth_PaiZhen where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and PZType=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
SCreateCDS20(ADOTemp, ClientDataSet5);
|
|||
|
|
SInitCDSData20(ADOTemp, ClientDataSet5);
|
|||
|
|
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFID,FileName,TFdate,Filler,FillTime from TP_File ');
|
|||
|
|
sql.Add('where WBID=' + quotedstr(FMainId));
|
|||
|
|
sql.Add('and TFType=''PB<50><42><EFBFBD><EFBFBD>'' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp, ClientDataSet6);
|
|||
|
|
SInitCDSData20(ADOTemp, ClientDataSet6);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'SXYCLName';
|
|||
|
|
flagname := 'ԭ<><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_YuanLiao.Edit;
|
|||
|
|
Self.CDS_YuanLiao.FieldByName('YCLName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.v2Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'PinPai';
|
|||
|
|
flagname := 'Ʒ<><C6B7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_YuanLiao.Edit;
|
|||
|
|
Self.CDS_YuanLiao.FieldByName('PinPai').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.PiQtyChange(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FQty1, FQty2: string;
|
|||
|
|
begin
|
|||
|
|
{FQty1:=Qty1.Text;
|
|||
|
|
if Trim(FQty1)='' then
|
|||
|
|
begin
|
|||
|
|
FQty1:='0';
|
|||
|
|
end;
|
|||
|
|
FQty2:=Qty2.Text;
|
|||
|
|
if Trim(FQty2)='' then
|
|||
|
|
begin
|
|||
|
|
FQty2:='0';
|
|||
|
|
end;
|
|||
|
|
C_Qty.Text:=FloatToStr(StrToFloat(FQty1)*StrToFloat(FQty2)); }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.Tv6DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sFieldName: string;
|
|||
|
|
fileName: string;
|
|||
|
|
ff: TADOBlobStream;
|
|||
|
|
FJStream: TMemoryStream;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet6.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
Panel4.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel4.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File where TFID=''' + Trim(ClientDataSet6.fieldbyname('TFID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
sFieldName := 'D:\ͼƬ<CDBC>鿴';
|
|||
|
|
if not DirectoryExists(pchar(sFieldName)) then
|
|||
|
|
CreateDirectory(pchar(sFieldName), nil);
|
|||
|
|
fileName := ClientDataSet6.fieldbyname('FileName').AsString;
|
|||
|
|
sFieldName := sFieldName + '\' + trim(fileName);
|
|||
|
|
try
|
|||
|
|
ff := TADOBlobstream.Create(ADOQueryTemp.fieldByName('FilesOther') as TblobField, bmRead);
|
|||
|
|
FJStream := TMemoryStream.Create;
|
|||
|
|
ff.SaveToStream(FJStream);
|
|||
|
|
UnCompressionStream(FJStream);
|
|||
|
|
FJStream.SaveToFile(sFieldName);
|
|||
|
|
Panel4.Visible := False;
|
|||
|
|
ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL);
|
|||
|
|
finally
|
|||
|
|
Panel4.Visible := False;
|
|||
|
|
FJStream.free;
|
|||
|
|
ff.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.Tv3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
Fint := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.Tv5MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
Fint := 2;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
FactType.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.ClientDataSet7 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('WFGYSName').Value := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
|||
|
|
FieldByName('WFGYSNo').Value := Trim(CDS_HZ.fieldbyname('CoCode').AsString);
|
|||
|
|
FieldByName('WFGYSNameJC').Value := Trim(CDS_HZ.fieldbyname('CoHRName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.v2Column11PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_YuanLiao do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('GYSName').Value := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.SJCarNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
var
|
|||
|
|
FSJCarNO: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmJTAllSel := TfrmJTAllSel.Create(Application);
|
|||
|
|
with frmJTAllSel do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with frmJTAllSel.ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
while frmJTAllSel.ClientDataSet1.Locate('SSel', true, []) do
|
|||
|
|
begin
|
|||
|
|
if trim(FSJCarNO) = '' then
|
|||
|
|
FSJCarNO := trim(ClientDataSet1.fieldbyname('MCNO').AsString)
|
|||
|
|
else
|
|||
|
|
FSJCarNO := FSJCarNO + ',' + trim(ClientDataSet1.fieldbyname('MCNO').AsString);
|
|||
|
|
|
|||
|
|
frmJTAllSel.ClientDataSet1.delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmJTAllSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.C_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmYCLViewSel := TfrmYCLViewSel.Create(Application);
|
|||
|
|
with frmYCLViewSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
C_Code.Text := frmYCLViewSel.CDS_HZ.fieldbyname('SPCode').asstring;
|
|||
|
|
C_CodeName.Text := frmYCLViewSel.CDS_HZ.fieldbyname('SPName').asstring;
|
|||
|
|
// MPRTSpec.Text := frmYCLViewSel.CDS_HZ.fieldbyname('SPSpec').asstring;
|
|||
|
|
// MPRTCF.Text := frmYCLViewSel.CDS_HZ.fieldbyname('CYCF').asstring;
|
|||
|
|
// MPRTMF.Text := frmYCLViewSel.CDS_HZ.fieldbyname('SPMF').asstring;
|
|||
|
|
// MPRTKZ.Text := frmYCLViewSel.CDS_HZ.fieldbyname('SPKZ').asstring;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmYCLViewSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.ISCZClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ISCZ.Checked then
|
|||
|
|
ISKF.Checked := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.ISKFClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ISKF.Checked then
|
|||
|
|
ISCZ.Checked := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.cxButtonEdit1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
var
|
|||
|
|
fsj: string;
|
|||
|
|
FWZ: Integer;
|
|||
|
|
begin
|
|||
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|||
|
|
FWZ := Pos('/', fsj);
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|||
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|||
|
|
V1Name.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
ZhenCun.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.CarTypePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmMachineTypeSel := TfrmMachineTypeSel.Create(Application);
|
|||
|
|
with frmMachineTypeSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
CarType.Text := Trim(CDS_HZ.fieldbyname('MCZX').AsString) + Trim(CDS_HZ.fieldbyname('MCLS').AsString) + Trim(CDS_HZ.fieldbyname('MCType').AsString);
|
|||
|
|
JTZB.Text := Trim(CDS_HZ.fieldbyname('MCClass').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmMachineTypeSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.TBSaveClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.ToolButton3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
OpenDiaLog: TOpenDialog;
|
|||
|
|
fFileName: string;
|
|||
|
|
fFilePath: string;
|
|||
|
|
maxNo: string;
|
|||
|
|
FJStream: TMemoryStream;
|
|||
|
|
mfileSize: integer;
|
|||
|
|
mCreationTime: TdateTime;
|
|||
|
|
mWriteTime: TdateTime;
|
|||
|
|
begin
|
|||
|
|
//if cxPageControl1.ActivePageIndex=0 then Exit;
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
with CDS_YuanLiao do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('PBQty').Value := 0;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if cxPageControl1.ActivePageIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
if Fint = 1 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet3 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Fint = 2 then
|
|||
|
|
with ClientDataSet5 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if cxPageControl1.ActivePageIndex = 2 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
OpenDiaLog := TOpenDialog.Create(Self);
|
|||
|
|
if OpenDiaLog.Execute then
|
|||
|
|
begin
|
|||
|
|
fFilePath := OpenDiaLog.FileName;
|
|||
|
|
fFileName := ExtractFileName(OpenDiaLog.FileName);
|
|||
|
|
Panel4.Caption := '<27><><EFBFBD>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel4.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxNo, 'FJ', 'TP_File', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
//<2F><>ȡ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>Ϣ
|
|||
|
|
GetFileInfo(fFilePath, mfileSize, mCreationTime, mWriteTime);
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where TFID=' + quotedstr(trim(maxNo)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
FJStream := TMemoryStream.Create;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File ');
|
|||
|
|
sql.Add('where TFID=' + quotedstr(trim(maxNo)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value := trim(maxNo);
|
|||
|
|
fieldbyname('TFType').Value := 'PB<50><42><EFBFBD><EFBFBD>';
|
|||
|
|
fieldbyname('Filler').Value := trim(DName);
|
|||
|
|
fieldbyname('FileName').Value := trim(fFileName);
|
|||
|
|
fieldbyname('TFDate').Value := mWriteTime;
|
|||
|
|
FJStream.LoadFromFile(fFilePath);
|
|||
|
|
CompressionStream(FJStream);
|
|||
|
|
tblobfield(FieldByName('Filesother')).LoadFromStream(FJStream);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet6 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('TFID').Value := Trim(maxNo);
|
|||
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
FieldByName('TFdate').Value := mWriteTime;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
fieldbyname('FileName').Value := trim(fFileName);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
FJStream.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
adoqueryCmd.Connection.CommitTrans;
|
|||
|
|
Panel4.Visible := False;
|
|||
|
|
except
|
|||
|
|
Panel4.Visible := False;
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if cxPageControl1.ActivePageIndex = 3 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet7 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.ToolButton4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if CDS_YuanLiao.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(CDS_YuanLiao.fieldbyname('PBId').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete Cloth_YCL_PB where PBId=''' + Trim(CDS_YuanLiao.fieldbyname('PBId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_YuanLiao.Delete;
|
|||
|
|
end
|
|||
|
|
else if cxPageControl1.ActivePageIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
if Fint = 1 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet3.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete Cloth_PaiZhen where PZID=''' + Trim(ClientDataSet3.fieldbyname('PZID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet3.Delete;
|
|||
|
|
end
|
|||
|
|
else if Fint = 2 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet5.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete Cloth_PaiZhen where PZID=''' + Trim(ClientDataSet5.fieldbyname('PZID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet5.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else if cxPageControl1.ActivePageIndex = 2 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet6.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete TP_File where TFID=''' + Trim(ClientDataSet6.fieldbyname('TFID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet6.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmClothGongYi.PBFactoryNoNameClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
PBFactoryNoName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|