unit u_op_railway; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, ExtCtrls, XPMenu, Menus, DB, ADODB, dxExEdtr, dxDBGrid, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, RxLookup, StdCtrls, Mask, DBCtrls, ComCtrls, bsSkinTabs, u_op_sate, u_fee, wwdbdatetimepicker, wwdbedit, Wwdotdot, Wwdbcomb, u_op_letter_free, wwdblook, bsdbctrls, Grids, DBGridEh, Wwdbigrd, Wwdbgrid, u_op_card, bsSkinBoxCtrls,DateUtils, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxMaskEdit, cxCalendar, cxTextEdit, cxGridDBTableView, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, DBGrids, DBCtrlsEh; type Tfrm_op_railway = class(TForm) 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; t_op_railway: TADOQuery; t_op_railway1: TDataSource; PopupMenu1: TPopupMenu; t_ch_fee: TADOQuery; XPMenu1: TXPMenu; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridDateColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column18: TdxDBGridMaskColumn; dxDBGrid1Column22: TdxDBGridMaskColumn; dxDBGrid1Column23: TdxDBGridMaskColumn; dxDBGrid1Column24: TdxDBGridMaskColumn; dxDBGrid1Column25: TdxDBGridDateColumn; dxDBGrid1Column26: TdxDBGridMaskColumn; dxDBGrid1Column19: TdxDBGridColumn; bsSkinPanel1: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label37: TLabel; Label5: TLabel; Label4: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit8: TDBEdit; DBEdit4: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; fra_fee1: Tfra_fee; fra_op_state1: Tfra_op_state; dxDBGrid1Column27: TdxDBGridColumn; Label65: TLabel; DBEdit18: TDBEdit; dxDBGrid1Column28: TdxDBGridColumn; bsSkinButton13: TbsSkinButton; Label41: TLabel; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; PopupMenu3: TPopupMenu; N37: TMenuItem; N38: TMenuItem; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; RxDBLookupCombo31: TRxDBLookupCombo; bsSkinTabSheet4: TbsSkinTabSheet; fra_op_letter_free1: Tfra_op_letter_free; N8: TMenuItem; N9: TMenuItem; N19: TMenuItem; N20: TMenuItem; N21: TMenuItem; N22: TMenuItem; N23: TMenuItem; N24: TMenuItem; dxDBGrid1Column29: TdxDBGridColumn; bsSkinPanel2: TbsSkinPanel; bsSkinDBText1: TbsSkinDBText; N26: TMenuItem; bsSkinSpeedButton1: TbsSkinSpeedButton; bsSkinTabSheet7: TbsSkinTabSheet; fra_op_card1: Tfra_op_card; Label7: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label53: TLabel; wwDBComboBox7: TwwDBComboBox; Label8: TLabel; DBEdit5: TDBEdit; t_op_railway_fen1: TDataSource; t_op_railway_fen: TADOQuery; bsSkinScrollBox1: TbsSkinScrollBox; bsSkinScrollBar1: TbsSkinScrollBar; dxDBGrid1Column20: TdxDBGridColumn; cxGrid1: TcxGrid; cxGrid1DBBandedTableView1: TcxGridDBBandedTableView; cxStyleRepository1: TcxStyleRepository; cxStyle1: TcxStyle; cxStyle2: TcxStyle; cxStyle3: TcxStyle; cxStyle4: TcxStyle; cxStyle5: TcxStyle; cxGrid1Level1: TcxGridLevel; cxGrid1DBTableView1: TcxGridDBTableView; cxGrid1DBTableView1DBColumn: TcxGridDBColumn; cxGrid1DBTableView1DBColumn1: TcxGridDBColumn; cxGrid1DBTableView1DBColumn2: TcxGridDBColumn; cxGrid1DBTableView1DBColumn3: TcxGridDBColumn; cxGrid1DBTableView1DBColumn4: TcxGridDBColumn; cxGrid1DBTableView1DBColumn5: TcxGridDBColumn; cxGrid1DBTableView1DBColumn6: TcxGridDBColumn; cxGrid1DBTableView1DBColumn7: TcxGridDBColumn; cxGrid1DBTableView1DBColumn8: TcxGridDBColumn; cxGrid1DBTableView1DBColumn9: TcxGridDBColumn; cxGrid1DBTableView1DBColumn10: TcxGridDBColumn; cxGrid1DBTableView1DBColumn11: TcxGridDBColumn; cxGrid1DBTableView1DBColumn12: TcxGridDBColumn; cxGrid1DBTableView1DBColumn13: TcxGridDBColumn; cxGrid1DBTableView1DBColumn14: TcxGridDBColumn; cxGrid1DBTableView1DBColumn15: TcxGridDBColumn; cxGrid1DBTableView1DBColumn16: TcxGridDBColumn; cxGrid1DBTableView1DBColumn17: TcxGridDBColumn; cxGrid1Level2: TcxGridLevel; v_op_railway_detail: TADOQuery; v_op_railway_detail1: TDataSource; bsSkinTabSheet6: TbsSkinTabSheet; bsSkinPanel8: TbsSkinPanel; bsSkinScrollBar2: TbsSkinScrollBar; bsSkinScrollBox2: TbsSkinScrollBox; Label34: TLabel; Label164: TLabel; Label110: TLabel; Label35: TLabel; Label98: TLabel; Label99: TLabel; Label100: TLabel; Label101: TLabel; Label102: TLabel; Label103: TLabel; Label105: TLabel; Label106: TLabel; Label107: TLabel; Label108: TLabel; Label57: TLabel; Label58: TLabel; Label59: TLabel; RxDBLookupCombo16: TRxDBLookupCombo; DBMemo3: TDBMemo; RxDBLookupCombo11: TRxDBLookupCombo; DBMemo18: TDBMemo; RxDBLookupCombo17: TRxDBLookupCombo; DBMemo4: TDBMemo; DBEdit43: TDBEdit; DBRichEdit2: TDBRichEdit; DBEdit45: TDBEdit; DBMemo6: TDBMemo; DBMemo7: TDBMemo; DBMemo8: TDBMemo; DBRichEdit4: TDBRichEdit; DBMemo9: TDBMemo; DBEdit46: TDBEdit; DBEdit47: TDBEdit; DBMemo2: TDBMemo; DBRichEdit1: TDBRichEdit; DBMemo5: TDBMemo; bsSkinPageControl2: TbsSkinPageControl; tab1: TbsSkinTabSheet; bsSkinPanel3: TbsSkinPanel; bsSkinGroupBox10: TbsSkinGroupBox; Label51: TLabel; Label52: TLabel; Label10: TLabel; Label23: TLabel; Label13: TLabel; Label27: TLabel; Label42: TLabel; Label17: TLabel; Label16: TLabel; wwDBDateTimePicker12: TwwDBDateTimePicker; wwDBComboBox2: TwwDBComboBox; RxDBLookupCombo7: TRxDBLookupCombo; RxDBLookupCombo8: TRxDBLookupCombo; wwDBComboBox3: TwwDBComboBox; RxDBLookupCombo29: TRxDBLookupCombo; RxDBLookupCombo30: TRxDBLookupCombo; RxDBLookupCombo13: TRxDBLookupCombo; wwDBComboBox4: TwwDBComboBox; bsSkinPanel4: TbsSkinPanel; tab2: TbsSkinTabSheet; t_op_railway2: TDataSource; bsSkinPanel7: TbsSkinPanel; dxDBGrid2: TdxDBGrid; dxDBGrid2Column1: TdxDBGridColumn; dxDBGrid2Column2: TdxDBGridColumn; dxDBGrid2Column3: TdxDBGridColumn; dxDBGrid2Column4: TdxDBGridColumn; dxDBGrid2Column5: TdxDBGridColumn; bsSkinButton36: TbsSkinButton; bsSkinButton34: TbsSkinButton; bsSkinButton33: TbsSkinButton; bsSkinButton32: TbsSkinButton; bsSkinButton31: TbsSkinButton; dxDBGrid2Column6: TdxDBGridColumn; dxDBGrid2Column7: TdxDBGridColumn; dxDBGrid2Column8: TdxDBGridColumn; dxDBGrid2Column9: TdxDBGridColumn; dxDBGrid2Column10: TdxDBGridColumn; dxDBGrid2Column11: TdxDBGridColumn; bsSkinGroupBox2: TbsSkinGroupBox; Label85: TLabel; Label9: TLabel; Label11: TLabel; Label12: TLabel; Label6: TLabel; Label36: TLabel; Label38: TLabel; Label40: TLabel; Label39: TLabel; Label43: TLabel; Label44: TLabel; Label45: TLabel; Label46: TLabel; Label47: TLabel; wwDBLookupCombo52: TwwDBLookupCombo; DBEdit6: TDBEdit; DBEdit7: TDBEdit; wwDBLookupCombo2: TwwDBLookupCombo; DBEdit9: TDBEdit; DBEdit10: TDBEdit; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo4: TRxDBLookupCombo; wwDBComboBox1: TwwDBComboBox; DBEdit21: TDBEdit; DBEdit81: TDBEdit; wwDBLookupCombo61: TwwDBLookupCombo; DBEdit82: TDBEdit; DBEdit83: TDBEdit; RxDBLookupCombo5: TRxDBLookupCombo; DBEdit22: TDBEdit; bsSkinGroupBox3: TbsSkinGroupBox; Label22: TLabel; Label15: TLabel; Label18: TLabel; Label26: TLabel; Label60: TLabel; Label61: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; DBEdit12: TDBEdit; DBEdit13: TDBEdit; wwDBDateTimePicker6: TwwDBDateTimePicker; wwDBDateTimePicker5: TwwDBDateTimePicker; wwDBDateTimePicker14: TwwDBDateTimePicker; bsSkinGroupBox9: TbsSkinGroupBox; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label48: TLabel; Label49: TLabel; DBEdit17: TDBEdit; DBEdit19: TDBEdit; wwDBDateTimePicker7: TwwDBDateTimePicker; wwDBDateTimePicker8: TwwDBDateTimePicker; DBEdit20: TDBEdit; wwDBDateTimePicker9: TwwDBDateTimePicker; wwDBDateTimePicker1: TwwDBDateTimePicker; wwDBDateTimePicker10: TwwDBDateTimePicker; bsSkinGroupBox4: TbsSkinGroupBox; Label14: TLabel; Label19: TLabel; Label25: TLabel; Label20: TLabel; Label21: TLabel; Label50: TLabel; Label24: TLabel; Label95: TLabel; DBEdit11: TDBEdit; DBEdit15: TDBEdit; wwDBDateTimePicker2: TwwDBDateTimePicker; wwDBDateTimePicker3: TwwDBDateTimePicker; DBEdit16: TDBEdit; wwDBDateTimePicker11: TwwDBDateTimePicker; wwDBLookupCombo5: TwwDBLookupCombo; wwDBLookupCombo6: TwwDBLookupCombo; DBEdit44: TDBEdit; bsSkinGroupBox5: TbsSkinGroupBox; Label104: TLabel; Label56: TLabel; DBRichEdit3: TDBRichEdit; DBMemo1: TDBMemo; dxDBGrid1Column21: TdxDBGridColumn; cxGrid1DBTableView1DBColumn18: TcxGridDBColumn; dxDBGrid2Column12: TdxDBGridColumn; dxDBGrid2Column13: TdxDBGridColumn; dxDBGrid2Column14: TdxDBGridColumn; dxDBGrid2Column15: TdxDBGridColumn; dxDBGrid2Column16: TdxDBGridColumn; dxDBGrid2Column17: TdxDBGridColumn; dxDBGrid2Column18: TdxDBGridColumn; dxDBGrid2Column19: TdxDBGridColumn; dxDBGrid2Column20: TdxDBGridColumn; dxDBGrid2Column21: TdxDBGridColumn; dxDBGrid2Column22: TdxDBGridColumn; dxDBGrid2Column23: TdxDBGridColumn; dxDBGrid2Column24: TdxDBGridColumn; dxDBGrid2Column25: TdxDBGridColumn; dxDBGrid2Column26: TdxDBGridColumn; dxDBGrid2Column27: TdxDBGridColumn; dxDBGrid2Column28: TdxDBGridColumn; dxDBGrid2Column29: TdxDBGridColumn; dxDBGrid2Column30: TdxDBGridColumn; dxDBGrid2Column31: TdxDBGridColumn; dxDBGrid2Column32: TdxDBGridColumn; dxDBGrid2Column33: TdxDBGridColumn; cxGrid1DBTableView3: TcxGridDBTableView; cxGrid1DBTableView3DBColumn: TcxGridDBColumn; cxGrid1DBTableView3DBColumn1: TcxGridDBColumn; cxGrid1DBTableView3DBColumn2: TcxGridDBColumn; cxGrid1DBTableView3DBColumn3: TcxGridDBColumn; cxGrid1DBTableView3DBColumn4: TcxGridDBColumn; cxGrid1DBTableView3DBColumn5: TcxGridDBColumn; cxGrid1DBTableView3DBColumn6: TcxGridDBColumn; cxGrid1DBTableView3DBColumn7: TcxGridDBColumn; cxGrid1DBTableView3DBColumn8: TcxGridDBColumn; cxGrid1DBTableView3DBColumn9: TcxGridDBColumn; cxGrid1DBTableView3DBColumn10: TcxGridDBColumn; cxGrid1DBTableView3DBColumn11: TcxGridDBColumn; cxGrid1DBTableView3DBColumn12: TcxGridDBColumn; cxGrid1DBTableView3DBColumn13: TcxGridDBColumn; cxGrid1DBTableView3DBColumn14: TcxGridDBColumn; cxGrid1DBTableView3DBColumn15: TcxGridDBColumn; cxGrid1DBTableView3DBColumn16: TcxGridDBColumn; cxGrid1DBTableView3DBColumn17: TcxGridDBColumn; cxGrid1DBTableView3DBColumn18: TcxGridDBColumn; cxGrid1DBTableView3DBColumn19: TcxGridDBColumn; cxGrid1DBTableView3DBColumn20: TcxGridDBColumn; cxGrid1DBTableView3DBColumn21: TcxGridDBColumn; cxGrid1DBTableView3DBColumn22: TcxGridDBColumn; cxGrid1DBTableView3DBColumn23: TcxGridDBColumn; cxGrid1DBTableView3DBColumn24: TcxGridDBColumn; cxGrid1DBTableView3DBColumn25: TcxGridDBColumn; cxGrid1DBTableView3DBColumn26: TcxGridDBColumn; cxGrid1DBTableView3DBColumn27: TcxGridDBColumn; cxGrid1DBTableView3DBColumn28: TcxGridDBColumn; cxGrid1DBTableView3DBColumn29: TcxGridDBColumn; cxGrid1DBTableView3DBColumn30: TcxGridDBColumn; cxGrid1DBTableView3DBColumn31: TcxGridDBColumn; cxGrid1DBTableView3DBColumn32: TcxGridDBColumn; cxStyleRepository2: TcxStyleRepository; cxStyle6: TcxStyle; cxStyle7: TcxStyle; cxStyle8: TcxStyle; cxStyle9: TcxStyle; cxGrid1DBTableView1DBColumn19: TcxGridDBColumn; cxGrid1DBTableView1DBColumn20: TcxGridDBColumn; cxGrid1DBTableView1DBColumn21: TcxGridDBColumn; cxGrid1DBTableView1DBColumn22: TcxGridDBColumn; cxGrid1DBTableView1DBColumn23: TcxGridDBColumn; cxGrid1DBTableView1DBColumn24: TcxGridDBColumn; cxGrid1DBTableView1DBColumn25: TcxGridDBColumn; cxGrid1DBTableView1DBColumn26: TcxGridDBColumn; cxGrid1DBTableView1DBColumn27: TcxGridDBColumn; cxGrid1DBTableView1DBColumn28: TcxGridDBColumn; cxGrid1DBTableView1DBColumn29: TcxGridDBColumn; cxGrid1DBTableView1DBColumn30: TcxGridDBColumn; cxGrid1DBTableView1DBColumn31: TcxGridDBColumn; cxGrid1DBTableView1DBColumn32: TcxGridDBColumn; cxGrid1DBTableView1DBColumn33: TcxGridDBColumn; cxGrid1DBTableView1DBColumn34: TcxGridDBColumn; cxGrid1DBTableView1DBColumn35: TcxGridDBColumn; cxGrid1DBTableView1DBColumn36: TcxGridDBColumn; cxGrid1DBTableView1DBColumn37: TcxGridDBColumn; cxGrid1DBTableView1DBColumn38: TcxGridDBColumn; cxGrid1DBTableView1DBColumn39: TcxGridDBColumn; cxGrid1DBTableView1DBColumn40: TcxGridDBColumn; cxGrid1DBTableView1DBColumn41: TcxGridDBColumn; cxGrid1DBTableView1DBColumn42: TcxGridDBColumn; cxGrid1DBTableView1DBColumn43: TcxGridDBColumn; cxGrid1DBTableView1DBColumn44: TcxGridDBColumn; cxGrid1DBTableView1DBColumn45: TcxGridDBColumn; cxGrid1DBTableView1DBColumn46: TcxGridDBColumn; cxGrid1DBTableView1DBColumn47: TcxGridDBColumn; cxGrid1DBTableView1DBColumn48: TcxGridDBColumn; cxGrid1DBTableView3DBColumn33: TcxGridDBColumn; cxGrid1DBTableView3DBColumn34: TcxGridDBColumn; cxGrid1DBTableView3DBColumn35: TcxGridDBColumn; cxGrid1DBTableView3DBColumn40: TcxGridDBColumn; cxGrid1DBTableView3DBColumn41: TcxGridDBColumn; cxGrid1DBTableView3DBColumn42: TcxGridDBColumn; cxGrid1DBTableView3DBColumn43: TcxGridDBColumn; cxGrid1DBTableView3DBColumn36: TcxGridDBColumn; cxGrid1DBTableView3DBColumn37: TcxGridDBColumn; PopupMenu4: TPopupMenu; N29: TMenuItem; N28: TMenuItem; N27: TMenuItem; N61: TMenuItem; N76: TMenuItem; N77: TMenuItem; N78: TMenuItem; N79: TMenuItem; N80: TMenuItem; N30: TMenuItem; N32: TMenuItem; N33: TMenuItem; N39: TMenuItem; N40: TMenuItem; N41: TMenuItem; N42: TMenuItem; Label55: TLabel; wwDBDateTimePicker15: TwwDBDateTimePicker; bsSkinButton38: TbsSkinButton; bsSkinGroupBox1: TbsSkinGroupBox; Label62: TLabel; DBMemo10: TDBMemo; Label54: TLabel; RxDBLookupCombo6: TRxDBLookupCombo; Label63: TLabel; wwDBLookupCombo1: TwwDBLookupCombo; DBEdit14: TDBEdit; Label64: TLabel; wwDBDateTimePicker13: TwwDBDateTimePicker; Label66: TLabel; wwDBDateTimePicker16: TwwDBDateTimePicker; Label67: TLabel; wwDBDateTimePicker17: TwwDBDateTimePicker; DBEdit23: TDBEdit; Label68: TLabel; Label69: TLabel; DBEdit24: TDBEdit; Label70: TLabel; DBEdit25: TDBEdit; Label71: TLabel; RxDBLookupCombo9: TRxDBLookupCombo; Label72: TLabel; DBEdit26: TDBEdit; Label73: TLabel; DBEdit27: TDBEdit; Label74: TLabel; DBEdit28: TDBEdit; DBEdit29: TDBEdit; Label75: TLabel; DBEdit30: TDBEdit; Label76: TLabel; Label77: TLabel; DBEdit31: TDBEdit; cxGrid1DBTableView1DBColumn49: TcxGridDBColumn; cxGrid1DBTableView1DBColumn50: TcxGridDBColumn; Label78: TLabel; RxDBLookupCombo10: TRxDBLookupCombo; cxGrid1DBTableView1DBColumn52: TcxGridDBColumn; wwDBDateTimePicker18: TwwDBDateTimePicker; Label79: TLabel; bsSkinButton14: TbsSkinButton; Label80: TLabel; wwDBLookupCombo3: TwwDBLookupCombo; DBEdit32: TDBEdit; RxDBLookupCombo12: TRxDBLookupCombo; Label81: TLabel; Label82: TLabel; wwDBDateTimePicker19: TwwDBDateTimePicker; Label83: TLabel; DBEdit33: TDBEdit; Label84: TLabel; Label86: TLabel; DBEdit34: TDBEdit; Label87: TLabel; DBEdit35: TDBEdit; Label88: TLabel; DBEdit36: TDBEdit; Label89: TLabel; wwDBDateTimePicker20: TwwDBDateTimePicker; Label90: TLabel; DBEdit37: TDBEdit; Label91: TLabel; DBEdit38: TDBEdit; Label92: TLabel; Label93: TLabel; Label94: TLabel; DBEdit39: TDBEdit; Label96: TLabel; DBComboBox1: TDBComboBox; DBComboBox2: TDBComboBox; RxDBLookupCombo14: TRxDBLookupCombo; RxDBLookupCombo15: TRxDBLookupCombo; Label97: TLabel; DBEdit40: TDBEdit; dxDBGrid2Column34: TdxDBGridColumn; dxDBGrid2Column35: TdxDBGridColumn; dxDBGrid2Column36: TdxDBGridColumn; dxDBGrid2Column37: TdxDBGridColumn; dxDBGrid2Column38: TdxDBGridColumn; bsSkinTabSheet8: TbsSkinTabSheet; Label109: TLabel; DBEdit41: TDBEdit; Label111: TLabel; RxDBLookupCombo18: TRxDBLookupCombo; Label112: TLabel; DBEdit42: TDBEdit; bsSkinButton12: TbsSkinButton; bsSkinPanel5: TbsSkinPanel; bsSkinComboBox1: TbsSkinComboBox; bsSkinStdLabel1: TbsSkinStdLabel; bsSkinButton16: TbsSkinButton; bsSkinDateEdit1: TbsSkinDateEdit; bsSkinStdLabel2: TbsSkinStdLabel; bsSkinButton17: TbsSkinButton; bsSkinButton15: TbsSkinButton; dxDBGrid2Column39: TdxDBGridColumn; procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure Panel2Resize(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure t_op_railwayBeforeEdit(DataSet: TDataSet); procedure t_op_railwayBeforePost(DataSet: TDataSet); 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 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 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 RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); procedure DBEdit7KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); procedure DBEdit18KeyPress(Sender: TObject; var Key: Char); procedure DBEdit2Change(Sender: TObject); procedure DBEdit3Change(Sender: TObject); procedure RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo8Change(Sender: TObject); procedure N10Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure bsSkinButton13Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N37Click(Sender: TObject); procedure RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); procedure wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); procedure N9Click(Sender: TObject); procedure N20Click(Sender: TObject); procedure t_op_railwayBeforeCancel(DataSet: TDataSet); procedure N21Click(Sender: TObject); procedure N24Click(Sender: TObject); procedure dxDBGrid1Column29CustomDraw(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 N26Click(Sender: TObject); procedure RxDBLookupCombo16Change(Sender: TObject); procedure RxDBLookupCombo17Change(Sender: TObject); procedure RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); procedure RxDBLookupCombo16Enter(Sender: TObject); procedure RxDBLookupCombo16Exit(Sender: TObject); procedure bsSkinSpeedButton1Click(Sender: TObject); procedure bsSkinPageControl1Change(Sender: TObject); procedure RxDBLookupCombo11Change(Sender: TObject); procedure DBEdit6KeyPress(Sender: TObject; var Key: Char); procedure bsSkinButton9Click(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure N29Click(Sender: TObject); procedure wwDBLookupCombo52Change(Sender: TObject); procedure wwDBLookupCombo2Change(Sender: TObject); procedure wwDBLookupCombo5Change(Sender: TObject); procedure wwDBLookupCombo6Change(Sender: TObject); procedure RxDBLookupCombo3Change(Sender: TObject); procedure t_op_railway_fenAfterPost(DataSet: TDataSet); procedure t_op_railway_fenAfterOpen(DataSet: TDataSet); procedure cxGrid1DBTableView1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure wwDBComboBox4Change(Sender: TObject); procedure dxDBGrid2DblClick(Sender: TObject); procedure bsSkinButton32Click(Sender: TObject); procedure t_op_railwayAfterOpen(DataSet: TDataSet); procedure bsSkinButton33Click(Sender: TObject); procedure bsSkinButton34Click(Sender: TObject); procedure bsSkinButton31Click(Sender: TObject); procedure t_op_railway_fenBeforeCancel(DataSet: TDataSet); procedure t_op_railway_fenBeforePost(DataSet: TDataSet); procedure N27Click(Sender: TObject); procedure N76Click(Sender: TObject); procedure N78Click(Sender: TObject); procedure N80Click(Sender: TObject); procedure N32Click(Sender: TObject); procedure N41Click(Sender: TObject); procedure N39Click(Sender: TObject); procedure bsSkinButton38Click(Sender: TObject); procedure wwDBComboBox2Change(Sender: TObject); procedure wwDBLookupCombo1Change(Sender: TObject); procedure bsSkinButton14Click(Sender: TObject); procedure fra_op_letter_free1bsSkinButton1Click(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure bsSkinButton17Click(Sender: TObject); procedure bsSkinButton16Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure bsSkinButton36Click(Sender: TObject); procedure t_op_railwayBeforeDelete(DataSet: TDataSet); private // procedure update_railctn(table:Tadoquery);//更新箱量 Letter_flag:integer; procedure t_raildatecharge(Sender:TField); procedure t_railkgscharge(Sender:TField); { Private declarations } public { Public declarations } end; var frm_op_railway: Tfrm_op_railway; railwayopen:boolean; implementation uses u_main, my_sys_function, u_data_share, u_sys_progress, u_op_date_change, u_op_railway_add,u_op_railwayctn_history, u_ch_fee_zhupiao, u_op_letter; {$R *.dfm} { procedure Tfrm_op_railway.update_railctn(table:Tadoquery);//更新箱量 var ctn_string:widestring; bok:Tbookmark; pkgs:integer; kgs,cbm:double; begin pkgs:=0; kgs:=0; cbm:=0; if table.IsEmpty then begin try table.DataSource.DataSet.Edit; table.DataSource.DataSet['箱型1']:=0; table.DataSource.DataSet['箱型2']:=0; table.DataSource.DataSet['箱型3']:=0; table.DataSource.DataSet['箱型4']:=0; table.DataSource.DataSet['箱型5']:=0; table.DataSource.DataSet['箱型6']:=0; table.DataSource.DataSet['箱型7']:=0; table.DataSource.DataSet['箱型8']:=0; table.DataSource.DataSet['箱型9']:=0; table.DataSource.DataSet['箱型10']:=0; table.DataSource.DataSet['其他箱型']:=0; table.DataSource.DataSet['箱TEU']:=0; table.DataSource.DataSet['集装箱']:=''; table.DataSource.DataSet['件数']:=0; table.DataSource.DataSet['重量']:=0; table.DataSource.DataSet['尺码']:=0; table.DataSource.DataSet.post; except showmessage('箱量录入失败!!'); abort; end; end else begin frm_main.t_sum_ctn.close; frm_main.t_sum_ctn.open; bok:=table.GetBookmark; try table.DataSource.DataSet.Edit; table.DataSource.DataSet['箱型1']:=0; table.DataSource.DataSet['箱型2']:=0; table.DataSource.DataSet['箱型3']:=0; table.DataSource.DataSet['箱型4']:=0; table.DataSource.DataSet['箱型5']:=0; table.DataSource.DataSet['箱型6']:=0; table.DataSource.DataSet['箱型7']:=0; table.DataSource.DataSet['箱型8']:=0; table.DataSource.DataSet['箱型9']:=0; table.DataSource.DataSet['箱型10']:=0; table.DataSource.DataSet['其他箱型']:=0; table.DataSource.DataSet['箱TEU']:=0; table.DataSource.DataSet['集装箱']:=''; table.DataSource.DataSet['件数']:=0; table.DataSource.DataSet['重量']:=0; table.DataSource.DataSet['尺码']:=0; table.first; while not table.eof do begin if table.fieldbyname('箱型代码').asstring<>'' then begin if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型1').asstring then begin table.DataSource.DataSet['箱型1']:=table.DataSource.DataSet['箱型1']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型2').asstring then begin table.DataSource.DataSet['箱型2']:=table.DataSource.DataSet['箱型2']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型3').asstring then begin table.DataSource.DataSet['箱型3']:=table.DataSource.DataSet['箱型3']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型4').asstring then begin table.DataSource.DataSet['箱型4']:=table.DataSource.DataSet['箱型4']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型5').asstring then begin table.DataSource.DataSet['箱型5']:=table.DataSource.DataSet['箱型5']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型6').asstring then begin table.DataSource.DataSet['箱型6']:=table.DataSource.DataSet['箱型6']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型7').asstring then begin table.DataSource.DataSet['箱型7']:=table.DataSource.DataSet['箱型7']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型8').asstring then begin table.DataSource.DataSet['箱型8']:=table.DataSource.DataSet['箱型8']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型9').asstring then begin table.DataSource.DataSet['箱型9']:=table.DataSource.DataSet['箱型9']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else if table.fieldbyname('箱型代码').asstring=frm_data_share.t_code_ctn_de.fieldbyname('箱型10').asstring then begin table.DataSource.DataSet['箱型10']:=table.DataSource.DataSet['箱型10']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end else begin table.DataSource.DataSet['其他箱型']:=table.DataSource.DataSet['其他箱型']+1; // table.DataSource.DataSet['箱TEU']:=table.DataSource.DataSet['箱TEU']+table.fieldbyname('TEU').asinteger; end; if not frm_main.t_sum_ctn.locate('代码',table.fieldbyname('箱型代码').asstring,[]) then begin frm_main.t_sum_ctn.insert; frm_main.t_sum_ctn['代码']:=table.fieldbyname('箱型代码').asstring; frm_main.t_sum_ctn['表现形式']:=table.fieldbyname('箱型').asstring; frm_main.t_sum_ctn['数量']:=1; frm_main.t_sum_ctn.post; end else begin frm_main.t_sum_ctn.edit; frm_main.t_sum_ctn['数量']:=frm_main.t_sum_ctn['数量']+1; frm_main.t_sum_ctn.post; end; end; pkgs:=pkgs+table.fieldbyname('件数').AsInteger; kgs:=kgs+table.fieldbyname('重量').Asfloat; cbm:=cbm+table.fieldbyname('尺码').Asfloat; table.next; end; ctn_string:=''; if not frm_main.t_sum_ctn.IsEmpty then begin frm_main.t_sum_ctn.first; while not frm_main.t_sum_ctn.eof do begin if ctn_string='' then begin ctn_string:=frm_main.t_sum_ctn.fieldbyname('表现形式').asstring+'*'+frm_main.t_sum_ctn.fieldbyname('数量').asstring; end else begin ctn_string:=ctn_string+' '+frm_main.t_sum_ctn.fieldbyname('表现形式').asstring+'*'+frm_main.t_sum_ctn.fieldbyname('数量').asstring; end; frm_main.t_sum_ctn.next; end; end; table.DataSource.DataSet['集装箱']:=ctn_string; table.DataSource.DataSet['件数']:=pkgs; table.DataSource.DataSet['重量']:=kgs; table.DataSource.DataSet['尺码']:=cbm; table.DataSource.DataSet.post; except showmessage('箱量录入失败!!'); table.GotoBookmark(bok); abort; end; table.GotoBookmark(bok); end; end; } procedure Tfrm_op_railway.bsSkinButton7Click(Sender: TObject); begin table_Prior(TAdoQuery(t_op_railway1.DataSet)); end; procedure Tfrm_op_railway.bsSkinButton6Click(Sender: TObject); begin table_next(TAdoQuery(t_op_railway1.DataSet)); end; procedure Tfrm_op_railway.bsSkinButton2Click(Sender: TObject); begin table_post(TAdoQuery(t_op_railway1.DataSet)); table_post(TAdoQuery(t_op_railway_fen1.DataSet)); end; procedure Tfrm_op_railway.bsSkinButton4Click(Sender: TObject); begin if t_op_railway.FieldByName('装运方式').asstring='铁路主票'then begin if not t_op_railway_fen.IsEmpty then begin showmessage('铁路主票存在分票信息,不能删除!!'); exit; end; end; t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_railway1.DataSet.fieldbyname('编号').asstring; t_ch_fee.open; if not t_ch_fee.IsEmpty then begin showmessage('业务存在费用信息,不能删除!!'); exit; end; table_delete(TAdoQuery(t_op_railway1.DataSet)); end; procedure Tfrm_op_railway.bsSkinButton3Click(Sender: TObject); begin table_cancel(TAdoQuery(t_op_railway1.DataSet)); end; procedure Tfrm_op_railway.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_op_railway.FormClose(Sender: TObject; var Action: TCloseAction); begin savecxgridview(cxGrid1DBTableView1,'cx'+caption+'1'); savecxgridview(cxGrid1DBTableView3,'cx'+caption+'3'); savereggrid(dxdbgrid1,caption); savereggrid(dxdbgrid2,caption+'2'); savewwgrid(fra_fee1.wwDBGrid1,'铁路运输应收'); savewwgrid(fra_fee1.wwDBGrid2,'铁路运输应付'); railwayopen:=false; frm_op_railway.Hide; frm_op_railway.ManualFloat(frm_op_railway.BoundsRect ); frm_main.freeTabs('frm_op_railway'); if assigned(frm_op_letter) then frm_op_letter.close; action:=cafree; frm_op_railway:=nil; end; procedure Tfrm_op_railway.FormShow(Sender: TObject); begin bsSkinPanel5.Visible:=false; if not ASSIGNED(frm_sys_progress) then frm_sys_progress:=tfrm_sys_progress.Create(self); frm_sys_progress.bsSkinGauge1.ProgressText:='加载数据请等候。。。'; frm_sys_progress.Show; Notebook1.PageIndex:=0; frm_sys_progress.bsSkinGauge1.MaxValue:=16; frm_sys_progress.bsSkinGauge1.MinValue:=0; frm_sys_progress.bsSkinGauge1.Value:=0; frm_sys_progress.Update; if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then begin DBEdit8.Width:=110; bsSkinSpeedButton1.Visible:=false; if frm_data_share.t_sys_noset.fieldbyname('是否允许手动编辑').AsBoolean then begin DBEdit8.ReadOnly:=false; end else begin DBEdit8.ReadOnly:=true; end; end else if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动取号' then begin DBEdit8.Width:=90; bsSkinSpeedButton1.Visible:=true; if frm_data_share.t_sys_noset.fieldbyname('是否允许手动编辑').AsBoolean then begin DBEdit8.ReadOnly:=false; end else begin DBEdit8.ReadOnly:=true; end; end else if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='手动编辑' then begin DBEdit8.ReadOnly:=false; DBEdit8.Width:=110; bsSkinSpeedButton1.Visible:=false; end; t_op_railway.Close; t_op_railway.SQL.clear; if strtobool(get_parameters_value(132,'true')) then begin t_op_railway.SQL.Add('select top 100 * from t_op_railway where 编号=主编号 and ' +'(录入人='+''''+employee+'''' +' or 操作员='+''''+employee+'''' +' or 客服员='+''''+employee+''''+')' +' order by 业务编号 DESC'); end else begin t_op_railway.SQL.Add('select * from t_op_railway where 主编号=编号 and ' +' SUBSTRING(CONVERT(char(15),接单日期,111),1,7)='''+FormatDateTime('YYYY',Date)+'/'+FormatDateTime('MM',Date)+''' and ' +open_data('0006','录入人','操作员','客服员','no','no') +' order by 接单日期 DESC'); end; t_op_railway.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_letter_free1.op_type.Text:='铁路运输'; fra_op_letter_free1.t_op_letter.DataSource:=t_op_railway1; fra_op_letter_free1.t_op_letter.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_letter_free1.t_op_letter_free_detail.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; t_op_railway_fen.open; v_op_railway_detail.close; v_op_railway_detail.sql.text:='select * from t_op_railway where 编号<>主编号 and 编号 in (select top 1000 ' +' 编号 from t_op_railway where 1=1 and ' +'(录入人='+''''+employee+'''' +' or 操作员='+''''+employee+'''' +' or 客服员='+''''+employee+''''+')) order by 主编号'; v_op_railway_detail.open; loadreggrid(dxdbgrid1,false,caption); loadreggrid(dxdbgrid2,false,caption); loadcxgridview(cxGrid1DBTableView1,'cx'+caption+'1'); loadcxgridview(cxGrid1DBTableView3,'cx'+caption+'3'); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; if if_open('297') or if_open('298') then begin fra_fee1.edit_type.text:='6'; fra_fee1.edit_data.text:='0006'; fra_fee1.edit_report.text:='铁路运输'; fra_fee1.t_ch_accept.DataSource:=t_op_railway1; if strtobool(get_parameters_value(150,'false')) then fra_fee1.bsSkinPanel3.Visible:=true; fra_fee1.DBEdit48.DataSource:=t_op_railway1; fra_fee1.DBEdit43.DataSource:=t_op_railway1; if if_open('297') then begin fra_fee1.t_ch_accept.DataSource:=t_op_railway1; if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('209')=false) then begin fra_fee1.t_ch_accept.close; fra_fee1.t_ch_accept.SQL.Clear; fra_fee1.t_ch_accept.SQL.Add('select * from t_ch_fee where 类型=' +''''+'收'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) order by 顺序,CH_ID'); end; fra_fee1.t_ch_accept.open; fra_fee1.a_shen_delete.open; fra_fee1.a_shen_modify_old.open; fra_fee1.a_shen_modify_new.open; fra_fee1.Panel3.visible:=true; end else fra_fee1.Panel3.visible:=false; if if_open('298') then begin fra_fee1.t_ch_pay.DataSource:=t_op_railway1; if (strtobool(get_parameters_value(64,'false'))=true) and (if_open('209')=false) then begin fra_fee1.t_ch_pay.close; fra_fee1.t_ch_pay.SQL.Clear; fra_fee1.t_ch_pay.SQL.Add('select * from t_ch_fee where 类型=' +''''+'付'+''''+' and 编号=:编号 and (录入人=' +''''+employee+''''+' or (录入人<>'+''''+employee+'''' +' and 机密<>1) ) order by 顺序,CH_ID'); end; fra_fee1.t_ch_pay.open; fra_fee1.p_shen_delete.open; fra_fee1.p_shen_modify_old.open; fra_fee1.p_shen_modify_new.open; fra_fee1.Panel1.visible:=true; end else fra_fee1.Panel1.visible:=false; if fra_fee1.Panel1.visible and fra_fee1.Panel3.visible then begin if if_open('228') then begin fra_fee1.Panel8.Visible:=true; fra_fee1.Panel8.Height:=20; end else fra_fee1.Panel8.Visible:=false; fra_fee1.t_op_gain.DataSource:=t_op_railway1; fra_fee1.t_op_gain.open; fra_fee1.t_op_gain_main.DataSource:=t_op_railway1; fra_fee1.t_op_gain_main.open; fra_fee1.Panel9.Visible:=false; end else begin fra_fee1.Panel8.Visible:=false; end; end else begin fra_fee1.Visible:=false; end; loadwwgrid(fra_fee1.wwDBGrid1,'铁路运输应收'); loadwwgrid(fra_fee1.wwDBGrid2,'铁路运输应付'); frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_state1.edit_state.text:='6'; fra_op_state1.t_op_state.DataSource:=t_op_railway1; fra_op_state1.t_op_state.open; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; fra_op_card1.t_op_card.DataSource:=t_op_railway1; fra_op_card1.t_op_card.open; frm_data_share.t_crm_client.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_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_code_source.requery; if not frm_data_share.t_code_railport.Active then frm_data_share.t_code_railport.open else frm_data_share.t_code_railport.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_sys_employee.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; frm_data_share.t_code_code.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; if not frm_data_share.t_code_railwayctnsource.Active then frm_data_share.t_code_railwayctnsource.open; if not frm_data_share.t_code_railwaypath.Active then frm_data_share.t_code_railwaypath.open; frm_data_share.t_code_currency.requery; frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1; bsSkinTabSheet2.TabVisible:=if_open('297') or if_open('298'); railwayopen:=true; frm_sys_progress.close; frm_sys_progress:=nil; end; procedure Tfrm_op_railway.bsSkinButton11Click(Sender: TObject); var answer:TModalResult; begin if bsSkinButton11.Caption='编辑修改' then begin Notebook1.PageIndex:=1; bsSkinButton11.Caption:='返回列表'; wwDBComboBox4.OnChange(nil); Exit; end; if bsSkinButton11.Caption='返回列表' then begin if (t_op_railway.State=dsinsert)or(t_op_railway.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_railway.post; end; if answer=mrNo then begin t_op_railway.cancel; end; if answer=mrCancel then begin exit; end; END; Notebook1.PageIndex:=0; bsSkinButton11.Caption:='编辑修改'; end; if bsSkinButton11.Caption='返回主票' then begin if (t_op_railway_fen.State=dsinsert)or(t_op_railway_fen.State=dsedit) then BEGIN answer:=messagedlg( '数据已经修改,是否保存?',mtWarning,mbYesNoCancel,0); if answer=mrYes then begin t_op_railway_fen.post; end; if answer=mrNo then begin t_op_railway_fen.cancel; end; if answer=mrCancel then begin exit; end; END; bsSkinButton11.Caption:='返回列表'; try t_op_railway1.Enabled:=false; t_op_railway1.DataSet:=t_op_railway; finally t_op_railway1.Enabled:=true; end; Notebook1.PageIndex:=1; exit; end; end; procedure Tfrm_op_railway.bsSkinButton8Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton8.ClientToScreen(Point(0,bsSkinButton8.Height)); PopupMenu1.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_railway.Panel2Resize(Sender: TObject); var i:integer; begin i:=round(Panel2.Width/13); 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; bsSkinButton12.Width:=i; bsSkinButton13.Left:=Panel2.Width-bsSkinButton13.Width-20; end; procedure Tfrm_op_railway.bsSkinButton1Click(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if (t_op_railway1.DataSet.State=dsinsert)or(t_op_railway1.DataSet.State=dsedit) then t_op_railway1.DataSet.post; try frm_op_railway_add:=Tfrm_op_railway_add.Create (self); if not t_op_railway1.DataSet.IsEmpty then begin frm_op_railway_add.shiptype:=''; frm_op_railway_add.bstype:=''; frm_op_railway_add.PNO:=''; frm_op_railway_add.shiptype:=t_op_railway1.DataSet.FieldByName('发运形式').AsString; frm_op_railway_add.bstype:=t_op_railway1.DataSet.FieldByName('装运方式').AsString; frm_op_railway_add.PNO:=t_op_railway1.DataSet.FieldByName('委托编号').AsString; end; if t_op_railway1.DataSet=t_op_railway then begin frm_op_railway_add.data1.Enabled:=false; frm_op_railway_add.data1.DataSet:=t_op_railway; frm_op_railway_add.data1.Enabled:=true; frm_op_railway_add_num:=1; end else begin frm_op_railway_add.data1.Enabled:=false; frm_op_railway_add.data1.DataSet:=t_op_railway_fen; frm_op_railway_add.data1.Enabled:=true; frm_op_railway_add.bsSkinCheckRadioBox6.Checked:=true; frm_op_railway_add.bsSkinCheckRadioBox1.Enabled:=false; frm_op_railway_add.bsSkinCheckRadioBox5.Enabled:=false; frm_op_railway_add.bsSkinCheckRadioBox6.Enabled:=false; frm_op_railway_add_num:=2; end; if frm_op_railway_add.ShowModal<>mrCancel then begin if not frm_op_railway.bsSkinTabSheet1.Showing then frm_op_railway.bsSkinTabSheet1.Show; end; finally frm_op_railway_add.Free; end; end; procedure Tfrm_op_railway.t_op_railwayBeforeEdit(DataSet: TDataSet); begin op_befor_post(t_op_railway,'0006'); end; procedure Tfrm_op_railway.t_op_railwayBeforePost(DataSet: TDataSet); begin table_before_post(t_op_railway,'委托单位'); table_before_post(t_op_railway,'操作员'); table_before_post(t_op_railway,'揽货人'); table_before_post(t_op_railway,'客服员'); // table_before_post(t_op_airtruck,'主提单号'); // table_before_post(t_op_airtruck,'分提单号'); table_before_post(t_op_railway,'接单日期'); // table_before_post(t_op_railway,'发车日期'); table_before_post(t_op_railway,'业务来源'); table_before_post(t_op_railway,'销售部门'); table_before_post(t_op_railway,'操作部门'); if op_empty('t_op_railway',t_op_railway) then Abort; if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then if t_op_railway.FieldByName('委托编号').IsNull or (trim(t_op_railway['委托编号'])='') then if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_railway['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway['会计期间']) else t_op_railway['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway['接单日期']); if (not t_op_railway.fieldbyname('发车日期').isnull) and (t_op_railway.fieldbyname('发车日期').oldvalue<>t_op_railway.fieldbyname('发车日期').value) then if (t_op_railway.fieldbyname('业务类型').asstring<>'更改单') and (Logininfo.endday>=t_op_railway.fieldbyname('发车日期').asdatetime) then begin showmessage('此接单日期所在期间已月末结账,不能添加修改业务!!'); abort; end; if t_op_railway.FieldByName('委托单位').OldValue<>t_op_railway.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_railway.FieldByName('委托单位').asstring,[])then begin if frm_data_share.t_crm_client_all.fieldbyname('客户状态').asstring='封存客户'then begin showmessage('当前业务委托单位已经封存,不能再进行业务合作,如需合作请进行恢复客户操作!'); abort; end; end; end; if t_op_railway.State=dsinsert then begin if t_op_railway.fieldbyname('业务编号').asstring=''then begin t_op_railway['业务编号']:=get_no(t_op_railway.fieldbyname('会计期间').AsDateTime,getbsno(Logininfo.RailWayBsNo,'RW')); end; t_op_railway['主编号']:=t_op_railway['编号']; t_op_railway['业务状态']:='接受委托'; t_op_railway['费用状态']:='录入状态'; end; if strtobool(get_parameters_value(45,'false')) then begin if (trim(t_op_railway.fieldbyname('委托编号').asstring)='') or (t_op_railway.fieldbyname('业务类型').asstring='更改单') then begin t_op_railway['委托标准']:=t_op_railway['编号']; end else begin t_op_railway['委托标准']:=t_op_railway['委托编号']; end; end else begin t_op_railway['委托标准']:=t_op_railway['编号']; end; // t_op_railway['upload']:=1; end; procedure Tfrm_op_railway.bsSkinButton10Click(Sender: TObject); begin query_railway(1,'0006'); end; procedure Tfrm_op_railway.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_railway.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 AColor:=dxgrid_color('铁路运输',ANode.Strings[dxDBGrid1Column2.Index]); AFont.Color:=clblack; end; procedure Tfrm_op_railway.DBEdit1KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit2); end; procedure Tfrm_op_railway.DBEdit2KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit3); end; procedure Tfrm_op_railway.DBEdit3KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_op_railway.DBEdit4KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit4); end; procedure Tfrm_op_railway.RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo31); end; procedure Tfrm_op_railway.RxDBLookupCombo13KeyPress(Sender: TObject; var Key: Char); begin key_DBEdit(Key,DBEdit8); end; procedure Tfrm_op_railway.DBEdit7KeyPress(Sender: TObject; var Key: Char); begin key_wwDBDateTimePicker(Key,wwDBDateTimePicker2); end; procedure Tfrm_op_railway.wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char); begin if key = #13 then begin Key :=#0; Perform(CM_DialogKey,VK_TAB,0); end; end; procedure Tfrm_op_railway.wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo7); end; procedure Tfrm_op_railway.RxDBLookupCombo11KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo18); end; procedure Tfrm_op_railway.RxDBLookupCombo7KeyPress(Sender: TObject; var Key: Char); begin // key_wwDBLookupCombo(Key,wwDBLookupCombo10); end; procedure Tfrm_op_railway.DBEdit18KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo1); end; procedure Tfrm_op_railway.DBEdit2Change(Sender: TObject); begin DBEdit2.Color:=dxgrid_color('铁路运输',DBEdit2.text); end; procedure Tfrm_op_railway.DBEdit3Change(Sender: TObject); begin DBEdit3.Color:=dxgrid_color_fee(DBEdit3.text); end; procedure Tfrm_op_railway.RxDBLookupCombo29KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo8); end; procedure Tfrm_op_railway.RxDBLookupCombo8KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo30); end; procedure Tfrm_op_railway.RxDBLookupCombo8Change(Sender: TObject); begin if (t_op_railway.state=dsinsert)or(t_op_railway.state=dsedit)then begin if RxDBLookupCombo8.DisplayValue='' then exit; if frm_data_share.t_sys_employee.locate('姓名',RxDBLookupCombo8.DisplayValue,[]) then t_op_railway['操作部门']:=frm_data_share.t_sys_employee['部门名称']; end; end; procedure Tfrm_op_railway.N10Click(Sender: TObject); begin // cxGrid1DBTableView1. cxGrid1DBTableView1.Columns[cxGrid1DBTableView1.DataController.FocusedRowIndex].Visible:=false; // update_grid_view_no(dxdbgrid1); // cxGrid1DBTableView1.CopyToClipboard(true); end; procedure Tfrm_op_railway.N14Click(Sender: TObject); var i:integer; begin for i:=0 to cxGrid1DBTableView1.ColumnCount-1 do begin cxGrid1DBTableView1.Columns[i].Visible:=true; end; // update_grid_view_all(dxdbgrid1); end; procedure Tfrm_op_railway.N12Click(Sender: TObject); begin // update_grid(cxGrid1,206); end; procedure Tfrm_op_railway.N16Click(Sender: TObject); begin cxgrid_save_xls(cxGrid1); end; procedure Tfrm_op_railway.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_op_railway,'业务编号'); end; procedure Tfrm_op_railway.bsSkinButton13Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_railway.N17Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态=' +''''+'录入状态'+''''+') ' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.N34Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'驳回提交'+''''+','+''''+'禁止修改'+''''+','+''''+'禁止删除'+''''+')) ' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.N36Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态 in (' +''''+'提交审核'+''''+','+''''+'申请修改'+''''+','+''''+'申请删除'+''''+')) ' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.N37Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 编号 in (select distinct 编号 from t_op_state where 是否完成<>1) ' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.RxDBLookupCombo31KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo13); end; procedure Tfrm_op_railway.wwDBLookupCombo1KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo16); end; procedure Tfrm_op_railway.N9Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'收'+''''+')' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.N20Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee where 类型='+''''+'付'+''''+')' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.t_op_railwayBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_railway); if t_op_railway.State=dsinsert then if not t_op_railway.FieldByName('委托编号').IsNull then delwtno(t_op_railway['委托编号']); end; procedure Tfrm_op_railway.N21Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 not in (select distinct 编号 from t_ch_fee )' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.N24Click(Sender: TObject); begin t_op_railway.Close; t_op_railway.SQL.clear; t_op_railway.SQL.Add('select * from t_op_railway where ' +open_data('0006','录入人','操作员','客服员','no','no') +' and 费用状态<>'+''''+'费用封帐'+'''' +' and 编号 in (select distinct 编号 from t_ch_fee where 费用状态<>'+''''+'结算完毕'+''''+')' +' order by 业务编号 '); t_op_railway.open; end; procedure Tfrm_op_railway.dxDBGrid1Column29CustomDraw(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 Trim(ANode.Strings[dxDBGrid1Column29.Index])='更改单' then AColor:=clred; AFont.Color:=clblack; end; procedure Tfrm_op_railway.N26Click(Sender: TObject); begin if t_op_railway.IsEmpty then exit; if not do_data('0006',t_op_railway.FieldByName('录入人').asstring ,t_op_railway.FieldByName('操作员').asstring ,t_op_railway.FieldByName('揽货人').asstring ,t_op_railway.FieldByName('客服员').asstring ,'','') then begin showmessage('你无权修改此数据!'); abort; end; if t_op_railway.FieldByName('业务状态').asstring='业务封帐' then begin showmessage('此票业务状态已经为业务封帐状态,不能修改!'); abort; end; if t_op_railway1=nil then exit; if (t_op_railway.State=dsinsert)or(t_op_railway.State=dsedit) then t_op_railway.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_railway1.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_railway.RxDBLookupCombo16Change(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if (t_op_railway1.DataSet.State=dsinsert)or(t_op_railway1.DataSet.State=dsedit)then begin if RxDBLookupCombo16.DisplayValue<>'' then t_op_railway1.DataSet['发货人代码']:=frm_data_share.t_crm_client_shiper.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_railway.RxDBLookupCombo17Change(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if (t_op_railway1.DataSet.State=dsinsert)or(t_op_railway1.DataSet.State=dsedit)then begin if RxDBLookupCombo17.DisplayValue<>'' then t_op_railway1.DataSet['收货人代码']:=frm_data_share.t_crm_client_shouhuo.fieldbyname('快捷代码').asstring; end; end; procedure Tfrm_op_railway.RxDBLookupCombo16KeyPress(Sender: TObject; var Key: Char); begin if key = #13 then begin Key :=#0; Perform(CM_DialogKey,VK_TAB,0); end; end; procedure Tfrm_op_railway.RxDBLookupCombo17KeyPress(Sender: TObject; var Key: Char); begin key_DBMemo(Key,DBMemo4); end; procedure Tfrm_op_railway.RxDBLookupCombo12KeyPress(Sender: TObject; var Key: Char); begin key_RxDBLookupCombo(Key,RxDBLookupCombo29); end; procedure Tfrm_op_railway.RxDBLookupCombo16Enter(Sender: TObject); begin RxLookupComboEnter(TRxDBLookupCombo(Sender)); end; procedure Tfrm_op_railway.RxDBLookupCombo16Exit(Sender: TObject); begin RxLookupComboExit(TRxDBLookupCombo(Sender)); end; procedure Tfrm_op_railway.bsSkinSpeedButton1Click(Sender: TObject); begin if t_op_railway1.DataSet.FieldByName('委托编号').IsNull or (t_op_railway1.DataSet['委托编号']='') then begin t_op_railway1.DataSet.edit; if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_railway1.DataSet['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway1.DataSet['会计期间']) else t_op_railway1.DataSet['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway1.DataSet['发车日期']); end; end; procedure Tfrm_op_railway.bsSkinPageControl1Change(Sender: TObject); begin if not railwayopen then exit; if bsSkinPageControl1.ActivePage=bsSkinTabSheet8 then begin if Letter_flag=0 then begin frm_op_letter:=tfrm_op_letter.Create (self); frm_op_letter.bsTypeid:=1; if t_op_railway1.DataSet.FieldByName('装运方式').AsString<>'铁路分票' then frm_op_letter.t_op_letter.DataSource:=t_op_railway1 else frm_op_letter.t_op_letter.DataSource:=t_op_railway_fen1; frm_op_letter.ManualDock(bsSkinTabSheet8,nil,alClient); frm_op_letter.show; Letter_flag:=1; end; exit; end; if bsSkinPageControl1.ActivePage<>bsSkinTabSheet1 then begin if t_op_railway.State in [dsedit,dsinsert] then t_op_railway.Post; end else begin t_op_railway.Refresh; end; end; procedure Tfrm_op_railway.RxDBLookupCombo11Change(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if RxDBLookupCombo11.DisplayValue='' then exit; t_op_railway1.DataSet.fieldbyname('货物描述').asstring:=t_op_railway1.DataSet.fieldbyname('货物描述').asstring+#13#10+frm_data_share.t_code_goods['货物描述']; end; end; procedure Tfrm_op_railway.DBEdit6KeyPress(Sender: TObject; var Key: Char); begin if key = #13 then begin Key :=#0; Perform(CM_DialogKey,VK_TAB,0); end; end; procedure Tfrm_op_railway.bsSkinButton9Click(Sender: TObject); begin sys_print('铁路运输委托',2,t_op_railway1,nil,nil,nil,t_op_railway_fen1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_railway.bsSkinButton15Click(Sender: TObject); begin // sys_print('铁路运输集装箱单据',2,t_op_railway1,nil,nil,nil,t_op_railway_fen1,nil,nil,nil,nil,nil,nil); if (t_op_railway_fen.State=dsinsert)or(t_op_railway_fen.State=dsedit) then t_op_railway_fen.post; end; procedure Tfrm_op_railway.N29Click(Sender: TObject); begin if t_op_railway_fen.IsEmpty then exit; t_op_railway_fen.edit; t_op_railway_fen['主编号']:=t_op_railway_fen['编号']; t_op_railway_fen.post; t_op_railway_fen.Requery(); end; procedure Tfrm_op_railway.wwDBLookupCombo52Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if wwDBLookupCombo52.text='' then exit; if frm_data_share.t_code_railport.locate('口岸代码',wwDBLookupCombo52.text,[]) then begin t_op_railway1.DataSet['发站']:=frm_data_share.t_code_railport['中文名']; t_op_railway1.DataSet['发站英文']:=frm_data_share.t_code_railport['英文名']; end; end; end; procedure Tfrm_op_railway.wwDBLookupCombo2Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if wwDBLookupCombo2.text='' then exit; if frm_data_share.t_code_railport.locate('口岸代码',wwDBLookupCombo2.text,[]) then begin t_op_railway1.DataSet['到达站']:=frm_data_share.t_code_railport['中文名']; t_op_railway1.DataSet['到达站英文']:=frm_data_share.t_code_railport['英文名']; end; end; end; procedure Tfrm_op_railway.wwDBLookupCombo5Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if wwDBLookupCombo5.text='' then exit; if frm_data_share.t_code_railport.locate('口岸代码',wwDBLookupCombo5.text,[]) then begin t_op_railway1.DataSet['出口口岸']:=frm_data_share.t_code_railport['详细内容']; end; end; end; procedure Tfrm_op_railway.wwDBLookupCombo6Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if wwDBLookupCombo6.text='' then exit; if frm_data_share.t_code_railport.locate('口岸代码',wwDBLookupCombo6.text,[]) then begin t_op_railway1.DataSet['中转站']:=frm_data_share.t_code_railport['英文名']; end; end; end; procedure Tfrm_op_railway.RxDBLookupCombo3Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if RxDBLookupCombo3.DisplayValue='' then exit; t_op_railway1.DataSet['箱型代码']:=frm_data_share.t_code_ctn['代码']; t_op_railway1.DataSet['箱皮重']:=frm_data_share.t_code_ctn['箱皮重']; t_op_railway1.DataSet['件数大写']:=frm_data_share.t_code_ctn['中文说明']; t_op_railway1.DataSet['包装种类']:=frm_data_share.t_code_ctn['英文说明']; end; end; procedure Tfrm_op_railway.t_op_railway_fenAfterPost(DataSet: TDataSet); var book1:Tbookmark; aQuery:TAdoQuery; pkgs,kgs,cbm:double; bsno:string; begin bsno:=dataSet.fieldbyname('编号').asstring; aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; sql.Add('select sum(件数) as 件数,sum(重量) as 重量,sum(尺码) as 尺码 from t_op_railway where 装运方式=''铁路分票'' and 主编号='''+Dataset.fieldbyname('主编号').AsString+''''); open; pkgs:=fieldbyname('件数').AsFloat; kgs:=fieldbyname('重量').AsFloat; cbm:=fieldbyname('尺码').AsFloat; if not IsEmpty then begin close;sql.clear; sql.Add('update t_op_railway set 件数='+floattostr(pkgs)+',重量='+floattostr(kgs)+',尺码='+floattostr(cbm)+' where 编号='''+Dataset.fieldbyname('主编号').AsString+''''); ExecSQL; t_op_railway.Refresh; end; end; finally FreeAndNil(aQuery); dataset.Locate('编号',bsno,[]); end; { book1:=v_op_railway_detail.GetBookmark; // update_railctn(t_op_railway_fen); v_op_railway_detail.Requery(); v_op_railway_detail.GotoBookmark(book1); } //ljp end; procedure Tfrm_op_railway.t_raildatecharge(Sender: TField); begin if sender.DataSet.State in [dsedit,dsinsert] then begin if (not sender.DataSet.fieldbyname('到山口时间').IsNull) and (not sender.DataSet.fieldbyname('出山口时间').IsNull) then begin sender.DataSet.fieldbyname('滞留天数').AsInteger:=DaysBetween(sender.DataSet.fieldbyname('出山口时间').asdatetime,sender.DataSet.fieldbyname('到山口时间').asdatetime); end; end; end; procedure Tfrm_op_railway.t_railkgscharge(Sender: TField); var sl:tstringlist; begin if sender.DataSet.State in [dsedit,dsinsert] then begin if (sender.DataSet.fieldbyname('箱皮重').asfloat<>0) and (sender.DataSet.fieldbyname('重量').asfloat<>0) then begin sl:=TStringList.Create; try sl.Add(sender.DataSet.fieldbyname('重量').asstring); sl.Add(sender.DataSet.fieldbyname('箱皮重').asstring); sl.Add('=========='); sl.Add(floattostr(sender.DataSet.fieldbyname('箱皮重').asfloat+sender.DataSet.fieldbyname('重量').asfloat)+'KGS'); sender.DataSet.fieldbyname('确认重量').Asstring:=sl.Text; sender.DataSet.fieldbyname('重量大写').Asstring:=change(sender.DataSet.fieldbyname('箱皮重').asfloat+sender.DataSet.fieldbyname('重量').asfloat,false,true)+' 公斤'; finally freeandnil(sl); end; end; end; end; procedure Tfrm_op_railway.t_op_railway_fenAfterOpen(DataSet: TDataSet); begin dataset.FieldByName('重量').OnChange:=t_railkgscharge; dataset.FieldByName('箱皮重').OnChange:=t_railkgscharge; dataset.FieldByName('到山口时间').OnChange:=t_raildatecharge; dataset.FieldByName('出山口时间').OnChange:=t_raildatecharge; DBRichEdit3.DefAttributes.Size:=9; DBRichEdit1.DefAttributes.Size:=9; DBRichEdit2.DefAttributes.Size:=9; DBRichEdit4.DefAttributes.Size:=9; end; procedure Tfrm_op_railway.cxGrid1DBTableView1CellClick( Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); begin // bsSkinButton11.OnClick(sender); end; procedure Tfrm_op_railway.wwDBComboBox4Change(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if wwDBComboBox4.text='铁路主票' then begin tab2.TabVisible:=true; DBEdit10.ReadOnly:=true; RxDBLookupCombo3.ReadOnly:=true; RxDBLookupCombo4.ReadOnly:=true; DBEdit21.ReadOnly:=true; wwDBComboBox1.ReadOnly:=true; DBEdit22.ReadOnly:=true; DBEdit81.ReadOnly:=true; wwDBLookupCombo61.ReadOnly:=true; DBEdit82.ReadOnly:=true; DBEdit83.ReadOnly:=true; RxDBLookupCombo5.ReadOnly:=true; DBEdit17.ReadOnly:=true; DBEdit10.Color:=clBtnFace; RxDBLookupCombo3.Color:=clBtnFace; RxDBLookupCombo4.Color:=clBtnFace; DBEdit21.Color:=clBtnFace; wwDBComboBox1.Color:=clBtnFace; DBEdit22.Color:=clBtnFace; DBEdit81.Color:=clBtnFace; wwDBLookupCombo61.Color:=clBtnFace; DBEdit82.Color:=clBtnFace; DBEdit83.Color:=clBtnFace; RxDBLookupCombo5.Color:=clBtnFace; DBEdit17.Color:=clBtnFace; bsSkinButton14.Visible:=true; // bsSkinPanel3.Parent:=bsSkinPageControl2; end else begin tab2.TabVisible:=false; DBEdit10.ReadOnly:=false; RxDBLookupCombo3.ReadOnly:=false; RxDBLookupCombo4.ReadOnly:=false; DBEdit21.ReadOnly:=false; wwDBComboBox1.ReadOnly:=false; DBEdit22.ReadOnly:=false; DBEdit81.ReadOnly:=false; wwDBLookupCombo61.ReadOnly:=false; DBEdit82.ReadOnly:=false; DBEdit83.ReadOnly:=false; RxDBLookupCombo5.ReadOnly:=false; DBEdit17.ReadOnly:=false; DBEdit10.Color:=clWindow; RxDBLookupCombo3.Color:=clWindow; RxDBLookupCombo4.Color:=clWindow; DBEdit21.Color:=clWindow; wwDBComboBox1.Color:=clWindow; DBEdit22.Color:=clWindow; DBEdit81.Color:=clWindow; wwDBLookupCombo61.Color:=clWindow; DBEdit82.Color:=clWindow; DBEdit83.Color:=clWindow; RxDBLookupCombo5.Color:=clWindow; DBEdit17.Color:=clWindow; bsSkinButton14.Visible:=false; // bsSkinPanel3.Parent:=bsSkinScrollBox1; end; end; procedure Tfrm_op_railway.dxDBGrid2DblClick(Sender: TObject); begin bsSkinButton11.Caption:='返回主票'; try t_op_railway1.Enabled:=false; t_op_railway1.DataSet:=t_op_railway_fen; finally t_op_railway1.Enabled:=true; end; end; procedure Tfrm_op_railway.bsSkinButton32Click(Sender: TObject); begin if (t_op_railway.State=dsinsert)or(t_op_railway.State=dsedit) then t_op_railway.post; if (t_op_railway_fen.State=dsinsert)or(t_op_railway_fen.State=dsedit) then t_op_railway_fen.post; try frm_op_railway_add:=tfrm_op_railway_add.Create (self); if not t_op_railway1.DataSet.IsEmpty then begin frm_op_railway_add.shiptype:=''; frm_op_railway_add.BsType:=''; //铁路分票 frm_op_railway_add.PNO:=''; frm_op_railway_add.shiptype:=t_op_railway1.DataSet.FieldByName('发运形式').AsString; frm_op_railway_add.BsType:='RAILHBL'; //铁路分票 frm_op_railway_add.PNO:=t_op_railway1.DataSet.FieldByName('委托编号').AsString; end; frm_op_railway_add.data1.Enabled:=false; frm_op_railway_add.data1.DataSet:=t_op_railway_fen; frm_op_railway_add.data1.Enabled:=true; frm_op_railway_add.bsSkinCheckRadioBox6.Checked:=true; frm_op_railway_add.bsSkinCheckRadioBox1.Enabled:=false; frm_op_railway_add.bsSkinCheckRadioBox5.Enabled:=false; frm_op_railway_add_num:=3; frm_op_railway_add.ShowModal; finally frm_op_railway_add.Free; end; end; procedure Tfrm_op_railway.t_op_railwayAfterOpen(DataSet: TDataSet); begin dataset.FieldByName('重量').OnChange:=t_railkgscharge; dataset.FieldByName('箱皮重').OnChange:=t_railkgscharge; dataset.FieldByName('到山口时间').OnChange:=t_raildatecharge; dataset.FieldByName('出山口时间').OnChange:=t_raildatecharge; DBRichEdit3.DefAttributes.Size:=9; DBRichEdit1.DefAttributes.Size:=9; DBRichEdit2.DefAttributes.Size:=9; DBRichEdit4.DefAttributes.Size:=9; end; procedure Tfrm_op_railway.bsSkinButton33Click(Sender: TObject); begin bsSkinButton11.Caption:='返回主票'; try t_op_railway1.Enabled:=false; t_op_railway1.DataSet:=t_op_railway_fen; finally t_op_railway1.Enabled:=true; end; end; procedure Tfrm_op_railway.bsSkinButton34Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton34.ClientToScreen(Point(0,bsSkinButton34.Height)); PopupMenu4.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_op_railway.bsSkinButton31Click(Sender: TObject); begin sys_print('铁路运输单证',2,t_op_railway1,nil,nil,nil,t_op_railway_fen1,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_op_railway.t_op_railway_fenBeforeCancel(DataSet: TDataSet); begin delete_no(t_op_railway_fen); if t_op_railway_fen.State=dsinsert then if not t_op_railway_fen.FieldByName('委托编号').IsNull then delwtno(t_op_railway_fen['委托编号']); end; procedure Tfrm_op_railway.t_op_railway_fenBeforePost(DataSet: TDataSet); begin table_before_post(t_op_railway_fen,'委托单位'); table_before_post(t_op_railway_fen,'操作员'); table_before_post(t_op_railway_fen,'揽货人'); table_before_post(t_op_railway_fen,'客服员'); table_before_post(t_op_railway_fen,'接单日期'); // table_before_post(t_op_railway_fen,'发车日期'); table_before_post(t_op_railway_fen,'业务来源'); table_before_post(t_op_railway_fen,'销售部门'); table_before_post(t_op_railway_fen,'操作部门'); if op_empty('t_op_railway',t_op_railway_fen) then abort; if Trim(frm_data_share.t_sys_noset.fieldbyname('出号规则').Asstring)='自动取号' then if t_op_railway_fen.FieldByName('委托编号').IsNull or (trim(t_op_railway_fen['委托编号'])='') then if Trim(frm_data_share.t_sys_noset.fieldbyname('日期规则').Asstring)='会计期间' then t_op_railway_fen['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway_fen['会计期间']) else t_op_railway_fen['委托编号']:=getwtno(5,subComp,department,employee,t_op_railway_fen['接单日期']); if (not t_op_railway_fen.fieldbyname('发车日期').isnull) and (t_op_railway_fen.fieldbyname('发车日期').oldvalue<>t_op_railway_fen.fieldbyname('发车日期').value) then if (t_op_railway_fen.fieldbyname('业务类型').asstring<>'更改单') and (Logininfo.endday>=t_op_railway_fen.fieldbyname('发车日期').asdatetime) then begin showmessage('此发车日期所在期间已月末结账,不能添加修改业务!!'); abort; end; if t_op_railway_fen.FieldByName('委托单位').OldValue<>t_op_railway_fen.FieldByName('委托单位').asstring then begin if frm_data_share.t_crm_client_all.Locate('客户简称',t_op_railway_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_railway_fen.State=dsinsert then begin if t_op_railway_fen.fieldbyname('业务编号').asstring=''then begin t_op_railway_fen['业务编号']:=get_no(t_op_railway_fen.fieldbyname('会计期间').AsDateTime,getbsno(Logininfo.RailWayBsNo,'RW')); end; t_op_railway_fen['主编号']:=t_op_railway['编号']; t_op_railway_fen['业务状态']:='接受委托'; t_op_railway_fen['费用状态']:='录入状态'; end; if strtobool(get_parameters_value(45,'false')) then begin if (trim(t_op_railway_fen.fieldbyname('委托编号').asstring)='') or (t_op_railway_fen.fieldbyname('业务类型').asstring='更改单') then begin t_op_railway_fen['委托标准']:=t_op_railway_Fen['编号']; end else begin t_op_railway_fen['委托标准']:=t_op_railway_fen['委托编号']; end; end else begin t_op_railway_fen['委托标准']:=t_op_railway_fen['编号']; end; end; procedure Tfrm_op_railway.N27Click(Sender: TObject); begin if t_op_railway_fen.IsEmpty then exit; t_op_railway_fen.edit; t_op_railway_fen['主编号']:=t_op_railway_fen['编号']; t_op_railway_fen['装运方式']:='铁路单票'; t_op_railway_fen.post; t_op_railway_fen.Requery(); end; procedure Tfrm_op_railway.N76Click(Sender: TObject); begin update_grid_view_no(dxdbgrid2); end; procedure Tfrm_op_railway.N78Click(Sender: TObject); begin update_grid_view_all(dxdbgrid2); end; procedure Tfrm_op_railway.N80Click(Sender: TObject); begin update_grid(dxdbgrid2,207); end; procedure Tfrm_op_railway.N32Click(Sender: TObject); begin if t_op_railway.IsEmpty then exit; if t_op_railway.FieldByName('装运方式').asstring='铁路单票' then exit; if t_op_railway.FieldByName('装运方式').asstring='铁路主票'then begin if not t_op_railway_fen.IsEmpty then begin showmessage('当前主票含有分票信息,不能更改为铁路单票!!'); exit; end; end; t_op_railway.edit; t_op_railway['装运方式']:='铁路单票'; t_op_railway['主编号']:=t_op_railway['编号']; t_op_railway.post; end; procedure Tfrm_op_railway.N41Click(Sender: TObject); begin if t_op_railway.IsEmpty then exit; if t_op_railway.FieldByName('装运方式').asstring='铁路主票' then exit; t_op_railway.edit; t_op_railway['装运方式']:='铁路主票'; t_op_railway['主编号']:=t_op_railway['编号']; t_op_railway.post; end; procedure Tfrm_op_railway.N39Click(Sender: TObject); begin if t_op_railway.IsEmpty then exit; if t_op_railway.FieldByName('装运方式').asstring='铁路分票' then exit; if t_op_railway.FieldByName('装运方式').asstring='铁路主票'then begin if not t_op_railway_fen.IsEmpty then begin showmessage('当前主票含有分票信息,不能更改为分票!!'); exit; end; end; t_op_railway.edit; t_op_railway['装运方式']:='铁路分票'; t_op_railway['主编号']:=t_op_railway['编号']; t_op_railway.post; end; procedure Tfrm_op_railway.bsSkinButton38Click(Sender: TObject); var book1:Tbookmark; begin if t_op_railway1.DataSet=nil then exit; book1:=t_op_railway1.DataSet.GetBookmark; t_op_railway1.DataSet.Refresh; t_op_railway1.DataSet.GotoBookmark(book1); if t_op_railway_fen1.DataSet=nil then exit; book1:=t_op_railway_fen1.DataSet.GetBookmark; t_op_railway_fen1.DataSet.Refresh; t_op_railway_fen1.DataSet.GotoBookmark(book1); end; procedure Tfrm_op_railway.wwDBComboBox2Change(Sender: TObject); begin if t_op_railway1.DataSet=nil then exit; if wwDBComboBox2.text='内贸' then begin bsSkinGroupBox2.Visible:=false; bsSkinGroupBox3.Visible:=false; bsSkinGroupBox4.Visible:=false; bsSkinGroupBox5.Visible:=false; bsSkinGroupBox9.Visible:=false; bsSkinGroupBox1.Visible:=true; end else begin bsSkinGroupBox2.Visible:=true; bsSkinGroupBox3.Visible:=true; bsSkinGroupBox4.Visible:=true; bsSkinGroupBox5.Visible:=true; bsSkinGroupBox9.Visible:=true; bsSkinGroupBox1.Visible:=false; end; end; procedure Tfrm_op_railway.wwDBLookupCombo1Change(Sender: TObject); begin if (t_op_railway1.DataSet.state=dsinsert)or(t_op_railway1.DataSet.state=dsedit)then begin if wwDBLookupCombo1.text='' then exit; if frm_data_share.t_code_railport.locate('口岸代码',wwDBLookupCombo1.text,[]) then begin t_op_railway1.DataSet['到达站']:=frm_data_share.t_code_railport['中文名']; t_op_railway1.DataSet['到达站英文']:=frm_data_share.t_code_railport['英文名']; end; end; end; procedure Tfrm_op_railway.bsSkinButton14Click(Sender: TObject); begin if not (if_open('297') or if_open('298')) 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_railway_fen; with frm_ch_fee_zhupiao do begin if if_open('297') then begin fra_fee_zhu1.t_ch_accept.close; fra_fee_zhu1.t_ch_accept.Parameters[1].value:=t_op_railway.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_accept.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_railway; fra_fee_zhu1.dxDBGrid1.FullExpand; fra_fee_zhu1.bsSkinPanel3.visible:=true; end else fra_fee_zhu1.bsSkinPanel3.visible:=false; if if_open('298') then begin fra_fee_zhu1.t_ch_pay.close; fra_fee_zhu1.t_ch_pay.Parameters[1].value:=t_op_railway.fieldbyname('编号').asstring; fra_fee_zhu1.t_ch_pay.open; fra_fee_zhu1.zhupiao1.DataSet:=t_op_railway; 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_railway.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_railway.fieldbyname('编号').asstring; fra_fee_zhu1.t_op_gain_fen.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_railway.fra_op_letter_free1bsSkinButton1Click( Sender: TObject); begin fra_op_letter_free1.bsSkinButton1Click(Sender); end; procedure Tfrm_op_railway.bsSkinButton12Click(Sender: TObject); begin bsSkinPanel5.Visible:=true; end; procedure Tfrm_op_railway.bsSkinButton17Click(Sender: TObject); begin bsSkinPanel5.Visible:=False; end; procedure Tfrm_op_railway.bsSkinButton16Click(Sender: TObject); var i :Integer; yjid:array of string ; val,fenbsno:string ; aAdoUpdate : TADOQuery; begin setlength(yjid,cxGrid1DBTableView1.Controller.SelectedRowCount); cxGrid1DBTableView1.BeginUpdate ; aAdoUpdate :=CreateAdoQuery; try for i:=0 to cxGrid1DBTableView1.Controller.SelectedRowCount-1 do begin //焦点移到选中列 val:=cxGrid1DBTableView1.DataController.GetDisplayText(cxGrid1DBTableView1.Controller.SelectedRows[I].RecordIndex,0) ; yjid[i]:=val ; end; //得到选中列的值 for i:=0 to high(yjid) do begin if t_op_railway.Locate('业务编号',yjid[i],[]) then begin fenbsno:=t_op_railway.FieldByName('编号').Value; t_op_railway.Edit; t_op_railway.FieldByName(bsSkinComboBox1.Text).Value:=FormatDateTime('YYYY-MM-DD',bsSkinDateEdit1.Date); t_op_railway.Post; end ; with aAdoUpdate do begin Close;SQL.Clear; SQL.Add('Update t_op_railway set '+bsSkinComboBox1.Text+'=:fieldValue'); SQL.Add('where 主编号=:bsno and 主编号<>编号'); Parameters.ParamByName('fieldValue').Value:=FormatDateTime('YYYY-MM-DD',bsSkinDateEdit1.Date); Parameters.ParamByName('bsno').Value:=fenbsno; ExecSQL; end; end ; finally cxGrid1DBTableView1.EndUpdate ; bsSkinPanel5.Visible:=False; FreeAndNil(aAdoUpdate); end; end; procedure Tfrm_op_railway.FormCreate(Sender: TObject); begin Letter_flag:=0; end; procedure Tfrm_op_railway.bsSkinButton36Click(Sender: TObject); begin t_ch_fee.close; t_ch_fee.Parameters[0].value:=t_op_railway_fen.fieldbyname('编号').asstring; t_ch_fee.open; if not t_ch_fee.IsEmpty then begin showmessage('注意!业务存在费用信息,不能删除!!'); exit; end; table_delete(TAdoQuery(t_op_railway_fen1.DataSet)); end; procedure Tfrm_op_railway.t_op_railwayBeforeDelete(DataSet: TDataSet); begin op_befor_post(t_op_railway,'0006'); if t_op_railway.FieldByName('装运方式').asstring<>'铁路分票'then if not t_op_railway.FieldByName('委托编号').IsNull then delwtno(t_op_railway['委托编号']); // delete_add(4,t_op_airi); 123 end; end.