|
|
unit u_op_seae_order_edit;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, ExtCtrls, DB, ADODB, dxExEdtr, dxCntner, dxTL,
|
|
|
dxDBCtrl, dxDBGrid, ComCtrls, bsSkinTabs, RxLookup, StdCtrls, Mask,
|
|
|
DBCtrls, wwdbdatetimepicker, wwdblook, u_op_sate, u_fee, u_op_card, Menus,
|
|
|
dxDBTLCl, dxGrClms, bsdbctrls, XPMenu, wwdbedit, Wwdotdot, Wwdbcomb,
|
|
|
Grids, Wwdbigrd, Wwdbgrid, DBGrids;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_seae_order_edit = class(TForm)
|
|
|
Panel2: TPanel;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton38: TbsSkinButton;
|
|
|
t_op_seae: TADOQuery;
|
|
|
t_op_seae1: TDataSource;
|
|
|
XPMenu1: TXPMenu;
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N15: TMenuItem;
|
|
|
N16: TMenuItem;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
t_op_ctn1: TDataSource;
|
|
|
t_op_ctn: TADOQuery;
|
|
|
t_op_seae_insert: TADOQuery;
|
|
|
t_op_seae_insert1: TDataSource;
|
|
|
t_op_ctn_insert: TADOQuery;
|
|
|
Notebook1: TNotebook;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
Label10: TLabel;
|
|
|
bsSkinPanel3: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
Label6: TLabel;
|
|
|
Label7: TLabel;
|
|
|
Label8: TLabel;
|
|
|
Label9: TLabel;
|
|
|
Label22: TLabel;
|
|
|
Label23: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBEdit6: TDBEdit;
|
|
|
DBEdit7: TDBEdit;
|
|
|
DBEdit8: TDBEdit;
|
|
|
DBMemo3: TDBMemo;
|
|
|
DBEdit15: TDBEdit;
|
|
|
wwDBComboBox15: TwwDBComboBox;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label11: TLabel;
|
|
|
Label12: TLabel;
|
|
|
Label13: TLabel;
|
|
|
Label14: TLabel;
|
|
|
Label15: TLabel;
|
|
|
Label16: TLabel;
|
|
|
Label17: TLabel;
|
|
|
Label18: TLabel;
|
|
|
Label19: TLabel;
|
|
|
Label20: TLabel;
|
|
|
Label25: TLabel;
|
|
|
Label26: TLabel;
|
|
|
Label27: TLabel;
|
|
|
Label28: TLabel;
|
|
|
Label29: TLabel;
|
|
|
Label30: TLabel;
|
|
|
Label31: TLabel;
|
|
|
Label32: TLabel;
|
|
|
Label33: TLabel;
|
|
|
Label34: TLabel;
|
|
|
Label35: TLabel;
|
|
|
Label36: TLabel;
|
|
|
Label38: TLabel;
|
|
|
Label39: TLabel;
|
|
|
Label40: TLabel;
|
|
|
Label44: TLabel;
|
|
|
DBMemo1: TDBMemo;
|
|
|
DBMemo4: TDBMemo;
|
|
|
DBMemo5: TDBMemo;
|
|
|
DBMemo38: TDBMemo;
|
|
|
DBMemo2: TDBMemo;
|
|
|
DBEdit9: TDBEdit;
|
|
|
DBEdit10: TDBEdit;
|
|
|
DBEdit11: TDBEdit;
|
|
|
DBEdit12: TDBEdit;
|
|
|
DBEdit13: TDBEdit;
|
|
|
DBEdit16: TDBEdit;
|
|
|
DBEdit18: TDBEdit;
|
|
|
DBEdit19: TDBEdit;
|
|
|
DBEdit20: TDBEdit;
|
|
|
DBEdit21: TDBEdit;
|
|
|
DBEdit22: TDBEdit;
|
|
|
DBEdit23: TDBEdit;
|
|
|
DBEdit24: TDBEdit;
|
|
|
DBEdit25: TDBEdit;
|
|
|
DBEdit26: TDBEdit;
|
|
|
DBEdit27: TDBEdit;
|
|
|
DBEdit28: TDBEdit;
|
|
|
DBEdit30: TDBEdit;
|
|
|
DBEdit31: TDBEdit;
|
|
|
DBEdit32: TDBEdit;
|
|
|
DBEdit36: TDBEdit;
|
|
|
DBGrid1: TDBGrid;
|
|
|
Label2: TLabel;
|
|
|
DBEdit2: TDBEdit;
|
|
|
Label3: TLabel;
|
|
|
DBEdit3: TDBEdit;
|
|
|
Label4: TLabel;
|
|
|
DBEdit4: TDBEdit;
|
|
|
Label5: TLabel;
|
|
|
DBEdit5: TDBEdit;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure Panel2Resize(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinButton38Click(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure Notebook1PageChanged(Sender: TObject);
|
|
|
procedure RxDBLookupCombo5Enter(Sender: TObject);
|
|
|
procedure RxDBLookupCombo5Exit(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
m_bsno:string;
|
|
|
procedure setconcolor; //<2F><><EFBFBD>ÿؼ<C3BF><D8BC><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
function getkingpkgs(kindpkgscode:string):string;
|
|
|
function GetDeptname(Port:String): String;
|
|
|
|
|
|
|
|
|
public
|
|
|
m_qryTask:TADOQuery;
|
|
|
{ Public declarations }
|
|
|
public procedure InitialData( qryTask:TADOQuery; bsno1:string);
|
|
|
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_seae_order_edit: Tfrm_op_seae_order_edit;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main,u_data_share, my_sys_function, u_sys_progress,
|
|
|
u_op_seae_apply_add, u_op_add_code, u_op_date_change, u_op_ctn,
|
|
|
u_op_seae_web_add, u_op_seae_selectbsno;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.setconcolor;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
{
|
|
|
frm_op_seae_web_order.Hide;
|
|
|
frm_op_seae_web_order.ManualFloat(frm_op_seae_web_order.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_seae_web_order');
|
|
|
action:=cafree;
|
|
|
frm_op_seae_web_order:=nil;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.Panel2Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(Panel2.Width/12);
|
|
|
bsSkinButton8.Width:=i;
|
|
|
bsSkinButton2.Width:=i;
|
|
|
bsSkinButton38.Width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
table_Prior(t_op_seae);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
table_next(t_op_seae);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3>ڱ<EFBFBD><DAB1>ر<EFBFBD><D8B1><EFBFBD>',2,t_op_seae1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton38Click(Sender: TObject);
|
|
|
var
|
|
|
book1:Tbookmark;
|
|
|
begin
|
|
|
book1:=t_op_seae.GetBookmark;
|
|
|
t_op_seae.Refresh;
|
|
|
t_op_seae.GotoBookmark(book1);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
|
|
|
t_op_seae.Close;
|
|
|
t_op_seae.SQL.clear;
|
|
|
t_op_seae.SQL.Add('select * from op_seaeorder where BSNO='''+ m_bsno + '''');
|
|
|
t_op_seae.open;
|
|
|
t_op_ctn.OPEN;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.Notebook1PageChanged(Sender: TObject);
|
|
|
begin
|
|
|
setconcolor;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.RxDBLookupCombo5Enter(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>;<3B><><EFBFBD><EFBFBD>' ;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.RxDBLookupCombo5Exit(Sender: TObject);
|
|
|
begin
|
|
|
TRxDBLookupCombo(Sender).LookupDisplay:='<27><><EFBFBD><EFBFBD>';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
i: Integer;
|
|
|
bsno,ywno,sql:String;
|
|
|
aQuery:TAdoQuery;
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frm_main.db.BeginTrans;
|
|
|
|
|
|
|
|
|
try
|
|
|
if not t_op_seae_insert.Active then t_op_seae_insert.Open; //<2F><><EFBFBD><EFBFBD>
|
|
|
if not t_op_ctn_insert.Active then t_op_ctn_insert.Open; //
|
|
|
|
|
|
t_op_seae_insert.Insert;
|
|
|
bsno:=get_id;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('װ<>˷<EFBFBD>ʽ').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').Value:=Date;
|
|
|
t_op_seae_insert.FieldByName('<27>ܴ<EFBFBD>').AsInteger:=WeekofYear(Date);
|
|
|
t_op_seae_insert.FieldByName('¼<><C2BC><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=date;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('ί<>е<EFBFBD>λ').AsString:=t_op_seae.FieldByName('CUSTOMERNAME').AsString;
|
|
|
if frm_data_share.t_crm_client.Locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',t_op_seae.FieldByName('CUSTOMERNAME').AsString,[]) then begin
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=GetDeptname(t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD>Դ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=getzqlx(t_op_seae.FieldByName('CUSTOMERNAME').AsString);
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>һ').AsString:=frm_data_share.t_crm_client.FieldByName('<27><>ע').AsString;
|
|
|
end;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>ͷ<EFBFBD>Ա').AsString:=employee;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=department;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʶ').AsString:=t_op_seae.FieldByName('CARGOID').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>˾').AsString:=t_op_seae.FieldByName('CARRIER').AsString;
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
With aQuery do begin
|
|
|
close;sql.Clear;
|
|
|
sql.Add('select Ĭ<>ϳ<EFBFBD>վ,Ĭ<>ϳ<EFBFBD>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+t_op_seae.FieldByName('CARRIER').AsString+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then begin
|
|
|
t_op_seae_insert.FieldByName('<27><>վ').AsString:=aQuery.fieldbyname('Ĭ<>ϳ<EFBFBD>վ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').AsString:=aQuery.fieldbyname('Ĭ<>ϳ<EFBFBD>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>').AsString;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
|
|
|
ywno:=get_no(Date,getbsno(Logininfo.SeaExpBsNo,'SE'));
|
|
|
if (t_op_seae.FieldByName('CUSTOMERNAME').AsString='<27><><EFBFBD><EFBFBD>') then
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=10;
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=ywno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('ί<>б<EFBFBD><D0B1><EFBFBD>').AsString:=t_op_seae.FieldByName('CUSTNO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ᵥ<EFBFBD><E1B5A5>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('ί<>б<EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ر<EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=bsno;
|
|
|
t_op_seae_insert.FieldByName('<27>Ʒѱ<C6B7>').AsString:='';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5>״̬').AsString:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ǰ״̬').AsString:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='¼<><C2BC>״̬';
|
|
|
t_op_seae_insert.FieldByName('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:='<27><>ͨ<EFBFBD><CDA8>';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOAD').AsString;
|
|
|
t_op_seae_insert.FieldByName('װ<>۴<EFBFBD><DBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTLOADID').AsString; //////??????
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>ᵥ<EFBFBD><E1B5A5><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('NOBILL').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SERVICE').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>ͷ').AsString:=t_op_seae.FieldByName('MARKS').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DESCRIPTION').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('SHIPPER').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27>ջ<EFBFBD><D5BB>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('CONSIGNEE').AsString;
|
|
|
t_op_seae_insert.FieldByName('֪ͨ<CDA8>˴<EFBFBD><CBB4><EFBFBD>').AsString:=t_op_seae.FieldByName('NOTIFYPARTY').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('BLFRT').AsString;
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD>ص<EFBFBD>').AsString:='QINGDAO,CHINA';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('KGS').AsString+'KGS';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('CBM').AsString+'CBM';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger:=t_op_seae.FieldByName('PKGS').AsInteger;
|
|
|
// t_op_seae_insert.FieldByName('<27><>װ').AsString:=getkingpkgs(t_op_seae.FieldByName('KINDPKGS').AsString);
|
|
|
t_op_seae_insert.FieldByName('<27><>װ').AsString:=t_op_seae.FieldByName('KINDPKGS').AsString;
|
|
|
if (t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsInteger>1) then t_op_seae_insert.FieldByName('<27><>װ').AsString:=t_op_seae_insert.FieldByName('<27><>װ').AsString+'S';
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ').AsString:=t_op_seae.FieldByName('PKGS').AsString+t_op_seae_insert.FieldByName('<27><>װ').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_seae.FieldByName('KGS').AsFloat;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsFloat:=t_op_seae.FieldByName('CBM').AsFloat;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д').AsString:='SAY:'+ntoc(t_op_seae.FieldByName('PKGS').asfloat,true)
|
|
|
+t_op_seae.FieldByName('KINDPKGS').asstring+' ONLY.';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DCLASS').AsString;
|
|
|
t_op_seae_insert.FieldByName('Σ<><CEA3>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('DUNNO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>').AsString:=t_op_seae.FieldByName('TEMPSET').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('REEFERF').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27>˷<EFBFBD>Э<EFBFBD><D0AD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('SERVICECONTRACTNO').AsString;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VESSEL').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('VOYNO').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=t_op_seae.FieldByName('ETD').Value;
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGEID').AsString;
|
|
|
if (frm_data_share.t_code_disport.Locate('EDI<44><49><EFBFBD><EFBFBD>',t_op_seae.FieldByName('PORTDISCHARGEID').AsString,[])) then
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=frm_data_share.t_code_disport.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').AsString
|
|
|
else
|
|
|
t_op_seae_insert.FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').AsString:=t_op_seae.FieldByName('PORTDISCHARGE').AsString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Ŀ<>ĵش<C4B5><D8B4><EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATIONID').AsString;
|
|
|
if (frm_data_share.t_code_disport.Locate('EDI<44><49><EFBFBD><EFBFBD>',t_op_seae.FieldByName('DESTINATIONID').AsString,[])) then
|
|
|
t_op_seae_insert.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString:=frm_data_share.t_code_disport.fieldbyname('Ӣ<><D3A2><EFBFBD><EFBFBD>').AsString
|
|
|
else t_op_seae_insert.FieldByName('Ŀ<>ĵ<EFBFBD>').AsString:=t_op_seae.FieldByName('DESTINATION').AsString;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><>װ<EFBFBD><D7B0>').AsString:=t_op_seae.FieldByName('CNTRTOTAL').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>˵<EFBFBD><CBB5>').AsString:=t_op_seae.FieldByName('REMARK').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><>ע').AsString:='<27>ͻ<EFBFBD><CDBB><EFBFBD>ϵ<EFBFBD><CFB5>:'+t_op_seae.FieldByName('CUSTATTN').AsString+' '+t_op_seae.FieldByName('CUSTTEL').AsString;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('<27><>˰<EFBFBD><CBB0><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>ĵ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>˰').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD>ͨ<EFBFBD><CDA8>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD>ǩ<EFBFBD><C7A9>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=null;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:='';
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6>½<EFBFBD><C2BD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6>½<EFBFBD><C2BD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('½<><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ƾ֤').Value:='';
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>۶<EFBFBD><DBB6><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>Ƿ<EFBFBD><C7B7>˲<EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert['VGM']:=1;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ط<EFBFBD><D8B7><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>').Value:=0;
|
|
|
t_op_seae_insert.FieldByName('BC״̬').Value:='N';
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>ƾ֤').Value:='';
|
|
|
|
|
|
t_op_seae_insert.FieldByName('ǩ<><C7A9><EFBFBD><EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('ISSUETYPE').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD>ѷ<EFBFBD>ʽ').AsString:=t_op_seae.FieldByName('BLFRT').AsString;
|
|
|
t_op_seae_insert.FieldByName('Ԥ<><D4A4><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>').AsString:=t_op_seae.FieldByName('PAYABLEAT').AsString;
|
|
|
// t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE>ϵ<EFBFBD><CFB5>').AsString:=t_op_seae.FieldByName('CUSTATTN').AsString;
|
|
|
|
|
|
|
|
|
t_op_seae_insert.FieldByName('Ӧ<>պ<EFBFBD><D5BA>˷<EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('<27><><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.FieldByName('<27>ݷ<EFBFBD><DDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsFloat:=0;
|
|
|
t_op_seae_insert.Post;
|
|
|
|
|
|
|
|
|
|
|
|
if (not t_op_ctn.IsEmpty) then
|
|
|
begin
|
|
|
try
|
|
|
t_op_ctn_insert.Close;
|
|
|
t_op_ctn_insert.Open;
|
|
|
with t_op_ctn do begin
|
|
|
First;
|
|
|
while not Eof do
|
|
|
begin
|
|
|
t_op_ctn_insert.Insert;
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CTNNUM'];
|
|
|
if frm_data_share.t_code_ctn.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ',t_op_ctn['CTNALL'],[]) then
|
|
|
begin
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:=t_op_ctn['CTNALL'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=frm_data_share.t_code_ctn['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn_insert['<27>ߴ<EFBFBD>']:=frm_data_share.t_code_ctn['<27>ߴ<EFBFBD>'];
|
|
|
if frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='20'then
|
|
|
t_op_ctn_insert['TEU']:=1*t_op_ctn_insert.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
|
|
|
if (frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='40')OR
|
|
|
(frm_data_share.t_code_ctn.FieldByName('<27>ߴ<EFBFBD>').asstring='45')then
|
|
|
t_op_ctn_insert['TEU']:=2*t_op_ctn_insert.FieldByName('<27><><EFBFBD><EFBFBD>').asinteger;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ']:='';
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:='';
|
|
|
t_op_ctn_insert['<27>ߴ<EFBFBD>']:='';
|
|
|
t_op_ctn_insert['TEU']:=0;
|
|
|
end;
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['PKGS'];
|
|
|
t_op_ctn_insert['<27><>װ']:=t_op_ctn['KINDPKGS'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['KGS'];
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=t_op_ctn['CBM'];
|
|
|
// t_op_ctn_insert['Ʒ<><C6B7>']:=t_op_ctn['GOODSNAME'];
|
|
|
|
|
|
|
|
|
|
|
|
t_op_ctn_insert['<27><><EFBFBD><EFBFBD>']:=bsno;
|
|
|
t_op_ctn_insert.post;
|
|
|
Next;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
end;
|
|
|
end;
|
|
|
update_ctn(t_op_ctn_insert);
|
|
|
|
|
|
|
|
|
t_op_seae.Edit;
|
|
|
t_op_seae.fieldbyname('ORSTATUS').AsString:='0';
|
|
|
t_op_seae.fieldbyname('BSCUSTNO').AsString:=bsno;
|
|
|
t_op_seae.Post;
|
|
|
|
|
|
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27>ѽ<EFBFBD><D1BD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27>ѽ<EFBFBD><D1BD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
finally
|
|
|
if frm_main.db.InTransaction then
|
|
|
begin
|
|
|
frm_main.db.RollbackTrans;
|
|
|
end;
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton1Click(Sender: TObject);
|
|
|
var
|
|
|
sql:string;
|
|
|
begin
|
|
|
if( Application.MessageBox(PChar('<27><>ȷʵҪֱ<D2AA>ӽ<EFBFBD><D3BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'+#13#10+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӹر<D3B9><D8B1><EFBFBD><EFBFBD><EFBFBD>!,<2C>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?'),'<27><>Ϣ<EFBFBD><CFA2>ʾ',MB_YESNO+ MB_ICONQUESTION)<>IDYES) then
|
|
|
Exit;
|
|
|
try
|
|
|
//** m_qryTask.Connection.BeginTrans;
|
|
|
m_qryTask.Edit;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>').AsDateTime:=Now;
|
|
|
m_qryTask.FieldByName('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>').AsInteger:=1;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString:='<27><><EFBFBD><EFBFBD>';
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString:=employee;
|
|
|
m_qryTask.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա').AsString:=employee;
|
|
|
|
|
|
m_qryTask.Post;
|
|
|
//
|
|
|
sql:='INSERT INTO t_op_task_state ( [<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>],[<5B><><EFBFBD><EFBFBD>״̬],[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>])VALUES (''%s'' ,''%s'' ,''%s'')';
|
|
|
sql:=Format(sql,[m_qryTask.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'<27><><EFBFBD><EFBFBD>',employee] );
|
|
|
m_qryTask.Connection.Execute(sql);
|
|
|
//** m_qryTask.Connection.CommitTrans;
|
|
|
|
|
|
m_qryTask.Requery();
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
close();
|
|
|
except
|
|
|
on e:Exception do
|
|
|
begin
|
|
|
// on except
|
|
|
//* m_qryTask.Connection.RollbackTrans;
|
|
|
m_qryTask.Cancel();
|
|
|
|
|
|
Application.MessageBox(PChar('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: '+E.Message),'<27><>Ϣ<EFBFBD><CFA2>ʾ');
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.InitialData(qryTask: TADOQuery;
|
|
|
bsno1: string);
|
|
|
begin
|
|
|
m_qryTask:=qryTask;
|
|
|
m_bsno:=bsno1;
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_order_edit.getkingpkgs(kindpkgscode: string): string;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD> from t_code_package where EDI<44><49><EFBFBD><EFBFBD>='''+kindpkgscode+'''');
|
|
|
Open;
|
|
|
if IsEmpty then
|
|
|
Result:='a'
|
|
|
else
|
|
|
Result:=FieldByName('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>').AsString;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
function Tfrm_op_seae_order_edit.GetDeptname(Port: String): String;
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
SQL.Add('Select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD>='''+Port+'''');
|
|
|
Open;
|
|
|
if not IsEmpty then
|
|
|
Result:=Trim(FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring)
|
|
|
else
|
|
|
Result:='';
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_seae_order_edit.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_op_seae_selectbsno:=tfrm_op_seae_selectbsno.Create (self);
|
|
|
frm_op_seae_selectbsno.ShowModal;
|
|
|
finally
|
|
|
frm_op_seae_selectbsno.Free;
|
|
|
frm_op_seae_selectbsno:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
end.
|