unit u_op_seae; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, dxExEdtr, XPMenu, Menus, DB, ADODB, bsSkinCtrls, bsdbctrls, wwdbedit, Wwdotdot, Wwdbcomb, wwdbdatetimepicker, wwdblook, StdCtrls, DBCtrls, ComCtrls, bsSkinTabs, RxLookup, Mask, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, ExtCtrls, Dialogs, ExtDlgs, Wwdbdlg, u_op_card,ComObj, Grids, DBGrids, kbmMemTable, kbmMemBinaryStreamFormat, DBCtrlsEh,Registry, DBLookupEh, Wwdbigrd, Wwdbgrid; type Tfrm_op_seae = class(TForm) t_op_seae: TADOQuery; t_op_seae1: TDataSource; t_op_seae_fen: TADOQuery; t_op_seae_fen1: TDataSource; t_op_seae2: TDataSource; PopupMenu1: TPopupMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N5: TMenuItem; N6: TMenuItem; N8: TMenuItem; N9: TMenuItem; N19: TMenuItem; N21: TMenuItem; N23: TMenuItem; N4: TMenuItem; N20: TMenuItem; N24: TMenuItem; N7: TMenuItem; N22: TMenuItem; N30: TMenuItem; EXCEL1: TMenuItem; N33: TMenuItem; EDI1: TMenuItem; XPMenu1: TXPMenu; Panel2: TPanel; bsSkinButton7: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton4: TbsSkinButton; bsSkinButton3: TbsSkinButton; bsSkinButton5: TbsSkinButton; Notebook1: TNotebook; bsSkinPanel1: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label37: TLabel; Label5: TLabel; Label38: TLabel; Label4: TLabel; Label36: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit8: TDBEdit; DBEdit4: TDBEdit; DBEdit9: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; DBEdit7: TDBEdit; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet6: TbsSkinTabSheet; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet7: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinTabSheet5: TbsSkinTabSheet; bsSkinTabSheet4: TbsSkinTabSheet; bsSkinTabSheet8: TbsSkinTabSheet; Panel3: TPanel; dxDBGrid1: TdxDBGrid; bsSkinGroupBox1: TbsSkinGroupBox; Label43: TLabel; wwDBLookupCombo1: TwwDBLookupCombo; Label45: TLabel; wwDBDateTimePicker1: TwwDBDateTimePicker; Label46: TLabel; wwDBLookupCombo4: TwwDBLookupCombo; Label47: TLabel; DBEdit12: TDBEdit; bsSkinGroupBox2: TbsSkinGroupBox; Label44: TLabel; wwDBDateTimePicker5: TwwDBDateTimePicker; Label48: TLabel; DBEdit13: TDBEdit; Label49: TLabel; RxDBLookupCombo23: TRxDBLookupCombo; Label50: TLabel; DBEdit14: TDBEdit; Label51: TLabel; DBEdit15: TDBEdit; bsSkinDBCheckRadioBox7: TbsSkinDBCheckRadioBox; Label55: TLabel; wwDBDateTimePicker10: TwwDBDateTimePicker; bsSkinGroupBox3: TbsSkinGroupBox; Label56: TLabel; Label57: TLabel; Label58: TLabel; Label59: TLabel; bsSkinGroupBox4: TbsSkinGroupBox; DBMemo10: TDBMemo; EDI2: TMenuItem; t_ch_fee: TADOQuery; DBEdit17: TDBEdit; Label62: TLabel; DBEdit18: TDBEdit; Label65: TLabel; Label66: TLabel; DBEdit20: TDBEdit; Label67: TLabel; DBEdit21: TDBEdit; Label68: TLabel; DBEdit22: TDBEdit; Label69: TLabel; Label70: TLabel; bsSkinButton13: TbsSkinButton; Label20: TLabel; RxDBLookupCombo29: TRxDBLookupCombo; Label41: TLabel; Label42: TLabel; RxDBLookupCombo30: TRxDBLookupCombo; wwDBComboBox3: TwwDBComboBox; Label63: TLabel; bsSkinGroupBox5: TbsSkinGroupBox; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N12: TMenuItem; N13: TMenuItem; N14: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinTabSheet9: TbsSkinTabSheet; PopupMenu3: TPopupMenu; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N37: TMenuItem; N38: TMenuItem; N39: TMenuItem; N40: TMenuItem; N41: TMenuItem; N42: TMenuItem; N43: TMenuItem; N44: TMenuItem; N45: TMenuItem; N46: TMenuItem; N47: TMenuItem; N48: TMenuItem; N49: TMenuItem; N50: TMenuItem; N51: TMenuItem; N52: TMenuItem; N53: TMenuItem; N54: TMenuItem; N55: TMenuItem; RxDBLookupCombo31: TRxDBLookupCombo; t_op_seae_huanhuo: TADOQuery; N56: TMenuItem; N57: TMenuItem; N58: TMenuItem; N59: TMenuItem; N60: TMenuItem; PopupMenu4: TPopupMenu; N27: TMenuItem; N28: TMenuItem; N29: TMenuItem; N26: TMenuItem; N31: TMenuItem; N32: TMenuItem; N61: TMenuItem; t_op_seae_huanhuo1: TDataSource; bsSkinGroupBox6: TbsSkinGroupBox; fra_op_card1: Tfra_op_card; bsSkinDBCheckRadioBox6: TbsSkinDBCheckRadioBox; Label40: TLabel; wwDBDateTimePicker7: TwwDBDateTimePicker; Label52: TLabel; wwDBDateTimePicker8: TwwDBDateTimePicker; bsSkinDBCheckRadioBox12: TbsSkinDBCheckRadioBox; bsSkinButton35: TbsSkinButton; bsSkinDBCheckRadioBox13: TbsSkinDBCheckRadioBox; Label53: TLabel; wwDBDateTimePicker11: TwwDBDateTimePicker; DBEdit6: TDBEdit; DBEdit16: TDBEdit; Label54: TLabel; wwDBLookupCombo9: TwwDBLookupCombo; Label60: TLabel; DBEdit19: TDBEdit; Label61: TLabel; wwDBDateTimePicker9: TwwDBDateTimePicker; Label64: TLabel; wwDBLookupCombo10: TwwDBLookupCombo; bsSkinTabSheet10: TbsSkinTabSheet; N25: TMenuItem; N62: TMenuItem; N63: TMenuItem; N64: TMenuItem; bsSkinPanel2: TbsSkinPanel; Label71: TLabel; DBMemo7: TDBMemo; Label72: TLabel; DBMemo8: TDBMemo; Label74: TLabel; DBMemo9: TDBMemo; Label75: TLabel; DBMemo11: TDBMemo; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridDateColumn; dxDBGrid1Column19: TdxDBGridDateColumn; dxDBGrid1Column20: TdxDBGridDateColumn; dxDBGrid1Column22: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridDateColumn; dxDBGrid1Column25: TdxDBGridMaskColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column27: TdxDBGridMaskColumn; dxDBGrid1Column28: TdxDBGridMaskColumn; dxDBGrid1Column29: TdxDBGridMaskColumn; dxDBGrid1Column30: TdxDBGridMaskColumn; dxDBGrid1Column31: TdxDBGridMaskColumn; dxDBGrid1Column32: TdxDBGridMaskColumn; dxDBGrid1Column33: TdxDBGridDateColumn; dxDBGrid1Column34: TdxDBGridMaskColumn; dxDBGrid1Column35: TdxDBGridMaskColumn; dxDBGrid1Column36: TdxDBGridMaskColumn; dxDBGrid1Column37: TdxDBGridMaskColumn; dxDBGrid1Column38: TdxDBGridMaskColumn; dxDBGrid1Column39: TdxDBGridMaskColumn; dxDBGrid1Column40: TdxDBGridMaskColumn; dxDBGrid1Column41: TdxDBGridColumn; dxDBGrid1Column42: TdxDBGridColumn; dxDBGrid11: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGridMaskColumn; dxDBGrid15: TdxDBGridMaskColumn; dxDBGrid16: TdxDBGridMaskColumn; dxDBGrid17: TdxDBGridMaskColumn; dxDBGrid18: TdxDBGridMaskColumn; dxDBGrid19: TdxDBGridMaskColumn; dxDBGrid110: TdxDBGridMaskColumn; dxDBGrid1Column63: TdxDBGridMaskColumn; dxDBGrid1TEU: TdxDBGridMaskColumn; dxDBGrid1Column65: TdxDBGridMaskColumn; dxDBGrid1Column66: TdxDBGridMaskColumn; dxDBGrid1Column67: TdxDBGridDateColumn; dxDBGrid1Column68: TdxDBGridMaskColumn; dxDBGrid1Column69: TdxDBGridMaskColumn; dxDBGrid1Column70: TdxDBGridMaskColumn; dxDBGrid1Column71: TdxDBGridMaskColumn; dxDBGrid1Column72: TdxDBGridMaskColumn; dxDBGrid1Column73: TdxDBGridMaskColumn; dxDBGrid1Column74: TdxDBGridMaskColumn; dxDBGrid1Column75: TdxDBGridMaskColumn; dxDBGrid1Column76: TdxDBGridCheckColumn; dxDBGrid1Column77: TdxDBGridCheckColumn; dxDBGrid1Column78: TdxDBGridCheckColumn; dxDBGrid1Column79: TdxDBGridCheckColumn; dxDBGrid1Column80: TdxDBGridCheckColumn; dxDBGrid1Column81: TdxDBGridDateColumn; dxDBGrid1Column82: TdxDBGridMaskColumn; dxDBGrid1Column83: TdxDBGridMaskColumn; dxDBGrid1Column84: TdxDBGridMaskColumn; dxDBGrid1Column85: TdxDBGridMaskColumn; dxDBGrid1Column86: TdxDBGridMaskColumn; dxDBGrid1Column87: TdxDBGridMaskColumn; dxDBGrid1Column88: TdxDBGridMaskColumn; dxDBGrid1Column89: TdxDBGridCheckColumn; dxDBGrid1Column90: TdxDBGridDateColumn; dxDBGrid1Column91: TdxDBGridCheckColumn; dxDBGrid1Column92: TdxDBGridDateColumn; dxDBGrid1Column93: TdxDBGridMaskColumn; dxDBGrid1Column94: TdxDBGridMaskColumn; dxDBGrid1Column95: TdxDBGridMaskColumn; dxDBGrid1Column96: TdxDBGridMaskColumn; dxDBGrid1Column97: TdxDBGridMaskColumn; dxDBGrid1Column98: TdxDBGridCheckColumn; dxDBGrid1Column99: TdxDBGridCheckColumn; dxDBGrid1Column100: TdxDBGridCheckColumn; dxDBGrid1Column101: TdxDBGridCheckColumn; dxDBGrid1Column102: TdxDBGridDateColumn; dxDBGrid1Column103: TdxDBGridCheckColumn; dxDBGrid1Column104: TdxDBGridDateColumn; dxDBGrid1Column105: TdxDBGridDateColumn; dxDBGrid1Column106: TdxDBGridMaskColumn; dxDBGrid1Column107: TdxDBGridMaskColumn; dxDBGrid1Column108: TdxDBGridMaskColumn; N65: TMenuItem; N66: TMenuItem; N67: TMenuItem; N68: TMenuItem; N69: TMenuItem; N70: TMenuItem; N71: TMenuItem; N72: TMenuItem; bsSkinButton15: TbsSkinButton; Label76: TLabel; wwDBDateTimePicker12: TwwDBDateTimePicker; wwDBDateTimePicker13: TwwDBDateTimePicker; Label77: TLabel; wwDBDateTimePicker14: TwwDBDateTimePicker; Label78: TLabel; wwDBDateTimePicker15: TwwDBDateTimePicker; Label79: TLabel; N73: TMenuItem; N74: TMenuItem; bsSkinButton38: TbsSkinButton; N75: TMenuItem; N76: TMenuItem; N77: TMenuItem; N78: TMenuItem; N79: TMenuItem; N80: TMenuItem; dxDBGrid1Column109: TdxDBGridColumn; dxDBGrid1Column110: TdxDBGridColumn; dxDBGrid1Column111: TdxDBGridColumn; N81: TMenuItem; N82: TMenuItem; N83: TMenuItem; N84: TMenuItem; bsSkinPanel5: TbsSkinPanel; Label82: TLabel; DBMemo12: TDBMemo; Label83: TLabel; DBEdit23: TDBEdit; Label84: TLabel; RxDBLookupCombo34: TRxDBLookupCombo; Label85: TLabel; RxDBLookupCombo35: TRxDBLookupCombo; Label86: TLabel; RxDBLookupCombo36: TRxDBLookupCombo; bsSkinButton40: TbsSkinButton; bsSkinButton41: TbsSkinButton; bsSkinDBCheckRadioBox8: TbsSkinDBCheckRadioBox; Label87: TLabel; wwDBDateTimePicker16: TwwDBDateTimePicker; bsSkinButton42: TbsSkinButton; bsSkinButton43: TbsSkinButton; dxDBGrid1Column112: TdxDBGridCheckColumn; dxDBGrid1Column113: TdxDBGridColumn; Label191: TLabel; wwDBComboBox12: TwwDBComboBox; Label179: TLabel; DBEdit71: TDBEdit; Label181: TLabel; DBEdit73: TDBEdit; Label185: TLabel; DBEdit109: TDBEdit; Label189: TLabel; wwDBComboBox11: TwwDBComboBox; Label190: TLabel; DBEdit114: TDBEdit; Label188: TLabel; DBEdit112: TDBEdit; Label187: TLabel; DBEdit111: TDBEdit; N85: TMenuItem; CMAEDI1: TMenuItem; Label90: TLabel; Label91: TLabel; bsSkinDBCheckRadioBox15: TbsSkinDBCheckRadioBox; Label94: TLabel; DBEdit24: TDBEdit; Label95: TLabel; DBEdit28: TDBEdit; Label96: TLabel; Label97: TLabel; DBEdit29: TDBEdit; Label98: TLabel; DBEdit30: TDBEdit; Label99: TLabel; wwDBComboBox5: TwwDBComboBox; N86: TMenuItem; N87: TMenuItem; N88: TMenuItem; N89: TMenuItem; N90: TMenuItem; N91: TMenuItem; N92: TMenuItem; N93: TMenuItem; NORISICA1: TMenuItem; ANE1: TMenuItem; N94: TMenuItem; N95: TMenuItem; N96: TMenuItem; N97: TMenuItem; N98: TMenuItem; N99: TMenuItem; bsSkinDBCheckRadioBox14: TbsSkinDBCheckRadioBox; N100: TMenuItem; WORD1: TMenuItem; N101: TMenuItem; N102: TMenuItem; N103: TMenuItem; N104: TMenuItem; bsSkinPanel3: TbsSkinPanel; bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox; bsSkinPanel4: TbsSkinPanel; Label80: TLabel; RxDBLookupCombo32: TRxDBLookupCombo; bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox; bsSkinPanel6: TbsSkinPanel; Label81: TLabel; RxDBLookupCombo33: TRxDBLookupCombo; bsSkinDBCheckRadioBox3: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox5: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox4: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox9: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox10: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox11: TbsSkinDBCheckRadioBox; DBEdit31: TDBEdit; Label101: TLabel; memtblrpt: TkbmMemTable; kbmBinaryStreamFormat1: TkbmBinaryStreamFormat; dsrmemtblrpt: TDataSource; bsSkinButton44: TbsSkinButton; bsSkinPanel7: TbsSkinPanel; bsSkinDBCheckRadioBox16: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox17: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox18: TbsSkinDBCheckRadioBox; bsSkinDBCheckRadioBox19: TbsSkinDBCheckRadioBox; t_op_modify: TADOQuery; N105: TMenuItem; EDI3: TMenuItem; bsSkinGroupBox7: TbsSkinGroupBox; Label108: TLabel; Label109: TLabel; RxDBLookupCombo48: TRxDBLookupCombo; RxDBLookupCombo49: TRxDBLookupCombo; Label88: TLabel; RxDBLookupCombo37: TRxDBLookupCombo; RxDBLookupCombo38: TRxDBLookupCombo; Label89: TLabel; t_code_edi_line: TADOQuery; ds_code_edi_line1: TDataSource; Label92: TLabel; RxDBLookupCombo41: TRxDBLookupCombo; dbmmoEDI: TDBMemo; Label129: TLabel; RxDBLookupCombo42: TRxDBLookupCombo; RxDBLookupCombo39: TRxDBLookupCombo; Label93: TLabel; DBEdit38: TDBEdit; bsSkinButton45: TbsSkinButton; N106: TMenuItem; lbl1: TLabel; dbedt1: TDBEdit; dbedt2: TDBEdit; lbl2: TLabel; dbedt3: TDBEdit; lbl3: TLabel; Label116: TLabel; RxDBLookupCombo40: TRxDBLookupCombo; bsSkinDBCheckRadioBox21: TbsSkinDBCheckRadioBox; Label117: TLabel; wwDBDateTimePicker17: TwwDBDateTimePicker; bsSkinButton46: TbsSkinButton; bsSkinDBCheckRadioBox22: TbsSkinDBCheckRadioBox; Label118: TLabel; wwDBDateTimePicker18: TwwDBDateTimePicker; bsSkinButton47: TbsSkinButton; bsSkinDBCheckRadioBox23: TbsSkinDBCheckRadioBox; Label119: TLabel; wwDBDateTimePicker19: TwwDBDateTimePicker; bsSkinButton48: TbsSkinButton; bsSkinDBCheckRadioBox24: TbsSkinDBCheckRadioBox; Label120: TLabel; wwDBDateTimePicker20: TwwDBDateTimePicker; bsSkinButton49: TbsSkinButton; bsSkinDBCheckRadioBox25: TbsSkinDBCheckRadioBox; Label127: TLabel; wwDBDateTimePicker21: TwwDBDateTimePicker; bsSkinButton50: TbsSkinButton; Query1: TADOQuery; aQuery2: TADOQuery; bsSkinButton51: TbsSkinButton; bsSkinButton52: TbsSkinButton; bsSkinButton53: TbsSkinButton; bsSkinButton54: TbsSkinButton; dxDBGrid1Column114: TdxDBGridColumn; dxDBGrid1Column115: TdxDBGridColumn; dxDBGrid1Column116: TdxDBGridColumn; RxDBLookupCombo24: TRxDBLookupCombo; RxDBLookupCombo25: TRxDBLookupCombo; RxDBLookupCombo26: TRxDBLookupCombo; RxDBLookupCombo27: TRxDBLookupCombo; N107: TMenuItem; EDI4: TMenuItem; bsSkinGroupBox8: TbsSkinGroupBox; t_op_ams: TADOQuery; t_op_ams1: TDataSource; DBEdit39: TDBEdit; Label128: TLabel; wwDBLookupCombo12: TwwDBLookupCombo; RxDBLookupCombo50: TRxDBLookupCombo; Label130: TLabel; DBMemo13: TDBMemo; N108: TMenuItem; NYKEDI1: TMenuItem; Label131: TLabel; RxDBLookupCombo51: TRxDBLookupCombo; wwDBLookupCombo13: TwwDBLookupCombo; DBMemo14: TDBMemo; RxDBLookupCombo52: TRxDBLookupCombo; wwDBLookupCombo14: TwwDBLookupCombo; DBMemo15: TDBMemo; Label132: TLabel; N109: TMenuItem; EDI5: TMenuItem; N110: TMenuItem; N111: TMenuItem; N112: TMenuItem; EDI6: TMenuItem; Label133: TLabel; DBMemo16: TDBMemo; wwDBLookupCombo15: TwwDBLookupCombo; N113: TMenuItem; N114: TMenuItem; N115: TMenuItem; N116: TMenuItem; N117: TMenuItem; N118: TMenuItem; N119: TMenuItem; Label104: TLabel; DBEdit34: TDBEdit; N120: TMenuItem; N121: TMenuItem; N122: TMenuItem; PILEDI1: TMenuItem; Label106: TLabel; bsSkinPanel8: TbsSkinPanel; Label13: TLabel; Label158: TLabel; Label163: TLabel; Label122: TLabel; Label121: TLabel; Label123: TLabel; Label6: TLabel; Label125: TLabel; Label126: TLabel; Label124: TLabel; Label7: TLabel; Label146: TLabel; Label145: TLabel; Label15: TLabel; Label25: TLabel; Label18: TLabel; Label73: TLabel; Label22: TLabel; Label32: TLabel; Label21: TLabel; Label35: TLabel; Label26: TLabel; Label27: TLabel; Label30: TLabel; Label31: TLabel; Label28: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label8: TLabel; Label164: TLabel; Label165: TLabel; Label166: TLabel; Label167: TLabel; Label168: TLabel; Label169: TLabel; Label170: TLabel; Label14: TLabel; Label16: TLabel; Label34: TLabel; Label39: TLabel; Label19: TLabel; Label100: TLabel; Label102: TLabel; Label103: TLabel; Label17: TLabel; Label105: TLabel; wwDBLookupCombo48: TwwDBLookupCombo; wwDBLookupCombo46: TwwDBLookupCombo; wwDBLookupCombo47: TwwDBLookupCombo; RxDBLookupCombo3: TRxDBLookupCombo; DBEdit5: TDBEdit; DBMemo37: TDBMemo; bsSkinButton22: TbsSkinButton; DBMemo38: TDBMemo; bsSkinButton21: TbsSkinButton; DBMemo35: TDBMemo; DBMemo34: TDBMemo; DBMemo33: TDBMemo; RxDBLookupCombo2: TRxDBLookupCombo; RxDBLookupCombo4: TRxDBLookupCombo; RxDBLookupCombo5: TRxDBLookupCombo; DBMemo1: TDBMemo; wwDBLookupCombo49: TwwDBLookupCombo; DBEdit63: TDBEdit; wwDBLookupCombo52: TwwDBLookupCombo; wwDBDateTimePicker2: TwwDBDateTimePicker; wwDBDateTimePicker6: TwwDBDateTimePicker; wwDBDateTimePicker3: TwwDBDateTimePicker; wwDBLookupCombo3: TwwDBLookupCombo; wwDBComboBox2: TwwDBComboBox; wwDBLookupCombo21: TwwDBLookupCombo; wwDBComboBoxBL: TwwDBComboBox; wwDBDateTimePicker4: TwwDBDateTimePicker; DBEdit25: TDBEdit; DBEdit27: TDBEdit; DBEdit26: TDBEdit; RxDBLookupCombo6: TRxDBLookupCombo; RxDBLookupCombo7: TRxDBLookupCombo; RxDBLookupCombo8: TRxDBLookupCombo; RxDBLookupCombo9: TRxDBLookupCombo; RxDBLookupCombo10: TRxDBLookupCombo; DBMemo39: TDBMemo; DBMemo40: TDBMemo; DBMemo41: TDBMemo; DBMemo42: TDBMemo; DBEdit80: TDBEdit; DBEdit81: TDBEdit; wwDBLookupCombo61: TwwDBLookupCombo; DBEdit82: TDBEdit; DBEdit83: TDBEdit; DBMemo2: TDBMemo; RxDBLookupCombo11: TRxDBLookupCombo; bsSkinButton16: TbsSkinButton; bsSkinButton17: TbsSkinButton; bsSkinButton18: TbsSkinButton; bsSkinButton19: TbsSkinButton; bsSkinButton20: TbsSkinButton; bsSkinButton23: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; bsSkinButton26: TbsSkinButton; RxDBLookupCombo14: TRxDBLookupCombo; RxDBLookupCombo20: TRxDBLookupCombo; bsSkinButton37: TbsSkinButton; DBEdit10: TDBEdit; DBEdit11: TDBEdit; RxDBLookupCombo15: TRxDBLookupCombo; RxDBLookupCombo28: TRxDBLookupCombo; Button1: TButton; RxDBLookupCombo12: TRxDBLookupCombo; bsSkinButton12: TbsSkinButton; wwDBLookupCombo7: TwwDBLookupCombo; wwDBLookupCombo11: TwwDBLookupCombo; RxDBLookupCombo43: TRxDBLookupCombo; DBEdit32: TDBEdit; DBEdit33: TDBEdit; RxDBLookupCombo21: TRxDBLookupCombo; RxDBLookupCombo22: TRxDBLookupCombo; RxDBLookupCombo13: TRxDBLookupCombo; bsSkinButton55: TbsSkinButton; wwDBComboBox8: TwwDBComboBox; wwDBDateTimePicker22: TwwDBDateTimePicker; bsSkinPageControl2: TbsSkinPageControl; bsskintabsheet_1: TbsSkinTabSheet; Label23: TLabel; Label24: TLabel; Label29: TLabel; Label33: TLabel; RxDBLookupCombo16: TRxDBLookupCombo; bsSkinButton27: TbsSkinButton; DBMemo3: TDBMemo; bsSkinButton28: TbsSkinButton; RxDBLookupCombo17: TRxDBLookupCombo; DBMemo4: TDBMemo; RxDBLookupCombo18: TRxDBLookupCombo; bsSkinButton29: TbsSkinButton; DBMemo5: TDBMemo; bsSkinButton30: TbsSkinButton; RxDBLookupCombo19: TRxDBLookupCombo; DBMemo6: TDBMemo; wwDBLookupCombo2: TwwDBLookupCombo; wwDBLookupCombo5: TwwDBLookupCombo; wwDBLookupCombo6: TwwDBLookupCombo; wwDBLookupCombo8: TwwDBLookupCombo; bsSkinButton39: TbsSkinButton; bsskintabsheet_2: TbsSkinTabSheet; dxDBGrid2: TdxDBGrid; dxDBGrid2Column1: TdxDBGridMaskColumn; dxDBGrid2Column17: TdxDBGridColumn; dxDBGrid2Column2: TdxDBGridMaskColumn; dxDBGrid2Column3: TdxDBGridMaskColumn; dxDBGrid2Column4: TdxDBGridMaskColumn; dxDBGrid2Column5: TdxDBGridMaskColumn; dxDBGrid2Column6: TdxDBGridMaskColumn; dxDBGrid2Column7: TdxDBGridDateColumn; dxDBGrid2Column8: TdxDBGridMaskColumn; dxDBGrid2Column9: TdxDBGridMaskColumn; dxDBGrid2Column10: TdxDBGridMaskColumn; dxDBGrid2Column11: TdxDBGridColumn; dxDBGrid2Column12: TdxDBGridColumn; dxDBGrid2Column13: TdxDBGridMaskColumn; dxDBGrid2Column14: TdxDBGridMaskColumn; dxDBGrid2Column15: TdxDBGridMaskColumn; dxDBGrid2Column16: TdxDBGridMaskColumn; Panel1: TPanel; bsSkinButton31: TbsSkinButton; bsSkinButton32: TbsSkinButton; bsSkinButton33: TbsSkinButton; bsSkinButton34: TbsSkinButton; bsSkinButton36: TbsSkinButton; bsSkinButton14: TbsSkinButton; bsSkinGroupBox9: TbsSkinGroupBox; Label107: TLabel; wwDBComboBox4: TwwDBComboBox; t_op_ctn1: TDataSource; t_op_ctn: TADOQuery; strngfld_op_ctnDSDesigner2: TStringField; strngfld_op_ctnDSDesigner6: TStringField; intgrfld_op_ctnDSDesigner5: TIntegerField; strngfld_op_ctnDSDesigner7: TStringField; strngfld_op_ctnDSDesigner8: TStringField; intgrfld_op_ctnDSDesigner9: TIntegerField; strngfld_op_ctnDSDesigner10: TStringField; bcdfld_op_ctnDSDesigner11: TBCDField; bcdfld_op_ctnDSDesigner12: TBCDField; strngfld_op_ctnDSDesigner1: TStringField; strngfld_op_ctnDSDesigner13: TStringField; strngfld_op_ctnDSDesigner14: TStringField; intgrfld_op_ctnTEU: TIntegerField; strngfld_op_ctnDSDesigner4: TStringField; strngfld_op_ctnDSDesigner3: TStringField; atncfld_op_ctnctn_id: TAutoIncField; strngfld_op_ctnDSDesigner: TStringField; bsSkinPanel9: TbsSkinPanel; bsSkinButton56: TbsSkinButton; bsSkinButton57: TbsSkinButton; bsSkinButton58: TbsSkinButton; bsSkinButton59: TbsSkinButton; bsSkinButton60: TbsSkinButton; btnMarks: TbsSkinButton; btnDesc: TbsSkinButton; wwDBLookupCombo16: TwwDBLookupCombo; wwDBLookupCombo17: TwwDBLookupCombo; wwDBGrid1: TwwDBGrid; Memo4: TMemo; Memo3: TMemo; Memo2: TMemo; Memo1: TMemo; N123: TMenuItem; N124: TMenuItem; DBEdit35: TDBEdit; N125: TMenuItem; EDI7: TMenuItem; N126: TMenuItem; EDI8: TMenuItem; Label110: TLabel; DBEdit36: TDBEdit; Label111: TLabel; DBEdit37: TDBEdit; Label112: TLabel; DBEdit40: TDBEdit; Label113: TLabel; RxDBLookupCombo44: TRxDBLookupCombo; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton5Click(Sender: TObject); procedure t_op_seaeBeforePost(DataSet: TDataSet); procedure FormShow(Sender: TObject); procedure t_op_seae_fenBeforePost(DataSet: TDataSet); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure wwDBComboBox2Change(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton33Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton32Click(Sender: TObject); procedure bsSkinButton36Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure t_op_seaeBeforeDelete(DataSet: TDataSet); procedure t_op_seae_fenBeforeDelete(DataSet: TDataSet); procedure bsSkinButton8Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure RxDBLookupCombo2Change(Sender: TObject); procedure RxDBLookupCombo3Change(Sender: TObject); procedure RxDBLookupCombo4Change(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo17Change(Sender: TObject); procedure RxDBLookupCombo18Change(Sender: TObject); procedure bsSkinButton26Click(Sender: TObject); procedure bsSkinButton25Click(Sender: TObject); procedure bsSkinButton24Click(Sender: TObject); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton21Click(Sender: TObject); procedure bsSkinButton22Click(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton18Click(Sender: TObject); procedure bsSkinButton19Click(Sender: TObject); procedure bsSkinButton20Click(Sender: TObject); procedure DBMemo40Change(Sender: TObject); procedure DBMemo41Change(Sender: TObject); procedure DBMemo42Change(Sender: TObject); procedure DBMemo41Exit(Sender: TObject); procedure DBMemo42Exit(Sender: TObject); procedure wwDBLookupCombo61Change(Sender: TObject); procedure bsSkinButton37Click(Sender: TObject); procedure DBEdit5Click(Sender: TObject); procedure wwDBLookupCombo52Change(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure N2Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure N24Click(Sender: TObject); procedure N22Click(Sender: TObject); procedure N27Click(Sender: TObject); procedure N29Click(Sender: TObject); procedure N9Click(Sender: TObject); procedure bsSkinButton34Click(Sender: TObject); procedure RxDBLookupCombo19Change(Sender: TObject); procedure RxDBLookupCombo11Change(Sender: TObject); procedure RxDBLookupCombo5Change(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure dxDBGrid1Column3CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure dxDBGrid2Column3CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure EXCEL1Click(Sender: TObject); procedure Panel2Resize(Sender: TObject); procedure DBEdit1KeyPress(Sender: TObject; var Key: Char); procedure DBEdit2KeyPress(Sender: TObject; var Key: Char); procedure DBEdit3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit4KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); procedure DBEdit8KeyPress(Sender: TObject; var Key: Char); procedure DBEdit9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit7KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo19KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo49KeyPress(Sender: TObject; var Key: Char); procedure DBEdit63KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker6KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); procedure DBEdit10KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char); procedure DBEdit11KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo21KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBoxBLKeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo15KeyPress(Sender: TObject; var Key: Char); procedure DBEdit26KeyPress(Sender: TObject; var Key: Char); procedure DBEdit27KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo9KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo10KeyPress(Sender: TObject; var Key: Char); procedure DBEdit5KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo14KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); procedure DBEdit80KeyPress(Sender: TObject; var Key: Char); procedure DBEdit81KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo61KeyPress(Sender: TObject; var Key: Char); procedure DBEdit82KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo4KeyPress(Sender: TObject; var Key: Char); procedure DBEdit12KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox1KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox2KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker5KeyPress(Sender: TObject; var Key: Char); procedure DBEdit13KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo23KeyPress(Sender: TObject; var Key: Char); procedure DBEdit17KeyPress(Sender: TObject; var Key: Char); procedure DBEdit15KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox7KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo24KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo25KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo27KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo26KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox12KeyPress(Sender: TObject; var Key: Char); procedure DBEdit71KeyPress(Sender: TObject; var Key: Char); procedure DBEdit73KeyPress(Sender: TObject; var Key: Char); procedure DBEdit109KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox11KeyPress(Sender: TObject; var Key: Char); procedure DBEdit114KeyPress(Sender: TObject; var Key: Char); procedure DBEdit112KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker4KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo28KeyPress(Sender: TObject; var Key: Char); procedure DBEdit25KeyPress(Sender: TObject; var Key: Char); procedure EDI1Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure DBEdit18KeyPress(Sender: TObject; var Key: Char); procedure DBEdit14KeyPress(Sender: TObject; var Key: Char); procedure DBEdit20KeyPress(Sender: TObject; var Key: Char); procedure DBEdit22KeyPress(Sender: TObject; var Key: Char); procedure t_op_seae_fenAfterInsert(DataSet: TDataSet); procedure DBEdit3Change(Sender: TObject); procedure DBEdit2Change(Sender: TObject); procedure wwDBLookupCombo46Enter(Sender: TObject); procedure wwDBLookupCombo47Enter(Sender: TObject); procedure wwDBLookupCombo48Enter(Sender: TObject); procedure RxDBLookupCombo2Enter(Sender: TObject); procedure RxDBLookupCombo3Enter(Sender: TObject); procedure RxDBLookupCombo4Enter(Sender: TObject); procedure wwDBLookupCombo46Change(Sender: TObject); procedure wwDBLookupCombo46Exit(Sender: TObject); procedure wwDBLookupCombo47Change(Sender: TObject); procedure wwDBLookupCombo48Change(Sender: TObject); procedure wwDBLookupCombo47Exit(Sender: TObject); procedure wwDBLookupCombo48Exit(Sender: TObject); procedure wwDBLookupCombo46KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo47KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo48KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo5KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo18KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo2Exit(Sender: TObject); procedure wwDBLookupCombo5Exit(Sender: TObject); procedure wwDBLookupCombo6Exit(Sender: TObject); procedure wwDBLookupCombo2Change(Sender: TObject); procedure wwDBLookupCombo5Change(Sender: TObject); procedure wwDBLookupCombo6Change(Sender: TObject); procedure RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo30KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo12Change(Sender: TObject); procedure RxDBLookupCombo14Change(Sender: TObject); procedure wwDBComboBox3KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox2KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox4KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox3KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox5KeyPress(Sender: TObject; var Key: Char); procedure N12Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure N17Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N37Click(Sender: TObject); procedure RxDBLookupCombo1Enter(Sender: TObject); procedure RxDBLookupCombo1Exit(Sender: TObject); procedure RxDBLookupCombo9Enter(Sender: TObject); procedure RxDBLookupCombo6Enter(Sender: TObject); procedure RxDBLookupCombo8Enter(Sender: TObject); procedure RxDBLookupCombo7Enter(Sender: TObject); procedure RxDBLookupCombo10Enter(Sender: TObject); procedure RxDBLookupCombo9Exit(Sender: TObject); procedure RxDBLookupCombo6Exit(Sender: TObject); procedure RxDBLookupCombo8Exit(Sender: TObject); procedure RxDBLookupCombo7Exit(Sender: TObject); procedure RxDBLookupCombo10Exit(Sender: TObject); procedure RxDBLookupCombo2Exit(Sender: TObject); procedure RxDBLookupCombo3Exit(Sender: TObject); procedure RxDBLookupCombo4Exit(Sender: TObject); procedure RxDBLookupCombo5Enter(Sender: TObject); procedure RxDBLookupCombo5Exit(Sender: TObject); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo17Enter(Sender: TObject); procedure RxDBLookupCombo18Enter(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure RxDBLookupCombo17Exit(Sender: TObject); procedure RxDBLookupCombo18Exit(Sender: TObject); procedure RxDBLookupCombo19Enter(Sender: TObject); procedure RxDBLookupCombo19Exit(Sender: TObject); procedure RxDBLookupCombo28Enter(Sender: TObject); procedure RxDBLookupCombo28Exit(Sender: TObject); procedure RxDBLookupCombo15Enter(Sender: TObject); procedure RxDBLookupCombo15Exit(Sender: TObject); procedure RxDBLookupCombo20Enter(Sender: TObject); procedure RxDBLookupCombo20Exit(Sender: TObject); procedure RxDBLookupCombo11Enter(Sender: TObject); procedure RxDBLookupCombo11Exit(Sender: TObject); procedure N40Click(Sender: TObject); procedure N42Click(Sender: TObject); procedure N44Click(Sender: TObject); procedure N46Click(Sender: TObject); procedure Label4Click(Sender: TObject); procedure Label23Click(Sender: TObject); procedure Label24Click(Sender: TObject); procedure Label29Click(Sender: TObject); procedure Label33Click(Sender: TObject); procedure Label12Click(Sender: TObject); procedure Label9Click(Sender: TObject); procedure Label11Click(Sender: TObject); procedure Label10Click(Sender: TObject); procedure Label8Click(Sender: TObject); procedure wwDBLookupCombo2DblClick(Sender: TObject); procedure Label125Click(Sender: TObject); procedure Label7Click(Sender: TObject); procedure Label35Click(Sender: TObject); procedure Label30Click(Sender: TObject); procedure Label73Click(Sender: TObject); procedure Label164Click(Sender: TObject); procedure wwDBLookupCombo61DblClick(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure N55Click(Sender: TObject); procedure N51Click(Sender: TObject); procedure N53Click(Sender: TObject); procedure RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo31Enter(Sender: TObject); procedure RxDBLookupCombo31Exit(Sender: TObject); procedure N58Click(Sender: TObject); procedure N60Click(Sender: TObject); procedure t_op_seae_huanhuoAfterInsert(DataSet: TDataSet); procedure N32Click(Sender: TObject); procedure N26Click(Sender: TObject); procedure bsSkinDBCheckRadioBox11KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox9KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox10KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo7Enter(Sender: TObject); procedure wwDBLookupCombo7Exit(Sender: TObject); procedure wwDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo5KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo7Change(Sender: TObject); procedure wwDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo8Change(Sender: TObject); procedure wwDBLookupCombo8Exit(Sender: TObject); procedure DBEdit16KeyPress(Sender: TObject; var Key: Char); procedure DBEdit21KeyPress(Sender: TObject; var Key: Char); procedure DBEdit6KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton35Click(Sender: TObject); procedure wwDBLookupCombo9KeyPress(Sender: TObject; var Key: Char); procedure DBEdit19KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker9KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo1Change(Sender: TObject); procedure N62Click(Sender: TObject); procedure N64Click(Sender: TObject); procedure dxDBGrid1Column2CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure dxDBGrid2Column2CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); procedure t_op_seaePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure N66Click(Sender: TObject); procedure t_op_seaeAfterPost(DataSet: TDataSet); procedure N68Click(Sender: TObject); procedure N70Click(Sender: TObject); procedure N72Click(Sender: TObject); procedure Notebook1PageChanged(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure wwDBDateTimePicker14KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo10KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker12KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker13KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker15KeyPress(Sender: TObject; var Key: Char); procedure N74Click(Sender: TObject); procedure t_op_seae_fenPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); procedure wwDBDateTimePicker2Change(Sender: TObject); procedure bsSkinButton38Click(Sender: TObject); procedure N76Click(Sender: TObject); procedure N78Click(Sender: TObject); procedure N80Click(Sender: TObject); procedure wwDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo11Change(Sender: TObject); procedure wwDBLookupCombo11Exit(Sender: TObject); procedure wwDBLookupCombo11DblClick(Sender: TObject); procedure t_op_seaeBeforeEdit(DataSet: TDataSet); procedure t_op_seae_fenBeforeEdit(DataSet: TDataSet); procedure t_op_seae_fenBeforeCancel(DataSet: TDataSet); procedure t_op_seaeBeforeCancel(DataSet: TDataSet); procedure RxDBLookupCombo32KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo33KeyPress(Sender: TObject; var Key: Char); procedure N82Click(Sender: TObject); procedure N84Click(Sender: TObject); procedure RxDBLookupCombo36Enter(Sender: TObject); procedure RxDBLookupCombo36Exit(Sender: TObject); procedure bsSkinButton39Click(Sender: TObject); procedure bsSkinButton42Click(Sender: TObject); procedure bsSkinButton40Click(Sender: TObject); procedure bsSkinButton41Click(Sender: TObject); procedure bsSkinButton43Click(Sender: TObject); procedure CMAEDI1Click(Sender: TObject); procedure Label92Click(Sender: TObject); procedure Label93Click(Sender: TObject); procedure Label56Click(Sender: TObject); procedure N88Click(Sender: TObject); procedure N87Click(Sender: TObject); procedure ANE1Click(Sender: TObject); procedure N97Click(Sender: TObject); procedure N99Click(Sender: TObject); procedure WORD1Click(Sender: TObject); procedure N102Click(Sender: TObject); procedure N104Click(Sender: TObject); procedure bsSkinPanel7MouseLeave(Sender: TObject); procedure bsSkinDBCheckRadioBox16Click(Sender: TObject); procedure bsSkinButton44Click(Sender: TObject); procedure DBEdit33KeyPress(Sender: TObject; var Key: Char); procedure bsSkinDBCheckRadioBox17Click(Sender: TObject); procedure bsSkinDBCheckRadioBox18Click(Sender: TObject); procedure bsSkinDBCheckRadioBox19Click(Sender: TObject); procedure wwDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); procedure DBLookupComboboxPORTDISCHARGEIDChange(Sender: TObject); procedure RxDBLookupCombo22Change(Sender: TObject); procedure RxDBLookupCombo21Change(Sender: TObject); procedure RxDBLookupCombo21KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo22KeyPress(Sender: TObject; var Key: Char); procedure EDI3Click(Sender: TObject); procedure bsSkinButton45Click(Sender: TObject); procedure N106Click(Sender: TObject); procedure RxDBLookupCombo40Enter(Sender: TObject); procedure RxDBLookupCombo40Exit(Sender: TObject); procedure bsSkinButton46Click(Sender: TObject); procedure bsSkinButton47Click(Sender: TObject); procedure bsSkinButton48Click(Sender: TObject); procedure bsSkinButton49Click(Sender: TObject); procedure bsSkinButton50Click(Sender: TObject); procedure bsSkinDBCheckRadioBox17Enter(Sender: TObject); procedure bsSkinDBCheckRadioBox16Enter(Sender: TObject); procedure bsSkinDBCheckRadioBox18Enter(Sender: TObject); procedure bsSkinDBCheckRadioBox19Enter(Sender: TObject); procedure bsSkinButton51Click(Sender: TObject); procedure bsSkinButton52Click(Sender: TObject); procedure bsSkinButton53Click(Sender: TObject); procedure bsSkinButton54Click(Sender: TObject); procedure bsSkinButton55Click(Sender: TObject); procedure wwDBComboBox8Enter(Sender: TObject); procedure wwDBComboBox8KeyPress(Sender: TObject; var Key: Char); procedure wwDBComboBox8Change(Sender: TObject); procedure EDI4Click(Sender: TObject); procedure wwDBLookupCombo12Change(Sender: TObject); procedure RxDBLookupCombo50Change(Sender: TObject); procedure NYKEDI1Click(Sender: TObject); procedure RxDBLookupCombo51Change(Sender: TObject); procedure wwDBLookupCombo13Change(Sender: TObject); procedure RxDBLookupCombo52Change(Sender: TObject); procedure wwDBLookupCombo14Change(Sender: TObject); procedure EDI5Click(Sender: TObject); procedure N111Click(Sender: TObject); procedure EDI6Click(Sender: TObject); procedure N115Click(Sender: TObject); procedure N117Click(Sender: TObject); procedure N119Click(Sender: TObject); procedure N121Click(Sender: TObject); procedure PILEDI1Click(Sender: TObject); procedure RxDBLookupCombo15Change(Sender: TObject); procedure bsSkinButton56Click(Sender: TObject); procedure bsSkinButton57Click(Sender: TObject); procedure bsSkinButton58Click(Sender: TObject); procedure bsSkinButton59Click(Sender: TObject); procedure btnMarksClick(Sender: TObject); procedure btnDescClick(Sender: TObject); procedure bsSkinButton60Click(Sender: TObject); procedure t_op_ctnAfterInsert(DataSet: TDataSet); procedure t_op_ctnAfterDelete(DataSet: TDataSet); procedure t_op_ctnBeforeDelete(DataSet: TDataSet); procedure t_op_ctnBeforeEdit(DataSet: TDataSet); procedure t_op_ctnBeforePost(DataSet: TDataSet); procedure wwDBLookupCombo17Change(Sender: TObject); procedure N124Click(Sender: TObject); procedure t_op_seaeAfterRefresh(DataSet: TDataSet); procedure DBEdit35Change(Sender: TObject); procedure EDI7Click(Sender: TObject); procedure EDI8Click(Sender: TObject); procedure DBMemo33Change(Sender: TObject); procedure DBMemo33Click(Sender: TObject); procedure DBMemo34Change(Sender: TObject); procedure DBMemo34Click(Sender: TObject); procedure DBMemo35Change(Sender: TObject); procedure DBMemo35Click(Sender: TObject); procedure DBMemo38Change(Sender: TObject); procedure DBMemo38Click(Sender: TObject); procedure DBMemo39Change(Sender: TObject); procedure DBMemo39Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_op_seae: Tfrm_op_seae; frm_op_seae_list_type:integer; frm_op_seae_create:boolean; implementation uses u_main,u_data_share, my_sys_function, u_op_seae_add, u_op_ctn, u_op_letter, u_op_add_ctn,u_op_seae_excel, u_ch_fee_se, u_op_seae_state, u_op_seae_assistant, u_op_seae_edi_yh, u_op_seae_vessel, u_sys_progress, u_op_seae_fenzhang, u_ch_fee_zhupiao, u_ch_piliang_seae, u_op_seae_huanhuo_do, u_op_seae_letter, u_op_date_change, my_sys_chat, u_op_seae_print_mul, u_op_seae_state_up, u_op_seae_edi_cma, u_code_package_edi, u_code_shiper_edi, u_code_edi_port, u_op_seae_hpadd, u_op_modify, u_op_salesmodify, u_op_seae_word, u_op_seae_edi_nor, u_op_data_copy, u_op_seae_vesselline, u_op_seae_edi_ym, u_op_seae_edi_nyk, u_op_seae_edi_cosco, u_op_delnote, u_op_seae_edi_wh, u_op_piliang_seae, u_op_seae_edi_PIL, u_op_seae_edi_JTB, u_op_seae_edi_custom_WaiDai, u_op_seae_edi_custom_ld; {$R *.dfm} procedure Tfrm_op_seae.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); savereggrid(dxdbgrid2,caption+'1'); t_code_edi_line.CLOSE; if assigned(frm_op_letter) then frm_op_letter.close; if assigned(frm_ch_fee_sea) then frm_ch_fee_sea.close; if assigned(frm_op_seae_state) then frm_op_seae_state.close; if assigned(frm_op_seae_assistant) then frm_op_seae_assistant.close; if assigned(frm_op_seae_fenzhang) then frm_op_seae_fenzhang.close; if assigned(frm_op_seae_letter) then frm_op_seae_letter.close; if assigned(frm_op_seae_state_up) then begin frm_op_seae_state_up.close; frm_op_seae_state_up.free; frm_op_seae_state_up:=nil; end; frm_op_seae.Hide; frm_op_seae.ManualFloat(frm_op_seae.BoundsRect ); frm_main.freeTabs('frm_op_seae'); frm_op_seae_create:=false; action:=cafree; frm_op_seae:=nil; end; procedure Tfrm_op_seae.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_seae.t_op_seaeBeforePost(DataSet: TDataSet); var aYear,amonth,aDay:Word; bYear,bmonth,bDay:Word; cntrStr:String; aQuery:TADOQuery; function GetCorpID(Corp:string):string; var aQuery:TADOQuery; begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; sql.Add('sELECT 代码 from t_crm_client where 客户简称='''+Corp+''''); Open; Result:=FieldByName('代码').AsString; end; finally FreeAndNil(aQuery); end; end; begin table_before_post(t_op_seae,'委托单位'); table_before_post(t_op_seae,'操作员'); table_before_post(t_op_seae,'揽货人'); table_before_post(t_op_seae,'客服员'); table_before_post(t_op_seae,'开船日期'); table_before_post(t_op_seae,'装运方式'); table_before_post(t_op_seae,'装货港'); table_before_post(t_op_seae,'卸货港'); table_before_post(t_op_seae,'业务来源'); //table_before_post(t_op_seae,'销售部门'); table_before_post(t_op_seae,'操作部门'); if t_op_seae2.DataSet.FieldByName('设置温度').Value<>t_op_seae2.DataSet.FieldByName('设置温度').OldValue then begin t_op_seae2.DataSet['最低温度']:=t_op_seae2.DataSet.FieldByName('设置温度').Value; t_op_seae2.DataSet['最高温度']:=t_op_seae2.DataSet.FieldByName('设置温度').Value; end; { if trim(t_op_seae2.DataSet.fieldbyname('装运方式').asstring)='整箱' then begin if CheckCtnTotalEquelDetail(t_op_seae) then begin showmessage('装箱明细不等于装箱总数,请核对'); // abort; end; end; } op_empty('t_op_seae',t_op_seae); if (Pos('RH',t_op_seae.fieldbyname('集装箱').asstring)>0) OR (Pos('RF',t_op_seae.fieldbyname('集装箱').asstring)>0) OR (Pos('DO',t_op_seae.fieldbyname('集装箱').asstring)>0) then begin //t_op_seae['货物标识']:='D'; if Trim(t_op_seae.fieldbyname('货物名称').asstring)='' then begin showmessage('冻柜货物名称必添!!'); abort; end; if Trim(t_op_seae.fieldbyname('货物描述').asstring)='' then begin showmessage('冻柜货物描述必添!!'); abort; end; end else if (Pos('GP',t_op_seae.fieldbyname('集装箱').asstring)>0) OR (Pos('HQ',t_op_seae.fieldbyname('集装箱').asstring)>0) then begin //t_op_seae['货物标识']:='S'; end; if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型1=D箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型1=D箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型1=C箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型1=C箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型1=F箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型1=F箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型1=X箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型1=X箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; {ljp with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if IsEmpty then begin if MessageDlg('输入的船期与航线船期不一致,是否保存?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin Abort; end; end; end; } end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型2=D箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型2=D箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型2=C箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型2=C箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型2=F箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型2=F箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型2=X箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型2=X箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; { ljp with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if IsEmpty then begin if MessageDlg('输入的船期与航线船期不一致,是否保存?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin Abort; end; end; end; } end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型3=D箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型3=D箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型3=C箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型3=C箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型3=F箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型3=F箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型3=X箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型3=X箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; { with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if IsEmpty then begin if MessageDlg('输入的船期与航线船期不一致,是否保存?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin Abort; end; end; end; } end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型4=D箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型4=D箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型4=C箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型4=C箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型4=F箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型4=F箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型4=X箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型4=X箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; { ljp with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if IsEmpty then begin if MessageDlg('输入的船期与航线船期不一致,是否保存?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin Abort; end; end; end; } end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型5=D箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型5=D箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型5=C箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型5=C箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型5=F箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型5=F箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型5=X箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型5=X箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin if Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring),t_op_seae.fieldbyname('集装箱').asstring)>0 then begin if (t_op_seae.FieldByName('已订舱').OldValue<>t_op_seae.FieldByName('已订舱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已订舱'] then aQuery2.SQL.Add('Update t_vessel_plan set D箱型6=D箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型6=D箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已出号').OldValue<>t_op_seae.FieldByName('已出号').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已出号'] then aQuery2.SQL.Add('Update t_vessel_plan set C箱型6=C箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型6=C箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已放箱').OldValue<>t_op_seae.FieldByName('已放箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已放箱'] then aQuery2.SQL.Add('Update t_vessel_plan set F箱型6=F箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型6=F箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('已背箱').OldValue<>t_op_seae.FieldByName('已背箱').Value) then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with Query1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if t_op_seae['已背箱'] then aQuery2.SQL.Add('Update t_vessel_plan set X箱型6=X箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型6=X箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if (t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value) or (t_op_seae.FieldByName('卸货代码').OldValue<>t_op_seae.FieldByName('卸货代码').Value) or (t_op_seae.FieldByName('货物名称').OldValue<>t_op_seae.FieldByName('货物名称').Value) or (t_op_seae.FieldByName('船公司').OldValue<>t_op_seae.FieldByName('船公司').Value) then begin with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_seae.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin cntrstr:=Query1.FieldByName('标准').AsString; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); if t_op_seae.FieldByName('货物名称').AsString<>'' then aQuery2.sql.add(' and 品名='''+Trim(t_op_seae.FieldByName('货物名称').AsString)+''''); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周'+getZweek(DayOfWeek(t_op_seae.FieldByName('开船日期').AsDateTime))+'=1'); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin aQuery2.Close; aQuery2.SQL.clear; aQuery2.sql.add('select * from v_price_detail '); aQuery2.sql.add(' WHERE 目的港代码='''+t_op_seae.FieldByName('卸货代码').AsString+''''); aQuery2.sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); aQuery2.sql.add(' and 年份='+formatDatetime('yyyy',t_op_seae['开船日期'])); aQuery2.sql.add(' and 周次='+IntToStr(WeekofYear(t_op_seae['开船日期']))); aQuery2.sql.add(' and (品名='''' or 品名 is null)'); aQuery2.sql.add(' and 周一=0 and 周二=0 and 周三=0 and 周四=0 and 周五=0 and 周六=0 and 周日=0 '); aQuery2.sql.add(' and 箱型='''+CntrStr+''''); aQuery2.Open; end; if aQuery2.IsEmpty then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end else begin if aQuery2['运价']<>Query1['单价'] then begin ShowMessage('系统已经引入系统费用,如要更改开船日期、卸货代码、货物名称、船公司信息请先删除系统费用!'); Abort; end; end; end; end; end; { ljp with Query1 do begin Close;SQL.Clear; SQL.Add('Select * from t_vessel_plan where 1=1'); sql.add(' and 船公司='''+GetCorpID(t_op_seae.FieldByName('船公司').AsString)+''''); sql.add(' and 船期='''+formatDatetime('yyyy-mm-dd',t_op_seae['开船日期'])+''''); Open; if IsEmpty then begin if MessageDlg('输入的船期与航线船期不一致,是否保存?',mtWarning,[mbYes,mbNo],0)<>mrYes then begin Abort; end; end; end; } end; end; // if t_op_seae.fieldbyname('截港日期').asstring<>''then begin if t_op_seae.fieldbyname('截港日期').asdatetime>t_op_seae.fieldbyname('开船日期').asdatetime then begin showmessage('截港日期不能大于开船日期!!'); abort; end; end; if t_op_seae.fieldbyname('预抵日期').asstring<>''then begin if t_op_seae.fieldbyname('预抵日期').asdatetime''then begin if t_op_seae.fieldbyname('二程开船日期').asdatetimet_op_seae.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_seae.FieldByName('委托单位').asstring,[])then begin if frm_data_share.t_crm_client_all.fieldbyname('客户状态').asstring='封存客户'then begin showmessage('当前业务委托单位已经封存,不能再进行业务合作,如需合作请进行恢复客户操作!'); abort; end; end; end; if t_op_seae.State=dsinsert then begin if t_op_seae.fieldbyname('业务编号').asstring=''then begin t_op_seae['业务编号']:=get_no(t_op_seae.fieldbyname('会计期间').AsDateTime,'SE'); if t_op_seae.fieldbyname('编号').asstring=''then t_op_seae['编号']:=get_id; t_op_seae['销售部门']:=GetDeptName(t_op_seae.fieldByName('揽货人').AsString); t_op_seae['操作部门']:=GetDeptName(t_op_seae.fieldByName('操作员').AsString); end; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae['分票编号']:=t_op_seae['编号']; t_op_seae['业务状态']:='接受委托'; t_op_seae['费用状态']:='录入状态'; end else begin if t_op_seae.FieldByName('装运方式').asstring='整箱' then begin table_before_post(t_op_seae,'集装箱'); end; end; t_op_seae['英文船期']:=date_eng(t_op_seae.fieldbyname('开船日期').AsDateTime); if strtobool(get_parameters_value(31,'false')) then begin if trim(t_op_seae.fieldbyname('主提单号').asstring)='' then begin t_op_seae['主提单标准']:=t_op_seae['编号']; end else begin t_op_seae['主提单标准']:=t_op_seae['主提单号']; end; end else begin t_op_seae['主提单标准']:=t_op_seae['编号']; end; if strtobool(get_parameters_value(32,'false')) then begin if trim(t_op_seae.fieldbyname('分提单号').asstring)='' then begin t_op_seae['分提单标准']:=t_op_seae['编号']; end else begin t_op_seae['分提单标准']:=t_op_seae['分提单号']; end; end else begin t_op_seae['分提单标准']:=t_op_seae['编号']; end; if strtobool(get_parameters_value(33,'false')) then begin if trim(t_op_seae.fieldbyname('委托编号').asstring)='' then begin t_op_seae['委托标准']:=t_op_seae['编号']; end else begin t_op_seae['委托标准']:=t_op_seae['委托编号']; end; end else begin t_op_seae['委托标准']:=t_op_seae['编号']; end; if strtobool(get_parameters_value(57,'false')) then begin if trim(t_op_seae.fieldbyname('核销单号').asstring)='' then begin t_op_seae['核销标准']:=t_op_seae['编号']; end else begin t_op_seae['核销标准']:=t_op_seae['核销单号']; end; end else begin t_op_seae['核销标准']:=t_op_seae['编号']; end; if strtobool(get_parameters_value(58,'false')) then begin if trim(t_op_seae.fieldbyname('报关单号').asstring)='' then begin t_op_seae['报关标准']:=t_op_seae['编号']; end else begin t_op_seae['报关标准']:=t_op_seae['报关单号']; end; end else begin t_op_seae['报关标准']:=t_op_seae['编号']; end; if strtobool(get_parameters_value(59,'false')) then begin if trim(t_op_seae.fieldbyname('报检单号').asstring)='' then begin t_op_seae['报检标准']:=t_op_seae['编号']; end else begin t_op_seae['报检标准']:=t_op_seae['报检单号']; end; end else begin t_op_seae['报检标准']:=t_op_seae['编号']; end; t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_seae2.DataSet.fieldbyname('编号').asstring; t_ch_fee.open; if (t_op_seae.fieldbyname('业务编号').asstring<>'') then begin if t_op_seae.FieldByName('开船日期').OldValue<>null then begin if t_op_seae.FieldByName('开船日期').OldValue<>t_op_seae.FieldByName('开船日期').Value then begin DecodeDate(t_op_seae.FieldByName('开船日期').OldValue,aYear,amonth,aDay); DecodeDate(t_op_seae.FieldByName('开船日期').Value,bYear,bmonth,bDay); t_op_modify.Open; t_op_modify.Insert; t_op_modify['更改日期']:=date; t_op_modify['编号']:=t_op_seae.fieldbyname('编号').asstring; t_op_modify['业务编号']:=t_op_seae.fieldbyname('业务编号').asstring; if ((aYear<>bYear) or (amonth<>bMonth)) and (not t_ch_fee.IsEmpty) then t_op_modify['跨月更改']:=1 else t_op_modify['跨月更改']:=0; t_op_modify['更改类型']:='船期更改'; t_op_modify['委托编号']:=t_op_seae.fieldbyname('委托编号').asstring; t_op_modify['委托单位']:=t_op_seae.fieldbyname('委托单位').asstring; t_op_modify['旧船名']:=t_op_seae.FieldByName('船名').OldValue; t_op_modify['旧航次']:=t_op_seae.FieldByName('航次').OldValue; t_op_modify['旧开船日期']:=t_op_seae.FieldByName('开船日期').OldValue; t_op_modify['操作']:=employee; t_op_modify['更改人IP']:=LocalIP; t_op_modify.Post; end; if t_op_seae.FieldByName('揽货人').OldValue<>t_op_seae.FieldByName('揽货人').Value then begin t_op_modify.Open; t_op_modify.Insert; t_op_modify['更改日期']:=date; t_op_modify['编号']:=t_op_seae.fieldbyname('编号').asstring; t_op_modify['更改类型']:='揽货人更改'; if (not t_ch_fee.IsEmpty) then t_op_modify['跨月更改']:=1 else t_op_modify['跨月更改']:=0; t_op_modify['业务编号']:=t_op_seae.fieldbyname('业务编号').asstring; t_op_modify['委托编号']:=t_op_seae.fieldbyname('委托编号').asstring; t_op_modify['委托单位']:=t_op_seae.fieldbyname('委托单位').asstring; t_op_modify['业务员']:=t_op_seae.fieldbyname('揽货人').asstring; t_op_modify['旧业务员']:=t_op_seae.fieldbyname('揽货人').oldvalue; t_op_modify['旧船名']:=t_op_seae.FieldByName('船名').OldValue; t_op_modify['旧航次']:=t_op_seae.FieldByName('航次').OldValue; t_op_modify['旧开船日期']:=t_op_seae.FieldByName('开船日期').OldValue; t_op_modify['操作']:=employee; t_op_modify['更改人IP']:=LocalIP; t_op_modify.Post; end; end; end; end; procedure Tfrm_op_seae.FormShow(Sender: TObject); var ExeFileName,Str:String; i:integer; begin ExeFileName:='\SoftWare\DongSheng\东胜物流信息管理系统\Grid'; 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:=35; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; frm_op_seae_list_type:=1; t_op_seae_fen.close; t_op_seae_huanhuo.close; t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select top 100 * from t_op_seae where 主编号=编号 and ' +'(录入人='+''''+employee+''''+' or 操作员='+''''+employee+'''' +' or 客服员='+''''+employee+''''+' or 报关操作='+''''+employee+''''+' or 航线操作='+''''+employee+'''' +' or 报检操作='+''''+employee+''''+')' +' order by 开船日期 DESC,船名,航次,主提单号'); { t_op_seae.SQL.Add('select top 100 * from t_op_seae where 主编号=编号 and ' +open_data('0001','揽货人','操作员','客服员','报关操作','报检操作') +' order by 开船日期 DESC,船名,航次,主提单号'); t_op_seae.SQL.SaveToFile('D:\1.txt'); } t_op_seae.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_op_seae_fen.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_op_seae_huanhuo.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_tiaokuan.open; t_op_ctn.Close; t_op_ctn.Parameters.ParamByName('编号').Value:=DBEdit35.Text; t_op_ctn.Open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_card1.t_op_card.DataSource:=t_op_seae2; fra_op_card1.t_op_card.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; loadreggrid(dxdbgrid1,true,caption); loadreggrid(dxdbgrid2,false,caption+'1'); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_op_seae.wwDBComboBox2Change(Sender); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_op_seae_create:=true; frm_data_share.t_sys_employee.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_ship.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_changzhan.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_truck.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_baoguan.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_weituo.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_daili.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_huodai.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_shiper.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_shouhuo.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_tongzhi.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_crm_client_other.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; if not frm_data_share.t_code_code.Active then frm_data_share.t_code_code.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_vessel.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_loaport.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_disport.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_items.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_free.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_signbill.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_goods.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_package.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_fee.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_currency.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_trade.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_card.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_source.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_edi_port.requery; t_code_edi_line.Open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_sys_progress.close; frm_sys_progress:=nil; try t_op_seae.DisableControls; for i:=0 to dxdbgrid1.ColumnCount-1 do begin dxdbgrid1.Columns[i].Sorted:=csNone; end; with TRegIniFile.Create do try RootKey:=HKEY_LOCAL_MACHINE; Str:=readString(ExeFileName,'Sort',''); if Str<>'' then t_op_seae.Sort:=str; finally Free; end; finally t_op_seae.First; t_op_seae.EnableControls; end; end; procedure Tfrm_op_seae.t_op_seae_fenBeforePost(DataSet: TDataSet); begin table_before_post(t_op_seae_fen,'委托单位'); table_before_post(t_op_seae_fen,'操作员'); table_before_post(t_op_seae_fen,'揽货人'); table_before_post(t_op_seae_fen,'客服员'); table_before_post(t_op_seae_fen,'开船日期'); table_before_post(t_op_seae_fen,'装货港'); table_before_post(t_op_seae_fen,'卸货港'); table_before_post(t_op_seae_fen,'业务来源'); table_before_post(t_op_seae_fen,'销售部门'); table_before_post(t_op_seae_fen,'操作部门'); op_empty('t_op_seae',t_op_seae_fen); if t_op_seae_fen.fieldbyname('截港日期').asstring<>''then begin if t_op_seae_fen.fieldbyname('截港日期').asdatetime>t_op_seae_fen.fieldbyname('开船日期').asdatetime then begin showmessage('截港日期不能大于开船日期!!'); abort; end; end; if t_op_seae_fen.fieldbyname('预抵日期').asstring<>''then begin if t_op_seae_fen.fieldbyname('预抵日期').asdatetime''then begin if t_op_seae_fen.fieldbyname('二程开船日期').asdatetimet_op_seae_fen.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_seae_fen.FieldByName('委托单位').asstring,[])then begin if frm_data_share.t_crm_client_all.fieldbyname('客户状态').asstring='封存客户'then begin showmessage('当前业务委托单位已经封存,不能再进行业务合作,如需合作请进行恢复客户操作!'); abort; end; end; end; if t_op_seae_fen.State=dsinsert then begin if t_op_seae_fen.fieldbyname('业务编号').asstring=''then begin t_op_seae_fen['业务编号']:=get_no(t_op_seae_fen.fieldbyname('会计期间').AsDateTime,'SE'); t_op_seae_fen['编号']:=get_id; end; t_op_seae_fen['主编号']:=t_op_seae['编号']; t_op_seae_fen['分票编号']:=t_op_seae_fen['编号']; t_op_seae_fen['业务状态']:='接受委托'; t_op_seae_fen['费用状态']:='录入状态'; end; t_op_seae_fen['英文船期']:=date_eng(t_op_seae_fen.fieldbyname('开船日期').AsDateTime); if strtobool(get_parameters_value(31,'false')) then begin if trim(t_op_seae_fen.fieldbyname('主提单号').asstring)='' then begin t_op_seae_fen['主提单标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['主提单标准']:=t_op_seae_fen['主提单号']; end; end else begin t_op_seae_fen['主提单标准']:=t_op_seae_fen['编号']; end; if strtobool(get_parameters_value(32,'false')) then begin if trim(t_op_seae_fen.fieldbyname('分提单号').asstring)='' then begin t_op_seae_fen['分提单标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['分提单标准']:=t_op_seae_fen['分提单号']; end; end else begin t_op_seae_fen['分提单标准']:=t_op_seae_fen['编号']; end; if strtobool(get_parameters_value(33,'false')) then begin if trim(t_op_seae_fen.fieldbyname('委托编号').asstring)='' then begin t_op_seae_fen['委托标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['委托标准']:=t_op_seae_fen['委托编号']; end; end else begin t_op_seae_fen['委托标准']:=t_op_seae_fen['编号']; end; if strtobool(get_parameters_value(57,'false')) then begin if trim(t_op_seae_fen.fieldbyname('核销单号').asstring)='' then begin t_op_seae_fen['核销标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['核销标准']:=t_op_seae_fen['核销单号']; end; end else begin t_op_seae_fen['核销标准']:=t_op_seae_fen['编号']; end; if strtobool(get_parameters_value(58,'false')) then begin if trim(t_op_seae_fen.fieldbyname('报关单号').asstring)='' then begin t_op_seae_fen['报关标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['报关标准']:=t_op_seae_fen['报关单号']; end; end else begin t_op_seae_fen['报关标准']:=t_op_seae_fen['编号']; end; if strtobool(get_parameters_value(59,'false')) then begin if trim(t_op_seae_fen.fieldbyname('报检单号').asstring)='' then begin t_op_seae_fen['报检标准']:=t_op_seae_fen['编号']; end else begin t_op_seae_fen['报检标准']:=t_op_seae_fen['报检单号']; end; end else begin t_op_seae_fen['报检标准']:=t_op_seae_fen['编号']; end; end; procedure Tfrm_op_seae.bsSkinButton7Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if not t_op_seae2.DataSet.Bof then t_op_seae2.DataSet.Prior; end; procedure Tfrm_op_seae.bsSkinButton6Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if not t_op_seae2.DataSet.eof then t_op_seae2.DataSet.next; end; procedure Tfrm_op_seae.wwDBComboBox2Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (wwDBComboBox2.text='拼箱主票') or (wwDBComboBox2.text='合票主票') then begin Label14.Caption:='分单列表'; DBMemo2.DataField:='分单列表'; bsSkinButton37.Visible:=true; wwDBLookupCombo11.Visible:=false; bsSkinPageControl2.Visible:=true; bsSkinButton12.Visible:=true; bsSkinButton14.Visible:=true; RxDBLookupCombo2.Visible:=false; RxDBLookupCombo3.Visible:=false; RxDBLookupCombo4.Visible:=false; RxDBLookupCombo5.Visible:=false; DBMemo33.Visible:=false; DBMemo34.Visible:=false; DBMemo35.Visible:=false; DBMemo1.Visible:=false; wwDBLookupCombo46.Visible:=false; wwDBLookupCombo47.Visible:=false; wwDBLookupCombo48.Visible:=false; wwDBLookupCombo7.Visible:=false; end else begin Label14.Caption:='附加条款'; DBMemo2.DataField:='附加条款'; bsSkinButton37.Visible:=false; wwDBLookupCombo11.Visible:=true; bsSkinPageControl2.Visible:=false; bsSkinButton12.Visible:=false; bsSkinButton14.Visible:=false; RxDBLookupCombo2.Visible:=true; RxDBLookupCombo3.Visible:=true; RxDBLookupCombo4.Visible:=true; RxDBLookupCombo5.Visible:=true; DBMemo33.Visible:=true; DBMemo34.Visible:=true; DBMemo35.Visible:=true; DBMemo1.Visible:=true; wwDBLookupCombo46.Visible:=true; wwDBLookupCombo47.Visible:=true; wwDBLookupCombo48.Visible:=true; wwDBLookupCombo7.Visible:=true; end; if (wwDBComboBox2.text='拼箱分票') or (wwDBComboBox2.text='拼箱单票') then bsSkinGroupBox9.Visible:=false else bsSkinGroupBox9.Visible:=True; end; procedure Tfrm_op_seae.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin bsSkinButton11.Caption:='返回列表'; Notebook1.PageIndex:=1; exit; end; if bsSkinButton11.Caption='返回列表' then begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_seae.post; end; if answer=mrNo then begin t_op_seae.cancel; end; if answer=mrCancel then begin exit; end; END; bsSkinButton11.Caption:='编辑修改'; Notebook1.PageIndex:=0; exit; end; if bsSkinButton11.Caption='返回主票' then begin if (t_op_seae_fen.State=dsinsert)or(t_op_seae_fen.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_seae_fen.post; end; if answer=mrNo then begin t_op_seae_fen.cancel; end; if answer=mrCancel then begin exit; end; END; bsSkinButton11.Caption:='返回列表'; try t_op_seae2.Enabled:=false; t_op_seae2.DataSet:=t_op_seae; finally t_op_seae2.Enabled:=true; end; Notebook1.PageIndex:=1; exit; end; end; procedure Tfrm_op_seae.bsSkinButton33Click(Sender: TObject); begin bsSkinButton11.Caption:='返回主票'; try t_op_seae2.Enabled:=false; t_op_seae2.DataSet:=t_op_seae_fen; finally t_op_seae2.Enabled:=true; end; end; procedure Tfrm_op_seae.bsSkinButton2Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; // showmessage('a'); if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.post; if (t_op_ctn.State=dsinsert)or(t_op_ctn.State=dsedit) then t_op_ctn.post; if (t_op_ams1.DataSet.State=dsinsert)or(t_op_ams1.DataSet.State=dsedit) then t_op_ams1.DataSet.post; end; procedure Tfrm_op_seae.bsSkinButton3Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.cancel; end; procedure Tfrm_op_seae.bsSkinButton4Click(Sender: TObject); var aQuery:TAdoQuery; function isDelete:Boolean; var aQuery:TAdoQuery; begin aQuery:=CreateAdoQuery; result:=false; try with aQuery do begin Close;SQL.Clear; SQL.Add('select 删除需经理审批 from t_sys_department where 部门名称=( select 部门名称 from t_sys_employee where 姓名='''+t_op_seae2.DataSet['揽货人']+''')'); open; if fieldbyname('删除需经理审批').AsBoolean then result:=true; end; finally FreeAndNil(aQuery); end; end; begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if not t_op_seae_huanhuo.IsEmpty then begin showmessage('对不起业务已经进行换货,不能删除!!'); exit; end; t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_seae2.DataSet.fieldbyname('编号').asstring; t_ch_fee.open; if not t_ch_fee.IsEmpty then begin showmessage('对不起业务存在费用信息,不能删除!!'); exit; end; if t_op_seae2.DataSet.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('对不起拼箱主票存在分票信息,不能删除!!'); exit; end; end; if t_op_seae2.DataSet.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('对不起合票主票存在分票信息,不能删除!!'); exit; end; end; if (t_op_seae2.dataset.fieldbyName('业务状态').AsString='批准删除') or (not isDelete) then begin if application.MessageBox('您确定要删除数据吗?','警告:',MB_OKCANCEL)=IDOK then t_op_seae2.DataSet.delete; end else begin if application.MessageBox('您确定要申请删除数据吗?','警告:',MB_OKCANCEL)=IDOK then begin frm_op_delnote:=Tfrm_op_delnote.Create(self); try frm_op_delnote.DataSource1.DataSet:=t_op_seae2.DataSet; aQuery:=CreateAdoQuery; try with aQuery do begin Close;sql.clear; sql.Add('delete from t_op_delnote where 编号='''+t_op_seae2.DataSet['编号']+''''); ExecSQL; end; finally freeandnil(aQuery); end; frm_op_delnote.t_op_delnote.open; frm_op_delnote.t_op_delnote.Insert; if frm_op_delnote.ShowModal=mrOk then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet.FieldByName('业务状态').AsString:='申请删除'; t_op_seae2.DataSet.post; end; finally FreeAndNil(frm_op_delnote); end; end; end; end; procedure Tfrm_op_seae.bsSkinButton32Click(Sender: TObject); begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; if (t_op_seae_fen.State=dsinsert)or(t_op_seae_fen.State=dsedit) then t_op_seae_fen.post; try frm_op_seae_add:=tfrm_op_seae_add.Create (self); frm_op_seae_add.data1.Enabled:=false; frm_op_seae_add.data1.DataSet:=t_op_seae_fen; frm_op_seae_add.data1.Enabled:=true; frm_op_seae_add.bsSkinCheckRadioBox3.Checked:=true; frm_op_seae_add.bsSkinCheckRadioBox1.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox2.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox3.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox4.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox5.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox6.Enabled:=false; frm_op_seae_add_num:=3; frm_op_seae_add.ShowModal; finally frm_op_seae_add.Free; end; end; procedure Tfrm_op_seae.bsSkinButton36Click(Sender: TObject); begin if (t_op_seae_fen.State=dsinsert)or(t_op_seae_fen.State=dsedit) then t_op_seae_fen.post; end; procedure Tfrm_op_seae.bsSkinButton1Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.post; try frm_op_seae_add:=tfrm_op_seae_add.Create (self); if t_op_seae2.DataSet=t_op_seae then begin frm_op_seae_add.data1.Enabled:=false; frm_op_seae_add.data1.DataSet:=t_op_seae; frm_op_seae_add.data1.Enabled:=true; frm_op_seae_add_num:=1; end else begin frm_op_seae_add.data1.Enabled:=false; frm_op_seae_add.data1.DataSet:=t_op_seae_fen; frm_op_seae_add.data1.Enabled:=true; frm_op_seae_add.bsSkinCheckRadioBox3.Checked:=true; frm_op_seae_add.bsSkinCheckRadioBox1.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox2.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox3.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox4.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox5.Enabled:=false; frm_op_seae_add.bsSkinCheckRadioBox6.Enabled:=false; frm_op_seae_add_num:=2; end; frm_op_seae_add.ShowModal; finally frm_op_seae_add.Free; if not frm_op_seae.bsSkinTabSheet1.Showing then frm_op_seae.bsSkinTabSheet1.Show; end; end; procedure Tfrm_op_seae.t_op_seaeBeforeDelete(DataSet: TDataSet); begin op_befor_post(t_op_seae,'0001'); delete_add(1,t_op_seae); end; procedure Tfrm_op_seae.t_op_seae_fenBeforeDelete(DataSet: TDataSet); begin op_befor_post(t_op_seae_fen,'0001'); delete_add(1,t_op_seae_fen); end; procedure Tfrm_op_seae.bsSkinButton8Click(Sender: TObject); var Pnt:Tpoint; begin if (t_op_seae2.DataSet.FieldByName('装运方式').asstring='拼箱分票') or (t_op_seae2.DataSet.FieldByName('装运方式').asstring='拼箱单票') or (t_op_seae2.DataSet.FieldByName('装运方式').asstring='合票单票') then begin N56.Visible:=true; N57.Visible:=true; end else begin N56.Visible:=false; N57.Visible:=false; end; Pnt:=bsSkinButton8.ClientToScreen(Point(0,bsSkinButton8.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seae.bsSkinButton9Click(Sender: TObject); var ablack:Boolean; begin if t_op_seae_fen.Active and (not t_op_seae_fen.IsEmpty) then begin ablack:=False; memtblrpt.LoadFromDataSet(t_op_seae_fen, [mtcpoStructure,mtcpoProperties,mtcpoFieldIndex]); memtblrpt.First; while not memtblrpt.Eof do begin if (memtblrpt.FieldByName('件数').AsInteger=0) or (memtblrpt.FieldByName('重量').AsFloat=0) or (memtblrpt.FieldByName('尺码').AsFloat=0) then begin ablack:=true; end; memtblrpt.Next; end; if ablack then begin memtblrpt.First; while not memtblrpt.Eof do begin memtblrpt.Edit; memtblrpt.FieldByName('件数').AsInteger:=0; memtblrpt.FieldByName('重量').AsFloat:=0.00; memtblrpt.FieldByName('尺码').AsFloat:=0.00; memtblrpt.Post; memtblrpt.Next; end; end; end; sys_print('海运出口单证',2,t_op_seae2,nil,nil,nil,t_op_seae_fen1,dsrmemtblrpt,nil,nil,nil,nil,nil); end; procedure Tfrm_op_seae.RxDBLookupCombo2Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo2.DisplayValue<>'' then t_op_seae2.DataSet['发货人代码']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo3Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo3.DisplayValue<>'' then t_op_seae2.DataSet['收货人代码']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo4Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo4.DisplayValue<>'' then t_op_seae2.DataSet['通知人代码']:=frm_data_share.t_crm_client_tongzhi.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo16Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo16.DisplayValue<>'' then t_op_seae2.DataSet['发货人代码']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo17Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo17.DisplayValue<>'' then t_op_seae2.DataSet['收货人代码']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo18Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit)then begin if RxDBLookupCombo17.DisplayValue<>'' then t_op_seae2.DataSet['通知人代码']:=frm_data_share.t_crm_client_tongzhi.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.bsSkinButton26Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'发货人代码'); end; procedure Tfrm_op_seae.bsSkinButton25Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'收货人代码'); end; procedure Tfrm_op_seae.bsSkinButton24Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'通知人代码'); end; procedure Tfrm_op_seae.bsSkinButton23Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'代理内容'); end; procedure Tfrm_op_seae.bsSkinButton21Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'唛头'); end; procedure Tfrm_op_seae.bsSkinButton22Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'箱号封号'); end; procedure Tfrm_op_seae.bsSkinButton16Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'货物描述'); end; procedure Tfrm_op_seae.bsSkinButton17Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,DBMemo2.DataField); end; procedure Tfrm_op_seae.bsSkinButton18Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'件数包装'); end; procedure Tfrm_op_seae.bsSkinButton19Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'货物重量'); end; procedure Tfrm_op_seae.bsSkinButton20Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'货物尺码'); end; procedure Tfrm_op_seae.DBMemo40Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin t_op_seae2.DataSet['件数']:=total_num(DBMemo40); t_op_seae2.DataSet['包装']:=total_package(dbmemo40); t_op_seae2.DataSet['件数大写'] :='SAY:'+ntoc(t_op_seae2.DataSet.FieldByName('件数').asfloat,true) +t_op_seae2.DataSet.FieldByName('包装').asstring+' ONLY.'; end; end; procedure Tfrm_op_seae.DBMemo41Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin t_op_seae2.DataSet['重量']:=total_num(DBMemo41); end; end; procedure Tfrm_op_seae.DBMemo42Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin t_op_seae2.DataSet['尺码']:=total_num(DBMemo42); end; end; procedure Tfrm_op_seae.DBMemo41Exit(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin kgs_cbm(DBMemo41,'KGS'); t_op_seae2.DataSet['货物重量']:=DBMemo41.text; end; end; procedure Tfrm_op_seae.DBMemo42Exit(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin kgs_cbm(DBMemo42,'CBM'); t_op_seae2.DataSet['货物尺码']:=DBMemo42.text; end; end; procedure Tfrm_op_seae.wwDBLookupCombo61Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin t_op_seae2.DataSet['件数大写'] :='SAY:'+ntoc(t_op_seae2.DataSet.FieldByName('件数').asfloat,true) +wwDBLookupCombo61.text+' ONLY.'; end; end; procedure Tfrm_op_seae.bsSkinButton37Click(Sender: TObject); var if_first:boolean; max,j:integer; begin if t_op_seae.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前拼箱主票业务已经完成,不能加入!!'); exit; end; if not t_op_seae_fen.IsEmpty then begin t_op_seae.Edit; t_op_seae_fen.First; if_first:=true; while not t_op_seae_fen.eof do begin if if_first then begin DBMemo2.text:=t_op_seae_fen.fieldbyname('主提单号').asstring; DBMemo39.text:=t_op_seae_fen.fieldbyname('货物描述').asstring; DBMemo40.text:=t_op_seae_fen.fieldbyname('件数包装').asstring; DBMemo41.text:=t_op_seae_fen.fieldbyname('货物重量').asstring; DBMemo42.text:=t_op_seae_fen.fieldbyname('货物尺码').asstring; if_first:=false; end else begin max:=DBMemo2.Lines.Count; if DBMemo39.Lines.Count>max then max:=DBMemo39.Lines.Count; if DBMemo40.Lines.Count>max then max:=DBMemo40.Lines.Count; if DBMemo41.Lines.Count>max then max:=DBMemo41.Lines.Count; if DBMemo42.Lines.Count>max then max:=DBMemo42.Lines.Count; if max=DBMemo2.Lines.Count then begin DBMemo2.Lines.Add(t_op_seae_fen.fieldbyname('主提单号').asstring); end else begin for j:=1 to (max-DBMemo2.Lines.Count) do begin DBMemo2.Lines.Add(' '); end; DBMemo2.Lines.Add(t_op_seae_fen.fieldbyname('主提单号').asstring); end; if max=DBMemo39.Lines.Count then begin DBMemo39.Lines.Add(t_op_seae_fen.fieldbyname('货物描述').asstring); end else begin for j:=1 to (max-DBMemo39.Lines.Count) do begin DBMemo39.Lines.Add(' '); end; DBMemo39.Lines.Add(t_op_seae_fen.fieldbyname('货物描述').asstring); end; if max=DBMemo40.Lines.Count then begin DBMemo40.Lines.Add(t_op_seae_fen.fieldbyname('件数包装').asstring); end else begin for j:=1 to (max-DBMemo40.Lines.Count) do begin DBMemo40.Lines.Add(' '); end; DBMemo40.Lines.Add(t_op_seae_fen.fieldbyname('件数包装').asstring); end; if max=DBMemo41.Lines.Count then begin DBMemo41.Lines.Add(t_op_seae_fen.fieldbyname('货物重量').asstring); end else begin for j:=1 to (max-DBMemo41.Lines.Count) do begin DBMemo41.Lines.Add(' '); end; DBMemo41.Lines.Add(t_op_seae_fen.fieldbyname('货物重量').asstring); end; if max=DBMemo42.Lines.Count then begin DBMemo42.Lines.Add(t_op_seae_fen.fieldbyname('货物尺码').asstring); end else begin for j:=1 to (max-DBMemo42.Lines.Count) do begin DBMemo42.Lines.Add(' '); end; DBMemo42.Lines.Add(t_op_seae_fen.fieldbyname('货物尺码').asstring); end; end; t_op_seae_fen.next; end; t_op_seae['包装']:='PACKAGES'; t_op_seae.post; end; end; procedure Tfrm_op_seae.DBEdit5Click(Sender: TObject); begin { if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)then t_op_seae2.DataSet.post; if t_op_seae2.DataSet.IsEmpty then exit; if (t_op_seae2.DataSet.fieldbyname('装运方式').asstring='拼箱分票') or (t_op_seae2.DataSet.fieldbyname('装运方式').asstring='拼箱单票')then exit; try frm_op_ctn:=tfrm_op_ctn.Create (self); frm_op_ctn.t_op_ctn.DataSource:=t_op_seae2; frm_op_ctn_type:=true; op_ctn_limited:='0001'; frm_op_ctn.ShowModal; finally frm_op_ctn.Free; end; } end; procedure Tfrm_op_seae.wwDBLookupCombo52Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin if frm_data_share.t_code_disport.Locate('英文名',wwDBLookupCombo52.text,[]) then begin // t_op_seae2.DataSet['卸货代码']:=frm_data_share.t_code_disport.FieldByName('英文名').AsString; t_op_seae2.DataSet['航线']:=frm_data_share.t_code_disport['航线']; end; end; end; procedure Tfrm_op_seae.bsSkinPageControl1Change(Sender: TObject); begin if frm_op_seae_create=false then exit; if bsSkinPageControl1.ActivePage=bsSkinTabSheet8 then begin if not t_op_ams.Active then t_op_ams.open; end else begin if t_op_ams.State in [dsedit,dsinsert] then t_op_ams.Post; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet3 then begin if not assigned(frm_op_letter) then begin frm_op_letter:=tfrm_op_letter.Create (self); frm_op_letter.t_op_letter.DataSource:=t_op_seae2; frm_op_letter.ManualDock(bsSkinTabSheet3,nil,alClient); frm_op_letter.show; end; exit; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet10 then begin if not assigned(frm_op_seae_letter) then begin frm_op_seae_letter:=tfrm_op_seae_letter.Create (self); frm_op_seae_letter.fra_op_letter_free1.op_type.Text:='海运出口'; frm_op_seae_letter.fra_op_letter_free1.t_op_letter.DataSource:=t_op_seae2; frm_op_seae_letter.fra_op_letter_free1.t_op_letter.open; frm_op_seae_letter.fra_op_letter_free1.t_op_letter_free_detail.open; frm_op_seae_letter.fra_op_letter_free1.t_op_hd.DataSource:=t_op_seae2; frm_op_seae_letter.fra_op_letter_free1.t_op_hd.open; frm_op_seae_letter.ManualDock(bsSkinTabSheet10,nil,alClient); frm_op_seae_letter.show; end; exit; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then begin if if_open('216') or if_open('217') then begin if not assigned(frm_ch_fee_sea) then begin frm_ch_fee_sea:=tfrm_ch_fee_sea.Create (self); frm_ch_fee_sea.ManualDock(bsSkinTabSheet2,nil,alClient); frm_ch_fee_sea.Show; end; end else begin showmessage('对不起,你无权操作费用!!'); end; exit; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet7 then begin if not assigned(frm_op_seae_state) then begin frm_op_seae_state:=tfrm_op_seae_state.Create (self); frm_op_seae_state.fra_op_state1.t_op_state.DataSource:=t_op_seae2; frm_op_seae_state.fra_op_state1.t_op_state.open; frm_op_seae_state.fra_op_state1.edit_state.Text:='1'; frm_op_seae_state.ManualDock(bsSkinTabSheet7,nil,alClient); frm_op_seae_state.show; end; exit; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet9 then begin if not assigned(frm_op_seae_fenzhang) then begin frm_op_seae_fenzhang:=tfrm_op_seae_fenzhang.Create (self); frm_op_seae_fenzhang.t_ch_fee_fenzhang.DataSource:=t_op_seae2; frm_op_seae_fenzhang.t_ch_fee_fenzhang.open; frm_op_seae_fenzhang.t_ch_fee.open; frm_op_seae_fenzhang.ManualDock(bsSkinTabSheet9,nil,alClient); frm_op_seae_fenzhang.show; end; exit; end; if bsSkinPageControl1.ActivePage=bsSkinTabSheet6 then begin if not assigned(frm_op_seae_assistant) then begin frm_op_seae_assistant:=tfrm_op_seae_assistant.Create (self); frm_op_seae_assistant.t_op_seae_assistant.DataSource:=t_op_seae2; frm_op_seae_assistant.ManualDock(bsSkinTabSheet6,nil,alClient); frm_op_seae_assistant.show; end; exit; end; end; procedure Tfrm_op_seae.N2Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='整箱' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前拼箱主票含有分票信息,不能更改为整箱!!'); exit; end; end; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为整箱!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='整箱'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N5Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='报关' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前拼箱主票含有分票信息,不能更改为报关!!'); exit; end; end; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为报关!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='报关'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N6Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='其他' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前拼箱主票含有分票信息,不能更改为其他!!'); exit; end; end; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为其他!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='其他'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N4Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票' then exit; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为其他!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='拼箱主票'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N24Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱分票' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前拼箱主票含有分票信息,不能更改为拼箱分票!!'); exit; end; end; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为其他!!'); exit; end; end; if t_op_seae.FieldByName('集装箱').asstring<>''then begin showmessage('此票业务存在集装箱信息不能更改为拼箱分票,如想更改请先将集装箱信息删除!!'); exit; end; t_op_seae.edit; t_op_seae['装运方式']:='拼箱分票'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N22Click(Sender: TObject); var i:Integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount<1 then begin showmessage('请选择要转换业务!!'); exit; end; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if t_op_seae.FieldByName('装运方式').asstring='拼箱单票' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前拼箱主票含有分票信息,不能更改为拼箱单票!!'); exit; end; end; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为其他!!'); exit; end; end; if t_op_seae.FieldByName('集装箱').asstring<>''then begin showmessage('此票业务存在集装箱信息不能更改为拼箱单票,如想更改请先将集装箱信息删除!!'); exit; end; t_op_seae.edit; t_op_seae['装运方式']:='拼箱单票'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; end; procedure Tfrm_op_seae.N27Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; t_op_seae_fen.edit; t_op_seae_fen['主编号']:=t_op_seae_fen['编号']; t_op_seae_fen['装运方式']:='拼箱单票'; t_op_seae_fen.post; t_op_seae_fen.Requery(); end; procedure Tfrm_op_seae.N29Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; t_op_seae_fen.edit; t_op_seae_fen['主编号']:=t_op_seae_fen['编号']; t_op_seae_fen.post; t_op_seae_fen.Requery(); end; procedure Tfrm_op_seae.N9Click(Sender: TObject); begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_add_ctn:=tfrm_op_add_ctn.Create (self); frm_op_add_ctn.ShowModal; finally frm_op_add_ctn.Free; end; end; procedure Tfrm_op_seae.bsSkinButton34Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton34.ClientToScreen(Point(0,bsSkinButton34.Height)); PopupMenu4.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seae.RxDBLookupCombo19Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if RxDBLookupCombo19.DisplayValue='' then exit; if trim(t_op_seae2.DataSet.fieldbyname('代理内容').asstring)=''then t_op_seae2.DataSet['代理内容']:=frm_data_share.t_crm_client_daili['快捷代码']; end; end; procedure Tfrm_op_seae.RxDBLookupCombo11Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if RxDBLookupCombo11.DisplayValue='' then exit; if trim(t_op_seae2.DataSet.fieldbyname('货物描述').asstring)=''then t_op_seae2.DataSet['货物描述']:=frm_data_share.t_code_goods['货物描述']; end; end; procedure Tfrm_op_seae.RxDBLookupCombo5Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if RxDBLookupCombo5.DisplayValue='' then exit; if trim(t_op_seae2.DataSet.fieldbyname('代理内容').asstring)=''then t_op_seae2.DataSet['代理内容']:=frm_data_share.t_crm_client_daili['快捷代码']; end; end; procedure Tfrm_op_seae.bsSkinButton10Click(Sender: TObject); begin query_seae(1,'0001'); end; procedure Tfrm_op_seae.dxDBGrid1Column3CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid1Column3.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae.dxDBGrid2Column3CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid2Column3.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_seae.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if frm_data_share.t_code_code.Active then frm_data_share.t_code_code.close; CanClose:=frm_close_query(t_op_ams); CanClose:=frm_close_query(t_op_seae); CanClose:=frm_close_query(t_op_seae_fen); CanClose:=frm_close_query(fra_op_card1.t_op_card); end; procedure Tfrm_op_seae.EXCEL1Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.post; try frm_op_seae_excel:=tfrm_op_seae_excel.Create (self); frm_op_seae_excel.ShowModal; finally frm_op_seae_excel.Free; end; end; procedure Tfrm_op_seae.Panel2Resize(Sender: TObject); var i:integer; begin i:=round(Panel2.Width/12); bsSkinButton7.Width:=i; bsSkinButton6.Width:=i; bsSkinButton9.Width:=i; bsSkinButton10.Width:=i; bsSkinButton1.Width:=i; bsSkinButton11.Width:=i; bsSkinButton8.Width:=i; bsSkinButton2.Width:=i; bsSkinButton4.Width:=i; bsSkinButton3.Width:=i; bsSkinButton38.Width:=i; bsSkinButton44.Left:=Panel2.Width-bsSkinButton44.Width-20; bsSkinButton13.Left:=bsSkinButton44.left-75; bsSkinButton15.left:=bsSkinButton13.Left-75; end; procedure Tfrm_op_seae.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit2); end; procedure Tfrm_op_seae.DBEdit2KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit3); end; procedure Tfrm_op_seae.DBEdit3KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit4); end; procedure Tfrm_op_seae.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit18); end; procedure Tfrm_op_seae.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo31); end; procedure Tfrm_op_seae.RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo13); end; procedure Tfrm_op_seae.RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo14); end; procedure Tfrm_op_seae.DBEdit8KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit9); end; procedure Tfrm_op_seae.DBEdit9KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit7); end; procedure Tfrm_op_seae.DBEdit7KeyPress(Sender: TObject; var Key: Char); begin if bsSkinPageControl2.Visible then key_RxDBLookupCombo(Key,RxDBLookupCombo16) else key_RxDBLookupCombo(Key,RxDBLookupCombo2); end; procedure Tfrm_op_seae.RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo46); end; procedure Tfrm_op_seae.RxDBLookupCombo19KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo8); end; procedure Tfrm_op_seae.wwDBLookupCombo49KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit63); end; procedure Tfrm_op_seae.DBEdit63KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker2); end; procedure Tfrm_op_seae.wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker6); end; procedure Tfrm_op_seae.wwDBDateTimePicker6KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo21); end; procedure Tfrm_op_seae.wwDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo22); // key_wwDBLookupCombo(Key,wwDBLookupCombo12); end; procedure Tfrm_op_seae.wwDBLookupCombo52KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit10); end; procedure Tfrm_op_seae.DBEdit10KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker3); end; procedure Tfrm_op_seae.wwDBDateTimePicker3KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit11); end; procedure Tfrm_op_seae.DBEdit11KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo21); end; procedure Tfrm_op_seae.RxDBLookupCombo20KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox8); end; procedure Tfrm_op_seae.wwDBLookupCombo21KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBoxBL); end; procedure Tfrm_op_seae.wwDBComboBoxBLKeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo28); end; procedure Tfrm_op_seae.RxDBLookupCombo15KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit26); end; procedure Tfrm_op_seae.DBEdit26KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit27); end; procedure Tfrm_op_seae.DBEdit27KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo20); end; procedure Tfrm_op_seae.RxDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo8); end; procedure Tfrm_op_seae.RxDBLookupCombo9KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo6); end; procedure Tfrm_op_seae.RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox2); end; procedure Tfrm_op_seae.RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo7); end; procedure Tfrm_op_seae.RxDBLookupCombo10KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo38); end; procedure Tfrm_op_seae.DBEdit5KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo37); end; procedure Tfrm_op_seae.RxDBLookupCombo14KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo43); end; procedure Tfrm_op_seae.RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo39); end; procedure Tfrm_op_seae.DBEdit80KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit81); end; procedure Tfrm_op_seae.DBEdit81KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo61); end; procedure Tfrm_op_seae.wwDBLookupCombo61KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit82); end; procedure Tfrm_op_seae.DBEdit82KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit83); end; procedure Tfrm_op_seae.wwDBLookupCombo4KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit12); end; procedure Tfrm_op_seae.DBEdit12KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker1); end; procedure Tfrm_op_seae.wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo1); end; procedure Tfrm_op_seae.wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo9); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo32); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox2KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo33); end; procedure Tfrm_op_seae.wwDBDateTimePicker5KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit13); end; procedure Tfrm_op_seae.DBEdit13KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo23); end; procedure Tfrm_op_seae.RxDBLookupCombo23KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit17); end; procedure Tfrm_op_seae.DBEdit17KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit15); end; procedure Tfrm_op_seae.DBEdit15KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit14); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker10); end; procedure Tfrm_op_seae.RxDBLookupCombo24KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo25); end; procedure Tfrm_op_seae.RxDBLookupCombo25KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo27); end; procedure Tfrm_op_seae.RxDBLookupCombo27KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo26); end; procedure Tfrm_op_seae.RxDBLookupCombo26KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox12); end; procedure Tfrm_op_seae.wwDBComboBox12KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit71); end; procedure Tfrm_op_seae.DBEdit71KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit73); end; procedure Tfrm_op_seae.DBEdit73KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit109); end; procedure Tfrm_op_seae.DBEdit109KeyPress(Sender: TObject; var Key: Char); begin key_wwDBComboBox(Key,wwDBComboBox11); end; procedure Tfrm_op_seae.wwDBComboBox11KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit114); end; procedure Tfrm_op_seae.DBEdit114KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit112); end; procedure Tfrm_op_seae.DBEdit112KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit111); end; procedure Tfrm_op_seae.wwDBDateTimePicker4KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo15); end; procedure Tfrm_op_seae.RxDBLookupCombo28KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit25); end; procedure Tfrm_op_seae.DBEdit25KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker4); end; procedure Tfrm_op_seae.EDI1Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_yh) then frm_op_seae_edi_yh:=tfrm_op_seae_edi_yh.Create(application); frm_op_seae_edi_yh.ShowModal; finally frm_op_seae_edi_yh.free; frm_op_seae_edi_yh:=nil; end; end; procedure Tfrm_op_seae.Button1Click(Sender: TObject); begin if t_op_seae2.DataSet.IsEmpty then exit; try frm_op_seae_vessel:=tfrm_op_seae_vessel.Create (self); frm_op_seae_vessel.v_vessel_voyage.open; frm_op_seae_vessel.wwIncrementalSearch1.Text:=wwDBLookupCombo49.text; op_seae_vessel_num:=1; frm_op_seae_vessel.ShowModal; finally frm_op_seae_vessel.Free; frm_op_seae_vessel:=nil; end; end; procedure Tfrm_op_seae.DBEdit18KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_op_seae.DBEdit14KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit20); end; procedure Tfrm_op_seae.DBEdit20KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit22); end; procedure Tfrm_op_seae.DBEdit22KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit21); end; procedure Tfrm_op_seae.t_op_seae_fenAfterInsert(DataSet: TDataSet); begin t_op_seae_fen['场站']:=t_op_seae['场站']; t_op_seae_fen['船名']:=t_op_seae['船名']; t_op_seae_fen['航次']:=t_op_seae['航次']; t_op_seae_fen['开船日期']:=t_op_seae['开船日期']; t_op_seae_fen['截港日期']:=t_op_seae['截港日期']; t_op_seae_fen['预抵日期']:=t_op_seae['预抵日期']; t_op_seae_fen['起运港']:=t_op_seae['起运港']; t_op_seae_fen['装货港']:=t_op_seae['装货港']; t_op_seae_fen['装港代码']:=t_op_seae['装港代码']; t_op_seae_fen['卸货港']:=t_op_seae['卸货港']; t_op_seae_fen['卸货代码']:=t_op_seae['卸货代码']; t_op_seae_fen['二程开船日期']:=t_op_seae['二程开船日期']; t_op_seae_fen['二程港口']:=t_op_seae['二程港口']; t_op_seae_fen['二程船名']:=t_op_seae['二程船名']; t_op_seae_fen['二程航次']:=t_op_seae['二程航次']; t_op_seae_fen['目的地']:=t_op_seae['目的地']; t_op_seae_fen['交货地点']:=t_op_seae['交货地点']; t_op_seae_fen['交货代码']:=t_op_seae['交货代码']; t_op_seae_fen['提单份数']:=t_op_seae['提单份数']; t_op_seae_fen['签单方式']:=t_op_seae['签单方式']; t_op_seae_fen['签单地点']:=t_op_seae['签单地点']; t_op_seae_fen['签单日期']:=t_op_seae['签单日期']; t_op_seae_fen['付费方式']:=t_op_seae['付费方式']; t_op_seae_fen['预付地点']:=t_op_seae['预付地点']; t_op_seae_fen['到付地点']:=t_op_seae['到付地点']; t_op_seae_fen['运输条款']:=t_op_seae['运输条款']; t_op_seae_fen['唛头']:=t_op_seae['唛头']; t_op_seae_fen['箱号封号']:=t_op_seae['箱号封号']; t_op_seae_fen['航线']:=t_op_seae['航线']; t_op_seae_fen['船公司']:=t_op_seae['船公司']; t_op_seae_fen['货代公司']:=t_op_seae['货代公司']; end; procedure Tfrm_op_seae.DBEdit3Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; DBEdit3.Color:=dxgrid_color_fee(DBEdit3.text); end; procedure Tfrm_op_seae.DBEdit2Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; DBEdit2.Color:=dxgrid_color('海运出口',DBEdit2.text); end; procedure Tfrm_op_seae.wwDBLookupCombo46Enter(Sender: TObject); begin with frm_data_share do begin t_code_code.Filtered:=false; t_code_code.Filter:='发货人=1'; t_code_code.Filtered:=true; end; end; procedure Tfrm_op_seae.wwDBLookupCombo47Enter(Sender: TObject); begin with frm_data_share do begin t_code_code.Filtered:=false; t_code_code.Filter:='收货人=1'; t_code_code.Filtered:=true; end; end; procedure Tfrm_op_seae.wwDBLookupCombo48Enter(Sender: TObject); begin with frm_data_share do begin t_code_code.Filtered:=false; t_code_code.Filter:='通知人=1'; t_code_code.Filtered:=true; end; end; procedure Tfrm_op_seae.RxDBLookupCombo2Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo2); end; procedure Tfrm_op_seae.RxDBLookupCombo3Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo3); end; procedure Tfrm_op_seae.RxDBLookupCombo4Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo4); end; procedure Tfrm_op_seae.wwDBLookupCombo46Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo46.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['发货人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo46Exit(Sender: TObject); begin wwDBLookupCombo46.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo47Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo47.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['收货人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo48Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo48.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['通知人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo47Exit(Sender: TObject); begin wwDBLookupCombo47.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo48Exit(Sender: TObject); begin wwDBLookupCombo48.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo46KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo33); end; procedure Tfrm_op_seae.wwDBLookupCombo47KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo34); end; procedure Tfrm_op_seae.wwDBLookupCombo48KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo35); end; procedure Tfrm_op_seae.RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo47); end; procedure Tfrm_op_seae.RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo48); end; procedure Tfrm_op_seae.wwDBLookupCombo2KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo3); end; procedure Tfrm_op_seae.wwDBLookupCombo5KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo4); end; procedure Tfrm_op_seae.wwDBLookupCombo6KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo5); end; procedure Tfrm_op_seae.RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo2); end; procedure Tfrm_op_seae.RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo5); end; procedure Tfrm_op_seae.RxDBLookupCombo18KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo6); end; procedure Tfrm_op_seae.wwDBLookupCombo2Exit(Sender: TObject); begin wwDBLookupCombo2.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo5Exit(Sender: TObject); begin wwDBLookupCombo5.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo6Exit(Sender: TObject); begin wwDBLookupCombo6.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo2Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo2.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['发货人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo5Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo5.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['收货人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo6Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo6.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['通知人代码']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo14); end; procedure Tfrm_op_seae.RxDBLookupCombo30KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo9); end; procedure Tfrm_op_seae.RxDBLookupCombo12Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if RxDBLookupCombo12.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo12.DisplayValue,[]) then t_op_seae2.DataSet['销售部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_seae.RxDBLookupCombo14Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if RxDBLookupCombo14.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo14.DisplayValue,[]) then t_op_seae2.DataSet['操作部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_seae.wwDBComboBox3KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo10); end; procedure Tfrm_op_seae.wwDBComboBox2KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo10); // key_wwDBComboBox(Key,wwDBComboBox3); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox4KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox9); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox3KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox5); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox5KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox4); end; procedure Tfrm_op_seae.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,1); end; procedure Tfrm_op_seae.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_seae.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_op_seae.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_op_seae.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_op_seae,'业务编号'); end; procedure Tfrm_op_seae.N17Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+')) ' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.bsSkinButton13Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_seae.N34Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.N36Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+'))) ' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.N37Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 主编号 in (select distinct 主编号 from t_op_seae where 编号 in (select distinct 编号 from t_op_state where 是否完成<>1)) ' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.RxDBLookupCombo1Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo1); end; procedure Tfrm_op_seae.RxDBLookupCombo1Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo1); end; procedure Tfrm_op_seae.RxDBLookupCombo9Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo9); end; procedure Tfrm_op_seae.RxDBLookupCombo6Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo6); end; procedure Tfrm_op_seae.RxDBLookupCombo8Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo8); end; procedure Tfrm_op_seae.RxDBLookupCombo7Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo7); end; procedure Tfrm_op_seae.RxDBLookupCombo10Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo10); end; procedure Tfrm_op_seae.RxDBLookupCombo9Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo9); end; procedure Tfrm_op_seae.RxDBLookupCombo6Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo6); end; procedure Tfrm_op_seae.RxDBLookupCombo8Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo8); end; procedure Tfrm_op_seae.RxDBLookupCombo7Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo7); end; procedure Tfrm_op_seae.RxDBLookupCombo10Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo10); end; procedure Tfrm_op_seae.RxDBLookupCombo2Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo2); end; procedure Tfrm_op_seae.RxDBLookupCombo3Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo3); end; procedure Tfrm_op_seae.RxDBLookupCombo4Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo4); end; procedure Tfrm_op_seae.RxDBLookupCombo5Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo5); end; procedure Tfrm_op_seae.RxDBLookupCombo5Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo5); end; procedure Tfrm_op_seae.RxDBLookupCombo16Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo16); end; procedure Tfrm_op_seae.RxDBLookupCombo17Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo17); end; procedure Tfrm_op_seae.RxDBLookupCombo18Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo18); end; procedure Tfrm_op_seae.RxDBLookupCombo16Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo16); end; procedure Tfrm_op_seae.RxDBLookupCombo17Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo17); end; procedure Tfrm_op_seae.RxDBLookupCombo18Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo18); end; procedure Tfrm_op_seae.RxDBLookupCombo19Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo19); end; procedure Tfrm_op_seae.RxDBLookupCombo19Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo19); end; procedure Tfrm_op_seae.RxDBLookupCombo28Enter(Sender: TObject); begin RxDBLookupCombo28.LookupDisplay:='代码;签单方式'; end; procedure Tfrm_op_seae.RxDBLookupCombo28Exit(Sender: TObject); begin RxDBLookupCombo28.LookupDisplay:='签单方式'; end; procedure Tfrm_op_seae.RxDBLookupCombo15Enter(Sender: TObject); begin RxDBLookupCombo15.LookupDisplay:='代码;付费方式'; end; procedure Tfrm_op_seae.RxDBLookupCombo15Exit(Sender: TObject); begin RxDBLookupCombo15.LookupDisplay:='付费方式'; end; procedure Tfrm_op_seae.RxDBLookupCombo20Enter(Sender: TObject); begin RxDBLookupCombo20.LookupDisplay:='航线代码;航线'; end; procedure Tfrm_op_seae.RxDBLookupCombo20Exit(Sender: TObject); begin RxDBLookupCombo20.LookupDisplay:='航线'; end; procedure Tfrm_op_seae.RxDBLookupCombo11Enter(Sender: TObject); begin RxDBLookupCombo11.LookupDisplay:='代码;货物名称'; end; procedure Tfrm_op_seae.RxDBLookupCombo11Exit(Sender: TObject); begin RxDBLookupCombo11.LookupDisplay:='货物名称'; end; procedure Tfrm_op_seae.N40Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; bsSkinTabSheet2.show; if if_open('216') or if_open('217') then begin if not assigned(frm_ch_fee_sea) then begin frm_ch_fee_sea:=tfrm_ch_fee_sea.Create (self); frm_ch_fee_sea.ManualDock(bsSkinTabSheet2,nil,alClient); frm_ch_fee_sea.Show; end; end else begin showmessage('对不起,你无权操作费用!!'); end; end; procedure Tfrm_op_seae.N42Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; bsSkinTabSheet7.show; if not assigned(frm_op_seae_state) then begin frm_op_seae_state:=tfrm_op_seae_state.Create (self); frm_op_seae_state.fra_op_state1.t_op_state.DataSource:=t_op_seae2; frm_op_seae_state.fra_op_state1.t_op_state.open; frm_op_seae_state.fra_op_state1.edit_state.Text:='1'; frm_op_seae_state.ManualDock(bsSkinTabSheet7,nil,alClient); frm_op_seae_state.show; end; end; procedure Tfrm_op_seae.N44Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; bsSkinTabSheet3.show; if not assigned(frm_op_letter) then begin frm_op_letter:=tfrm_op_letter.Create (self); frm_op_letter.t_op_letter.DataSource:=t_op_seae2; frm_op_letter.ManualDock(bsSkinTabSheet3,nil,alClient); frm_op_letter.show; end; end; procedure Tfrm_op_seae.N46Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; bsSkinTabSheet6.show; if not assigned(frm_op_seae_assistant) then begin frm_op_seae_assistant:=tfrm_op_seae_assistant.Create (self); frm_op_seae_assistant.t_op_seae_assistant.DataSource:=t_op_seae2; frm_op_seae_assistant.ManualDock(bsSkinTabSheet6,nil,alClient); frm_op_seae_assistant.show; end; end; procedure Tfrm_op_seae.Label4Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('委托单位').asstring,frm_data_share.t_crm_client_weituo); end; procedure Tfrm_op_seae.Label23Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('发货人').asstring,frm_data_share.t_crm_client_shiper); end; procedure Tfrm_op_seae.Label24Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('收货人').asstring,frm_data_share.t_crm_client_shouhuo); end; procedure Tfrm_op_seae.Label29Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('通知人').asstring,frm_data_share.t_crm_client_tongzhi); end; procedure Tfrm_op_seae.Label33Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('代理').asstring,frm_data_share.t_crm_client_daili); end; procedure Tfrm_op_seae.Label12Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('场站').asstring,frm_data_share.t_crm_client_changzhan); end; procedure Tfrm_op_seae.Label9Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('船公司').asstring,frm_data_share.t_crm_client_ship); end; procedure Tfrm_op_seae.Label11Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('货代公司').asstring,frm_data_share.t_crm_client_huodai); end; procedure Tfrm_op_seae.Label10Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('报关行').asstring,frm_data_share.t_crm_client_baoguan); end; procedure Tfrm_op_seae.Label8Click(Sender: TObject); begin client_view(t_op_seae2.DataSet.fieldbyname('承运车队').asstring,frm_data_share.t_crm_client_truck); end; procedure Tfrm_op_seae.wwDBLookupCombo2DblClick(Sender: TObject); begin open_code_edit('016'); end; procedure Tfrm_op_seae.Label125Click(Sender: TObject); begin open_code_edit('097'); end; procedure Tfrm_op_seae.Label7Click(Sender: TObject); begin open_code_edit('011'); end; procedure Tfrm_op_seae.Label35Click(Sender: TObject); begin open_code_edit('071'); end; procedure Tfrm_op_seae.Label30Click(Sender: TObject); begin open_code_edit('015'); end; procedure Tfrm_op_seae.Label73Click(Sender: TObject); begin open_code_edit('012'); end; procedure Tfrm_op_seae.Label164Click(Sender: TObject); begin open_code_edit('007'); end; procedure Tfrm_op_seae.wwDBLookupCombo61DblClick(Sender: TObject); begin open_code_edit('013'); end; procedure Tfrm_op_seae.bsSkinButton12Click(Sender: TObject); begin t_op_seae_fen.first; while not t_op_seae_fen.Eof do begin t_op_seae_fen.edit; t_op_seae_fen['箱号封号']:=t_op_seae['箱号封号']; t_op_seae_fen.post; t_op_seae_fen.next; end; end; procedure Tfrm_op_seae.bsSkinButton14Click(Sender: TObject); begin if not (if_open('216') or if_open('217')) then begin showmessage('对不起,你无权操作费用!!'); exit; end; if not assigned(frm_ch_fee_zhupiao) then frm_ch_fee_zhupiao:=tfrm_ch_fee_zhupiao.Create (self); frm_ch_fee_zhupiao.fra_fee_zhu1.fenpiao1.DataSet:=t_op_seae_fen; with frm_ch_fee_zhupiao do begin if if_open('216') then begin fra_fee_zhu1.t_ch_accept.close; fra_fee_zhu1.t_ch_accept.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_accept.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seae; fra_fee_zhu1.dxDBGrid1.FullExpand; fra_fee_zhu1.bsSkinPanel3.visible:=true; end else fra_fee_zhu1.bsSkinPanel3.visible:=false; if if_open('217') then begin fra_fee_zhu1.t_ch_pay.close; fra_fee_zhu1.t_ch_pay.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_pay.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_seae; fra_fee_zhu1.dxDBGrid2.FullExpand; fra_fee_zhu1.bsSkinPanel4.visible:=true; end else fra_fee_zhu1.bsSkinPanel4.visible:=false; if fra_fee_zhu1.bsSkinPanel3.visible and fra_fee_zhu1.bsSkinPanel4.visible then begin fra_fee_zhu1.t_op_gain.close; fra_fee_zhu1.t_op_gain.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_gain.open; fra_fee_zhu1.t_op_gain_fen.close; fra_fee_zhu1.t_op_gain_fen.Parameters[1].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_gain_fen.open; fra_fee_zhu1.t_op_pin_he.close; fra_fee_zhu1.t_op_pin_he.Parameters[0].value:=t_op_seae.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_pin_he.open; end else begin fra_fee_zhu1.t_op_gain.close; fra_fee_zhu1.t_op_gain_fen.close; fra_fee_zhu1.bsSkinTabSheet2.TabVisible:=false; end; fra_fee_zhu1.dxDBGrid3.FullExpand; end; frm_ch_fee_zhupiao.ShowModal; end; procedure Tfrm_op_seae.N55Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if if_open('216') and if_open('217') then begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_ch_piliang_seae:=tfrm_ch_piliang_seae.Create (self); t_op_seae.DisableControls; t_op_seae.first; while not t_op_seae.eof do begin if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; t_op_seae.next; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_ch_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_ch_piliang_seae.t_op_seae.open; frm_ch_piliang_seae.ShowModal; finally t_op_seae.EnableControls; frm_ch_piliang_seae.Free; frm_ch_piliang_seae:=nil; end; end else begin showmessage('你无权进行利润帐单批量打印!!'); end; end; procedure Tfrm_op_seae.N51Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if if_open('216') and if_open('217') then begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_ch_piliang_seae:=tfrm_ch_piliang_seae.Create (self); str:='select * from t_op_seae where 编号=' +''''+t_op_seae.fieldbyname('编号').AsString+''''; frm_ch_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_ch_piliang_seae.t_op_seae.open; frm_ch_piliang_seae.ShowModal; finally frm_ch_piliang_seae.Free; frm_ch_piliang_seae:=nil; end; end else begin showmessage('你无权进行利润帐单批量打印!!'); end; end; procedure Tfrm_op_seae.N53Click(Sender: TObject); var str:widestring; i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount<1 then begin showmessage('请选择要打印的业务帐单!!'); exit; end; if if_open('216') and if_open('217') then begin if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_ch_piliang_seae:=tfrm_ch_piliang_seae.Create (self); t_op_seae.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_ch_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_ch_piliang_seae.t_op_seae.open; frm_ch_piliang_seae.ShowModal; finally t_op_seae.EnableControls; frm_ch_piliang_seae.Free; frm_ch_piliang_seae:=nil; end; end else begin showmessage('你无权进行利润帐单批量打印!!'); end; end; procedure Tfrm_op_seae.RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit8); end; procedure Tfrm_op_seae.RxDBLookupCombo31Enter(Sender: TObject); begin RxDBLookupCombo31.LookupDisplay:='代码;业务来源'; end; procedure Tfrm_op_seae.RxDBLookupCombo31Exit(Sender: TObject); begin RxDBLookupCombo31.LookupDisplay:='业务来源'; end; procedure Tfrm_op_seae.N58Click(Sender: TObject); begin t_op_seae_huanhuo.DataSource:=t_op_seae2; t_op_seae_huanhuo.Requery(); if t_op_seae_huanhuo.IsEmpty then begin try frm_op_seae_huanhuo_do:=tfrm_op_seae_huanhuo_do.Create (self); t_op_seae_huanhuo.insert; frm_op_seae_huanhuo_do.ShowModal; finally frm_op_seae_huanhuo_do.Free; frm_op_seae_huanhuo_do:=nil; end; end else begin showmessage('此票业务已经确认换货!!'); end; end; procedure Tfrm_op_seae.N60Click(Sender: TObject); begin t_op_seae_huanhuo.DataSource:=t_op_seae2; t_op_seae_huanhuo.Requery(); if t_op_seae_huanhuo.IsEmpty then begin showmessage('此票业务还没有确认换货!!'); end else begin if application.MessageBox('您确定取消换货吗?','警告:',MB_OKCANCEL)=IDOK then t_op_seae_huanhuo.delete; end; end; procedure Tfrm_op_seae.t_op_seae_huanhuoAfterInsert(DataSet: TDataSet); begin t_op_seae_huanhuo['编号']:=t_op_seae_huanhuo.DataSource.DataSet['编号']; t_op_seae_huanhuo['换货客户']:=t_op_seae_huanhuo.DataSource.DataSet['委托单位']; t_op_seae_huanhuo['录入人']:=employee; t_op_seae_huanhuo['录入日期']:=date; end; procedure Tfrm_op_seae.N32Click(Sender: TObject); begin t_op_seae_huanhuo.DataSource:=t_op_seae_fen1; t_op_seae_huanhuo.Requery(); if t_op_seae_huanhuo.IsEmpty then begin try frm_op_seae_huanhuo_do:=tfrm_op_seae_huanhuo_do.Create (self); t_op_seae_huanhuo.insert; t_op_seae_huanhuo['换货客户']:=t_op_seae2.DataSet.fieldbyname('委托单位').asstring; frm_op_seae_huanhuo_do.ShowModal; finally frm_op_seae_huanhuo_do.Free; frm_op_seae_huanhuo_do:=nil; end; end else begin showmessage('此票业务已经确认换货!!'); end; end; procedure Tfrm_op_seae.N26Click(Sender: TObject); begin t_op_seae_huanhuo.DataSource:=t_op_seae_fen1; t_op_seae_huanhuo.Requery(); if t_op_seae_huanhuo.IsEmpty then begin showmessage('此票业务还没有确认换货!!'); end else begin if application.MessageBox('您确定取消换货吗?','警告:',MB_OKCANCEL)=IDOK then t_op_seae_huanhuo.delete; end; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox11KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker5); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox9KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox10); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox10KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox11); end; procedure Tfrm_op_seae.wwDBLookupCombo7Enter(Sender: TObject); begin with frm_data_share do begin t_code_code.Filtered:=false; t_code_code.Filter:='代理=1'; t_code_code.Filtered:=true; end; end; procedure Tfrm_op_seae.wwDBLookupCombo7Exit(Sender: TObject); begin wwDBLookupCombo7.Clear; end; procedure Tfrm_op_seae.wwDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo1); end; procedure Tfrm_op_seae.RxDBLookupCombo5KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo7); end; procedure Tfrm_op_seae.wwDBLookupCombo7Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo7.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['代理内容']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo6); end; procedure Tfrm_op_seae.wwDBLookupCombo8Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo8.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['代理内容']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo8Exit(Sender: TObject); begin wwDBLookupCombo8.Clear; end; procedure Tfrm_op_seae.DBEdit16KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox7); end; procedure Tfrm_op_seae.DBEdit21KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit6); end; procedure Tfrm_op_seae.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit16); end; procedure Tfrm_op_seae.bsSkinButton35Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('是否派车').asboolean then begin showmessage('业务已经派车!!'); exit; end; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('请求派车').asboolean then begin if application.MessageBox('业务已经请求派车,你要取消请求吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['请求派车']:=0; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要请求派车吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['请求派车']:=1; t_op_seae2.DataSet.post; { Send_invocie_check_shen('申请调度派车,业务编号:'+t_op_seae2.DataSet.fieldbyname('业务编号').AsString +',主提单号:'+t_op_seae2.DataSet.fieldbyname('主提单号').AsString,'161','37'); } end; end; end; procedure Tfrm_op_seae.wwDBLookupCombo9KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit19); end; procedure Tfrm_op_seae.DBEdit19KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker9); end; procedure Tfrm_op_seae.wwDBDateTimePicker9KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo10); end; procedure Tfrm_op_seae.RxDBLookupCombo1Change(Sender: TObject); var aQuery:TAdoQuery; begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.State=dsinsert then begin if frm_data_share.t_crm_client_weituo.Locate('客户简称',RxDBLookupCombo1.DisplayValues[1],[])then begin if frm_data_share.t_crm_client_weituo.fieldbyname('发货人').asboolean then begin t_op_seae2.DataSet['发货人']:=RxDBLookupCombo1.DisplayValues[1]; // t_op_seae2.DataSet['第三方付费']:=RxDBLookupCombo1.DisplayValues[1]; t_op_seae2.DataSet['发货人代码']:=frm_data_share.t_crm_client_weituo.fieldbyname('快捷代码').asstring; end; { if frm_data_share.t_crm_client_weituo.fieldbyname('揽货人').asstring<>''then begin t_op_seae2.DataSet['揽货人']:=frm_data_share.t_crm_client_weituo.fieldbyname('揽货人').asstring; RxDBLookupCombo12Change(Sender); end; } end; end; if frm_data_share.t_crm_client.Locate('客户简称',RxDBLookupCombo1.DisplayValues[1],[]) then if (Trim(frm_data_share.t_crm_client.FieldByName('客户性质').AsString)='其他') then exit; if t_op_seae2.DataSet.FieldByName('揽货人').asstring<>'' then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;sql.Clear; sql.Add('Select distinct 揽货人 from t_crm_client_sales where 客户简称='''+RxDBLookupCombo1.DisplayValues[1]+''' and 状态=''审核'' '); sql.add(' and 揽货人='''+t_op_seae2.DataSet.FieldByName('揽货人').asstring+''''); Open; if IsEmpty then begin t_op_seae2.DataSet.FieldByName('揽货人').asstring:=''; end else begin end; end; finally FreeAndNil(aQuery); end; end; end; procedure Tfrm_op_seae.N62Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+')' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.N64Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+')' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.dxDBGrid1Column2CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if ANode.Strings[dxDBGrid1Column2.Index]='申请删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else if ANode.Strings[dxDBGrid1Column2.Index]='批准删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else begin AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid1Column2.Index]); AFont.Color:=clblack; end; end; procedure Tfrm_op_seae.dxDBGrid2Column2CustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont; var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean); begin if ANode.Strings[dxDBGrid2Column2.Index]='申请删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else if ANode.Strings[dxDBGrid2Column2.Index]='批准删除' then begin AColor:=clBtnFace; AFont.Color:=clred; end else begin AColor:=dxgrid_color('海运出口',ANode.Strings[dxDBGrid2Column2.Index]); AFont.Color:=clblack; end; end; procedure Tfrm_op_seae.t_op_seaePostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); var str:widestring; begin if pos('SOME VALUES MAY HAVE BEEN CHANGED',UpperCase(E.Message))<>0 then begin showmessage('数据已经被其它用户修改,当前修改不能保存'+#13#10+'请刷新数据后重新录入'); abort; end; if pos('主提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 主提单标准='+''''+t_op_seae['主提单标准']+''''; double_seae(str,1); abort; end; if pos('分提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 分提单标准='+''''+t_op_seae['分提单标准']+''''; double_seae(str,2); abort; end; if pos('委托标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 委托标准='+''''+t_op_seae['委托标准']+''''; double_seae(str,3); abort; end; if pos('核销标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 核销标准='+''''+t_op_seae['核销标准']+''''; double_seae(str,4); abort; end; if pos('报关标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 报关标准='+''''+t_op_seae['报关标准']+''''; double_seae(str,5); abort; end; if pos('报检标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 报检标准='+''''+t_op_seae['报检标准']+''''; double_seae(str,6); abort; end; end; procedure Tfrm_op_seae.N66Click(Sender: TObject); begin if t_op_seae2.DataSet.IsEmpty then exit; if not do_data('0001',t_op_seae2.DataSet.FieldByName('录入人').asstring ,t_op_seae2.DataSet.FieldByName('操作员').asstring ,t_op_seae2.DataSet.FieldByName('揽货人').asstring ,t_op_seae2.DataSet.FieldByName('客服员').asstring ,t_op_seae2.DataSet.FieldByName('报关操作').asstring ,t_op_seae2.DataSet.FieldByName('报检操作').asstring) then begin showmessage('对不起你无权修改此数据!'); abort; end; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.post; try frm_op_date_change:=tfrm_op_date_change.Create (self); frm_op_date_change.DataSource1.Enabled:=false; frm_op_date_change.DataSource1.DataSet:=t_op_seae2.DataSet; frm_op_date_change.DataSource1.Enabled:=true; frm_op_date_change.ShowModal; finally frm_op_date_change.Free; frm_op_date_change:=nil; end; end; procedure Tfrm_op_seae.t_op_seaeAfterPost(DataSet: TDataSet); begin telll_sales; end; procedure Tfrm_op_seae.N68Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_seae_print_mul:=tfrm_op_seae_print_mul.Create (self); str:='select * from t_op_seae where 编号=' +''''+t_op_seae.fieldbyname('编号').AsString+''''; frm_op_seae_print_mul.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_seae_print_mul.t_op_seae.open; frm_op_seae_print_mul.ShowModal; finally frm_op_seae_print_mul.Free; frm_op_seae_print_mul:=nil; end; end; procedure Tfrm_op_seae.N70Click(Sender: TObject); var str:widestring; i:integer; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount<1 then begin showmessage('请选择要打印的业务!!'); exit; end; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_seae_print_mul:=tfrm_op_seae_print_mul.Create (self); t_op_seae.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_op_seae_print_mul.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_seae_print_mul.t_op_seae.open; frm_op_seae_print_mul.ShowModal; finally t_op_seae.EnableControls; frm_op_seae_print_mul.Free; frm_op_seae_print_mul:=nil; end; end; procedure Tfrm_op_seae.N72Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_seae_print_mul:=tfrm_op_seae_print_mul.Create (self); t_op_seae.DisableControls; t_op_seae.first; while not t_op_seae.eof do begin if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; t_op_seae.next; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_op_seae_print_mul.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_seae_print_mul.t_op_seae.open; frm_op_seae_print_mul.ShowModal; finally t_op_seae.EnableControls; frm_op_seae_print_mul.Free; frm_op_seae_print_mul:=nil; end; end; procedure Tfrm_op_seae.Notebook1PageChanged(Sender: TObject); begin if Notebook1.PageIndex<>0 then begin if assigned(frm_op_seae_state_up) then frm_op_seae_state_up.Hide; end; end; procedure Tfrm_op_seae.bsSkinButton15Click(Sender: TObject); begin if not assigned(frm_op_seae_state_up) then frm_op_seae_state_up:=tfrm_op_seae_state_up.Create (self); frm_op_seae_state_up.show; frm_op_seae_state_up.Left:=bsSkinButton15.left+Notebook1.left+2; frm_op_seae_state_up.top:=70+Notebook1.top; end; procedure Tfrm_op_seae.wwDBDateTimePicker14KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox1); end; procedure Tfrm_op_seae.wwDBLookupCombo10KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker12); end; procedure Tfrm_op_seae.wwDBDateTimePicker12KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker13); end; procedure Tfrm_op_seae.wwDBDateTimePicker13KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker15); end; procedure Tfrm_op_seae.wwDBDateTimePicker15KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker14); end; procedure Tfrm_op_seae.N74Click(Sender: TObject); begin update_grid_sort(dxdbgrid1,1); end; procedure Tfrm_op_seae.t_op_seae_fenPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); var str:widestring; begin if pos('SOME VALUES MAY HAVE BEEN CHANGED',UpperCase(E.Message))<>0 then begin showmessage('数据已经被其它用户修改,当前修改不能保存'+#13#10+'请刷新数据后重新录入'); abort; end; if pos('主提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 主提单标准='+''''+t_op_seae_fen['主提单标准']+''''; double_seae(str,1); abort; end; if pos('分提单标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 分提单标准='+''''+t_op_seae_fen['分提单标准']+''''; double_seae(str,2); abort; end; if pos('委托标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 委托标准='+''''+t_op_seae_fen['委托标准']+''''; double_seae(str,3); abort; end; if pos('核销标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 核销标准='+''''+t_op_seae_fen['核销标准']+''''; double_seae(str,4); abort; end; if pos('报关标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 报关标准='+''''+t_op_seae_fen['报关标准']+''''; double_seae(str,5); abort; end; if pos('报检标准',UpperCase(E.Message))<>0 then begin str:='select * from t_op_seae where 报检标准='+''''+t_op_seae_fen['报检标准']+''''; double_seae(str,6); abort; end; end; procedure Tfrm_op_seae.wwDBDateTimePicker2Change(Sender: TObject); var aQuery:TAdoQuery; begin if wwDBDateTimePicker2.DataSource.DataSet.FieldByName('费用状态').AsString='费用封帐' then begin wwDBDateTimePicker2.ReadOnly:=TRUE; exit; end; { aQuery:=CreateAdoQuery; try with aQuery do begin close;sql.clear; sql.add(''); open; end; finally freeandnil(aQuery) end; } if strtobool(get_parameters_value(28,'false'))then begin IF wwDBDateTimePicker2.DataSource.DataSet.IsEmpty THEN BEGIN wwDBDateTimePicker2.ReadOnly:=FALSE; EXIT; END; if wwDBDateTimePicker2.DataSource.DataSet.State=dsinsert then wwDBDateTimePicker2.ReadOnly:=FALSE else if not wwDBDateTimePicker2.DataSource.DataSet.fieldbyname('是否解锁').asboolean then begin if copy(wwDBDateTimePicker2.DataSource.DataSet.FieldByName('装运方式').AsString,1,4)<>'拼箱'then begin if (date-wwDBDateTimePicker2.DataSource.DataSet.fieldbyname('开船日期').asdatetime)>strtoint(get_parameters_value(29,'3')) then begin wwDBDateTimePicker2.ReadOnly:=TRUE; end ELSE wwDBDateTimePicker2.ReadOnly:=FALSE; end else begin if (date-wwDBDateTimePicker2.DataSource.DataSet.fieldbyname('开船日期').asdatetime)>strtoint(get_parameters_value(37,'3')) then begin wwDBDateTimePicker2.ReadOnly:=TRUE; end ELSE wwDBDateTimePicker2.ReadOnly:=FALSE; end; end else wwDBDateTimePicker2.ReadOnly:=FALSE; end; end; procedure Tfrm_op_seae.bsSkinButton38Click(Sender: TObject); var book1:Tbookmark; begin if t_op_seae2.DataSet=nil then exit; book1:=t_op_seae2.DataSet.GetBookmark; t_op_seae2.DataSet.Refresh; t_op_seae2.DataSet.GotoBookmark(book1); if bsSkinPageControl1.ActivePage=bsSkinTabSheet2 then begin if frm_ch_fee_sea<>nil then begin frm_ch_fee_sea.fra_fee1.getsumstr; end; end; end; procedure Tfrm_op_seae.N76Click(Sender: TObject); begin update_grid_view_no(dxdbgrid2); end; procedure Tfrm_op_seae.N78Click(Sender: TObject); begin update_grid_view_all(dxdbgrid2); end; procedure Tfrm_op_seae.N80Click(Sender: TObject); begin update_grid(dxdbgrid2,25); end; procedure Tfrm_op_seae.wwDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo2); end; procedure Tfrm_op_seae.wwDBLookupCombo11Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if frm_data_share.t_code_tiaokuan.locate('代码',wwDBLookupCombo11.text,[]) then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['附加条款']:=frm_data_share.t_code_tiaokuan.fieldbyname('附加条款').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo11Exit(Sender: TObject); begin wwDBLookupCombo11.TEXT:=''; end; procedure Tfrm_op_seae.wwDBLookupCombo11DblClick(Sender: TObject); begin open_code_edit('188'); end; procedure Tfrm_op_seae.t_op_seaeBeforeEdit(DataSet: TDataSet); begin op_befor_post(t_op_seae,'0001'); end; procedure Tfrm_op_seae.t_op_seae_fenBeforeEdit(DataSet: TDataSet); begin op_befor_post(t_op_seae_fen,'0001'); end; procedure Tfrm_op_seae.t_op_seae_fenBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_seae_fen); end; procedure Tfrm_op_seae.t_op_seaeBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_seae); end; procedure Tfrm_op_seae.RxDBLookupCombo32KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox2); end; procedure Tfrm_op_seae.RxDBLookupCombo33KeyPress(Sender: TObject; var Key: Char); begin key_bsSkinDBCheckRadioBox(Key,bsSkinDBCheckRadioBox3); end; procedure Tfrm_op_seae.N82Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 not in (select distinct 编号 from t_ch_fee)' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.N84Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+')' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.RxDBLookupCombo36Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo36); end; procedure Tfrm_op_seae.RxDBLookupCombo36Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo36); end; procedure Tfrm_op_seae.bsSkinButton39Click(Sender: TObject); begin t_op_seae_fen.first; while not t_op_seae_fen.Eof do begin t_op_seae_fen.edit; t_op_seae_fen['代理']:=t_op_seae['代理']; t_op_seae_fen['代理内容']:=t_op_seae['代理内容']; t_op_seae_fen.post; t_op_seae_fen.next; end; end; procedure Tfrm_op_seae.bsSkinButton42Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否寄单').asboolean then begin if application.MessageBox('业务已经寄单,你要取消寄单吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否寄单']:=0; t_op_seae2.DataSet['寄单日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要寄单吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否寄单']:=1; t_op_seae2.DataSet['寄单日期']:=date; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton40Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否退税').asboolean then begin if application.MessageBox('业务已经退税,你要取消退税吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否退税']:=0; t_op_seae2.DataSet['退税日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要退税吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否退税']:=1; t_op_seae2.DataSet['退税日期']:=date; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton41Click(Sender: TObject); begin if not if_open('160') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否签单').asboolean then begin if application.MessageBox('业务已经签单,你要取消签单吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否签单']:=0; t_op_seae2.DataSet['签单日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要签单吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否签单']:=1; t_op_seae2.DataSet['签单日期']:=date; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton43Click(Sender: TObject); begin if not if_open('161') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否派车').asboolean then begin if application.MessageBox('业务已经派车,你要取消派车吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否派车']:=0; t_op_seae2.DataSet['派车日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要派车吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否派车']:=1; t_op_seae2.DataSet['派车日期']:=date; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.CMAEDI1Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_cma) then frm_op_seae_edi_cma:=tfrm_op_seae_edi_cma.Create(application); frm_op_seae_edi_cma.ShowModal; finally frm_op_seae_edi_cma.free; frm_op_seae_edi_cma:=nil; end; end; procedure Tfrm_op_seae.Label92Click(Sender: TObject); begin try frm_code_package_edi:=tfrm_code_package_edi.Create (application); frm_code_package_edi.ShowModal; finally frm_code_package_edi.Free; frm_code_package_edi:=NIL; end; end; procedure Tfrm_op_seae.Label93Click(Sender: TObject); begin try frm_code_shiper_edi:=tfrm_code_shiper_edi.Create (application); frm_code_shiper_edi.ShowModal; finally frm_code_shiper_edi.Free; frm_code_shiper_edi:=NIL; end; end; procedure Tfrm_op_seae.Label56Click(Sender: TObject); begin if not if_open('179') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; try if not assigned(frm_code_edi_port) then frm_code_edi_port:=tfrm_code_edi_port.Create (self); frm_code_edi_port.ShowModal; finally frm_code_edi_port.free; frm_code_edi_port:=NIL; end; end; procedure Tfrm_op_seae.N88Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; t_op_seae_fen.edit; t_op_seae_fen['合票编号']:=t_op_seae_fen['编号']; t_op_seae_fen['拼箱类型']:='合票单票'; t_op_seae_fen.post; t_op_seae_fen.Requery(); end; procedure Tfrm_op_seae.N87Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; frm_op_seaehpadd:=Tfrm_op_seaehpadd.Create(Self); try frm_op_seaehpadd.showmodal; finally FreeAndNil(frm_op_seaehpadd); end; end; procedure Tfrm_op_seae.ANE1Click(Sender: TObject); var ExcelTemplet:Variant; i:Integer; sl:TStrings; s:String; begin if t_op_seae.IsEmpty then exit; if dxDBGrid1.SelectedCount<1 then begin showmessage('请选择要导出的业务!!'); exit; end; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; ExcelTemplet:= CreateOleObject('Excel.Application'); ExcelTemplet.Visible := true;//是否显示 ExcelTemplet.Workbooks.Open(ExtractFileDir(ParamStr(0))+'\ANE.xls'); ExcelTemplet.WorkSheets[1].Cells[3,4].value:=t_op_seae.FieldByName('船名').AsString; ExcelTemplet.WorkSheets[1].Cells[3,7].value:=t_op_seae.FieldByName('航次').AsString; ExcelTemplet.WorkSheets[1].Cells[3,14].value:=t_op_seae.FieldByName('开船日期').AsString; sl:=TStringList.Create; try for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); ExcelTemplet.WorkSheets[1].Cells[7+i,3].value:=t_op_seae.FieldByName('主提单号').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,4].value:=t_op_seae.FieldByName('装货港').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,4].value:=t_op_seae.FieldByName('装货港').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,4].value:=t_op_seae.FieldByName('装货港').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,4].value:=t_op_seae.FieldByName('装货港').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,4].value:=t_op_seae.FieldByName('装货港').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,11].value:=t_op_seae.FieldByName('件数').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,12].value:=t_op_seae.FieldByName('重量').AsString; ExcelTemplet.WorkSheets[1].Cells[7+i,13].value:=t_op_seae.FieldByName('尺码').AsString; sl.Assign(TMemoField(t_op_seae.FieldByName('货物描述'))); ExcelTemplet.WorkSheets[1].Cells[7+i,13].value:=sl.Strings[0]; sl.Assign(TMemoField(t_op_seae.FieldByName('辅助字段一'))); if sl.Count>=4 then begin s:=sl.Strings[0]; ExcelTemplet.WorkSheets[1].Cells[7+i,13].value:=t_op_seae.FieldByName('尺码').AsString; end; // ExcelTemplet.WorkSheets[1].Cells[7+i,3].value:=t_op_seae.FieldByName('主提单号').AsString; end; except Showmessage('请确认ANE.xls文件是否存在,或者其他错误;请重起再试。'); ExcelTemplet.DisplayAlerts := false;//是否提示存盘 ExcelTemplet.Quit;//如果出错则退出 end; end; procedure Tfrm_op_seae.N97Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱分票' then exit; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为合票主票!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='合票主票'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.N99Click(Sender: TObject); begin if t_op_seae.IsEmpty then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱主票' then exit; if t_op_seae.FieldByName('装运方式').asstring='拼箱分票' then exit; if t_op_seae.FieldByName('装运方式').asstring='合票主票'then begin if not t_op_seae_fen.IsEmpty then begin showmessage('当前合票主票含有分票信息,不能更改为合票分票!!'); exit; end; end; t_op_seae.edit; t_op_seae['装运方式']:='合票分票'; t_op_seae['主编号']:=t_op_seae['编号']; t_op_seae.post; end; procedure Tfrm_op_seae.WORD1Click(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if (t_op_seae2.DataSet.State=dsinsert)or(t_op_seae2.DataSet.State=dsedit) then t_op_seae2.DataSet.post; try frm_op_seae_word:=tfrm_op_seae_word.Create (self); frm_op_seae_word.ShowModal; finally frm_op_seae_word.Free; end; end; procedure Tfrm_op_seae.N102Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; t_op_seae_fen.edit; t_op_seae_fen['拼箱类型']:='合票主票'; t_op_seae_fen.post; t_op_seae_fen.Requery(); end; procedure Tfrm_op_seae.N104Click(Sender: TObject); begin if t_op_seae_fen.IsEmpty then exit; t_op_seae_fen.edit; t_op_seae_fen['拼箱类型']:='合票分票'; t_op_seae_fen.post; t_op_seae_fen.Requery(); end; procedure Tfrm_op_seae.bsSkinPanel7MouseLeave(Sender: TObject); begin bsSkinPanel7.Visible:=false; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox16Click(Sender: TObject); var aQuery1,aQuery2:TADOQuery; cntrstr:String; begin aQuery1:=CreateAdoQuery; aQuery2:=CreateAdoQuery; try if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型1=C箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型1=C箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型2=C箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型2=C箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型3=C箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型3=C箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型4=C箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型4=C箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型5=C箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型5=C箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox16.Checked then aQuery2.SQL.Add('Update t_vessel_plan set C箱型6=C箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set C箱型6=C箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; t_op_seae.Post; finally FreeAndNil(aQuery1); FreeAndNil(aQuery2); end; end; procedure Tfrm_op_seae.bsSkinButton44Click(Sender: TObject); begin // if DBEdit5.Text='' then Exit; bsSkinPanel7.Visible:=not bsSkinPanel7.Visible; end; procedure Tfrm_op_seae.DBEdit33KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo39); end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox17Click(Sender: TObject); var aQuery1,aQuery2:TADOQuery; cntrstr:string; begin aQuery1:=CreateAdoQuery; aQuery2:=CreateAdoQuery; // try if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); t_op_seae.Edit; with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型1=D箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型1=D箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型2=D箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型2=D箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型3=D箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型3=D箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型4=D箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型4=D箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型5=D箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型5=D箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox17.Checked then aQuery2.SQL.Add('Update t_vessel_plan set D箱型6=D箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set D箱型6=D箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; t_op_seae.Post; // finally FreeAndNil(aQuery1); FreeAndNil(aQuery2); // end; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox18Click(Sender: TObject); var aQuery1,aQuery2:TADOQuery; cntrstr:string; begin aQuery1:=CreateAdoQuery; aQuery2:=CreateAdoQuery; try if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); t_op_seae.Edit; with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型1=F箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型1=F箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型2=F箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型2=F箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型3=F箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型3=F箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型4=F箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型4=F箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型5=F箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型5=F箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox18.Checked then aQuery2.SQL.Add('Update t_vessel_plan set F箱型6=F箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set F箱型6=F箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; t_op_seae.Post; finally FreeAndNil(aQuery1); FreeAndNil(aQuery2); end; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox19Click(Sender: TObject); var aQuery1,aQuery2:TADOQuery; cntrstr:String; begin aQuery1:=CreateAdoQuery; aQuery2:=CreateAdoQuery; try if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); t_op_seae.Edit; with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型1=X箱型1+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型1=X箱型1-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型2=X箱型2+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型2=X箱型2-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型3=X箱型3+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型3=X箱型3-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型4=X箱型4+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型4=X箱型4-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型5=X箱型5+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型5=X箱型5-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; if trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring)<>'' then begin cntrstr:=frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring; CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]); with aQuery1 do begin Close;SQL.Clear; SQL.Add('select sum(数量) as 数量 from t_op_ctn where 编号='''+t_op_seae1.DataSet.fieldbyName('编号').AsString+''' and 表现形式='''+trim(cntrstr)+''''); Open; if (not IsEmpty) AND (FieldByName('数量').AsInteger>0) then begin aQuery2.Close; aQuery2.SQL.Clear; if bsSkinDBCheckRadioBox19.Checked then aQuery2.SQL.Add('Update t_vessel_plan set X箱型6=X箱型6+'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%''') else aQuery2.SQL.Add('Update t_vessel_plan set X箱型6=X箱型6-'+FieldByName('数量').AsString+' where 船公司='''+GetCorpID(t_op_seae1.DataSet.FieldByName('船公司').AsString)+''' and 船期='''+FormatDateTime('YYYY-MM-DD',t_op_seae1.DataSet.FieldByName('开船日期').Value)+''' and 船名='''+t_op_seae1.DataSet.FieldByName('船名').AsString+''' and 航次 like ''%'+t_op_seae1.DataSet.FieldByName('航次').AsString+'%'''); aQuery2.ExecSQL; end; end; end; t_op_seae.Post; finally FreeAndNil(aQuery1); FreeAndNil(aQuery2); end; end; procedure Tfrm_op_seae.wwDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); begin key_dbedit(Key,DBEdit10); end; procedure Tfrm_op_seae.DBLookupComboboxPORTDISCHARGEIDChange( Sender: TObject); begin { } end; procedure Tfrm_op_seae.RxDBLookupCombo22Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin if frm_data_share.t_code_disport.Locate('EDI代码',RxDBLookupCombo22.DisplayValues[0],[]) then begin t_op_seae2.DataSet['卸货港']:=frm_data_share.t_code_disport.FieldByName('英文名').AsString; t_op_seae2.DataSet['航线']:=frm_data_share.t_code_disport['航线']; end; end; end; procedure Tfrm_op_seae.RxDBLookupCombo21Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsedit)or(t_op_seae2.DataSet.state=dsinsert)then begin if frm_data_share.t_code_loaport.Locate('EDI代码',RxDBLookupCombo21.DisplayValues[0],[]) then begin t_op_seae2.DataSet['装货港']:=frm_data_share.t_code_loaport.FieldByName('英文名').AsString; end; end; end; procedure Tfrm_op_seae.RxDBLookupCombo21KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo3); end; procedure Tfrm_op_seae.RxDBLookupCombo22KeyPress(Sender: TObject; var Key: Char); begin key_wwDBLookupCombo(Key,wwDBLookupCombo52); end; procedure Tfrm_op_seae.EDI3Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_nor) then frm_op_seae_edi_nor:=tfrm_op_seae_edi_nor.Create(application); frm_op_seae_edi_nor.ShowModal; finally frm_op_seae_edi_nor.free; frm_op_seae_edi_nor:=nil; end; end; procedure Tfrm_op_seae.bsSkinButton45Click(Sender: TObject); begin frm_main.view_momo(t_op_seae2,'EDI备注'); end; procedure Tfrm_op_seae.N106Click(Sender: TObject); begin try frm_op_data_copy:=tfrm_op_data_copy.Create (self); frm_op_data_copy.DataSource1.Enabled:=false; frm_op_data_copy.DataSource1.DataSet:=t_op_seae2.DataSet; frm_op_data_copy.DataSource1.Enabled:=true; frm_op_data_copy.ShowModal; finally frm_op_data_copy.Free; frm_op_data_copy:=nil; end; end; procedure Tfrm_op_seae.RxDBLookupCombo40Enter(Sender: TObject); begin RxLookupComboEnter(RxDBLookupCombo40); end; procedure Tfrm_op_seae.RxDBLookupCombo40Exit(Sender: TObject); begin RxLookupComboExit(RxDBLookupCombo40); end; procedure Tfrm_op_seae.bsSkinButton46Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否商检换证').asboolean then begin if application.MessageBox('业务已经换证,你要取消换证吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否商检换证']:=0; t_op_seae2.DataSet['换证日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要换证吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否商检换证']:=1; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton47Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否客户入货').asboolean then begin if application.MessageBox('业务已经客户入货,你要取消客户入货吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否客户入货']:=0; t_op_seae2.DataSet['客户入货日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要客户入货吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否客户入货']:=1; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton48Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否出通关单').asboolean then begin if application.MessageBox('业务已经出证,你要取消出证吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否出通关单']:=0; t_op_seae2.DataSet['出证时间']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要出证吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否出通关单']:=1; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton49Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否客户派车').asboolean then begin if application.MessageBox('业务已经客户派车,你要取消客户派车吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否客户派车']:=0; t_op_seae2.DataSet['客户派车日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要客户派车吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否客户派车']:=1; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinButton50Click(Sender: TObject); begin if not if_open('159') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_op_seae2.DataSet=nil then exit; if t_op_seae2.DataSet.IsEmpty then exit; if t_op_seae2.DataSet.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('当前业务已经封帐!!'); exit; end; if t_op_seae2.DataSet.FieldByName('是否回货').asboolean then begin if application.MessageBox('业务已经回货,你要取消回货吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否回货']:=0; t_op_seae2.DataSet['回货日期']:=null; t_op_seae2.DataSet.post; end; end else begin if application.MessageBox('您确定要回货吗?','警告:',MB_OKCANCEL)=IDOK then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet['是否回货']:=1; t_op_seae2.DataSet.post; end; end; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox17Enter(Sender: TObject); begin t_op_seae.Edit; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox16Enter(Sender: TObject); begin t_op_seae.Edit; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox18Enter(Sender: TObject); begin t_op_seae.Edit; end; procedure Tfrm_op_seae.bsSkinDBCheckRadioBox19Enter(Sender: TObject); begin t_op_seae.Edit; end; procedure Tfrm_op_seae.bsSkinButton51Click(Sender: TObject); begin t_op_seae.Edit; if t_op_seae['已订舱'] then t_op_seae['已订舱']:=0 else t_op_seae['已订舱']:=1; t_op_seae.Post; end; procedure Tfrm_op_seae.bsSkinButton52Click(Sender: TObject); begin t_op_seae.Edit; if t_op_seae['已出号'] then t_op_seae['已出号']:=0 else t_op_seae['已出号']:=1; t_op_seae.Post; end; procedure Tfrm_op_seae.bsSkinButton53Click(Sender: TObject); begin t_op_seae.Edit; if t_op_seae['已放箱'] then t_op_seae['已放箱']:=0 else t_op_seae['已放箱']:=1; t_op_seae.Post; end; procedure Tfrm_op_seae.bsSkinButton54Click(Sender: TObject); begin t_op_seae.Edit; if t_op_seae['已背箱'] then t_op_seae['已背箱']:=0 else t_op_seae['已背箱']:=1; t_op_seae.Post; end; procedure Tfrm_op_seae.bsSkinButton55Click(Sender: TObject); begin if t_op_seae2.DataSet.IsEmpty then exit; try frm_op_seae_vesselline:=tfrm_op_seae_vesselline.Create (self); frm_op_seae_vesselline.GetDate:=t_op_seae['开船日期']; frm_op_seae_vesselline.ShowModal; finally frm_op_seae_vesselline.Free; frm_op_seae_vesselline:=nil; end; end; procedure Tfrm_op_seae.wwDBComboBox8Enter(Sender: TObject); var aQuery:TADOQuery; begin if wwDBComboBox8.DataSource.DataSet.FieldByName('费用状态').AsString='费用封帐' then begin wwDBComboBox8.ReadOnly:=TRUE; exit; end; wwDBComboBox8.Items.Clear; if t_op_seae2.DataSet.FieldByName('委托单位').IsNull or (t_op_seae2.DataSet.FieldByName('委托单位').AsString='') then begin showmessage('请先录入委托单位'); exit; end; if frm_data_share.t_crm_client.Locate('客户简称',t_op_seae2.DataSet.FieldByName('委托单位').AsString,[]) then begin if (Trim(frm_data_share.t_crm_client.FieldByName('客户性质').AsString)='其他') then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;sql.Clear; sql.Add('Select 姓名 from t_sys_employee '); Open; if not IsEmpty then begin first; while not eof do begin wwDBComboBox8.Items.Add(FieldByName('姓名').AsString); Next; end; end else begin end; end; finally FreeAndNil(aQuery); end; end else begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;sql.Clear; sql.Add('Select distinct 揽货人 from t_crm_client_sales where 客户简称='''+t_op_seae2.DataSet.FieldByName('委托单位').AsString+''' and 状态=''审核'' '); Open; if not IsEmpty then begin first; while not eof do begin wwDBComboBox8.Items.Add(FieldByName('揽货人').AsString); Next; end; end else begin MessageDlg('此委托单位未输入结费账期,请先录入相应揽货人的结费账期!',mtWarning,[mbOk],0); exit; end; end; finally FreeAndNil(aQuery); end; end; end; end; procedure Tfrm_op_seae.wwDBComboBox8KeyPress(Sender: TObject; var Key: Char); begin if key<>#13 then key:=#0; key_RxDBLookupCombo(Key,RxDBLookupCombo13); end; procedure Tfrm_op_seae.wwDBComboBox8Change(Sender: TObject); begin if t_op_seae2.DataSet=nil then exit; if (t_op_seae2.DataSet.state=dsinsert)or(t_op_seae2.DataSet.state=dsedit)then begin if wwDBComboBox8.text='' then exit; if frm_data_share.t_sys_employee.locate('姓名',wwDBComboBox8.text,[]) then t_op_seae2.DataSet['销售部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_seae.EDI4Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_ym) then frm_op_seae_edi_ym:=tfrm_op_seae_edi_ym.Create(application); frm_op_seae_edi_ym.ShowModal; finally frm_op_seae_edi_ym.free; frm_op_seae_edi_ym:=nil; end; end; procedure Tfrm_op_seae.wwDBLookupCombo12Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo12.text,[]) then begin t_op_ams1.DataSet.edit; t_op_ams1.DataSet['AMS发货人']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo50Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if (t_op_ams1.DataSet.State=dsinsert)or(t_op_ams1.DataSet.State=dsedit)then begin if RxDBLookupCombo50.DisplayValue<>'' then t_op_ams1.DataSet['AMS发货人']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.NYKEDI1Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_nyk) then frm_op_seae_edi_nyk:=tfrm_op_seae_edi_nyk.Create(application); frm_op_seae_edi_nyk.ShowModal; finally frm_op_seae_edi_nyk.free; frm_op_seae_edi_nyk:=nil; end; end; procedure Tfrm_op_seae.RxDBLookupCombo51Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if (t_op_ams1.DataSet.State=dsinsert)or(t_op_ams1.DataSet.State=dsedit)then begin if RxDBLookupCombo51.DisplayValue<>'' then t_op_ams1.DataSet['AMS收货人']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo13Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo13.text,[]) then begin t_op_ams1.DataSet.edit; t_op_ams1.DataSet['AMS收货人']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.RxDBLookupCombo52Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if (t_op_ams1.DataSet.State=dsinsert)or(t_op_ams1.DataSet.State=dsedit)then begin if RxDBLookupCombo52.DisplayValue<>'' then t_op_ams1.DataSet['AMS通知人']:=frm_data_share.t_crm_client_tongzhi.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_seae.wwDBLookupCombo14Change(Sender: TObject); begin if t_op_ams1.DataSet=nil then exit; if frm_data_share.t_code_code.locate('代码',wwDBLookupCombo14.text,[]) then begin t_op_ams1.DataSet.edit; t_op_ams1.DataSet['AMS通知人']:=frm_data_share.t_code_code.fieldbyname('内容').asstring; end; end; procedure Tfrm_op_seae.EDI5Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_COSCO) then frm_op_seae_edi_COSCO:=tfrm_op_seae_edi_COSCO.Create(application); frm_op_seae_edi_COSCO.ShowModal; finally frm_op_seae_edi_COSCO.free; frm_op_seae_edi_COSCO:=nil; end; end; procedure Tfrm_op_seae.N111Click(Sender: TObject); var aQuery:TAdoQuery; begin if t_op_seae2.DataSet.FieldByName('业务状态').AsString='申请删除' then begin t_op_seae2.DataSet.edit; t_op_seae2.DataSet.FieldByName('业务状态').AsString:='接受委托'; t_op_seae2.DataSet.post; aQuery:=CreateAdoQuery; try with aQuery do begin close;sql.Clear; sql.Add('delete from t_op_delnote where 编号='''+t_op_seae2.DataSet.Fieldbyname('编号').AsString+''''); ExecSQL; end; finally FreeAndNil(aQuery); end; end; end; procedure Tfrm_op_seae.EDI6Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_wh) then frm_op_seae_edi_wh:=tfrm_op_seae_edi_wh.Create(application); frm_op_seae_edi_wh.ShowModal; finally frm_op_seae_edi_wh.free; frm_op_seae_edi_wh:=nil; end; end; procedure Tfrm_op_seae.N115Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if not if_open('269') then begin showmessage('你无权批量修改!'); exit; end; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_piliang_seae:=tfrm_op_piliang_seae.Create (self); str:='select * from t_op_seae where 编号=' +''''+t_op_seae.fieldbyname('编号').AsString+''''; frm_op_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_piliang_seae.t_op_seae.open; frm_op_piliang_seae.t_op.DataSet:=t_op_seae; frm_op_piliang_seae.ShowModal; finally frm_op_piliang_seae.Free; frm_op_piliang_seae:=nil; end; end; procedure Tfrm_op_seae.N117Click(Sender: TObject); var str:widestring; i:integer; begin if t_op_seae.IsEmpty then exit; if not if_open('269') then begin showmessage('你无权批量修改!'); exit; end; if dxDBGrid1.SelectedCount<1 then begin showmessage('请选择要修改的业务!!'); exit; end; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_piliang_seae:=tfrm_op_piliang_seae.Create (self); t_op_seae.DisableControls; for i:=0 to dxDBGrid1.SelectedCount-1 do begin t_op_seae.GotoBookmark(pointer(dxDBGrid1.selectedrows[i])); if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_op_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_piliang_seae.t_op_seae.open; frm_op_piliang_seae.t_op.DataSet:=t_op_seae; frm_op_piliang_seae.ShowModal; finally t_op_seae.EnableControls; frm_op_piliang_seae.Free; frm_op_piliang_seae:=nil; end; end; procedure Tfrm_op_seae.N119Click(Sender: TObject); var str:widestring; begin if t_op_seae.IsEmpty then exit; if not if_open('269') then begin showmessage('你无权批量修改!'); exit; end; if (t_op_seae.State=dsinsert)or(t_op_seae.State=dsedit) then t_op_seae.post; try frm_op_piliang_seae:=tfrm_op_piliang_seae.Create (self); t_op_seae.DisableControls; t_op_seae.first; while not t_op_seae.eof do begin if str='' then str:=''''+t_op_seae.fieldbyname('编号').AsString+'''' else str:=str+','+''''+t_op_seae.fieldbyname('编号').AsString+''''; t_op_seae.next; end; str:='('+str+')'; str:='select * from t_op_seae where 编号 in '+str+default_sort(53,'t_op_seae','','desc'); frm_op_piliang_seae.t_op_seae.Parameters.ParamByName('SQLStr').value:=str; frm_op_piliang_seae.t_op_seae.open; frm_op_piliang_seae.t_op.DataSet:=t_op_seae; frm_op_piliang_seae.ShowModal; finally t_op_seae.EnableControls; frm_op_piliang_seae.Free; frm_op_piliang_seae:=nil; end; end; procedure Tfrm_op_seae.N121Click(Sender: TObject); begin t_op_seae.Close; t_op_seae.SQL.clear; t_op_seae.SQL.Add('select * from t_op_seae where 主编号=编号 and ' +open_data('0001','录入人','操作员','客服员','报关操作','报检操作') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 主编号 in (select distinct 编号 from t_ch_fee where 类型=''付'' and 费用名称=''佣金'' and 费用状态<>'+''''+'结算完毕'+''''+')' +default_sort(53,'t_op_seae','','desc')); t_op_seae.open; end; procedure Tfrm_op_seae.PILEDI1Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_PIL) then frm_op_seae_edi_PIL:=tfrm_op_seae_edi_PIL.Create(application); frm_op_seae_edi_PIL.ShowModal; finally frm_op_seae_edi_PIL.free; frm_op_seae_edi_PIL:=nil; end; end; procedure Tfrm_op_seae.RxDBLookupCombo15Change(Sender: TObject); begin if Pos('PREPAID',t_op_seae2.DataSet.fieldbyname('付费方式').asstring)>0 then begin DBEdit26.Text:='QINGDAO CHINA'; DBEdit27.Text:=''; end else begin DBEdit26.Text:=''; DBEdit27.Text:=wwDBLookupCombo52.Value; end; end; procedure Tfrm_op_seae.bsSkinButton56Click(Sender: TObject); begin t_op_ctn.insert; end; procedure Tfrm_op_seae.bsSkinButton57Click(Sender: TObject); begin table_post(t_op_ctn); end; procedure Tfrm_op_seae.bsSkinButton58Click(Sender: TObject); begin table_delete(t_op_ctn); end; procedure Tfrm_op_seae.bsSkinButton59Click(Sender: TObject); begin table_cancel(t_op_ctn); end; procedure Tfrm_op_seae.btnMarksClick(Sender: TObject); begin frm_main.view_momo(t_op_ctn1,'唛头'); end; procedure Tfrm_op_seae.btnDescClick(Sender: TObject); begin frm_main.view_momo(t_op_ctn1,'货物描述'); end; procedure Tfrm_op_seae.bsSkinButton60Click(Sender: TObject); var bok:Tbookmark; if_first:boolean; begin if t_op_ctn.IsEmpty then exit; op_befor_post(TADOQuery(DBEdit35.DataSource.DataSet),'0001'); t_op_ctn.First; if_first:=true; bok:=t_op_ctn.GetBookmark; while not t_op_ctn.Eof do begin if if_first then begin memo1.Lines.Text:=t_op_ctn.fieldbyname('箱号').asstring+'/'+t_op_ctn.fieldbyname('封号').asstring; memo2.Lines.Text:=t_op_ctn.fieldbyname('件数').asstring+t_op_ctn.fieldbyname('包装').asstring; memo3.Lines.Text:=t_op_ctn.fieldbyname('重量').asstring+'KGS'; memo4.Lines.Text:=t_op_ctn.fieldbyname('尺码').asstring+'CBM'; if_first:=false; end else begin // memo1.Lines.Add(' '); memo1.Lines.Add(t_op_ctn.fieldbyname('箱号').asstring+'/'+t_op_ctn.fieldbyname('封号').asstring); memo2.Lines.Add(' '); memo2.Lines.Add(t_op_ctn.fieldbyname('件数').asstring+t_op_ctn.fieldbyname('包装').asstring); memo3.Lines.Add(' '); memo3.Lines.Add(t_op_ctn.fieldbyname('重量').asstring+'KGS'); memo4.Lines.Add(' '); memo4.Lines.Add(t_op_ctn.fieldbyname('尺码').asstring+'CBM'); end; t_op_ctn.next; end; DBEdit35.DataSource.DataSet.edit; DBEdit35.DataSource.DataSet['箱号封号']:=memo1.Lines.Text; DBEdit35.DataSource.DataSet['件数包装']:=memo2.Lines.Text; DBEdit35.DataSource.DataSet['货物重量']:=memo3.Lines.Text; DBEdit35.DataSource.DataSet['货物尺码']:=memo4.Lines.Text; DBEdit35.DataSource.DataSet.post; t_op_ctn.GotoBookmark(bok); end; procedure Tfrm_op_seae.t_op_ctnAfterInsert(DataSet: TDataSet); begin t_op_ctn['编号']:=DBEdit35.DataSource.DataSet['编号']; t_op_ctn['数量']:=1; end; procedure Tfrm_op_seae.t_op_ctnAfterDelete(DataSet: TDataSet); begin update_edictn(DBEdit35.DataSource.DataSet,True); if not (DBEdit35.DataSource.DataSet.State in [dsinsert]) then begin if CheckCtnTotalEquelDetail(TADOQuery(DBEdit35.DataSource.DataSet)) then begin if MessageDlg('装箱明细件、重、尺不等于装箱总数,是否更新?',mtWarning,mbOKCancel,0)=mrok then begin bsSkinButton60.OnClick(nil); end; // abort; end; end; t_op_ctn.Requery; end; procedure Tfrm_op_seae.t_op_ctnBeforeDelete(DataSet: TDataSet); begin if t_op_ctn.RecordCount=1 then begin if t_op_ctn.DataSource.DataSet.FieldByName('装运方式').asstring='整箱' then begin showmessage('业务集装箱不能为空,你不能删除!!'); abort; end; end; op_befor_post(TADOQuery(DBEdit35.DataSource.DataSet),'0001'); end; procedure Tfrm_op_seae.t_op_ctnBeforeEdit(DataSet: TDataSet); begin op_befor_post(TADOQuery(DBEdit35.DataSource.DataSet),'0001'); end; procedure Tfrm_op_seae.t_op_ctnBeforePost(DataSet: TDataSet); var aQuery:TADOQuery; begin if frm_data_share.t_code_ctn.Locate('代码',t_op_ctn.fieldbyname('代码').asstring,[]) then begin t_op_ctn['表现形式']:=frm_data_share.t_code_ctn['表现形式']; if frm_data_share.t_code_ctn.FieldByName('尺寸').asstring='20'then t_op_ctn['TEU']:=1*t_op_ctn.FieldByName('数量').asinteger; if (frm_data_share.t_code_ctn.FieldByName('尺寸').asstring='40')OR (frm_data_share.t_code_ctn.FieldByName('尺寸').asstring='45')then t_op_ctn['TEU']:=2*t_op_ctn.FieldByName('数量').asinteger; end else begin t_op_ctn['代码']:=''; t_op_ctn['表现形式']:=''; t_op_ctn['箱型']:=''; t_op_ctn['尺寸']:=''; end; table_before_post(t_op_ctn,'代码'); table_before_post(t_op_ctn,'数量'); if not frm_data_share.t_code_line_ctn.active then frm_data_share.t_code_line_ctn.Open; if frm_data_share.t_code_line_ctn.IsEmpty then exit; if t_op_ctn.fieldbyname('表现形式').OldValue<>null then if (t_op_ctn.fieldbyname('表现形式').OldValue<>t_op_ctn.fieldbyname('表现形式').Value) or (t_op_ctn.fieldbyname('数量').OldValue<>t_op_ctn.fieldbyname('数量').Value) then if (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring),t_op_ctn.fieldbyname('表现形式').OldValue)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型2').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型3').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型4').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型5').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型6').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) or (Pos(trim(frm_data_share.t_code_line_ctn.fieldbyname('运价箱型1').asstring),t_op_ctn.fieldbyname('表现形式').Value)>0) then begin aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; SQL.Add('Select * from t_ch_fee where 系统费用=1'); sql.add(' and 编号='''+t_op_ctn.FieldByName('编号').AsString+''''); Open; if not IsEmpty then begin MessageDlg('系统已经引入系统费用,如要箱型和箱量请先删除系统费用!',mtWarning,[mbOK],0); Abort; end; end; finally FreeAndNil(aQuery); end; end; end; procedure Tfrm_op_seae.wwDBLookupCombo17Change(Sender: TObject); begin if (t_op_ctn.State=dsedit)or(t_op_ctn.State=dsinsert) then begin if frm_data_share.t_code_ctn.Locate('代码',wwDBLookupCombo17.text,[]) then begin t_op_ctn['表现形式']:=frm_data_share.t_code_ctn['表现形式']; t_op_ctn['箱型']:=frm_data_share.t_code_ctn['箱型']; t_op_ctn['尺寸']:=frm_data_share.t_code_ctn['尺寸']; end else begin t_op_ctn['表现形式']:=''; t_op_ctn['箱型']:=''; t_op_ctn['尺寸']:=''; end; end; end; procedure Tfrm_op_seae.N124Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_jtb) then frm_op_seae_edi_jtb:=tfrm_op_seae_edi_jtb.Create(application); frm_op_seae_edi_jtb.ShowModal; finally frm_op_seae_edi_jtb.free; frm_op_seae_edi_jtb:=nil; end; end; procedure Tfrm_op_seae.t_op_seaeAfterRefresh(DataSet: TDataSet); begin // if t_op_ctn.Active then t_op_ctn.Refresh; end; procedure Tfrm_op_seae.DBEdit35Change(Sender: TObject); begin t_op_ctn.Close; t_op_ctn.Parameters.ParamByName('编号').Value:=DBEdit35.Text; t_op_ctn.Open; end; procedure Tfrm_op_seae.EDI7Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_custom_Waidai) then frm_op_seae_edi_custom_Waidai:=tfrm_op_seae_edi_custom_Waidai.Create(application); frm_op_seae_edi_custom_Waidai.ShowModal; finally frm_op_seae_edi_custom_Waidai.free; frm_op_seae_edi_custom_Waidai:=nil; end; end; procedure Tfrm_op_seae.EDI8Click(Sender: TObject); begin if t_op_seae.isempty then begin showmessage('对不起,没有托单信息,不能生成EDI文件!'); exit; end; try if not assigned(frm_op_seae_edi_custom_ld) then frm_op_seae_edi_custom_ld:=tfrm_op_seae_edi_custom_ld.Create(application); frm_op_seae_edi_custom_ld.ShowModal; finally frm_op_seae_edi_custom_ld.free; frm_op_seae_edi_custom_ld:=nil; end; end; procedure Tfrm_op_seae.DBMemo33Change(Sender: TObject); begin wwDBLookupCombo46.Text:='Num:'+IntToStr(Length(DBMemo33.Lines[DBMemo33.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo33Click(Sender: TObject); begin wwDBLookupCombo46.Text:='Num:'+IntToStr(Length(DBMemo33.Lines[DBMemo33.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo34Change(Sender: TObject); begin wwDBLookupCombo47.Text:='Num:'+IntToStr(Length(DBMemo34.Lines[DBMemo34.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo34Click(Sender: TObject); begin wwDBLookupCombo47.Text:='Num:'+IntToStr(Length(DBMemo34.Lines[DBMemo34.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo35Change(Sender: TObject); begin wwDBLookupCombo48.Text:='Num:'+IntToStr(Length(DBMemo35.Lines[DBMemo35.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo35Click(Sender: TObject); begin wwDBLookupCombo48.Text:='Num:'+IntToStr(Length(DBMemo35.Lines[DBMemo35.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo38Change(Sender: TObject); begin Label106.Caption:='唛头字符Num:'+IntToStr(Length(DBMemo38.Lines[DBMemo38.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo38Click(Sender: TObject); begin Label106.Caption:='唛头字符Num:'+IntToStr(Length(DBMemo38.Lines[DBMemo38.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo39Change(Sender: TObject); begin Label106.Caption:='货物描述Num:'+IntToStr(Length(DBMemo39.Lines[DBMemo39.CaretPos.Y])); end; procedure Tfrm_op_seae.DBMemo39Click(Sender: TObject); begin Label106.Caption:='货物描述Num:'+IntToStr(Length(DBMemo39.Lines[DBMemo39.CaretPos.Y])); end; end.