2025-07-30 15:56:27 +08:00
|
|
|
|
unit U_YMTFHSQInPut;
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
|
cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
|
|
|
|
|
|
cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinDarkRoom,
|
|
|
|
|
|
dxSkinOffice2013White, dxSkinSharpPlus, dxSkinSpringTime,
|
|
|
|
|
|
dxSkinsDefaultPainters, dxSkinscxPCPainter, dxSkinBlack, dxSkinBlue,
|
|
|
|
|
|
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkSide,
|
|
|
|
|
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|
|
|
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|
|
|
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|
|
|
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|
|
|
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|
|
|
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|
|
|
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|
|
|
|
|
dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSilver,
|
|
|
|
|
|
dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinValentine,
|
|
|
|
|
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmFHSQInPut = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
|
v1PRTColor: TcxGridDBColumn;
|
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
|
ADOCmd: TADOQuery;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
Order_Sub: TClientDataSet;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
v1Column14: TcxGridDBColumn;
|
|
|
|
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
CRType: TComboBox;
|
|
|
|
|
|
Note: TEdit;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
SHDanWei: TBtnEditC;
|
|
|
|
|
|
v1Column6: TcxGridDBColumn;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
SQDate: TDateTimePicker;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Salesman: TBtnEditC;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
|
v1Column5: TcxGridDBColumn;
|
|
|
|
|
|
v1Column10: TcxGridDBColumn;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
JGType: TEdit;
|
2025-07-30 15:56:27 +08:00
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure SHDanWeiBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure SHDanWeiBtnDnClick(Sender: TObject);
|
|
|
|
|
|
procedure ShouKuanKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure SalesmanBtnDnClick(Sender: TObject);
|
|
|
|
|
|
procedure v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
fuserName: string;
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
PState, CopyInt: Integer;
|
|
|
|
|
|
FMainId, FFMainId, ChkStr, ConPriceStr: string;
|
|
|
|
|
|
FXS: Integer;
|
|
|
|
|
|
FZZType: string;
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmFHSQInPut: TfrmFHSQInPut;
|
|
|
|
|
|
newh: hwnd;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
2025-09-29 09:29:56 +08:00
|
|
|
|
U_DataLink, U_ZDYHelp, U_RTFun, U_YMTOrderSel, U_ZdyAttachKH, U_ZdyAttachGYS; // U_YMTKHList, , U_YMTGYSList
|
2025-07-30 15:56:27 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.InitData();
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
// fsj:='select Name=ZdyName from KH_Zdy where Type=''ClothType'' ';
|
|
|
|
|
|
// SInitComBoxBySql(ADOTemp,ClothType,False,fsj);
|
|
|
|
|
|
if PState = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Salesman.Text := dname;
|
|
|
|
|
|
SQDate.DateTime := SGetServerDate10(ADOTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add(' select A.* from YMT_FHSQ_Sub A');
|
|
|
|
|
|
if PState = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.Add('where FSId=''' + Trim(FMainId) + '''');
|
|
|
|
|
|
end;
|
|
|
|
|
|
if PState = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.Add(' where 1<>1');
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS20(ADOQuery1, Order_Sub);
|
|
|
|
|
|
SInitCDSData20(ADOQuery1, Order_Sub);
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select A.* from YMT_FHSQ_Main A');
|
|
|
|
|
|
sql.Add(' where FSId=''' + Trim(FMainId) + ''' ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCSHDataNew(ADOQuery1, ScrollBox1, 1);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
var
|
|
|
|
|
|
FType, ZDYName, FText: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
readCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
InitData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmFHSQInPut.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno, maxmnno, FSSId: string;
|
|
|
|
|
|
fconNO, fmxType: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
if Trim(FMainId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNoHZ(ADOCmd, maxno, 'NK', 'YMT_FHSQ_Main', 3, 1, 3) = 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 YMT_FHSQ_Main where FSID=''' + Trim(FMainId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FMainId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('SQType').Value := '<27><>Ʒ';
|
|
|
|
|
|
FieldByName('FSID').Value := Trim(maxno);
|
|
|
|
|
|
RTSetsavedata(ADOCmd, 'YMT_FHSQ_Main', ScrollBox1, 1);
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|
|
|
|
|
Order_Sub.DisableControls;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('SSId').AsString) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'SS', 'YMT_FHSQ_Sub', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Order_Sub.EnableControls;
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
maxno := Trim(Order_Sub.fieldbyname('SSId').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from YMT_FHSQ_Sub ');
|
|
|
|
|
|
sql.Add(' where SSId=''' + Trim(maxno) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOCmd.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSSId := '';
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FSSId := Trim(maxno);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FSSId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('FSID').Value := Trim(FMainId);
|
|
|
|
|
|
FieldByName('SSID').Value := Trim(maxno);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'YMT_FHSQ_Sub', 0);
|
|
|
|
|
|
FieldByName('MainId').Value := Order_Sub.fieldbyname('MainId').Value;
|
|
|
|
|
|
FieldByName('SubId').Value := Order_Sub.fieldbyname('SubId').Value;
|
|
|
|
|
|
FieldByName('SSConMainId').Value := Order_Sub.fieldbyname('SSConMainId').Value;
|
|
|
|
|
|
FieldByName('SSConSubId').Value := Order_Sub.fieldbyname('SSConSubId').Value;
|
|
|
|
|
|
FieldByName('FHPrice').Value := Order_Sub.fieldbyname('FHPrice').Value;
|
|
|
|
|
|
FieldByName('BZType').Value := Order_Sub.fieldbyname('BZType').Value;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Sub.Edit;
|
|
|
|
|
|
Order_Sub.FieldByName('SSID').Value := Trim(maxno);
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Sub.EnableControls;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('Update YMT_FHSQ_Main Set ');
|
|
|
|
|
|
sql.Add('SQPSHZ=(select Sum(SQPS) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
|
|
|
|
|
|
sql.Add(',SQQtyHZM=(select Sum(SQQtyM) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
|
|
|
|
|
|
sql.Add('where FSID=''' + Trim(FMainId) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.TBSaveClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
Freal: Double;
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToolBar1.SetFocus;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CRType.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Order_Sub.Locate('SQPS', null, []) = True then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('SSId').AsString) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YMT_FHSQ_Sub where SSId=''' + Trim(Order_Sub.fieldbyname('SSId').AsString) + '''');
|
|
|
|
|
|
sql.add(' and isnull(FHPS,0)>0');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOTemp.IsEmpty = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27>ѷ<EFBFBD><D1B7><EFBFBD><EFBFBD><EFBFBD><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 YMT_FHSQ_Sub where SSId=''' + Trim(Order_Sub.fieldbyname('SSId').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('Update YMT_FHSQ_Main Set ');
|
|
|
|
|
|
sql.Add('SQPSHZ=(select Sum(SQPS) from YMT_FHSQ_Sub A where A.FSID=YMT_FHSQ_Main.FSID)');
|
|
|
|
|
|
sql.Add('where FSID=''' + Trim(FMainId) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Sub.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.SHDanWeiBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if CRType.Text = '<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-29 09:29:56 +08:00
|
|
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|
|
|
|
|
with frmZdyAttachGYS do
|
2025-07-30 15:56:27 +08:00
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2025-09-29 09:29:56 +08:00
|
|
|
|
Self.SHDanWei.Text := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('KHNameJC').AsString);
|
|
|
|
|
|
Self.SHDanWei.TxtCode := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('KHNo').AsString);
|
|
|
|
|
|
Self.Salesman.Text := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('YWY').AsString);
|
2025-07-30 15:56:27 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
2025-09-29 09:29:56 +08:00
|
|
|
|
frmZdyAttachGYS.Free;
|
2025-07-30 15:56:27 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-29 09:29:56 +08:00
|
|
|
|
frmZdyAttachkh := TfrmZdyAttachkh.Create(Application);
|
|
|
|
|
|
with frmZdyAttachkh do
|
2025-07-30 15:56:27 +08:00
|
|
|
|
begin
|
|
|
|
|
|
// if self.canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|
|
|
|
|
// canshu1 := 'ҵ<><D2B5>Ա';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2025-09-29 09:29:56 +08:00
|
|
|
|
Self.SHDanWei.Text := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('KHNameJC').AsString);
|
|
|
|
|
|
Self.SHDanWei.TxtCode := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('KHNo').AsString);
|
|
|
|
|
|
Self.Salesman.Text := Trim(frmZdyAttachkh.CDS_HZ.fieldbyname('YWY').AsString);
|
2025-07-30 15:56:27 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
2025-09-29 09:29:56 +08:00
|
|
|
|
frmZdyAttachkh.Free;
|
2025-07-30 15:56:27 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.SHDanWeiBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
SHDanWei.Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.ShouKuanKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'Salesman';
|
|
|
|
|
|
flagname := 'ҵ<><D2B5>Ա';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Self.Salesman.Text := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.SalesmanBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Salesman.Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'FeeName';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('FeeName').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmFHSQInPut.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
frmOrderSel := TfrmOrderSel.Create(Application);
|
|
|
|
|
|
with frmOrderSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
FKHNo := Trim(SHDanWei.TxtCode);
|
|
|
|
|
|
// FTT := Trim(FHTaiTou.text);
|
|
|
|
|
|
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
while frmOrderSel.CDS_Main.Locate('SSel', true, []) do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(Self.SHDanWei.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
SHDanWei.TxtCode := Trim(frmOrderSel.CDS_Main.fieldbyname('KHNO').AsString);
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from KH_Main where KHNO=''' + Trim(SHDanWei.TxtCode) + '''');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SHDanWei.Text := Trim(ADOQueryTemp.fieldbyname('KHNameJC').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
// if Trim(Self.FHTaiTou.Text) = '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FHTaiTou.Text := Trim(frmOrderSel.CDS_Main.fieldbyname('SYRName').AsString);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
|
|
if Self.Order_Sub.Locate('SubId;CPType', VarArrayOf([Trim(frmOrderSel.CDS_Main.fieldbyname('SubId').AsString), Trim(frmOrderSel.CDS_Main.fieldbyname('CPType').AsString)]), []) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('MainId').Value := frmOrderSel.CDS_Main.fieldbyname('MainId').Value;
|
|
|
|
|
|
FieldByName('SubId').Value := frmOrderSel.CDS_Main.fieldbyname('SubId').Value;
|
|
|
|
|
|
FieldByName('MXPrtName').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLCodeName').AsString);
|
|
|
|
|
|
FieldByName('MXPrtColor').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLColor').AsString);
|
|
|
|
|
|
FieldByName('MXPrtHX').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLHX').AsString);
|
|
|
|
|
|
FieldByName('SCConNo').Value := Trim(frmOrderSel.CDS_Main.fieldbyname('MLOrderNo').AsString);
|
|
|
|
|
|
// CRType.Text := Trim(frmOrderSel.CDS_Main.fieldbyname('CRType').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
CRType.ItemIndex := CRType.Items.IndexOf(trim(frmOrderSel.CDS_Main.fieldbyname('CRType').AsString));
|
|
|
|
|
|
FieldByName('CPType').Value := '<27><>Ʒ';
|
|
|
|
|
|
FieldByName('SQPS').Value := 0;
|
|
|
|
|
|
FieldByName('SQQtyM').Value := 0;
|
|
|
|
|
|
FieldByName('BZType').Value := frmOrderSel.CDS_Main.fieldbyname('BZType').Value;
|
|
|
|
|
|
FieldByName('FHPrice').Value := frmOrderSel.CDS_Main.fieldbyname('MLPrice').Value;
|
|
|
|
|
|
FieldByName('FeeName').Value := frmOrderSel.CDS_Main.fieldbyname('FeeName').Value;
|
|
|
|
|
|
FieldByName('FeeMoney').Value := frmOrderSel.CDS_Main.fieldbyname('FeeMoney').Value;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
frmOrderSel.CDS_Main.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmOrderSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|