新余库存管理,匹数数量的问题

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-08-15 16:57:51 +08:00
parent ef3eefe70d
commit 8619a17600
13 changed files with 301 additions and 125 deletions

View File

@ -11,7 +11,23 @@ uses
cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
cxLookAndFeelPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu,
System.ImageList, U_BaseInput, cxContainer, cxImageList,
dxScrollbarAnnotations, dxSkinsCore, dxSkinsDefaultPainters;
dxScrollbarAnnotations, dxSkinsCore, dxSkinsDefaultPainters, dxSkinBasic,
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, dxSkinOffice2016Colorful,
dxSkinOffice2016Dark, dxSkinOffice2019Black, dxSkinOffice2019Colorful,
dxSkinOffice2019DarkGray, dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven,
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue,
dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
dxSkinWhiteprint, dxSkinWXI, dxSkinXmas2008Blue;
type
TfrmCompanySel = class(TfrmBaseHelp)

View File

@ -21,7 +21,7 @@ inherited frmCustomer: TfrmCustomer
Height = 30
AutoSize = True
ButtonHeight = 30
ButtonWidth = 115
ButtonWidth = 131
Caption = 'ToolBar1'
Color = clWhite
DisabledImages = DataLink_Company.cxImageList_bar
@ -127,6 +127,14 @@ inherited frmCustomer: TfrmCustomer
ImageIndex = 7
OnClick = TBCloseClick
end
object SetupStore: TToolButton
Left = 996
Top = 0
AutoSize = True
Caption = #19968#38190#35774#32622#38376#24215
ImageIndex = 23
OnClick = SetupStoreClick
end
end
object Panel1: TPanel [1]
Left = 0

View File

@ -117,6 +117,7 @@ type
Tv1Column9: TcxGridDBColumn;
Tv1Column12: TcxGridDBColumn;
Tv1Column13: TcxGridDBColumn;
SetupStore: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
@ -140,6 +141,7 @@ type
procedure ToolButton2Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure SetupStoreClick(Sender: TObject);
private
fFlileFlag: string;
{ Private declarations }
@ -214,6 +216,38 @@ begin
end;
end;
end;
if Trim(canshu4) = '新余' then
begin
SetupStore.Visible:=False;
end;
end;
procedure TfrmCustomer.btnReChkClick(Sender: TObject);
var
RTValues: TArray<string>;
begin
if CDS_1.IsEmpty then
exit;
RTValues := SelCDSKey(CDS_1, ['COID']);
if RTValues[0] = '' then
begin
Application.MessageBox('请选择数据!', '提示', 0);
Exit;
end;
try
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update BS_Company SET status=''1'',Chktime=getdate(),Chker=' + quotedstr(trim(DName)));
sql.Add('where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + QuotedStr(RTValues[0]) + ','','') X where BS_Company.CoID=X.RTValue ) ');
execsql;
end;
application.MessageBox('撤销审核成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('撤销审核失败!', '提示信息', 0);
end;
end;
procedure TfrmCustomer.InitGrid();
@ -491,7 +525,7 @@ begin
end;
end;
procedure TfrmCustomer.btnReChkClick(Sender: TObject);
procedure TfrmCustomer.SetupStoreClick(Sender: TObject);
var
RTValues: TArray<string>;
begin
@ -508,14 +542,14 @@ begin
begin
close;
sql.Clear;
sql.Add('update BS_Company SET status=''0'',Chktime=null,Chker=null ');
sql.Add('update BS_Company SET Stores=''新余'' ');
sql.Add('where EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + QuotedStr(RTValues[0]) + ','','') X where BS_Company.CoID=X.RTValue ) ');
execsql;
end;
application.MessageBox('撤销审核成功!', '提示信息');
application.MessageBox('设置门店成功!', '提示信息');
TBRafresh.Click;
except
application.MessageBox('撤销审核失败!', '提示信息', 0);
application.MessageBox('设置门店失败!', '提示信息', 0);
end;
end;

