修改云翔一码通

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-09-20 10:39:47 +08:00
parent 204eed7743
commit ce5209fc37
16 changed files with 2263 additions and 317 deletions

View File

@ -18,8 +18,8 @@ type
TA = class(TComponent)
public
S: string;
end;
TStringArray = array of string; // 定义字符串数组类型
function SGetMaxId(AdoQueryTemp: TADOQuery; MyTable: string; MyField: string; var MaxId: Integer): Boolean;
@ -221,6 +221,8 @@ procedure SelOKNoFilter(Tv1: TcxGridDBTableView; FSel: Boolean);
procedure SelOKNoFilterBand(Tv1: TcxGridDBBandedTableView; FSel: Boolean);
function SelCDSKey(CDS_1: TClientDataSet; Keys: array of string): TStringArray;
type
TMyF = function(App: TApplication; //主应用程序 (对Delphi而言)
FormH: HWND; //创建窗口的父窗口句柄 (对PB而言)
@ -675,8 +677,7 @@ begin
if trim(fieldByName('FilePath').AsString) <> '' then
mChildPath := trim(fieldByName('FilePath').AsString) + '\';
end;
end
//////////////////////////////////////
end //////////////////////////////////////
//不存在
else
begin
@ -717,7 +718,6 @@ begin
ff.SaveToStream(Stream);
//OleContainer1.SaveToFile(ExtractFilePath(Paramstr(0))+mfielName)
Stream.SaveToFile(mFilePath + mFileName); //+'\tmpFile\'
//OleContainer1.SaveToFile('tmp');
finally
Stream.Free;
@ -1910,8 +1910,7 @@ begin
else }
if Trim(fieldByName(mfield).AsString) <> '' then
TRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
if Controls[i].Tag = 99 then
@ -1924,8 +1923,7 @@ begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
TComboBox(Controls[i]).ItemIndex := idx;
end;
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2023,8 +2021,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
@ -2039,8 +2036,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TcxRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2186,8 +2182,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
@ -2202,8 +2197,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TcxRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2324,8 +2318,7 @@ begin
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString)
else
TEdit(Controls[i]).Text := '';
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
@ -2344,8 +2337,7 @@ begin
TcxRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString)
else
TcxRichEdit(Controls[i]).Text := '';
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Style = csDropDownList then
@ -2440,8 +2432,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
@ -2456,8 +2447,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TcxRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2552,8 +2542,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
@ -2568,8 +2557,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TcxRichEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2663,8 +2651,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
if Controls[i].Tag = 99 then
@ -2677,8 +2664,7 @@ begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
TComboBox(Controls[i]).ItemIndex := idx;
end;
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2738,8 +2724,7 @@ begin
else if Controls[i] is TcheckBox then
begin
TcheckBox(Controls[i]).Checked := fieldByName(mfield).asBoolean;
end
{else if Controls[i] is TcxLookupComboBox then
end {else if Controls[i] is TcxLookupComboBox then
begin
TcxLookupComboBox(Controls[i]).EditValue:=fieldByName(mfield).AsString;
TcxLookupComboBox(Controls[i]).EditingText:=fieldByName(mfield+'name').AsString;
@ -2774,8 +2759,7 @@ begin
begin
if Trim(fieldByName(mfield).AsString) <> '' then
TEdit(Controls[i]).Text := trim(fieldByName(mfield).AsString);
end
//ftcombobox
end //ftcombobox
else if Controls[i] is TFTComboBox then
begin
if Controls[i].Tag = 99 then
@ -2788,8 +2772,7 @@ begin
idx := TftComboBox(Controls[i]).IndexOfItem2(trim(fieldByName(mfield).AsString));
TComboBox(Controls[i]).ItemIndex := idx;
end;
end
//combobox
end //combobox
else if Controls[i] is TComboBox then
begin
if TComboBox(Controls[i]).Items.Count > 0 then
@ -2849,8 +2832,7 @@ begin
else if Controls[i] is TcheckBox then
begin
TcheckBox(Controls[i]).Checked := fieldByName(mfield).asBoolean;
end
{else if Controls[i] is TcxLookupComboBox then
end {else if Controls[i] is TcxLookupComboBox then
begin
TcxLookupComboBox(Controls[i]).EditValue:=fieldByName(mfield).AsString;
TcxLookupComboBox(Controls[i]).EditingText:=fieldByName(mfield+'name').AsString;
@ -3827,6 +3809,62 @@ begin
end;
end;
function SelCDSKey(CDS_1: TClientDataSet; Keys: array of string): TStringArray;
var
RTValues: TStringArray;
i, j, CurRow: Integer;
begin
// 初始化结果数组
SetLength(RTValues, Length(Keys));
// 保存当前位置并禁用控件刷新
CurRow := CDS_1.RecNo;
CDS_1.DisableControls;
try
with CDS_1 do
begin
First;
j := 0;
// 遍历数据集
while not Eof do
begin
// 检查SSel字段是否为True
if FieldByName('SSel').AsBoolean then
begin
// 处理每个键字段
for i := 0 to Length(Keys) - 1 do
begin
if j = 0 then
// 第一个匹配记录,初始化字符串
RTValues[i] := Trim(FieldByName(Keys[i]).AsString) + ','
else
// 后续匹配记录,追加到字符串
RTValues[i] := RTValues[i] + Trim(FieldByName(Keys[i]).AsString) + ',';
end;
Inc(j); // 增加匹配计数
end;
Next; // 移动到下一条记录
end;
end;
finally
// 恢复位置并启用控件
CDS_1.RecNo := CurRow;
CDS_1.EnableControls;
end;
// 移除每个字符串末尾的逗号
for i := 0 to Length(RTValues) - 1 do
begin
if Length(RTValues[i]) > 0 then
RTValues[i] := Copy(RTValues[i], 1, Length(RTValues[i]) - 1);
end;
// 返回结果
Result := RTValues;
end;
procedure OneKeyPost(Tv1: TcxGridDBTableView; CDS_Sub: TClientDataSet);
var
FValue, FFValue, FColumn, FFColumn: string;
@ -4255,7 +4293,6 @@ begin
// (tv1.DataController.DataSet.Fields[i] as TNumericField).DisplayFormat := '#,0.00;-#,0.00;#';
//tv1.Columns[i].Summary.FooterFormat:='0.0';
//tv1.Columns[i].Summary.FooterKind := skSum;
//这个与Group Row上的汇总同时使用时好象只能有一个有效
//创建行分组行上的汇总项
@ -4328,7 +4365,6 @@ begin
// (tv1.DataController.DataSet.Fields[i] as TNumericField).DisplayFormat := '#,0.00;-#,0.00;#';
//tv1.Columns[i].Summary.FooterFormat:='0.0';
//tv1.Columns[i].Summary.FooterKind := skSum;
//这个与Group Row上的汇总同时使用时好象只能有一个有效
//创建行分组行上的汇总项

View File

@ -13,7 +13,7 @@ function ConnData(): Boolean;
implementation
uses
U_DataLink, U_YMTRKList, U_YMTFHSQList;
U_DataLink, U_YMTRKList, U_YMTFHSQList, U_YMTFHDataList, U_YMTJGWCList;
/////////////////////////////////////////////////////////////////
// 功能说明:取Dll中得窗体 //
@ -38,7 +38,7 @@ begin
DCode := PChar(GCode);
DdataBase := DataBase;
DTitCaption := Title;
DParameters1 := Parameters1;
DParameters1 := '高权限';
DParameters2 := Parameters2;
DParameters3 := Parameters3;
DParameters4 := Parameters4;
@ -118,6 +118,26 @@ begin
mnewHandle := frmYMTRKList.Handle;
end;
112: //加工完成回仓数据
begin
if frmYMTJGWCList = nil then
begin
frmYMTJGWCList := TfrmYMTJGWCList.Create(application.MainForm);
with frmYMTJGWCList do
begin
caption := Trim(Title);
FormStyle := mstyle;
windowState := mstate;
BorderStyle := mborderstyle;
//show;
end;
end
else
frmYMTJGWCList.BringToFront;
//句柄
mnewHandle := frmYMTJGWCList.Handle;
end;
211: //发货申请
begin
if frmYMTFHSQList = nil then
@ -137,6 +157,25 @@ begin
//句柄
mnewHandle := frmYMTFHSQList.Handle;
end;
212: //发货数据
begin
if frmYMTFHDataList = nil then
begin
frmYMTFHDataList := TfrmYMTFHDataList.Create(application.MainForm);
with frmYMTFHDataList do
begin
caption := Trim(Title);
FormStyle := mstyle;
windowState := mstate;
BorderStyle := mborderstyle;
//show;
end;
end
else
frmYMTFHDataList.BringToFront;
//句柄
mnewHandle := frmYMTFHDataList.Handle;
end;
end;
Result := mnewHandle;

View File

@ -0,0 +1,480 @@
object frmYMTFHDataList: TfrmYMTFHDataList
Left = 515
Top = 347
Width = 1370
Height = 750
Caption = #21457#36135#25968#25454
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 = 1362
Height = 33
ButtonHeight = 30
ButtonWidth = 83
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 TBDel: TToolButton
Left = 126
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 3
OnClick = TBDelClick
end
object TBExport: TToolButton
Left = 189
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 68
OnClick = TBExportClick
end
object TBClose: TToolButton
Left = 252
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 21
OnClick = TBCloseClick
end
object ToolButton1: TToolButton
Left = 315
Top = 0
Caption = #39044#35272#25171#21360
ImageIndex = 4
Visible = False
OnClick = ToolButton1Click
end
object ToolButton2: TToolButton
Left = 398
Top = 0
Caption = #24555#36895#25171#21360
ImageIndex = 4
Visible = False
OnClick = ToolButton2Click
end
end
object Panel1: TPanel
Left = 0
Top = 33
Width = 1362
Height = 40
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 = 193
Top = 12
Width = 12
Height = 12
Caption = #33267
end
object Label3: TLabel
Left = 480
Top = 12
Width = 24
Height = 12
Caption = #21697#21517
end
object Label5: TLabel
Left = 322
Top = 12
Width = 48
Height = 12
Caption = #30003#35831#21333#21495
end
object Label12: TLabel
Left = 882
Top = 12
Width = 48
Height = 12
Caption = #20986#24211#31867#22411
end
object Label13: TLabel
Left = 614
Top = 12
Width = 24
Height = 12
Caption = #39068#33394
end
object Label15: TLabel
Left = 748
Top = 12
Width = 24
Height = 12
Caption = #33457#22411
end
object BegDate: TDateTimePicker
Left = 91
Top = 8
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 = 220
Top = 8
Width = 87
Height = 20
Date = 40768.458268587970000000
Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 5
end
object SPName: TEdit
Tag = 2
Left = 519
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 2
OnChange = TBFindClick
end
object FSId: TEdit
Tag = 2
Left = 385
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 1
end
object CRType: TComboBox
Tag = 2
Left = 945
Top = 8
Width = 80
Height = 20
Style = csDropDownList
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 12
TabOrder = 6
OnChange = TBFindClick
Items.Strings = (
''
#21152#24037#20986#24211)
end
object SPColor: TEdit
Tag = 2
Left = 653
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 3
OnChange = FactoryNameChange
end
object PRTHX: TEdit
Tag = 2
Left = 787
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 4
OnChange = FactoryNameChange
end
end
object cxGrid2: TcxGrid
Left = 0
Top = 73
Width = 1362
Height = 646
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>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_YXYMT.Default
object Tv1FromMXID: TcxGridDBColumn
Tag = 2
Caption = #32534#21495
DataBinding.FieldName = 'FromMXID'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v1Column6: TcxGridDBColumn
Caption = #30003#35831#21333#21495
DataBinding.FieldName = 'FSId'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object v1Column13: TcxGridDBColumn
Caption = #25351#31034#21333#21495
DataBinding.FieldName = 'SCConNo'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 102
end
object v1Column2: TcxGridDBColumn
Tag = 2
Caption = #20986#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 = #20986#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 v2Column1: TcxGridDBColumn
Tag = 2
Caption = #21697#21517
DataBinding.FieldName = 'SPName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 97
end
object v1Column15: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'SPColor'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 69
end
object v1Column17: TcxGridDBColumn
Caption = #33457#22411
DataBinding.FieldName = 'SPHX'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object v2Column6: TcxGridDBColumn
Tag = 2
Caption = #25968#37327
DataBinding.FieldName = 'Qty'
PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 85
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv1
end
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 531
Top = 277
end
object ADOQueryMain: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 667
Top = 277
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 735
Top = 277
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 735
Top = 345
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 667
Top = 345
end
object CDS_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 531
Top = 345
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 = 667
Top = 413
ReportData = {}
end
object RMDBMain: TRMDBDataSet
Visible = True
DataSet = CDS_PRT
Left = 599
Top = 413
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 = 735
Top = 413
end
object RMDBHZ: TRMDBDataSet
Visible = True
DataSet = CDS_HZ
Left = 531
Top = 413
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 803
Top = 277
end
object CDS_PRT: TClientDataSet
Aggregates = <>
Params = <>
Left = 599
Top = 345
end
object PopupMenu1: TPopupMenu
Left = 803
Top = 345
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 = 599
Top = 277
end
end

View File

@ -0,0 +1,399 @@
unit U_YMTFHDataList;
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;
type
TfrmYMTFHDataList = 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;
TBDel: TToolButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Label3: TLabel;
Label5: TLabel;
SPName: TEdit;
FSId: TEdit;
cxGrid2: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column6: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
v1Column17: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
Label12: TLabel;
CRType: TComboBox;
Label13: TLabel;
SPColor: TEdit;
Label15: TLabel;
PRTHX: TEdit;
ADOQueryImage: TADOQuery;
Tv1FromMXID: TcxGridDBColumn;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
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 TBDelClick(Sender: TObject);
procedure TBAddClick(Sender: TObject);
procedure TBEditClick(Sender: TObject);
procedure SPSpecChange(Sender: TObject);
procedure FactoryNameChange(Sender: TObject);
procedure TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
private
canshu1, canshu2: string;
procedure InitGrid();
procedure InitImage(fsubID: string);
{ Private declarations }
public
{ Public declarations }
end;
var
frmYMTFHDataList: TfrmYMTFHDataList;
implementation
uses
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun;
{$R *.dfm}
procedure TfrmYMTFHDataList.InitImage(fsubID: string);
begin
ADOQueryImage.close;
// IF fwbid='' then exit;
with ADOQueryImage do
begin
close;
sql.Clear;
sql.Add('select * from TP_File A');
sql.Add('inner join JYOrder_Sub B on B.HXFile=A.WBID');
sql.Add('where B.SubID=' + quotedstr(trim(fsubID)));
open;
end;
end;
procedure TfrmYMTFHDataList.FormDestroy(Sender: TObject);
begin
frmYMTFHDataList := nil;
end;
procedure TfrmYMTFHDataList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TfrmYMTFHDataList.FormCreate(Sender: TObject);
begin
//cxGrid1.Align:=alClient;
canshu1 := Trim(DParameters1);
canshu2 := Trim(DParameters2);
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime;
end;
procedure TfrmYMTFHDataList.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select A.*, B.FSId, B.SCConNo');
sql.Add(' from YMT_CK_CR A');
sql.Add(' JOIN YMT_FHSQ_Sub B ON B.SSID = A.ToSSID');
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 TfrmYMTFHDataList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
InitGrid();
end;
procedure TfrmYMTFHDataList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmYMTFHDataList.TBCloseClick(Sender: TObject);
begin
WriteCxGrid('发货数据列表', Tv1, '发货数据');
Close;
end;
procedure TfrmYMTFHDataList.FormShow(Sender: TObject);
begin
if Trim(canshu2) = '查看' then
begin
TBDel.Visible := False;
end
else
begin
TBDel.Visible := True;
end;
ReadCxGrid('发货数据列表', Tv1, '发货数据');
InitGrid();
end;
procedure TfrmYMTFHDataList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel('发货数据列表', cxGrid2);
end;
procedure TfrmYMTFHDataList.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 TfrmYMTFHDataList.N1Click(Sender: TObject);
begin
SelOKNo(CDS_Main, True);
end;
procedure TfrmYMTFHDataList.N2Click(Sender: TObject);
begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmYMTFHDataList.TBDelClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
begin
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
begin
Application.MessageBox('平移入库的数据为自动生成,不能删除!', '提示', 0);
Exit;
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YMT_CK_CR where FZSPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
sql.Add(' and CRQtyFlag=-1');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add(' delete YMT_CK_CR where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
CDS_Main.Delete;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('删除异常!', '提示', 0);
end;
end
else
begin
CDS_Main.Delete;
end;
end;
procedure TfrmYMTFHDataList.TBAddClick(Sender: TObject);
begin
try
frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
with frmYMTRKInPut do
begin
PState := 0;
FBCId := '';
if ShowModal = 1 then
begin
Self.InitGrid();
end;
end;
finally
frmYMTRKInPut.Free;
end;
end;
procedure TfrmYMTFHDataList.TBEditClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
begin
Application.MessageBox('平移入库的数据为自动生成,不能修改!', '提示', 0);
Exit;
end;
try
frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
with frmYMTRKInPut do
begin
PState := 1;
FBCId := Trim(CDS_Main.fieldbyname('SPID').AsString);
TBDel.Visible := False;
TBAdd.Visible := False;
if ShowModal = 1 then
begin
Self.InitGrid();
end;
end;
finally
frmYMTRKInPut.Free;
end;
end;
procedure TfrmYMTFHDataList.SPSpecChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmYMTFHDataList.FactoryNameChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmYMTFHDataList.TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
var
FValue: string;
FBounds: TRect;
begin
FBounds := AViewInfo.Bounds;
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
ACanvas.Font.Color := clBlack;
ACanvas.Brush.Style := bsClear;
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
ADone := True;
end;
end;
procedure TfrmYMTFHDataList.ToolButton1Click(Sender: TObject);
var
FPrintJson, JsonResult, MFiltration: string;
RTValues: TStringArray;
begin
if CDS_Main.IsEmpty then
Exit;
if CDS_Main.Locate('SSel', True, []) then
begin
RTValues := SelCDSKey(CDS_Main, ['SPID']);
MFiltration := RTValues[0];
end
else
begin
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
end;
FPrintJson := '{ "LMType": "LMType","QrCodeField": "MXID","PreviewPrint": true,"DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '", "PrtArgs": [ { "IsSql": true, "Filtration": " ' + MFiltration + '" }] }';
FormPrint(Application, PChar(FPrintJson));
end;
procedure TfrmYMTFHDataList.ToolButton2Click(Sender: TObject);
var
MPrintJson, JsonResult, MFiltration: string;
begin
if CDS_Main.IsEmpty then
Exit;
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
MPrintJson := '{ "LBName": "标签打印","QrCodeField": "MXID","DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '","IsPreview": true,"printerIndex": 0,"ExportFileType": "", "PrtArgs": [ {"SqlStr": "EXEC P_YMT_CK_MX_Prt1 ''' + MFiltration + ''' " }] }';
FunPrint(Application, PChar(MPrintJson));
end;
end.

View File

@ -1,6 +1,6 @@
object frmFHSQInPut: TfrmFHSQInPut
Left = 615
Top = 422
Left = 354
Top = 585
Width = 1113
Height = 664
Caption = #21457#36135#30003#35831#24405#20837
@ -138,6 +138,20 @@ object frmFHSQInPut: TfrmFHSQInPut
Font.Style = [fsBold]
ParentFont = False
end
object Label3: TLabel
Tag = 1
Left = 849
Top = 12
Width = 72
Height = 17
Caption = #21152#24037#31867#22411
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object CRType: TComboBox
Tag = 1
Left = 115
@ -232,6 +246,21 @@ object frmFHSQInPut: TfrmFHSQInPut
OnBtnUpClick = SalesmanBtnUpClick
OnBtnDnClick = SalesmanBtnDnClick
end
object JGType: TEdit
Tag = 1
Left = 931
Top = 8
Width = 120
Height = 23
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -17
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

View File

@ -62,6 +62,8 @@ type
v1Column5: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
ToolButton3: TToolButton;
Label3: TLabel;
JGType: TEdit;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);

View File

@ -1,6 +1,6 @@
object frmYMTFHSQList: TfrmYMTFHSQList
Left = 635
Top = 231
Left = 521
Top = 198
Width = 1308
Height = 679
Caption = #21457#36135#30003#35831

View File

@ -636,7 +636,6 @@ end;
procedure TfrmYMTFHSQList.ToolButton2Click(Sender: TObject);
begin
Panel3.Visible := True;
end;

View File

@ -0,0 +1,475 @@
object frmYMTJGWCList: TfrmYMTJGWCList
Left = 316
Top = 278
Width = 1370
Height = 750
Caption = #21152#24037#23436#25104#22238#20179#25968#25454
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 = 1362
Height = 33
ButtonHeight = 30
ButtonWidth = 59
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 TBDel: TToolButton
Left = 126
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 3
OnClick = TBDelClick
end
object TBExport: TToolButton
Left = 189
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 68
OnClick = TBExportClick
end
object TBClose: TToolButton
Left = 252
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 21
OnClick = TBCloseClick
end
end
object Panel1: TPanel
Left = 0
Top = 33
Width = 1362
Height = 48
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 = 183
Top = 12
Width = 12
Height = 12
Caption = #33267
end
object Label3: TLabel
Left = 450
Top = 12
Width = 24
Height = 12
Caption = #21697#21517
end
object Label4: TLabel
Left = 574
Top = 12
Width = 48
Height = 12
Caption = #21152#24037#21333#20301
end
object Label5: TLabel
Left = 302
Top = 12
Width = 48
Height = 12
Caption = #30003#35831#21333#21495
end
object Label13: TLabel
Left = 722
Top = 12
Width = 24
Height = 12
Caption = #39068#33394
end
object Label15: TLabel
Left = 846
Top = 12
Width = 24
Height = 12
Caption = #33457#22411
end
object BegDate: TDateTimePicker
Left = 86
Top = 8
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 = 205
Top = 8
Width = 87
Height = 20
Date = 40768.458268587970000000
Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 6
end
object MXPrtName: TEdit
Tag = 2
Left = 484
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 2
OnChange = TBFindClick
end
object FactoryName: TEdit
Tag = 2
Left = 632
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 3
OnChange = FactoryNameChange
end
object FSId: TEdit
Tag = 2
Left = 360
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 1
end
object MXPrtColor: TEdit
Tag = 2
Left = 756
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 4
OnChange = FactoryNameChange
end
object MXPrtHX: TEdit
Tag = 2
Left = 880
Top = 8
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 5
OnChange = FactoryNameChange
end
end
object cxGrid2: TcxGrid
Left = 0
Top = 81
Width = 1362
Height = 638
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 = TV1Qty
end
item
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end
item
Format = '#,###'
Kind = skSum
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
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 = 40
end
object TV1FromMXID: TcxGridDBColumn
Caption = #32534#21495
DataBinding.FieldName = 'FromMXID'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 83
end
object TV1FSId: TcxGridDBColumn
Caption = #30003#35831#21333#21495
DataBinding.FieldName = 'FSId'
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 102
end
object TV1SCConNo: TcxGridDBColumn
Tag = 2
Caption = #25351#31034#21333#21495
DataBinding.FieldName = 'SCConNo'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1CRTime: 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 TV1CRType: 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 TV1SHDanWei: TcxGridDBColumn
Tag = 2
Caption = #21152#24037#21333#20301
DataBinding.FieldName = 'SHDanWei'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 101
end
object TV1MXPrtName: TcxGridDBColumn
Tag = 2
Caption = #21697#21517
DataBinding.FieldName = 'MXPrtName'
PropertiesClassName = 'TcxTextEditProperties'
Properties.ReadOnly = True
HeaderAlignmentHorz = taCenter
Width = 97
end
object TV1MXPrtColor: TcxGridDBColumn
Caption = #39068#33394
DataBinding.FieldName = 'MXPrtColor'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 69
end
object TV1MXPrtHX: TcxGridDBColumn
Caption = #33457#22411
DataBinding.FieldName = 'MXPrtHX'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object TV1Qty: TcxGridDBColumn
Tag = 2
Caption = #25968#37327
DataBinding.FieldName = 'Qty'
PropertiesClassName = 'TcxTextEditProperties'
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 85
end
end
object cxGrid2Level1: TcxGridLevel
GridView = Tv1
end
end
object ADOQueryCmd: TADOQuery
Connection = DataLink_YXYMT.ADOLink
Parameters = <>
Left = 531
Top = 277
end
object ADOQueryMain: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 667
Top = 277
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 735
Top = 277
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 735
Top = 345
end
object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2
PopupMenus = <>
Left = 667
Top = 345
end
object CDS_Main: TClientDataSet
Aggregates = <>
Params = <>
Left = 531
Top = 345
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 = 667
Top = 413
ReportData = {}
end
object RMDBMain: TRMDBDataSet
Visible = True
DataSet = CDS_PRT
Left = 599
Top = 413
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 = 735
Top = 413
end
object RMDBHZ: TRMDBDataSet
Visible = True
DataSet = CDS_HZ
Left = 531
Top = 413
end
object CDS_HZ: TClientDataSet
Aggregates = <>
Params = <>
Left = 803
Top = 277
end
object CDS_PRT: TClientDataSet
Aggregates = <>
Params = <>
Left = 599
Top = 345
end
object PopupMenu1: TPopupMenu
Left = 803
Top = 345
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 = 599
Top = 277
end
end

View File

@ -0,0 +1,352 @@
unit U_YMTJGWCList;
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
TfrmYMTJGWCList = 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;
TBDel: TToolButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
MXPrtName: TEdit;
FactoryName: TEdit;
FSId: TEdit;
cxGrid2: TcxGrid;
Tv1: TcxGridDBTableView;
TV1FromMXID: TcxGridDBColumn;
TV1CRTime: TcxGridDBColumn;
TV1CRType: TcxGridDBColumn;
TV1FSId: TcxGridDBColumn;
TV1MXPrtColor: TcxGridDBColumn;
TV1MXPrtHX: TcxGridDBColumn;
TV1SHDanWei: TcxGridDBColumn;
TV1MXPrtName: TcxGridDBColumn;
TV1Qty: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
Label13: TLabel;
MXPrtColor: TEdit;
Label15: TLabel;
MXPrtHX: TEdit;
ADOQueryImage: TADOQuery;
TV1SCConNo: TcxGridDBColumn;
Tv1SSel: 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 TBDelClick(Sender: TObject);
procedure TBAddClick(Sender: TObject);
procedure SPSpecChange(Sender: TObject);
procedure FactoryNameChange(Sender: TObject);
procedure TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
procedure ToolButton2Click(Sender: TObject);
private
canshu1, canshu2: string;
procedure InitGrid();
procedure InitImage(fsubID: string);
{ Private declarations }
public
{ Public declarations }
end;
var
frmYMTJGWCList: TfrmYMTJGWCList;
implementation
uses
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun;
{$R *.dfm}
procedure TfrmYMTJGWCList.InitImage(fsubID: string);
begin
ADOQueryImage.close;
// IF fwbid='' then exit;
with ADOQueryImage do
begin
close;
sql.Clear;
sql.Add('select * from TP_File A');
sql.Add('inner join JYOrder_Sub B on B.HXFile=A.WBID');
sql.Add('where B.SubID=' + quotedstr(trim(fsubID)));
open;
end;
end;
procedure TfrmYMTJGWCList.FormDestroy(Sender: TObject);
begin
frmYMTJGWCList := nil;
end;
procedure TfrmYMTJGWCList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TfrmYMTJGWCList.FormCreate(Sender: TObject);
begin
//cxGrid1.Align:=alClient;
canshu1 := Trim(DParameters1);
canshu2 := Trim(DParameters2);
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime;
end;
procedure TfrmYMTJGWCList.InitGrid();
begin
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add(' select A.FromMXID, A.Qty, A.CRType,A.CRTime,B.*, C.SHDanWei ');
sql.Add(' from YMT_CK_CR A');
sql.Add(' JOIN YMT_FHSQ_Sub B ON B.SSID = A.ToSSID');
sql.Add(' JOIN YMT_FHSQ_Main C ON C.FSId = B.FSId');
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(A.CKName,'''')=''面料''');
SQL.Add(' and A.CRType=''加工完成'' ');
Open;
//ShowMessage(SQL.Text);
end;
SCreateCDS20(ADOQueryMain, CDS_Main);
SInitCDSData20(ADOQueryMain, CDS_Main);
finally
ADOQueryMain.EnableControls;
end;
end;
procedure TfrmYMTJGWCList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
InitGrid();
end;
procedure TfrmYMTJGWCList.ConNoMChange(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
end;
end;
procedure TfrmYMTJGWCList.TBCloseClick(Sender: TObject);
begin
WriteCxGrid('加工完成回仓数据列表', Tv1, '加工完成面料仓库');
Close;
end;
procedure TfrmYMTJGWCList.FormShow(Sender: TObject);
begin
if Trim(canshu2) = '查看' then
begin
TBDel.Visible := False;
end
else
begin
TBDel.Visible := True;
end;
ReadCxGrid('加工完成回仓数据列表', Tv1, '加工完成面料仓库');
InitGrid();
end;
procedure TfrmYMTJGWCList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel('加工完成回仓数据列表', cxGrid2);
end;
procedure TfrmYMTJGWCList.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 TfrmYMTJGWCList.N1Click(Sender: TObject);
begin
SelOKNo(CDS_Main, True);
end;
procedure TfrmYMTJGWCList.N2Click(Sender: TObject);
begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmYMTJGWCList.TBDelClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
Exit;
if Trim(CDS_Main.fieldbyname('SPID').AsString) <> '' then
begin
if Trim(CDS_Main.fieldbyname('CRType').AsString) = '平移入库' then
begin
Application.MessageBox('平移入库的数据为自动生成,不能删除!', '提示', 0);
Exit;
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YMT_CK_CR where FZSPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
sql.Add(' and CRQtyFlag=-1');
Open;
end;
if ADOQueryTemp.IsEmpty = False then
begin
Application.MessageBox('已有出库记录,不能删除!', '提示', 0);
Exit;
end;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add(' delete YMT_CK_CR where SPID=''' + Trim(CDS_Main.fieldbyname('SPID').AsString) + '''');
ExecSQL;
end;
ADOQueryCmd.Connection.CommitTrans;
CDS_Main.Delete;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('删除异常!', '提示', 0);
end;
end
else
begin
CDS_Main.Delete;
end;
end;
procedure TfrmYMTJGWCList.TBAddClick(Sender: TObject);
begin
try
frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
with frmYMTRKInPut do
begin
PState := 0;
FBCId := '';
if ShowModal = 1 then
begin
Self.InitGrid();
end;
end;
finally
frmYMTRKInPut.Free;
end;
end;
procedure TfrmYMTJGWCList.SPSpecChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmYMTJGWCList.FactoryNameChange(Sender: TObject);
begin
TBFind.Click;
end;
procedure TfrmYMTJGWCList.TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
var
FValue: string;
FBounds: TRect;
begin
FBounds := AViewInfo.Bounds;
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
ACanvas.Font.Color := clBlack;
ACanvas.Brush.Style := bsClear;
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
ADone := True;
end;
end;
procedure TfrmYMTJGWCList.ToolButton2Click(Sender: TObject);
var
MPrintJson, JsonResult, MFiltration: string;
begin
if CDS_Main.IsEmpty then
Exit;
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
MPrintJson := '{ "LBName": "标签打印","QrCodeField": "MXID","DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '","IsPreview": true,"printerIndex": 0,"ExportFileType": "", "PrtArgs": [ {"SqlStr": "EXEC P_YMT_CK_MX_Prt1 ''' + MFiltration + ''' " }] }';
FunPrint(Application, PChar(MPrintJson));
end;
end.

View File

@ -196,9 +196,10 @@ begin
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;

View File

@ -1,6 +1,6 @@
object frmYMTRKList: TfrmYMTRKList
Left = 386
Top = 376
Left = 338
Top = 426
Width = 1370
Height = 750
Caption = #38754#26009#22238#20179#30331#35760
@ -23,7 +23,7 @@ object frmYMTRKList: TfrmYMTRKList
Width = 1362
Height = 33
ButtonHeight = 30
ButtonWidth = 83
ButtonWidth = 107
Caption = 'ToolBar1'
Color = clSkyBlue
Flat = True
@ -70,16 +70,24 @@ object frmYMTRKList: TfrmYMTRKList
ImageIndex = 11
OnClick = TBEditClick
end
object TBDel: TToolButton
object TbEditKW: TToolButton
Left = 252
Top = 0
AutoSize = True
Caption = #25209#37327#20462#25913#24211#20301
ImageIndex = 11
OnClick = TbEditKWClick
end
object TBDel: TToolButton
Left = 363
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 3
OnClick = TBDelClick
end
object TBExport: TToolButton
Left = 315
Left = 426
Top = 0
AutoSize = True
Caption = #23548#20986
@ -87,7 +95,7 @@ object frmYMTRKList: TfrmYMTRKList
OnClick = TBExportClick
end
object TBClose: TToolButton
Left = 378
Left = 489
Top = 0
AutoSize = True
Caption = #20851#38381
@ -95,14 +103,14 @@ object frmYMTRKList: TfrmYMTRKList
OnClick = TBCloseClick
end
object ToolButton1: TToolButton
Left = 441
Left = 552
Top = 0
Caption = #39044#35272#25171#21360
ImageIndex = 4
OnClick = ToolButton1Click
end
object ToolButton2: TToolButton
Left = 524
Left = 659
Top = 0
Caption = #24555#36895#25171#21360
ImageIndex = 4
@ -189,48 +197,27 @@ object frmYMTRKList: TfrmYMTRKList
Height = 12
Caption = #20837#24211#31867#22411
end
object Label10: TLabel
Left = 702
Top = 12
Width = 48
Height = 12
Caption = #24211' '#20301
end
object Label11: TLabel
Left = 703
Top = 36
Left = 823
Top = 37
Width = 48
Height = 12
Caption = #26579#21378#32568#21495
end
object Label13: TLabel
Left = 843
Left = 704
Top = 12
Width = 24
Height = 12
Caption = #39068#33394
end
object Label14: TLabel
Left = 843
Top = 36
Width = 24
Height = 12
Caption = #33394#21495
end
object Label15: TLabel
Left = 959
Top = 12
Left = 704
Top = 37
Width = 24
Height = 12
Caption = #33457#22411
end
object Label16: TLabel
Left = 959
Top = 36
Width = 24
Height = 12
Caption = #23458#25143
end
object BegDate: TDateTimePicker
Left = 77
Top = 9
@ -249,7 +236,7 @@ object frmYMTRKList: TfrmYMTRKList
Date = 40768.458268587970000000
Time = 40768.458268587970000000
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 8
TabOrder = 7
end
object SPName: TEdit
Tag = 2
@ -288,7 +275,7 @@ object frmYMTRKList: TfrmYMTRKList
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 10
TabOrder = 9
OnChange = SPSpecChange
end
object SPCF: TEdit
@ -298,7 +285,7 @@ object frmYMTRKList: TfrmYMTRKList
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 11
TabOrder = 10
OnChange = FactoryNameChange
end
object OrderNo: TEdit
@ -308,7 +295,7 @@ object frmYMTRKList: TfrmYMTRKList
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 12
TabOrder = 11
OnChange = FactoryNameChange
end
object ToFactoryName: TEdit
@ -330,7 +317,7 @@ object frmYMTRKList: TfrmYMTRKList
Style = csDropDownList
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
ItemHeight = 12
TabOrder = 9
TabOrder = 8
OnChange = TBFindClick
Items.Strings = (
''
@ -342,9 +329,19 @@ object frmYMTRKList: TfrmYMTRKList
#37319#36141#20837#24211
#27425#21697#20837#24211)
end
object KuWei: TEdit
object RCGangNo: TEdit
Tag = 2
Left = 754
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
@ -352,61 +349,21 @@ object frmYMTRKList: TfrmYMTRKList
TabOrder = 5
OnChange = FactoryNameChange
end
object RCGangNo: TEdit
object SPHX: TEdit
Tag = 2
Left = 754
Top = 33
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 13
OnChange = FactoryNameChange
end
object PRTColor: TEdit
Tag = 2
Left = 868
Top = 9
Left = 729
Top = 34
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 6
OnChange = FactoryNameChange
end
object SOrddefstr1: TEdit
Tag = 2
Left = 868
Top = 33
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 14
OnChange = FactoryNameChange
end
object PRTHX: TEdit
Tag = 2
Left = 984
Top = 9
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 7
OnChange = FactoryNameChange
end
object CustomerNoName: TEdit
Tag = 2
Left = 984
Top = 33
Width = 80
Height = 20
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
TabOrder = 15
OnChange = FactoryNameChange
end
end
object cxGrid2: TcxGrid
Left = 0
Top = 105
Width = 1177
Width = 1112
Height = 614
Align = alClient
TabOrder = 2
@ -450,6 +407,13 @@ object frmYMTRKList: TfrmYMTRKList
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 = 40
end
object v1Column6: TcxGridDBColumn
Caption = #20837#24211#21333#21495
DataBinding.FieldName = 'SPID'
@ -662,19 +626,19 @@ object frmYMTRKList: TfrmYMTRKList
end
end
object Panel2: TPanel
Left = 1177
Left = 1112
Top = 105
Width = 185
Width = 250
Height = 614
Align = alRight
Caption = 'Panel2'
TabOrder = 3
object cxGrid1: TcxGrid
Left = -13
Left = 1
Top = 71
Width = 197
Width = 248
Height = 542
Align = alRight
Align = alClient
TabOrder = 0
object TvMX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
@ -715,6 +679,13 @@ object frmYMTRKList: TfrmYMTRKList
OptionsView.Indicator = True
OptionsView.IndicatorWidth = 33
OnCustomDrawIndicatorCell = TvMXCustomDrawIndicatorCell
object TvMXSsel: TcxGridDBColumn
Caption = #36873#25321
DataBinding.FieldName = 'Ssel'
PropertiesClassName = 'TcxCheckBoxProperties'
HeaderAlignmentHorz = taCenter
Width = 50
end
object TvMXMXID: TcxGridDBColumn
Caption = #32534#21495
DataBinding.FieldName = 'MXID'
@ -738,7 +709,7 @@ object frmYMTRKList: TfrmYMTRKList
object ToolBar2: TToolBar
Left = 1
Top = 42
Width = 183
Width = 248
Height = 29
ButtonHeight = 30
ButtonWidth = 71
@ -767,7 +738,7 @@ object frmYMTRKList: TfrmYMTRKList
object Panel3: TPanel
Left = 1
Top = 1
Width = 183
Width = 248
Height = 41
Align = alTop
TabOrder = 2
@ -797,6 +768,59 @@ object frmYMTRKList: TfrmYMTRKList
end
end
end
object Panel4: TPanel
Left = 560
Top = 140
Width = 234
Height = 125
Color = clSkyBlue
TabOrder = 4
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 = -17
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 = <>

View File

@ -24,7 +24,8 @@ uses
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit;
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit,
cxMaskEdit;
type
TfrmYMTRKList = class(TForm)
@ -94,21 +95,15 @@ type
Label12: TLabel;
CRType: TComboBox;
v1Column18: TcxGridDBColumn;
Label10: TLabel;
KuWei: TEdit;
v1Column19: TcxGridDBColumn;
Label11: TLabel;
RCGangNo: TEdit;
Label13: TLabel;
PRTColor: TEdit;
Label14: TLabel;
SOrddefstr1: TEdit;
SPColor: TEdit;
Label15: TLabel;
PRTHX: TEdit;
SPHX: TEdit;
ADOQueryImage: TADOQuery;
v1Column21: TcxGridDBColumn;
Label16: TLabel;
CustomerNoName: TEdit;
cxGrid1: TcxGrid;
TvMX: TcxGridDBTableView;
TvMXMXQty: TcxGridDBColumn;
@ -127,6 +122,14 @@ type
AddNum: TEdit;
Label17: TLabel;
Button1: TButton;
TvMXSsel: TcxGridDBColumn;
TbEditKW: TToolButton;
Tv1SSel: TcxGridDBColumn;
Panel4: TPanel;
Label25: TLabel;
btnChk: TButton;
btn1: TButton;
KuWei: TcxButtonEdit;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -151,6 +154,10 @@ type
procedure TbAddRowClick(Sender: TObject);
procedure TbDeleteRowClick(Sender: TObject);
procedure Button1Click(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();
@ -167,7 +174,8 @@ var
implementation
uses
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun;
U_DataLink, U_RTFun, U_YMTRKInPut, U_ZdyAttachGYS, U_LabelPrintFun,
U_ZDYHelp;
{$R *.dfm}
procedure TfrmYMTRKList.InitMXGrid(SPID: string);
@ -380,6 +388,8 @@ begin
end;
procedure TfrmYMTRKList.TBEditClick(Sender: TObject);
var
OldSPID: string; // 用于保存当前行的SPID
begin
if CDS_Main.IsEmpty then
Exit;
@ -389,18 +399,27 @@ begin
Exit;
end;
try
OldSPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
frmYMTRKInPut := TfrmYMTRKInPut.Create(Application);
with frmYMTRKInPut do
begin
PState := 1;
FBCId := Trim(CDS_Main.fieldbyname('SPID').AsString);
FBCId := OldSPID;
TBDel.Visible := False;
TBAdd.Visible := False;
if ShowModal = 1 then
begin
Self.InitGrid();
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;
@ -453,10 +472,19 @@ end;
procedure TfrmYMTRKList.ToolButton1Click(Sender: TObject);
var
FPrintJson, JsonResult, MFiltration: string;
RTValues: TStringArray;
begin
if CDS_Main.IsEmpty then
Exit;
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
if CDS_MX.Locate('SSel', True, []) then
begin
RTValues := SelCDSKey(CDS_MX, ['MXID']);
MFiltration := RTValues[0];
end
else
begin
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
end;
FPrintJson := '{ "LMType": "LMType","QrCodeField": "MXID","PreviewPrint": true,"DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '", "PrtArgs": [ { "IsSql": true, "Filtration": " ' + MFiltration + '" }] }';
FormPrint(Application, PChar(FPrintJson));
@ -576,5 +604,76 @@ begin
end;
end;
procedure TfrmYMTRKList.TbEditKWClick(Sender: TObject);
begin
if CDS_Main.IsEmpty then
exit;
Panel4.Visible := True;
end;
procedure TfrmYMTRKList.KuWeiPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmZDYHelp := TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag := 'KuWei';
flagname := '库位';
if ShowModal = 1 then
begin
with Self.CDS_Main do
begin
Edit;
KuWei.Text := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmYMTRKList.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 TfrmYMTRKList.btn1Click(Sender: TObject);
begin
Panel4.Visible := False;
end;
end.

View File

@ -24,7 +24,9 @@ uses
U_LabelMapSet in '..\A00±êÇ©´òÓ¡\U_LabelMapSet.pas' {frmLabelMapSet},
U_LabelPrint in '..\A00±êÇ©´òÓ¡\U_LabelPrint.pas' {frmLabelPrint},
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_YMTJGWCList in 'U_YMTJGWCList.pas' {frmYMTJGWCList};
{$R *.res}

View File

@ -6,26 +6,26 @@ uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
Menus, cxButtonEdit, cxDropDownEdit, cxPC, Buttons, cxTextEdit, cxImage,StrUtils,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore,
dxSkinDarkRoom,
dxSkinOffice2013White,
dxSkinSharpPlus,
dxSkinSpringTime,
dxSkinsDefaultPainters,
dxSkinscxPCPainter;
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, cxButtonEdit,
cxDropDownEdit, cxPC, Buttons, cxTextEdit, cxImage, StrUtils, 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
TfrmZHCPDJList = class(TForm)
@ -105,15 +105,15 @@ type
procedure BJClick(Sender: TObject);
procedure KHNameChange(Sender: TObject);
private
canshu1,canshu2:string;
DQdate:TDateTime;
canshu1, canshu2: string;
DQdate: TDateTime;
procedure InitGrid();
procedure InitForm();
function DelData():Boolean;
function StrFenHang(FStr:string;var FHStr:String):Boolean;
function DelData(): Boolean;
function StrFenHang(FStr: string; var FHStr: string): Boolean;
{ Private declarations }
public
FFInt,FCloth:Integer;
FFInt, FCloth: Integer;
{ Public declarations }
end;
@ -122,8 +122,9 @@ type
//frmZHCPList: TfrmZHCPList;
implementation
uses
U_DataLink,U_RTFun,U_ZHDJInPut,U_KWView;
U_DataLink, U_RTFun, U_ZHDJInPut, U_KWView;
{$R *.dfm}
@ -132,108 +133,107 @@ begin
//frmZHCPList:=nil;
end;
procedure TfrmZHCPDJList.FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TfrmZHCPDJList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=caFree;
Action := caFree;
end;
procedure TfrmZHCPDJList.FormCreate(Sender: TObject);
begin
cxgrid1.Align:=alClient;
cxgrid1.Align := alClient;
end;
procedure TfrmZHCPDJList.TBCloseClick(Sender: TObject);
begin
if Trim(Self.Caption)='展会登记*' then
if Trim(Self.Caption) = '展会登记*' then
begin
WriteCxGrid('展会登记YX',Tv1,'展会产品管理');
end else
if Trim(Self.Caption)='展会报价*' then
WriteCxGrid('展会登记YX', Tv1, '展会产品管理');
end
else if Trim(Self.Caption) = '展会报价*' then
begin
WriteCxGrid('展会报价YX',Tv1,'展会产品管理');
end else
if Trim(Self.Caption)='展会登记(高权限)*' then
WriteCxGrid('展会报价YX', Tv1, '展会产品管理');
end
else if Trim(Self.Caption) = '展会登记(高权限)*' then
begin
WriteCxGrid('展会登记(高权限)YX',Tv1,'展会产品管理');
WriteCxGrid('展会登记(高权限)YX', Tv1, '展会产品管理');
end;
Close;
end;
procedure TfrmZHCPDJList.InitGrid();
begin
Panel2.Visible:=True;
Panel2.Visible := True;
Panel2.Refresh;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered:=False;
Filtered := False;
Close;
sql.Clear;
sql.Add(' select A.* ');
sql.Add(' from ZH_KH_DJ A ');
sql.Add(' where Valid=''Y'' ');
sql.Add(' and ZDDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
sql.Add(' and ZDDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
if Trim(canshu2)<>'高权限' then
sql.Add(' and ZDDate>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
sql.Add(' and ZDDate<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
if Trim(canshu2) <> '高权限' then
begin
SQL.Add(' and (isnull(YWY,'''')='''+Trim(DName)+''' or isnull(LiDan,'''')='''+Trim(DName)+''' or isnull(Filler,'''')='''+Trim(DName)+''')');
SQL.Add(' and (isnull(YWY,'''')=''' + Trim(DName) + ''' or isnull(LiDan,'''')=''' + Trim(DName) + ''' or isnull(Filler,'''')=''' + Trim(DName) + ''')');
end;
Open;
end;
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
finally
ADOQueryMain.EnableControls;
end;
Panel2.Visible:=False;
Panel2.Visible := False;
end;
procedure TfrmZHCPDJList.InitForm();
begin
BegDate.Date:=SGetServerDateMBeg(ADOQueryTemp);
EndDate.Date:=SGetServerDate(ADOQueryTemp);
if Trim(Self.Caption)='报价登记*' then
BegDate.Date := SGetServerDateMBeg(ADOQueryTemp);
EndDate.Date := SGetServerDate(ADOQueryTemp);
if Trim(Self.Caption) = '报价登记*' then
begin
ReadCxGrid('展会登记YX',Tv1,'展会产品管理');
TBAdd.Visible:=True;
TBEdit.Visible:=True;
ReadCxGrid('展会登记YX', Tv1, '展会产品管理');
TBAdd.Visible := True;
TBEdit.Visible := True;
// TBDel.Visible:=True;
end else
if Trim(Self.Caption)='报价管理*' then
end
else if Trim(Self.Caption) = '报价管理*' then
begin
ReadCxGrid('展会报价YX',Tv1,'展会产品管理');
TBAdd.Visible:=True;
TBEdit.Visible:=True;
TBDel.Visible:=True;
BJ.Visible:=True;
canshu2:='高权限';
end else
if Trim(Self.Caption)='报价登记(高权限)*' then
ReadCxGrid('展会报价YX', Tv1, '展会产品管理');
TBAdd.Visible := True;
TBEdit.Visible := True;
TBDel.Visible := True;
BJ.Visible := True;
canshu2 := '高权限';
end
else if Trim(Self.Caption) = '报价登记(高权限)*' then
begin
ReadCxGrid('展会登记(高权限)YX',Tv1,'展会产品管理');
TBAdd.Visible:=True;
TBEdit.Visible:=True;
TBDel.Visible:=True;
canshu2:='高权限';
ReadCxGrid('展会登记(高权限)YX', Tv1, '展会产品管理');
TBAdd.Visible := True;
TBEdit.Visible := True;
TBDel.Visible := True;
canshu2 := '高权限';
end;
//InitGrid();
end;
procedure TfrmZHCPDJList.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
end;
function TfrmZHCPDJList.DelData():Boolean;
function TfrmZHCPDJList.DelData(): Boolean;
begin
try
Result:=false;
Result := false;
ADOQueryCmd.Connection.BeginTrans;
Order_Main.DisableControls;
with Order_Main do
@ -245,8 +245,8 @@ begin
begin
Close;
sql.Clear;
sql.Add(' UPdate ZH_KH_DJ Set DelTime=getdate(),DelerCode='''+Trim(DCode)+''',Deler='''+Trim(DName)+''', Valid=''N'' ');
sql.Add(' where ZDID='''+Trim(Order_Main.fieldbyname('ZDID').AsString)+'''');
sql.Add(' UPdate ZH_KH_DJ Set DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + ''', Valid=''N'' ');
sql.Add(' where ZDID=''' + Trim(Order_Main.fieldbyname('ZDID').AsString) + '''');
ExecSQL;
end;
Order_Main.Delete;
@ -254,63 +254,68 @@ begin
end;
Order_Main.EnableControls;
ADOQueryCmd.Connection.CommitTrans;
Result:=True;
Result := True;
except
ADOQueryCmd.Connection.RollbackTrans;
Result:=False;
Application.MessageBox('数据删除异常!','提示',0);
Result := False;
Application.MessageBox('数据删除异常!', '提示', 0);
end;
end;
function TfrmZHCPDJList.StrFenHang(FStr:string;var FHStr:String):Boolean;
function TfrmZHCPDJList.StrFenHang(FStr: string; var FHStr: string): Boolean;
var
i,j:Integer;
LSStr:String;
i, j: Integer;
LSStr: string;
begin
Result:=False;
FStr:=Trim(FStr);
FHStr:='';
j:=1;
i:=Pos(' ',FStr);
while i>0 do
Result := False;
FStr := Trim(FStr);
FHStr := '';
j := 1;
i := Pos(' ', FStr);
while i > 0 do
begin
if j=1 then
if j = 1 then
begin
LSStr:=Copy(FStr,1,i-1); //'1234 5678 456'
FHStr:='1:'+LSStr;
end else
LSStr := Copy(FStr, 1, i - 1); //'1234 5678 456'
FHStr := '1:' + LSStr;
end
else
begin
LSStr:=Copy(FStr,1,i-1);
if Trim(LSStr)='' then
LSStr := Copy(FStr, 1, i - 1);
if Trim(LSStr) = '' then
begin
Fstr:=Copy(Fstr,i+1,Length(Fstr)-i);
end else
FHStr:=FHStr+#13+#10+inttostr(j)+':'+LSStr;
FStr := Copy(FStr, i + 1, Length(FStr) - i);
end
else
FHStr := FHStr + #13 + #10 + inttostr(j) + ':' + LSStr;
end;
if Trim(LSStr)<>'' then
if Trim(LSStr) <> '' then
begin
j:=j+1;
Fstr:=Copy(Fstr,i+1,Length(Fstr)-i);
j := j + 1;
FStr := Copy(FStr, i + 1, Length(FStr) - i);
end;
i:=Pos(' ',FStr);
i := Pos(' ', FStr);
end;
if j=1 then
if j = 1 then
begin
FHStr:=FStr;
end else
FHStr := FStr;
end
else
begin
if Trim(FStr)<>'' then
if Trim(FStr) <> '' then
begin
FHStr:=FHStr+#13+#10+inttostr(j)+':'+FStr;
FHStr := FHStr + #13 + #10 + inttostr(j) + ':' + FStr;
end;
end;
Result:=True;
Result := True;
end;
procedure TfrmZHCPDJList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then Exit;
TcxGridToExcel(Self.Caption,cxGrid1);
if ADOQueryMain.IsEmpty then
Exit;
TcxGridToExcel(Self.Caption, cxGrid1);
end;
procedure TfrmZHCPDJList.TBRafreshClick(Sender: TObject);
@ -318,17 +323,16 @@ begin
InitGrid();
end;
procedure TfrmZHCPDJList.TBAddClick(Sender: TObject);
begin
try
frmZHDJInPut:=TfrmZHDJInPut.Create(Application);
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
with frmZHDJInPut do
begin
PState:=0;
FMainId:='';
frmZHDJInPut.canshu2:=Self.canshu2;
if ShowModal=1 then
PState := 0;
FMainId := '';
frmZHDJInPut.canshu2 := Self.canshu2;
if ShowModal = 1 then
begin
InitGrid();
end;
@ -354,21 +358,21 @@ begin
end;
procedure TfrmZHCPDJList.ToolButton1Click(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmZHDJInPut:=TfrmZHDJInPut.Create(Application);
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
with frmZHDJInPut do
begin
PState:=1;
FMainId:=Trim(Order_Main.fieldbyname('ZDID').AsString);
TBSave.Visible:=False;
if Trim(self.Caption)='展会报价*' then
PState := 1;
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
TBSave.Visible := False;
if Trim(self.Caption) = '展会报价*' then
begin
frmZHDJInPut.canshu1:='报价';
frmZHDJInPut.canshu1 := '报价';
end;
if ShowModal=1 then
if ShowModal = 1 then
begin
//InitGrid();
end;
@ -380,16 +384,19 @@ end;
procedure TfrmZHCPDJList.CustomerNoNameChange(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
SCreateCDS20(ADOQueryMain,Order_Main);
SInitCDSData20(ADOQueryMain,Order_Main);
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
end;
procedure TfrmZHCPDJList.TBDelClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
if Order_Main.IsEmpty then
Exit;
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
Exit;
if DelData() then
begin
//Order_Main.Delete;
@ -418,18 +425,19 @@ end;
procedure TfrmZHCPDJList.TBEditClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmZHDJInPut:=TfrmZHDJInPut.Create(Application);
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
with frmZHDJInPut do
begin
PState:=1;
FMainId:=Trim(Order_Main.fieldbyname('ZDID').AsString);
frmZHDJInPut.canshu2:=Self.canshu2;
if ShowModal=1 then
PState := 1;
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
frmZHDJInPut.canshu2 := Self.canshu2;
if ShowModal = 1 then
begin
InitGrid();
Self.Order_Main.Locate('ZDID',FMainId,[]);
Self.Order_Main.Locate('ZDID', FMainId, []);
end;
end;
finally
@ -439,23 +447,24 @@ end;
procedure TfrmZHCPDJList.BJClick(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmZHDJInPut:=TfrmZHDJInPut.Create(Application);
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
with frmZHDJInPut do
begin
PState:=1;
FMainId:=Trim(Order_Main.fieldbyname('ZDID').AsString);
frmZHDJInPut.canshu1:='报价';
if ShowModal=1 then
PState := 1;
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
frmZHDJInPut.canshu1 := '报价';
if ShowModal = 1 then
begin
InitGrid();
Self.Order_Main.Locate('ZDID',FMainId,[]);
Self.Order_Main.Locate('ZDID', FMainId, []);
end;
end;
finally
frmZHDJInPut.Free;
end;
end;
end;
procedure TfrmZHCPDJList.KHNameChange(Sender: TObject);
@ -464,3 +473,4 @@ begin
end;
end.

View File

@ -13,20 +13,19 @@ uses
IdTCPClient, IdFTP, cxPC, cxGridCustomPopupMenu, cxGridPopupMenu, cxGroupBox,
cxCheckBox, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport,
IniFiles, cxImage, Menus, ShellAPI, cxLookAndFeels, cxLookAndFeelPainters,
cxNavigator, dxSkinsCore,
dxSkinDarkRoom,
dxSkinOffice2013White,
dxSkinSharpPlus, dxSkinSpringTime,
dxSkinsDefaultPainters,
dxSkinscxPCPainter;
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
TfrmZHDJInPut = class(TForm)