unit u_op_seae_web_si; 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; type Tfrm_op_seae_web_si = class(TForm) Panel2: TPanel; bsSkinButton7: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton5: TbsSkinButton; bsSkinButton38: TbsSkinButton; Notebook1: TNotebook; t_op_seae: TADOQuery; t_op_seae1: TDataSource; bsSkinPanel1: TbsSkinPanel; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinPanel2: TbsSkinPanel; Label47: TLabel; Label49: TLabel; wwDBDateTimePicker9: TwwDBDateTimePicker; Edit3: TEdit; wwDBDateTimePicker12: TwwDBDateTimePicker; Label52: TLabel; Label54: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; bsSkinButton8: TbsSkinButton; bsSkinButton12: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton1: TbsSkinButton; Label45: TLabel; wwDBComboBox8: TwwDBComboBox; wwDBDateTimePicker11: TwwDBDateTimePicker; Label48: TLabel; wwDBDateTimePicker13: TwwDBDateTimePicker; Label50: TLabel; Panel1: TPanel; dxDBGrid1: TdxDBGrid; dxDBGrid1Column29: TdxDBGridColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridColumn; dxDBGrid1Column20: TdxDBGridColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridDateColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column23: TdxDBGridColumn; dxDBGrid1Column26: TdxDBGridColumn; dxDBGrid1Column25: TdxDBGridMemoColumn; bsSkinPanel3: TbsSkinPanel; Label1: TLabel; DBEdit1: TDBEdit; Label2: TLabel; DBEdit2: TDBEdit; Label4: TLabel; DBEdit4: TDBEdit; Label3: TLabel; DBEdit3: TDBEdit; Label5: TLabel; DBEdit5: TDBEdit; Label6: TLabel; DBEdit6: TDBEdit; Label7: TLabel; DBEdit7: TDBEdit; DBEdit8: TDBEdit; Label8: TLabel; DBMemo3: TDBMemo; Label9: TLabel; Label10: TLabel; bsSkinPanel4: TbsSkinPanel; DBMemo1: TDBMemo; DBMemo4: TDBMemo; DBMemo5: TDBMemo; Label11: TLabel; Label12: TLabel; Label13: TLabel; DBMemo38: TDBMemo; Label14: TLabel; Label15: TLabel; DBMemo2: TDBMemo; DBEdit9: TDBEdit; Label16: TLabel; DBEdit10: TDBEdit; Label17: TLabel; Label18: TLabel; DBEdit11: TDBEdit; Label19: TLabel; DBEdit12: TDBEdit; Label21: TLabel; DBEdit14: TDBEdit; Label22: TLabel; DBEdit15: TDBEdit; Label23: TLabel; Label24: TLabel; DBEdit17: TDBEdit; wwDBComboBox15: TwwDBComboBox; Label20: TLabel; DBEdit13: TDBEdit; Label25: TLabel; DBEdit16: TDBEdit; Label26: TLabel; DBEdit18: TDBEdit; Label27: TLabel; DBEdit19: TDBEdit; Label28: TLabel; DBEdit20: TDBEdit; Label29: TLabel; DBEdit21: TDBEdit; Label30: TLabel; DBEdit22: TDBEdit; Label31: TLabel; DBEdit23: TDBEdit; t_op_ctn1: TDataSource; Label32: TLabel; DBEdit24: TDBEdit; DBEdit25: TDBEdit; Label33: TLabel; Label34: TLabel; DBEdit26: TDBEdit; DBEdit27: TDBEdit; Label35: TLabel; Label36: TLabel; DBEdit28: TDBEdit; Label38: TLabel; DBEdit30: TDBEdit; Label39: TLabel; DBEdit31: TDBEdit; DBEdit32: TDBEdit; Label40: TLabel; Label41: TLabel; DBEdit33: TDBEdit; Label44: TLabel; DBEdit36: TDBEdit; t_op_seae_insert: TADOQuery; t_op_seae_insert1: TDataSource; t_op_ctn_insert: TADOQuery; dxDBGrid1Column18: TdxDBGridColumn; wwDBGrid1: TwwDBGrid; dxDBGrid1Column21: TdxDBGridColumn; t_op_ctn: TADOQuery; t_op_seae_assistant: TADOQuery; DBEdit29: TDBEdit; t_op_seae_order: TADOQuery; Label37: TLabel; DBEdit34: TDBEdit; Label42: TLabel; DBEdit35: TDBEdit; Label43: TLabel; DBEdit37: TDBEdit; DBEdit38: TDBEdit; Label46: TLabel; Label51: TLabel; DBEdit39: TDBEdit; 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 bsSkinButton11Click(Sender: TObject); procedure bsSkinButton38Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure Notebook1PageChanged(Sender: TObject); procedure RxDBLookupCombo5Enter(Sender: TObject); procedure RxDBLookupCombo5Exit(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure dxDBGrid1DblClick(Sender: TObject); procedure DBEdit29Change(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); private { Private declarations } procedure setconcolor; //设置控件的颜色 public { Public declarations } end; var frm_op_seae_web_si: Tfrm_op_seae_web_si; implementation uses u_main,u_data_share, my_sys_function, u_sys_progress, u_op_add_code, u_op_date_change, u_op_ctn, u_op_seae_web_add; {$R *.dfm} procedure Tfrm_op_seae_web_si.setconcolor; begin if t_op_seae.IsEmpty then Exit; t_op_seae_order.Close; t_op_seae_order.SQL.Text:='select * from t_op_seae where 业务编号='''+t_op_seae.fieldbyname('BSNO').AsString+''''; t_op_seae_order.Open; if t_op_seae_order.IsEmpty then begin // MessageDlg('无法定位订舱,不能生产截单!', mtConfirmation, [mbYes],0); exit; end; t_op_seae_assistant.Close; t_op_seae_assistant.SQL.Text:='select * from t_op_seae_assistant where 业务编号='''+t_op_seae.fieldbyname('BSNO').AsString+''''; t_op_seae_assistant.Open; if not t_op_seae_assistant.IsEmpty then begin if AnsiCompareStr(t_op_seae.Fieldbyname('VESSEL').asstring , t_op_seae_assistant.fieldbyname('船名').asstring)<>0 then DBEdit13.Font.Color:=clred else DBEdit13.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('VOYNO').asstring , t_op_seae_assistant.fieldbyname('航次').asstring)<>0 then DBEdit16.Font.Color:=clred else DBEdit16.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PORTLOAD').asstring , t_op_seae_assistant.fieldbyname('装货港').asstring)<>0 then DBEdit10.Font.Color:=clred else DBEdit10.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PORTDISCHARGE').asstring , t_op_seae_assistant.fieldbyname('卸货港').asstring)<>0 then DBEdit11.Font.Color:=clred else DBEdit11.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PLACEDELIVERY').asstring , t_op_seae_assistant.fieldbyname('交货地点').asstring)<>0 then DBEdit34.Font.Color:=clred else DBEdit34.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('DESTINATION').asstring , t_op_seae_assistant.fieldbyname('目的地').asstring)<>0 then DBEdit18.Font.Color:=clred else DBEdit18.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('BLFRT').asstring , t_op_seae_assistant.fieldbyname('付费方式').asstring)<>0 then DBEdit20.Font.Color:=clred else DBEdit20.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PREPARDAT').asstring , t_op_seae_assistant.fieldbyname('预付地点').asstring)<>0 then DBEdit21.Font.Color:=clred else DBEdit21.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PAYABLEAT').asstring , t_op_seae_assistant.fieldbyname('到付地点').asstring)<>0 then DBEdit38.Font.Color:=clred else DBEdit38.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('ISSUETYPE').asstring , t_op_seae_assistant.fieldbyname('签单方式').asstring)<>0 then DBEdit22.Font.Color:=clred else DBEdit22.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('NOBILL').asstring , t_op_seae_assistant.fieldbyname('提单份数').asstring)<>0 then DBEdit39.Font.Color:=clred else DBEdit39.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('SERVICE').asstring , t_op_seae_assistant.fieldbyname('运输条款').asstring)<>0 then DBEdit39.Font.Color:=clred else DBEdit39.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PKGS').asstring , t_op_seae_assistant.fieldbyname('件数').asstring)<>0 then DBEdit24.Font.Color:=clred else DBEdit24.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('KINDPKGS').asstring , t_op_seae_assistant.fieldbyname('包装').asstring)<>0 then DBEdit25.Font.Color:=clred else DBEdit25.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('KGS').asstring , t_op_seae_assistant.fieldbyname('重量').asstring)<>0 then DBEdit26.Font.Color:=clred else DBEdit26.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('CBM').asstring , t_op_seae_assistant.fieldbyname('尺码').asstring)<>0 then DBEdit27.Font.Color:=clred else DBEdit27.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('TOTALNO').asstring , t_op_seae_assistant.fieldbyname('件数大写').asstring)<>0 then DBEdit37.Font.Color:=clred else DBEdit37.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('SHIPPER').asstring , t_op_seae_assistant.fieldbyname('发货人代码').asstring)<>0 then DBMemo1.Font.Color:=clred else DBMemo1.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('NOTIFYPARTY').asstring , t_op_seae_assistant.fieldbyname('通知人代码').asstring)<>0 then DBMemo5.Font.Color:=clred else DBMemo5.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('CONSIGNEE').asstring , t_op_seae_assistant.fieldbyname('收货人代码').asstring)<>0 then DBMemo4.Font.Color:=clred else DBMemo4.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('MARKS').asstring , t_op_seae_assistant.fieldbyname('唛头').asstring)<>0 then DBMemo38.Font.Color:=clred else DBMemo38.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('DESCRIPTION').asstring , t_op_seae_assistant.fieldbyname('货物描述').asstring)<>0 then DBMemo2.Font.Color:=clred else DBMemo2.Font.Color:=clblack ; end else begin if AnsiCompareStr(t_op_seae.Fieldbyname('VESSEL').asstring , t_op_seae_order.fieldbyname('船名').asstring)<>0 then DBEdit13.Font.Color:=clred else DBEdit13.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('VOYNO').asstring , t_op_seae_order.fieldbyname('航次').asstring)<>0 then DBEdit16.Font.Color:=clred else DBEdit16.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PORTLOAD').asstring , t_op_seae_order.fieldbyname('装货港').asstring)<>0 then DBEdit10.Font.Color:=clred else DBEdit10.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PORTDISCHARGE').asstring , t_op_seae_order.fieldbyname('卸货港').asstring)<>0 then DBEdit11.Font.Color:=clred else DBEdit11.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PLACEDELIVERY').asstring , t_op_seae_order.fieldbyname('交货地点').asstring)<>0 then DBEdit34.Font.Color:=clred else DBEdit34.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('DESTINATION').asstring , t_op_seae_order.fieldbyname('目的地').asstring)<>0 then DBEdit18.Font.Color:=clred else DBEdit18.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('BLFRT').asstring , t_op_seae_order.fieldbyname('付费方式').asstring)<>0 then DBEdit20.Font.Color:=clred else DBEdit20.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PREPARDAT').asstring , t_op_seae_order.fieldbyname('预付地点').asstring)<>0 then DBEdit21.Font.Color:=clred else DBEdit21.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PAYABLEAT').asstring , t_op_seae_order.fieldbyname('到付地点').asstring)<>0 then DBEdit38.Font.Color:=clred else DBEdit38.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('ISSUETYPE').asstring , t_op_seae_order.fieldbyname('签单方式').asstring)<>0 then DBEdit22.Font.Color:=clred else DBEdit22.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('NOBILL').asstring , t_op_seae_order.fieldbyname('提单份数').asstring)<>0 then DBEdit39.Font.Color:=clred else DBEdit39.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('SERVICE').asstring , t_op_seae_order.fieldbyname('运输条款').asstring)<>0 then DBEdit39.Font.Color:=clred else DBEdit39.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('PKGS').asstring , t_op_seae_order.fieldbyname('件数').asstring)<>0 then DBEdit24.Font.Color:=clred else DBEdit24.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('KINDPKGS').asstring , t_op_seae_order.fieldbyname('包装').asstring)<>0 then DBEdit25.Font.Color:=clred else DBEdit25.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('KGS').asstring , t_op_seae_order.fieldbyname('毛重').asstring)<>0 then DBEdit26.Font.Color:=clred else DBEdit26.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('CBM').asstring , t_op_seae_order.fieldbyname('尺码').asstring)<>0 then DBEdit27.Font.Color:=clred else DBEdit27.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('TOTALNO').asstring , t_op_seae_order.fieldbyname('件数大写').asstring)<>0 then DBEdit37.Font.Color:=clred else DBEdit37.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('SHIPPER').asstring , t_op_seae_order.fieldbyname('发货人代码').asstring)<>0 then DBMemo1.Font.Color:=clred else DBMemo1.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('NOTIFYPARTY').asstring , t_op_seae_order.fieldbyname('通知人代码').asstring)<>0 then DBMemo5.Font.Color:=clred else DBMemo5.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('CONSIGNEE').asstring , t_op_seae_order.fieldbyname('收货人代码').asstring)<>0 then DBMemo4.Font.Color:=clred else DBMemo4.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('MARKS').asstring , t_op_seae_order.fieldbyname('唛头').asstring)<>0 then DBMemo38.Font.Color:=clred else DBMemo38.Font.Color:=clblack ; if AnsiCompareStr(t_op_seae.Fieldbyname('DESCRIPTION').asstring , t_op_seae_order.fieldbyname('货物描述').asstring)<>0 then DBMemo2.Font.Color:=clred else DBMemo2.Font.Color:=clblack ; end; end; procedure Tfrm_op_seae_web_si.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae_web_si.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_op_seae_web_si.Hide; frm_op_seae_web_si.ManualFloat(frm_op_seae_web_si.BoundsRect ); frm_main.freeTabs('frm_op_seae_web_si'); action:=cafree; frm_op_seae_web_si:=nil; end; procedure Tfrm_op_seae_web_si.Panel2Resize(Sender: TObject); var i:integer; begin i:=round(Panel2.Width/12); bsSkinButton7.Width:=i; bsSkinButton6.Width:=i; bsSkinButton9.Width:=i; bsSkinButton1.Width:=i; bsSkinButton11.Width:=i; bsSkinButton2.Width:=i; bsSkinButton38.Width:=i; end; procedure Tfrm_op_seae_web_si.bsSkinButton7Click(Sender: TObject); begin table_Prior(t_op_seae); end; procedure Tfrm_op_seae_web_si.bsSkinButton6Click(Sender: TObject); begin table_next(t_op_seae); end; procedure Tfrm_op_seae_web_si.bsSkinButton9Click(Sender: TObject); begin sys_print('海运出口报关报检',2,t_op_seae1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_seae_web_si.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='查看' then begin Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end else begin Notebook1.PageIndex:=0; bsSkinButton11.Caption:='查看'; end; end; procedure Tfrm_op_seae_web_si.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_web_si.FormShow(Sender: TObject); begin Notebook1.PageIndex:=0; if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(self); frm_sys_progress.bsSkinGauge1.ProgressText:='加载数据请等候。。。'; frm_sys_progress.Show; frm_sys_progress.bsSkinGauge1.MaxValue:=28; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; //委托编号处理 t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select B.*,(CASE ORSTATUS WHEN ''8'' THEN ''确认截单'' WHEN ''0'' THEN ''确认截单'' WHEN ''1'' THEN ''提交截单'' WHEN ''2'' THEN ''驳回截单'''); t_op_seae.SQL.Add(' WHEN ''4'' THEN ''退舱'' else ''录入状态'' end) as ORSTATUSREF '); t_op_seae.SQL.Add(' from op_seaesi B where B.ORSTATUS<>''9'' and op='''+employee+'''' +' order by B.ETD DESC'); t_op_seae.open; t_op_ctn.Open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; loadreggrid(dxdbgrid1,false,caption); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.close; frm_sys_progress:=nil; end; procedure Tfrm_op_seae_web_si.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seae_web_si.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seae_web_si.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,101); end; procedure Tfrm_op_seae_web_si.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seae_web_si.bsSkinButton8Click(Sender: TObject); VAR str:widestring; begin if Edit3.text<>''then str:=str+' and MBLNO like '+''''+'%'+Edit3.text+'%'+''''; if RxDBLookupCombo2.DisplayValue<>''then str:=str+' and CUSTOMERNAME='+''''+RxDBLookupCombo2.DisplayValues[1]+''''; if wwDBComboBox8.Value<>''then str:=str+' and ORSTATUS='+''''+wwDBComboBox8.Value+''''; if (wwDBDateTimePicker9.text<>'') OR (wwDBDateTimePicker12.text<>'') then BEGIN if wwDBDateTimePicker9.text<>''then str:=str+' and CONFIRMDATE>='+''''+wwDBDateTimePicker9.text+''''; if wwDBDateTimePicker12.text<>''then str:=str+' and CONFIRMDATE<='+''''+wwDBDateTimePicker12.text+' 23:59:59'' '; END; if wwDBDateTimePicker13.text<>''then str:=str+' and ETD>='+''''+wwDBDateTimePicker13.text+''''; if wwDBDateTimePicker11.text<>''then str:=str+' and ETD<='+''''+wwDBDateTimePicker11.text+''''; t_op_seae.close; t_op_seae.sql.clear; t_op_seae.SQL.Add('select B.*,(CASE ORSTATUS WHEN ''8'' THEN ''确认截单'' WHEN ''0'' THEN ''确认截单'' WHEN ''1'' THEN ''提交截单'' WHEN ''2'' THEN ''驳回截单'''); t_op_seae.SQL.Add(' WHEN ''4'' THEN ''退舱'' else ''录入状态'' end) as ORSTATUSREF '); t_op_seae.SQL.Add(' from op_seaesi B where B.ORSTATUS<>''9'' and op='''+employee+'''' +str +' order by B.ETD DESC'); t_op_seae.open; end; procedure Tfrm_op_seae_web_si.bsSkinButton12Click(Sender: TObject); begin Edit3.text:=''; RxDBLookupCombo2.ClearValue; wwDBDateTimePicker9.text:=''; wwDBDateTimePicker12.text:=''; wwDBDateTimePicker11.text:=''; wwDBDateTimePicker13.text:=''; end; procedure Tfrm_op_seae_web_si.Notebook1PageChanged(Sender: TObject); begin setconcolor; end; procedure Tfrm_op_seae_web_si.RxDBLookupCombo5Enter(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='代码;姓名' ; end; procedure Tfrm_op_seae_web_si.RxDBLookupCombo5Exit(Sender: TObject); begin TRxDBLookupCombo(Sender).LookupDisplay:='姓名'; end; procedure Tfrm_op_seae_web_si.bsSkinButton2Click(Sender: TObject); var afield : variant; i: Integer; begin if t_op_seae.FieldByName('ORSTATUSREF').AsString<>'提交截单' then begin MessageDlg('当前状态不允许生成订舱!', mtConfirmation, [mbYes],0); exit; end; t_op_seae_order.Close; t_op_seae_order.SQL.Text:='select * from t_op_seae where 业务编号='''+t_op_seae.fieldbyname('BSNO').AsString+''''; t_op_seae_order.Open; if t_op_seae_order.IsEmpty then begin MessageDlg('无法定位订舱,不能生产截单!', mtConfirmation, [mbYes],0); exit; end; t_op_seae_assistant.Close; t_op_seae_assistant.SQL.Text:='select * from t_op_seae_assistant where 业务编号='''+t_op_seae.fieldbyname('BSNO').AsString+''''; t_op_seae_assistant.Open; if not t_op_seae_assistant.IsEmpty then begin t_op_seae_assistant.Edit; t_op_seae_assistant.FieldByName('装货港').AsString:=t_op_seae.FieldByName('PORTLOAD').AsString; t_op_seae_assistant.FieldByName('装港代码').AsString:=t_op_seae.FieldByName('PORTLOADID').AsString; //////?????? t_op_seae_assistant.FieldByName('提单份数').AsString:=t_op_seae.FieldByName('NOBILL').AsString; t_op_seae_assistant.FieldByName('运输条款').AsString:=t_op_seae.FieldByName('SERVICE').AsString; t_op_seae_assistant.FieldByName('唛头').AsString:=t_op_seae.FieldByName('MARKS').AsString; t_op_seae_assistant.FieldByName('货物描述').AsString:=t_op_seae.FieldByName('DESCRIPTION').AsString; t_op_seae_assistant.FieldByName('发货人代码').AsString:=t_op_seae.FieldByName('SHIPPER').AsString; t_op_seae_assistant.FieldByName('收货人代码').AsString:=t_op_seae.FieldByName('CONSIGNEE').AsString; t_op_seae_assistant.FieldByName('通知人代码').AsString:=t_op_seae.FieldByName('NOTIFYPARTY').AsString; t_op_seae_assistant.FieldByName('付费方式').AsString:=t_op_seae.FieldByName('BLFRT').AsString; t_op_seae_assistant.FieldByName('签单地点').AsString:=t_op_seae.FieldByName('ISSUEPLACE').AsString; t_op_seae_assistant.FieldByName('件数包装').AsString:=t_op_seae.FieldByName('PKGS').AsString+t_op_seae.FieldByName('KINDPKGS').AsString; t_op_seae_assistant.FieldByName('货物重量').AsString:=t_op_seae.FieldByName('KGS').AsString+'KGS'; t_op_seae_assistant.FieldByName('货物尺码').AsString:=t_op_seae.FieldByName('CBM').AsString+'CBM'; t_op_seae_assistant.FieldByName('件数').AsInteger:=t_op_seae.FieldByName('PKGS').AsInteger; t_op_seae_assistant.FieldByName('包装').AsString:=t_op_seae.FieldByName('KINDPKGS').AsString; t_op_seae_assistant.FieldByName('重量').AsFloat:=t_op_seae.FieldByName('KGS').AsFloat; t_op_seae_assistant.FieldByName('尺码').AsFloat:=t_op_seae.FieldByName('CBM').AsFloat; t_op_seae_assistant.FieldByName('件数大写').AsString:=t_op_seae.fieldbyname('TOTALNO').AsString; { t_op_seae_assistant.FieldByName('危险品分类').AsString:=t_op_seae.FieldByName('DCLASS').AsString; t_op_seae_assistant.FieldByName('危险品编号').AsString:=t_op_seae.FieldByName('DUNNO').AsString; } t_op_seae_assistant.FieldByName('船名').AsString:=t_op_seae.FieldByName('VESSEL').AsString; t_op_seae_assistant.FieldByName('航次').AsString:=t_op_seae.FieldByName('VOYNO').AsString; t_op_seae_assistant.FieldByName('开船日期').Value:=t_op_seae.FieldByName('ETD').Value; t_op_seae_assistant.FieldByName('卸货港').AsString:=t_op_seae.FieldByName('PORTDISCHARGE').AsString; t_op_seae_assistant.FieldByName('卸货代码').AsString:=t_op_seae.FieldByName('PORTDISCHARGEID').AsString; t_op_seae_assistant.FieldByName('目的地').AsString:=t_op_seae.FieldByName('DESTINATION').AsString; t_op_seae_assistant.FieldByName('目的地代码').AsString:=t_op_seae.FieldByName('DESTINATIONID').AsString; t_op_seae_assistant.FieldByName('交货地点').AsString:=t_op_seae.FieldByName('PLACEDELIVERY').AsString; t_op_seae_assistant.FieldByName('交货代码').AsString:=t_op_seae.FieldByName('PLACEDELIVERYID').AsString; t_op_seae_assistant.FieldByName('集装箱').AsString:=t_op_seae.FieldByName('CNTRTOTAL').AsString; t_op_seae_assistant.FieldByName('预付地点').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString; t_op_seae_assistant.FieldByName('签单方式').AsString:=t_op_seae.FieldByName('ISSUETYPE').AsString; t_op_seae_assistant.FieldByName('预付地点').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString; t_op_seae_assistant.FieldByName('到付地点').AsString:=t_op_seae.FieldByName('PAYABLEAT').AsString; t_op_seae_assistant.FieldByName('运输条款').AsString:=t_op_seae.FieldByName('SERVICE').AsString; t_op_seae_assistant.Post; end else begin t_op_seae_assistant.Insert; for i:=0 to (t_op_seae_order.fieldcount-1) do begin try if t_op_seae_assistant.FindField(t_op_seae_order.fields[i].FieldName)<>nil then t_op_seae_assistant[t_op_seae_order.fields[i].FieldName]:= t_op_seae_order.fields[i].value; except ; end; end; t_op_seae_assistant.FieldByName('装货港').AsString:=t_op_seae.FieldByName('PORTLOAD').AsString; t_op_seae_assistant.FieldByName('装港代码').AsString:=t_op_seae.FieldByName('PORTLOADID').AsString; //////?????? t_op_seae_assistant.FieldByName('提单份数').AsString:=t_op_seae.FieldByName('NOBILL').AsString; t_op_seae_assistant.FieldByName('运输条款').AsString:=t_op_seae.FieldByName('SERVICE').AsString; t_op_seae_assistant.FieldByName('唛头').AsString:=t_op_seae.FieldByName('MARKS').AsString; t_op_seae_assistant.FieldByName('货物描述').AsString:=t_op_seae.FieldByName('DESCRIPTION').AsString; t_op_seae_assistant.FieldByName('发货人代码').AsString:=t_op_seae.FieldByName('SHIPPER').AsString; t_op_seae_assistant.FieldByName('收货人代码').AsString:=t_op_seae.FieldByName('CONSIGNEE').AsString; t_op_seae_assistant.FieldByName('通知人代码').AsString:=t_op_seae.FieldByName('NOTIFYPARTY').AsString; t_op_seae_assistant.FieldByName('付费方式').AsString:=t_op_seae.FieldByName('BLFRT').AsString; t_op_seae_assistant.FieldByName('签单地点').AsString:=t_op_seae.FieldByName('ISSUEPLACE').AsString; t_op_seae_assistant.FieldByName('件数包装').AsString:=t_op_seae.FieldByName('PKGS').AsString+t_op_seae.FieldByName('KINDPKGS').AsString; t_op_seae_assistant.FieldByName('货物重量').AsString:=t_op_seae.FieldByName('KGS').AsString+'KGS'; t_op_seae_assistant.FieldByName('货物尺码').AsString:=t_op_seae.FieldByName('CBM').AsString+'CBM'; t_op_seae_assistant.FieldByName('件数').AsInteger:=t_op_seae.FieldByName('PKGS').AsInteger; t_op_seae_assistant.FieldByName('包装').AsString:=t_op_seae.FieldByName('KINDPKGS').AsString; t_op_seae_assistant.FieldByName('重量').AsFloat:=t_op_seae.FieldByName('KGS').AsFloat; t_op_seae_assistant.FieldByName('尺码').AsFloat:=t_op_seae.FieldByName('CBM').AsFloat; t_op_seae_assistant.FieldByName('件数大写').AsString:=t_op_seae.fieldbyname('TOTALNO').AsString; { t_op_seae_assistant.FieldByName('危险品分类').AsString:=t_op_seae.FieldByName('DCLASS').AsString; t_op_seae_assistant.FieldByName('危险品编号').AsString:=t_op_seae.FieldByName('DUNNO').AsString; } t_op_seae_assistant.FieldByName('船名').AsString:=t_op_seae.FieldByName('VESSEL').AsString; t_op_seae_assistant.FieldByName('航次').AsString:=t_op_seae.FieldByName('VOYNO').AsString; t_op_seae_assistant.FieldByName('开船日期').Value:=t_op_seae.FieldByName('ETD').Value; t_op_seae_assistant.FieldByName('卸货港').AsString:=t_op_seae.FieldByName('PORTDISCHARGE').AsString; t_op_seae_assistant.FieldByName('卸货代码').AsString:=t_op_seae.FieldByName('PORTDISCHARGEID').AsString; t_op_seae_assistant.FieldByName('目的地').AsString:=t_op_seae.FieldByName('DESTINATION').AsString; t_op_seae_assistant.FieldByName('目的地代码').AsString:=t_op_seae.FieldByName('DESTINATIONID').AsString; t_op_seae_assistant.FieldByName('交货地点').AsString:=t_op_seae.FieldByName('PLACEDELIVERY').AsString; t_op_seae_assistant.FieldByName('交货代码').AsString:=t_op_seae.FieldByName('PLACEDELIVERYID').AsString; t_op_seae_assistant.FieldByName('集装箱').AsString:=t_op_seae.FieldByName('CNTRTOTAL').AsString; t_op_seae_assistant.FieldByName('预付地点').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString; t_op_seae_assistant.FieldByName('签单方式').AsString:=t_op_seae.FieldByName('ISSUETYPE').AsString; t_op_seae_assistant.FieldByName('预付地点').AsString:=t_op_seae.FieldByName('PREPARDAT').AsString; t_op_seae_assistant.FieldByName('到付地点').AsString:=t_op_seae.FieldByName('PAYABLEAT').AsString; t_op_seae_assistant.FieldByName('运输条款').AsString:=t_op_seae.FieldByName('SERVICE').AsString; t_op_seae_assistant.Post; end; ShowMessage('已更新截单信息!'); end; procedure Tfrm_op_seae_web_si.dxDBGrid1DblClick(Sender: TObject); begin Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; end; procedure Tfrm_op_seae_web_si.DBEdit29Change(Sender: TObject); begin if (Notebook1.PageIndex=1) then setconcolor; end; procedure Tfrm_op_seae_web_si.bsSkinButton1Click(Sender: TObject); begin t_op_seae.Edit; t_op_seae.fieldbyname('ORSTATUS').AsString:='2'; t_op_seae.Post; t_op_seae.Refresh; end; end.