View File

@ -80,7 +80,7 @@ begin
Parameters1 := '管理';
// DCode := 'L01';
// DCode := 'L02';
// Parameters4 := '新余';
Parameters4 := '新余';
end
else
begin

View File

@ -165,7 +165,6 @@ inherited frmClothInfo: TfrmClothInfo
Height = 733
HotZoneClassName = 'TcxMediaPlayer9Style'
Control = Panel5
ExplicitHeight = 506
end
object Panel1: TPanel [2]
Left = 0
@ -271,7 +270,6 @@ inherited frmClothInfo: TfrmClothInfo
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 2
ExplicitHeight = 506
object cxDBTreeList1: TcxDBTreeList
Left = 2
Top = 2
@ -294,7 +292,6 @@ inherited frmClothInfo: TfrmClothInfo
ScrollbarAnnotations.CustomAnnotations = <>
TabOrder = 0
OnDblClick = cxDBTreeList1DblClick
ExplicitHeight = 502
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
DataBinding.FieldName = 'CTName'
Width = 210
@ -316,7 +313,6 @@ inherited frmClothInfo: TfrmClothInfo
BevelOuter = bvLowered
Caption = 'Panel3'
TabOrder = 4
ExplicitHeight = 506
object Panel7: TPanel
Left = 2
Top = 2
@ -407,7 +403,6 @@ inherited frmClothInfo: TfrmClothInfo
Align = alBottom
Caption = 'Panel9'
TabOrder = 1
ExplicitTop = 299
object Panel10: TPanel
Left = 1
Top = 1
@ -445,9 +440,6 @@ inherited frmClothInfo: TfrmClothInfo
Align = alClient
PopupMenu = PM_1
TabOrder = 2
ExplicitLeft = 10
ExplicitWidth = 1088
ExplicitHeight = 257
object Tv1: TcxGridDBTableView
OnDblClick = Tv1DblClick
OnMouseDown = Tv1MouseDown
@ -696,7 +688,6 @@ inherited frmClothInfo: TfrmClothInfo
Width = 8
Height = 484
AlignSplitter = salRight
ExplicitHeight = 257
end
end
inherited loadProcess: TPanel
@ -719,7 +710,6 @@ inherited frmClothInfo: TfrmClothInfo
Height = 733
Align = alRight
TabOrder = 8
ExplicitHeight = 506
object Tv2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>

View File

@ -17,7 +17,23 @@ uses
IdExplicitTLSClientServerBase, U_BaseList, cxContainer, dxDBBarCode, dxBarCode,
Vcl.Clipbrd, cxTextEdit, BtnEdit, StrUtils, Vcl.Buttons,
dxScrollbarAnnotations, cxProgressBar, dxSkinsCore, dxSkinsDefaultPainters,
dxSkinWXI;
dxSkinWXI, dxSkinBasic, 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, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue;
type
FdDy = record

View File

@ -22,6 +22,7 @@ inherited frmTradeClothTotalInInput: TfrmTradeClothTotalInInput
Align = alClient
TabOrder = 0
object Tv1: TcxGridDBTableView
OnMouseDown = Tv1MouseDown
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_1
@ -92,7 +93,9 @@ inherited frmTradeClothTotalInInput: TfrmTradeClothTotalInInput
#29983#20135#36864#22238
#38144#21806#36864#22238
#30424#30408#20837#24211
#26399#21021#20837#24211)
#26399#21021#20837#24211
#35843#25320#20837#24211
#37319#36141#20837#24211)
HeaderAlignmentHorz = taCenter
Width = 77
end
@ -183,13 +186,16 @@ inherited frmTradeClothTotalInInput: TfrmTradeClothTotalInInput
Caption = #21697#21517
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
PropertiesClassName = 'TcxButtonEditProperties'
Properties.Buttons = <
PropertiesClassName = 'TcxLookupComboBoxProperties'
Properties.KeyFieldNames = 'C_Name'
Properties.ListColumns = <
item
Default = True
Kind = bkEllipsis
Caption = #21517#31216
HeaderAlignment = taCenter
FieldName = 'C_Name'
end>
Properties.OnButtonClick = v2Column1PropertiesButtonClick
Properties.ListSource = DS_PM
Properties.OnEditValueChanged = v1SPNamePropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 77
end
@ -559,4 +565,15 @@ inherited frmTradeClothTotalInInput: TfrmTradeClothTotalInInput
Left = 644
Top = 367
end
object ADO_PM: TADOQuery
Connection = DataLink_TradeTotalClothStk.ADOLink
Parameters = <>
Left = 584
Top = 443
end
object DS_PM: TDataSource
DataSet = ADO_PM
Left = 644
Top = 447
end
end

