928 lines
29 KiB
ObjectPascal
928 lines
29 KiB
ObjectPascal
|
|
unit U_ZGJBMX230727;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
|
cxTextEdit, cxDBLookupComboBox, cxContainer, cxDropDownEdit, cxPC, Menus,
|
|||
|
|
TeEngine, Series, TeeProcs, Chart, DbChart, GanttCh, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator, cxGridBandedTableView,
|
|||
|
|
cxGridDBBandedTableView, cxButtons;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmZGJBMX230727 = class(TForm)
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v2Column12: TcxGridDBColumn;
|
|||
|
|
v2Column7: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
SH1: TPanel;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
ClientDataSet2: TClientDataSet;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
cxGrid0: TcxGrid;
|
|||
|
|
Tv0: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn8: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
|
cxGridLevel3: TcxGridLevel;
|
|||
|
|
Tv0Column1: TcxGridDBColumn;
|
|||
|
|
Tv0Column2: TcxGridDBColumn;
|
|||
|
|
Tv0Column3: TcxGridDBColumn;
|
|||
|
|
Tv0Column4: TcxGridDBColumn;
|
|||
|
|
Tv0Column5: TcxGridDBColumn;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
Tv2: TcxGridDBBandedTableView;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
Tv2Column1: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column2: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column3: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column4: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column5: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column6: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column7: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column8: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column9: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column10: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column11: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column12: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column13: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column14: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column15: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column16: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column17: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column18: TcxGridDBBandedColumn;
|
|||
|
|
Tv0Column6: TcxGridDBColumn;
|
|||
|
|
Tv0Column7: TcxGridDBColumn;
|
|||
|
|
Tv0Column8: TcxGridDBColumn;
|
|||
|
|
Tv0Column9: TcxGridDBColumn;
|
|||
|
|
Tv0Column10: TcxGridDBColumn;
|
|||
|
|
DataSource0: TDataSource;
|
|||
|
|
ClientDataSet0: TClientDataSet;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridLevel4: TcxGridLevel;
|
|||
|
|
Tv3Column1: TcxGridDBColumn;
|
|||
|
|
Tv3Column2: TcxGridDBColumn;
|
|||
|
|
Tv3Column3: TcxGridDBColumn;
|
|||
|
|
Tv3Column4: TcxGridDBColumn;
|
|||
|
|
Tv3Column5: TcxGridDBColumn;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ClientDataSet3: TClientDataSet;
|
|||
|
|
RM2: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
ADOQueryPrint: TADOQuery;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
ClientDataSet5: TClientDataSet;
|
|||
|
|
RichEdit1: TRichEdit;
|
|||
|
|
Tv3Column6: TcxGridDBColumn;
|
|||
|
|
Tv2Column19: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column20: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column21: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column22: TcxGridDBBandedColumn;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Tv0Column11: TcxGridDBColumn;
|
|||
|
|
Tv0Column12: TcxGridDBColumn;
|
|||
|
|
Tv0Column13: TcxGridDBColumn;
|
|||
|
|
Tv0Column14: TcxGridDBColumn;
|
|||
|
|
Tv0Column15: TcxGridDBColumn;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Tv2Column23: TcxGridDBBandedColumn;
|
|||
|
|
SaveGS: TcxButton;
|
|||
|
|
Tv0Column16: TcxGridDBColumn;
|
|||
|
|
Tv0Column17: TcxGridDBColumn;
|
|||
|
|
Tv0Column18: TcxGridDBColumn;
|
|||
|
|
Tv0Column19: TcxGridDBColumn;
|
|||
|
|
Tv2Column24: TcxGridDBBandedColumn;
|
|||
|
|
Tv2Column25: TcxGridDBBandedColumn;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Tv3CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Panel4DblClick(Sender: TObject);
|
|||
|
|
procedure Tv2CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
procedure Tv2Column21CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
procedure cxGridDBColumn7HeaderClick(Sender: TObject);
|
|||
|
|
procedure Tv0CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure cxGridDBColumn9HeaderClick(Sender: TObject);
|
|||
|
|
procedure SH1DblClick(Sender: TObject);
|
|||
|
|
procedure Label1Click(Sender: TObject);
|
|||
|
|
procedure SaveGSClick(Sender: TObject);
|
|||
|
|
procedure Tv2Column9CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
procedure Tv2Column23CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
procedure Tv2Column4CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
procedure Tv2Column5CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
procedure Tv2Column2CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
procedure Tv2Column22CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
procedure Tv2Column3CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
private
|
|||
|
|
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
public
|
|||
|
|
FMainid,FConNo,FFlag:String;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmZGJBMX230727: TfrmZGJBMX230727;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun,U_JYDayListGang,U_Fun,U_JYOrderCDList,U_JYOrderCDGangList;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_View_JD_Main :MainId');
|
|||
|
|
Parameters.ParamByName('MainId').Value:=FMainid;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet0);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet0);
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_View_JD_PB :OrderNO');
|
|||
|
|
Parameters.ParamByName('OrderNO').Value:=FConNo;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet1);
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_View_JD :MainId');
|
|||
|
|
Parameters.ParamByName('MainId').Value:=FMainid;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet2);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet2);
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_View_JD_HZ :MainId');
|
|||
|
|
//sql.Add('exec P_Print_CRJD_HZ :MainId');
|
|||
|
|
Parameters.ParamByName('MainId').Value:=FMainid;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet3);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet3);
|
|||
|
|
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_Print_CRJD_CD :MainId');
|
|||
|
|
Parameters.ParamByName('MainId').Value:=FMainid;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet5);
|
|||
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet5);
|
|||
|
|
RichEdit1.Text:=Trim(ClientDataSet5.fieldbyname('HZCD').AsString);
|
|||
|
|
RichEdit1.Text:=RichEdit1.Text+#13+#13+Trim(ClientDataSet5.fieldbyname('ZJCD1').AsString);
|
|||
|
|
RichEdit1.Text:=RichEdit1.Text+#13+#13+Trim(ClientDataSet5.fieldbyname('ZJCD2').AsString);
|
|||
|
|
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Action := caHide;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(DName)='ADMIN' then SaveGS.Visible:=True;
|
|||
|
|
ReadCxGridAll(trim(self.Caption)+'0', Tv0);
|
|||
|
|
ReadCxGridAll(trim(self.Caption)+'1', Tv1);
|
|||
|
|
ReadCxGridAll(trim(self.Caption)+'3', Tv3);
|
|||
|
|
ReadCxBandedGridAll(trim(self.Caption)+'2', Tv2);
|
|||
|
|
InitGrid();
|
|||
|
|
FFlag:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZGJBMX230727:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
Txt, fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
if Tv2.Controller.FocusedColumn.Tag=1 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmJYDayListGang:=TfrmJYDayListGang.Create(Application);
|
|||
|
|
with frmJYDayListGang do
|
|||
|
|
begin
|
|||
|
|
FAPID:=Trim(Self.ClientDataSet2.fieldbyname('APID').AsString);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmJYDayListGang.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end else
|
|||
|
|
if Tv2.Controller.FocusedColumn.Tag=2 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet2.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
ExportFtErpFile('<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF>뵥.rmf', ADOQueryTemp);
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TOp 1 * from WFB_MJJY A where A.APID='''+Trim(ClientDataSet2.fieldbyname('APID').AsString)+''' and isnull(RKOrdID,'''')<>'''' ');
|
|||
|
|
sql.Add(' and isnull(Mjstr4,'''')='''+Trim(ClientDataSet2.fieldbyname('Ganghao').AsString)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet2 do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' exec P_Print_RKMDGangNo2 ');
|
|||
|
|
SQL.Add(' @RKOrdID=''' + Trim(ADOQueryTemp.fieldbyname('RKOrdID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(ADOQueryPrint.fieldbyname('RKOrdID').AsString);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF>뵥.rmf';
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
//Rm2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
|
|||
|
|
// RM2.PrintReport;
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end else
|
|||
|
|
if Tv2.Controller.FocusedColumn.Tag=3 then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TOp 1 * from WFB_MJJY A where A.APID='''+Trim(ClientDataSet2.fieldbyname('APID').AsString)+''' and isnull(RKOrdID,'''')<>'''' ');
|
|||
|
|
sql.Add(' and isnull(Mjstr4,'''')='''+Trim(ClientDataSet2.fieldbyname('Ganghao').AsString)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' exec P_Print_RKMDGangNo_CK ');
|
|||
|
|
SQL.Add(' @RKOrdID=''' + Trim(ADOQueryTemp.fieldbyname('RKOrdID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(ADOQueryPrint.fieldbyname('RKOrdID').AsString);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ExportFtErpFile('<27><><EFBFBD><EFBFBD><EFBFBD>뵥GJ.rmf', ADOQueryTemp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD>뵥GJ.rmf';
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
//Rm2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
|
|||
|
|
// RM2.PrintReport;
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
if Tv2.Controller.FocusedColumn.Tag=4 then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TOp 1 * from WFB_MJJY A where A.APID='''+Trim(ClientDataSet2.fieldbyname('APID').AsString)+''' and isnull(RKOrdID,'''')<>'''' ');
|
|||
|
|
sql.Add(' and isnull(Mjstr4,'''')='''+Trim(ClientDataSet2.fieldbyname('Ganghao').AsString)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' exec P_Print_RKMDGangNo_KC ');
|
|||
|
|
SQL.Add(' @RKOrdID=''' + Trim(ADOQueryTemp.fieldbyname('RKOrdID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(ADOQueryPrint.fieldbyname('RKOrdID').AsString);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ExportFtErpFile('<27><><EFBFBD><EFBFBD><EFBFBD>뵥.rmf', ADOQueryTemp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD>뵥.rmf';
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
//Rm2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
|
|||
|
|
// RM2.PrintReport;
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv3CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
ClientDataSet2.Filter:='PRTColor='''+Trim(ClientDataSet3.fieldbyname('PRTColor').AsString)+'''';
|
|||
|
|
ClientDataSet2.Filtered:=True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Panel4DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ClientDataSet2.Filtered:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
|
var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
Fsunhao:Double;
|
|||
|
|
begin
|
|||
|
|
Fsunhao := AViewInfo.GridRecord.Values[TcxGridDBBandedTableView(Sender).GetColumnByFieldName('PCBFB').Index];
|
|||
|
|
//if VarToStr(Fsunhao)='' then Exit;
|
|||
|
|
|
|||
|
|
{if Fsunhao >=15 then
|
|||
|
|
ACanvas.Brush.Color := $4763FF
|
|||
|
|
else
|
|||
|
|
if (Fsunhao >=10) and (Fsunhao <15) then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color := $00FFFF
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end; }
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column21CustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id:Integer;
|
|||
|
|
Fsunhao10:string;
|
|||
|
|
Fsunhao:Double;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Id:=TV2.GetColumnByFieldName('PCBFB').Index;
|
|||
|
|
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]=null then Exit;
|
|||
|
|
|
|||
|
|
Fsunhao10:=AViewInfo.GridRecord.Values[Id];
|
|||
|
|
|
|||
|
|
Fsunhao:=StrToInt(Fsunhao10);
|
|||
|
|
if Fsunhao >=15 then
|
|||
|
|
ACanvas.Brush.Color := $4763FF
|
|||
|
|
else
|
|||
|
|
if (Fsunhao >=10) and (Fsunhao <15) then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color := $00FFFF
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.cxGridDBColumn7HeaderClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
EngMoney: string;
|
|||
|
|
FEWMID,Txt, fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet0.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><>Ⱦ<EFBFBD><C8BE><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>.rmf';
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
Panel5.Refresh;
|
|||
|
|
ExportFtErpFile('<27><>Ⱦ<EFBFBD><C8BE><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>.rmf', ADOQueryPrint);
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.* ');
|
|||
|
|
sql.Add(',OrderDetail=(select Top 1 OrderDetail from PBOrder_Main B where B.OrderNo=A.ConNo and B.Valid=''Y'')');
|
|||
|
|
sql.Add(' from SalesContract_Main A inner join SalesContract_Sub B on A.MainId=B.MainId ');
|
|||
|
|
sql.Add(' where A.Conno=''' + Trim(ClientDataSet0.fieldbyname('Conno').AsString) + '''');
|
|||
|
|
sql.Add(' order by B.XHNo ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
FEWMID:=Trim(ADOQueryPrint.fieldbyname('Mainid').AsString);
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(FEWMID);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
// RMVariables['EngMoney']:=EngMoney;
|
|||
|
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv0CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
EngMoney,LBName: string;
|
|||
|
|
FEWMID,Txt, fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
if Tv0.Controller.FocusedColumn.Tag=1 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet0.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
LBName := 'Ⱦ<><C8BE>ָʾ<D6B8><CABE>';
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
Panel5.Refresh;
|
|||
|
|
ExportFtErpFile(Trim(LBName) + '.rmf', ADOQueryTemp);
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Print_Order');
|
|||
|
|
sql.add('@mainID=' + quotedstr(trim(ClientDataSet0.fieldbyname('MainID').AsString)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
FEWMID:=Trim(ClientDataSet0.fieldbyname('Mainid').AsString);
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(FEWMID);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf';
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
//RMVariables['SYRName'] := Trim(SYRName);
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf'), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.cxGridDBColumn9HeaderClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
Txt, fImagePath: string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar: TMakebar;
|
|||
|
|
Mixtext: TMixtext;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet0.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
if trim(ClientDataSet0.fieldbyname('LBName').AsString) = '' then
|
|||
|
|
exit;
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
Panel5.Refresh;
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('exec P_Print_Cs_Roll ');
|
|||
|
|
sql.Add('@mainID=''' + trim(ClientDataSet0.fieldbyname('mainID').AsString) + ''' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
|
Txt := Trim(ADOQueryPrint.fieldbyname('MJID').AsString);
|
|||
|
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
|
if FileExists(fImagePath) then
|
|||
|
|
DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ExportFtErpFile10(Trim(ClientDataSet0.fieldbyname('LBName').AsString) + '.rmf', ADOQueryTemp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report10\' + Trim(ClientDataSet0.fieldbyname('LBName').AsString) + '.rmf';
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
|
RM2.ShowReport;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD>ҵ<EFBFBD>' + trim(fPrintFile)), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.SH1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmJYOrderCDList:=TfrmJYOrderCDList.Create(Application);
|
|||
|
|
with frmJYOrderCDList do
|
|||
|
|
begin
|
|||
|
|
FMainid:=Trim(Self.ClientDataSet0.fieldbyname('Mainid').AsString);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmJYOrderCDList.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Label1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmJYOrderCDGangList:=TfrmJYOrderCDGangList.Create(Application);
|
|||
|
|
with frmJYOrderCDGangList do
|
|||
|
|
begin
|
|||
|
|
FMainid:=Trim(Self.ClientDataSet0.fieldbyname('Mainid').AsString);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmJYOrderCDGangList.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.SaveGSClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(DName)='ADMIN' then
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
Panel5.Refresh;
|
|||
|
|
WriteCxGridAll(trim(self.Caption)+'0', Tv0,ADOQueryCmd,ADOQueryTemp);
|
|||
|
|
WriteCxGridAll(trim(self.Caption)+'1', Tv1,ADOQueryCmd,ADOQueryTemp);
|
|||
|
|
WriteCxGridAll(trim(self.Caption)+'3', Tv3,ADOQueryCmd,ADOQueryTemp);
|
|||
|
|
WriteCxBandedGridAll(trim(self.Caption)+'2', Tv2,ADOQueryCmd,ADOQueryTemp);
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column9CustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id:Integer;
|
|||
|
|
Fsunhao10:string;
|
|||
|
|
Fsunhao:Double;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Id:=TV2.GetColumnByFieldName('jyshStr').Index;
|
|||
|
|
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]=null then Exit;
|
|||
|
|
|
|||
|
|
Fsunhao10:=AViewInfo.GridRecord.Values[Id];
|
|||
|
|
|
|||
|
|
Fsunhao:=StrToFloat(Fsunhao10);
|
|||
|
|
if Fsunhao >=3 then
|
|||
|
|
ACanvas.Brush.Color:= $00FFFF
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column23CustomDrawCell(
|
|||
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id:Integer;
|
|||
|
|
Fsunhao10:string;
|
|||
|
|
Fsunhao:Double;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Id:=TV2.GetColumnByFieldName('KPJSPC').Index;
|
|||
|
|
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]=null then Exit;
|
|||
|
|
|
|||
|
|
Fsunhao10:=AViewInfo.GridRecord.Values[Id];
|
|||
|
|
|
|||
|
|
Fsunhao:=StrToFloat(Fsunhao10);
|
|||
|
|
if Fsunhao<0 then Fsunhao:=Fsunhao*(-1);
|
|||
|
|
if Fsunhao >=5 then
|
|||
|
|
ACanvas.Brush.Color:= $00FFFF
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column4CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
var
|
|||
|
|
i,j:Integer;
|
|||
|
|
begin
|
|||
|
|
i:=tv2.GetColumnByFieldName('RCGangNo').Index;
|
|||
|
|
j:=tv2.GetColumnByFieldName('KpPS').Index;
|
|||
|
|
if (ARow1.Values[i]=ARow2.Values[i]) and (ARow1.Values[j]=ARow2.Values[j]) then
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column5CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
var
|
|||
|
|
i,j:Integer;
|
|||
|
|
begin
|
|||
|
|
i:=tv2.GetColumnByFieldName('RCGangNo').Index;
|
|||
|
|
j:=tv2.GetColumnByFieldName('KpQty').Index;
|
|||
|
|
if (ARow1.Values[i]=ARow2.Values[i]) and (ARow1.Values[j]=ARow2.Values[j]) then
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column2CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
var
|
|||
|
|
i,j:Integer;
|
|||
|
|
begin
|
|||
|
|
i:=tv2.GetColumnByFieldName('PRTEColor').Index;
|
|||
|
|
j:=tv2.GetColumnByFieldName('KPDate').Index;
|
|||
|
|
if (ARow1.Values[i]=ARow2.Values[i]) and (ARow1.Values[j]=ARow2.Values[j]) then
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column22CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
var
|
|||
|
|
i,j:Integer;
|
|||
|
|
begin
|
|||
|
|
i:=tv2.GetColumnByFieldName('PRTColor').Index;
|
|||
|
|
j:=tv2.GetColumnByFieldName('PRTEColor').Index;
|
|||
|
|
if (ARow1.Values[i]=ARow2.Values[i]) and (ARow1.Values[j]=ARow2.Values[j]) then
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmZGJBMX230727.Tv2Column3CompareRowValuesForCellMerging(
|
|||
|
|
Sender: TcxGridColumn; ARow1: TcxGridDataRow;
|
|||
|
|
AProperties1: TcxCustomEditProperties; const AValue1: Variant;
|
|||
|
|
ARow2: TcxGridDataRow; AProperties2: TcxCustomEditProperties;
|
|||
|
|
const AValue2: Variant; var AAreEqual: Boolean);
|
|||
|
|
var
|
|||
|
|
i,j:Integer;
|
|||
|
|
begin
|
|||
|
|
i:=tv2.GetColumnByFieldName('KPDate').Index;
|
|||
|
|
j:=tv2.GetColumnByFieldName('RCGangNo').Index;
|
|||
|
|
if (ARow1.Values[i]=ARow2.Values[i]) and (ARow1.Values[j]=ARow2.Values[j]) then
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
AAreEqual:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|