1401 lines
38 KiB
ObjectPascal
1401 lines
38 KiB
ObjectPascal
|
|
unit U_TradePlanMgeList;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
|||
|
|
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
|
|||
|
|
Vcl.ComCtrls, Vcl.ToolWin, cxGraphics, cxControls, cxLookAndFeels, cxContainer,
|
|||
|
|
cxEdit, dxLayoutcxEditAdapters, dxBarBuiltInMenu, cxPC, dxLayoutContainer,
|
|||
|
|
cxClasses, cxTextEdit, dxLayoutControl, cxStyles, cxCustomData, cxFilter,
|
|||
|
|
cxData, cxDataStorage, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
|
|||
|
|
Data.DB, cxDBData, cxCalendar, cxGridLevel, cxGridCustomTableView,
|
|||
|
|
cxGridTableView, cxGridDBTableView, cxGridCustomView, cxGrid, U_BaseList,
|
|||
|
|
Data.Win.ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, Datasnap.DBClient,
|
|||
|
|
cxCheckBox, cxButtonEdit, cxSplitter, dxCore, cxDateUtils, cxMaskEdit,
|
|||
|
|
cxDropDownEdit, cxProgressBar, Vcl.Menus, RM_Common, RM_Class, RM_GridReport,
|
|||
|
|
RM_Dataset, cxLookAndFeelPainters, Vcl.ExtCtrls;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmTradePlanMgeList = class(TfrmBaseList)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBAdd: TToolButton;
|
|||
|
|
btnCopy: TToolButton;
|
|||
|
|
TBEdit: TToolButton;
|
|||
|
|
TBDel: TToolButton;
|
|||
|
|
Tdjsz: TToolButton;
|
|||
|
|
TBPrint: TToolButton;
|
|||
|
|
TBCK: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
TWC: TToolButton;
|
|||
|
|
TNowc: TToolButton;
|
|||
|
|
Tbcgs: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
dxLayoutControl_query: TdxLayoutControl;
|
|||
|
|
custName: TcxTextEdit;
|
|||
|
|
ConNo: TcxTextEdit;
|
|||
|
|
BuyConNo: TcxTextEdit;
|
|||
|
|
OrderNo: TcxTextEdit;
|
|||
|
|
dxLayoutControl_queryGroup_Root: TdxLayoutGroup;
|
|||
|
|
dxLayoutItem1: TdxLayoutItem;
|
|||
|
|
dxLayoutItem2: TdxLayoutItem;
|
|||
|
|
cxPageControl1: TcxPageControl;
|
|||
|
|
cxTabSheet1: TcxTabSheet;
|
|||
|
|
cxTabSheet2: TcxTabSheet;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1OrderNo: TcxGridDBColumn;
|
|||
|
|
v1custName: TcxGridDBColumn;
|
|||
|
|
v1OrdDate: TcxGridDBColumn;
|
|||
|
|
v1DlyDate: TcxGridDBColumn;
|
|||
|
|
v1ZQty: TcxGridDBColumn;
|
|||
|
|
v1OrderUnit3: TcxGridDBColumn;
|
|||
|
|
tv1ordNote: TcxGridDBColumn;
|
|||
|
|
tv1packNote: TcxGridDBColumn;
|
|||
|
|
v1MPRTSCTeBieNote: TcxGridDBColumn;
|
|||
|
|
v1filler: TcxGridDBColumn;
|
|||
|
|
v1OrdPerson2: TcxGridDBColumn;
|
|||
|
|
v1Column11: TcxGridDBColumn;
|
|||
|
|
v1Column12: TcxGridDBColumn;
|
|||
|
|
v1Column13: TcxGridDBColumn;
|
|||
|
|
v1Column14: TcxGridDBColumn;
|
|||
|
|
v1Column15: TcxGridDBColumn;
|
|||
|
|
v1Column16: TcxGridDBColumn;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1Column18: TcxGridDBColumn;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
Tv1Column3: TcxGridDBColumn;
|
|||
|
|
Tv1Column4: TcxGridDBColumn;
|
|||
|
|
v1ConNo: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
dxLayoutItem_ywy: TdxLayoutItem;
|
|||
|
|
dxLayoutItem_pm: TdxLayoutItem;
|
|||
|
|
ywy: TcxTextEdit;
|
|||
|
|
C_Name: TcxTextEdit;
|
|||
|
|
GPM_1: TcxGridPopupMenu;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
TV2SSel: TcxGridDBColumn;
|
|||
|
|
V2BuyConNo: TcxGridDBColumn;
|
|||
|
|
V2C_StyleNo: TcxGridDBColumn;
|
|||
|
|
V2C_Name: TcxGridDBColumn;
|
|||
|
|
V2C_EName: TcxGridDBColumn;
|
|||
|
|
v1C_ColorNo: TcxGridDBColumn;
|
|||
|
|
v1C_Color: TcxGridDBColumn;
|
|||
|
|
V2PRTCode: TcxGridDBColumn;
|
|||
|
|
TV2C_EColor: TcxGridDBColumn;
|
|||
|
|
v1OrdQty: TcxGridDBColumn;
|
|||
|
|
v1OrdUnit: TcxGridDBColumn;
|
|||
|
|
Tv2OrdSNote: TcxGridDBColumn;
|
|||
|
|
v1C_Pattern: TcxGridDBColumn;
|
|||
|
|
V2C_Width: TcxGridDBColumn;
|
|||
|
|
V2C_GramWeight: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
v1SOrddefstr2: TcxGridDBColumn;
|
|||
|
|
V2C_Spec: TcxGridDBColumn;
|
|||
|
|
V2JYRoll: TcxGridDBColumn;
|
|||
|
|
V2Column8: TcxGridDBColumn;
|
|||
|
|
V2Column9: TcxGridDBColumn;
|
|||
|
|
V2Column10: TcxGridDBColumn;
|
|||
|
|
V2Column11: TcxGridDBColumn;
|
|||
|
|
V2Column12: TcxGridDBColumn;
|
|||
|
|
V2Column13: TcxGridDBColumn;
|
|||
|
|
V2Column14: TcxGridDBColumn;
|
|||
|
|
TV2Column1: TcxGridDBColumn;
|
|||
|
|
TV2Column2: TcxGridDBColumn;
|
|||
|
|
TV2Column3: TcxGridDBColumn;
|
|||
|
|
TV2Column4: TcxGridDBColumn;
|
|||
|
|
TV2Column5: TcxGridDBColumn;
|
|||
|
|
TV2Column6: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
cxSplitter1: TcxSplitter;
|
|||
|
|
endDate: TcxDateEdit;
|
|||
|
|
begdate: TcxDateEdit;
|
|||
|
|
dxLayoutItem_beg: TdxLayoutItem;
|
|||
|
|
dxLayoutItem_end: TdxLayoutItem;
|
|||
|
|
dxLayoutItem_khdh: TdxLayoutItem;
|
|||
|
|
dxLayoutItem_hth: TdxLayoutItem;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
ADOQuerySub: TADOQuery;
|
|||
|
|
ORDER_SUB: TClientDataSet;
|
|||
|
|
GPM_2: TcxGridPopupMenu;
|
|||
|
|
Tcdgl: TToolButton;
|
|||
|
|
Ttoexcel: TToolButton;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
tv3: TcxGridDBTableView;
|
|||
|
|
tv3SSel: TcxGridDBColumn;
|
|||
|
|
tv3BuyConNo: TcxGridDBColumn;
|
|||
|
|
tv3C_StyleNo: TcxGridDBColumn;
|
|||
|
|
tv3C_Name: TcxGridDBColumn;
|
|||
|
|
tv3C_EName: TcxGridDBColumn;
|
|||
|
|
tv3C_ColorNo: TcxGridDBColumn;
|
|||
|
|
tv3C_Color: TcxGridDBColumn;
|
|||
|
|
tv3PRTCode: TcxGridDBColumn;
|
|||
|
|
tv3C_EColor: TcxGridDBColumn;
|
|||
|
|
tv3C_Pattern: TcxGridDBColumn;
|
|||
|
|
tv3OrdQty: TcxGridDBColumn;
|
|||
|
|
tv3OrdUnit: TcxGridDBColumn;
|
|||
|
|
tv3OrdSNote: TcxGridDBColumn;
|
|||
|
|
tv3C_Width: TcxGridDBColumn;
|
|||
|
|
tv3C_GramWeight: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn17: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn18: TcxGridDBColumn;
|
|||
|
|
tv3C_Spec: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn20: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn21: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn22: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn23: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn24: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn25: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn26: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn27: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn28: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn29: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn30: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn31: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn32: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn33: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
tv3OrderNo: TcxGridDBColumn;
|
|||
|
|
tv3custName: TcxGridDBColumn;
|
|||
|
|
tv3ordDate: TcxGridDBColumn;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ADOQueryMxList: TADOQuery;
|
|||
|
|
cxProgressBar1: TcxProgressBar;
|
|||
|
|
GPM_3: TcxGridPopupMenu;
|
|||
|
|
tv3ConNo: TcxGridDBColumn;
|
|||
|
|
cds_mxlist: TClientDataSet;
|
|||
|
|
Tfilter: TToolButton;
|
|||
|
|
Tbqyl: TToolButton;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
ADOQueryPrint: TADOQuery;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_1: TRMDBDataSet;
|
|||
|
|
Tupdateto: TToolButton;
|
|||
|
|
dxLayoutItem_batchno: TdxLayoutItem;
|
|||
|
|
batchNo: TcxTextEdit;
|
|||
|
|
FtyPCId: TcxTextEdit;
|
|||
|
|
dxLayoutItem_FtyPCId: TdxLayoutItem;
|
|||
|
|
tv3batchNo: TcxGridDBColumn;
|
|||
|
|
tv3FtyPCId: TcxGridDBColumn;
|
|||
|
|
TV2FtyPCId: TcxGridDBColumn;
|
|||
|
|
TV2batchNo: TcxGridDBColumn;
|
|||
|
|
Tv1rkroll: TcxGridDBColumn;
|
|||
|
|
Tv1rKQty: TcxGridDBColumn;
|
|||
|
|
Tv1rKJZ: TcxGridDBColumn;
|
|||
|
|
Tv1rKMZ: TcxGridDBColumn;
|
|||
|
|
TV2rKRoll: TcxGridDBColumn;
|
|||
|
|
TV2rKJZ: TcxGridDBColumn;
|
|||
|
|
TV2rKQty: TcxGridDBColumn;
|
|||
|
|
TV2rKMZ: TcxGridDBColumn;
|
|||
|
|
TV2Column7: TcxGridDBColumn;
|
|||
|
|
Tv1Column5: TcxGridDBColumn;
|
|||
|
|
tv3Column1: TcxGridDBColumn;
|
|||
|
|
Tv1Column6: TcxGridDBColumn;
|
|||
|
|
Tv1Column7: TcxGridDBColumn;
|
|||
|
|
Tv1Column8: TcxGridDBColumn;
|
|||
|
|
TV2Column8: TcxGridDBColumn;
|
|||
|
|
TV2Column9: TcxGridDBColumn;
|
|||
|
|
TV2Column10: TcxGridDBColumn;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
procedure TBAddClick(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure TbcgsClick(Sender: TObject);
|
|||
|
|
procedure btnCopyClick(Sender: TObject);
|
|||
|
|
procedure TBEditClick(Sender: TObject);
|
|||
|
|
procedure TBDelClick(Sender: TObject);
|
|||
|
|
procedure TdjszClick(Sender: TObject);
|
|||
|
|
procedure TBPrintClick(Sender: TObject);
|
|||
|
|
procedure TBCKClick(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure TWCClick(Sender: TObject);
|
|||
|
|
procedure TNowcClick(Sender: TObject);
|
|||
|
|
procedure TcdglClick(Sender: TObject);
|
|||
|
|
procedure TtoexcelClick(Sender: TObject);
|
|||
|
|
procedure cxPageControl1Click(Sender: TObject);
|
|||
|
|
procedure OrderNoPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure TfilterClick(Sender: TObject);
|
|||
|
|
procedure OrderNoPropertiesChange(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure TupdatetoClick(Sender: TObject);
|
|||
|
|
procedure ButtonEdit(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
canshu1, canshu2: string;
|
|||
|
|
fIsLoad: Boolean;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitMxGrid();
|
|||
|
|
procedure InitForm();
|
|||
|
|
procedure InitSub();
|
|||
|
|
function DelData(): Boolean;
|
|||
|
|
function DelSubData(): Boolean;
|
|||
|
|
procedure threadLoadform();
|
|||
|
|
public
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmTradePlanMgeList: TfrmTradePlanMgeList;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_TradePlanInPut, U_globalVar, U_FormLayOutDesign,
|
|||
|
|
U_TradeInspSet, U_AttachmentUpload, U_LabelPrint, U_ZDYHelp, U_iniParam,
|
|||
|
|
U_UptPlanDataToRoll, U_PictureUpload, U_PlanDR;
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.btnCopyClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
CopyInt := 99;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
fCopyMainId := FMainId;
|
|||
|
|
canshu1 := Self.canshu1;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
CopyInt := 99;
|
|||
|
|
FMainId := Trim(Self.cds_mxlist.fieldbyname('MainId').AsString);
|
|||
|
|
fCopyMainId := FMainId;
|
|||
|
|
canshu1 := Self.canshu1;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.cxPageControl1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
dxLayoutItem_khdh.Visible := false;
|
|||
|
|
dxLayoutItem_pm.Visible := false;
|
|||
|
|
dxLayoutItem_batchno.Visible := false;
|
|||
|
|
dxLayoutItem_FtyPCId.Visible := false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
dxLayoutItem_khdh.Visible := true;
|
|||
|
|
dxLayoutItem_pm.Visible := true;
|
|||
|
|
dxLayoutItem_batchno.Visible := true;
|
|||
|
|
dxLayoutItem_FtyPCId.Visible := true;
|
|||
|
|
end;
|
|||
|
|
TBRafresh.Click
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Action := cafree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
canshu1 := Trim(Self.fParameters1);
|
|||
|
|
cxGrid2.Height := 250;
|
|||
|
|
cxGrid1.Align := alClient;
|
|||
|
|
cxPageControl1.Align := alClient;
|
|||
|
|
cxPageControl1.ActivePageIndex := 0;
|
|||
|
|
cxGrid3.Align := alClient;
|
|||
|
|
// if cxPageControl1.ActivePageIndex = 0 then begin
|
|||
|
|
// dxLayoutItem_khdh.Visible := false;
|
|||
|
|
// dxLayoutItem_pm.Visible := false;
|
|||
|
|
// dxLayoutItem_batchno.Visible:=false;
|
|||
|
|
// dxLayoutItem_FtyPCId.Visible:=false;
|
|||
|
|
// end
|
|||
|
|
// else begin dxLayoutItem_khdh.Visible := true;
|
|||
|
|
// dxLayoutItem_pm.Visible := true;
|
|||
|
|
// dxLayoutItem_batchno.Visible:=true;
|
|||
|
|
// dxLayoutItem_FtyPCId.Visible:=true;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
frmTradePlanMgeList := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.FormShow(Sender: TObject);
|
|||
|
|
//var
|
|||
|
|
// mdesignCode :string;
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Tbcgs.Visible := gIsCanDesign;
|
|||
|
|
endDate.Date := SGetServerDate(ADOQueryBaseTemp);
|
|||
|
|
begdate.Date := endDate.Date - 10;
|
|||
|
|
// Scaleby(Screen.Width,1024);
|
|||
|
|
InitForm();
|
|||
|
|
|
|||
|
|
// addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl_query,7);
|
|||
|
|
// addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid3',dxLayoutControl_query,7);
|
|||
|
|
//threadLoadform();
|
|||
|
|
// mdesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) + '|' + 'cxgrid1';
|
|||
|
|
// addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl_query,7);
|
|||
|
|
//application.ProcessMessages;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
canshu1 := Self.canshu1;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBCKClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mMainId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mMainId := Trim(Self.cds_mxlist.fieldbyname('MainId').AsString);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 5;
|
|||
|
|
FMainId := Trim(mMainId);
|
|||
|
|
ToolBar2.Visible := false;
|
|||
|
|
TBSave.Visible := false;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if (canshu1 <> '<27><><EFBFBD><EFBFBD>') and (canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
with ADOQueryBaseTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Cloth_Inspect where isnull(mainID,'''')<>'''' and mainID=''' + Trim(Order_Main.fieldbyname('mainID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if not ADOQueryBaseTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ѽ<EFBFBD><D1BC>鲻<EFBFBD><E9B2BB>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(Order_Main.fieldbyname('MainId').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
DelData()
|
|||
|
|
end;
|
|||
|
|
Order_Main.Delete;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if (canshu1 <> '<27><><EFBFBD><EFBFBD>') and (canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
begin
|
|||
|
|
if Trim(cds_mxlist.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
with ADOQueryBaseTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Cloth_Inspect where isnull(mainID,'''')<>'''' and mainID=''' + Trim(cds_mxlist.fieldbyname('mainID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if not ADOQueryBaseTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ѽ<EFBFBD><D1BC>鲻<EFBFBD><E9B2BB>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(cds_mxlist.fieldbyname('subId').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
DelSubData()
|
|||
|
|
end;
|
|||
|
|
cds_mxlist.Delete;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBEditClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
if (canshu1 <> '<27><><EFBFBD><EFBFBD>') and (canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
FOrderNo := Trim(Self.Order_Main.fieldbyname('OrderNo').AsString);
|
|||
|
|
canshu1 := Self.canshu1;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
if (canshu1 <> '<27><><EFBFBD><EFBFBD>') and (canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
begin
|
|||
|
|
if Trim(cds_mxlist.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTradePlanInPut := TfrmTradePlanInPut.Create(Application);
|
|||
|
|
with frmTradePlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.cds_mxlist.fieldbyname('MainId').AsString);
|
|||
|
|
FOrderNo := Trim(Self.cds_mxlist.fieldbyname('OrderNo').AsString);
|
|||
|
|
canshu1 := Self.canshu1;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradePlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
WSql: string;
|
|||
|
|
mxIds: string;
|
|||
|
|
begin
|
|||
|
|
mxIds := '';
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
WSql := (Trim(Order_Main.fieldbyname('MainId').AsString));
|
|||
|
|
ORDER_SUB.First;
|
|||
|
|
while not ORDER_SUB.eof do
|
|||
|
|
begin
|
|||
|
|
if ORDER_SUB.FieldByName('SSel').AsBoolean then
|
|||
|
|
mxIds := trim(ORDER_SUB.FieldByName('subId').AsString) + ',' + mxIds;
|
|||
|
|
ORDER_SUB.Next;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
WSql := (Trim(cds_mxlist.fieldbyname('MainId').AsString));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
|||
|
|
with frmLabelPrint do
|
|||
|
|
begin
|
|||
|
|
FLMType := 'TradePlanPrint';
|
|||
|
|
FFiltration1 := WSql;
|
|||
|
|
FFiltrationSubs := mxIds;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
// Self.InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLabelPrint.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
InitGrid()
|
|||
|
|
else
|
|||
|
|
InitMxGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TcdglClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'WFBCD';
|
|||
|
|
flagname := '<27>õ<EFBFBD>';
|
|||
|
|
fnote := true;
|
|||
|
|
V1Note.Caption := 'Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TdjszClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mOrderNo, mMainId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mOrderNo := Trim(Order_Main.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(Order_Main.fieldbyname('mainId').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mOrderNo := Trim(cds_mxlist.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(cds_mxlist.fieldbyname('mainId').AsString);
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmTradeInspSet := TfrmTradeInspSet.Create(Application);
|
|||
|
|
with frmTradeInspSet do
|
|||
|
|
begin
|
|||
|
|
// caption:=mOrderNo+'<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'
|
|||
|
|
FDataID := mMainId;
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTradeInspSet.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TNowcClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mOrderNo, mMainId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mOrderNo := Trim(Order_Main.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(Order_Main.fieldbyname('mainId').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(cds_mxlist.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
mOrderNo := Trim(cds_mxlist.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(cds_mxlist.fieldbyname('mainId').AsString);
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryBaseCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Trade_Plan_Main SET status=''9'' ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(mMainId));
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(Trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(Trim(Self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + Trim(mOrderNo))));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TbcgsClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD><EFBFBD>ϸ<EFBFBD>б<EFBFBD>T3', tv3, gDllFileCaption);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>T1', Tv1, gDllFileCaption);
|
|||
|
|
WriteCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>T2', TV2, gDllFileCaption);
|
|||
|
|
end;
|
|||
|
|
if gIsCanDesign then
|
|||
|
|
begin
|
|||
|
|
saveLayOut(application, dxLayoutControl_query, ADOQueryBaseCmd, pwidechar(fDllFileName + '|' + Self.name + '|' + dxLayoutControl_query.name + '.ini'));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TtoexcelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if (cxPageControl1.ActivePageIndex = 0) then
|
|||
|
|
begin
|
|||
|
|
if cxGrid2.Focused then
|
|||
|
|
begin
|
|||
|
|
TcxGridToExcel(Self.Caption, cxGrid2);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
TcxGridToExcel(Self.Caption + '-<2D><>ϸ', cxGrid1);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
TcxGridToExcel(Self.Caption + '-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ', cxGrid3);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TfilterClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
conno.Tag := 2;
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Tv1.BeginUpdate();
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain, SLGetFilters(dxLayoutControl_query, 1, 2));
|
|||
|
|
Order_Main.EmptyDataSet;
|
|||
|
|
SInitCDSData(ADOQueryMain, Order_Main);
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
Tv1.EndUpdate;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
tv3.BeginUpdate();
|
|||
|
|
if ADOQueryMxList.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMxList, SLGetFilters(dxLayoutControl_query, 1, 2));
|
|||
|
|
cds_mxlist.EmptyDataSet;
|
|||
|
|
SInitCDSData(ADOQueryMxList, cds_mxlist);
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
tv3.EndUpdate;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TupdatetoClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mOrderNo, mMainId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mOrderNo := Trim(Order_Main.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(Order_Main.fieldbyname('mainId').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mOrderNo := Trim(cds_mxlist.fieldbyname('orderNo').AsString);
|
|||
|
|
mMainId := Trim(cds_mxlist.fieldbyname('mainId').AsString);
|
|||
|
|
end;
|
|||
|
|
frmUptPlanDataToRoll := TfrmUptPlanDataToRoll.create(Application);
|
|||
|
|
with frmUptPlanDataToRoll do
|
|||
|
|
begin
|
|||
|
|
fMainId := mMainId;
|
|||
|
|
cxTextEdit1.Text := trim(mOrderNo);
|
|||
|
|
showModal;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmPlanDR := TfrmPlanDR.Create(Application);
|
|||
|
|
with frmPlanDR do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmPlanDR.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.ToolButton4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mMainId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mMainId := Trim(Self.cds_mxlist.fieldbyname('MainId').AsString);
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmAttachmentUpload := TfrmAttachmentUpload.Create(Application);
|
|||
|
|
with frmAttachmentUpload do
|
|||
|
|
begin
|
|||
|
|
if Trim(canshu1) <> '<27><>ѯ' then
|
|||
|
|
FEditAuthority := true;
|
|||
|
|
fkeyNO := Trim(mMainId);
|
|||
|
|
fType := 'ָʾ<D6B8><CABE>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmAttachmentUpload.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
begin
|
|||
|
|
if fIsLoad then
|
|||
|
|
InitSub();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.TWCClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryBaseCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Trade_Plan_Main SET status=''10'' ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(Trim(Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(Trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(Trim(Self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + Trim(Order_Main.fieldbyname('orderNO').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(cds_mxlist.fieldbyname('Filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryBaseCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Trade_Plan_Main SET status=''10'' ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(Trim(cds_mxlist.fieldbyname('mainID').AsString)));
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(Trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(Trim(Self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + Trim(cds_mxlist.fieldbyname('orderNO').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɳɹ<C9B3><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.ButtonEdit(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
try
|
|||
|
|
frmPictureUpload := TfrmPictureUpload.Create(Application);
|
|||
|
|
with frmPictureUpload do
|
|||
|
|
begin
|
|||
|
|
fFlileFlag := UserDataFlag + 'HX';
|
|||
|
|
FWidth := 250;
|
|||
|
|
FHeight := 300;
|
|||
|
|
FTFType := 'HX';
|
|||
|
|
FDataId := Trim(Self.ORDER_SUB.fieldbyname('subId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmPictureUpload.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.InitGrid();
|
|||
|
|
var
|
|||
|
|
strwhere: string;
|
|||
|
|
mStatus: string;
|
|||
|
|
begin
|
|||
|
|
strwhere := '';
|
|||
|
|
mStatus := cxTabControl1.Tabs[cxTabControl1.TabIndex].Caption;
|
|||
|
|
ConNo.Tag := 99;
|
|||
|
|
batchNo.Tag := 99;
|
|||
|
|
FtyPCId.Tag := 99;
|
|||
|
|
strwhere := SLGetFilters(dxLayoutControl_query, 1, 2);
|
|||
|
|
if Trim(strwhere) <> '' then
|
|||
|
|
begin
|
|||
|
|
strwhere := ' and ' + Trim(strwhere);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if (Trim(DParameters1) <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
strwhere := strwhere + ' and A.Filler=' + quotedstr(Trim(DName));
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
Tv1.BeginUpdate();
|
|||
|
|
fIsLoad := false;
|
|||
|
|
loadProcess.Visible := true;
|
|||
|
|
loadProcess.Refresh;
|
|||
|
|
|
|||
|
|
Order_Main.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
close;
|
|||
|
|
Filtered := false;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_View_TradePlanList_for_pack :timeType, :begdate,:enddate,:mStatus,:WSql');
|
|||
|
|
Parameters.ParamByName('timeType').Value := '<27>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
Parameters.ParamByName('begdate').Value := FormatDateTime('yyyy-MM-dd', begdate.Date);
|
|||
|
|
Parameters.ParamByName('enddate').Value := FormatDateTime('yyyy-MM-dd', endDate.Date + 1);
|
|||
|
|
Parameters.ParamByName('mStatus').Value := mStatus;
|
|||
|
|
Parameters.ParamByName('WSql').Value := strwhere;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
// if Order_Main.Fields.Count<=1 then
|
|||
|
|
SCreateCDS(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData(ADOQueryMain, Order_Main);
|
|||
|
|
finally
|
|||
|
|
Tv1.DataController.Filter.Clear;
|
|||
|
|
Order_Main.EnableControls;
|
|||
|
|
|
|||
|
|
Tv1.EndUpdate;
|
|||
|
|
TV1.Controller.GoToFirst();
|
|||
|
|
fIsLoad := true;
|
|||
|
|
InitSub();
|
|||
|
|
|
|||
|
|
loadProcess.Visible := false;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.InitForm();
|
|||
|
|
begin
|
|||
|
|
addQryContionByLay(ADOQueryBaseTemp, fformId, 'cxgrid1', dxLayoutControl_query, 7);
|
|||
|
|
addQryContionByLay(ADOQueryBaseTemp, fformId, 'cxgrid3', dxLayoutControl_query, 7);
|
|||
|
|
ReadCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>T1', Tv1, gDllFileCaption);
|
|||
|
|
ReadCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>T2', TV2, gDllFileCaption);
|
|||
|
|
ReadCxGrid('<27><>װָʾ<D6B8><CABE><EFBFBD><EFBFBD>ϸ<EFBFBD>б<EFBFBD>T3', tv3, gDllFileCaption);
|
|||
|
|
//
|
|||
|
|
InitGrid();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.InitSub();
|
|||
|
|
begin
|
|||
|
|
ADOQuerySub.close;
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
TV2.BeginUpdate();
|
|||
|
|
ORDER_SUB.DisableControls;
|
|||
|
|
with ADOQuerySub do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_View_TradePlanMxList_for_pack ');
|
|||
|
|
sql.Add('@mainId =' + quotedstr((Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
// if ORDER_SUB.Fields.Count<=1 then
|
|||
|
|
SCreateCDS(ADOQuerySub, ORDER_SUB);
|
|||
|
|
SInitCDSData(ADOQuerySub, ORDER_SUB);
|
|||
|
|
finally
|
|||
|
|
ORDER_SUB.EnableControls;
|
|||
|
|
TV2.EndUpdate;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
//
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.N1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FLabVolume, fPrintFile, mSubId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if ORDER_SUB.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mSubId := Trim(ORDER_SUB.fieldbyname('SUBID').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mSubId := Trim(cds_mxlist.fieldbyname('SUBID').AsString);
|
|||
|
|
end;
|
|||
|
|
//
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' EXEC P_Trade_Print_djd_Lab ');
|
|||
|
|
sql.Add(' @CIID=''' + mSubId + '''');
|
|||
|
|
sql.Add(',@isTest =1');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(ADOQueryPrint.fieldbyname('SLabVolume').AsString) <> '' then
|
|||
|
|
FLabVolume := Trim(ADOQueryPrint.fieldbyname('SLabVolume').AsString)
|
|||
|
|
else
|
|||
|
|
FLabVolume := Trim(ADOQueryPrint.fieldbyname('LabVolume').AsString);
|
|||
|
|
|
|||
|
|
if FLabVolume = '' then
|
|||
|
|
FLabVolume := trim(gDefaultLableFile);
|
|||
|
|
if FLabVolume = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>δ<EFBFBD><CEB4><EFBFBD>þ<EFBFBD><C3BE><EFBFBD>ǩ<EFBFBD><C7A9>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ExportFtErpFile(FLabVolume + '.rmf', ADOQueryBaseTemp);
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + FLabVolume + '.rmf';
|
|||
|
|
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
if Trim(ADOQueryPrint.fieldbyname('LabVolume').AsString) <> '<27><>Ʒ<EFBFBD><C6B7>ǩ' then
|
|||
|
|
RM1.DefaultCopies := 2
|
|||
|
|
else
|
|||
|
|
RM1.DefaultCopies := 1;
|
|||
|
|
RM1.ShowErrorMsg := false;
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.N2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
MLabPackage, fPrintFile, mSubId: string;
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
if ORDER_SUB.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mSubId := Trim(ORDER_SUB.fieldbyname('SUBID').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if cds_mxlist.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
mSubId := Trim(cds_mxlist.fieldbyname('SUBID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryPrint do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Trade_Insp_Prt_djd_PackLab_test ');
|
|||
|
|
sql.Add('@subId =' + quotedstr(mSubId));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if Trim(ADOQueryPrint.fieldbyname('SLabPackage').AsString) <> '' then
|
|||
|
|
MLabPackage := Trim(ADOQueryPrint.fieldbyname('SLabPackage').AsString)
|
|||
|
|
else
|
|||
|
|
MLabPackage := Trim(ADOQueryPrint.fieldbyname('LabPackage').AsString);
|
|||
|
|
if MLabPackage = '' then
|
|||
|
|
MLabPackage := trim(gDefaultPackLableFile);
|
|||
|
|
if MLabPackage = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>δ<EFBFBD><CEB4><EFBFBD>ð<EFBFBD><C3B0><EFBFBD>ǩ<EFBFBD><C7A9>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ExportFtErpFile(Trim(MLabPackage) + '.rmf', ADOQueryBaseTemp);
|
|||
|
|
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(MLabPackage) + '.rmf';
|
|||
|
|
if not FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.DefaultCopies := 1;
|
|||
|
|
RM1.ShowErrorMsg := false;
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.OrderNoPropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Tfilter.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.OrderNoPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.InitMxGrid();
|
|||
|
|
var
|
|||
|
|
strwhere: string;
|
|||
|
|
mStatus: string;
|
|||
|
|
begin
|
|||
|
|
strwhere := '';
|
|||
|
|
try
|
|||
|
|
loadProcess.Visible := true;
|
|||
|
|
loadProcess.Refresh;
|
|||
|
|
tv3.BeginUpdate();
|
|||
|
|
ConNo.Tag := 2;
|
|||
|
|
batchNo.Tag := 2;
|
|||
|
|
FtyPCId.Tag := 2;
|
|||
|
|
strwhere := SLGetFilters(dxLayoutControl_query, 1, 2);
|
|||
|
|
if Trim(strwhere) <> '' then
|
|||
|
|
begin
|
|||
|
|
strwhere := ' and ' + Trim(strwhere);
|
|||
|
|
end;
|
|||
|
|
mStatus := cxTabControl1.Tabs[cxTabControl1.TabIndex].Caption;
|
|||
|
|
if (Trim(DParameters1) <> '<27><>Ȩ<EFBFBD><C8A8>') then
|
|||
|
|
strwhere := strwhere + ' and A.Filler=' + quotedstr(Trim(DName));
|
|||
|
|
|
|||
|
|
cds_mxlist.DisableControls;
|
|||
|
|
with ADOQueryMxList do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
Filtered := false;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_View_TradePlanMxList_for_pack :timeType, :begdate,:enddate,:mStatus,:WSql');
|
|||
|
|
Parameters.ParamByName('timeType').Value := '<27>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
Parameters.ParamByName('begdate').Value := FormatDateTime('yyyy-MM-dd', begdate.Date);
|
|||
|
|
Parameters.ParamByName('enddate').Value := FormatDateTime('yyyy-MM-dd', endDate.Date + 1);
|
|||
|
|
Parameters.ParamByName('mStatus').Value := mStatus;
|
|||
|
|
// if strwhere<> then
|
|||
|
|
Parameters.ParamByName('WSql').Value := ' ' + strwhere;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
// if cds_mxlist.Fields.Count<=1 then
|
|||
|
|
SCreateCDS(ADOQueryMxList, cds_mxlist);
|
|||
|
|
SInitCDSData(ADOQueryMxList, cds_mxlist);
|
|||
|
|
|
|||
|
|
cds_mxlist.EnableControls;
|
|||
|
|
|
|||
|
|
tv3.DataController.Filter.Clear;
|
|||
|
|
finally
|
|||
|
|
TV3.Controller.GoToFirst();
|
|||
|
|
tv3.EndUpdate;
|
|||
|
|
loadProcess.Visible := false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmTradePlanMgeList.DelData(): Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result := false;
|
|||
|
|
ADOQueryBaseCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryBaseCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete Trade_Plan_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
sql.Add('delete Trade_Plan_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
sql.Add('delete Trade_Plan_Fty where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(Trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(Trim(Self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('ָʾ<D6B8><CABE>ɾ<EFBFBD><C9BE>')));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('ָʾ<D6B8><CABE><EFBFBD>ţ<EFBFBD>' + Trim(Order_Main.fieldbyname('OrderNO').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ADOQueryBaseCmd.Connection.CommitTrans;
|
|||
|
|
Result := true;
|
|||
|
|
except
|
|||
|
|
ADOQueryBaseCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
/////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
function TfrmTradePlanMgeList.DelSubData(): Boolean;
|
|||
|
|
var
|
|||
|
|
mSubId: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result := false;
|
|||
|
|
mSubId := Trim(cds_mxlist.fieldbyname('subId').AsString);
|
|||
|
|
ADOQueryBaseCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryBaseCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
// sql.Add('delete Trade_Plan_Main where MainId=''' +
|
|||
|
|
// Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
sql.Add('delete Trade_Plan_Sub where MainId=' + quotedstr(Trim(cds_mxlist.fieldbyname('MainId').AsString)));
|
|||
|
|
sql.Add('and subId=' + quotedstr(mSubId));
|
|||
|
|
// sql.Add('delete Trade_Plan_Fty where MainId=''' +
|
|||
|
|
// Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(Trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(Trim(Self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('ָʾ<D6B8><CABE>ɾ<EFBFBD><C9BE>')));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('ָʾ<D6B8><CABE><EFBFBD>ţ<EFBFBD>' + Trim(Order_Main.fieldbyname('OrderNO').AsString) + ';<3B><>ϸid=' + mSubId)));
|
|||
|
|
sql.Add(',' + quotedstr(Trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ADOQueryBaseCmd.Connection.CommitTrans;
|
|||
|
|
Result := true;
|
|||
|
|
except
|
|||
|
|
ADOQueryBaseCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
procedure TfrmTradePlanMgeList.threadLoadform();
|
|||
|
|
var
|
|||
|
|
thread: TThread;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
thread := TThread.CreateAnonymousThread(
|
|||
|
|
procedure
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
close;
|
|||
|
|
Filtered := false;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_View_TradePlanList_for_pack :timeType, :begdate,:enddate,:mStatus,:WSql');
|
|||
|
|
Parameters.ParamByName('timeType').Value := '<27>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
Parameters.ParamByName('begdate').Value := FormatDateTime('yyyy-MM-dd', begdate.Date);
|
|||
|
|
Parameters.ParamByName('enddate').Value := FormatDateTime('yyyy-MM-dd', endDate.Date + 1);
|
|||
|
|
Parameters.ParamByName('mStatus').Value := '';
|
|||
|
|
Parameters.ParamByName('WSql').Value := '';
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end);
|
|||
|
|
|
|||
|
|
thread.FreeOnTerminate := True;
|
|||
|
|
thread.Start;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|