View File

@ -11,7 +11,7 @@ uses
cxGridPopupMenu, ADODB, DBClient, cxButtonEdit, cxTextEdit, StdCtrls, ExtCtrls,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxDateRanges,
dxBarBuiltInMenu, U_BaseInput, System.ImageList, Vcl.ImgList, cxCheckBox, cxPC,
dxScrollbarAnnotations, cxImageList;
dxScrollbarAnnotations, cxImageList, cxDBLookupComboBox;
type
TfrmTradeClothTotalInInput = class(TfrmBaseInput)
@ -69,6 +69,8 @@ type
Tv1Column21: TcxGridDBColumn;
Tv1Column22: TcxGridDBColumn;
GeMeiOutputSel: TToolButton;
ADO_PM: TADOQuery;
DS_PM: TDataSource;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBAddClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
@ -87,6 +89,8 @@ type
procedure Tv1Column8PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure Tv1Column14PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure GeMeiOutputSelClick(Sender: TObject);
procedure v1SPNamePropertiesEditValueChanged(Sender: TObject);
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
function SaveData(MSaveType: string): Boolean;
@ -162,6 +166,7 @@ begin
FieldByName('BCIOID').Value := null;
FieldByName('StkCoNo').Value := '本厂仓库';
FieldByName('StkCoName').Value := '本厂仓库';
post;
end;
end
@ -174,6 +179,7 @@ begin
FieldByName('StkCoNo').Value := '本厂仓库';
FieldByName('StkCoName').Value := '本厂仓库';
FieldByName('QtyUnit').Value := 'Kg';
FieldByName('C_Degree').AsString := Trim('Å÷²¼');
Post;
end;
end;
@ -360,6 +366,14 @@ begin
SInitCDSData(ADOQueryTemp, CDS_Sub);
SetStatus();
with ADO_PM do
begin
Close;
sql.Clear;
sql.Add(' SELECT C_Code,C_Name FROM Bs_Cloth_Info ');
Open;
end;
end;
procedure TfrmTradeClothTotalInInput.GeMeiOutputSelClick(Sender: TObject);
@ -667,6 +681,34 @@ begin
end;
end;
procedure TfrmTradeClothTotalInInput.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if not ADO_PM.IsEmpty then
begin
if ADO_PM.FieldByName('C_Name').AsString <> CDS_sub.FieldByName('C_Name').AsString then
begin
with ADO_PM do
begin
Close;
sql.Clear;
sql.Add(' SELECT C_Code,C_Name FROM Bs_Cloth_Info ');
//sql.Add(' where C_Code= ' + QuotedStr(CDS_sub.FieldByName('C_Code').AsString));
Open;
end;
end;
end
else
with ADO_PM do
begin
Close;
sql.Clear;
sql.Add(' SELECT C_Code,C_Name FROM Bs_Cloth_Info ');
//sql.Add(' where C_Code= ' + QuotedStr(CDS_sub.FieldByName('C_Code').AsString));
Open;
end;
end;
procedure TfrmTradeClothTotalInInput.v1Column14PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
@ -763,5 +805,24 @@ begin
end;
end;
procedure TfrmTradeClothTotalInInput.v1SPNamePropertiesEditValueChanged(Sender: TObject);
var
mvalue, FFieldName: string;
begin
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
mvalue := TcxTextEdit(Sender).EditingText;
with CDS_Sub do
begin
Edit;
FieldByName(FFieldName).Value := Trim(mvalue);
Post;
ADO_pm.Locate('C_Name', mvalue, []);
Edit;
FieldByName('C_Name').Value := ADO_pm.FieldByName('C_Name').Value;
Post;
end;
end;
end.

