1801 lines
51 KiB
ObjectPascal
1801 lines
51 KiB
ObjectPascal
![]() |
unit U_OrderInPutPrice;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
|||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
|||
|
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
|||
|
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
|||
|
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxPC, cxGridCustomPopupMenu,
|
|||
|
cxGridPopupMenu, cxDropDownEdit,jpeg,IdGlobal, RM_Common, RM_Class,
|
|||
|
RM_e_Xls, RM_System, RM_GridReport, RM_Dataset, cxCheckBox,
|
|||
|
cxLookAndFeels, cxLookAndFeelPainters, dxBarBuiltInMenu, cxNavigator,
|
|||
|
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
|||
|
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|||
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
|
|||
|
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
|
|||
|
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
|||
|
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
|||
|
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
|||
|
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
|||
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter;
|
|||
|
|
|||
|
type
|
|||
|
TfrmOrderInPutPrice = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBSave: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
ADOTemp: TADOQuery;
|
|||
|
ADOCmd: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
Order_Sub: TClientDataSet;
|
|||
|
ADOQuery1: TADOQuery;
|
|||
|
cxPageControl1: TcxPageControl;
|
|||
|
cxTabSheet1: TcxTabSheet;
|
|||
|
ToolBar2: TToolBar;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
Label10: TLabel;
|
|||
|
Label3: TLabel;
|
|||
|
Label14: TLabel;
|
|||
|
Label12: TLabel;
|
|||
|
Label13: TLabel;
|
|||
|
Label2: TLabel;
|
|||
|
Label6: TLabel;
|
|||
|
Label21: TLabel;
|
|||
|
Label25: TLabel;
|
|||
|
Label43: TLabel;
|
|||
|
OrderNo: TEdit;
|
|||
|
ConNoHZ: TEdit;
|
|||
|
OrdDate: TDateTimePicker;
|
|||
|
ChuanY: TBtnEditC;
|
|||
|
DLYDate: TDateTimePicker;
|
|||
|
YWY: TBtnEditC;
|
|||
|
Label4: TLabel;
|
|||
|
Note: TMemo;
|
|||
|
CDS_JGLC: TClientDataSet;
|
|||
|
DataSource2: TDataSource;
|
|||
|
CDS_JGC: TClientDataSet;
|
|||
|
DataSource3: TDataSource;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
cxGridPopupMenu3: TcxGridPopupMenu;
|
|||
|
MPRTCodeName: TEdit;
|
|||
|
MPRTSpec: TEdit;
|
|||
|
Label7: TLabel;
|
|||
|
MPRTCF: TEdit;
|
|||
|
MPRTMF: TEdit;
|
|||
|
MPRTKZ: TEdit;
|
|||
|
CustomerNoName: TBtnEditA;
|
|||
|
Label8: TLabel;
|
|||
|
Label11: TLabel;
|
|||
|
ComTaiTou: TBtnEditA;
|
|||
|
Label18: TLabel;
|
|||
|
LiDanPerson: TBtnEditA;
|
|||
|
Panel4: TPanel;
|
|||
|
CheckBox1: TCheckBox;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
Label42: TLabel;
|
|||
|
ZLLevel: TBtnEditA;
|
|||
|
Label44: TLabel;
|
|||
|
SCYaoSu: TMemo;
|
|||
|
ScrollBox1: TScrollBox;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v1Column14: TcxGridDBColumn;
|
|||
|
v1Column20: TcxGridDBColumn;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
v1PRTColor: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
v1OrderUnit: TcxGridDBColumn;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
Panel2: TPanel;
|
|||
|
Button1: TButton;
|
|||
|
Button2: TButton;
|
|||
|
cxGrid4: TcxGrid;
|
|||
|
Tv11: TcxGridDBTableView;
|
|||
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
cxGridDBColumn13: TcxGridDBColumn;
|
|||
|
v11Column1: TcxGridDBColumn;
|
|||
|
cxGridLevel3: TcxGridLevel;
|
|||
|
ClientDataSet11: TClientDataSet;
|
|||
|
DataSource11: TDataSource;
|
|||
|
cxGridPopupMenu11: TcxGridPopupMenu;
|
|||
|
ClientDataSet1: TClientDataSet;
|
|||
|
ClientDataSet2: TClientDataSet;
|
|||
|
Label5: TLabel;
|
|||
|
MPRTMFNote: TEdit;
|
|||
|
Label16: TLabel;
|
|||
|
BZNote: TBtnEditA;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
Label9: TLabel;
|
|||
|
KHNameJC: TEdit;
|
|||
|
MPRTCode: TBtnEditA;
|
|||
|
Label17: TLabel;
|
|||
|
BPPiZhong: TEdit;
|
|||
|
Label19: TLabel;
|
|||
|
ToolButton9: TToolButton;
|
|||
|
ToolButton12: TToolButton;
|
|||
|
Label20: TLabel;
|
|||
|
Label22: TLabel;
|
|||
|
PBFactoryName: TBtnEditA;
|
|||
|
JGFactoryName: TBtnEditA;
|
|||
|
cxTabSheet3: TcxTabSheet;
|
|||
|
ToolBar4: TToolBar;
|
|||
|
ToolButton6: TToolButton;
|
|||
|
ToolButton7: TToolButton;
|
|||
|
ScrollBox3: TScrollBox;
|
|||
|
ToolBar3: TToolBar;
|
|||
|
ToolButton8: TToolButton;
|
|||
|
ToolButton10: TToolButton;
|
|||
|
ToolButton4: TToolButton;
|
|||
|
ToolButton5: TToolButton;
|
|||
|
ToolButton11: TToolButton;
|
|||
|
cxGrid3: TcxGrid;
|
|||
|
Tv3: TcxGridDBTableView;
|
|||
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
v3Column1: TcxGridDBColumn;
|
|||
|
v3Column8: TcxGridDBColumn;
|
|||
|
Tv3Column1: TcxGridDBColumn;
|
|||
|
v3Column2: TcxGridDBColumn;
|
|||
|
v3Column3: TcxGridDBColumn;
|
|||
|
v3Column5: TcxGridDBColumn;
|
|||
|
v3Column6: TcxGridDBColumn;
|
|||
|
v3Column7: TcxGridDBColumn;
|
|||
|
v3Column9: TcxGridDBColumn;
|
|||
|
v3Column10: TcxGridDBColumn;
|
|||
|
v3Column4: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
Panel6: TPanel;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv2: TcxGridDBTableView;
|
|||
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
cxGridLevel2: TcxGridLevel;
|
|||
|
MPRTKZNote: TBtnEditA;
|
|||
|
v1PrtColorNo: TcxGridDBColumn;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
procedure v1PRTColorPropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure CustomerNoNameBtnDnClick(Sender: TObject);
|
|||
|
procedure OrdDefStr2BtnUpClick(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure YCLFactoryBtnUpClick(Sender: TObject);
|
|||
|
procedure MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
|
|||
|
procedure ToolButton6Click(Sender: TObject);
|
|||
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
procedure ToolButton8Click(Sender: TObject);
|
|||
|
procedure cxGridDBColumn6PropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
procedure ToolButton7Click(Sender: TObject);
|
|||
|
procedure Tv2CellClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure ToolButton10Click(Sender: TObject);
|
|||
|
procedure ToolButton11Click(Sender: TObject);
|
|||
|
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
procedure ComTaiTouBtnClick(Sender: TObject);
|
|||
|
procedure LiDanPersonBtnClick(Sender: TObject);
|
|||
|
procedure v3Column1PropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
procedure ZLLevelBtnClick(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure BZNoteBtnClick(Sender: TObject);
|
|||
|
procedure CustomerNoNameBtnClick(Sender: TObject);
|
|||
|
procedure MPRTCodeBtnClick(Sender: TObject);
|
|||
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
|
|||
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
procedure ToolButton9Click(Sender: TObject);
|
|||
|
procedure v1Column2PropertiesEditValueChanged(Sender: TObject);
|
|||
|
procedure ToolButton12Click(Sender: TObject);
|
|||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure PBFactoryNameBtnClick(Sender: TObject);
|
|||
|
procedure JGFactoryNameBtnClick(Sender: TObject);
|
|||
|
procedure MPRTKZNoteBtnClick(Sender: TObject);
|
|||
|
private
|
|||
|
CanShu1,CanShu2,ConPrice:String;
|
|||
|
FJSFlag:Boolean;
|
|||
|
procedure InitData();
|
|||
|
function SaveData():Boolean;
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
PState,CopyInt,PriceFlag,DRInt,JYInt:Integer;
|
|||
|
FMainId,FFMainId,FOrderNo,ConSubId,DataType:String;
|
|||
|
FXS:Integer;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
var
|
|||
|
frmOrderInPutPrice: TfrmOrderInPutPrice;
|
|||
|
newh:hwnd;
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel,U_OrderSubSel,U_ContractSelList,
|
|||
|
U_GYSList, U_ZdyAttachment, U_CPManageFMSel;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
WriteCxGrid('ָʾ<D6B8><CABE>¼<EFBFBD><C2BC>1',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
WriteCxGrid('<27>ӹ<EFBFBD><D3B9><EFBFBD>¼<EFBFBD><C2BC>',Tv3,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.InitData();
|
|||
|
begin
|
|||
|
ReadCxGrid('ָʾ<D6B8><CABE>¼<EFBFBD><C2BC>1',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
ReadCxGrid('<27>ӹ<EFBFBD><D3B9><EFBFBD>¼<EFBFBD><C2BC>',Tv3,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
cxPageControl1.ActivePageIndex:=0;
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select * from JYOrder_Sub where 1=1 ');
|
|||
|
if PState=1 then
|
|||
|
begin
|
|||
|
sql.Add(' and MainId='''+Trim(FMainId)+'''');
|
|||
|
end;
|
|||
|
if PState=0 then
|
|||
|
begin
|
|||
|
sql.Add(' and 1=2');
|
|||
|
end;
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQuery1,Order_Sub);
|
|||
|
SInitCDSData20(ADOQuery1,Order_Sub);
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.* ');
|
|||
|
sql.Add(',ConNoHZ=[dbo].[F_Get_Order_SubStr](A.MainId,''ConNoHZ'') ');
|
|||
|
sql.Add(',KHConNoHZ=[dbo].[F_Get_Order_SubStr](A.MainId,''KHConNoHZ'') ');
|
|||
|
SQL.Add(' from JYOrder_Main A where MainId='''+Trim(FMainId)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCSHDataNew(ADOQuery1,Panel1,2);
|
|||
|
PBFactoryName.TxtCode:=Trim(ADOQuery1.fieldbyname('PBFactoryNo').asstring);
|
|||
|
JGFactoryName.TxtCode:=Trim(ADOQuery1.fieldbyname('JGFactoryNo').asstring);
|
|||
|
ConNoHZ.Text:=Trim(ADOQuery1.fieldbyname('ConNoHZ').AsString);
|
|||
|
OrderNo.Text:=Trim(ADOQuery1.fieldbyname('OrderNo').AsString);
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
if CopyInt<>99 then
|
|||
|
sql.Add('select * from JYOrder_Process where MainId='''+Trim(FMainId)+'''')
|
|||
|
else
|
|||
|
sql.Add('select * from JYOrder_Process where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQuery1,CDS_JGLC);
|
|||
|
SInitCDSData20(ADOQuery1,CDS_JGLC);
|
|||
|
if PState=0 then
|
|||
|
begin
|
|||
|
OrdDate.DateTime:=SGetServerDateTime(ADOTemp);
|
|||
|
DlyDate.DateTime:=OrdDate.DateTime;
|
|||
|
LiDanPerson.Text:=Trim(DName);
|
|||
|
end else
|
|||
|
begin
|
|||
|
end;
|
|||
|
if CopyInt=99 then
|
|||
|
begin
|
|||
|
PState:=0;
|
|||
|
FMainId:='';
|
|||
|
OrderNo.Text:='';
|
|||
|
ConNoHZ.Text:='';
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('MainId').Value:='';
|
|||
|
FieldByName('SubId').Value:='';
|
|||
|
Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
InitData();
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmOrderInPutPrice.SaveData():Boolean;
|
|||
|
var
|
|||
|
maxno,maxsubno,maxJDNo,JDMainId,maxjfno,maxjcno,FOrderNo:String;
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOCmd.Connection.BeginTrans;
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if Trim(FMainId)='' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOCmd,maxno,'JM','JYOrder_Main',2,1)=False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
maxno:=Trim(FMainId);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JYOrder_Main where MainId='''+Trim(FMainId)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(FMainId)='' then
|
|||
|
begin
|
|||
|
Append;
|
|||
|
end
|
|||
|
else begin
|
|||
|
Edit;
|
|||
|
end;
|
|||
|
FieldByName('MainId').Value:=Trim(maxno);
|
|||
|
if Trim(ConSubId)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('ConSubId').Value:=Trim(ConSubId);
|
|||
|
end;
|
|||
|
RTSetsavedata(ADOCmd,'JYOrder_Main',Panel1,2);
|
|||
|
FieldByName('PBFactoryNo').Value:=Trim(PBFactoryName.TxtCode);
|
|||
|
FieldByName('JGFactoryNo').Value:=Trim(JGFactoryName.TxtCode);
|
|||
|
FieldByName('CustomerNo').Value:=Trim(CustomerNoName.TxtCode);
|
|||
|
if Trim(FMainId)='' then
|
|||
|
begin
|
|||
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
end else
|
|||
|
begin
|
|||
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
end;
|
|||
|
FieldByName('Note').Value:=Trim(Note.Text);
|
|||
|
FieldByName('OrderNo').Value:=Trim(OrderNo.Text);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_Main where orderno='''+Trim(OrderNo.Text)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTemp.RecordCount>1 then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOCmd,maxsubno,'JS','JYOrder_Sub',4,1)=False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
maxsubno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JYOrder_Sub where SubId='''+Trim(maxsubno)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
|||
|
Append
|
|||
|
else
|
|||
|
Edit;
|
|||
|
FieldByName('MainId').Value:=Trim(maxno);
|
|||
|
FieldByName('SubId').Value:=Trim(maxsubno);
|
|||
|
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'JYOrder_Sub',0);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Order_Sub.Edit;
|
|||
|
Order_Sub.FieldByName('SubId').Value:=Trim(maxsubno);
|
|||
|
//Order_Sub.Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD>
|
|||
|
with CDS_JGLC do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)='' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOCmd,maxsubno,'PS','JYOrder_Process',4,1)=False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
maxsubno:=Trim(CDS_JGLC.fieldbyname('PSId').AsString);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JYOrder_Process where PSId='''+Trim(maxsubno)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)='' then
|
|||
|
Append
|
|||
|
else
|
|||
|
Edit;
|
|||
|
FieldByName('MainId').Value:=Trim(maxno);
|
|||
|
FieldByName('PSId').Value:=Trim(maxsubno);
|
|||
|
RTSetSaveDataCDS(ADOCmd,Tv2,CDS_JGLC,'JYOrder_Process',0);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
CDS_JGLC.Edit;
|
|||
|
CDS_JGLC.FieldByName('PSId').Value:=Trim(maxsubno);
|
|||
|
CDS_JGLC.FieldByName('MainId').Value:=Trim(maxno);
|
|||
|
//Order_Sub.Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ADOCmd.Connection.CommitTrans;
|
|||
|
Result:=True;
|
|||
|
FMainId:=Trim(maxno);
|
|||
|
except
|
|||
|
Result:=False;
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.TBSaveClick(Sender: TObject);
|
|||
|
var
|
|||
|
FReal:Double;
|
|||
|
I:integer;
|
|||
|
JC:String;
|
|||
|
begin
|
|||
|
ToolBar1.SetFocus;
|
|||
|
if Trim(OrderNo.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('ָʾ<D6B8><CABE><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(CustomerNoName.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(JGFactoryName.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(MPRTSpec.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(KHNameJC.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
JC:=Trim(KHNameJC.Text);
|
|||
|
for i:=1 to Length(JC) do
|
|||
|
begin
|
|||
|
if bytetype(JC,i)<>mbsinglebyte then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2>ܺ<EFBFBD><DCBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(ComTaiTou.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>˾̧ͷ<CCA7><CDB7><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(YWY.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('ҵ<><D2B5>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(LiDanPerson.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(MPRTCodeName.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(BZNote.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>װҪ<D7B0><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(MPRTMF.Text)<>'' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(MPRTMF.Text,FReal)=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(MPRTKZ.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Order_Sub.Locate('PRTOrderQty',Null,[])=True then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Order_Sub.Locate('OrderUnit',Null,[])=True then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Order_Sub.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if SaveData() then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
end;
|
|||
|
begin
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrderQty,B.OrderUnit from JYOrder_PCS_Sub A ');
|
|||
|
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
|
|||
|
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
|
|||
|
SQL.Add(' and isnull(A.CKName,'''')<>''<27><><EFBFBD>ڲֿ<DAB2>'' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQuery1,CDS_JGC);
|
|||
|
SInitCDSData20(ADOQuery1,CDS_JGC);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.v1PRTColorPropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='OrdColor';
|
|||
|
flagname:='<27><>ɫ';
|
|||
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
V1Note.Caption:='Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
MainType:=Trim(DName);
|
|||
|
fnote:=True;
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
Self.Order_Sub.Edit;
|
|||
|
Self.Order_Sub.FieldByName('PRTColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
Self.Order_Sub.FieldByName('PRTColorEng').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton1Click(Sender: TObject);
|
|||
|
var
|
|||
|
FReal:Double;
|
|||
|
i,j,z:Integer;
|
|||
|
jstr:string;
|
|||
|
begin
|
|||
|
ToolBar1.SetFocus;
|
|||
|
{if Trim(OrderNo.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;}
|
|||
|
if CheckBox1.Checked then
|
|||
|
begin
|
|||
|
if Order_Sub.IsEmpty then
|
|||
|
begin
|
|||
|
j:=1;
|
|||
|
end else
|
|||
|
begin
|
|||
|
z:=Pos('#',Trim(Order_Sub.fieldbyname('PRTColorNo').AsString));
|
|||
|
jstr:=Copy(Trim(Order_Sub.fieldbyname('PRTColorNo').AsString),2,z-2);
|
|||
|
if Trim(jstr)<>'' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(jstr,FReal)=True then
|
|||
|
begin
|
|||
|
j:=StrToInt(jstr)+1;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
j:=1;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CopyAddRow(Tv1,Order_Sub);
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
//FieldByName('PRTColor').Value:='';
|
|||
|
//FieldByName('PRTOrdQty').Value:=null;
|
|||
|
//FieldByName('PRTColorNo').Value:=null;
|
|||
|
//FieldByName('PRTColorEng').Value:=null;
|
|||
|
//FieldByName('PRTHX').Value:=null;
|
|||
|
FieldByName('SubId').Value:='';
|
|||
|
if CheckBox1.Checked then
|
|||
|
begin
|
|||
|
FieldByName('PRTColorNo').Value:='C'+Trim(IntToStr(j))+'#';
|
|||
|
end;
|
|||
|
if Trim(ConPrice)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Price').Value:=ConPrice;
|
|||
|
end;
|
|||
|
FieldByName('XHInt').Value:=Order_Sub.RecordCount;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Sub.IsEmpty then Exit;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where CO.SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
sql.Add(' and isnull(CO.SubId,'''')<>'''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if adoTemp.IsEmpty=False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>','<27><>ʾ');
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)<>'' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_Sub where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Order_Sub.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.CustomerNoNameBtnDnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
TBtnEditC(Sender).Text:='';
|
|||
|
TBtnEditC(Sender).TxtCode:='';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.OrdDefStr2BtnUpClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj:string;
|
|||
|
FWZ:Integer;
|
|||
|
begin
|
|||
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
FWZ:=Pos('/',fsj);
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
if Trim(flag)='OrdDefStr2' then
|
|||
|
begin
|
|||
|
//flag:='OrdDefStr2';
|
|||
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
V1Note.Caption:='Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
fnote:=True;
|
|||
|
end;
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
if Trim(flag)='MPRTCode' then
|
|||
|
begin
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select Top 1 * from JYOrder_Main where MPRTCode='''+Trim(ClientDataSet1.fieldbyname('ZDYName').AsString)+'''');
|
|||
|
sql.Add(' order by FillTime desc');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
MPRTCodeName.Text:=ADOTemp.fieldbyname('MPRTCodeName').Value;
|
|||
|
MPRTMF.Text:=ADOTemp.fieldbyname('MPRTMF').Value;
|
|||
|
MPRTKZ.Text:=ADOTemp.fieldbyname('MPRTKZ').Value;
|
|||
|
MPRTSpec.Text:=ADOTemp.fieldbyname('MPRTSpec').Value;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Sub.IsEmpty then Exit;
|
|||
|
ToolBar1.SetFocus;
|
|||
|
OneKeyPost(Tv1,Order_Sub);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.YCLFactoryBtnUpClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj:string;
|
|||
|
FWZ:Integer;
|
|||
|
begin
|
|||
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
FWZ:=Pos('/',fsj);
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
MainType:=TEdit(Sender).Name;
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj:string;
|
|||
|
FWZ:Integer;
|
|||
|
begin
|
|||
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
FWZ:=Pos('/',fsj);
|
|||
|
try
|
|||
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
with frmZDYHelpSel do
|
|||
|
begin
|
|||
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text:=ReturnStr;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelpSel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton6Click(Sender: TObject);
|
|||
|
var
|
|||
|
Fint:Integer;
|
|||
|
FReal,FMF,FKZ:Double;
|
|||
|
begin
|
|||
|
Fint:=CDS_JGLC.RecordCount;
|
|||
|
try
|
|||
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
with frmZDYHelpSel do
|
|||
|
begin
|
|||
|
flag:='JGGX';
|
|||
|
flagname:='<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with ClientDataSet1 do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
|
|||
|
begin
|
|||
|
with CDS_JGLC do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('PSXH').Value:=Fint+1;
|
|||
|
FieldByName('PSName').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
Fint:=Fint+1;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelpSel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_JGLC.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(CDS_JGLC.fieldbyname('PSID').AsString)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
try
|
|||
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
with frmGYSList do
|
|||
|
begin
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with CDS_JGC do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('FactoryNo').Value:=Trim(frmGYSList.CDS_HZ.fieldbyname('ATID').AsString) ;
|
|||
|
FieldByName('FactoryName').Value:=Trim(frmGYSList.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
FieldByName('PFDate').Value:=Now;
|
|||
|
//Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmGYSList.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton8Click(Sender: TObject);
|
|||
|
var
|
|||
|
maxno:string;
|
|||
|
begin
|
|||
|
if CDS_JGC.IsEmpty then Exit;
|
|||
|
ToolBar1.SetFocus;
|
|||
|
try
|
|||
|
ADOCmd.Connection.BeginTrans;
|
|||
|
CDS_JGC.DisableControls;
|
|||
|
with CDS_JGC do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(CDS_JGC.fieldbyname('PFID').AsString)='' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOCmd,maxno,'PF','JYOrder_PCS_Sub',3,1)=False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
CDS_JGC.EnableControls;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD>̼ӹ<CCBC><D3B9><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
maxno:=Trim(CDS_JGC.fieldbyname('PFID').AsString);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_PCS_Sub where PFID='''+Trim(CDS_JGC.fieldbyname('PFID').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(CDS_JGC.fieldbyname('PFID').AsString)='' then
|
|||
|
begin
|
|||
|
Append;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
end;
|
|||
|
FieldByName('MainID').Value:=Trim(FMainId);
|
|||
|
FieldByName('PSID').Value:=Trim(CDS_JGLC.fieldbyname('PSID').AsString);
|
|||
|
FieldByName('SubID').Value:=Trim(CDS_JGC.fieldbyname('SubID').AsString);
|
|||
|
FieldByName('PFID').Value:=Trim(maxno);
|
|||
|
FieldByName('FactoryNo').Value:=Trim(CDS_JGC.fieldbyname('FactoryNo').AsString);
|
|||
|
FieldByName('FactoryName').Value:=Trim(CDS_JGC.fieldbyname('FactoryName').AsString);
|
|||
|
FieldByName('PFDlyDate').Value:=CDS_JGC.fieldbyname('PFDlyDate').Value;
|
|||
|
RTSetSaveDataCDS(ADOCmd,Tv3,CDS_JGC,'JYOrder_PCS_Sub',0);
|
|||
|
if Trim(CDS_JGC.fieldbyname('PFTPPS').AsString)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('PFTPPS').Value:=CDS_JGC.fieldbyname('PFTPPS').AsString;
|
|||
|
end else
|
|||
|
begin
|
|||
|
FieldByName('PFTPPS').Value:=0;
|
|||
|
end;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with CDS_JGC do
|
|||
|
begin
|
|||
|
edit;
|
|||
|
fieldbyname('PFID').AsString:=trim(maxno);
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ADOCmd.Connection.CommitTrans;
|
|||
|
CDS_JGC.EnableControls;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
except
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
CDS_JGC.EnableControls;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.cxGridDBColumn6PropertiesButtonClick(
|
|||
|
Sender: TObject; AButtonIndex: Integer);
|
|||
|
var
|
|||
|
fsj:string;
|
|||
|
i:Integer;
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
with frmZDYHelpSel do
|
|||
|
begin
|
|||
|
flag:='PSNote';
|
|||
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>';
|
|||
|
MainType:=Trim(CDS_JGLC.fieldbyname('PSName').AsString);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
i:=0;
|
|||
|
with ClientDataSet1 do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
|
|||
|
begin
|
|||
|
i:=i+1;
|
|||
|
if Trim(fsj)='' then
|
|||
|
begin
|
|||
|
fsj:=fsj+Trim(IntToStr(i))+') '+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end else
|
|||
|
begin
|
|||
|
fsj:=fsj+#10+Trim(IntToStr(i))+') '+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with CDS_JGLC do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('PSNote').Value:=Trim(fsj);
|
|||
|
//Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelpSel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_JGC.IsEmpty=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ѱ<EFBFBD><D1B0>Ų<EFBFBD><C5B2><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)<>'' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_Process where PSId='''+Trim(CDS_JGLC.fieldbyname('PSId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_JGLC.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.Tv2CellClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.PRTHX,PRTColor=isnull(B.PRTColorNo,'''')+'' ''+isnull(B.PRTColorEng,'''')+'' ''+isnull(B.PRTColor,''''), ');
|
|||
|
sql.Add(' B.PRTOrderQty,B.OrderUnit from JYOrder_PCS_Sub A');
|
|||
|
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
|
|||
|
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQuery1,CDS_JGC);
|
|||
|
SInitCDSData20(ADOQuery1,CDS_JGC);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton10Click(Sender: TObject);
|
|||
|
var
|
|||
|
i:Integer;
|
|||
|
FName:String;
|
|||
|
begin
|
|||
|
if CDS_JGLC.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(CDS_JGLC.fieldbyname('PSID').AsString)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if CDS_JGC.IsEmpty then
|
|||
|
begin
|
|||
|
with ADOQuery1 do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.PRTHX,PRTColor=isnull(B.PRTColorNo,'''')+'' ''+isnull(B.PRTColorEng,'''')+'' ''+isnull(B.PRTColor,''''), ');
|
|||
|
sql.Add(' B.PRTOrderQty,B.OrderUnit from JYOrder_PCS_Sub A');
|
|||
|
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
|
|||
|
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQuery1,CDS_JGC);
|
|||
|
SInitCDSData20(ADOQuery1,CDS_JGC);
|
|||
|
end;
|
|||
|
try
|
|||
|
frmOrderSubSel:=TfrmOrderSubSel.Create(Application);
|
|||
|
with frmOrderSubSel do
|
|||
|
begin
|
|||
|
FFFMainId:=Trim(Self.FMainId);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
ClientDataSet1.DisableControls;
|
|||
|
with frmOrderSubSel.ClientDataSet1 do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
Self.CDS_JGC.Append;
|
|||
|
Self.CDS_JGC.FieldByName('SubId').Value:=frmOrderSubSel.ClientDataSet1.FieldByName('SubId').Value;
|
|||
|
for i:=0 to frmOrderSubSel.Tv3.ColumnCount-1 do
|
|||
|
begin
|
|||
|
FName:=frmOrderSubSel.Tv3.Columns[i].DataBinding.FilterFieldName;
|
|||
|
Self.CDS_JGC.FieldByName(FName).Value:=frmOrderSubSel.ClientDataSet1.FieldByName(FName).Value;
|
|||
|
|
|||
|
end;
|
|||
|
Self.CDS_JGC.FieldByName('FactoryNo').Value:=frmOrderSubSel.ClientDataSet1.FieldByName('FactoryNo').Value;
|
|||
|
Self.CDS_JGC.FieldByName('PFDate').Value:=Now;
|
|||
|
Self.CDS_JGC.Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ClientDataSet1.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton11Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_JGC.IsEmpty then Exit;
|
|||
|
ToolBar1.SetFocus;
|
|||
|
OneKeyPost(Tv3,CDS_JGC);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.cxGridDBColumn3PropertiesButtonClick(
|
|||
|
Sender: TObject; AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
with frmGYSList do
|
|||
|
begin
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with CDS_JGC do
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('FactoryNo').Value:=Trim(frmGYSList.CDS_HZ.fieldbyname('ATID').AsString) ;
|
|||
|
FieldByName('FactoryName').Value:=Trim(frmGYSList.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
//Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmGYSList.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton5Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_JGC.IsEmpty then Exit;
|
|||
|
if Trim(CDS_JGC.fieldbyname('PFId').AsString)<>'' then
|
|||
|
begin
|
|||
|
{with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_Main_MD where PFId='''+Trim(CDS_JGC.fieldbyname('PFId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTemp.IsEmpty=false then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ѿ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end; }
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_PCS_Sub where PFId='''+Trim(CDS_JGC.fieldbyname('PFId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_JGC.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ComTaiTouBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='OrdDefStr2';
|
|||
|
flagname:='<27><>˾̧ͷ';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
ComTaiTou.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.LiDanPersonBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='LiDanPerson';
|
|||
|
flagname:='<27><><EFBFBD><EFBFBD>Ա';
|
|||
|
fnote:=True;
|
|||
|
V1Note.Caption:='<27>绰';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
LiDanPerson.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.v3Column1PropertiesButtonClick(Sender: TObject;
|
|||
|
AButtonIndex: Integer);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='PFGenDanPerson';
|
|||
|
flagname:='<27><><EFBFBD><EFBFBD>Ա';
|
|||
|
fnote:=True;
|
|||
|
V1Note.Caption:='<27>绰';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with CDS_JGC do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('PFGenDanPerson').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ZLLevelBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='ZLLevel';
|
|||
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȼ<EFBFBD>';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
ZLLevel.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.Button1Click(Sender: TObject);
|
|||
|
var
|
|||
|
maxno:String;
|
|||
|
begin
|
|||
|
if Trim(CustomerNoName.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Order_Sub.IsEmpty then Exit;
|
|||
|
{if Order_Sub.Locate('SSel',True,[])=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end; }
|
|||
|
if Order_Sub.Locate('SSel;SubId',VarArrayOf([True,Null]),[loPartialKey])=True then
|
|||
|
begin
|
|||
|
if Application.MessageBox('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>,<2C>Ƿ<C7B7>','<27><>ʾ',1)=2 then
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Order_Sub.Locate('SSel;SubId',VarArrayOf([True,'']),[loPartialKey])=True then
|
|||
|
begin
|
|||
|
if Application.MessageBox('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>,<2C>Ƿ<C7B7>','<27><>ʾ',1)=2 then
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select MainId,SubId from JYOrder_Sub where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet1);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet1);
|
|||
|
if ClientDataSet1.IsEmpty=False then ClientDataSet1.Delete;
|
|||
|
Order_Sub.DisableControls;
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
//if FieldByName('SSel').AsBoolean=True then
|
|||
|
begin
|
|||
|
with ClientDataSet1 do
|
|||
|
begin
|
|||
|
append;
|
|||
|
FieldByName('MainId').Value:=Trim(FMainId);
|
|||
|
FieldByName('SubId').Value:=Trim(Order_Sub.fieldbyname('SubId').AsString);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Order_Sub.EnableControls;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select MainId,SubId,KHConNO=Cast(Null as varchar(40)),PRTColor,PRTHX,ConNo=Cast(Null as varchar(40)) from JYOrderCon_Sub where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet2);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet2);
|
|||
|
try
|
|||
|
frmContractSelList:=TfrmContractSelList.Create(Application);
|
|||
|
with frmContractSelList do
|
|||
|
begin
|
|||
|
KHCode:=Trim(Self.CustomerNoName.Text);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with frmContractSelList.Order_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while frmContractSelList.Order_Main.Locate('SSel',True,[]) do
|
|||
|
begin
|
|||
|
with Self.ClientDataSet2 do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('MainId').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
FieldByName('SubId').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('SubId').AsString);
|
|||
|
FieldByName('ConNo').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('ConNo').AsString);
|
|||
|
FieldByName('KHConNO').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('KHConNO').AsString);
|
|||
|
FieldByName('PRTColor').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTColor').AsString);
|
|||
|
FieldByName('PRTHX').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTHX').AsString);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
frmContractSelList.Order_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmContractSelList.Free;
|
|||
|
end;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
ClientDataSet1.DisableControls;
|
|||
|
with ClientDataSet1 do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
ClientDataSet2.DisableControls;
|
|||
|
with ClientDataSet2 do
|
|||
|
begin
|
|||
|
ClientDataSet2.First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if GetLSNo(ADOQueryCmd,maxno,'CO','JYOrder_ConORD',4,1)=False then
|
|||
|
begin
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
ClientDataSet1.EnableControls;
|
|||
|
ClientDataSet2.EnableControls;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD>ۺ<EFBFBD>ָͬʾ<D6B8><CABE>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_ConORD where Mainid='''+trim(ClientDataSet1.fieldbyname('Mainid').AsString)+''' ');
|
|||
|
sql.Add(' and Subid='''+trim(ClientDataSet1.fieldbyname('Subid').AsString)+''' ');
|
|||
|
open;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
if IsEmpty then
|
|||
|
Append
|
|||
|
else
|
|||
|
edit;
|
|||
|
FieldByName('MainId').Value:=Trim(ClientDataSet1.fieldbyname('MainId').AsString);
|
|||
|
FieldByName('SubId').Value:=Trim(ClientDataSet1.fieldbyname('SubId').AsString);
|
|||
|
FieldByName('ConMainId').Value:=Trim(ClientDataSet2.fieldbyname('MainId').AsString);
|
|||
|
FieldByName('ConSubId').Value:=Trim(ClientDataSet2.fieldbyname('SubId').AsString);
|
|||
|
FieldByName('COID').Value:=Trim(maxno);
|
|||
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
ClientDataSet2.Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ClientDataSet2.EnableControls;
|
|||
|
ClientDataSet1.Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ClientDataSet1.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where CO.SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet11);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet11);
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' select ConNoHZ=[dbo].[F_Get_Order_SubStr](:MainId,''ConNoHZ'')');
|
|||
|
Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
ConNoHZ.Text:=Trim(ADOTemp.fieldbyname('ConNoHZ').AsString);
|
|||
|
except;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
ClientDataSet1.EnableControls;
|
|||
|
ClientDataSet2.EnableControls;
|
|||
|
Application.MessageBox('ָ<><D6B8><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if ClientDataSet11.IsEmpty then Exit;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrder_ConORD where COID='''+Trim(ClientDataSet11.fieldbyname('COID').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
ClientDataSet11.Delete;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' select ConNoHZ=[dbo].[F_Get_Order_SubStr](:MainId,''ConNoHZ'')');
|
|||
|
Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
ConNoHZ.Text:=Trim(ADOTemp.fieldbyname('ConNoHZ').AsString);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.BZNoteBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='BZNote';
|
|||
|
flagname:='<27><>װҪ<D7B0><D2AA>';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
BZNote.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.CustomerNoNameBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZdyAttachment:=TfrmZdyAttachment.Create(Application);
|
|||
|
with frmZdyAttachment do
|
|||
|
begin
|
|||
|
fkhType:='';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
CustomerNoName.Text:=Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
|||
|
CustomerNoName.TxtCode:=Trim(CDS_HZ.fieldbyname('ZDYCode').AsString);
|
|||
|
YWY.Text:=Trim(CDS_HZ.fieldbyname('DEFstr5').AsString);
|
|||
|
KHNameJC.Text:=Trim(CDS_HZ.fieldbyname('ZdyNameYW').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZdyAttachment.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.MPRTCodeBtnClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj:String;
|
|||
|
Fint:Integer;
|
|||
|
begin
|
|||
|
try
|
|||
|
frmCPManageFMSel:=TfrmCPManageFMSel.Create(Application);
|
|||
|
with frmCPManageFMSel do
|
|||
|
begin
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
Self.MPRTCode.Text:=Trim(frmCPManageFMSel.CDS_Main.fieldbyname('CYNo').AsString);
|
|||
|
Self.MPRTCodeName.Text:=Trim(frmCPManageFMSel.CDS_Main.fieldbyname('CYName').AsString);
|
|||
|
Self.MPRTCF.Text:=Trim(frmCPManageFMSel.CDS_Main.fieldbyname('CYECF').AsString);
|
|||
|
fsj:=Trim(frmCPManageFMSel.CDS_Main.fieldbyname('CYMF').AsString);
|
|||
|
Fint:=Pos('C',fsj);
|
|||
|
if Fint>0 then
|
|||
|
begin
|
|||
|
fsj:=Copy(fsj,1,Fint-1);
|
|||
|
end else
|
|||
|
begin
|
|||
|
Fint:=Pos('"',fsj);
|
|||
|
if Fint>0 then
|
|||
|
begin
|
|||
|
fsj:=Copy(fsj,1,Fint-1);
|
|||
|
end;
|
|||
|
end;
|
|||
|
Self.MPRTMF.Text:=Trim(fsj);
|
|||
|
fsj:=Trim(frmCPManageFMSel.CDS_Main.fieldbyname('CYKZ').AsString);
|
|||
|
Fint:=Pos('g',fsj);
|
|||
|
if Fint>0 then
|
|||
|
begin
|
|||
|
fsj:=Copy(fsj,1,Fint-1);
|
|||
|
end else
|
|||
|
begin
|
|||
|
Fint:=Pos('G',fsj);
|
|||
|
if Fint>0 then
|
|||
|
begin
|
|||
|
fsj:=Copy(fsj,1,Fint-1);
|
|||
|
end;
|
|||
|
end;
|
|||
|
Self.MPRTKZ.Text:=Trim(fsj);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmCPManageFMSel.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.Tv1MouseDown(Sender: TObject;
|
|||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
begin
|
|||
|
{with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where CO.SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
sql.Add(' and isnull(CO.SubId,'''')<>'''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet11);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet11); }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton9Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(CustomerNoName.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
try
|
|||
|
frmContractSelList:=TfrmContractSelList.Create(Application);
|
|||
|
with frmContractSelList do
|
|||
|
begin
|
|||
|
KHCode:=Trim(Self.CustomerNoName.TxtCode);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
with frmContractSelList.Order_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while frmContractSelList.Order_Main.Locate('SSel',True,[]) do
|
|||
|
begin
|
|||
|
with Self.Order_Sub do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('PRTColor').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTColor').AsString);
|
|||
|
FieldByName('PRTColorEng').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('SOrdDefStr4').AsString);
|
|||
|
FieldByName('StyleNo').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('styleNo').AsString);
|
|||
|
FieldByName('PRTHX').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTHX').AsString);
|
|||
|
FieldByName('PRTColorNo').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTColorNo').AsString);
|
|||
|
FieldByName('ColorOk').Value:=Trim(frmContractSelList.Order_Main.fieldbyname('PRTColorOK').AsString);
|
|||
|
FieldByName('PRTOrderQty').Value:=frmContractSelList.Order_Main.fieldbyname('PRTOrderQty').Value;
|
|||
|
FieldByName('OrderUnit').Value:=frmContractSelList.Order_Main.fieldbyname('OrderUnit').Value;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with Self.Order_Sub do
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('XHInt').Value:=Self.Order_Sub.RecordCount;
|
|||
|
end;
|
|||
|
frmContractSelList.Order_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmContractSelList.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.v1Column2PropertiesEditValueChanged(
|
|||
|
Sender: TObject);
|
|||
|
var
|
|||
|
mvalue:Boolean;
|
|||
|
FStr:string;
|
|||
|
begin
|
|||
|
mvalue:=TcxCheckBox(Sender).EditingValue;
|
|||
|
if mvalue=true then
|
|||
|
begin
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value:=True;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
FStr:=Order_Sub.fieldbyname('XHInt').AsString;
|
|||
|
Order_Sub.DisableControls;
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value:=False;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Order_Sub.EnableControls;
|
|||
|
Order_Sub.Locate('XHInt',StrToInt(FStr),[]);
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value:=True;
|
|||
|
end;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where CO.SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
sql.Add(' and isnull(CO.SubId,'''')<>'''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet11);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet11);
|
|||
|
end else
|
|||
|
begin
|
|||
|
with Order_Sub do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value:=False;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet11);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet11);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.ToolButton12Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if not Assigned(DataLink_TradeManage) then
|
|||
|
DataLink_TradeManage:=TDataLink_TradeManage.Create(Application);
|
|||
|
Try
|
|||
|
with DataLink_TradeManage.ADOLink do
|
|||
|
begin
|
|||
|
if not Connected then
|
|||
|
begin
|
|||
|
Connected:=false;
|
|||
|
ConnectionString:=DConString;
|
|||
|
LoginPrompt:=false;
|
|||
|
Connected:=true;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Except
|
|||
|
application.MessageBox('<27><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><><EFBFBD><EFBFBD>',mb_Ok+ MB_ICONERROR);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
with ADOTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select CO.*,B.KHConNO,A.PRTColor,A.PRTHX,B.ConNo');
|
|||
|
SQL.Add('from JYOrder_ConORD CO inner join JYOrderCon_Sub A on CO.ConSubId=A.SubId inner join JYOrderCon_Main B on A.MainId=B.MainId');
|
|||
|
sql.Add(' where CO.SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
|||
|
sql.Add(' and isnull(CO.SubId,'''')<>'''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOTemp,ClientDataSet11);
|
|||
|
SInitCDSData20(ADOTemp,ClientDataSet11);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.PBFactoryNameBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
with frmGYSList do
|
|||
|
begin
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
PBFactoryName.TxtCode:=Trim(frmGYSList.CDS_HZ.fieldbyname('ATID').AsString) ;
|
|||
|
PBFactoryName.Text:=Trim(frmGYSList.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmGYSList.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.JGFactoryNameBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
with frmGYSList do
|
|||
|
begin
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
JGFactoryName.TxtCode:=Trim(frmGYSList.CDS_HZ.fieldbyname('ATID').AsString) ;
|
|||
|
JGFactoryName.Text:=Trim(frmGYSList.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmGYSList.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmOrderInPutPrice.MPRTKZNoteBtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='MPRTKZNote';
|
|||
|
flagname:='<27><><EFBFBD>ص<EFBFBD>λ';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
MPRTKZNote.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|