|
|
|
|
unit u_op_seai_oder_add;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, BusinessSkinForm, bsSkinCtrls, StdCtrls, wwdbdatetimepicker, DB,
|
|
|
|
|
RxLookup,adodb,my_sys_chat;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_op_seai_order_add = class(TForm)
|
|
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
wwDBDateTimePicker1: TwwDBDateTimePicker;
|
|
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
|
|
data1: TDataSource;
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
RxDBLookupCombo14: TRxDBLookupCombo;
|
|
|
|
|
Label42: TLabel;
|
|
|
|
|
RxDBLookupCombo30: TRxDBLookupCombo;
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
RxDBLookupCombo13: TRxDBLookupCombo;
|
|
|
|
|
data2: TDataSource;
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
RxDBLookupCombo12: TRxDBLookupCombo;
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
RxDBLookupCombo29: TRxDBLookupCombo;
|
|
|
|
|
data3: TDataSource;
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
procedure RxDBLookupCombo14Change(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
procedure RxDBLookupCombo29Change(Sender: TObject);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_op_seai_order_add: Tfrm_op_seai_order_add;
|
|
|
|
|
frm_op_seae_add_num:integer;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses u_main, my_sys_function, u_data_share;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seai_order_add.bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seai_order_add.FormShow(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
wwDBDateTimePicker1.Date:=date;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seai_order_add.bsSkinButton3Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
i: Integer;
|
|
|
|
|
bsno,ywno:String;
|
|
|
|
|
aQuery:TAdoQuery;
|
|
|
|
|
begin
|
|
|
|
|
if (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='')
|
|
|
|
|
or (RxDBLookupCombo14.DisplayValue='') or (RxDBLookupCombo14.DisplayValue='') then begin
|
|
|
|
|
MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', mtConfirmation, [mbYes],0);
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if not data1.DataSet.Active then data1.DataSet.Open;
|
|
|
|
|
if not data3.DataSet.Active then data3.DataSet.Open;
|
|
|
|
|
bsno:=get_id;
|
|
|
|
|
data1.DataSet.Insert;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=bsno;
|
|
|
|
|
|
|
|
|
|
if Data2.DataSet['<27>Ƿ<EFBFBD>ƴ<EFBFBD><C6B4>']=1 then
|
|
|
|
|
data1.DataSet['װ<>˷<EFBFBD>ʽ']:='ƴ<>䵥Ʊ'
|
|
|
|
|
else
|
|
|
|
|
data1.DataSet['װ<>˷<EFBFBD>ʽ']:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>']:=wwDBDateTimePicker1.date;
|
|
|
|
|
data1.DataSet['<27>ܴ<EFBFBD>']:=WeekofYear(wwDBDateTimePicker1.date);
|
|
|
|
|
data1.DataSet['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
|
|
data1.DataSet['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>Ա']:=RxDBLookupCombo14.DisplayValue;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo29.DisplayValue;
|
|
|
|
|
|
|
|
|
|
data1.DataSet['<27>ͷ<EFBFBD>Ա']:=RxDBLookupCombo13.DisplayValue;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>']:=RxDBLookupCombo12.DisplayValue;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo30.DisplayValue;
|
|
|
|
|
data1.DataSet['ί<>е<EFBFBD>λ']:=data2.DataSet['ί<>е<EFBFBD>λ'];
|
|
|
|
|
data1.DataSet['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><>ͨ<EFBFBD><CDA8>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ywno:=get_no(data1.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').AsDateTime,getbsno(Logininfo.SeaImpBsNo,'SI'));
|
|
|
|
|
data1.DataSet['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=ywno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>']:=bsno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>']:=bsno;
|
|
|
|
|
data1.DataSet['ί<>б<EFBFBD>']:=bsno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD>ر<EFBFBD>']:=bsno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsno;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=bsno;
|
|
|
|
|
data1.DataSet['<27>Ʒѱ<C6B7>']:='';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data1.DataSet['<27>Ʒѱ<C6B7>']:='';
|
|
|
|
|
|
|
|
|
|
data1.DataSet['ҵ<><D2B5>״̬']:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>']:=data2.DataSet['<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>'];
|
|
|
|
|
data1.DataSet['֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>']:=data2.DataSet['֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['װ<><D7B0><EFBFBD><EFBFBD>']:=data2.DataSet['װ<><D7B0><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['ж<><D0B6><EFBFBD><EFBFBD>']:=data2.DataSet['ж<><D0B6><EFBFBD><EFBFBD>'];
|
|
|
|
|
|
|
|
|
|
data1.DataSet['<27><>ͷ']:=data2.DataSet['<27><>ͷ'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><>װ']:=data2.DataSet['<27><>װ'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=data2.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']
|
|
|
|
|
:='SAY:'+ntoc(data1.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asfloat,true)
|
|
|
|
|
+data1.DataSet.FieldByName('<27><>װ').asstring+' ONLY.';
|
|
|
|
|
data1.DataSet['<27><>ע']:=data2.DataSet['<27><>ע'];
|
|
|
|
|
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
|
|
data1.DataSet['<27><><EFBFBD><EFBFBD>ƾ֤']:='';
|
|
|
|
|
|
|
|
|
|
data1.DataSet['ҵ<><D2B5><EFBFBD><EFBFBD>Դ']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
data1.DataSet['<27><>Դ<EFBFBD><D4B4>ϸ']:='';
|
|
|
|
|
data1.DataSet.Post;
|
|
|
|
|
if (Data2.DataSet['<27><><EFBFBD><EFBFBD>1']<>'') and (Data2.DataSet['<27><><EFBFBD><EFBFBD>1']<>0) then begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
sql.Add('select * from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+Data2.DataSet['<27><><EFBFBD><EFBFBD>1']+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if recordcount<>0 then begin
|
|
|
|
|
Data3.DataSet.Insert;
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>1'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>1'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
|
|
if aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
if (aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
|
|
(aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
Data3.DataSet.post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (Data2.DataSet['<27><><EFBFBD><EFBFBD>2']<>'') and (Data2.DataSet['<27><><EFBFBD><EFBFBD>2']<>0) then begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
sql.Add('select * from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+Data2.DataSet['<27><><EFBFBD><EFBFBD>2']+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if recordcount<>0 then begin
|
|
|
|
|
Data3.DataSet.Insert;
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>2'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>2'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
|
|
if aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
if (aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
|
|
(aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
Data3.DataSet.post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if (Data2.DataSet['<27><><EFBFBD><EFBFBD>3']<>'') and (Data2.DataSet['<27><><EFBFBD><EFBFBD>3']<>0) then begin
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
sql.Add('select * from t_code_ctn where <20><><EFBFBD><EFBFBD>='''+Data2.DataSet['<27><><EFBFBD><EFBFBD>3']+'''');
|
|
|
|
|
Open;
|
|
|
|
|
if recordcount<>0 then begin
|
|
|
|
|
Data3.DataSet.Insert;
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>3'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD>']:=Data2.DataSet['<27><><EFBFBD><EFBFBD>3'];
|
|
|
|
|
Data3.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=aQuery['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ'];
|
|
|
|
|
if aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
|
|
Data3.DataSet['TEU']:=1*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
if (aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
|
|
(aQuery.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
|
|
Data3.DataSet['TEU']:=2*Data3.DataSet.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
Data3.DataSet.post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
freeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
Data2.DataSet.Edit;
|
|
|
|
|
Data2.DataSet['<27><><EFBFBD><EFBFBD>״̬']:=1;
|
|
|
|
|
Data2.DataSet['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=ywno;
|
|
|
|
|
Data2.DataSet.Post;
|
|
|
|
|
close;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seai_order_add.RxDBLookupCombo14Change(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo14.DisplayValue='' then
|
|
|
|
|
exit;
|
|
|
|
|
if frm_data_share.t_sys_employee.locate('<27><><EFBFBD><EFBFBD>',RxDBLookupCombo14.DisplayValue,[]) then
|
|
|
|
|
RxDBLookupCombo30.DisplayValue:=frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seai_order_add.RxDBLookupCombo29Change(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if RxDBLookupCombo29.DisplayValue='' then
|
|
|
|
|
exit;
|
|
|
|
|
if frm_data_share.t_sys_employee.locate('<27><><EFBFBD><EFBFBD>',RxDBLookupCombo29.DisplayValue,[]) then
|
|
|
|
|
RxDBLookupCombo12.DisplayValue:=frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|