View File

@ -130,7 +130,7 @@ begin
111: //댕새데
begin
with TfrmTradeMarketList.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10),formId,title) do //
with TfrmTradeMarketList.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10), FormID, Title) do //
begin
fFormID := FormID;
FOrdType := '攣끽데';

View File

@ -2,21 +2,21 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Left = 143
Top = 4
Caption = #35746#21333#24405#20837
ClientHeight = 699
ClientWidth = 1913
ClientHeight = 736
ClientWidth = 1921
Font.Charset = GB2312_CHARSET
Font.Height = -16
Position = poMainFormCenter
WindowState = wsMaximized
ExplicitWidth = 1929
ExplicitHeight = 738
ExplicitWidth = 1937
ExplicitHeight = 775
PixelsPerInch = 96
TextHeight = 21
object ToolBar1: TToolBar [0]
Tag = 1
Left = 0
Top = 0
Width = 1913
Width = 1921
Height = 38
AutoSize = True
ButtonHeight = 38
@ -28,8 +28,6 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
List = True
ShowCaptions = True
TabOrder = 0
ExplicitLeft = -8
ExplicitTop = -6
object TBSave: TToolButton
Left = 0
Top = 0
@ -61,7 +59,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Tag = 1
Left = 0
Top = 193
Width = 1913
Width = 1921
Height = 24
ButtonHeight = 30
ButtonWidth = 67
@ -92,28 +90,26 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
object Panel2: TPanel [2]
Left = 0
Top = 217
Width = 1913
Height = 482
Width = 1921
Height = 519
Align = alClient
Caption = 'Panel2'
TabOrder = 2
object Panel3: TPanel
Left = 1
Top = 1
Width = 1625
Height = 480
Width = 1633
Height = 517
Align = alClient
Caption = 'Panel2'
TabOrder = 0
object cxGrid1: TcxGrid
Left = 1
Top = 1
Width = 1623
Height = 478
Width = 1631
Height = 515
Align = alClient
TabOrder = 0
ExplicitLeft = -127
ExplicitTop = 42
object Tv1: TcxGridDBTableView
OnMouseDown = Tv1MouseDown
Navigator.Buttons.CustomButtons = <>
@ -371,10 +367,10 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
end
end
object Panel4: TPanel
Left = 1626
Left = 1634
Top = 1
Width = 286
Height = 480
Height = 517
Align = alRight
Caption = 'Panel4'
TabOrder = 1
@ -385,8 +381,6 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Height = 41
Align = alTop
TabOrder = 0
ExplicitLeft = -23
ExplicitTop = 5
object Label33: TLabel
Left = 113
Top = 10
@ -403,7 +397,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
end
object QtyMX: TcxTextEdit
Left = 163
Top = 4
Top = 2
TabOrder = 0
OnKeyPress = QtyMXKeyPress
Width = 89
@ -413,21 +407,17 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Left = 1
Top = 42
Width = 284
Height = 437
Height = 474
Align = alClient
Caption = #21452#20987#21024#38500#26126#32454#20449#24687
TabOrder = 1
ExplicitLeft = -7
ExplicitTop = 48
object cxGrid2: TcxGrid
Left = 2
Top = 23
Width = 280
Height = 412
Height = 449
Align = alClient
TabOrder = 0
ExplicitLeft = -22
ExplicitTop = 22
object TvMX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False
@ -490,7 +480,7 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
object ScrollBox1: TScrollBox [3]
Left = 0
Top = 38
Width = 1913
Width = 1921
Height = 155
Align = alTop
BevelInner = bvNone
@ -500,8 +490,6 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
ParentCtl3D = False
TabOrder = 3
OnClick = ScrollBox1Click
ExplicitLeft = -8
ExplicitTop = 56
object Label3: TLabel
Left = 730
Top = 70
@ -546,14 +534,6 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Caption = #32463#33829#21333#20301
Visible = False
end
object Label19: TLabel
Left = 371
Top = 247
Width = 80
Height = 21
Caption = #32852#31995#26041#24335#65306
Visible = False
end
object Label37: TLabel
Left = 1077
Top = 21
@ -575,10 +555,17 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
Height = 21
Caption = #35746#21333#21495
end
object Label19: TLabel
Left = 1077
Top = 68
Width = 80
Height = 21
Caption = #32852#31995#26041#24335#65306
end
object TMMNo: TcxTextEdit
Tag = 2
Left = 814
Top = 17
Top = 15
Enabled = False
TabOrder = 0
Width = 200
@ -671,39 +658,39 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
OnDblClick = OurCoNameDblClick
Width = 200
end
object BuyOrdNo: TcxTextEdit
Tag = 2
Left = 416
Top = 15
TabOrder = 7
Width = 200
end
object CustName: TcxMRUEdit
Left = 122
Top = 15
Properties.ImmediatePost = True
Properties.ReadOnly = False
Properties.OnButtonClick = StkPositionPropertiesButtonClick
Properties.OnChange = CustNamePropertiesChange
Properties.OnCloseUp = CustNamePropertiesCloseUp
TabOrder = 8
OnMouseDown = CustNameMouseDown
Width = 200
end
object CONTACT: TcxButtonEdit
Tag = 2
Left = 469
Top = 243
Left = 1164
Top = 63
Hint = 'CONTACT/'#32852#31995#26041#24335
Properties.Buttons = <
item
Default = True
Kind = bkEllipsis
end>
Properties.ReadOnly = True
Properties.OnButtonClick = ShippingAddressPropertiesButtonClick
Style.ButtonStyle = btsDefault
TabOrder = 7
Visible = False
OnDblClick = OurCoNameDblClick
Width = 545
end
object BuyOrdNo: TcxTextEdit
Tag = 2
Left = 436
Top = 17
TabOrder = 8
Width = 200
end
object CustName: TcxMRUEdit
Left = 122
Top = 17
Properties.ImmediatePost = True
Properties.ReadOnly = False
Properties.OnButtonClick = StkPositionPropertiesButtonClick
Properties.OnChange = CustNamePropertiesChange
TabOrder = 9
OnDblClick = OurCoNameDblClick
Width = 200
end
end
@ -884,6 +871,10 @@ inherited frmTradeMarketInPut: TfrmTradeMarketInPut
object PopupMenu1: TPopupMenu
Left = 425
Top = 370
object N5: TMenuItem
Caption = #20445#23384#21518#31435#21363#25552#20132
OnClick = N5Click
end
object N1: TMenuItem
Caption = #20445#23384#21518#31435#21363#23457#26680
OnClick = N1Click

