增加码单
This commit is contained in:
parent
ccbf816152
commit
2c3486532e
|
@ -2,7 +2,7 @@ library TradeManage;
|
|||
uses
|
||||
SysUtils,
|
||||
classes,
|
||||
forms,
|
||||
forms,
|
||||
WinTypes,
|
||||
WinProcs,
|
||||
U_DataLink in 'U_DataLink.pas' {DataLink_TradeManage: TDataModule},
|
||||
|
|
|
@ -127,10 +127,18 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
|
|||
ImageIndex = 54
|
||||
OnClick = ToolButton13Click
|
||||
end
|
||||
object ToolButton8: TToolButton
|
||||
object ToolButton14: TToolButton
|
||||
Left = 929
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25209#37327#20462#25913#33853#33394
|
||||
ImageIndex = 54
|
||||
OnClick = ToolButton14Click
|
||||
end
|
||||
object ToolButton8: TToolButton
|
||||
Left = 1040
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25209#37327#20462#25913#30382#37325
|
||||
ImageIndex = 54
|
||||
Wrap = True
|
||||
|
@ -1113,6 +1121,12 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
|
|||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object Tv1Column3: TcxGridDBColumn
|
||||
Caption = #33853#33394
|
||||
DataBinding.FieldName = 'MJLS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
|
@ -1889,6 +1903,47 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
|
|||
'4')
|
||||
end
|
||||
end
|
||||
object Panel14: TPanel
|
||||
Left = 1044
|
||||
Top = 216
|
||||
Width = 225
|
||||
Height = 117
|
||||
Color = clSkyBlue
|
||||
TabOrder = 14
|
||||
Visible = False
|
||||
object Label38: TLabel
|
||||
Left = 24
|
||||
Top = 44
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #33853#33394
|
||||
end
|
||||
object Button15: TButton
|
||||
Left = 32
|
||||
Top = 72
|
||||
Width = 60
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button15Click
|
||||
end
|
||||
object Button16: TButton
|
||||
Left = 128
|
||||
Top = 72
|
||||
Width = 60
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button16Click
|
||||
end
|
||||
object FMJLS: TEdit
|
||||
Left = 56
|
||||
Top = 40
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
|
|
|
@ -224,6 +224,13 @@ type
|
|||
Edit6: TEdit;
|
||||
Tv1Column2: TcxGridDBColumn;
|
||||
Label37: TLabel;
|
||||
Tv1Column3: TcxGridDBColumn;
|
||||
ToolButton14: TToolButton;
|
||||
Panel14: TPanel;
|
||||
Label38: TLabel;
|
||||
Button15: TButton;
|
||||
Button16: TButton;
|
||||
FMJLS: TEdit;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
|
@ -285,6 +292,9 @@ type
|
|||
procedure Button8Click(Sender: TObject);
|
||||
procedure Button14Click(Sender: TObject);
|
||||
procedure Button13Click(Sender: TObject);
|
||||
procedure Button15Click(Sender: TObject);
|
||||
procedure Button16Click(Sender: TObject);
|
||||
procedure ToolButton14Click(Sender: TObject);
|
||||
// procedure Edit5Click(Sender: TObject);
|
||||
// procedure CheckBox3Click(Sender: TObject);
|
||||
private
|
||||
|
@ -452,7 +462,7 @@ begin
|
|||
EnableControls;
|
||||
end;
|
||||
|
||||
TV1.Controller.FocusedRowIndex := i;
|
||||
TV1.Controller.FocusedRowIndex := i;
|
||||
TV1.Controller.TopRowIndex := t;
|
||||
|
||||
label22.Caption := 'Æ¥Êý:' + floattostr(sumP);
|
||||
|
@ -625,12 +635,12 @@ begin
|
|||
MJQty4.Text := Trim(ADOTmp.fieldbyname('MJQty4').AsString);
|
||||
MJFK.Text := Trim(ADOTmp.fieldbyname('MJFK').AsString);
|
||||
MJSJKZ.Text := Trim(ADOTmp.fieldbyname('MJSJKZ').AsString);
|
||||
M.Caption := Trim(Trim(ADOTmp.fieldbyname('MJTypeOther').AsString));
|
||||
// M.Caption := Trim(Trim(ADOTmp.fieldbyname('MJTypeOther').AsString));
|
||||
Ma.Caption := Trim(Trim(ADOTmp.fieldbyname('MJStr1').AsString));
|
||||
if Trim(m.Caption) = '' then
|
||||
begin
|
||||
m.Caption := Trim(ADOTmp.fieldbyname('AOrddefstr3').AsString);
|
||||
end;
|
||||
// if Trim(m.Caption) = '' then
|
||||
// begin
|
||||
// m.Caption := Trim(ADOTmp.fieldbyname('AOrddefstr3').AsString);
|
||||
// end;
|
||||
if Trim(Ma.Caption) = '' then
|
||||
begin
|
||||
Ma.Caption := Trim(ADOTmp.fieldbyname('AOrddefstr2').AsString);
|
||||
|
@ -2341,5 +2351,59 @@ begin
|
|||
|
||||
end;
|
||||
|
||||
procedure TfrmJYOrderCDOne.Button15Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then
|
||||
Exit;
|
||||
if Order_Main.Locate('SSel', True, []) = False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
Order_Main.DisableControls;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean = True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update WFB_MJJY Set MJLS=''' + trim(FMJLS.Text) + ''' ');
|
||||
sql.Add('where MJID=''' + Trim(Order_Main.fieldbyname('MJID').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Order_Main.EnableControls;
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
Panel14.Visible := false;
|
||||
TBRafresh.Click;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Order_Main.EnableControls;
|
||||
application.MessageBox('数据保存失败!', '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmJYOrderCDOne.Button16Click(Sender: TObject);
|
||||
begin
|
||||
Panel14.Visible := false;
|
||||
end;
|
||||
|
||||
procedure TfrmJYOrderCDOne.ToolButton14Click(Sender: TObject);
|
||||
begin
|
||||
Panel14.Left := (self.Width - Panel14.Width) div 2;
|
||||
Panel14.Visible := true;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
@ -1010,8 +1010,8 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
OnClick = Label9Click
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 154
|
||||
Top = 446
|
||||
Left = 133
|
||||
Top = 447
|
||||
Width = 26
|
||||
Height = 22
|
||||
Caption = 'cm'
|
||||
|
@ -1049,7 +1049,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 18
|
||||
Left = 1
|
||||
Top = 446
|
||||
Width = 42
|
||||
Height = 20
|
||||
|
@ -1114,7 +1114,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
ParentFont = False
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 217
|
||||
Left = 238
|
||||
Top = 58
|
||||
Width = 60
|
||||
Height = 23
|
||||
|
@ -1141,8 +1141,8 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
Visible = False
|
||||
end
|
||||
object Label22: TLabel
|
||||
Left = 154
|
||||
Top = 480
|
||||
Left = 134
|
||||
Top = 481
|
||||
Width = 36
|
||||
Height = 22
|
||||
Caption = 'g/'#13217
|
||||
|
@ -1154,7 +1154,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
ParentFont = False
|
||||
end
|
||||
object Label23: TLabel
|
||||
Left = 18
|
||||
Left = 1
|
||||
Top = 479
|
||||
Width = 42
|
||||
Height = 20
|
||||
|
@ -1193,7 +1193,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
ParentFont = False
|
||||
end
|
||||
object Label29: TLabel
|
||||
Left = 214
|
||||
Left = 235
|
||||
Top = 14
|
||||
Width = 58
|
||||
Height = 23
|
||||
|
@ -1389,10 +1389,23 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label56: TLabel
|
||||
Left = 168
|
||||
Top = 446
|
||||
Width = 42
|
||||
Height = 20
|
||||
Caption = #33853#33394
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -20
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object MJFK: TEdit
|
||||
Left = 64
|
||||
Top = 440
|
||||
Width = 83
|
||||
Left = 45
|
||||
Top = 441
|
||||
Width = 88
|
||||
Height = 33
|
||||
AutoSize = False
|
||||
Enabled = False
|
||||
|
@ -1507,9 +1520,9 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
OnKeyPress = MJstr3KeyPress
|
||||
end
|
||||
object MJSJKZ: TEdit
|
||||
Left = 65
|
||||
Top = 474
|
||||
Width = 81
|
||||
Left = 44
|
||||
Top = 475
|
||||
Width = 88
|
||||
Height = 33
|
||||
AutoSize = False
|
||||
Enabled = False
|
||||
|
@ -1793,6 +1806,24 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
|
|||
OnExit = MJStr4Exit
|
||||
OnKeyPress = MJstr3KeyPress
|
||||
end
|
||||
object MJLS: TEdit
|
||||
Left = 176
|
||||
Top = 472
|
||||
Width = 41
|
||||
Height = 33
|
||||
AutoSize = False
|
||||
Enabled = False
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -32
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 24
|
||||
Text = 'A'
|
||||
OnClick = MJXHClick
|
||||
OnKeyPress = MJstr3KeyPress
|
||||
end
|
||||
end
|
||||
object MovePanel1: TMovePanel
|
||||
Left = 634
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
unit U_MJManageNewFDNew;
|
||||
|
||||
interface
|
||||
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, math, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, StdCtrls, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
|
@ -270,6 +270,8 @@ type
|
|||
Label55: TLabel;
|
||||
BPtype: TEdit;
|
||||
Tv3Column1: TcxGridDBColumn;
|
||||
Label56: TLabel;
|
||||
MJLS: TEdit;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
|
@ -1033,6 +1035,7 @@ begin
|
|||
FieldByName('APId').value := Trim(FAPId);
|
||||
FieldByName('MJID').Value := Trim(maxno);
|
||||
FieldByName('MJStr2').Value := 'δÈë¿â';
|
||||
FieldByName('MJLS').Value := Trim(MJLS.Text);
|
||||
FieldByName('note').Value := Trim(note.Text);
|
||||
FieldByName('BPtype').Value := Trim(BPtype.Text);
|
||||
FieldByName('MJBanZu').Value := Trim(FBanZu);
|
||||
|
@ -1375,7 +1378,27 @@ begin
|
|||
end
|
||||
else if fRollType = 'ÎÞ¹æÔòÉú³É' then
|
||||
begin
|
||||
if Edit10.text <> '' then
|
||||
begin
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select subid,MJStr4,MJXH from WFB_MJJY X where X.mainID=''' + Trim(FMainId) + ''' and X.subid=''' + Trim(Fsubid) + ''' and isnull(X.MJStr4,'''')=''' + Trim(MJStr4.Text) + '''');
|
||||
sql.Add(' Group by subid,MJStr4,MJXH having count(*)>1');
|
||||
Open;
|
||||
end;
|
||||
|
||||
if ADOCmd.IsEmpty = False then
|
||||
begin
|
||||
CFMJXH := Trim(ADOCmd.fieldbyname('MJXH').AsString);
|
||||
Result := False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
PlaySound('wav\卷号重复.wav', 0, SND_FILENAME or SND_ASYNC);
|
||||
Application.MessageBox(Pchar('卷号: ' + Trim(CFMJXH) + ' 重复,请处理数据!'), '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -1715,7 +1738,7 @@ begin
|
|||
apid.Text := FAPID;
|
||||
Button3.Click;
|
||||
end;
|
||||
|
||||
|
||||
end
|
||||
else
|
||||
exit;
|
||||
|
|
|
@ -579,7 +579,7 @@ object frmProductOrderNewList: TfrmProductOrderNewList
|
|||
Width = 60
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #26816#39564#38271#24230
|
||||
Caption = #26816#39564#31859#25968
|
||||
DataBinding.FieldName = 'JYQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
|
@ -655,6 +655,12 @@ object frmProductOrderNewList: TfrmProductOrderNewList
|
|||
Styles.Header = DataLink_TradeManage.Default
|
||||
Width = 80
|
||||
end
|
||||
object Tv1Column5: TcxGridDBColumn
|
||||
Caption = #26816#39564#30721#25968
|
||||
DataBinding.FieldName = 'JYMQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
|
@ -1009,7 +1015,7 @@ object frmProductOrderNewList: TfrmProductOrderNewList
|
|||
Width = 60
|
||||
end
|
||||
object V2Column8: TcxGridDBColumn
|
||||
Caption = #26816#39564#38271#24230
|
||||
Caption = #26816#39564#31859#25968
|
||||
DataBinding.FieldName = 'JYQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
|
@ -1091,6 +1097,12 @@ object frmProductOrderNewList: TfrmProductOrderNewList
|
|||
HeaderAlignmentHorz = taCenter
|
||||
Width = 65
|
||||
end
|
||||
object TV2Column8: TcxGridDBColumn
|
||||
Caption = #26816#39564#30721#25968
|
||||
DataBinding.FieldName = 'JYMQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV2
|
||||
|
|
|
@ -20,12 +20,12 @@ uses
|
|||
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;
|
||||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
||||
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
||||
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
||||
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
||||
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
||||
dxSkinscxPCPainter;
|
||||
|
||||
type
|
||||
TfrmProductOrderNewList = class(TForm)
|
||||
|
@ -162,6 +162,8 @@ type
|
|||
TV2Column7: TcxGridDBColumn;
|
||||
ToolButton7: TToolButton;
|
||||
QryCheckNet: TADOQuery;
|
||||
Tv1Column5: TcxGridDBColumn;
|
||||
TV2Column8: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
|
@ -233,7 +235,7 @@ uses
|
|||
function TfrmProductOrderNewList.SelfConnData(): Boolean;
|
||||
begin
|
||||
try
|
||||
with QryCheckNet do
|
||||
with QryCheckNet do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
|
@ -307,12 +309,13 @@ begin
|
|||
exit;
|
||||
with ADOQuerySub do
|
||||
begin
|
||||
close;
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select *,DJStatus=case when JYRoll=MaxRoll then 0 else 1 end from (');
|
||||
sql.Add('select A.*, ');
|
||||
sql.Add('JYRoll=(select count(MJID) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID),');
|
||||
sql.Add('JYQty=(select sum(MJLen) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID),');
|
||||
sql.Add('JYMQty=(select sum(MJMa) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID),');
|
||||
sql.Add('JYJZ=(select sum(MJQty4) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID),');
|
||||
sql.Add('JYMZ=(select sum(MJMaoZ) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID),');
|
||||
sql.Add('JYCRoll=(select count(MJID) from WFB_MJJY X where X.MainID=A.mainID and X.subID=A.subID and X.MJType=''´ÎÆ·''),');
|
||||
|
|
Loading…
Reference in New Issue
Block a user