修改一码通的一些内容

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-10-20 11:30:39 +08:00
parent 19ebd6eb13
commit 56ab7867a3
27 changed files with 16779 additions and 4869 deletions

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ object frmSelExportField: TfrmSelExportField
TabOrder = 2 TabOrder = 2
Visible = False Visible = False
object ExpGrid: TcxGridDBTableView object ExpGrid: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False Navigator.Buttons.CustomButtons = <>
DataController.DataSource = ExportDataSource DataController.DataSource = ExportDataSource
DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <> DataController.Summary.FooterSummaryItems = <>

View File

@ -8,7 +8,22 @@ uses
DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, cxStyles, cxCustomData, DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData,
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid; cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
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;
type type
TfrmSelExportField = class(TForm) TfrmSelExportField = class(TForm)

View File

@ -13,7 +13,8 @@ function ConnData(): Boolean;
implementation implementation
uses uses
U_DataLink, U_YMTRKList, U_YMTFHSQList, U_YMTFHDataList, U_YMTJGWCList; U_DataLink, U_YMTRKList, U_YMTFHSQList, U_YMTFHDataList, U_YMTJGWCList,
U_YMTStockList;
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// 功能说明:取Dll中得窗体 // // 功能说明:取Dll中得窗体 //
@ -48,6 +49,8 @@ begin
DParameters8 := Parameters8; DParameters8 := Parameters8;
DParameters9 := Parameters9; DParameters9 := Parameters9;
DParameters10 := Parameters10; DParameters10 := Parameters10;
DName := 'ADMIN';
DCode := 'ADMIN';
MainApplication := App; MainApplication := App;
DCurHandle := FormH; DCurHandle := FormH;
@ -56,7 +59,6 @@ begin
Application := TApplication(App); Application := TApplication(App);
DCurHandle := 0; DCurHandle := 0;
//赋值链接字符串 //赋值链接字符串
SetLength(server, 255); SetLength(server, 255);
SetLength(dtbase, 255); SetLength(dtbase, 255);
@ -138,13 +140,63 @@ begin
mnewHandle := frmYMTJGWCList.Handle; mnewHandle := frmYMTJGWCList.Handle;
end; end;
211: //发货申请 113: //库存数据
begin begin
if frmYMTFHSQList = nil then if frmStockList = nil then
begin
frmStockList := TfrmStockList.Create(application.MainForm);
with frmStockList do
begin
caption := Trim(Title);
FormStyle := mstyle;
windowState := mstate;
BorderStyle := mborderstyle;
//show;
end;
end
else
frmStockList.BringToFront;
//句柄
mnewHandle := frmStockList.Handle;
end;
// 211: //发货申请
// begin
// if frmYMTFHSQList = nil then
// begin
// frmYMTFHSQList := TfrmYMTFHSQList.Create(application.MainForm);
// with frmYMTFHSQList do
// begin
// caption := Trim(Title);
// FormStyle := mstyle;
// windowState := mstate;
// BorderStyle := mborderstyle;
// //show;
// end;
// end
// else
// frmYMTFHSQList.BringToFront;
// //句柄
// mnewHandle := frmYMTFHSQList.Handle;
// end;
211: //销售发货申请
begin
bFound := FALSE;
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
begin
if App.MainForm.MDIChildren[i].Caption = '销售发货申请' then
begin
BringWindowToTop(frmYMTFHSQList.Handle);
bFound := TRUE;
Break;
end;
end;
if not bFound then
begin begin
frmYMTFHSQList := TfrmYMTFHSQList.Create(application.MainForm); frmYMTFHSQList := TfrmYMTFHSQList.Create(application.MainForm);
with frmYMTFHSQList do with frmYMTFHSQList do
begin begin
Title := '销售发货申请';
caption := Trim(Title); caption := Trim(Title);
FormStyle := mstyle; FormStyle := mstyle;
windowState := mstate; windowState := mstate;
@ -176,10 +228,42 @@ begin
//句柄 //句柄
mnewHandle := frmYMTFHDataList.Handle; mnewHandle := frmYMTFHDataList.Handle;
end; end;
213: //加工发货登记
begin
bFound := FALSE;
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
begin
if App.MainForm.MDIChildren[i].Caption = '加工发货登记' then
begin
BringWindowToTop(frmYMTFHSQList.Handle);
bFound := TRUE;
Break;
end;
end;
if not bFound then
begin
frmYMTFHSQList := TfrmYMTFHSQList.Create(application.MainForm);
with frmYMTFHSQList do
begin
Title := '加工发货登记';
caption := Trim(Title);
FormStyle := mstyle;
windowState := mstate;
BorderStyle := mborderstyle;
//show;
end;
end
else
frmYMTFHSQList.BringToFront;
//句柄
mnewHandle := frmYMTFHSQList.Handle;
end;
end; end;
Result := mnewHandle; Result := mnewHandle;
end; end;
//=========================================================== //===========================================================
//建立数据库连接池 //建立数据库连接池
//=========================================================== //===========================================================

View File

@ -1,6 +1,6 @@
object frmYMTFHDataList: TfrmYMTFHDataList object frmYMTFHDataList: TfrmYMTFHDataList
Left = 515 Left = 479
Top = 347 Top = 280
Width = 1370 Width = 1370
Height = 750 Height = 750
Caption = #21457#36135#25968#25454 Caption = #21457#36135#25968#25454
@ -352,13 +352,19 @@ object frmYMTFHDataList: TfrmYMTFHDataList
end end
object v2Column6: TcxGridDBColumn object v2Column6: TcxGridDBColumn
Tag = 2 Tag = 2
Caption = #25968#37327 Caption = #38271#24230
DataBinding.FieldName = 'Qty' DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False Options.Editing = False
Width = 85 Width = 85
end end
object Tv1Column1: TcxGridDBColumn
Caption = #37325#37327
DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
end
end end
object cxGrid2Level1: TcxGridLevel object cxGrid2Level1: TcxGridLevel
GridView = Tv1 GridView = Tv1

View File

@ -79,6 +79,7 @@ type
Tv1FromMXID: TcxGridDBColumn; Tv1FromMXID: TcxGridDBColumn;
ToolButton1: TToolButton; ToolButton1: TToolButton;
ToolButton2: TToolButton; ToolButton2: TToolButton;
Tv1Column1: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);

View File