View File

@ -93,7 +93,6 @@ type
Label2: TLabel;
Label14: TLabel;
Label20: TLabel;
Label19: TLabel;
Label37: TLabel;
Label18: TLabel;
TMMNo: TcxTextEdit;
@ -103,7 +102,6 @@ type
OrdType: TComboBox;
OurCoName: TcxButtonEdit;
ShippingAddress: TcxButtonEdit;
CONTACT: TcxButtonEdit;
ADO_YS: TADOQuery;
DS_YS: TDataSource;
DS_RCPM: TDataSource;
@ -129,6 +127,9 @@ type
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
Label19: TLabel;
CONTACT: TcxButtonEdit;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
@ -166,6 +167,9 @@ type
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure CustNameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure CustNamePropertiesCloseUp(Sender: TObject);
private
FSCXDH: string;
procedure InitData();
@ -425,7 +429,7 @@ begin
begin
Close;
sql.Clear;
sql.Add(' SELECT C_Code,C_Name,qtyunit FROM Bs_Cloth_Info order by HotQty desc ');
sql.Add(' SELECT A.C_Code,A.C_Name,A.qtyunit,B.Price FROM Bs_Cloth_Info A left join Trade_Market_Sub B on A.C_Code=B.C_Code order by HotQty desc ');
Open;
end;
with ADO_YS do
@ -499,6 +503,8 @@ begin
FieldByName('Filler').Value := Trim(DName);
if btnFlag = 1 then //±£´æºóÁ¢¼´ÉóºË
FieldByName('status').Value := Trim('9');
if btnFlag = 5 then //保存后立即提交
FieldByName('status').Value := Trim('1');
end
else
begin
@ -506,6 +512,7 @@ begin
FieldByName('EditId').Value := Trim(DCode);
FieldByName('Editer').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
end;
RTSetsavedata(ADOCmd, 'Trade_Market_Main', ScrollBox1, 2);
FieldByName('TMMID').Value := Trim(maxno);
@ -558,37 +565,6 @@ begin
end;
///////////////////// ±£´æ×Ó±í ///////////////////////////
// with CDS_MX do
// begin
// First;
// while not Eof do
// begin
//
// with ADOCmd do
// begin
// Close;
// SQL.Clear;
// sql.Add('select * from Trade_Market_Sub_Qty where TMSQID=' + quotedstr(Trim(CDS_MX.FieldByName('TMSQID').AsString)));
// Open;
// end;
// with ADOCmd do
// begin
// if Trim(CDS_MX.fieldbyname('TMSQID').AsString) = '' then
// Append
// else
// Edit;
// RTSetSaveDataCDS(ADOCmd, TvMX, CDS_MX, 'Trade_Market_Sub_Qty', 0);
// Post;
// end;
// Next;
// end;
// end;
with ADOCmd do
begin
Close;
@ -949,11 +925,69 @@ begin
end;
procedure TfrmTradeMarketInPut.CustNameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if not ADO_YS.IsEmpty then
begin
if ADO_YS.FieldByName('C_Code').AsString <> CDS_1.FieldByName('C_Code').AsString then
begin
with ADO_YS do
begin
Close;
sql.Clear;
sql.Add(' SELECT A.C_Code,B.C_Color,B.C_ColorNo FROM Bs_Cloth_Info A inner join BS_Cloth_Info_Sub B on A.BCIID=B.BCIID ');
sql.Add(' where A.C_Code= ' + QuotedStr(CDS_1.FieldByName('C_Code').AsString));
Open;
end;
end;
end
else
begin
with ADO_YS do
begin
Close;
sql.Clear;
sql.Add(' SELECT A.C_Code,B.C_Color,B.C_ColorNo FROM Bs_Cloth_Info A inner join BS_Cloth_Info_Sub B on A.BCIID=B.BCIID ');
sql.Add(' where A.C_Code= ' + QuotedStr(CDS_1.FieldByName('C_Code').AsString));
Open;
end;
end;
end;
procedure TfrmTradeMarketInPut.CustNamePropertiesChange(Sender: TObject);
begin
inherited;
if CDS_KH.Locate('CoAbbrName', Trim(self.CustName.Text), []) then
begin
self.CustName.Hint := Trim(CDS_KH.fieldbyname('CoCode').AsString);
end;
end;
procedure TfrmTradeMarketInPut.CustNamePropertiesCloseUp(Sender: TObject);
begin
inherited;
with ADOtemp do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.* ');
sql.Add(',BankName=(select top 1 BankName from Bs_Company_Bank X where X.CoID=A.CoID ) ');
sql.Add(',ContactsId=(select top 1 UserID from SY_User X where X.UserName=B.Contacts ) ');
sql.Add('from BS_Company A ');
sql.Add('left join BS_Company_contact B ON A.COID=B.COID and B.IsDefault=1 ');
sql.Add('where 1=1 ');
sql.Add(' and A.CoType=''' + Trim('客户') + '''');
// if Trim(FAuthority) = '理单业务' then
// begin
// sql.Add(' and ( SalesId=' + quotedstr(trim(DCode)) + ' or exists (select * from [dbo].[F_Tool_SplitString](TallyId,'','') X where X.RTValue =' + quotedstr(trim(DCode)) + '))');
// end;
if canshu4 = '新余' then
sql.Add(' and A.Stores=''' + Trim('新余') + '''');
sql.Add(' and A.CoAbbrName=''' + Trim(CustName.Text) + '''');
Open;
end;
self.ShippingAddress.Text := Trim(adotemp.fieldbyname('mxaddress').AsString);
self.CONTACT.Text := Trim(adotemp.fieldbyname('Telephone').AsString);
end;
procedure TfrmTradeMarketInPut.cxDBImage1DblClick(Sender: TObject);
@ -1029,6 +1063,12 @@ begin
TBSaveClick(Sender);
end;
procedure TfrmTradeMarketInPut.N5Click(Sender: TObject);
begin
btnFlag := 5;
TBSaveClick(Sender);
end;
procedure TfrmTradeMarketInPut.OurCoNameDblClick(Sender: TObject);
begin
TcxButtonEdit(Sender).Text := '';
@ -1215,7 +1255,7 @@ begin
self.CustName.Hint := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);
self.CustName.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoAbbrName').AsString);
self.ShippingAddress.Text := Trim(frmCompanySel.CDS_1.fieldbyname('mxaddress').AsString);
self.CONTACT.Text := Trim(frmCompanySel.CDS_1.fieldbyname('PhoneNumber').AsString);
self.CONTACT.Text := Trim(frmCompanySel.CDS_1.fieldbyname('Telephone').AsString);
end;
end;
@ -1287,9 +1327,10 @@ begin
begin
Close;
SQL.Clear;
sql.Add('insert into Trade_Market_Sub_Qty (TMSQID,TMSId,Qty)');
sql.Add('insert into Trade_Market_Sub_Qty (TMSQID,TMSId,TMMID,Qty)');
sql.Add('values(' + quotedstr(Trim(MaxNo)));
sql.Add(',' + quotedstr(Trim(MTMSId)));
sql.Add(',' + quotedstr(Trim(FTMMID)));
sql.Add(',' + QtyMX.Text);
sql.Add(')');
ExecSQL;
@ -1301,6 +1342,7 @@ begin
Append;
FieldByName('TMSQID').Value := MaxNo;
FieldByName('TMSId').Value := MTMSId;
FieldByName('TMMId').Value := FTMMId;
FieldByName('Qty').Value := QtyMX.Text;
post;
end;
@ -1428,6 +1470,7 @@ begin
Edit;
FieldByName('C_Code').Value := ADO_PM.FieldByName('C_Code').Value;
FieldByName('TMSUnit').Value := ADO_PM.FieldByName('qtyunit').Value;
FieldByName('price').Value := ADO_PM.FieldByName('price').Value;
Post;
end;

View File

@ -410,7 +410,7 @@ inherited frmTradeMarketList: TfrmTradeMarketList
end
object Tv1Column22: TcxGridDBColumn
Caption = #20986#24211#25968#37327
DataBinding.FieldName = 'Qty2'
DataBinding.FieldName = 'OutQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Width = 84

View File

@ -312,7 +312,7 @@ begin
SqlStr := SqlStr + ' , @Status=''10'' ';
end;
end;
// ShowMessage(SqlStr);
// ShowMessage(SqlStr);
InitCDSData(ADOQueryMain, Order_Main, Tv1, SqlStr, FilterStr, 'TMMId');
end;