969 lines
26 KiB
ObjectPascal
969 lines
26 KiB
ObjectPascal
|
|
unit U_ConInPutXF;
|
|||
|
|
|
|||
|
|
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,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxCurrencyEdit, cxDropDownEdit,
|
|||
|
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinBlack,
|
|||
|
|
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
|||
|
|
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|||
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|||
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|||
|
|
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|||
|
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
|||
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
|||
|
|
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
|||
|
|
dxSkinscxPCPainter;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmConInPutXF = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
OrdDate: TDateTimePicker;
|
|||
|
|
ToolBar2: TToolBar;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Order_Sub: TClientDataSet;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
YWY: TEdit;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
CustomerNoName: TBtnEditC;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
GCName: TBtnEditC;
|
|||
|
|
CDS_Type: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
Note: TMemo;
|
|||
|
|
Label44: TLabel;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
CustomerNo: TEdit;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
QDDate: TDateTimePicker;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
v1FLQty: TcxGridDBColumn;
|
|||
|
|
v1BNo: TcxGridDBColumn;
|
|||
|
|
v1Note: TcxGridDBColumn;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
KHWTName: TEdit;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
v1XFBFB: TcxGridDBColumn;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
HTDJ: TBtnEditC;
|
|||
|
|
v1KSFee: TcxGridDBColumn;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
WTRTel: TEdit;
|
|||
|
|
ConType: TComboBox;
|
|||
|
|
FKType: TComboBox;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
PriceType: TComboBox;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1Column5: TcxGridDBColumn;
|
|||
|
|
GLQty: TEdit;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
KPType: TComboBox;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure CustomerNoNameBtnUpClick(Sender: TObject);
|
|||
|
|
procedure CustomerNoNameBtnDnClick(Sender: TObject);
|
|||
|
|
procedure SYRNameBtnUpClick(Sender: TObject);
|
|||
|
|
procedure CPRanHouGYBtnDnClick(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure v1FLiangPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v1ConPricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v1JSPricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v1NotePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure NoteDblClick(Sender: TObject);
|
|||
|
|
procedure v1FLQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure FKTypeDblClick(Sender: TObject);
|
|||
|
|
procedure ConTypeChange(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
function SaveDataSubOne(): Boolean;
|
|||
|
|
function SaveDataMain(): Boolean;
|
|||
|
|
function SaveDataSubMore(): Boolean;
|
|||
|
|
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
PState, CopyInt: Integer;
|
|||
|
|
FMainId, FFMainId: string;
|
|||
|
|
FXS: Integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmConInPutXF: TfrmConInPutXF;
|
|||
|
|
newh: hwnd;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_ZDYHelp, U_RTFun, U_ZDYHelpSel, U_ZdyAttachment;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('<27><>ͬ¼<CDAC><C2BC>', Tv1, '<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.InitData();
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from KH_Zdy where Type=''MPRTNameType'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1, CDS_Type);
|
|||
|
|
SInitCDSData20(ADOQuery1, CDS_Type);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select * from JYOrderCon_Sub ');
|
|||
|
|
if PState = 1 then
|
|||
|
|
begin
|
|||
|
|
sql.Add('where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
end;
|
|||
|
|
if PState = 0 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' where 1=2');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1, Order_Sub);
|
|||
|
|
SInitCDSData20(ADOQuery1, Order_Sub);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_Main where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1, ScrollBox1, 2);
|
|||
|
|
FKType.Text := Trim(ADOQuery1.fieldbyname('FKType').AsString);
|
|||
|
|
if PState = 0 then
|
|||
|
|
begin
|
|||
|
|
OrdDate.DateTime := SGetServerDateTime(ADOTemp);
|
|||
|
|
QDDate.DateTime := SGetServerDateTime(ADOTemp);
|
|||
|
|
YWY.Text := '<27><>˾';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
if CopyInt = 99 then
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
YWY.Text := Trim(DName);
|
|||
|
|
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 TfrmConInPutXF.ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|||
|
|
var
|
|||
|
|
FType, ZDYName, FText: string;
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
readCxGrid('<27><>ͬ¼<CDAC><C2BC>', Tv1, '<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmConInPutXF.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
fconNO, fmxType: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, maxno, 'JW', 'JYOrderCon_Main', 3, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ConType.ItemIndex < 2 then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, fconNO, 'SF' + trim(formatdatetime('yy', SGetServerDate(ADOQuery1))), 'JYOrderCon_Main', 4, 0) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOTemp, fconNO, 'LS' + trim(formatdatetime('yy', SGetServerDate(ADOQuery1))), 'JYOrderCon_Main', 4, 0) = False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ConNo.Text := Trim(fconNO);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(FMainId);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from JYOrderCon_Main where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
RTSetsavedata(ADOCmd, 'JYOrderCon_Main', ScrollBox1, 2);
|
|||
|
|
FieldByName('Status').Value := '0';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_Main where GCName=''' + Trim(GCName.Text) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOCmd.RecordCount > 1 then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
{ with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_Main where ConNo='''+Trim(ConNo.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOCmd.RecordCount>1 then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end; }
|
|||
|
|
FMainId := Trim(maxno);
|
|||
|
|
|
|||
|
|
///<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(ADOTemp, maxno, 'JB', 'JYOrderCon_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
|
|||
|
|
maxno := Trim(Order_Sub.fieldbyname('SubId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_Sub where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and SubId=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MainId').Value := Trim(FMainId);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'JYOrderCon_Sub', 0);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update JYOrderCon_Sub Set ShiJiPrice=GuDingPrice*(1-isnull(XFBFB,0)*0.01)+isnull(KSFee,0)+isnull(KSFeeP8,0)+isnull(OtherPrice,0)');
|
|||
|
|
SQL.Add(' where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and isnull(GuDingPrice,0)>0');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Result := False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmConInPutXF.SaveDataMain(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
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;
|
|||
|
|
maxno := Trim(FFMainId);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno := Trim(FMainId);
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|||
|
|
SSetsaveSqlNew(ADOCmd, 'JYOrder_Main', ScrollBox1, 2);
|
|||
|
|
if PState = 1 then
|
|||
|
|
begin
|
|||
|
|
FieldByName('OrdUpDate').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
if Trim(FMainId) = '' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FMainId := Trim(maxno);
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmConInPutXF.SaveDataSubOne(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<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(ADOTemp, maxno, '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
|
|||
|
|
maxno := Trim(Order_Sub.fieldbyname('SubId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from JYOrder_Sub where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and SubId=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MainId').Value := Trim(FMainId);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'JYOrder_Sub', 0);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
//Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmConInPutXF.SaveDataSubMore(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<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(ADOTemp, maxno, '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
|
|||
|
|
maxno := Trim(Order_Sub.fieldbyname('SubId').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from JYOrder_Sub where MainId=''' + Trim(FMainId) + '''');
|
|||
|
|
sql.Add(' and SubId=''' + Trim(maxno) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MainId').Value := Trim(FMainId);
|
|||
|
|
FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'JYOrder_Sub', 0);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.FieldByName('SubId').Value := Trim(maxno);
|
|||
|
|
//Order_Sub.Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.TBSaveClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
OrdDate.SetFocus;
|
|||
|
|
if Trim(ConNo.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ͬ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(ConType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(GLQty.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(GCName.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><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(PriceType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>۸<EFBFBD><DBB8><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(KPType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ʊ<EFBFBD><C6B1><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ConType.ItemIndex > 1 then
|
|||
|
|
begin
|
|||
|
|
if Trim(FKType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ʱ<EFBFBD><CAB1>ͬ<EFBFBD><CDAC><EFBFBD>ʽ<EEB7BD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.Locate('BNo', Null, []) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
{ if Order_Sub.Locate('JSPrice',Null,[]) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.Locate('JSPrice',0,[]) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD><EFBFBD>㣡','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end; }
|
|||
|
|
Order_Sub.DisableControls;
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
{if Order_Sub.FieldByName('JSPrice').AsFloat<200 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>С<EFBFBD><D0A1>200<30><30>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.FieldByName('JSPrice').AsFloat>600 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>۲<EFBFBD><DBB2>ܴ<EFBFBD><DCB4><EFBFBD>600<30><30>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end; }
|
|||
|
|
|
|||
|
|
if PriceType.ItemIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.FieldByName('GuDingPrice').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27>̶<EFBFBD><CCB6>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Trim(Order_Sub.FieldByName('FLQty').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
if Order_Sub.FieldByName('FLQty').AsFloat < 50 then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.FieldByName('BengSongFee').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>С<EFBFBD><D0A1>50<35><30><EFBFBD><EFBFBD><EFBFBD>ͷѲ<CDB7><D1B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if ConType.ItemIndex > 1 then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.FieldByName('GuDingPrice').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.FieldByName('YuGuPrice').AsString) = '' then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27><>ʱ<EFBFBD><CAB1>ͬ <20>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>ۺ<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>ͬʱΪ<CAB1><CEAA>!', '', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if Order_Sub.FieldByName('YuGuPrice').AsFloat < 200 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>С<EFBFBD><D0A1>200<30><30>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.FieldByName('YuGuPrice').AsFloat > 800 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2>ܴ<EFBFBD><DCB4><EFBFBD>800<30><30>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if Order_Sub.FieldByName('GuDingPrice').AsFloat < 200 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>С<EFBFBD><D0A1>200<30><30>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.FieldByName('GuDingPrice').AsFloat > 800 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
Application.MessageBox('<27>̶<EFBFBD><CCB6><EFBFBD><EFBFBD>۲<EFBFBD><DBB2>ܴ<EFBFBD><DCB4><EFBFBD>800<30><30>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.EnableControls;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.ToolButton1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
if Trim(ConNo.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ͬ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(ConType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(PriceType.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>۸<EFBFBD><DBB8><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
CopyAddRow(Tv1, Order_Sub);
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('FLQty').Value := null;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Sub.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
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 JYOrderCon_Sub where SubId=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.CustomerNoNameBtnUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachment := TfrmZdyAttachment.Create(Application);
|
|||
|
|
with frmZdyAttachment do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
CustomerNoName.Text := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
CustomerNoName.TxtCode := Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
CustomerNo.Text := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
|||
|
|
FKType.Text := Trim(CDS_HZ.fieldbyname('DEFNote3').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
;
|
|||
|
|
frmZdyAttachment.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.CustomerNoNameBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text := '';
|
|||
|
|
TBtnEditC(Sender).TxtCode := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.SYRNameBtnUpClick(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) = 'SYRName' then
|
|||
|
|
begin
|
|||
|
|
flag := 'OrdDefStr2';
|
|||
|
|
V1Name.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
fnote := True;
|
|||
|
|
end;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
if Trim(flag) <> 'OrdDefStr2' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
if Trim(flag) = 'GCName' then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.fieldbyname('Note').AsString = '' then
|
|||
|
|
GLQty.Text := '0'
|
|||
|
|
else
|
|||
|
|
GLQty.Text := trim(ClientDataSet1.fieldbyname('Note').asstring);
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
{TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
SYRName.TxtCode:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select Top 1* from JYOrderCon_Main where SYRName='''+Trim(ClientDataSet1.fieldbyname('Note').AsString)+'''');
|
|||
|
|
sql.Add(' order by FillTime desc');
|
|||
|
|
Open;
|
|||
|
|
Self.SYRAddress.Text:=Trim(ADOTemp.fieldbyname('SYRAddress').AsString);
|
|||
|
|
Self.TelNo.Text:=Trim(ADOTemp.fieldbyname('TelNo').AsString);
|
|||
|
|
Self.FaxNo.Text:=Trim(ADOTemp.fieldbyname('FaxNo').AsString);
|
|||
|
|
end;}
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.CPRanHouGYBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text := '';
|
|||
|
|
TBtnEditC(Sender).TxtCode := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxgrid1.Align := alclient;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.v1FLiangPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mavlue: string;
|
|||
|
|
begin
|
|||
|
|
mavlue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if mavlue = '' then
|
|||
|
|
mavlue := '0';
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('FLQty').Value := mavlue;
|
|||
|
|
FieldByName('YWMoney').Value := FieldByName('ConPrice').AsFloat * strtofloat(mavlue);
|
|||
|
|
FieldByName('JSMoney').Value := FieldByName('JSPrice').AsFloat * strtofloat(mavlue);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.v1ConPricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mavlue: string;
|
|||
|
|
begin
|
|||
|
|
mavlue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if mavlue = '' then
|
|||
|
|
mavlue := '0';
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('ConPrice').Value := mavlue;
|
|||
|
|
FieldByName('YWMoney').Value := FieldByName('FLQty').AsFloat * strtofloat(mavlue);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.v1JSPricePropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mavlue: string;
|
|||
|
|
begin
|
|||
|
|
mavlue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if mavlue = '' then
|
|||
|
|
mavlue := '0';
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('JSPrice').Value := mavlue;
|
|||
|
|
FieldByName('JSMoney').Value := FieldByName('FLQty').AsFloat * strtofloat(mavlue);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.v1NotePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'Note';
|
|||
|
|
flagname := '<27><>ע';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.fieldbyname('Note').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.NoteDblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'Note';
|
|||
|
|
flagname := '<27><>ע';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.Note.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.v1FLQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mavlue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mavlue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
|
if mavlue = '' then
|
|||
|
|
mavlue := '0';
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := mavlue;
|
|||
|
|
end;
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('JSMoney').Value := FieldByName('JSPrice').AsFloat * (1 - FieldByName('XFBFB').AsFloat * 0.01) * FieldByName('FLQty').AsFloat;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.FKTypeDblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'FKType';
|
|||
|
|
flagname := '<27><><EFBFBD>ʽ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.FKType.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmConInPutXF.ConTypeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// if ConType.ItemIndex>1 then
|
|||
|
|
// begin
|
|||
|
|
// FKType.Style:=csDropDownList;
|
|||
|
|
// end else
|
|||
|
|
// begin
|
|||
|
|
// FKType.Style:=csDropDown;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|