@ -1,20 +1,20 @@
object frmFHSQInPut: TfrmFHSQInPut object frmFHSQInPut: TfrmFHSQInPut
Left = 354 Left = 677
Top = 296 Top = 428
Width = 1499 Width = 1499
Height = 664 Height = 664
Caption = #21457#36135#30003#35831#24405#20837 Caption = #21457#36135#30003#35831#24405#20837
Color = clBtnFace Color = clBtnFace
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -12
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
OldCreateOrder = False OldCreateOrder = False
Position = poScreenCenter Position = poScreenCenter
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 120 PixelsPerInch = 96
TextHeight = 15 TextHeight = 12
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
@ -59,7 +59,7 @@ object frmFHSQInPut: TfrmFHSQInPut
Left = 0 Left = 0
Top = 29 Top = 29
Width = 1491 Width = 1491
Height = 139 Height = 111
Align = alTop Align = alTop
BevelInner = bvNone BevelInner = bvNone
BevelOuter = bvNone BevelOuter = bvNone
@ -70,121 +70,118 @@ object frmFHSQInPut: TfrmFHSQInPut
TabOrder = 1 TabOrder = 1
object Label1: TLabel object Label1: TLabel
Tag = 1 Tag = 1
Left = 41 Left = 33
Top = 15 Top = 12
Width = 115 Width = 100
Height = 22 Height = 19
Caption = #20986#24211#31867#22411#65306 Caption = #20986#24211#31867#22411#65306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label12: TLabel object Label12: TLabel
Tag = 1 Tag = 1
Left = 49 Left = 40
Top = 98 Top = 78
Width = 105 Width = 93
Height = 22 Height = 19
Caption = #22791' '#27880#65306 Caption = #22791' '#27880#65306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label11: TLabel object Label11: TLabel
Tag = 1 Tag = 1
Left = 475 Left = 380
Top = 15 Top = 12
Width = 115 Width = 100
Height = 22 Height = 19
Caption = #25910#36135#21333#20301#65306 Caption = #25910#36135#21333#20301#65306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label2: TLabel object Label2: TLabel
Tag = 1 Tag = 1
Left = 475 Left = 380
Top = 54 Top = 43
Width = 115 Width = 100
Height = 22 Height = 19
Caption = #30003#35831#26085#26399#65306 Caption = #30003#35831#26085#26399#65306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label5: TLabel object Label5: TLabel
Tag = 1 Tag = 1
Left = 64 Left = 53
Top = 54 Top = 43
Width = 92 Width = 80
Height = 22 Height = 19
Caption = #19994#21153#21592#65306 Caption = #19994#21153#21592#65306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label3: TLabel object Label3: TLabel
Tag = 1 Tag = 1
Left = 1061 Left = 849
Top = 15 Top = 12
Width = 92 Width = 80
Height = 22 Height = 19
Caption = #21152#24037#31867#22411 Caption = #21152#24037#31867#22411
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object CRType: TComboBox object CRType: TComboBox
Tag = 1 Tag = 1
Left = 144 Left = 123
Top = 10 Top = 8
Width = 312 Width = 250
Height = 30 Height = 27
Style = csDropDownList Style = csDropDownList
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 22 ItemHeight = 19
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
Items.Strings = ( Items.Strings = (
#38144#21806#20869#38144 #38144#21806#20869#38144
#21152#24037#20869#38144
#38144#21806#22806#38144 #38144#21806#22806#38144
#21152#24037#22806#38144 '')
#21152#24037#20986#24211
#20854#20182#20986#24211)
end end
object Note: TEdit object Note: TEdit
Tag = 1 Tag = 1
Left = 144 Left = 123
Top = 94 Top = 75
Width = 892 Width = 714
Height = 23 Height = 28
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -193,14 +190,14 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object SHDanWei: TBtnEditC object SHDanWei: TBtnEditC
Tag = 1 Tag = 1
Left = 569 Left = 469
Top = 9 Top = 7
Width = 466 Width = 373
Height = 26 Height = 31
Hint = 'KHNo' Hint = 'KHNo'
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991'('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861 ImeName = #20013#25991'('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
@ -211,10 +208,10 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object SQDate: TDateTimePicker object SQDate: TDateTimePicker
Tag = 1 Tag = 1
Left = 569 Left = 469
Top = 49 Top = 39
Width = 162 Width = 130
Height = 30 Height = 27
BevelInner = bvNone BevelInner = bvNone
Date = 43473.670856296290000000 Date = 43473.670856296290000000
Format = 'yyyy-MM-dd' Format = 'yyyy-MM-dd'
@ -222,7 +219,7 @@ object frmFHSQInPut: TfrmFHSQInPut
Checked = False Checked = False
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -231,13 +228,13 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object Salesman: TBtnEditC object Salesman: TBtnEditC
Tag = 1 Tag = 1
Left = 144 Left = 123
Top = 48 Top = 38
Width = 169 Width = 135
Height = 26 Height = 31
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -248,13 +245,13 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object JGType: TEdit object JGType: TEdit
Tag = 1 Tag = 1
Left = 1164 Left = 936
Top = 10 Top = 8
Width = 150 Width = 120
Height = 23 Height = 28
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -264,7 +261,7 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object ToolBar2: TToolBar object ToolBar2: TToolBar
Left = 0 Left = 0
Top = 168 Top = 140
Width = 1491 Width = 1491
Height = 29 Height = 29
ButtonHeight = 30 ButtonHeight = 30
@ -304,9 +301,9 @@ object frmFHSQInPut: TfrmFHSQInPut
end end
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 0 Left = 0
Top = 197 Top = 169
Width = 1491 Width = 1491
Height = 430 Height = 464
Align = alClient Align = alClient
TabOrder = 3 TabOrder = 3
object Tv1: TcxGridDBTableView object Tv1: TcxGridDBTableView

View File

@ -0,0 +1,480 @@
object frmFHSQInPut2: TfrmFHSQInPut2
Left = 357
Top = 336
Width = 1499
Height = 664
Caption = #21457#36135#30003#35831#24405#20837
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 1491
Height = 29
ButtonHeight = 30
ButtonWidth = 75
Caption = 'ToolBar1'
Color = clBtnFace
EdgeInner = esNone
EdgeOuter = esNone
Flat = True
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
Images = DataLink_YXYMT.ThreeImgList
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object TBSave: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #20445#23384
ImageIndex = 5
OnClick = TBSaveClick
end
object TBClose: TToolButton
Left = 79
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 21
OnClick = TBCloseClick
end
end
object ScrollBox1: TScrollBox
Left = 0
Top = 29
Width = 1491
Height = 111
Align = alTop
BevelInner = bvNone
BevelOuter = bvNone
Color = clBtnFace
Ctl3D = False
ParentColor = False
ParentCtl3D = False
TabOrder = 1
object Label1: TLabel
Tag = 1
Left = 33
Top = 12
Width = 100
Height = 19
Caption = #20986#24211#31867#22411#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Tag = 1
Left = 40
Top = 78
Width = 93
Height = 19
Caption = #22791' '#27880#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label11: TLabel
Tag = 1
Left = 380
Top = 12
Width = 100
Height = 19
Caption = #25910#36135#21333#20301#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label2: TLabel
Tag = 1
Left = 380
Top = 43
Width = 100
Height = 19
Caption = #30003#35831#26085#26399#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label5: TLabel
Tag = 1
Left = 53
Top = 43
Width = 80
Height = 19
Caption = #19994#21153#21592#65306
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label3: TLabel
Tag = 1
Left = 849
Top = 12
Width = 80
Height = 19
Caption = #21152#24037#31867#22411
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object CRType: TComboBox
Tag = 1
Left = 121
Top = 8
Width = 250
Height = 27
Style = csDropDownList
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 19
ParentFont = False
TabOrder = 0
Items.Strings = (
#21152#24037#20869#38144
#21152#24037#22806#38144
#21152#24037#20986#24211
'')
end
object Note: TEdit
Tag = 1
Left = 121
Top = 75
Width = 714
Height = 25
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ParentFont = False
TabOrder = 4
end
object SHDanWei: TBtnEditC
Tag = 1
Left = 470
Top = 7
Width = 373
Height = 28
Hint = 'KHNo'
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991'('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
ParentFont = False
TabOrder = 1
OnBtnUpClick = SHDanWeiBtnUpClick
OnBtnDnClick = SHDanWeiBtnDnClick
end
object SQDate: TDateTimePicker
Tag = 1
Left = 470
Top = 39
Width = 130
Height = 27
BevelInner = bvNone
Date = 43473.670856296290000000
Format = 'yyyy-MM-dd'
Time = 43473.670856296290000000
Checked = False
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ParentFont = False
TabOrder = 2
end
object Salesman: TBtnEditC
Tag = 1
Left = 121
Top = 38
Width = 135
Height = 28
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ParentFont = False
TabOrder = 3
OnBtnUpClick = SalesmanBtnUpClick
OnBtnDnClick = SalesmanBtnDnClick
end
object JGType: TEdit
Tag = 1
Left = 931
Top = 8
Width = 120
Height = 25
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ParentFont = False
TabOrder = 5
end
end
object ToolBar2: TToolBar
Left = 0
Top = 140
Width = 1491
Height = 29
ButtonHeight = 30
ButtonWidth = 95
Caption = 'ToolBar1'
Color = clBtnFace
EdgeInner = esNone
EdgeOuter = esNone
Flat = True
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
Images = DataLink_YXYMT.ThreeImgList
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 2
object ToolButton3: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #35745#21010#21333
ImageIndex = 57
Visible = False
OnClick = ToolButton3Click
end
object ToolButton1: TToolButton
Left = 99
Top = 0
AutoSize = True
Caption = #24211#23384
ImageIndex = 57
OnClick = ToolButton1Click
end
object ToolButton2: TToolButton
Left = 178
Top = 0
AutoSize = True
Caption = #21024#34892
ImageIndex = 113
OnClick = ToolButton2Click
end
end
object cxGrid1: TcxGrid
Left = 0
Top = 169
Width = 1491
Height = 464
Align = alClient
TabOrder = 3
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DataSource1
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <
item
Format = '0'
Position = spFooter
end
item
Format = '0'
Position = spFooter
end
item
Format = '0'
Position = spFooter
end>
DataController.Summary.FooterSummaryItems = <
item
Kind = skSum
end
item
Kind = skSum
end
item
Kind = skSum
end
item
Kind = skSum
end
item
Kind = skSum
Column = v1Column5
end>
DataController.Summary.SummaryGroups = <>
OptionsBehavior.FocusCellOnTab = True
OptionsBehavior.GoToNextCellOnEnter = True
OptionsBehavior.FocusCellOnCycle = True
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.Content = DataLink_YXYMT.Default
Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_YXYMT.Default
object v1Column14: TcxGridDBColumn
Caption = #32534#21495
DataBinding.FieldName = 'MXID'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 120
end
object v1Column6: TcxGridDBColumn
Caption = #21697#21517
DataBinding.FieldName = 'MXPrtName'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 110
end
object v1Column1: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'MXPrtColor'
HeaderAlignmentHorz = taCenter
Width = 95
end
object v1Column2: TcxGridDBColumn
Caption = #33457#22411
DataBinding.FieldName = 'MXPrtHX'
HeaderAlignmentHorz = taCenter
Width = 81
end
object v1Column4: TcxGridDBColumn
Caption = #38271#24230
DataBinding.FieldName = 'MQty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1Column1: TcxGridDBColumn
Caption = #37325#37327
DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column3: TcxGridDBColumn
Caption = #24211#20301
DataBinding.FieldName = 'Kuwei'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1Column2: TcxGridDBColumn
Caption = #36153#29992#21333#20215
DataBinding.FieldName = 'FHPrice'
HeaderAlignmentHorz = taCenter
Width = 107
end
object v1Column10: TcxGridDBColumn
Caption = #36153#29992#21517#31216
DataBinding.FieldName = 'FeeName'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Properties.OnButtonClick = v1Column10PropertiesButtonClick
HeaderAlignmentHorz = taCenter
Width = 107
end
object v1Column5: TcxGridDBColumn
Caption = #36153#29992#37329#39069
DataBinding.FieldName = 'FeeMoney'
Visible = False
HeaderAlignmentHorz = taCenter
Width = 106
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
end
end
object ADOTemp: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 200
Top = 65533
end
object ADOCmd: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 168
Top = 65533
end
object DataSource1: TDataSource
DataSet = Order_Sub
Left = 768
Top = 392
end
object Order_Sub: TClientDataSet
Aggregates = <>
Params = <>
Left = 728
Top = 392
end
object ADOQuery1: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 136
Top = 65533
end
object cxGridPopupMenu2: TcxGridPopupMenu
Grid = cxGrid1
PopupMenus = <>
Left = 688
Top = 392
end
end

View File

@ -0,0 +1,586 @@
unit U_YMTFHSQInPut2;
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, cxCalendar, StrUtils,
cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinDarkRoom,
dxSkinOffice2013White, dxSkinSharpPlus, dxSkinSpringTime,
dxSkinsDefaultPainters, dxSkinscxPCPainter, dxSkinBlack, dxSkinBlue,
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSilver,
dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinValentine,
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue;
type
TfrmFHSQInPut2 = class(TForm)
ToolBar1: TToolBar;
TBSave: TToolButton;
TBClose: TToolButton;
ScrollBox1: TScrollBox;
ToolBar2: TToolBar;
ToolButton2: TToolButton;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
ADOTemp: TADOQuery;
ADOCmd: TADOQuery;
DataSource1: TDataSource;
Order_Sub: TClientDataSet;
ADOQuery1: TADOQuery;
v1Column14: TcxGridDBColumn;
cxGridPopupMenu2: TcxGridPopupMenu;
Label1: TLabel;
CRType: TComboBox;
Note: TEdit;
Label12: TLabel;
Label11: TLabel;
SHDanWei: TBtnEditC;
v1Column6: TcxGridDBColumn;
Label2: TLabel;
SQDate: TDateTimePicker;
Label5: TLabel;
Salesman: TBtnEditC;
v1Column1: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column5: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
ToolButton3: TToolButton;
Label3: TLabel;
JGType: TEdit;
ToolButton1: TToolButton;
Tv1Column1: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure SHDanWeiBtnUpClick(Sender: TObject);
procedure SHDanWeiBtnDnClick(Sender: TObject);
procedure ShouKuanKeyPress(Sender: TObject; var Key: Char);
procedure SalesmanBtnUpClick(Sender: TObject);
procedure SalesmanBtnDnClick(Sender: TObject);
procedure v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
fuserName: string;
procedure InitData();
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
function SaveData(): Boolean;
{ Private declarations }
public
PState, CopyInt: Integer;
FMainId, FFMainId, ChkStr, ConPriceStr: string;
FXS: Integer;
FZZType: string;
{ Public declarations }
end;
var
frmFHSQInPut2: TfrmFHSQInPut2;
newh: hwnd;
implementation
uses
U_DataLink, U_ZDYHelp, U_RTFun, U_YMTOrderSel, U_ZdyAttachKH, U_ZdyAttachGYS,
U_YMTStockSel; // U_YMTKHList, , U_YMTGYSList
{$R *.dfm}
procedure TfrmFHSQInPut2.TBCloseClick(Sender: TObject);
begin
Close;
WriteCxGrid('发货申请录入1', Tv1, '发货管理');
end;
procedure TfrmFHSQInPut2.InitData();
var
fsj: string;
begin
if PState = 0 then
begin
Salesman.Text := dname;
SQDate.DateTime := SGetServerDate10(ADOTemp);
end;
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add(' select A.* from YMT_FHSQ_Sub A');
if PState = 1 then
begin
sql.Add('where FSId=''' + Trim(FMainId) + '''');
end;
if PState = 0 then
begin
sql.Add(' where 1<>1');
end;
Open;
end;
SCreateCDS20(ADOQuery1, Order_Sub);
SInitCDSData20(ADOQuery1, Order_Sub);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.* from YMT_FHSQ_Main A');
sql.Add(' where FSId=''' + Trim(FMainId) + ''' ');
Open;
end;
SCSHDataNew(ADOQuery1, ScrollBox1, 1);
end;
procedure TfrmFHSQInPut2.ZDYHelp(FButn: TcxButtonEdit; LType: string);
var
FType, ZDYName, FText: string;
begin
end;
procedure TfrmFHSQInPut2.FormShow(Sender: TObject);
begin
readCxGrid('发货申请录入1', Tv1, '发货管理');
InitData();
end;
function TfrmFHSQInPut2.SaveData(): Boolean;
var
maxno, maxmnno, FSSId: string;
fconNO, fmxType: string;
begin
try
ADOCmd.Connection.BeginTrans;
///保存主表
if Trim(FMainId) = '' then
begin
if GetLSNoHZ(ADOCmd, maxno, 'NK', 'YMT_FHSQ_Main', 3, 1, 3) = False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxno := Trim(FMainId);
end;
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('select * from YMT_FHSQ_Main where FSID=''' + Trim(FMainId) + '''');
Open;
end;
with ADOCmd do
begin
if Trim(FMainId) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('SQType').Value := '成品';
FieldByName('FSID').Value := Trim(maxno);
RTSetsavedata(ADOCmd, 'YMT_FHSQ_Main', ScrollBox1, 1);
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);
///保存子表
Order_Sub.DisableControls;
with Order_Sub do
begin
First;
while not Eof do
begin
if Trim(Order_Sub.fieldbyname('SSId').AsString) = '' then
begin
if GetLSNo(ADOCmd, maxno, 'SS', 'YMT_FHSQ_Sub', 4, 1) = False then
begin
Order_Sub.EnableControls;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('取子流水号失败!', '提示', 0);
Exit;
end;
end
else
begin
maxno := Trim(Order_Sub.fieldbyname('SSId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from YMT_FHSQ_Sub ');
sql.Add(' where SSId=''' + Trim(maxno) + '''');
Open;
end;
if ADOCmd.IsEmpty then
begin
FSSId := '';
end
else
begin
FSSId := Trim(maxno);
end;
with ADOCmd do
begin
if Trim(FSSId) = '' then
begin
Append;
FieldByName('Filler').Value := Trim(DName);
end
else
begin
Edit;
FieldByName('Editer').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
end;
FieldByName('FSID').Value := Trim(FMainId);
FieldByName('SSID').Value := Trim(maxno);
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'YMT_FHSQ_Sub', 0);
FieldByName('MainId').Value := Order_Sub.fieldbyname('MainId').Value;
FieldByName('SubId').Value := Order_Sub.fieldbyname('SubId').Value;
FieldByName('SSConMainId').Value := Order_Sub.fieldbyname('SSConMainId').Value;
FieldByName('SSConSubId').Value := Order_Sub.fieldbyname('SSConSubId').Value;
FieldByName('FHPrice').Value := Order_Sub.fieldbyname('FHPrice').Value;
FieldByName('BZType').Value := Order_Sub.fieldbyname('BZType').Value;
Post;
end;
Order_Sub.Edit;
Order_Sub.FieldByName('SSID').Value := Trim(maxno);
Next;
end;
end;
Order_Sub.EnableControls;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update YMT_FHSQ_Main Set ');
sql.Add('SQPSHZ=(select Sum(SQPS) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
sql.Add(',SQQtyHZM=(select Sum(SQQtyM) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
sql.Add('where FSID=''' + Trim(FMainId) + '''');
ExecSQL;
end;
ADOCmd.Connection.CommitTrans;
Result := True;
except
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('保存失败!', '提示', 0);
Result := False;
end;
end;
procedure TfrmFHSQInPut2.TBSaveClick(Sender: TObject);
var
Freal: Double;
begin
ToolBar1.SetFocus;
if Trim(CRType.Text) = '' then
begin
Application.MessageBox('出库类型不能为空!', '提示', 0);
Exit;
end;
if Order_Sub.IsEmpty then
begin
Application.MessageBox('明细不能为空!', '提示', 0);
Exit;
end;
if SaveData() then
begin
Application.MessageBox('保存成功!', '提示', 0);
end;
end;
procedure TfrmFHSQInPut2.ToolButton2Click(Sender: TObject);
begin
if Order_Sub.IsEmpty then
Exit;
if Trim(Order_Sub.fieldbyname('SSId').AsString) <> '' then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YMT_FHSQ_Sub where SSId=''' + Trim(Order_Sub.fieldbyname('SSId').AsString) + '''');
sql.add(' and isnull(FHPS,0)>0');
Open;
end;
if ADOTemp.IsEmpty = False then
begin
Application.MessageBox('已发货不能删除数据!', '提示', 0);
exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete YMT_FHSQ_Sub where SSId=''' + Trim(Order_Sub.fieldbyname('SSId').AsString) + '''');
ExecSQL;
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update YMT_FHSQ_Main Set ');
sql.Add('SQPSHZ=(select Sum(SQPS) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
sql.Add('where FSID=''' + Trim(FMainId) + '''');
ExecSQL;
end;
end;
Order_Sub.Delete;
end;
procedure TfrmFHSQInPut2.SHDanWeiBtnUpClick(Sender: TObject);
begin
if CRType.Text = '加工出库' then
begin
try
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
with frmZdyAttachGYS do
begin
if ShowModal = 1 then
begin
Self.SHDanWei.Text := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('KHNameJC').AsString);
Self.SHDanWei.TxtCode := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('KHNo').AsString);
Self.Salesman.Text := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('YWY').AsString);
end;
end;
finally
frmZdyAttachGYS.Free;
end;
end
else
begin
try
frmZdyAttachkh := TfrmZdyAttachkh.Create(Application);
with frmZdyAttachkh do
begin
// if self.canshu1 <> '高权限' then
// canshu1 := '业务员';
if ShowModal = 1 then
begin
Self.SHDanWei.Text := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('KHNameJC').AsString);
Self.SHDanWei.TxtCode := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('KHNo').AsString);
Self.Salesman.Text := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('YWY').AsString);
end;
end;
finally
frmZdyAttachkh.Free;
end;
end;
end;
procedure TfrmFHSQInPut2.SHDanWeiBtnDnClick(Sender: TObject);
begin
SHDanWei.Text := '';
end;
procedure TfrmFHSQInPut2.ShouKuanKeyPress(Sender: TObject; var Key: Char);
begin
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
begin
Key := #0;
end
else if (pos('.', TEdit(Sender).text) <> 0) then
begin
if Key = '.' then
begin
Key := #0;
end;
end;
end;
procedure TfrmFHSQInPut2.SalesmanBtnUpClick(Sender: TObject);
begin
try
frmZDYHelp := TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag := 'Salesman';
flagname := '业务员';
if ShowModal = 1 then
begin
Self.Salesman.Text := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmFHSQInPut2.SalesmanBtnDnClick(Sender: TObject);
begin
Salesman.Text := '';
end;
procedure TfrmFHSQInPut2.v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZDYHelp := TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag := 'FeeName';
flagname := '费用名称';
if ShowModal = 1 then
begin
with Order_Sub do
begin
Edit;
FieldByName('FeeName').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmFHSQInPut2.ToolButton3Click(Sender: TObject);
begin
try
frmOrderSel := TfrmOrderSel.Create(Application);
with frmOrderSel do
begin
FKHNo := Trim(SHDanWei.TxtCode);
// FTT := Trim(FHTaiTou.text);
if ShowModal = 1 then
begin
while frmOrderSel.CDS_Main.Locate('SSel', true, []) do
begin
if Trim(Self.SHDanWei.Text) = '' then
begin
SHDanWei.TxtCode := Trim(frmOrderSel.CDS_Main.fieldbyname('KHNO').AsString);
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from KH_Main where KHNO=''' + Trim(SHDanWei.TxtCode) + '''');
open;
end;
SHDanWei.Text := Trim(ADOQueryTemp.fieldbyname('KHNameJC').AsString);
end;
// if Trim(Self.FHTaiTou.Text) = '' then
// begin
// FHTaiTou.Text := Trim(frmOrderSel.CDS_Main.fieldbyname('SYRName').AsString);
// end;
if Self.Order_Sub.Locate('SubId;CPType', VarArrayOf([Trim(frmOrderSel.CDS_Main.fieldbyname('SubId').AsString), Trim(frmOrderSel.CDS_Main.fieldbyname('CPType').AsString)]), []) = False then
begin
with Self.Order_Sub do
begin
Append;
FieldByName('MainId').Value := frmOrderSel.CDS_Main.fieldbyname('MainId').Value;
FieldByName('SubId').Value := frmOrderSel.CDS_Main.fieldbyname('SubId').Value;
FieldByName('MXPrtName').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLCodeName').AsString);
FieldByName('MXPrtColor').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLColor').AsString);
FieldByName('MXPrtHX').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLHX').AsString);
FieldByName('SCConNo').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLOrderNo').AsString);
// CRType.Text := Trim(frmOrderSel.CDS_Main.fieldbyname('CRType').AsString);
CRType.ItemIndex := CRType.Items.IndexOf(trim(frmOrderSel.CDS_Main.fieldbyname('CRType').AsString));
FieldByName('CPType').Value := '成品';
FieldByName('SQPS').Value := 0;
FieldByName('SQQtyM').Value := 0;
FieldByName('BZType').Value := frmOrderSel.CDS_Main.fieldbyname('BZType').Value;
FieldByName('FHPrice').Value := frmOrderSel.CDS_Main.fieldbyname('MLPrice').Value;
FieldByName('FeeName').Value := frmOrderSel.CDS_Main.fieldbyname('FeeName').Value;
FieldByName('FeeMoney').Value := frmOrderSel.CDS_Main.fieldbyname('FeeMoney').Value;
Post;
end;
end;
frmOrderSel.CDS_Main.Delete;
end;
end;
end;
finally
frmOrderSel.Free;
end;
end;
procedure TfrmFHSQInPut2.ToolButton1Click(Sender: TObject);
begin
try
frmStockSel := TfrmStockSel.Create(Application);
with frmStockSel do
begin
if ShowModal = 1 then
begin
while frmStockSel.CDS_Main.Locate('SSel', true, []) do
begin
with Self.Order_Sub do
begin
Append;
FieldByName('MXPrtName').Value := Trim(frmStockSel.CDS_Main.fieldbyname('SPName').AsString);
FieldByName('MXPrtColor').Value := Trim(frmStockSel.CDS_Main.fieldbyname('SPColor').AsString);
FieldByName('MXPrtHX').Value := Trim(frmStockSel.CDS_Main.fieldbyname('SPHX').AsString);
FieldByName('MXID').Value := Trim(frmStockSel.CDS_Main.fieldbyname('FromMXID').AsString);
FieldByName('CPType').Value := '布匹';
FieldByName('MQty').Value := frmStockSel.CDS_Main.fieldbyname('MQty').Value;
;
FieldByName('KgQty').Value := frmStockSel.CDS_Main.fieldbyname('KgQty').Value;
FieldByName('Kuwei').Value := frmStockSel.CDS_Main.fieldbyname('KuWei').Value;
Post;
end;
with frmStockSel.CDS_Main do
begin
Edit;
fieldbyname('SSel').Value := False;
Post;
end;
end;
end;
end;
finally
frmStockSel.Free;
end;
end;
end.

View File

@ -7,7 +7,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
Color = clBtnFace Color = clBtnFace
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -12
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
OldCreateOrder = False OldCreateOrder = False
@ -15,8 +15,8 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 120 PixelsPerInch = 96
TextHeight = 15 TextHeight = 12
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
@ -54,16 +54,24 @@ object frmYMTFHSQList: TfrmYMTFHSQList
ImageIndex = 1 ImageIndex = 1
OnClick = TBAddClick OnClick = TBAddClick
end end
object TBEdit: TToolButton object TbAdd2: TToolButton
Left = 158 Left = 158
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #26032#22686
ImageIndex = 2
OnClick = TbAdd2Click
end
object TBEdit: TToolButton
Left = 237
Top = 0
AutoSize = True
Caption = #20462#25913 Caption = #20462#25913
ImageIndex = 11 ImageIndex = 11
OnClick = TBEditClick OnClick = TBEditClick
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 237 Left = 316
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #25209#37327#20462#25913 Caption = #25209#37327#20462#25913
@ -71,7 +79,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = ToolButton2Click OnClick = ToolButton2Click
end end
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 356 Left = 435
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #26597#30475 Caption = #26597#30475
@ -79,7 +87,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = ToolButton1Click OnClick = ToolButton1Click
end end
object TBDel: TToolButton object TBDel: TToolButton
Left = 435 Left = 514
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #21024#38500 Caption = #21024#38500
@ -87,7 +95,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = TBDelClick OnClick = TBDelClick
end end
object tchk: TToolButton object tchk: TToolButton
Left = 514 Left = 593
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #23457#26680 Caption = #23457#26680
@ -95,7 +103,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = tchkClick OnClick = tchkClick
end end
object Tnochk: TToolButton object Tnochk: TToolButton
Left = 593 Left = 672
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #25764#38144#23457#26680 Caption = #25764#38144#23457#26680
@ -103,7 +111,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = TnochkClick OnClick = TnochkClick
end end
object TBPrint: TToolButton object TBPrint: TToolButton
Left = 712 Left = 791
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #25171#21360 Caption = #25171#21360
@ -111,7 +119,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnClick = TBPrintClick OnClick = TBPrintClick
end end
object TBClose: TToolButton object TBClose: TToolButton
Left = 791 Left = 870
Top = 0 Top = 0
AutoSize = True AutoSize = True
Caption = #20851#38381 Caption = #20851#38381
@ -121,9 +129,9 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 0 Left = 0
Top = 128 Top = 108
Width = 1300 Width = 1300
Height = 194 Height = 282
Align = alClient Align = alClient
TabOrder = 2 TabOrder = 2
object Tv1: TcxGridDBTableView object Tv1: TcxGridDBTableView
@ -373,88 +381,88 @@ object frmYMTFHSQList: TfrmYMTFHSQList
Left = 0 Left = 0
Top = 32 Top = 32
Width = 1300 Width = 1300
Height = 96 Height = 76
Align = alTop Align = alTop
BevelInner = bvRaised BevelInner = bvRaised
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clSkyBlue Color = clSkyBlue
TabOrder = 1 TabOrder = 1
object Label1: TLabel object Label1: TLabel
Left = 29 Left = 23
Top = 19 Top = 15
Width = 92 Width = 80
Height = 22 Height = 19
Caption = #30003#35831#26085#26399 Caption = #30003#35831#26085#26399
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label4: TLabel object Label4: TLabel
Left = 343 Left = 274
Top = 19 Top = 15
Width = 92 Width = 80
Height = 22 Height = 19
Caption = #25910#36135#21333#20301 Caption = #25910#36135#21333#20301
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label5: TLabel object Label5: TLabel
Left = 365 Left = 292
Top = 56 Top = 45
Width = 69 Width = 60
Height = 22 Height = 19
Caption = #19994#21153#21592 Caption = #19994#21153#21592
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label2: TLabel object Label2: TLabel
Left = 106 Left = 85
Top = 56 Top = 45
Width = 12 Width = 11
Height = 22 Height = 19
Caption = '-' Caption = '-'
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label3: TLabel object Label3: TLabel
Left = 586 Left = 469
Top = 19 Top = 15
Width = 92 Width = 80
Height = 22 Height = 19
Caption = #23457#26680#29366#24577 Caption = #23457#26680#29366#24577
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object BegDate: TDateTimePicker object BegDate: TDateTimePicker
Left = 126 Left = 101
Top = 15 Top = 12
Width = 156 Width = 125
Height = 30 Height = 27
Date = 40675.464742650460000000 Date = 40675.464742650460000000
Format = 'yyyy-MM-dd' Format = 'yyyy-MM-dd'
Time = 40675.464742650460000000 Time = 40675.464742650460000000
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -463,16 +471,16 @@ object frmYMTFHSQList: TfrmYMTFHSQList
OnChange = BegDateChange OnChange = BegDateChange
end end
object EndDate: TDateTimePicker object EndDate: TDateTimePicker
Left = 126 Left = 101
Top = 52 Top = 42
Width = 157 Width = 125
Height = 30 Height = 27
Date = 40675.464761099540000000 Date = 40675.464761099540000000
Format = 'yyyy-MM-dd' Format = 'yyyy-MM-dd'
Time = 40675.464761099540000000 Time = 40675.464761099540000000
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -482,13 +490,13 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object SHDanWei: TEdit object SHDanWei: TEdit
Tag = 2 Tag = 2
Left = 435 Left = 363
Top = 17 Top = 11
Width = 123 Width = 98
Height = 25 Height = 27
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -498,13 +506,13 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object Salesman: TEdit object Salesman: TEdit
Tag = 2 Tag = 2
Left = 435 Left = 363
Top = 54 Top = 40
Width = 120 Width = 98
Height = 25 Height = 27
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -514,16 +522,16 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object ComboBox1: TComboBox object ComboBox1: TComboBox
Tag = 7 Tag = 7
Left = 679 Left = 555
Top = 15 Top = 10
Width = 126 Width = 101
Height = 30 Height = 27
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ItemHeight = 22 ItemHeight = 19
ItemIndex = 0 ItemIndex = 0
ParentFont = False ParentFont = False
TabOrder = 4 TabOrder = 4
@ -536,7 +544,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object cxSplitter1: TcxSplitter object cxSplitter1: TcxSplitter
Left = 0 Left = 0
Top = 322 Top = 390
Width = 1300 Width = 1300
Height = 8 Height = 8
HotZoneClassName = 'TcxMediaPlayer9Style' HotZoneClassName = 'TcxMediaPlayer9Style'
@ -545,9 +553,9 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
object cxGrid2: TcxGrid object cxGrid2: TcxGrid
Left = 0 Left = 0
Top = 330 Top = 398
Width = 1300 Width = 1300
Height = 312 Height = 250
Align = alBottom Align = alBottom
TabOrder = 4 TabOrder = 4
object Tv2: TcxGridDBTableView object Tv2: TcxGridDBTableView
@ -657,11 +665,18 @@ object frmYMTFHSQList: TfrmYMTFHSQList
Width = 105 Width = 105
end end
object v2Column3: TcxGridDBColumn object v2Column3: TcxGridDBColumn
Caption = #21457#36135#31859#25968 Caption = #21457#36135#38271#24230
DataBinding.FieldName = 'FHMQty' DataBinding.FieldName = 'FHMQty'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Width = 126 Width = 126
end end
object Tv2Column1: TcxGridDBColumn
Caption = #21457#36135#37325#37327
DataBinding.FieldName = 'FHKgQty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 126
end
object v2Column4: TcxGridDBColumn object v2Column4: TcxGridDBColumn
Caption = #36153#29992#21517#31216 Caption = #36153#29992#21517#31216
DataBinding.FieldName = 'FeeName' DataBinding.FieldName = 'FeeName'
@ -680,52 +695,52 @@ object frmYMTFHSQList: TfrmYMTFHSQList
end end
end end
object Panel3: TPanel object Panel3: TPanel
Left = 610 Left = 488
Top = 235 Top = 188
Width = 293 Width = 234
Height = 121 Height = 97
Color = clSkyBlue Color = clSkyBlue
TabOrder = 5 TabOrder = 5
Visible = False Visible = False
object Label25: TLabel object Label25: TLabel
Left = 30 Left = 24
Top = 15 Top = 12
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #20986#24211#31867#22411 Caption = #20986#24211#31867#22411
end end
object btnChk: TButton object btnChk: TButton
Left = 35 Left = 28
Top = 71 Top = 57
Width = 75 Width = 60
Height = 32 Height = 25
Caption = #30830#35748 Caption = #30830#35748
TabOrder = 0 TabOrder = 0
OnClick = btnChkClick OnClick = btnChkClick
end end
object Button3: TButton object Button3: TButton
Left = 200 Left = 160
Top = 71 Top = 57
Width = 75 Width = 60
Height = 32 Height = 25
Caption = #20851#38381 Caption = #20851#38381
TabOrder = 1 TabOrder = 1
OnClick = Button3Click OnClick = Button3Click
end end
object CRType: TComboBox object CRType: TComboBox
Tag = 1 Tag = 1
Left = 99 Left = 79
Top = 10 Top = 8
Width = 174 Width = 139
Height = 30 Height = 27
Style = csDropDownList Style = csDropDownList
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -22 Font.Height = -19
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 22 ItemHeight = 19
ParentFont = False ParentFont = False
TabOrder = 2 TabOrder = 2
Items.Strings = ( Items.Strings = (
@ -882,7 +897,7 @@ object frmYMTFHSQList: TfrmYMTFHSQList
object cxStyleRepository1: TcxStyleRepository object cxStyleRepository1: TcxStyleRepository
Left = 636 Left = 636
Top = 337 Top = 337
PixelsPerInch = 120 PixelsPerInch = 96
object cxStyle1: TcxStyle object cxStyle1: TcxStyle
AssignedValues = [svFont] AssignedValues = [svFont]
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET

View File

@ -110,6 +110,8 @@ type
CRType: TComboBox; CRType: TComboBox;
v1Column6: TcxGridDBColumn; v1Column6: TcxGridDBColumn;
Tv1Column1: TcxGridDBColumn; Tv1Column1: TcxGridDBColumn;
TbAdd2: TToolButton;
Tv2Column1: TcxGridDBColumn;
//RMllPDFExport1: TRMllPDFExport; //RMllPDFExport1: TRMllPDFExport;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
@ -133,6 +135,7 @@ type
procedure ToolButton2Click(Sender: TObject); procedure ToolButton2Click(Sender: TObject);
procedure Button3Click(Sender: TObject); procedure Button3Click(Sender: TObject);
procedure btnChkClick(Sender: TObject); procedure btnChkClick(Sender: TObject);
procedure TbAdd2Click(Sender: TObject);
private private
procedure InitGrid(); procedure InitGrid();
procedure InitSubGrid(); procedure InitSubGrid();
@ -152,7 +155,7 @@ var
implementation implementation
uses uses
U_DataLink, U_YMTFHSQInPut, U_Fun, U_ZDYHelp, U_LabelPrintFun; U_DataLink, U_YMTFHSQInPut, U_Fun, U_ZDYHelp, U_LabelPrintFun, U_YMTFHSQInPut2;
{$R *.dfm} {$R *.dfm}
@ -263,6 +266,15 @@ begin
sql.Add(' and filltime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + ''''); sql.Add(' and filltime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
sql.Add(' and filltime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + ''''); sql.Add(' and filltime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
if Trim(Self.Caption) = '销售发货申请' then
begin
sql.Add(' and CRType in (''销售内销'',''销售外销'')');
end
else if Trim(Self.Caption) = '加工发货登记' then
begin
sql.Add(' and CRType in (''加工出库'',''加工内销'',''加工外销'')');
end;
if ComboBox1.Text = '未审核' then if ComboBox1.Text = '未审核' then
begin begin
SQL.Add(' and isnull(A.Chker,'''')='''' '); SQL.Add(' and isnull(A.Chker,'''')='''' ');
@ -295,7 +307,16 @@ begin
EndDate.DateTime := SGetServerDate10(ADOQueryTemp); EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime; BegDate.DateTime := EndDate.DateTime;
InitGrid(); if Trim(Self.Caption) = '销售发货申请' then
begin
TBAdd.Visible := True;
TBAdd2.Visible := False;
end
else if Trim(Self.Caption) = '加工发货登记' then
begin
TBAdd2.Visible := True;
TBAdd.Visible := False;
end;
end; end;
@ -329,6 +350,9 @@ begin
Application.MessageBox('已生成应收账款不能修改数据!', '提示', 0); Application.MessageBox('已生成应收账款不能修改数据!', '提示', 0);
Exit; Exit;
end; end;
if Trim(Self.Caption) = '销售发货申请' then
begin
try try
frmFHSQInPut := TfrmFHSQInPut.Create(Application); frmFHSQInPut := TfrmFHSQInPut.Create(Application);
with frmFHSQInPut do with frmFHSQInPut do
@ -344,6 +368,26 @@ begin
finally finally
frmFHSQInPut.Free; frmFHSQInPut.Free;
end; end;
end
else if Trim(Self.Caption) = '加工发货登记' then
begin
try
frmFHSQInPut2 := TfrmFHSQInPut2.Create(Application);
with frmFHSQInPut2 do
begin
PState := 1;
FMainId := Trim(Self.Order_Main.fieldbyname('FSID').AsString);
FZZType := trim(self.FZZType);
if ShowModal = 1 then
begin
end;
end;
finally
frmFHSQInPut2.Free;
end;
end;
end; end;
procedure TfrmYMTFHSQList.TBDelClick(Sender: TObject); procedure TfrmYMTFHSQList.TBDelClick(Sender: TObject);
@ -469,6 +513,7 @@ end;
procedure TfrmYMTFHSQList.FormShow(Sender: TObject); procedure TfrmYMTFHSQList.FormShow(Sender: TObject);
begin begin
InitForm(); InitForm();
InitGrid();
end; end;
procedure TfrmYMTFHSQList.CheckBox1Click(Sender: TObject); procedure TfrmYMTFHSQList.CheckBox1Click(Sender: TObject);
@ -682,5 +727,25 @@ begin
end; end;
end; end;
procedure TfrmYMTFHSQList.TbAdd2Click(Sender: TObject);
begin
try
frmFHSQInPut2 := TfrmFHSQInPut2.Create(Application);
with frmFHSQInPut2 do
begin
PState := 0;
FMainId := '';
FZZType := trim(self.FZZType);
if ShowModal = 1 then
begin
end;
end;
finally
frmFHSQInPut2.Free;
end;
InitGrid();
end;
end. end.

View File

@ -1,6 +1,6 @@
object frmYMTJGWCList: TfrmYMTJGWCList object frmYMTJGWCList: TfrmYMTJGWCList
Left = 433 Left = 558
Top = 674 Top = 353
Width = 1370 Width = 1370
Height = 750 Height = 750
Caption = #21152#24037#23436#25104#22238#20179#25968#25454 Caption = #21152#24037#23436#25104#22238#20179#25968#25454
@ -236,7 +236,7 @@ object frmYMTJGWCList: TfrmYMTJGWCList
end end
item item
Kind = skSum Kind = skSum
Column = TV1Qty Column = TV1MQty
end end
item item
Kind = skSum Kind = skSum
@ -353,10 +353,17 @@ object frmYMTJGWCList: TfrmYMTJGWCList
Options.Editing = False Options.Editing = False
Width = 70 Width = 70
end end
object TV1Qty: TcxGridDBColumn object Tv1KgQty: TcxGridDBColumn
Caption = #37325#37327
DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 85
end
object TV1MQty: TcxGridDBColumn
Tag = 2 Tag = 2
Caption = #25968#37327 Caption = #38271#24230
DataBinding.FieldName = 'Qty' DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False Options.Editing = False

View File

@ -71,7 +71,7 @@ type
TV1SPHX: TcxGridDBColumn; TV1SPHX: TcxGridDBColumn;
TV1FactoryName: TcxGridDBColumn; TV1FactoryName: TcxGridDBColumn;
TV1SPName: TcxGridDBColumn; TV1SPName: TcxGridDBColumn;
TV1Qty: TcxGridDBColumn; TV1MQty: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel; cxGrid2Level1: TcxGridLevel;
Label13: TLabel; Label13: TLabel;
MXPrtColor: TEdit; MXPrtColor: TEdit;
@ -87,6 +87,7 @@ type
btn1: TButton; btn1: TButton;
KuWei: TcxButtonEdit; KuWei: TcxButtonEdit;
Tv1KuWei: TcxGridDBColumn; Tv1KuWei: TcxGridDBColumn;
Tv1KgQty: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -377,7 +378,7 @@ begin
with Self.CDS_Main do with Self.CDS_Main do
begin begin
Edit; Edit;
FieldByName('KuWei').Value := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString); KuWei.Text := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString);
end; end;
end; end;
end; end;

View File

@ -14,6 +14,8 @@ object frmYMTRKInPut: TfrmYMTRKInPut
OldCreateOrder = False OldCreateOrder = False
Position = poScreenCenter Position = poScreenCenter
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 12 TextHeight = 12
@ -315,6 +317,7 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Width = 70 Width = 70
end end
object Tv1Price: TcxGridDBColumn object Tv1Price: TcxGridDBColumn
Tag = 2
Caption = #21333#20215 Caption = #21333#20215
DataBinding.FieldName = 'Price' DataBinding.FieldName = 'Price'
PropertiesClassName = 'TcxCurrencyEditProperties' PropertiesClassName = 'TcxCurrencyEditProperties'
@ -577,9 +580,9 @@ object frmYMTRKInPut: TfrmYMTRKInPut
TabOrder = 3 TabOrder = 3
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 1 Left = 1
Top = 1 Top = 71
Width = 257 Width = 257
Height = 557 Height = 487
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
object TvMX: TcxGridDBTableView object TvMX: TcxGridDBTableView
@ -629,28 +632,90 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Caption = #32534#21495 Caption = #32534#21495
DataBinding.FieldName = 'MXID' DataBinding.FieldName = 'MXID'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 99 Width = 99
end end
object TvMXMXQty: TcxGridDBColumn object TvMXMXQty: TcxGridDBColumn
Caption = #25968#37327 Caption = #25968#37327
DataBinding.FieldName = 'MXQty' DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.Sorting = False Options.Sorting = False
Width = 80 Width = 60
end end
object TvMXColumn1: TcxGridDBColumn object TvMXColumn1: TcxGridDBColumn
Caption = #37325#37327 Caption = #37325#37327
DataBinding.FieldName = 'KGQty' DataBinding.FieldName = 'KGQty'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Width = 80 Width = 60
end end
end end
object cxGridLevel2: TcxGridLevel object cxGridLevel2: TcxGridLevel
GridView = TvMX GridView = TvMX
end end
end end
object Panel3: TPanel
Left = 1
Top = 1
Width = 257
Height = 41
Align = alTop
TabOrder = 1
object Label17: TLabel
Left = 6
Top = 12
Width = 36
Height = 12
Caption = #22686#34892#25968
Layout = tlCenter
end
object AddNum: TEdit
Left = 47
Top = 10
Width = 41
Height = 20
TabOrder = 0
OnKeyPress = AddNumKeyPress
end
object BtnQuicklyAdd: TButton
Left = 98
Top = 4
Width = 75
Height = 30
Caption = #24555#36895#22686#34892
TabOrder = 1
OnClick = BtnQuicklyAddClick
end
end
object ToolBar2: TToolBar
Left = 1
Top = 42
Width = 257
Height = 29
ButtonHeight = 30
ButtonWidth = 71
Caption = 'ToolBar2'
Images = DataLink_YXYMT.ThreeImgList
List = True
ShowCaptions = True
TabOrder = 2
object TbAddRow: TToolButton
Left = 0
Top = 2
AutoSize = True
Caption = #22686#21333#34892
ImageIndex = 12
OnClick = TbAddRowClick
end
object TbDeleteRow: TToolButton
Left = 75
Top = 2
AutoSize = True
Caption = #21024#34892
ImageIndex = 13
OnClick = TbDeleteRowClick
end
end
end end
object DataSource3: TDataSource object DataSource3: TDataSource
DataSet = CDS_Sub DataSet = CDS_Sub
@ -700,4 +765,21 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Left = 1170 Left = 1170
Top = 287 Top = 287
end end
object http: TIdHTTP
MaxLineAction = maException
ReadTimeout = 0
AllowCookies = True
ProxyParams.BasicAuthentication = False
ProxyParams.ProxyPort = 0
Request.ContentLength = -1
Request.ContentRangeEnd = 0
Request.ContentRangeStart = 0
Request.ContentType = 'text/html'
Request.Accept = 'text/html, */*'
Request.BasicAuthentication = False
Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
HTTPOptions = [hoForceEncodeParams]
Left = 532
Top = 320
end
end end

View File

@ -22,7 +22,8 @@ uses
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit; dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP;
type type
TfrmYMTRKInPut = class(TForm) TfrmYMTRKInPut = class(TForm)
@ -92,6 +93,14 @@ type
Tv1IsTax: TcxGridDBColumn; Tv1IsTax: TcxGridDBColumn;
Tv1Money: TcxGridDBColumn; Tv1Money: TcxGridDBColumn;
Tv1Price: TcxGridDBColumn; Tv1Price: TcxGridDBColumn;
Panel3: TPanel;
Label17: TLabel;
AddNum: TEdit;
BtnQuicklyAdd: TButton;
ToolBar2: TToolBar;
TbAddRow: TToolButton;
TbDeleteRow: TToolButton;
http: TIdHTTP;
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBAddClick(Sender: TObject); procedure TBAddClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject); procedure TBCloseClick(Sender: TObject);
@ -116,6 +125,12 @@ type
procedure v1Column21PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure v1Column21PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure Tv1PricePropertiesEditValueChanged(Sender: TObject); procedure Tv1PricePropertiesEditValueChanged(Sender: TObject);
procedure Tv1PriceTypePropertiesEditValueChanged(Sender: TObject); procedure Tv1PriceTypePropertiesEditValueChanged(Sender: TObject);
procedure BtnQuicklyAddClick(Sender: TObject);
procedure TbAddRowClick(Sender: TObject);
procedure TbDeleteRowClick(Sender: TObject);
procedure AddNumKeyPress(Sender: TObject; var Key: Char);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
function SaveCKData(): Boolean; function SaveCKData(): Boolean;
@ -123,10 +138,12 @@ type
procedure InitGrid(); procedure InitGrid();
procedure AddRows(); procedure AddRows();
function YFData(): Boolean; function YFData(): Boolean;
function BatchStockIn(MXIDs: string; UserID: string): Boolean;
public public
{ Public declarations } { Public declarations }
FBCId: string; FBCId: string;
PState, CopyInt: Integer; PState, CopyInt: Integer;
FSelectedSPIDs: TStringList; // 用于保存所有选中的SPID
end; end;
var var
@ -135,9 +152,85 @@ var
implementation implementation
uses uses
U_DataLink, U_RTFun, U_ZDYHelp, U_ZdyAttachGYS, U_MLMangeYHSel, U_ZdyAttachKH,U_KuWeiList; U_DataLink, U_RTFun, U_ZDYHelp, U_ZdyAttachGYS, U_MLMangeYHSel, U_ZdyAttachKH,
U_KuWeiList, superobject;
{$R *.dfm} {$R *.dfm}
function TfrmYMTRKInPut.BatchStockIn(MXIDs: string; UserID: string): Boolean;
var
IdHttp: TIdHTTP;
Url, ResponseStr: string;
ResponseStream: TStringStream;
vJson1: ISuperObject;
begin
Result := False;
// 参数验证
if Trim(MXIDs) = '' then
begin
ShowMessage('MXID不能为空');
Exit;
end;
if Trim(UserID) = '' then
begin
ShowMessage('用户ID不能为空');
Exit;
end;
IdHttp := TIdHTTP.Create(nil);
ResponseStream := TStringStream.Create('');
try
try
// GET请求 - 不需要设置ContentType
// 参数直接放在URL中
// 接口URL参数编码在URL中
Url := 'http://www.rightsoft.top/YunXiang/api/YMTCK/batchStockIn?' + 'MXID=' + Trim(MXIDs) + '&userid=' + Trim(UserID);
// ShowMessage(Url);
// 发送GET请求
IdHttp.Get(Url, ResponseStream);
// 获取响应内容
ResponseStr := ResponseStream.DataString;
// 解析JSON响应
vJson1 := SO(ResponseStr);
// ShowMessage(ResponseStr);
if (vJson1.O['code'] <> nil) then
begin
if (vJson1.O['code'].AsInteger = 10000) then
begin
Result := True;
ShowMessage('批量入库成功!');
end
else
begin
// 获取错误信息
if vJson1.O['message'] <> nil then
ShowMessage('批量入库失败: ' + vJson1.O['message'].AsString)
else
ShowMessage('批量入库失败,未知错误');
end;
end
else
begin
ShowMessage('接口返回格式错误');
end;
except
on e: Exception do
begin
ShowMessage('网络请求异常: ' + e.Message);
end;
end;
finally
IdHttp.Free;
ResponseStream.Free;
end;
end;
function TfrmYMTRKInPut.YFData(): Boolean; function TfrmYMTRKInPut.YFData(): Boolean;
var var
CRID, OrdMainId, YFID, FComTaiTou, FCRID, FFactoryName, FFactoryNo: string; CRID, OrdMainId, YFID, FComTaiTou, FCRID, FFactoryName, FFactoryNo: string;
@ -311,17 +404,43 @@ begin
end; end;
procedure TfrmYMTRKInPut.InitMXGrid(SPID: string); procedure TfrmYMTRKInPut.InitMXGrid(SPID: string);
var
FilterSPID: string;
begin begin
with ADOQueryTemp do if not Assigned(CDS_MX) then
Exit;
try
CDS_MX.DisableControls;
try
// 清除现有过滤器
CDS_MX.Filtered := False;
CDS_MX.Filter := '';
// 从CDS_Sub获取SPID并设置过滤条件
FilterSPID := SPID;
if FilterSPID <> '' then
begin begin
Close; CDS_MX.Filter := 'SPID = ''' + FilterSPID + '''';
sql.Clear; CDS_MX.Filtered := True;
sql.Add('select * from YMT_CK_MX where SPID=' + quotedstr(Trim(SPID))); end;
sql.Add(' order by MXID');
Open; // 可选:如果没有过滤条件,定位到第一条记录
if not CDS_MX.Filtered then
CDS_MX.First;
finally
CDS_MX.EnableControls;
end;
except
on E: Exception do
begin
// 可以在这里添加错误处理,比如显示消息
MessageDlg('初始化MXGrid时出错: ' + E.Message, mtError, [mbOK], 0);
end;
end; end;
SCreateCDS20(ADOQueryTemp, CDS_MX);
SInitCDSData20(ADOQueryTemp, CDS_MX);
end; end;
procedure TfrmYMTRKInPut.AddRows(); procedure TfrmYMTRKInPut.AddRows();
@ -363,7 +482,35 @@ begin
end; end;
procedure TfrmYMTRKInPut.InitGrid(); procedure TfrmYMTRKInPut.InitGrid();
var
SPIDList: string;
i: Integer;
begin begin
// 如果有多个选中的SPID构建IN查询条件
if Assigned(FSelectedSPIDs) and (FSelectedSPIDs.Count > 0) then
begin
SPIDList := '';
for i := 0 to FSelectedSPIDs.Count - 1 do
begin
if i > 0 then
SPIDList := SPIDList + ',';
SPIDList := SPIDList + QuotedStr(FSelectedSPIDs[i]);
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add(' select A.* ');
sql.Add(',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)');
sql.Add(' from YMT_CK_CR A');
sql.Add(' where SPID IN (' + SPIDList + ')');
Open;
end;
end
else
begin
// 原有的单个SPID查询逻辑
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
@ -374,12 +521,19 @@ begin
sql.Add(' where SPID=''' + Trim(FBCId) + ''''); sql.Add(' where SPID=''' + Trim(FBCId) + '''');
Open; Open;
end; end;
end;
// 其余代码保持不变
SCreateCDS20(ADOQueryTemp, CDS_Sub); SCreateCDS20(ADOQueryTemp, CDS_Sub);
SInitCDSData20(ADOQueryTemp, CDS_Sub); SInitCDSData20(ADOQueryTemp, CDS_Sub);
if CDS_Sub.IsEmpty then if CDS_Sub.IsEmpty then
Exit; Exit;
// 注意这里可能需要修改因为现在有多个SPID
// 您需要决定如何处理多个SPID的情况
InitMXGrid(CDS_Sub.fieldbyname('SPID').AsString); InitMXGrid(CDS_Sub.fieldbyname('SPID').AsString);
// 其余代码保持不变
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
@ -388,8 +542,10 @@ begin
sql.Add(' and CRQtyFlag=-1'); sql.Add(' and CRQtyFlag=-1');
Open; Open;
end; end;
if not ADOQueryTemp.IsEmpty then if not ADOQueryTemp.IsEmpty then
begin begin
// 禁用相关列
v1Column4.Options.Focusing := False; v1Column4.Options.Focusing := False;
v1Column14.Options.Focusing := False; v1Column14.Options.Focusing := False;
v2Column1.Options.Focusing := False; v2Column1.Options.Focusing := False;
@ -402,6 +558,7 @@ begin
end end
else else
begin begin
// 启用相关列
v1Column4.Options.Focusing := True; v1Column4.Options.Focusing := True;
v1Column14.Options.Focusing := True; v1Column14.Options.Focusing := True;
v2Column1.Options.Focusing := True; v2Column1.Options.Focusing := True;
@ -412,6 +569,56 @@ begin
v1Column11.Options.Focusing := True; v1Column11.Options.Focusing := True;
end; end;
end; end;
//procedure TfrmYMTRKInPut.InitGrid();
//begin
// with ADOQueryTemp do
// begin
// Close;
// sql.Clear;
// sql.Add(' select A.* ');
// sql.Add(',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)');
// sql.Add(' from YMT_CK_CR A');
// sql.Add(' where SPID=''' + Trim(FBCId) + '''');
// Open;
// end;
// SCreateCDS20(ADOQueryTemp, CDS_Sub);
// SInitCDSData20(ADOQueryTemp, CDS_Sub);
// if CDS_Sub.IsEmpty then
// Exit;
//
// InitMXGrid(CDS_Sub.fieldbyname('SPID').AsString);
// with ADOQueryTemp do
// begin
// Close;
// sql.Clear;
// sql.Add('select * from YMT_CK_CR where FZSPID=''' + Trim(CDS_Sub.fieldbyname('SPID').AsString) + '''');
// sql.Add(' and CRQtyFlag=-1');
// Open;
// end;
// if not ADOQueryTemp.IsEmpty then
// begin
// v1Column4.Options.Focusing := False;
// v1Column14.Options.Focusing := False;
// v2Column1.Options.Focusing := False;
// v1Column8.Options.Focusing := False;
// v1Column7.Options.Focusing := False;
// v1Column1.Options.Focusing := False;
// v1Column10.Options.Focusing := False;
// v1Column11.Options.Focusing := False;
// Exit;
// end
// else
// begin
// v1Column4.Options.Focusing := True;
// v1Column14.Options.Focusing := True;
// v2Column1.Options.Focusing := True;
// v1Column8.Options.Focusing := True;
// v1Column7.Options.Focusing := True;
// v1Column1.Options.Focusing := True;
// v1Column10.Options.Focusing := True;
// v1Column11.Options.Focusing := True;
// end;
//end;
procedure TfrmYMTRKInPut.FormClose(Sender: TObject; var Action: TCloseAction); procedure TfrmYMTRKInPut.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
@ -458,16 +665,20 @@ end;
function TfrmYMTRKInPut.SaveCKData(): Boolean; function TfrmYMTRKInPut.SaveCKData(): Boolean;
var var
FCRID, Maxno, FFSPID: string; FCRID, Maxno, MaxMXno, FFSPID, FFMXID: string;
MXIDs: string; // 用于收集需要批量入库的MXID
begin begin
try try
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
CDS_Sub.DisableControls; CDS_Sub.DisableControls;
// 初始化MXIDs每个主表项开始时清空
MXIDs := '';
with CDS_Sub do with CDS_Sub do
begin begin
First; First;
while not eof do while not eof do
begin begin
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
@ -476,6 +687,7 @@ begin
open; open;
end; end;
FFSPID := Trim(ADOQueryTemp.fieldbyname('SPID').AsString); FFSPID := Trim(ADOQueryTemp.fieldbyname('SPID').AsString);
if Trim(FFSPID) = '' then if Trim(FFSPID) = '' then
begin begin
Maxno := Trim(CDS_Sub.fieldbyname('SPID').AsString); Maxno := Trim(CDS_Sub.fieldbyname('SPID').AsString);
@ -503,7 +715,8 @@ begin
begin begin
Edit; Edit;
end; end;
////////////////////////////////////////////////////////////////////////////////////////////
//////////保存主表数据
FieldByName('SPID').Value := Trim(Maxno); FieldByName('SPID').Value := Trim(Maxno);
FieldByName('FZSPID').Value := Trim(Maxno); FieldByName('FZSPID').Value := Trim(Maxno);
FieldByName('CKName').Value := '待检布'; FieldByName('CKName').Value := '待检布';
@ -517,7 +730,7 @@ begin
FieldByName('CRQtyFlag').Value := 1; FieldByName('CRQtyFlag').Value := 1;
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'YMT_CK_CR', 2); RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'YMT_CK_CR', 2);
YFData();
if Trim(FFSPID) = '' then if Trim(FFSPID) = '' then
FieldByName('Filler').Value := Trim(DName) FieldByName('Filler').Value := Trim(DName)
else else
@ -530,10 +743,13 @@ begin
begin begin
FieldByName('QCOrderNo').Value := Trim(CDS_Sub.fieldbyname('OrderNo').AsString); FieldByName('QCOrderNo').Value := Trim(CDS_Sub.fieldbyname('OrderNo').AsString);
end; end;
////////////////////////////////////////////////////////////////////////////////////////////
Post; Post;
end; end;
//////////生成应付数据
YFData();
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
@ -560,19 +776,103 @@ begin
Exit; Exit;
end; end;
///////////////////////////////////////////////////////////////////////////
/// 保存子表
with CDS_MX do
begin
DisableControls; // 禁用CDS_MX控件
try
CDS_MX.Filter := 'SPID = ''' + Trim(Maxno) + '''';
First;
while not Eof do
begin
// 查询明细记录是否存在
with ADOQueryTemp do
begin
Close;
SQL.Clear;
SQL.Add('select * from YMT_CK_MX where MXID=''' + Trim(CDS_MX.fieldbyname('MXID').AsString) + '''');
Open;
end;
FFMXID := Trim(ADOQueryTemp.fieldbyname('MXID').AsString);
if Trim(FFMXID) = '' then
MaxMXno := Trim(CDS_MX.fieldbyname('MXID').AsString)
else
MaxMXno := Trim(FFMXID);
// 准备明细数据
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Add('select * from YMT_CK_MX where MXID=''' + Trim(MaxMXno) + '''');
Open;
if Trim(FFMXID) = '' then
Append
else
Edit;
FieldByName('SPID').Value := Trim(CDS_MX.fieldbyname('SPID').AsString);
FieldByName('MXID').Value := Trim(MaxMXno); // 确保MXID被设置
RTSetSaveDataCDS(ADOQueryCmd, TvMX, CDS_MX, 'YMT_CK_MX', 0);
if Trim(FFMXID) = '' then
FieldByName('Filler').Value := Trim(DName)
else
begin
FieldByName('EditUser').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp);
end;
Post;
end;
// 检查MQty是否大于0如果是则收集MXID
if CDS_MX.FieldByName('MQty').AsFloat > 0 then
begin
if MXIDs <> '' then
MXIDs := MXIDs + ',' + Trim(MaxMXno)
else
MXIDs := Trim(MaxMXno);
end;
Next; // 移动到下一条记录,避免死循环
end;
finally
EnableControls; // 恢复CDS_MX控件状态
end;
end;
Edit; Edit;
FieldByName('SPID').Value := Trim(Maxno); FieldByName('SPID').Value := Trim(Maxno);
Post; Post;
if PState = 0 then
AddRows();
Next; Next;
end; end;
end; end;
CDS_Sub.EnableControls; CDS_Sub.EnableControls;
ADOQueryCmd.Connection.CommitTrans; ADOQueryCmd.Connection.CommitTrans;
// 如果有需要批量入库的记录,调用接口
if MXIDs <> '' then
begin
if not BatchStockIn(MXIDs, Trim(DCode)) then
begin
// 如果接口调用失败,可以选择回滚事务
// ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('批量入库接口调用失败!', '提示', 0);
Exit;
end;
end;
Result := True; Result := True;
except except
Result := False; Result := False;
ADOQueryCmd.Connection.RollbackTrans; ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('保存异常!', '提示', 0); Application.MessageBox('保存异常!', '提示', 0);
end; end;
@ -592,6 +892,19 @@ begin
ReadCxGrid('待检布入库登记', Tv1, '待检布仓库'); ReadCxGrid('待检布入库登记', Tv1, '待检布仓库');
InitGrid(); InitGrid();
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YMT_CK_MX ');
Open;
end;
SCreateCDS20(ADOQueryTemp, CDS_MX);
SInitCDSData20(ADOQueryTemp, CDS_MX);
if PState = 0 then
InitMXGrid(' ')
else
InitMXGrid(Trim(CDS_Sub.fieldbyname('SPID').AsString));
end; end;
procedure TfrmYMTRKInPut.TBDelClick(Sender: TObject); procedure TfrmYMTRKInPut.TBDelClick(Sender: TObject);
@ -649,16 +962,18 @@ begin
// Application.MessageBox('入库时间不能为空!', '提示', 0); // Application.MessageBox('入库时间不能为空!', '提示', 0);
// Exit; // Exit;
// end; // end;
// if CDS_Sub.Locate('CRType', null, []) = True then
// begin if CDS_Sub.Locate('CRType', null, []) = True then
// Application.MessageBox('入库类型不能为空!', '提示', 0); begin
// Exit; Application.MessageBox('入库类型不能为空!', '提示', 0);
// end; Exit;
// if CDS_Sub.Locate('SPName', null, []) = True then end;
// begin if CDS_Sub.Locate('SPName', null, []) = True then
// Application.MessageBox('品名不能为空!', '提示', 0); begin
// Exit; Application.MessageBox('品名不能为空!', '提示', 0);
// end; Exit;
end;
// if CDS_Sub.Locate('OrderNo', null, []) = True then // if CDS_Sub.Locate('OrderNo', null, []) = True then
// begin // begin
// Application.MessageBox('订单号不能为空!', '提示', 0); // Application.MessageBox('订单号不能为空!', '提示', 0);
@ -669,14 +984,16 @@ begin
// Application.MessageBox('存放工厂不能为空!', '提示', 0); // Application.MessageBox('存放工厂不能为空!', '提示', 0);
// Exit; // Exit;
// end; // end;
// if trim(CDS_Sub.fieldbyname('CRType').AsString) <> '客户退货' then if (trim(CDS_Sub.fieldbyname('CRType').AsString) <> '期初入库') and (trim(CDS_Sub.fieldbyname('CRType').AsString) <> '客户退货') then
// begin begin
// if CDS_Sub.Locate('FactoryName', null, []) = True then if CDS_Sub.Locate('FactoryName', null, []) = True then
// begin begin
// Application.MessageBox('加工厂不能为空!', '提示', 0); Application.MessageBox('供应商不能为空!', '提示', 0);
// Exit; Exit;
// end; end;
// end; end;
// if CDS_Sub.Locate('PiQty', null, []) = True then // if CDS_Sub.Locate('PiQty', null, []) = True then
// begin // begin
// Application.MessageBox('匹数不能为空!', '提示', 0); // Application.MessageBox('匹数不能为空!', '提示', 0);
@ -1082,5 +1399,151 @@ begin
end; end;
end; end;
procedure TfrmYMTRKInPut.BtnQuicklyAddClick(Sender: TObject);
var
Num, i: Integer;
MaxNo, MMXID, SPID: string;
begin
Num := StrToInt(Trim(AddNum.Text));
SPID := Trim(CDS_Sub.fieldbyname('SPID').AsString);
if SPID = '' then
Exit;
try
ADOQueryCmd.Connection.BeginTrans;
for i := 1 to Num do
begin
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
MMXID := Trim(MaxNo);
with CDS_MX do
begin
Append;
FieldByName('MXID').Value := MMXID;
FieldByName('SPID').Value := SPID;
FieldByName('MQty').Value := '0';
FieldByName('KGQty').Value := '0';
Post;
end;
end;
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('添加失败!', '提示', 0);
end;
end;
procedure TfrmYMTRKInPut.TbAddRowClick(Sender: TObject);
var
MaxNo, MMXID, SPID: string;
begin
SPID := Trim(CDS_Sub.fieldbyname('SPID').AsString);
if SPID = '' then
Exit;
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
MMXID := Trim(MaxNo);
with CDS_MX do
begin
if IsEmpty = False then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('MXID').Value := MMXID;
FieldByName('SPID').Value := SPID;
FieldByName('MQty').Value := '0';
FieldByName('KGQty').Value := '0';
Post;
end;
end;
procedure TfrmYMTRKInPut.TbDeleteRowClick(Sender: TObject);
var
Bookmark: TBookmark;
begin
if CDS_MX.IsEmpty then
begin
Application.MessageBox('当前没有可删除的记录!', '提示', MB_ICONWARNING);
Exit;
end;
if Trim(CDS_MX.fieldbyname('MXID').AsString) <> '' then
begin
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YMT_FHSQ_Sub where MXID=''' + Trim(CDS_MX.fieldbyname('MXID').AsString) + '''');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
Application.MessageBox('已有出库申请记录,不能删除!', '提示', 0);
Exit;
end;
end;
if Application.MessageBox('确定要删除当前行吗?', '确认删除', MB_ICONQUESTION + MB_YESNO) <> IDYES then
Exit;
// 记录当前行,删除后尝试回到附近位置
Bookmark := CDS_MX.GetBookmark;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('delete YMT_CK_MX where MXID=' + quotedstr(Trim(CDS_MX.FieldByName('MXID').AsString)));
ExecSQL;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('delete YMT_CK_CR where FromMXID=' + quotedstr(Trim(CDS_MX.FieldByName('MXID').AsString)));
ExecSQL;
end;
try
CDS_MX.Delete;
finally
if CDS_MX.BookmarkValid(Bookmark) then
CDS_MX.GotoBookmark(Bookmark);
CDS_MX.FreeBookmark(Bookmark);
end;
end;
procedure TfrmYMTRKInPut.AddNumKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
BtnQuicklyAdd.Click;
end;
procedure TfrmYMTRKInPut.FormDestroy(Sender: TObject);
begin
if Assigned(FSelectedSPIDs) then
FSelectedSPIDs.Free;
inherited;
end;
procedure TfrmYMTRKInPut.FormCreate(Sender: TObject);
begin
FSelectedSPIDs := TStringList.Create;
end;
end. end.

View File

@ -1,13 +1,13 @@
object frmYMTRKList: TfrmYMTRKList object frmYMTRKList: TfrmYMTRKList
Left = 267 Left = 206
Top = 100 Top = 367
Width = 1470 Width = 1470
Height = 823 Height = 823
Caption = #38754#26009#22238#20179#30331#35760 Caption = #38754#26009#22238#20179#30331#35760
Color = clBtnFace Color = clBtnFace
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -12
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
OldCreateOrder = False OldCreateOrder = False
@ -15,8 +15,8 @@ object frmYMTRKList: TfrmYMTRKList
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 120 PixelsPerInch = 96
TextHeight = 15 TextHeight = 12
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
@ -123,118 +123,118 @@ object frmYMTRKList: TfrmYMTRKList
Left = 0 Left = 0
Top = 33 Top = 33
Width = 1462 Width = 1462
Height = 90 Height = 72
Align = alTop Align = alTop
BevelInner = bvRaised BevelInner = bvRaised
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clSkyBlue Color = clSkyBlue
TabOrder = 1 TabOrder = 1
object Label1: TLabel object Label1: TLabel
Left = 35 Left = 28
Top = 15 Top = 12
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #26597#35810#26102#38388 Caption = #26597#35810#26102#38388
end end
object Label2: TLabel object Label2: TLabel
Left = 80 Left = 64
Top = 45 Top = 36
Width = 15 Width = 12
Height = 15 Height = 12
Caption = #33267 Caption = #33267
end end
object Label3: TLabel object Label3: TLabel
Left = 398 Left = 318
Top = 15 Top = 12
Width = 30 Width = 24
Height = 15 Height = 12
Caption = #21697#21517 Caption = #21697#21517
end end
object Label4: TLabel object Label4: TLabel
Left = 544 Left = 435
Top = 15 Top = 12
Width = 45 Width = 36
Height = 15 Height = 12
Caption = #21152#24037#21378 Caption = #21152#24037#21378
end end
object Label5: TLabel object Label5: TLabel
Left = 223 Left = 178
Top = 15 Top = 12
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #20837#24211#21333#21495 Caption = #20837#24211#21333#21495
end end
object Label8: TLabel object Label8: TLabel
Left = 398 Left = 318
Top = 45 Top = 36
Width = 30 Width = 24
Height = 15 Height = 12
Caption = #35268#26684 Caption = #35268#26684
end end
object Label6: TLabel object Label6: TLabel
Left = 544 Left = 435
Top = 45 Top = 36
Width = 46 Width = 36
Height = 15 Height = 12
Caption = #25104' '#20998 Caption = #25104' '#20998
end end
object Label7: TLabel object Label7: TLabel
Left = 701 Left = 561
Top = 45 Top = 36
Width = 61 Width = 48
Height = 15 Height = 12
Caption = #35746' '#21333' '#21495 Caption = #35746' '#21333' '#21495
end end
object Label9: TLabel object Label9: TLabel
Left = 701 Left = 561
Top = 15 Top = 12
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #23384#25918#24037#21378 Caption = #23384#25918#24037#21378
end end
object Label12: TLabel object Label12: TLabel
Left = 223 Left = 178
Top = 45 Top = 36
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #20837#24211#31867#22411 Caption = #20837#24211#31867#22411
end end
object Label11: TLabel object Label11: TLabel
Left = 1029 Left = 823
Top = 46 Top = 37
Width = 60 Width = 48
Height = 15 Height = 12
Caption = #26579#21378#32568#21495 Caption = #26579#21378#32568#21495
end end
object Label13: TLabel object Label13: TLabel
Left = 880 Left = 704
Top = 15 Top = 12
Width = 30 Width = 24
Height = 15 Height = 12
Caption = #39068#33394 Caption = #39068#33394
end end
object Label15: TLabel object Label15: TLabel
Left = 880 Left = 704
Top = 46 Top = 37
Width = 30 Width = 24
Height = 15 Height = 12
Caption = #33457#22411 Caption = #33457#22411
end end
object BegDate: TDateTimePicker object BegDate: TDateTimePicker
Left = 96 Left = 77
Top = 11 Top = 9
Width = 109 Width = 87
Height = 23 Height = 20
Date = 40768.458268587970000000 Date = 40768.458268587970000000
Time = 40768.458268587970000000 Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 0 TabOrder = 0
end end
object EndDate: TDateTimePicker object EndDate: TDateTimePicker
Left = 96 Left = 77
Top = 40 Top = 32
Width = 109 Width = 87
Height = 23 Height = 20
Date = 40768.458268587970000000 Date = 40768.458268587970000000
Time = 40768.458268587970000000 Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
@ -242,9 +242,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPName: TEdit object SPName: TEdit
Tag = 2 Tag = 2
Left = 431 Left = 345
Top = 11 Top = 9
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 2 TabOrder = 2
@ -252,9 +252,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object FactoryName: TEdit object FactoryName: TEdit
Tag = 2 Tag = 2
Left = 590 Left = 472
Top = 11 Top = 9
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 3 TabOrder = 3
@ -262,9 +262,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPID: TEdit object SPID: TEdit
Tag = 2 Tag = 2
Left = 285 Left = 228
Top = 11 Top = 9
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 1 TabOrder = 1
@ -272,9 +272,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPSpec: TEdit object SPSpec: TEdit
Tag = 2 Tag = 2
Left = 431 Left = 345
Top = 40 Top = 32
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 9 TabOrder = 9
@ -282,9 +282,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPCF: TEdit object SPCF: TEdit
Tag = 2 Tag = 2
Left = 590 Left = 472
Top = 40 Top = 32
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 10 TabOrder = 10
@ -292,9 +292,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object OrderNo: TEdit object OrderNo: TEdit
Tag = 2 Tag = 2
Left = 765 Left = 612
Top = 41 Top = 33
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 11 TabOrder = 11
@ -302,9 +302,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object ToFactoryName: TEdit object ToFactoryName: TEdit
Tag = 2 Tag = 2
Left = 765 Left = 612
Top = 11 Top = 9
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 4 TabOrder = 4
@ -312,13 +312,13 @@ object frmYMTRKList: TfrmYMTRKList
end end
object CRType: TComboBox object CRType: TComboBox
Tag = 2 Tag = 2
Left = 285 Left = 228
Top = 40 Top = 32
Width = 100 Width = 80
Height = 23 Height = 20
Style = csDropDownList Style = csDropDownList
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 15 ItemHeight = 12
TabOrder = 8 TabOrder = 8
OnChange = TBFindClick OnChange = TBFindClick
Items.Strings = ( Items.Strings = (
@ -333,9 +333,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object RCGangNo: TEdit object RCGangNo: TEdit
Tag = 2 Tag = 2
Left = 1093 Left = 874
Top = 43 Top = 34
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 12 TabOrder = 12
@ -343,9 +343,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPColor: TEdit object SPColor: TEdit
Tag = 2 Tag = 2
Left = 911 Left = 729
Top = 11 Top = 9
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 5 TabOrder = 5
@ -353,9 +353,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object SPHX: TEdit object SPHX: TEdit
Tag = 2 Tag = 2
Left = 911 Left = 729
Top = 43 Top = 34
Width = 100 Width = 80
Height = 20 Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861 ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 6 TabOrder = 6
@ -364,9 +364,9 @@ object frmYMTRKList: TfrmYMTRKList
end end
object cxGrid2: TcxGrid object cxGrid2: TcxGrid
Left = 0 Left = 0
Top = 123 Top = 105
Width = 1107 Width = 1178
Height = 663 Height = 687
Align = alClient Align = alClient
TabOrder = 2 TabOrder = 2
object Tv1: TcxGridDBTableView object Tv1: TcxGridDBTableView
@ -660,21 +660,22 @@ object frmYMTRKList: TfrmYMTRKList
end end
end end
object Panel2: TPanel object Panel2: TPanel
Left = 1107 Left = 1178
Top = 123 Top = 105
Width = 355 Width = 284
Height = 663 Height = 687
Align = alRight Align = alRight
Caption = 'Panel2' Caption = 'Panel2'
TabOrder = 3 TabOrder = 3
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 1 Left = 1
Top = 82 Top = 71
Width = 353 Width = 282
Height = 580 Height = 615
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
object TvMX: TcxGridDBTableView object TvMX: TcxGridDBTableView
PopupMenu = pm1
Navigator.Buttons.CustomButtons = <> Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False Navigator.Buttons.Delete.Enabled = False
Navigator.Buttons.Delete.Visible = False Navigator.Buttons.Delete.Visible = False
@ -728,6 +729,7 @@ object frmYMTRKList: TfrmYMTRKList
Caption = #32534#21495 Caption = #32534#21495
DataBinding.FieldName = 'MXID' DataBinding.FieldName = 'MXID'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 80 Width = 80
end end
object TvMXMXQty: TcxGridDBColumn object TvMXMXQty: TcxGridDBColumn
@ -735,15 +737,15 @@ object frmYMTRKList: TfrmYMTRKList
DataBinding.FieldName = 'MQty' DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False
Options.Sorting = False Options.Sorting = False
Width = 80 Width = 63
end end
object TvMXColumn1: TcxGridDBColumn object TvMXColumn1: TcxGridDBColumn
Caption = #37325#37327 Caption = #37325#37327
DataBinding.FieldName = 'KgQty' DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Width = 80 Options.Editing = False
Width = 63
end end
end end
object cxGridLevel2: TcxGridLevel object cxGridLevel2: TcxGridLevel
@ -752,16 +754,17 @@ object frmYMTRKList: TfrmYMTRKList
end end
object ToolBar2: TToolBar object ToolBar2: TToolBar
Left = 1 Left = 1
Top = 53 Top = 42
Width = 353 Width = 282
Height = 29 Height = 29
ButtonHeight = 30 ButtonHeight = 30
ButtonWidth = 80 ButtonWidth = 71
Caption = 'ToolBar2' Caption = 'ToolBar2'
Images = DataLink_YXYMT.ThreeImgList Images = DataLink_YXYMT.ThreeImgList
List = True List = True
ShowCaptions = True ShowCaptions = True
TabOrder = 1 TabOrder = 1
Visible = False
object TbAddRow: TToolButton object TbAddRow: TToolButton
Left = 0 Left = 0
Top = 2 Top = 2
@ -771,7 +774,7 @@ object frmYMTRKList: TfrmYMTRKList
OnClick = TbAddRowClick OnClick = TbAddRowClick
end end
object TbDeleteRow: TToolButton object TbDeleteRow: TToolButton
Left = 84 Left = 75
Top = 2 Top = 2
AutoSize = True AutoSize = True
Caption = #21024#34892 Caption = #21024#34892
@ -782,30 +785,31 @@ object frmYMTRKList: TfrmYMTRKList
object Panel3: TPanel object Panel3: TPanel
Left = 1 Left = 1
Top = 1 Top = 1
Width = 353 Width = 282
Height = 52 Height = 41
Align = alTop Align = alTop
TabOrder = 2 TabOrder = 2
Visible = False
object Label17: TLabel object Label17: TLabel
Left = 8 Left = 6
Top = 15 Top = 12
Width = 45 Width = 36
Height = 15 Height = 12
Caption = #22686#34892#25968 Caption = #22686#34892#25968
Layout = tlCenter Layout = tlCenter
end end
object AddNum: TEdit object AddNum: TEdit
Left = 59 Left = 47
Top = 13 Top = 10
Width = 51 Width = 41
Height = 20 Height = 20
TabOrder = 0 TabOrder = 0
end end
object Button1: TButton object Button1: TButton
Left = 123 Left = 98
Top = 5 Top = 4
Width = 93 Width = 75
Height = 38 Height = 30
Caption = #24555#36895#22686#34892 Caption = #24555#36895#22686#34892
TabOrder = 1 TabOrder = 1
OnClick = Button1Click OnClick = Button1Click
@ -813,41 +817,41 @@ object frmYMTRKList: TfrmYMTRKList
end end
end end
object Panel4: TPanel object Panel4: TPanel
Left = 684 Left = 547
Top = 175 Top = 140
Width = 293 Width = 235
Height = 156 Height = 125
Color = clSkyBlue Color = clSkyBlue
TabOrder = 4 TabOrder = 4
Visible = False Visible = False
object Label25: TLabel object Label25: TLabel
Left = 48 Left = 38
Top = 43 Top = 34
Width = 30 Width = 24
Height = 15 Height = 12
Caption = #24211#20301 Caption = #24211#20301
end end
object btnChk: TButton object btnChk: TButton
Left = 35 Left = 28
Top = 101 Top = 81
Width = 75 Width = 60
Height = 32 Height = 25
Caption = #30830#35748 Caption = #30830#35748
TabOrder = 0 TabOrder = 0
OnClick = btnChkClick OnClick = btnChkClick
end end
object btn1: TButton object btn1: TButton
Left = 200 Left = 160
Top = 100 Top = 80
Width = 75 Width = 60
Height = 31 Height = 25
Caption = #20851#38381 Caption = #20851#38381
TabOrder = 1 TabOrder = 1
OnClick = btn1Click OnClick = btn1Click
end end
object KuWei: TcxButtonEdit object KuWei: TcxButtonEdit
Left = 94 Left = 75
Top = 34 Top = 27
ParentFont = False ParentFont = False
Properties.Buttons = < Properties.Buttons = <
item item
@ -857,12 +861,69 @@ object frmYMTRKList: TfrmYMTRKList
Properties.OnButtonClick = KuWeiPropertiesButtonClick Properties.OnButtonClick = KuWeiPropertiesButtonClick
Style.Font.Charset = GB2312_CHARSET Style.Font.Charset = GB2312_CHARSET
Style.Font.Color = clWindowText Style.Font.Color = clWindowText
Style.Font.Height = -23 Style.Font.Height = -19
Style.Font.Name = #23435#20307 Style.Font.Name = #23435#20307
Style.Font.Style = [fsBold] Style.Font.Style = [fsBold]
Style.IsFontAssigned = True Style.IsFontAssigned = True
TabOrder = 2 TabOrder = 2
Width = 151 Width = 121
end
end
object Panel5: TPanel
Left = 1203
Top = 300
Width = 235
Height = 141
Color = clSkyBlue
TabOrder = 5
Visible = False
object Label10: TLabel
Left = 38
Top = 18
Width = 24
Height = 12
Caption = #25968#37327
end
object Label14: TLabel
Left = 38
Top = 58
Width = 24
Height = 12
Caption = #37325#37327
end
object Sure: TButton
Left = 28
Top = 97
Width = 60
Height = 25
Caption = #30830#35748
TabOrder = 0
OnClick = SureClick
end
object Quit: TButton
Left = 160
Top = 96
Width = 60
Height = 25
Caption = #20851#38381
TabOrder = 1
OnClick = QuitClick
end
object MQty: TEdit
Left = 72
Top = 14
Width = 121
Height = 20
TabOrder = 2
Text = '0'
end
object KgQty: TEdit
Left = 72
Top = 54
Width = 121
Height = 20
TabOrder = 3
Text = '0'
end end
end end
object ADOQueryCmd: TADOQuery object ADOQueryCmd: TADOQuery
@ -995,4 +1056,29 @@ object frmYMTRKList: TfrmYMTRKList
Left = 832 Left = 832
Top = 316 Top = 316
end end
object pm1: TPopupMenu
Left = 676
Top = 442
object MenuItem1: TMenuItem
Caption = #25286#25209
OnClick = MenuItem1Click
end
end
object http: TIdHTTP
MaxLineAction = maException
ReadTimeout = 0
AllowCookies = True
ProxyParams.BasicAuthentication = False
ProxyParams.ProxyPort = 0
Request.ContentLength = -1
Request.ContentRangeEnd = 0
Request.ContentRangeStart = 0
Request.ContentType = 'text/html'
Request.Accept = 'text/html, */*'
Request.BasicAuthentication = False
Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
HTTPOptions = [hoForceEncodeParams]
Left = 532
Top = 320
end
end end

View File

@ -25,7 +25,7 @@ uses
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit, dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit,
cxMaskEdit; cxMaskEdit, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;
type type
TfrmYMTRKList = class(TForm) TfrmYMTRKList = class(TForm)
@ -135,6 +135,16 @@ type
Tv1Column3: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn;
TvMXColumn1: TcxGridDBColumn; TvMXColumn1: TcxGridDBColumn;
Tv1Column4: TcxGridDBColumn; Tv1Column4: TcxGridDBColumn;
pm1: TPopupMenu;
MenuItem1: TMenuItem;
Panel5: TPanel;
Label10: TLabel;
Sure: TButton;
Quit: TButton;
Label14: TLabel;
MQty: TEdit;
KgQty: TEdit;
http: TIdHTTP;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -163,11 +173,16 @@ type
procedure KuWeiPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure KuWeiPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure btnChkClick(Sender: TObject); procedure btnChkClick(Sender: TObject);
procedure btn1Click(Sender: TObject); procedure btn1Click(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure SureClick(Sender: TObject);
procedure QuitClick(Sender: TObject);
private private
canshu1, canshu2: string; canshu1, canshu2: string;
procedure InitGrid(); procedure InitGrid();
procedure InitImage(fsubID: string); procedure InitImage(fsubID: string);
procedure InitMXGrid(SPID: string); procedure InitMXGrid(SPID: string);
function BatchStockIn(MXIDs: string; UserID: string): Boolean;
{ Private declarations } { Private declarations }
public public
{ Public declarations } { Public declarations }
@ -179,10 +194,84 @@ var
implementation implementation
uses uses
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun, U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun, U_ZDYHelp,
U_ZDYHelp, U_KuWeiList; U_KuWeiList, superobject;
{$R *.dfm} {$R *.dfm}
function TfrmYMTRKList.BatchStockIn(MXIDs: string; UserID: string): Boolean;
var
IdHttp: TIdHTTP;
Url, ResponseStr: string;
ResponseStream: TStringStream;
vJson1: ISuperObject;
begin
Result := False;
// 参数验证
if Trim(MXIDs) = '' then
begin
ShowMessage('MXID不能为空');
Exit;
end;
if Trim(UserID) = '' then
begin
ShowMessage('用户ID不能为空');
Exit;
end;
IdHttp := TIdHTTP.Create(nil);
ResponseStream := TStringStream.Create('');
try
try
// GET请求 - 不需要设置ContentType
// 参数直接放在URL中
// 接口URL参数编码在URL中
Url := 'http://www.rightsoft.top/YunXiang/api/YMTCK/batchStockIn?' + 'MXID=' + Trim(MXIDs) + '&userid=' + Trim(UserID);
// ShowMessage(Url);
// 发送GET请求
IdHttp.Get(Url, ResponseStream);
// 获取响应内容
ResponseStr := ResponseStream.DataString;
// 解析JSON响应
vJson1 := SO(ResponseStr);
// ShowMessage(ResponseStr);
if (vJson1.O['code'] <> nil) then
begin
if (vJson1.O['code'].AsInteger = 10000) then
begin
Result := True;
ShowMessage('批量入库成功!');
end
else
begin
// 获取错误信息
if vJson1.O['message'] <> nil then
ShowMessage('批量入库失败: ' + vJson1.O['message'].AsString)
else
ShowMessage('批量入库失败,未知错误');
end;
end
else
begin
ShowMessage('接口返回格式错误');
end;
except
on e: Exception do
begin
ShowMessage('网络请求异常: ' + e.Message);
end;
end;
finally
IdHttp.Free;
ResponseStream.Free;
end;
end;
procedure TfrmYMTRKList.InitMXGrid(SPID: string); procedure TfrmYMTRKList.InitMXGrid(SPID: string);
begin begin
with ADOQueryTemp do with ADOQueryTemp do
@ -349,6 +438,7 @@ begin
Application.MessageBox('已有出库记录,不能删除!', '提示', 0); Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
Exit; Exit;
end; end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit; Exit;
try try
@ -392,29 +482,111 @@ begin
end; end;
end; end;
//procedure TfrmYMTRKList.TBEditClick(Sender: TObject);
//var
// OldSPID: string; // 用于保存当前行的SPID
//begin
// if CDS_Main.IsEmpty then
// Exit;
//
// if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
// begin
// Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
// Exit;
// end;
// try
// OldSPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
// frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
// with frmYMTRKInPut do
// begin
// PState := 1;
// FBCId := OldSPID;
// TBDel.Visible := False;
// TBAdd.Visible := False;
// if ShowModal = 1 then
// begin
//
// end;
// end;
// InitGrid();
// // 重新定位到原来的行
// if not CDS_Main.Locate('SPID', OldSPID, []) then
// begin
// // 如果找不到原记录(如被删除),则定位到第一条记录
// if not CDS_Main.IsEmpty then
// CDS_Main.First;
// end;
// finally
// frmYMTRKInPut.Free;
// end;
//end;
procedure TfrmYMTRKList.TBEditClick(Sender: TObject); procedure TfrmYMTRKList.TBEditClick(Sender: TObject);
var var
OldSPID: string; // 用于保存当前行的SPID OldSPID: string; // 用于保存当前行的SPID
SelectedSPIDs: TStringList; // 用于保存所有选中的SPID
begin begin
if CDS_Main.IsEmpty then if CDS_Main.IsEmpty then
Exit; Exit;
if Trim(CDS_Main.fieldbyname('CRType').AsString) = 'Æ½ÒÆÈë¿â' then
// 创建字符串列表保存所有选中的SPID
SelectedSPIDs := TStringList.Create;
try
// 检查是否有选中的行
if CDS_Main.Locate('SSel', True, []) = True then
begin
// 遍历数据集收集所有选中的SPID
CDS_Main.DisableControls;
try
CDS_Main.First;
while not CDS_Main.Eof do
begin
if CDS_Main.FieldByName('SSel').AsBoolean then
begin
// 检查是否为平移入库
if Trim(CDS_Main.FieldByName('CRType').AsString) = '平移入库' then
begin
Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
Exit; // 直接Exit不需要手动释放SelectedSPIDsfinally块会处理
end;
SelectedSPIDs.Add(Trim(CDS_Main.FieldByName('SPID').AsString));
end;
CDS_Main.Next;
end;
finally
CDS_Main.EnableControls;
end;
end
else
begin
// 没有勾选任何行,只处理当前行
// 检查当前行是否为平移入库
if Trim(CDS_Main.FieldByName('CRType').AsString) = '平移入库' then
begin begin
Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0); Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
Exit; Exit;
end; end;
SelectedSPIDs.Add(Trim(CDS_Main.FieldByName('SPID').AsString));
end;
// 保存当前行的SPID用于后续定位
OldSPID := Trim(CDS_Main.FieldByName('SPID').AsString);
try try
OldSPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
frmYMTRKInPut := TfrmYMTRKInPut.Create(Application); frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
with frmYMTRKInPut do with frmYMTRKInPut do
begin begin
PState := 1; PState := 1;
FBCId := OldSPID; FBCId := OldSPID; // 保持原有单个SPID的兼容性
// 传递所有选中的SPID
FSelectedSPIDs.Assign(SelectedSPIDs);
TBDel.Visible := False; TBDel.Visible := False;
TBAdd.Visible := False; TBAdd.Visible := False;
if ShowModal = 1 then if ShowModal = 1 then
begin begin
// 处理返回结果
end; end;
end; end;
InitGrid(); InitGrid();
@ -428,6 +600,9 @@ begin
finally finally
frmYMTRKInPut.Free; frmYMTRKInPut.Free;
end; end;
finally
SelectedSPIDs.Free;
end;
end; end;
procedure TfrmYMTRKList.SPIDChange(Sender: TObject); procedure TfrmYMTRKList.SPIDChange(Sender: TObject);
@ -511,13 +686,6 @@ procedure TfrmYMTRKList.TbAddRowClick(Sender: TObject);
var var
MaxNo, MMXID, SPID: string; MaxNo, MMXID, SPID: string;
begin begin
// with CDS_MX do
// begin
// Append;
// FieldByName('MXID').Value := '';
// FieldByName('MXQty').Value := 0;
// Post;
// end;
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin begin
Application.MessageBox('取最大号失败!', '提示', 0); Application.MessageBox('取最大号失败!', '提示', 0);
@ -627,7 +795,7 @@ begin
with Self.CDS_Main do with Self.CDS_Main do
begin begin
Edit; Edit;
FieldByName('KuWei').Value := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString); KuWei.Text := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString);
end; end;
end; end;
end; end;
@ -678,5 +846,102 @@ begin
Panel4.Visible := False; Panel4.Visible := False;
end; end;
procedure TfrmYMTRKList.MenuItem1Click(Sender: TObject);
begin
if CDS_MX.IsEmpty then
exit;
Panel5.Visible := True;
end;
//执行拆批
procedure TfrmYMTRKList.SureClick(Sender: TObject);
var
MaxNo, MMXID, SPID, MXIDs: string;
fMQty, fKGQty: Double;
begin
// 开始事务
ADOQueryCmd.Connection.BeginTrans;
try
// 验证输入数值
try
fMQty := StrToFloat(Trim(MQty.Text));
fKGQty := StrToFloat(Trim(KGQty.Text));
except
Application.MessageBox('请输入有效的数值!', '提示', 0);
ADOQueryCmd.Connection.RollbackTrans; // 回滚事务
Exit;
end;
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
ADOQueryCmd.Connection.RollbackTrans; // 回滚事务
Exit;
end;
MMXID := Trim(MaxNo);
SPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
// 增加拆出了新批
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('insert into YMT_CK_MX (MXID,SPID,MQty,KGQty,Filler)');
sql.Add('values(' + quotedstr(MMXID));
sql.Add(',' + quotedstr(Trim(SPID)));
sql.Add(',' + FloatToStr(fMQty)); // 使用数值,不加引号
sql.Add(',' + FloatToStr(fKGQty)); // 使用数值,不加引号
sql.Add(',' + quotedstr(Trim(DName)));
sql.Add(')');
ExecSQL;
end;
// 更新当前数量和重量
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update YMT_CK_MX SET MQty = ' + FloatToStr(CDS_MX.FieldByName('MQty').AsFloat - fMQty));
sql.Add(', KGQty = ' + FloatToStr(CDS_MX.FieldByName('KGQty').AsFloat - fKGQty));
sql.Add('where MXID=' + quotedstr(trim(CDS_MX.fieldbyname('MXID').AsString)));
execsql;
end;
MXIDs := MMXID + ',' + trim(CDS_MX.fieldbyname('MXID').AsString);
// 提交事务 - 所有操作成功完成
ADOQueryCmd.Connection.CommitTrans;
// 调用接口,将拆批数据入库
if MXIDs <> '' then
begin
if not BatchStockIn(MXIDs, Trim(DCode)) then
begin
Application.MessageBox('批量入库接口调用失败!', '提示', 0);
Exit;
end;
end;
InitMXGrid(SPID);
Panel5.Visible := False;
application.MessageBox('拆批成功!', '提示信息');
except
on E: Exception do
begin
// 回滚事务 - 发生任何异常都回滚
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(PChar('拆批失败!错误:' + E.Message), '提示信息', 0);
end;
end;
end;
procedure TfrmYMTRKList.QuitClick(Sender: TObject);
begin
Panel5.Visible := False;
end;
end. end.

View File

@ -0,0 +1,799 @@
object frmStockList: TfrmStockList
Left = -1
Top = 580
Width = 1470
Height = 823
Caption = #24211#23384#26597#35810
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 1462
Height = 33
ButtonHeight = 30
ButtonWidth = 107
Caption = 'ToolBar1'
Color = clSkyBlue
Flat = True
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_YXYMT.ThreeImgList
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 0
OnClick = TBRafreshClick
end
object TBFind: TToolButton
Left = 63
Top = 0
AutoSize = True
Caption = #36807#28388
ImageIndex = 20
OnClick = TBFindClick
end
object TbEditKW: TToolButton
Left = 126
Top = 0
AutoSize = True
Caption = #25209#37327#20462#25913#24211#20301
ImageIndex = 11
OnClick = TbEditKWClick
end
object TBExport: TToolButton
Left = 237
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 68
OnClick = TBExportClick
end
object TBClose: TToolButton
Left = 300
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 21
OnClick = TBCloseClick
end
end
object Panel1: TPanel
Left = 0
Top = 33
Width = 1462
Height = 72
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
object Label1: TLabel
Left = 28
Top = 12
Width = 48
Height = 12
Caption = #26597#35810#26102#38388
end
object Label2: TLabel
Left = 64
Top = 36
Width = 12
Height = 12
Caption = #33267
end
object Label3: TLabel
Left = 318
Top = 12
Width = 24
Height = 12
Caption = #21697#21517
end
object Label4: TLabel
Left = 435
Top = 12
Width = 36
Height = 12
Caption = #21152#24037#21378
end
object Label5: TLabel
Left = 178
Top = 12
Width = 48
Height = 12
Caption = #20837#24211#21333#21495
end
object Label8: TLabel
Left = 318
Top = 36
Width = 24
Height = 12
Caption = #35268#26684
end
object Label6: TLabel
Left = 435
Top = 36
Width = 36
Height = 12
Caption = #25104' '#20998
end
object Label7: TLabel
Left = 561
Top = 36
Width = 48
Height = 12
Caption = #35746' '#21333' '#21495
end
object Label9: TLabel
Left = 561
Top = 12
Width = 48
Height = 12
Caption = #23384#25918#24037#21378
end
object Label12: TLabel
Left = 178
Top = 36
Width = 48
Height = 12
Caption = #20837#24211#31867#22411
end
object Label11: TLabel
Left = 823
Top = 37
Width = 48
Height = 12
Caption = #26579#21378#32568#21495
end
object Label13: TLabel
Left = 704
Top = 12
Width = 24
Height = 12
Caption = #39068#33394
end
object Label15: TLabel
Left = 704
Top = 37
Width = 24
Height = 12
Caption = #33457#22411
end
object BegDate: TDateTimePicker
Left = 77
Top = 9
Width = 87
Height = 20
Date = 40768.458268587970000000
Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 0
end
object EndDate: TDateTimePicker
Left = 77
Top = 32
Width = 87
Height = 20
Date = 40768.458268587970000000
Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 7
end
object SPName: TEdit
Tag = 2
Left = 345
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 2
OnChange = TBFindClick
end
object FactoryName: TEdit
Tag = 2
Left = 472
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 3
OnChange = FactoryNameChange
end
object SPID: TEdit
Tag = 2
Left = 228
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 1
OnChange = SPIDChange
end
object SPSpec: TEdit
Tag = 2
Left = 345
Top = 32
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 9
OnChange = SPSpecChange
end
object SPCF: TEdit
Tag = 2
Left = 472
Top = 32
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 10
OnChange = FactoryNameChange
end
object OrderNo: TEdit
Tag = 2
Left = 612
Top = 33
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 11
OnChange = FactoryNameChange
end
object ToFactoryName: TEdit
Tag = 2
Left = 612
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 4
OnChange = FactoryNameChange
end
object CRType: TComboBox
Tag = 2
Left = 228
Top = 32
Width = 80
Height = 20
Style = csDropDownList
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 12
TabOrder = 8
OnChange = TBFindClick
Items.Strings = (
''
#21152#24037#23436#25104
#22238#20462#23436#25104
#26816#39564#36864#22238
#26399#21021#20837#24211
#23458#25143#36864#36135
#37319#36141#20837#24211
#27425#21697#20837#24211)
end
object RCGangNo: TEdit
Tag = 2
Left = 874
Top = 34
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 12
OnChange = FactoryNameChange
end
object SPColor: TEdit
Tag = 2
Left = 729
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 5
OnChange = FactoryNameChange
end
object SPHX: TEdit
Tag = 2
Left = 729
Top = 34
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 6
OnChange = FactoryNameChange
end
end
object cxGrid2: TcxGrid
Left = 0
Top = 105
Width = 1462
Height = 687
Align = alClient
TabOrder = 2
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DataSource1
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <
item
Kind = skCount
end
item
Kind = skSum
end
item
Kind = skSum
Column = v2Column6
end
item
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Kind = skSum
Column = Tv1Column4
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_YXYMT.Default
object Tv1SSel: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'SSel'
PropertiesClassName = 'TcxCheckBoxProperties'
HeaderAlignmentHorz = taCenter
Width = 47
end
object v1Column6: TcxGridDBColumn
Caption = #20837#24211#21333#21495
DataBinding.FieldName = 'SPID'
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object Tv1Column5: TcxGridDBColumn
Caption = #32534#21495
DataBinding.FieldName = 'FromMXID'
HeaderAlignmentHorz = taCenter
Options.Editing = False
end
object v1Column2: TcxGridDBColumn
Tag = 2
Caption = #20837#24211#26102#38388
DataBinding.FieldName = 'CRTime'
PropertiesClassName = 'TcxDateEditProperties'
Properties.SaveTime = False
Properties.ShowTime = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 100
end
object v1Column4: TcxGridDBColumn
Tag = 2
Caption = #20837#24211#31867#22411
DataBinding.FieldName = 'CRType'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.DropDownListStyle = lsFixedList
Properties.Items.Strings = (
#21152#24037#23436#25104
#29983#20135#36864#22238)
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object v1Column13: TcxGridDBColumn
Caption = #35746#21333#21495
DataBinding.FieldName = 'OrderNo'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 102
end
object Tv1Column3: TcxGridDBColumn
Caption = #23458#25143
DataBinding.FieldName = 'CustomerNoName'
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1Column14: TcxGridDBColumn
Tag = 2
Caption = #20379#24212#21830
DataBinding.FieldName = 'FactoryName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 101
end
object v2Column1: TcxGridDBColumn
Tag = 2
Caption = #21697#21517
DataBinding.FieldName = 'SPName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 97
end
object v1Column21: TcxGridDBColumn
Tag = 2
Caption = #20135#21697#32534#21495
DataBinding.FieldName = 'spcode'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column8: TcxGridDBColumn
Tag = 2
Caption = #35268#26684
DataBinding.FieldName = 'SPSpec'
HeaderAlignmentHorz = taCenter
HeaderGlyphAlignmentHorz = taCenter
Options.Editing = False
Width = 65
end
object v1Column7: TcxGridDBColumn
Tag = 2
Caption = #25104#20998
DataBinding.FieldName = 'SPCF'
HeaderAlignmentHorz = taCenter
HeaderGlyphAlignmentHorz = taCenter
Options.Editing = False
Width = 73
end
object v1Column1: TcxGridDBColumn
Tag = 2
Caption = #38376#24133
DataBinding.FieldName = 'SPMF'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 73
end
object v1Column10: TcxGridDBColumn
Tag = 2
Caption = #20811#37325
DataBinding.FieldName = 'SPKZ'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 90
end
object v1Column15: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'SPColor'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 69
end
object v1Column17: TcxGridDBColumn
Caption = #33457#22411#33457#21495
DataBinding.FieldName = 'SPHX'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column11: TcxGridDBColumn
Tag = 2
Caption = #23384#25918#24037#21378
DataBinding.FieldName = 'ToFactoryName'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 84
end
object v1Column18: TcxGridDBColumn
Caption = #24211#20301
DataBinding.FieldName = 'KuWei'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 86
end
object v1Column19: TcxGridDBColumn
Caption = #32568#21495
DataBinding.FieldName = 'RCGangNo'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 75
end
object Tv1Column2: TcxGridDBColumn
Caption = #24037#33402
DataBinding.FieldName = 'GYLXName'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 55
end
object v2Column6: TcxGridDBColumn
Tag = 2
Caption = #25968#37327
DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 62
end
object Tv1Column4: TcxGridDBColumn
Caption = #37325#37327
DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1Column3: TcxGridDBColumn
Tag = 2
Caption = #25968#37327#21333#20301
DataBinding.FieldName = 'QtyUnit'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.DropDownListStyle = lsFixedList
Properties.Items.Strings = (
'Kg'
'M'
'Y')
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
end
object Tv1Column1: TcxGridDBColumn
Caption = #21333#20215
DataBinding.FieldName = 'Price'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 55
end
object v1Column16: TcxGridDBColumn
Tag = 2
Caption = #26469#33258#24037#21378
DataBinding.FieldName = 'FromFactoryName'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
VisibleForCustomization = False
Width = 79
end
object v1Column12: TcxGridDBColumn
Tag = 2
Caption = #22791#27880
DataBinding.FieldName = 'Note'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 79
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv1
end
end
object Panel4: TPanel
Left = 547
Top = 140
Width = 235
Height = 125
Color = clSkyBlue
TabOrder = 3
Visible = False
object Label25: TLabel
Left = 38
Top = 34
Width = 24
Height = 12
Caption = #24211#20301
end
object btnChk: TButton
Left = 28
Top = 81
Width = 60
Height = 25
Caption = #30830#35748
TabOrder = 0
OnClick = btnChkClick
end
object btn1: TButton
Left = 160
Top = 80
Width = 60
Height = 25
Caption = #20851#38381
TabOrder = 1
OnClick = btn1Click
end
object KuWei: TcxButtonEdit
Left = 75
Top = 27
ParentFont = False
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.OnButtonClick = KuWeiPropertiesButtonClick
Style.Font.Charset = GB2312_CHARSET
Style.Font.Color = clWindowText
Style.Font.Height = -19
Style.Font.Name = #23435#20307
Style.Font.Style = [fsBold]
Style.IsFontAssigned = True
TabOrder = 2
Width = 121
end
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 504
Top = 254
end
object ADOQueryMain: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 668
Top = 254
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 750
Top = 254
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 504
Top = 378
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 750
Top = 316
end
object CDS_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 504
Top = 316
end
object RM1: TRMGridReport
ThreadPrepareReport = True
InitialZoom = pzDefault
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
DefaultCollate = False
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
PreviewOptions.RulerUnit = rmutScreenPixels
PreviewOptions.RulerVisible = False
PreviewOptions.DrawBorder = False
PreviewOptions.BorderPen.Color = clGray
PreviewOptions.BorderPen.Style = psDash
Dataset = RMDBMain
CompressLevel = rmzcFastest
CompressThread = False
LaterBuildEvents = True
OnlyOwnerDataSet = False
Left = 504
Top = 440
ReportData = {}
end
object RMDBMain: TRMDBDataSet
Visible = True
DataSet = CDS_PRT
Left = 832
Top = 378
end
object RMXLSExport1: TRMXLSExport
ShowAfterExport = True
ExportPrecision = 1
PagesOfSheet = 100
ExportImages = True
ExportFrames = True
ExportImageFormat = ifBMP
JPEGQuality = 0
ScaleX = 1.000000000000000000
ScaleY = 1.000000000000000000
CompressFile = False
Left = 586
Top = 440
end
object RMDBHZ: TRMDBDataSet
Visible = True
DataSet = CDS_HZ
Left = 750
Top = 378
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 832
Top = 254
end
object CDS_PRT: TClientDataSet
Aggregates = <>
Params = <>
Left = 668
Top = 316
end
object PopupMenu1: TPopupMenu
Left = 668
Top = 378
object N1: TMenuItem
Caption = #20840#36873
OnClick = N1Click
end
object N2: TMenuItem
Caption = #20840#24323
OnClick = N2Click
end
end
object ADOQueryImage: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 586
Top = 254
end
object CDS_MX: TClientDataSet
Aggregates = <>
Params = <>
Left = 586
Top = 316
end
object DS_MX: TDataSource
DataSet = CDS_MX
Left = 586
Top = 378
end
object cxGridPopupMenu2: TcxGridPopupMenu
PopupMenus = <>
Left = 832
Top = 316
end
end

View File

@ -0,0 +1,345 @@
unit U_YMTStockList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit,
cxContainer, cxImage, cxDBEdit, 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, cxCurrencyEdit,
cxMaskEdit;
type
TfrmStockList = class(TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBExport: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu;
Label1: TLabel;
Label2: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
CDS_Main: TClientDataSet;
RM1: TRMGridReport;
RMDBMain: TRMDBDataSet;
RMXLSExport1: TRMXLSExport;
RMDBHZ: TRMDBDataSet;
CDS_HZ: TClientDataSet;
CDS_PRT: TClientDataSet;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
SPName: TEdit;
FactoryName: TEdit;
SPID: TEdit;
SPSpec: TEdit;
Label6: TLabel;
SPCF: TEdit;
Label7: TLabel;
OrderNo: TEdit;
cxGrid2: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column6: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
v1Column17: TcxGridDBColumn;
v1Column14: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column1: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1Column11: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
v1Column16: TcxGridDBColumn;
v1Column12: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
Label9: TLabel;
ToFactoryName: TEdit;
Label12: TLabel;
CRType: TComboBox;
v1Column18: TcxGridDBColumn;
v1Column19: TcxGridDBColumn;
Label11: TLabel;
RCGangNo: TEdit;
Label13: TLabel;
SPColor: TEdit;
Label15: TLabel;
SPHX: TEdit;
ADOQueryImage: TADOQuery;
v1Column21: TcxGridDBColumn;
CDS_MX: TClientDataSet;
DS_MX: TDataSource;
cxGridPopupMenu2: TcxGridPopupMenu;
TbEditKW: TToolButton;
Tv1SSel: TcxGridDBColumn;
Panel4: TPanel;
Label25: TLabel;
btnChk: TButton;
btn1: TButton;
KuWei: TcxButtonEdit;
Tv1Column1: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
Tv1Column3: TcxGridDBColumn;
Tv1Column4: TcxGridDBColumn;
Tv1Column5: TcxGridDBColumn;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure ConNoMChange(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure TBFindClick(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure SPIDChange(Sender: TObject);
procedure SPSpecChange(Sender: TObject);
procedure FactoryNameChange(Sender: TObject);
procedure TbEditKWClick(Sender: TObject);
procedure KuWeiPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure btnChkClick(Sender: TObject);
procedure btn1Click(Sender: TObject);
private
canshu1, canshu2: string;
procedure InitGrid();
{ Private declarations }
public
{ Public declarations }
end;
var
frmStockList: TfrmStockList;
implementation
uses
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun, U_ZDYHelp,
U_KuWeiList;
{$R *.dfm}
procedure TfrmStockList.FormDestroy(Sender: TObject);
begin
frmStockList := nil;
end;
procedure TfrmStockList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TfrmStockList.FormCreate(Sender: TObject);
begin
canshu1 := Trim(DParameters1);
canshu2 := Trim(DParameters2);
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime;
end;
procedure TfrmStockList.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select A.* ');
sql.Add(' from YMT_CK_CR A');
sql.add(' where A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
sql.Add(' and A.CRTime<=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
sql.Add(' and isnull(CKName,'''')=''面料''');
SQL.Add(' and CRFlag=''入库'' ');
Open;
//ShowMessage(SQL.Text);
end;
SCreateCDS20(ADOQueryMain, CDS_Main);
SInitCDSData20(ADOQueryMain, CDS_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmStockList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
InitGrid();
end;
procedure TfrmStockList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmStockList.TBCloseClick(Sender: TObject);
begin
WriteCxGrid('待检布入库列表', Tv1, '面料仓库');
Close;
end;
procedure TfrmStockList.FormShow(Sender: TObject);
begin
ReadCxGrid('待检布入库列表', Tv1, '面料仓库');
InitGrid();
end;
procedure TfrmStockList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel('待检布入库列表', cxGrid2);
end;
procedure TfrmStockList.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, CDS_Main);
SInitCDSData20(ADOQueryMain, CDS_Main);
end;
end;
procedure TfrmStockList.N1Click(Sender: TObject);
begin
SelOKNo(CDS_Main, True);
end;
procedure TfrmStockList.N2Click(Sender: TObject);
begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmStockList.SPIDChange(Sender: TObject);
begin
if Length(Trim(SPID.Text)) < 4 then
begin
if Trim(SPID.Text) <> '' then
Exit;
end;
TBFind.Click;
end;
procedure TfrmStockList.SPSpecChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmStockList.FactoryNameChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmStockList.TbEditKWClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
exit;
Panel4.Visible := True;
end;
procedure TfrmStockList.KuWeiPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmKuWeiList := TfrmKuWeiList.Create(Application);
with frmKuWeiList do
begin
if ShowModal = 1 then
begin
with Self.CDS_Main do
begin
Edit;
KuWei.Text := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString);
end;
end;
end;
finally
frmKuWeiList.Free;
end;
end;
procedure TfrmStockList.btnChkClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
exit;
if CDS_Main.Locate('SSel', True, []) = False then
begin
application.MessageBox('请选择数据!', '提示信息');
exit;
end;
try
while CDS_Main.Locate('SSel', True, []) do
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update YMT_CK_CR SET KuWei=' + quotedstr(trim(KuWei.Text)));
sql.Add('where SPID=' + quotedstr(trim(CDS_Main.fieldbyname('SPID').AsString)));
execsql;
end;
with CDS_Main do
begin
Edit;
FieldByName('SSel').Value := False;
FieldByName('KuWei').Value := trim(KuWei.Text);
Post;
end;
end;
Panel4.Visible := False;
application.MessageBox('批量修改成功!', '提示信息');
except
application.MessageBox('批量修改失败!', '提示信息', 0);
end;
end;
procedure TfrmStockList.btn1Click(Sender: TObject);
begin
Panel4.Visible := False;
end;
end.

View File

@ -0,0 +1,616 @@
object frmStockSel: TfrmStockSel
Left = 237
Top = 581
Width = 1328
Height = 687
Caption = #24211#23384#36873#25321
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
OldCreateOrder = False
WindowState = wsMaximized
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 1320
AutoSize = True
ButtonHeight = 30
ButtonWidth = 73
Caption = 'ToolBar1'
Color = clSkyBlue
Flat = True
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -18
Font.Name = #23435#20307
Font.Style = [fsBold]
Images = DataLink_YXYMT.ThreeImgList
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 24
OnClick = TBRafreshClick
end
object ToolButton1: TToolButton
Left = 77
Top = 0
AutoSize = True
Caption = #30830#35748
ImageIndex = 10
OnClick = ToolButton1Click
end
object TBClose: TToolButton
Left = 154
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 21
OnClick = TBCloseClick
end
end
object Panel1: TPanel
Left = 0
Top = 32
Width = 1320
Height = 70
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clSkyBlue
TabOrder = 1
object Label1: TLabel
Left = 25
Top = 14
Width = 80
Height = 19
Caption = #19979#21333#26085#26399
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label4: TLabel
Left = 241
Top = 14
Width = 73
Height = 19
Caption = #23458' '#25143
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Left = 613
Top = 119
Width = 26
Height = 12
Caption = #20811#37325
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label5: TLabel
Left = 489
Top = 14
Width = 73
Height = 19
Caption = #21697' '#21517
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object Label7: TLabel
Left = 525
Top = 88
Width = 52
Height = 12
Caption = #23457#26680#29366#24577
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
Visible = False
end
object Label2: TLabel
Left = 746
Top = 14
Width = 80
Height = 19
Caption = #20837#24211#31867#22411
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object BegDate: TDateTimePicker
Left = 100
Top = 10
Width = 123
Height = 27
Date = 40675.464742650460000000
Format = 'yyyy-MM-dd'
Time = 40675.464742650460000000
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
end
object EndDate: TDateTimePicker
Left = 100
Top = 37
Width = 123
Height = 27
Date = 40675.464761099540000000
Format = 'yyyy-MM-dd'
Time = 40675.464761099540000000
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
end
object CustomerNoName: TEdit
Tag = 2
Left = 328
Top = 9
Width = 140
Height = 27
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
OnChange = CustomerNoNameChange
end
object MPRTKZ: TEdit
Tag = 2
Left = 654
Top = 99
Width = 56
Height = 20
TabOrder = 3
end
object SPName: TEdit
Tag = 2
Left = 576
Top = 9
Width = 139
Height = 27
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 4
OnChange = CustomerNoNameChange
OnKeyPress = SPNameKeyPress
end
object status: TComboBox
Tag = 2
Left = 581
Top = 87
Width = 103
Height = 20
ItemHeight = 12
TabOrder = 5
Visible = False
Items.Strings = (
#26410#23457#26680
#24050#23457#26680
#24050#23436#25104
'')
end
object CRType: TComboBox
Tag = 2
Left = 844
Top = 10
Width = 139
Height = 27
Style = csDropDownList
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -19
Font.Name = #23435#20307
Font.Style = [fsBold]
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 19
ParentFont = False
TabOrder = 6
Items.Strings = (
''
#21152#24037#23436#25104
#22238#20462#23436#25104
#26816#39564#36864#22238
#26399#21021#20837#24211
#23458#25143#36864#36135
#37319#36141#20837#24211
#27425#21697#20837#24211)
end
end
object cxSplitter1: TcxSplitter
Left = 0
Top = 648
Width = 1320
Height = 8
HotZoneClassName = 'TcxMediaPlayer9Style'
AlignSplitter = salBottom
Visible = False
end
object cxGrid2: TcxGrid
Left = 0
Top = 102
Width = 1320
Height = 546
Align = alClient
TabOrder = 3
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DataSource1
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <
item
Kind = skCount
end
item
Kind = skSum
end
item
Kind = skSum
Column = v2Column6
end
item
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Kind = skSum
Column = Tv1Column4
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.Indicator = True
Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_YXYMT.Default
object Tv1SSel: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'SSel'
PropertiesClassName = 'TcxCheckBoxProperties'
HeaderAlignmentHorz = taCenter
Width = 47
end
object v1Column6: TcxGridDBColumn
Caption = #20837#24211#21333#21495
DataBinding.FieldName = 'SPID'
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object v1Column2: TcxGridDBColumn
Tag = 2
Caption = #20837#24211#26102#38388
DataBinding.FieldName = 'CRTime'
PropertiesClassName = 'TcxDateEditProperties'
Properties.SaveTime = False
Properties.ShowTime = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 100
end
object v1Column4: TcxGridDBColumn
Tag = 2
Caption = #20837#24211#31867#22411
DataBinding.FieldName = 'CRType'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.DropDownListStyle = lsFixedList
Properties.Items.Strings = (
#21152#24037#23436#25104
#29983#20135#36864#22238)
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object v1Column13: TcxGridDBColumn
Caption = #35746#21333#21495
DataBinding.FieldName = 'OrderNo'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 102
end
object Tv1Column3: TcxGridDBColumn
Caption = #23458#25143
DataBinding.FieldName = 'CustomerNoName'
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1Column14: TcxGridDBColumn
Tag = 2
Caption = #20379#24212#21830
DataBinding.FieldName = 'FactoryName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 101
end
object v2Column1: TcxGridDBColumn
Tag = 2
Caption = #21697#21517
DataBinding.FieldName = 'SPName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 97
end
object v1Column21: TcxGridDBColumn
Tag = 2
Caption = #20135#21697#32534#21495
DataBinding.FieldName = 'spcode'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column8: TcxGridDBColumn
Tag = 2
Caption = #35268#26684
DataBinding.FieldName = 'SPSpec'
HeaderAlignmentHorz = taCenter
HeaderGlyphAlignmentHorz = taCenter
Options.Editing = False
Width = 65
end
object v1Column7: TcxGridDBColumn
Tag = 2
Caption = #25104#20998
DataBinding.FieldName = 'SPCF'
HeaderAlignmentHorz = taCenter
HeaderGlyphAlignmentHorz = taCenter
Options.Editing = False
Width = 73
end
object v1Column1: TcxGridDBColumn
Tag = 2
Caption = #38376#24133
DataBinding.FieldName = 'SPMF'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 73
end
object v1Column10: TcxGridDBColumn
Tag = 2
Caption = #20811#37325
DataBinding.FieldName = 'SPKZ'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 90
end
object v1Column15: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'SPColor'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 69
end
object v1Column17: TcxGridDBColumn
Caption = #33457#22411#33457#21495
DataBinding.FieldName = 'SPHX'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column11: TcxGridDBColumn
Tag = 2
Caption = #23384#25918#24037#21378
DataBinding.FieldName = 'ToFactoryName'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 84
end
object v1Column18: TcxGridDBColumn
Caption = #24211#20301
DataBinding.FieldName = 'KuWei'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 86
end
object v1Column19: TcxGridDBColumn
Caption = #32568#21495
DataBinding.FieldName = 'RCGangNo'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 75
end
object Tv1Column2: TcxGridDBColumn
Caption = #24037#33402
DataBinding.FieldName = 'GYLXName'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 55
end
object v2Column6: TcxGridDBColumn
Tag = 2
Caption = #25968#37327
DataBinding.FieldName = 'MQty'
PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 62
end
object Tv1Column4: TcxGridDBColumn
Caption = #37325#37327
DataBinding.FieldName = 'KgQty'
HeaderAlignmentHorz = taCenter
Width = 80
end
object v1Column3: TcxGridDBColumn
Tag = 2
Caption = #25968#37327#21333#20301
DataBinding.FieldName = 'QtyUnit'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.DropDownListStyle = lsFixedList
Properties.Items.Strings = (
'Kg'
'M'
'Y')
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
end
object Tv1Column1: TcxGridDBColumn
Caption = #21333#20215
DataBinding.FieldName = 'Price'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 55
end
object v1Column16: TcxGridDBColumn
Tag = 2
Caption = #26469#33258#24037#21378
DataBinding.FieldName = 'FromFactoryName'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Visible = False
HeaderAlignmentHorz = taCenter
Options.Editing = False
VisibleForCustomization = False
Width = 79
end
object v1Column12: TcxGridDBColumn
Tag = 2
Caption = #22791#27880
DataBinding.FieldName = 'Note'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 79
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv1
end
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 710
Top = 298
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 582
Top = 298
end
object ADOQueryMain: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 614
Top = 298
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 646
Top = 298
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 582
Top = 330
end
object CDS_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 678
Top = 298
end
object PopupMenu1: TPopupMenu
Left = 614
Top = 330
object N2: TMenuItem
Caption = #20840#36873
OnClick = N2Click
end
object N1: TMenuItem
Caption = #20840#24323
OnClick = N1Click
end
object N3: TMenuItem
Caption = #25490#21333
end
end
end

View File

@ -0,0 +1,259 @@
unit U_YMTStockSel;
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, cxCalendar, StrUtils,
cxCurrencyEdit, cxImage, cxDBEdit, Menus, RM_Common, RM_Class, RM_e_Xls,
RM_Dataset, RM_System, RM_GridReport, cxGridCustomPopupMenu, cxGridPopupMenu,
cxPC, cxSplitter, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdFTP, ShellAPI, cxCheckBox, cxLookAndFeels, cxLookAndFeelPainters,
cxNavigator, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxDropDownEdit;
type
TfrmStockSel = class(TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
Label1: TLabel;
cxGridPopupMenu1: TcxGridPopupMenu;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
CDS_Main: TClientDataSet;
Label4: TLabel;
CustomerNoName: TEdit;
PopupMenu1: TPopupMenu;
N2: TMenuItem;
Label12: TLabel;
MPRTKZ: TEdit;
cxSplitter1: TcxSplitter;
SPName: TEdit;
Label5: TLabel;
N1: TMenuItem;
Label7: TLabel;
status: TComboBox;
N3: TMenuItem;
ToolButton1: TToolButton;
cxGrid2: TcxGrid;
Tv1: TcxGridDBTableView;
Tv1SSel: TcxGridDBColumn;
v1Column6: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
Tv1Column3: TcxGridDBColumn;
v1Column14: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
v1Column21: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column1: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
v1Column17: TcxGridDBColumn;
v1Column11: TcxGridDBColumn;
v1Column18: TcxGridDBColumn;
v1Column19: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
Tv1Column4: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
Tv1Column1: TcxGridDBColumn;
v1Column16: TcxGridDBColumn;
v1Column12: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
Label2: TLabel;
CRType: TComboBox;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure SPNameKeyPress(Sender: TObject; var Key: Char);
procedure MLConNoKeyPress(Sender: TObject; var Key: Char);
procedure MLOrderNoKeyPress(Sender: TObject; var Key: Char);
procedure CustomerNoNameChange(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
DQdate: TDateTime;
procedure InitGrid();
procedure InitForm();
{ Private declarations }
public
FFInt, FCloth: Integer;
canshu1, canshu2, canshu3: string;
fFlileFlag: string;
FKHNo, FTT: string;
{ Public declarations }
end;
var
frmStockSel: TfrmStockSel;
implementation
uses
U_DataLink, U_Fun;
{$R *.dfm}
procedure TfrmStockSel.FormDestroy(Sender: TObject);
begin
frmStockSel := nil;
end;
procedure TfrmStockSel.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TfrmStockSel.FormCreate(Sender: TObject);
begin
DQdate := SGetServerDate(ADOQueryTemp);
canshu1 := trim(DParameters1);
canshu2 := trim(DdataBase);
end;
procedure TfrmStockSel.TBCloseClick(Sender: TObject);
begin
Close;
WriteCxGrid('生产指示单新YX', Tv1, '生产指示单管理');
end;
procedure TfrmStockSel.InitGrid();
var
fwhere, Pwhere: string;
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select A.* ');
sql.Add(' from YMT_CK_CR A');
sql.add(' where A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
sql.Add(' and A.CRTime<=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
sql.Add(' and isnull(CKName,'''')=''面料''');
SQL.Add(' and CRFlag=''入库'' ');
Open;
//ShowMessage(SQL.Text);
end;
SCreateCDS20(ADOQueryMain, CDS_Main);
SInitCDSData20(ADOQueryMain, CDS_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmStockSel.InitForm();
begin
ReadCxGrid('生产指示单新YX', Tv1, '生产指示单管理');
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime;
InitGrid();
end;
procedure TfrmStockSel.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
Exit;
SelExportData(Tv1, ADOQueryMain, '面料染色计划单');
end;
procedure TfrmStockSel.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmStockSel.FormShow(Sender: TObject);
begin
InitForm();
end;
procedure TfrmStockSel.CheckBox1Click(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmStockSel.CheckBox2Click(Sender: TObject);
begin
TBRafresh.Click;
end;
procedure TfrmStockSel.N1Click(Sender: TObject);
begin
SelOKNo(CDS_Main, false);
end;
procedure TfrmStockSel.N2Click(Sender: TObject);
begin
SelOKNo(CDS_Main, True);
end;
procedure TfrmStockSel.SPNameKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
InitGrid();
end;
procedure TfrmStockSel.MLConNoKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
InitGrid();
end;
procedure TfrmStockSel.MLOrderNoKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
InitGrid();
end;
procedure TfrmStockSel.CustomerNoNameChange(Sender: TObject);
begin
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, CDS_Main);
SInitCDSData20(ADOQueryMain, CDS_Main);
end;
procedure TfrmStockSel.ToolButton1Click(Sender: TObject);
begin
ModalResult := 1;
end;
end.

View File

@ -101,7 +101,7 @@ DebugSourceDirs=
UsePackages=0 UsePackages=0
[Parameters] [Parameters]
RunParams= RunParams=
HostApplication=D:\马国钢开发代码\项目代码\D7WMyunxiang\云翔一码通\testDll.exe HostApplication=D:\Project\D7myYunxiang\云翔一码通\testDll.exe
Launcher= Launcher=
UseLauncher=0 UseLauncher=0
DebugCWD= DebugCWD=

View File

@ -18,7 +18,6 @@ uses
U_ColumnBandSet in '..\Z99Dependency\ThreeFun\Form\U_ColumnBandSet.pas' {frmColumnBandSet}, U_ColumnBandSet in '..\Z99Dependency\ThreeFun\Form\U_ColumnBandSet.pas' {frmColumnBandSet},
U_SelPrintFieldNew in '..\Z99Dependency\ThreeFun\Form\U_SelPrintFieldNew.pas' {frmSelPrintFieldNew}, U_SelPrintFieldNew in '..\Z99Dependency\ThreeFun\Form\U_SelPrintFieldNew.pas' {frmSelPrintFieldNew},
U_CompressionFun in '..\Z99Dependency\ThreeFun\Fun\U_CompressionFun.pas', U_CompressionFun in '..\Z99Dependency\ThreeFun\Fun\U_CompressionFun.pas',
U_SelExportField in '..\Z99Dependency\ThreeFun\Fun\U_SelExportField.pas' {frmSelExportField},
superobject in '..\Z99Dependency\ThreeFun\Fun\superobject.pas', superobject in '..\Z99Dependency\ThreeFun\Fun\superobject.pas',
U_ClientPrintRmf in '..\A00±êÇ©´òÓ¡\U_ClientPrintRmf.pas' {frmClientPrintRmf}, U_ClientPrintRmf in '..\A00±êÇ©´òÓ¡\U_ClientPrintRmf.pas' {frmClientPrintRmf},
U_LabelMapSet in '..\A00±êÇ©´òÓ¡\U_LabelMapSet.pas' {frmLabelMapSet}, U_LabelMapSet in '..\A00±êÇ©´òÓ¡\U_LabelMapSet.pas' {frmLabelMapSet},
@ -26,7 +25,11 @@ uses
U_LabelPrintFun in '..\A00±êÇ©´òÓ¡\U_LabelPrintFun.pas', U_LabelPrintFun in '..\A00±êÇ©´òÓ¡\U_LabelPrintFun.pas',
U_QrCodeFun in '..\A00±êÇ©´òÓ¡\U_QrCodeFun.pas', U_QrCodeFun in '..\A00±êÇ©´òÓ¡\U_QrCodeFun.pas',
U_YMTFHDataList in 'U_YMTFHDataList.pas' {frmYMTFHDataList}, U_YMTFHDataList in 'U_YMTFHDataList.pas' {frmYMTFHDataList},
U_YMTJGWCList in 'U_YMTJGWCList.pas' {frmYMTJGWCList}; U_YMTJGWCList in 'U_YMTJGWCList.pas' {frmYMTJGWCList},
U_YMTFHSQInPut2 in 'U_YMTFHSQInPut2.pas' {frmFHSQInPut2},
U_YMTStockSel in 'U_YMTStockSel.pas' {frmStockSel},
U_YMTStockList in 'U_YMTStockList.pas' {frmStockList},
U_SelExportField in '..\Z99Dependency\ThreeFun\Fun\U_SelExportField.pas' {frmSelExportField};
{$R *.res} {$R *.res}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
unit util_utf8;
interface
uses Windows;
type
UTF8String = AnsiString;
function AnsiToWide(const S: AnsiString): WideString;
function WideToUTF8(const WS: WideString): UTF8String;
function AnsiToUTF8(const S: AnsiString): UTF8String;
function UTF8ToWide(const US: UTF8String): WideString;
function WideToAnsi(const WS: WideString): AnsiString;
function UTF8ToAnsi(const S: UTF8String): AnsiString;
implementation
function AnsiToWide(const S: AnsiString): WideString;
var
len: integer;
ws: WideString;
begin
Result:='';
if (Length(S) = 0) then
exit;
len:=MultiByteToWideChar(CP_ACP, 0, PChar(s), -1, nil, 0);
SetLength(ws, len);
MultiByteToWideChar(CP_ACP, 0, PChar(s), -1, PWideChar(ws), len);
Result:=ws;
end;
function WideToUTF8(const WS: WideString): UTF8String;
var
len: integer;
us: UTF8String;
begin
Result:='';
if (Length(WS) = 0) then
exit;
len:=WideCharToMultiByte(CP_UTF8, 0, PWideChar(WS), -1, nil, 0, nil, nil);
SetLength(us, len);
WideCharToMultiByte(CP_UTF8, 0, PWideChar(WS), -1, PChar(us), len, nil, nil);
Result:=us;
end;
function AnsiToUTF8(const S: AnsiString): UTF8String;
begin
Result:=WideToUTF8(AnsiToWide(S));
end;
function UTF8ToWide(const US: UTF8String): WideString;
var
len: integer;
ws: WideString;
begin
Result:='';
if (Length(US) = 0) then
exit;
len:=MultiByteToWideChar(CP_UTF8, 0, PChar(US), -1, nil, 0);
SetLength(ws, len);
MultiByteToWideChar(CP_UTF8, 0, PChar(US), -1, PWideChar(ws), len);
Result:=ws;
end;
function WideToAnsi(const WS: WideString): AnsiString;
var
len: integer;
s: AnsiString;
begin
Result:='';
if (Length(WS) = 0) then
exit;
len:=WideCharToMultiByte(CP_ACP, 0, PWideChar(WS), -1, nil, 0, nil, nil);
SetLength(s, len);
WideCharToMultiByte(CP_ACP, 0, PWideChar(WS), -1, PChar(s), len, nil, nil);
Result:=s;
end;
function UTF8ToAnsi(const S: UTF8String): AnsiString;
begin
Result:=WideToAnsi(UTF8ToWide(S));
end;
end.

View File

@ -7,7 +7,7 @@ object frmKuWeiList: TfrmKuWeiList
Color = clBtnFace Color = clBtnFace
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -13 Font.Height = -12
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
OldCreateOrder = False OldCreateOrder = False
@ -15,12 +15,12 @@ object frmKuWeiList: TfrmKuWeiList
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 107 PixelsPerInch = 96
TextHeight = 13 TextHeight = 12
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
Width = 1199 Width = 1207
AutoSize = True AutoSize = True
ButtonHeight = 30 ButtonHeight = 30
ButtonWidth = 65 ButtonWidth = 65
@ -139,14 +139,14 @@ object frmKuWeiList: TfrmKuWeiList
end end
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 0 Left = 0
Top = 84 Top = 80
Width = 1199 Width = 1207
Height = 513 Height = 526
Align = alClient Align = alClient
PopupMenu = PopupMenu1 PopupMenu = PopupMenu1
TabOrder = 1 TabOrder = 1
object Tv1: TcxGridDBTableView object Tv1: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False Navigator.Buttons.CustomButtons = <>
OnCellDblClick = Tv1CellDblClick OnCellDblClick = Tv1CellDblClick
DataController.DataSource = DataSource1 DataController.DataSource = DataSource1
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
@ -185,11 +185,12 @@ object frmKuWeiList: TfrmKuWeiList
Styles.Footer = DataLink_MYSC.Default10 Styles.Footer = DataLink_MYSC.Default10
Styles.Header = DataLink_MYSC.Default10 Styles.Header = DataLink_MYSC.Default10
object v1Column4: TcxGridDBColumn object v1Column4: TcxGridDBColumn
Caption = #25171#21360#36873#25321 Caption = #36873#25321
DataBinding.FieldName = 'SSel' DataBinding.FieldName = 'SSel'
PropertiesClassName = 'TcxCheckBoxProperties' PropertiesClassName = 'TcxCheckBoxProperties'
Properties.ImmediatePost = True Properties.ImmediatePost = True
Properties.NullStyle = nssUnchecked Properties.NullStyle = nssUnchecked
HeaderAlignmentHorz = taCenter
Width = 74 Width = 74
end end
object v1Column1: TcxGridDBColumn object v1Column1: TcxGridDBColumn
@ -235,87 +236,87 @@ object frmKuWeiList: TfrmKuWeiList
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Top = 32 Top = 32
Width = 1199 Width = 1207
Height = 52 Height = 48
Align = alTop Align = alTop
BevelInner = bvRaised BevelInner = bvRaised
BevelOuter = bvLowered BevelOuter = bvLowered
Color = clSkyBlue Color = clSkyBlue
TabOrder = 2 TabOrder = 2
object Label2: TLabel object Label2: TLabel
Left = 21 Left = 19
Top = 17 Top = 16
Width = 34 Width = 32
Height = 16 Height = 15
Caption = #21306#22495 Caption = #21306#22495
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label1: TLabel object Label1: TLabel
Left = 142 Left = 131
Top = 17 Top = 16
Width = 34 Width = 32
Height = 16 Height = 15
Caption = #20998#21306 Caption = #20998#21306
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label5: TLabel object Label5: TLabel
Left = 263 Left = 243
Top = 17 Top = 16
Width = 17 Width = 16
Height = 16 Height = 15
Caption = #25490 Caption = #25490
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label6: TLabel object Label6: TLabel
Left = 468 Left = 432
Top = 17 Top = 16
Width = 68 Width = 64
Height = 16 Height = 15
Caption = #24211#20301#21517#31216 Caption = #24211#20301#21517#31216
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object Label7: TLabel object Label7: TLabel
Left = 367 Left = 339
Top = 17 Top = 16
Width = 17 Width = 16
Height = 16 Height = 15
Caption = #23618 Caption = #23618
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
end end
object QuYu: TEdit object QuYu: TEdit
Tag = 2 Tag = 2
Left = 57 Left = 53
Top = 13 Top = 12
Width = 65 Width = 60
Height = 24 Height = 24
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
@ -324,13 +325,13 @@ object frmKuWeiList: TfrmKuWeiList
end end
object FenQu: TEdit object FenQu: TEdit
Tag = 2 Tag = 2
Left = 179 Left = 165
Top = 13 Top = 12
Width = 65 Width = 60
Height = 24 Height = 24
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
@ -339,13 +340,13 @@ object frmKuWeiList: TfrmKuWeiList
end end
object Pai: TEdit object Pai: TEdit
Tag = 2 Tag = 2
Left = 283 Left = 261
Top = 13 Top = 12
Width = 65 Width = 60
Height = 24 Height = 24
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
@ -354,13 +355,13 @@ object frmKuWeiList: TfrmKuWeiList
end end
object KWName: TEdit object KWName: TEdit
Tag = 2 Tag = 2
Left = 538 Left = 497
Top = 13 Top = 12
Width = 165 Width = 152
Height = 24 Height = 24
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False
@ -369,13 +370,13 @@ object frmKuWeiList: TfrmKuWeiList
end end
object Ceng: TEdit object Ceng: TEdit
Tag = 2 Tag = 2
Left = 387 Left = 357
Top = 13 Top = 12
Width = 65 Width = 60
Height = 24 Height = 24
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -16 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
ParentFont = False ParentFont = False

View File

@ -6,11 +6,24 @@ uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, cxButtonEdit,
Menus, cxButtonEdit, cxDropDownEdit, cxPC, Buttons; cxDropDownEdit, cxPC, Buttons, 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;
type type
TfrmKuWeiList = class(TForm) TfrmKuWeiList = class(TForm)
@ -76,19 +89,17 @@ type
procedure cxTabControl1Change(Sender: TObject); procedure cxTabControl1Change(Sender: TObject);
procedure ZJStatusChange(Sender: TObject); procedure ZJStatusChange(Sender: TObject);
procedure ToolButton4Click(Sender: TObject); procedure ToolButton4Click(Sender: TObject);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
private private
canshu1:string; canshu1: string;
DQdate:TDateTime; DQdate: TDateTime;
procedure InitGrid(); procedure InitGrid();
procedure InitForm(); procedure InitForm();
function DelData():Boolean; function DelData(): Boolean;
procedure PrtData(KWID:String); procedure PrtData(KWID: string);
{ Private declarations } { Private declarations }
public public
FFInt,FCloth:Integer; FFInt, FCloth: Integer;
{ Public declarations } { Public declarations }
end; end;
@ -97,31 +108,31 @@ var
frmKuWeiList: TfrmKuWeiList; frmKuWeiList: TfrmKuWeiList;
implementation implementation
uses uses
U_DataLink,U_RTFun,U_ZDYHelp,U_KuWeiInPutCeng; U_DataLink, U_RTFun, U_ZDYHelp, U_KuWeiInPutCeng;
{$R *.dfm} {$R *.dfm}
procedure TfrmKuWeiList.FormDestroy(Sender: TObject); procedure TfrmKuWeiList.FormDestroy(Sender: TObject);
begin begin
frmKuWeiList:=nil; frmKuWeiList := nil;
end; end;
procedure TfrmKuWeiList.FormClose(Sender: TObject; procedure TfrmKuWeiList.FormClose(Sender: TObject; var Action: TCloseAction);
var Action: TCloseAction);
begin begin
Action:=caFree; Action := caFree;
end; end;
procedure TfrmKuWeiList.FormCreate(Sender: TObject); procedure TfrmKuWeiList.FormCreate(Sender: TObject);
begin begin
cxgrid1.Align:=alClient; cxgrid1.Align := alClient;
canshu1:=Trim(DParameters1); canshu1 := Trim(DParameters1);
end; end;
procedure TfrmKuWeiList.TBCloseClick(Sender: TObject); procedure TfrmKuWeiList.TBCloseClick(Sender: TObject);
begin begin
WriteCxGrid('库位列表',Tv1,'库位管理'); WriteCxGrid('库位列表', Tv1, '库位管理');
Close; Close;
end; end;
@ -131,62 +142,71 @@ begin
ADOQueryMain.DisableControls; ADOQueryMain.DisableControls;
with ADOQueryMain do with ADOQueryMain do
begin begin
Filtered:=False; Filtered := False;
Close; Close;
sql.Clear; sql.Clear;
sql.Add(' select A.* '); sql.Add(' select A.* ');
sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' '); sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' ');
Open; Open;
end; end;
SCreateCDS20(ADOQueryMain,Order_Main); SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main); SInitCDSData20(ADOQueryMain, Order_Main);
finally finally
ADOQueryMain.EnableControls; ADOQueryMain.EnableControls;
end; end;
end; end;
procedure TfrmKuWeiList.InitForm(); procedure TfrmKuWeiList.InitForm();
begin begin
ReadCxGrid('库位列表',Tv1,'库位管理'); ReadCxGrid('库位列表', Tv1, '库位管理');
InitGrid(); InitGrid();
end; end;
procedure TfrmKuWeiList.TBFindClick(Sender: TObject); procedure TfrmKuWeiList.TBFindClick(Sender: TObject);
begin begin
if ADOQueryMain.Active=False then Exit; if ADOQueryMain.Active = False then
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); Exit;
SCreateCDS20(ADOQueryMain,Order_Main); SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SInitCDSData20(ADOQueryMain,Order_Main); SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
end; end;
procedure TfrmKuWeiList.TBDelClick(Sender: TObject); procedure TfrmKuWeiList.TBDelClick(Sender: TObject);
begin begin
if Order_Main.IsEmpty then Exit; if Order_Main.IsEmpty then
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit; Exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
application.MessageBox('请选择数据!', '提示信息');
exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
if DelData() then if DelData() then
begin begin
//Order_Main.Delete; //Order_Main.Delete;
end; end;
end; end;
function TfrmKuWeiList.DelData():Boolean; function TfrmKuWeiList.DelData(): Boolean;
begin begin
try try
Result:=false; Result := false;
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
Order_Main.DisableControls; Order_Main.DisableControls;
with Order_Main do with Order_Main do
begin begin
//First; First;
// while Order_Main.Locate('SSel',True,[]) do while Order_Main.Locate('SSel',True,[]) do
begin begin
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add(' UPdate KuWei Set Valid=''N'', DelTime=getdate(),DelerCode='''+Trim(DCode)+''',Deler='''+Trim(DName)+''''); sql.Add(' UPdate KuWei Set Valid=''N'', DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + '''');
sql.Add(' where KWID='''+Trim(Order_Main.fieldbyname('KWID').AsString)+''''); sql.Add(' where KWID=''' + Trim(Order_Main.fieldbyname('KWID').AsString) + '''');
ExecSQL; ExecSQL;
end; end;
Order_Main.Delete; Order_Main.Delete;
@ -194,20 +214,20 @@ begin
end; end;
Order_Main.EnableControls; Order_Main.EnableControls;
ADOQueryCmd.Connection.CommitTrans; ADOQueryCmd.Connection.CommitTrans;
Result:=True; Result := True;
except except
ADOQueryCmd.Connection.RollbackTrans; ADOQueryCmd.Connection.RollbackTrans;
Result:=False; Result := False;
Application.MessageBox('数据删除异常!','提示',0); Application.MessageBox('数据删除异常!', '提示', 0);
end; end;
end; end;
procedure TfrmKuWeiList.TBExportClick(Sender: TObject); procedure TfrmKuWeiList.TBExportClick(Sender: TObject);
begin begin
if ADOQueryMain.IsEmpty then Exit; if ADOQueryMain.IsEmpty then
TcxGridToExcel(Self.Caption,cxGrid1); Exit;
TcxGridToExcel(Self.Caption, cxGrid1);
end; end;
procedure TfrmKuWeiList.TBRafreshClick(Sender: TObject); procedure TfrmKuWeiList.TBRafreshClick(Sender: TObject);
@ -218,10 +238,10 @@ end;
procedure TfrmKuWeiList.TBAddClick(Sender: TObject); procedure TfrmKuWeiList.TBAddClick(Sender: TObject);
begin begin
try try
frmKuWeiInPutCeng:=TfrmKuWeiInPutCeng.Create(Application); frmKuWeiInPutCeng := TfrmKuWeiInPutCeng.Create(Application);
with frmKuWeiInPutCeng do with frmKuWeiInPutCeng do
begin begin
if ShowModal=1 then if ShowModal = 1 then
begin begin
InitGrid(); InitGrid();
end; end;
@ -248,20 +268,21 @@ end;
procedure TfrmKuWeiList.CustomerNoNameChange(Sender: TObject); procedure TfrmKuWeiList.CustomerNoNameChange(Sender: TObject);
begin begin
if ADOQueryMain.Active=False then Exit; if ADOQueryMain.Active = False then
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); Exit;
SCreateCDS20(ADOQueryMain,Order_Main); SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SInitCDSData20(ADOQueryMain,Order_Main); SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
end; end;
procedure TfrmKuWeiList.N2Click(Sender: TObject); procedure TfrmKuWeiList.N2Click(Sender: TObject);
begin begin
SelOKNo(Order_Main,false); SelOKNo(Order_Main, false);
end; end;
procedure TfrmKuWeiList.N1Click(Sender: TObject); procedure TfrmKuWeiList.N1Click(Sender: TObject);
begin begin
SelOKNo(Order_Main,True); SelOKNo(Order_Main, True);
end; end;
procedure TfrmKuWeiList.cxTabControl1Change(Sender: TObject); procedure TfrmKuWeiList.cxTabControl1Change(Sender: TObject);
@ -276,86 +297,88 @@ end;
procedure TfrmKuWeiList.ToolButton4Click(Sender: TObject); procedure TfrmKuWeiList.ToolButton4Click(Sender: TObject);
begin begin
if Order_Main.IsEmpty then Exit; if Order_Main.IsEmpty then
if Trim(ComboBox1.Text)='' then Exit;
if Trim(ComboBox1.Text) = '' then
begin begin
Application.MessageBox('方向不能为空!','提示',0); Application.MessageBox('方向不能为空!', '提示', 0);
Exit; Exit;
end; end;
if Order_Main.Locate('SSel',True,[])=False then if Order_Main.Locate('SSel', True, []) = False then
begin begin
Application.MessageBox('没有选择数据!','提示',0); Application.MessageBox('没有选择数据!', '提示', 0);
Exit; Exit;
end; end;
Order_Main.DisableControls; Order_Main.DisableControls;
with Order_Main do with Order_Main do
begin begin
First; First;
while Locate('SSel',True,[]) do while Locate('SSel', True, []) do
begin begin
PrtData(Trim(Order_Main.fieldbyname('KWID').AsString)); PrtData(Trim(Order_Main.fieldbyname('KWID').AsString));
Edit; Edit;
FieldByName('SSel').Value:=False; FieldByName('SSel').Value := False;
end; end;
end; end;
Order_Main.EnableControls; Order_Main.EnableControls;
end; end;
procedure TfrmKuWeiList.PrtData(KWID:String);
procedure TfrmKuWeiList.PrtData(KWID: string);
var var
fPrintFile,Txt,fImagePath:string; fPrintFile, Txt, fImagePath: string;
i,j:Integer; i, j: Integer;
Moudle: THandle; Moudle: THandle;
Makebar:TMakebar; Makebar: TMakebar;
Mixtext:TMixtext; Mixtext: TMixtext;
begin begin
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\库位标签.rmf'; fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\库位标签.rmf';
if FileExists(fPrintFile)=False then if FileExists(fPrintFile) = False then
begin begin
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\库位标签.rmf'),'提示',0); Application.MessageBox(PChar('没有找' + ExtractFilePath(Application.ExeName) + 'Report\库位标签.rmf'), '提示', 0);
exit; exit;
end; end;
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
SQL.Clear; SQL.Clear;
sql.Add('select * from KuWei where KWID='''+Trim(KWID)+''''); sql.Add('select * from KuWei where KWID=''' + Trim(KWID) + '''');
Open; Open;
end; end;
SCreateCDS20(ADOQueryTemp,CDS_PRT); SCreateCDS20(ADOQueryTemp, CDS_PRT);
SInitCDSData20(ADOQueryTemp,CDS_PRT); SInitCDSData20(ADOQueryTemp, CDS_PRT);
try try
Moudle:=LoadLibrary('MakeQRBarcode.dll'); Moudle := LoadLibrary('MakeQRBarcode.dll');
@Makebar:=GetProcAddress(Moudle,'Make'); @Makebar := GetProcAddress(Moudle, 'Make');
@Mixtext:=GetProcAddress(Moudle,'MixText'); @Mixtext := GetProcAddress(Moudle, 'MixText');
Txt:=Trim(KWID); Txt := Trim(KWID);
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp'; fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil); CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then DeleteFile(fImagePath); if FileExists(fImagePath) then
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3); DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except except
application.MessageBox('二维码生成失败!','提示信息',MB_ICONERROR); application.MessageBox('二维码生成失败!', '提示信息', MB_ICONERROR);
exit; exit;
end; end;
RMVariables['QRBARCODE']:=fImagePath; RMVariables['QRBARCODE'] := fImagePath;
if Trim(ComboBox1.Text)='→' then if Trim(ComboBox1.Text) = '→' then
begin begin
RMVariables['FangXiang']:='→→→→'; RMVariables['FangXiang'] := '→→→→';
end else end
if Trim(ComboBox1.Text)='←' then else if Trim(ComboBox1.Text) = '←' then
begin begin
RMVariables['FangXiang']:='←←←←'; RMVariables['FangXiang'] := '←←←←';
end; end;
RM1.LoadFromFile(fPrintFile); RM1.LoadFromFile(fPrintFile);
//RM1.ShowReport; //RM1.ShowReport;
RM1.PrintReport; RM1.PrintReport;
end; end;
procedure TfrmKuWeiList.Tv1CellDblClick(Sender: TcxCustomGridTableView; procedure TfrmKuWeiList.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
begin begin
ModalResult:=1; ModalResult := 1;
end; end;
end. end.