增加页面

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-11-21 09:37:23 +08:00
parent 0ba0b75c88
commit e11c0d4666
5 changed files with 931 additions and 770 deletions

View File

@ -1,6 +1,6 @@
object frmClothContractList: TfrmClothContractList
Left = 109
Top = 139
Left = 348
Top = 303
Width = 1171
Height = 571
Caption = #22383#24067#37319#36141#21512#21516
@ -78,16 +78,32 @@ object frmClothContractList: TfrmClothContractList
ImageIndex = 17
OnClick = TBDelClick
end
object Tchk: TToolButton
object TReview: TToolButton
Left = 315
Top = 0
AutoSize = True
Caption = #23457#26680
ImageIndex = 41
OnClick = TReviewClick
end
object TnoReview: TToolButton
Left = 378
Top = 0
AutoSize = True
Caption = #25764#38144#23457#26680
ImageIndex = 129
OnClick = TnoReviewClick
end
object Tchk: TToolButton
Left = 465
Top = 0
AutoSize = True
Caption = #23436#25104
ImageIndex = 41
OnClick = TchkClick
end
object TNochk: TToolButton
Left = 378
Left = 528
Top = 0
AutoSize = True
Caption = #25764#38144#23436#25104
@ -95,7 +111,7 @@ object frmClothContractList: TfrmClothContractList
OnClick = TNochkClick
end
object TBExport: TToolButton
Left = 465
Left = 615
Top = 0
AutoSize = True
Caption = #23548#20986
@ -103,7 +119,7 @@ object frmClothContractList: TfrmClothContractList
OnClick = TBExportClick
end
object TBPrint: TToolButton
Left = 528
Left = 678
Top = 0
AutoSize = True
Caption = #25171#21360
@ -111,7 +127,7 @@ object frmClothContractList: TfrmClothContractList
OnClick = TBPrintClick
end
object ToolButton1: TToolButton
Left = 591
Left = 741
Top = 0
AutoSize = True
Caption = #37319#36141#38468#20214
@ -119,7 +135,7 @@ object frmClothContractList: TfrmClothContractList
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 678
Left = 828
Top = 0
AutoSize = True
Caption = #20851#38381
@ -307,7 +323,7 @@ object frmClothContractList: TfrmClothContractList
TabOrder = 0
object Tv1: TcxGridDBTableView
OnMouseDown = Tv1MouseDown
NavigatorButtons.ConfirmDelete = False
Navigator.Buttons.CustomButtons = <>
OnCellClick = Tv1CellClick
OnCellDblClick = Tv1CellDblClick
OnCustomDrawCell = Tv1CustomDrawCell
@ -415,14 +431,14 @@ object frmClothContractList: TfrmClothContractList
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
Style = 9
TabIndex = 0
TabOrder = 3
Tabs.Strings = (
#26410#23436#25104
#23436#25104
Properties.CustomButtons.Buttons = <>
Properties.Style = 9
Properties.TabIndex = 0
Properties.Tabs.Strings = (
#26410#23457#26680
#24050#23457#26680
#20840#37096)
Visible = False
OnChange = cxTabControl1Change
ClientRectBottom = 22
ClientRectRight = 1155
@ -430,13 +446,13 @@ object frmClothContractList: TfrmClothContractList
end
object cxGrid2: TcxGrid
Left = 0
Top = 356
Top = 355
Width = 1155
Height = 177
Align = alBottom
TabOrder = 4
object TV2: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DSsub
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <
@ -585,7 +601,7 @@ object frmClothContractList: TfrmClothContractList
DataBinding.FieldName = 'Sdefstr5'
Visible = False
HeaderAlignmentHorz = taCenter
Hidden = True
VisibleForCustomization = False
Width = 80
end
object v1Column14: TcxGridDBColumn
@ -608,7 +624,7 @@ object frmClothContractList: TfrmClothContractList
end
object cxSplitter1: TcxSplitter
Left = 0
Top = 348
Top = 347
Width = 1155
Height = 8
HotZoneClassName = 'TcxMediaPlayer9Style'

View File

@ -6,11 +6,24 @@ uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter,
RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport,
cxTextEdit, cxPC, cxDropDownEdit;
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class,
RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC,
cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, dxBarBuiltInMenu;
type
TfrmClothContractList = class(TForm)
@ -100,6 +113,8 @@ type
Image2: TImage;
Button1: TButton;
RadioGroup1: TRadioGroup;
TReview: TToolButton;
TnoReview: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -113,38 +128,26 @@ type
procedure TBAddClick(Sender: TObject);
procedure ConNoChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
ANewItemRecordFocusingChanged: Boolean);
procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Tv3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Tv2CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Tv3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Tv2CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure ToolButton5Click(Sender: TObject);
procedure v2Column3PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure conPress(Sender: TObject; var Key: Char);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure TchkClick(Sender: TObject);
procedure TNochkClick(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure ToolButton1Click(Sender: TObject);
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure Image2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure SQNOKeyPress(Sender: TObject; var Key: Char);
procedure TReviewClick(Sender: TObject);
procedure TnoReviewClick(Sender: TObject);
private
FInt, PFInt: Integer;
procedure InitGrid();
@ -162,6 +165,7 @@ var
frmClothContractList: TfrmClothContractList;
implementation
uses
U_DataLink, U_ClothContractInPutPB, U_Fun, U_ProductOrderList, U_ZDYHelp,
U_FjList_RZ;
@ -170,7 +174,8 @@ uses
procedure TfrmClothContractList.InitSub();
begin
ADOQuerySub.Close;
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
with ADOQuerySub do
begin
close;
@ -186,33 +191,52 @@ begin
TBAdd.Visible := false;
tchk.Visible := false;
tnochk.Visible := false;
TReview.Visible := false;
tnoReview.Visible := false;
tbedit.Visible := false;
tbdel.Visible := false;
IF FType=''then
if FType = '' then
begin
if Trim(DParameters1) = '高权限' then
begin
case cxTabControl1.TabIndex of
0:begin
// tchk.Visible:=true;
0:
begin
TReview.Visible := true;
tbedit.Visible := true;
tbdel.Visible := true;
TBAdd.Visible := true;
end;
1:begin
// tnochk.Visible:=true;
1:
begin
tnoReview.Visible := true;
end;
2:begin
end;
end
else
begin
case cxTabControl1.TabIndex of
0:
begin
tbedit.Visible := true;
tbdel.Visible := true;
TBAdd.Visible := true;
end;
1:
begin
end;
end;
end;
IF FType='查询' then
end;
if FType = '查询' then
begin
Tbadd.Visible := false;
TBPrint.Visible := false;
//v1Price.Visible:=false;
// v1PriceUnit.Visible:=false;
// v1Money.Visible:=false;
// v1Price.Hidden:=true;
// v1PriceUnit.Hidden:=true;
// v1Money.Hidden:=true;
@ -226,8 +250,7 @@ begin
frmClothContractList := nil;
end;
procedure TfrmClothContractList.FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TfrmClothContractList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
@ -245,15 +268,18 @@ begin
end;
procedure TfrmClothContractList.InitGrid();
var strwhere: string;
var
strwhere: string;
begin
strwhere:=' where QDTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and QDTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+''''
+' and HTType=''采购合同''';
IF cxTabControl1.TabIndex=0 then
strwhere:=strwhere+' and isnull(C_status,''0'')=''0'' ';
IF cxTabControl1.TabIndex=1 then
strwhere:=strwhere+' and isnull(C_status,''0'')=''1'' ';
strwhere := ' where QDTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and QDTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''' + ' and HTType=''采购合同''';
// if cxTabControl1.TabIndex = 0 then
// strwhere := strwhere + ' and isnull(C_status,''0'')=''0'' ';
// if cxTabControl1.TabIndex = 1 then
// strwhere := strwhere + ' and isnull(C_status,''0'')=''1'' ';
// if cxTabControl1.TabIndex < 2 then
// begin
// strwhere := strwhere + ' and isnull(A.ChkStatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + '''';
// end;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
@ -266,10 +292,10 @@ begin
sql.Add(' where QDTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' ');
sql.Add(' and QDTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + ''' ');
sql.Add(' and HTType=''采购合同'' ');
// IF cxTabControl1.TabIndex=0 then
// sql.Add(' and isnull(C_status,''0'')=''0'' ');
// IF cxTabControl1.TabIndex=1 then
// sql.Add(' and isnull(C_status,''0'')=''1'' ');
if cxTabControl1.TabIndex = 0 then
sql.Add(' and isnull(A.ChkStatus,''0'')=''0'' ');
if cxTabControl1.TabIndex = 1 then
sql.Add(' and isnull(A.ChkStatus,''0'')=''1'' ');
Open;
end;
SCreateCDS20(ADOQueryMain, Order_Main);
@ -288,7 +314,8 @@ begin
if Trim(DParameters1) = '1' then
begin
TBPrint.Visible := False;
end else
end
else
begin
// v1Column1.Visible:=True;
// v1Column1.Hidden:=False;
@ -305,7 +332,8 @@ end;
procedure TfrmClothContractList.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
@ -313,7 +341,8 @@ end;
procedure TfrmClothContractList.TBEditClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmClothContractInPutPB := TfrmClothContractInPutPB.Create(Application);
with frmClothContractInPutPB do
@ -333,13 +362,15 @@ end;
procedure TfrmClothContractList.TBDelClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
if ClientDataSet2.IsEmpty = false then
begin
Application.MessageBox('已到坯,不能删除坯布合同!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
if DelData() then
begin
//TBRafresh.Click;
@ -374,16 +405,17 @@ end;
procedure TfrmClothContractList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then Exit;
if ADOQueryMain.IsEmpty then
Exit;
TcxGridToExcel('坯布合同订单列表', cxGrid1);
end;
procedure TfrmClothContractList.TBPrintClick(Sender: TObject);
var
fPrintFile, FConNoM: string;
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
Panel4.Left := (self.Width - Panel4.Width) div 2;
Panel4.Visible := true;
@ -443,7 +475,8 @@ end;
procedure TfrmClothContractList.ConNoChange(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
@ -455,10 +488,7 @@ begin
SetStatus();
end;
procedure TfrmClothContractList.Tv1FocusedRecordChanged(
Sender: TcxCustomGridTableView; APrevFocusedRecord,
AFocusedRecord: TcxCustomGridRecord;
ANewItemRecordFocusingChanged: Boolean);
procedure TfrmClothContractList.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
begin
{ with ADOQueryTemp do
begin
@ -487,28 +517,22 @@ begin
SInitCDSData20(ADOQueryTemp,ClientDataSet3); }
end;
procedure TfrmClothContractList.Tv2MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure TfrmClothContractList.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FInt := 2;
end;
procedure TfrmClothContractList.Tv1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure TfrmClothContractList.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FInt := 1;
end;
procedure TfrmClothContractList.Tv3MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure TfrmClothContractList.Tv3MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FInt := 3;
end;
procedure TfrmClothContractList.Tv2CellClick(
Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure TfrmClothContractList.Tv2CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
with ADOQueryTemp do
begin
@ -532,8 +556,7 @@ begin
end;
procedure TfrmClothContractList.v2Column3PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
procedure TfrmClothContractList.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZDYHelp := TfrmZDYHelp.Create(Application);
@ -555,8 +578,7 @@ begin
end;
end;
procedure TfrmClothContractList.conPress(Sender: TObject;
var Key: Char);
procedure TfrmClothContractList.conPress(Sender: TObject; var Key: Char);
begin
{if Key=#13 then
begin
@ -581,13 +603,11 @@ begin
end; }
end;
procedure TfrmClothContractList.Tv1CellDblClick(
Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure TfrmClothContractList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
If Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmClothContractInPutPB := TfrmClothContractInPutPB.Create(Application);
with frmClothContractInPutPB do
@ -610,7 +630,8 @@ end;
procedure TfrmClothContractList.TchkClick(Sender: TObject);
begin
if Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
@ -629,7 +650,8 @@ end;
procedure TfrmClothContractList.TNochkClick(Sender: TObject);
begin
if Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
@ -652,9 +674,7 @@ begin
TBRafresh.Click;
end;
procedure TfrmClothContractList.Tv1CustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure TfrmClothContractList.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
{ if cxTabControl1.TabIndex=0 then
begin
@ -678,7 +698,8 @@ end;
procedure TfrmClothContractList.ToolButton1Click(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmFjList_RZ := TfrmFjList_RZ.Create(Application);
with frmFjList_RZ do
@ -697,10 +718,7 @@ begin
end;
end;
procedure TfrmClothContractList.Tv1CellClick(
Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure TfrmClothContractList.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
InitSub();
end;
@ -713,9 +731,9 @@ end;
procedure TfrmClothContractList.Button1Click(Sender: TObject);
var
fPrintFile, FConNoM: string;
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
// fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\坯布订购合同.rmf' ;
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]) + '.rmf';
with ADOQueryTemp do
@ -724,8 +742,7 @@ begin
Filtered := False;
sql.Clear;
sql.Add('exec ClothContract_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
Parameters.ParamByName('MainId').Value := Trim(Order_Main.fieldbyname('MainId').AsString);
Parameters.ParamByName('WSql').Value := '';
Open;
@ -737,20 +754,21 @@ begin
begin
RM1.LoadFromFile(fPrintFile);
RM1.ShowReport;
end else
end
else
begin
Application.MessageBox(PChar('没有找到' + trim(fPrintFile)), '提示', 0);
end;
end;
procedure TfrmClothContractList.SQNOKeyPress(Sender: TObject;
var Key: Char);
procedure TfrmClothContractList.SQNOKeyPress(Sender: TObject; var Key: Char);
begin
IF key=#13 then
if Key = #13 then
begin
IF trim(SQNo.Text)='' then exit;
if trim(SQNo.Text) = '' then
exit;
with ADOQueryMain do
begin
Filtered := False;
@ -767,4 +785,45 @@ begin
end;
end;
procedure TfrmClothContractList.TReviewClick(Sender: TObject);
begin
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update Contract_Main SET ChkStatus=''1'',chktime=getdate(),chker=' + quotedstr(trim(Dname)));
sql.Add('where MainId=' + quotedstr(trim(Order_Main.fieldbyname('MainId').AsString)));
execsql;
end;
application.MessageBox('坯布采购审核成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('坯布采购审核失败!', '提示信息', 0);
end;
end;
procedure TfrmClothContractList.TnoReviewClick(Sender: TObject);
begin
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update Contract_Main SET ChkStatus=''0'',chktime=null,chker='''' ');
sql.Add('where MainId=' + quotedstr(trim(Order_Main.fieldbyname('MainId').AsString)));
execsql;
end;
application.MessageBox('坯布采购撤销审核成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('坯布采购撤销审核失败!', '提示信息', 0);
end;
end;
end.

View File

@ -22,7 +22,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Width = 1366
AutoSize = True
ButtonHeight = 30
ButtonWidth = 59
ButtonWidth = 83
Caption = 'ToolBar1'
Color = clSkyBlue
Flat = True
@ -69,16 +69,34 @@ object frmClothContractListHZ: TfrmClothContractListHZ
ImageIndex = 54
OnClick = TBEditClick
end
object ToolButton1: TToolButton
object TCK: TToolButton
Left = 252
Top = 0
AutoSize = True
Caption = ' '#23457#26680' '
ImageIndex = 41
Visible = False
OnClick = TCKClick
end
object TnoCK: TToolButton
Left = 327
Top = 0
AutoSize = True
Caption = #25764#38144#23457#26680
ImageIndex = 129
Visible = False
OnClick = TnoCKClick
end
object ToolButton1: TToolButton
Left = 414
Top = 0
AutoSize = True
Caption = #22797#21046
ImageIndex = 58
OnClick = ToolButton1Click
end
object TBDel: TToolButton
Left = 315
Left = 477
Top = 0
AutoSize = True
Caption = #21024#38500
@ -86,7 +104,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
OnClick = TBDelClick
end
object TBExport: TToolButton
Left = 378
Left = 540
Top = 0
AutoSize = True
Caption = #23548#20986
@ -95,7 +113,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
OnClick = TBExportClick
end
object TBPrint: TToolButton
Left = 441
Left = 603
Top = 0
AutoSize = True
Caption = #25171#21360
@ -103,14 +121,15 @@ object frmClothContractListHZ: TfrmClothContractListHZ
OnClick = TBPrintClick
end
object ToolButton2: TToolButton
Left = 504
Left = 666
Top = 0
Caption = #38468#20214
AutoSize = True
Caption = ' '#38468#20214' '
ImageIndex = 57
OnClick = ToolButton2Click
end
object TBClose: TToolButton
Left = 563
Left = 741
Top = 0
AutoSize = True
Caption = #20851#38381
@ -933,9 +952,9 @@ object frmClothContractListHZ: TfrmClothContractListHZ
end
object cxGrid1: TcxGrid
Left = 0
Top = 86
Top = 109
Width = 1366
Height = 629
Height = 606
Align = alClient
TabOrder = 3
object Tv1: TcxGridDBTableView
@ -957,8 +976,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsData.Editing = False
OptionsSelection.CellSelect = False
OptionsData.Deleting = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.Inactive = DataLink_TradeManage.SHuangSe
@ -968,6 +986,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #32433#32447#36141#38144#21512#21516
DataBinding.FieldName = 'ConNo'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 84
end
@ -975,6 +994,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #20135#21697#21517#31216
DataBinding.FieldName = 'C_CodeName'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 108
end
@ -985,6 +1005,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Properties.SaveTime = False
Properties.ShowTime = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 82
end
@ -992,6 +1013,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #31614#35746#26085#26399
DataBinding.FieldName = 'QDTime'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 89
end
@ -999,6 +1021,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #20379#24212#21830
DataBinding.FieldName = 'FactoryNoName'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 134
end
@ -1006,6 +1029,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #35268#26684
DataBinding.FieldName = 'C_Spec'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 66
end
@ -1014,6 +1038,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
DataBinding.FieldName = 'Qty1'
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
VisibleForCustomization = False
Width = 46
@ -1022,6 +1047,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #25968#37327
DataBinding.FieldName = 'C_Qty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 58
end
@ -1029,6 +1055,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #21333#20301
DataBinding.FieldName = 'C_Unit'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 47
end
@ -1036,6 +1063,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #21333#20215
DataBinding.FieldName = 'Price'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 57
end
@ -1043,6 +1071,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #24065#31181
DataBinding.FieldName = 'PriceUnit'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 61
end
@ -1050,6 +1079,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #24635#20215
DataBinding.FieldName = 'Money'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 58
end
@ -1057,6 +1087,7 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #22791#27880
DataBinding.FieldName = 'C_Note'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Styles.Header = DataLink_TradeManage.Default
Width = 68
end
@ -1064,13 +1095,41 @@ object frmClothContractListHZ: TfrmClothContractListHZ
Caption = #21512#21516#21495
DataBinding.FieldName = 'XSconNo'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80
end
object Tv1Column1: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'Ssel'
PropertiesClassName = 'TcxCheckBoxProperties'
Properties.ImmediatePost = True
Properties.NullStyle = nssUnchecked
Width = 60
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
end
end
object cxTabControl1: TcxTabControl
Left = 0
Top = 86
Width = 1366
Height = 23
Align = alTop
TabOrder = 4
Properties.CustomButtons.Buttons = <>
Properties.Style = 9
Properties.TabIndex = 0
Properties.Tabs.Strings = (
#26410#23457#26680
#24050#23457#26680
#20840#37096)
OnChange = cxTabControl1Change
ClientRectBottom = 23
ClientRectRight = 1366
ClientRectTop = 19
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
@ -1079,7 +1138,8 @@ object frmClothContractListHZ: TfrmClothContractListHZ
object ADOQueryCmd: TADOQuery
Connection = DataLink_TradeManage.ADOLink
Parameters = <>
Left = 936
Left = 976
Top = 80
end
object ADOQueryMain: TADOQuery
Connection = DataLink_TradeManage.ADOLink

View File

@ -6,12 +6,24 @@ uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter,
RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport,
cxTextEdit, cxPC, cxLookAndFeels, cxLookAndFeelPainters,
dxBarBuiltInMenu, cxNavigator;
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class,
RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC,
cxLookAndFeels, cxLookAndFeelPainters, dxBarBuiltInMenu, cxNavigator,
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxCheckBox;
type
TfrmClothContractListHZ = class(TForm)
@ -149,6 +161,10 @@ type
cxGrid1Level1: TcxGridLevel;
ToolButton2: TToolButton;
v1Column3: TcxGridDBColumn;
TCK: TToolButton;
TnoCK: TToolButton;
cxTabControl1: TcxTabControl;
Tv1Column1: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
@ -165,10 +181,14 @@ type
procedure cxPageControl1Change(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure TCKClick(Sender: TObject);
procedure TnoCKClick(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
private
FInt, PFInt: Integer;
procedure InitGrid();
procedure InitForm();
procedure SetStatus();
function DelData(): Boolean;
{ Private declarations }
public
@ -179,9 +199,11 @@ var
frmClothContractListHZ: TfrmClothContractListHZ;
implementation
uses
U_DataLink,U_ClothContractInPutSX,U_Fun,U_ProductOrderList,U_ZDYHelp,U_ClothContractInPutSXMX
,U_ClothContractInPutHZ,U_ClothContractInPutPB, U_FjList_RZ;
U_DataLink, U_ClothContractInPutSX, U_Fun, U_ProductOrderList, U_ZDYHelp,
U_ClothContractInPutSXMX, U_ClothContractInPutHZ, U_ClothContractInPutPB,
U_FjList_RZ;
{$R *.dfm}
@ -190,8 +212,7 @@ begin
frmClothContractListHZ := nil;
end;
procedure TfrmClothContractListHZ.FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TfrmClothContractListHZ.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
@ -207,9 +228,19 @@ begin
end;
procedure TfrmClothContractListHZ.InitGrid();
var
strwhere: string;
begin
if cxPageControl1.ActivePageIndex=0 then
strwhere := '';
// if Trim(DParameters1) <> '高权限' then
// strwhere := strwhere + ' and Filler=''' + Trim(DName) + '''';
strwhere := strwhere + ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
if cxTabControl1.TabIndex < 2 then
begin
strwhere := strwhere + ' and isnull(OM.ChkStatus,''0'')=''' + inttostr(cxTabControl1.TabIndex) + '''';
end;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
@ -218,8 +249,8 @@ begin
Close;
sql.Clear;
sql.Add('exec ClothContractSX_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
Parameters.ParamByName('WSql').Value := strwhere;
// Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
Open;
end;
SCreateCDS20(ADOQueryMain, Order_Main);
@ -227,111 +258,6 @@ begin
finally
ADOQueryMain.EnableControls;
end;
end else
if cxPageControl1.ActivePageIndex=1 then
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('select A.*,B.*,ConNoM=A.ConNo,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
sql.Add(' where A.FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
sql.Add(' and A.FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
SQL.Add(' and A.ConType=''纱线前加工'' ');
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end else
if cxPageControl1.ActivePageIndex=2 then
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('select A.*,B.*,ConNoM=A.ConNo,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
sql.Add(' where A.FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
sql.Add(' and A.FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
SQL.Add(' and A.ConType=''纱线加工'' ');
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end else
if cxPageControl1.ActivePageIndex=3 then
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('exec ClothContract_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end else
if cxPageControl1.ActivePageIndex=4 then
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('select A.*,B.*,ConNoM=A.ConNo,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
sql.Add(' where A.FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
sql.Add(' and A.FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
SQL.Add(' and A.ConType=''染色加工'' ');
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end else
if cxPageControl1.ActivePageIndex=5 then
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Close;
sql.Clear;
sql.Add('select A.*,B.*,ConNoM=A.ConNo,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
sql.Add(' where A.FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
sql.Add(' and A.FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
SQL.Add(' and A.ConType=''后加工'' ');
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
end;
@ -342,33 +268,38 @@ begin
ReadCxGrid('坯布采购合同', Tv3, '指示单管理');
ReadCxGrid('染色合同', Tv4, '指示单管理');
ReadCxGrid('后加工合同', Tv5, '指示单管理');
if Trim(DParameters1)='1' then
begin
TBPrint.Visible:=False;
v1Column1.Visible:=False;
v1Column1.Hidden:=True;
v1PRTUnit.Visible:=False;
v1PRTUnit.Hidden:=True;
v1PRTQty.Visible:=False;
v1PRTQty.Hidden:=True;
end else
begin
v1Column1.Visible:=True;
v1Column1.Hidden:=False;
v1PRTUnit.Visible:=True;
v1PRTUnit.Hidden:=False;
v1PRTQty.Visible:=True;
v1PRTQty.Hidden:=False;
TBPrint.Visible:=True;
end;
// if Trim(DParameters1) = '1' then
// begin
// TBPrint.Visible := False;
// v1Column1.Visible := False;
// v1Column1.Hidden := True;
// v1PRTUnit.Visible := False;
// v1PRTUnit.Hidden := True;
// v1PRTQty.Visible := False;
// v1PRTQty.Hidden := True;
// end
// else
// begin
// v1Column1.Visible := True;
// v1Column1.Hidden := False;
// v1PRTUnit.Visible := True;
// v1PRTUnit.Hidden := False;
// v1PRTQty.Visible := True;
// v1PRTQty.Hidden := False;
// TBPrint.Visible := True;
// end;
BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 7;
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
SetStatus();
InitGrid();
end;
procedure TfrmClothContractListHZ.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
@ -376,7 +307,8 @@ end;
procedure TfrmClothContractListHZ.TBEditClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
if cxPageControl1.ActivePageIndex = 0 then
begin
try
@ -394,8 +326,8 @@ begin
finally
frmClothContractInPutSXMX.Free;
end;
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -419,8 +351,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -444,8 +376,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
try
frmClothContractInPutPB := TfrmClothContractInPutPB.Create(Application);
@ -462,8 +394,8 @@ begin
finally
frmClothContractInPutPB.Free;
end;
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -487,8 +419,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=5 then
end
else if cxPageControl1.ActivePageIndex = 5 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -518,7 +450,8 @@ end;
procedure TfrmClothContractListHZ.TBDelClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
if cxPageControl1.ActivePageIndex = 0 then
begin
@ -535,17 +468,19 @@ begin
Application.MessageBox('已经产生到货数据不能删除!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
if DelData() then
begin
//TBRafresh.Click;
//TBFind.Click;
Order_Main.Delete;
end;
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOQueryCmd do
begin
Close;
@ -571,10 +506,11 @@ begin
end;
end;
Order_Main.Delete;
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOQueryCmd do
begin
Close;
@ -600,8 +536,8 @@ begin
end;
end;
Order_Main.Delete;
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
with ADOQueryTemp do
begin
@ -616,7 +552,8 @@ begin
Application.MessageBox('已经产生到货数据不能删除!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOQueryCmd do
begin
Close;
@ -652,10 +589,11 @@ begin
end;
end;
Order_Main.Delete;
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOQueryCmd do
begin
Close;
@ -681,10 +619,11 @@ begin
end;
end;
Order_Main.Delete;
end else
if cxPageControl1.ActivePageIndex=5 then
end
else if cxPageControl1.ActivePageIndex = 5 then
begin
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOQueryCmd do
begin
Close;
@ -764,16 +703,17 @@ end;
procedure TfrmClothContractListHZ.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then Exit;
if ADOQueryMain.IsEmpty then
Exit;
TcxGridToExcel('坯布合同订单列表', cxGrid1);
end;
procedure TfrmClothContractListHZ.TBPrintClick(Sender: TObject);
var
fPrintFile, FConNoM: string;
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
if cxPageControl1.ActivePageIndex = 0 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\纱线订购合同.rmf';
@ -783,8 +723,7 @@ begin
Close;
sql.Clear;
sql.Add('exec ClothContractSX_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
Parameters.ParamByName('MainId').Value := Trim(Order_Main.fieldbyname('MainId').AsString);
Parameters.ParamByName('WSql').Value := '';
Open;
@ -792,8 +731,8 @@ begin
SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp, CDS_PRT);
FConNoM := Trim(CDS_PRT.fieldbyname('ConNoM').AsString);
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\纱线前加工合同.rmf';
with ADOQueryTemp do
@ -808,8 +747,8 @@ begin
SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp, CDS_PRT);
FConNoM := Trim(CDS_PRT.fieldbyname('ConNo').AsString);
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\纱线加工合同.rmf';
with ADOQueryTemp do
@ -824,8 +763,8 @@ begin
SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp, CDS_PRT);
FConNoM := Trim(CDS_PRT.fieldbyname('ConNo').AsString);
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\坯布订购合同.rmf';
with ADOQueryTemp do
@ -834,8 +773,7 @@ begin
Close;
sql.Clear;
sql.Add('exec ClothContract_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
Parameters.ParamByName('MainId').Value := Trim(Order_Main.fieldbyname('MainId').AsString);
Parameters.ParamByName('WSql').Value := '';
Open;
@ -843,8 +781,8 @@ begin
SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp, CDS_PRT);
FConNoM := Trim(CDS_PRT.fieldbyname('ConNoM').AsString);
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\染色合同.rmf';
with ADOQueryTemp do
@ -859,8 +797,8 @@ begin
SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp, CDS_PRT);
FConNoM := Trim(CDS_PRT.fieldbyname('ConNo').AsString);
end else
if cxPageControl1.ActivePageIndex=5 then
end
else if cxPageControl1.ActivePageIndex = 5 then
begin
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\后加工合同.rmf';
with ADOQueryTemp do
@ -877,7 +815,6 @@ begin
FConNoM := Trim(CDS_PRT.fieldbyname('ConNo').AsString);
end;
if FileExists(fPrintFile) then
begin
//RMVariables['begindate']:=begindate.DateTime;
@ -886,7 +823,8 @@ begin
//RMVariables['printer']:=Trim(gUserName);
RM1.LoadFromFile(fPrintFile);
RM1.ShowReport;
end else
end
else
begin
Application.MessageBox(PChar('没有找' + ExtractFilePath(Application.ExeName) + 'Report\相对应的合同报表.rmf'), '提示', 0);
end;
@ -916,8 +854,8 @@ begin
finally
frmClothContractInPutSXMX.Free;
end;
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -940,8 +878,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -964,8 +902,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
try
frmClothContractInPutPB := TfrmClothContractInPutPB.Create(Application);
@ -981,8 +919,8 @@ begin
finally
frmClothContractInPutPB.Free;
end;
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1005,8 +943,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=5 then
end
else if cxPageControl1.ActivePageIndex = 5 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1035,7 +973,8 @@ end;
procedure TfrmClothContractListHZ.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
@ -1046,12 +985,12 @@ begin
InitForm();
end;
procedure TfrmClothContractListHZ.conPress(Sender: TObject;
var Key: Char);
procedure TfrmClothContractListHZ.conPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
if Length(Trim(ConNoM.Text))<3 then Exit;
if Length(Trim(ConNoM.Text)) < 3 then
Exit;
try
ADOQueryMain.DisableControls;
@ -1064,25 +1003,25 @@ begin
begin
sql.Add('exec ClothContractSX_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value := ' and OM.conNo like ''' + '%' + Trim(ConNoM.Text) + '%' + '''';
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
sql.Add('select A.*,B.*,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
SQL.Add(' where A.ConNO like''' + '%' + Trim(ConNoM.Text) + '%' + '''');
sql.Add(' and A.ConType=''纱线加工''');
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
sql.Add('exec ClothContract_QryList :MainId,:WSql');
Parameters.ParamByName('WSql').Value := ' and OM.conNo like ''' + '%' + Trim(ConNoM.Text) + '%' + '''';
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
sql.Add('select A.*,B.*,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
SQL.Add(' where A.ConNO like''' + '%' + Trim(ConNoM.Text) + '%' + '''');
sql.Add(' and A.ConType=''染色加工''');
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
sql.Add('select A.*,B.*,Money=(B.Price*B.C_Qty) from ContractHZ_Main A inner join ContractHZ_Sub B on A.Mainid=B.MainId ');
SQL.Add(' where A.ConNO like''' + '%' + Trim(ConNoM.Text) + '%' + '''');
@ -1106,7 +1045,8 @@ end;
procedure TfrmClothContractListHZ.ToolButton1Click(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
if cxPageControl1.ActivePageIndex = 0 then
begin
try
@ -1125,8 +1065,8 @@ begin
finally
frmClothContractInPutSXMX.Free;
end;
end else
if cxPageControl1.ActivePageIndex=1 then
end
else if cxPageControl1.ActivePageIndex = 1 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1151,8 +1091,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=2 then
end
else if cxPageControl1.ActivePageIndex = 2 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1177,8 +1117,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=3 then
end
else if cxPageControl1.ActivePageIndex = 3 then
begin
try
frmClothContractInPutPB := TfrmClothContractInPutPB.Create(Application);
@ -1196,8 +1136,8 @@ begin
finally
frmClothContractInPutPB.Free;
end;
end else
if cxPageControl1.ActivePageIndex=4 then
end
else if cxPageControl1.ActivePageIndex = 4 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1222,8 +1162,8 @@ begin
finally
frmClothContractInPutHZ.Free;
end;
end else
if cxPageControl1.ActivePageIndex=5 then
end
else if cxPageControl1.ActivePageIndex = 5 then
begin
try
frmClothContractInPutHZ := TfrmClothContractInPutHZ.Create(Application);
@ -1253,7 +1193,8 @@ end;
procedure TfrmClothContractListHZ.ToolButton2Click(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmFjList_RZ := TfrmFjList_RZ.Create(Application);
with frmFjList_RZ do
@ -1272,4 +1213,89 @@ begin
end;
end;
procedure TfrmClothContractListHZ.TCKClick(Sender: TObject);
begin
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update ContractSX_Main SET ChkStatus=''1'',chktime=getdate(),chker='+quotedstr(trim(Dname)));
sql.Add('where MainId=' + quotedstr(trim(Order_Main.fieldbyname('MainId').AsString)));
execsql;
end;
application.MessageBox('纱线采购审核成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('纱线采购审核失败!', '提示信息', 0);
end;
end;
procedure TfrmClothContractListHZ.TnoCKClick(Sender: TObject);
begin
if Order_Main.IsEmpty then
exit;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update ContractSX_Main SET ChkStatus=''0'',chktime=null,Chker='''' ');
sql.Add('where MainId=' + quotedstr(trim(Order_Main.fieldbyname('MainId').AsString)));
execsql;
end;
application.MessageBox('纱线采购撤销审核成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('纱线采购撤销审核失败!', '提示信息', 0);
end;
end;
procedure TfrmClothContractListHZ.cxTabControl1Change(Sender: TObject);
begin
SetStatus();
InitGrid();
end;
procedure TfrmClothContractListHZ.SetStatus();
begin
tbedit.Visible := false;
tbdel.Visible := false;
TCK.Visible := false;
TnoCK.Visible := false;
if Trim(DParameters1) = '高权限' then
begin
case cxTabControl1.TabIndex of
0:
begin
tbedit.Visible := true;
tbdel.Visible := true;
TCK.Visible := true;
end;
1:
begin
TnoCK.Visible := true;
end;
end;
end
else
begin
case cxTabControl1.TabIndex of
0:
begin
tbedit.Visible := true;
tbdel.Visible := true;
end;
1:
begin
end;
end;
end;
end;
end.