You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

786 lines
23 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_op_truck;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, XPMenu, Menus, DB, ADODB, dxDBTLCl, dxGrClms,
dxDBCtrl, dxDBGrid, dxTL, dxCntner, Mask, wwdbedit, Wwdotdot, Wwdbcomb,
wwdblook, RxLookup, wwdbdatetimepicker, StdCtrls, bsSkinCtrls, ExtCtrls,
DBCtrls, ComCtrls, bsSkinTabs, bsdbctrls, Grids, Wwdbigrd, Wwdbgrid;
type
Tfrm_op_truck = class(TForm)
Panel2: TPanel;
t_op_seae: TADOQuery;
t_op_seae1: TDataSource;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
XPMenu1: TXPMenu;
t_op_letter: TADOQuery;
t_op_letter1: TDataSource;
t_op_letter_pc: TADOQuery;
t_op_letter_pc1: TDataSource;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column86: TdxDBGridCheckColumn;
dxDBGrid1Column87: TdxDBGridCheckColumn;
dxDBGrid1Column88: TdxDBGridColumn;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column13: TdxDBGridMaskColumn;
dxDBGrid1Column14: TdxDBGridMaskColumn;
dxDBGrid1Column15: TdxDBGridMaskColumn;
dxDBGrid1Column16: TdxDBGridDateColumn;
dxDBGrid1Column17: TdxDBGridDateColumn;
dxDBGrid1Column19: TdxDBGridMaskColumn;
dxDBGrid1Column20: TdxDBGridMaskColumn;
dxDBGrid1Column36: TdxDBGridMaskColumn;
dxDBGrid1Column37: TdxDBGridMaskColumn;
dxDBGrid1Column38: TdxDBGridMaskColumn;
dxDBGrid1Column39: TdxDBGridColumn;
dxDBGrid1Column40: TdxDBGridColumn;
dxDBGrid11: TdxDBGridMaskColumn;
dxDBGrid12: TdxDBGridMaskColumn;
dxDBGrid13: TdxDBGridMaskColumn;
dxDBGrid14: TdxDBGridMaskColumn;
dxDBGrid15: TdxDBGridMaskColumn;
dxDBGrid16: TdxDBGridMaskColumn;
dxDBGrid17: TdxDBGridMaskColumn;
dxDBGrid18: TdxDBGridMaskColumn;
dxDBGrid19: TdxDBGridMaskColumn;
dxDBGrid110: TdxDBGridMaskColumn;
dxDBGrid1Column61: TdxDBGridMaskColumn;
dxDBGrid1TEU: TdxDBGridMaskColumn;
dxDBGrid1Column63: TdxDBGridMaskColumn;
dxDBGrid1Column64: TdxDBGridMaskColumn;
dxDBGrid1Column65: TdxDBGridDateColumn;
dxDBGrid1Column66: TdxDBGridMaskColumn;
dxDBGrid1Column67: TdxDBGridMaskColumn;
dxDBGrid1Column72: TdxDBGridMaskColumn;
dxDBGrid1Column74: TdxDBGridMaskColumn;
bsSkinTabSheet2: TbsSkinTabSheet;
dxDBGrid2: TdxDBGrid;
dxDBGridMaskColumn1: TdxDBGridMaskColumn;
dxDBGrid1HEAD_TO: TdxDBGridMaskColumn;
dxDBGridColumn1: TdxDBGridColumn;
dxDBGridColumn2: TdxDBGridColumn;
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton7: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinPanel4: TbsSkinPanel;
Label13: TLabel;
Label14: TLabel;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
Button5: TButton;
Label29: TLabel;
DBEdit14: TDBEdit;
Label49: TLabel;
DBEdit31: TDBEdit;
Label50: TLabel;
DBEdit32: TDBEdit;
Button2: TButton;
DBEdit17: TDBEdit;
Label15: TLabel;
Label31: TLabel;
DBEdit18: TDBEdit;
Label32: TLabel;
DBEdit19: TDBEdit;
Label33: TLabel;
DBEdit20: TDBEdit;
Label28: TLabel;
DBEdit11: TDBEdit;
Button1: TButton;
DBEdit21: TDBEdit;
Label34: TLabel;
Label35: TLabel;
DBEdit22: TDBEdit;
Label36: TLabel;
DBEdit23: TDBEdit;
Button3: TButton;
DBEdit24: TDBEdit;
Label37: TLabel;
Label38: TLabel;
DBEdit25: TDBEdit;
DBMemo13: TDBMemo;
Label39: TLabel;
bsSkinPanel5: TbsSkinPanel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
DBEdit10: TDBEdit;
DBEdit12: TDBEdit;
DBEdit13: TDBEdit;
DBEdit45: TDBEdit;
DBEdit46: TDBEdit;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N21: TMenuItem;
N22: TMenuItem;
N20: TMenuItem;
bsSkinButton14: TbsSkinButton;
RxDBLookupCombo10: TRxDBLookupCombo;
dxDBGrid1Column41: TdxDBGridColumn;
dxDBGrid1Column42: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
bsSkinPanel1: TbsSkinPanel;
Label6: TLabel;
Label3: TLabel;
Label1: TLabel;
Label2: TLabel;
Label10: TLabel;
Label5: TLabel;
Label9: TLabel;
Label8: TLabel;
Label11: TLabel;
Label30: TLabel;
Label125: TLabel;
Label16: TLabel;
Label7: TLabel;
Label4: TLabel;
Label12: TLabel;
Edit1: TEdit;
Edit4: TEdit;
Edit2: TEdit;
Edit3: TEdit;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
RxDBLookupCombo2: TRxDBLookupCombo;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Edit7: TEdit;
wwDBLookupCombo49: TwwDBLookupCombo;
RxDBLookupCombo6: TRxDBLookupCombo;
wwDBComboBox1: TwwDBComboBox;
wwDBDateTimePicker5: TwwDBDateTimePicker;
wwDBDateTimePicker6: TwwDBDateTimePicker;
bsSkinButton8: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton15: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
Label21: TLabel;
RxDBLookupCombo1: TRxDBLookupCombo;
Label26: TLabel;
DBEdit3: TDBEdit;
Label27: TLabel;
DBEdit4: TDBEdit;
t_op_letter_pc_ctn1: TDataSource;
t_op_letter_pc_ctn: TADOQuery;
bsSkinPanel6: TbsSkinPanel;
wwDBGrid1: TwwDBGrid;
bsSkinPanel7: TbsSkinPanel;
bsSkinDBNavigator1: TbsSkinDBNavigator;
wwDBLookupCombo1: TwwDBLookupCombo;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure t_op_letterAfterInsert(DataSet: TDataSet);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_op_letterBeforeInsert(DataSet: TDataSet);
procedure t_op_letter_pcBeforeInsert(DataSet: TDataSet);
procedure t_op_letter_pcAfterInsert(DataSet: TDataSet);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N21Click(Sender: TObject);
procedure N20Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure dxDBGrid1DblClick(Sender: TObject);
procedure t_op_letterBeforeEdit(DataSet: TDataSet);
procedure bsSkinButton14Click(Sender: TObject);
procedure bsSkinButton16Click(Sender: TObject);
procedure t_op_seaeBeforeEdit(DataSet: TDataSet);
procedure bsSkinButton15Click(Sender: TObject);
procedure t_op_seaeBeforePost(DataSet: TDataSet);
procedure Panel2Resize(Sender: TObject);
procedure t_op_letter_pc_ctnAfterInsert(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_truck: Tfrm_op_truck;
frm_op_truck_insert:boolean;
implementation
uses u_main, u_data_share, u_code_send_head, u_code_truck_client,
u_code_truck_changzhan, my_sys_function, my_sys_chat;
{$R *.dfm}
procedure Tfrm_op_truck.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_op_truck.Hide;
frm_op_truck.ManualFloat(frm_op_truck.BoundsRect );
frm_main.freeTabs('frm_op_truck');
action:=cafree;
frm_op_truck:=nil;
end;
procedure Tfrm_op_truck.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_truck.bsSkinButton10Click(Sender: TObject);
var
str:widestring;
begin
if (wwDBDateTimePicker5.text<>'')or(wwDBDateTimePicker6.text<>'') then
begin
str:='where <20>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>=1';
if wwDBDateTimePicker5.text<>'' then
str:=str+' and <20>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker5.text+'''';
if wwDBDateTimePicker6.text<>'' then
str:=str+' and <20>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker6.text+'''';
end
else
begin
if wwDBComboBox1.text='' then
str:='where <20><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>=1 and <20>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>=0';
if wwDBComboBox1.text='û<><C3BB><EFBFBD>ɳ<EFBFBD>' then
str:='where <20><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>=1 and <20>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>=0';
if wwDBComboBox1.text='<27>Ѿ<EFBFBD><D1BE>ɳ<EFBFBD>' then
str:='where <20><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>=1 and <20>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>=1';
end;
if Edit1.text<>''then
str:=str+' and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit4.text<>''then
str:=str+' and ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit3.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
if RxDBLookupCombo2.DisplayValues[1]<>''then
str:=str+' and ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
if RxDBLookupCombo6.DisplayValues[1]<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValues[1]+'''';
if wwDBLookupCombo49.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit7.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if RxDBLookupCombo1.DisplayValues[1]<>''then
str:=str+' and <20><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>='+''''+RxDBLookupCombo1.DisplayValues[1]+'''';
t_op_seae.close;
t_op_seae.sql.clear;
t_op_seae.sql.add('select * from t_op_seae '+str+default_sort(53,'t_op_seae','','desc'));
t_op_seae.open;
end;
procedure Tfrm_op_truck.bsSkinButton6Click(Sender: TObject);
begin
Edit1.text:='';
Edit4.text:='';
Edit2.text:='';
Edit3.text:='';
wwDBDateTimePicker1.text:='';
wwDBDateTimePicker2.text:='';
RxDBLookupCombo2.ClearValue;
wwDBDateTimePicker3.text:='';
wwDBDateTimePicker4.text:='';
wwDBLookupCombo49.text:='';
Edit7.text:='';
RxDBLookupCombo1.ClearValue;
RxDBLookupCombo6.ClearValue;
wwDBComboBox1.text:='';
wwDBDateTimePicker5.text:='';
wwDBDateTimePicker6.text:='';
end;
procedure Tfrm_op_truck.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_op_seae,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_op_truck.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_op_truck.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_op_truck.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,100);
end;
procedure Tfrm_op_truck.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_op_truck.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,true,caption);
t_op_seae.open;
t_op_letter.open;
t_op_letter_pc.Open;
t_op_letter_pc_ctn.Open;
end;
procedure Tfrm_op_truck.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
frm_op_truck.bsSkinButton10Click(Sender);
end;
end;
procedure Tfrm_op_truck.bsSkinButton13Click(Sender: TObject);
begin
if t_op_seae.IsEmpty then
exit;
if t_op_seae.FieldByName('<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>').asboolean then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
if t_op_seae.FieldByName('ҵ<><D2B5>״̬').asstring='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>');
exit;
end;
if t_op_seae.fieldbyname('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>').asstring=''then
begin
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>ӣ<EFBFBD><D3A3><EFBFBD>');
exit;
end;
t_op_seae.Edit;
t_op_seae['<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>']:=1;
t_op_seae['<27>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_op_seae.post;
{
Send_op_do('<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD>ɳ<EFBFBD><><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+t_op_seae.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString
+',<2C><><EFBFBD><EFBFBD><E1B5A5>:'+t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><E1B5A5>').AsString,'38',
t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD>Ա').AsString,
t_op_seae.fieldbyname('<27>ͷ<EFBFBD>Ա').AsString,
t_op_seae.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
}
showmessage('ȷ<><C8B7><EFBFBD>ɳ<EFBFBD><C9B3>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_op_truck.bsSkinButton12Click(Sender: TObject);
begin
if t_op_seae.IsEmpty then
exit;
if not t_op_seae.FieldByName('<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>').asboolean then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>');
exit;
end;
if t_op_seae.FieldByName('ҵ<><D2B5>״̬').asstring='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>');
exit;
end;
t_op_seae.Edit;
t_op_seae['<27>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>']:=0;
t_op_seae['<27>ɳ<EFBFBD><C9B3><EFBFBD><EFBFBD><EFBFBD>']:=null;
t_op_seae.post;
showmessage('ȡ<><C8A1><EFBFBD>ɳ<EFBFBD><C9B3>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_op_truck.bsSkinButton8Click(Sender: TObject);
begin
table_Prior(t_op_seae);
end;
procedure Tfrm_op_truck.bsSkinButton11Click(Sender: TObject);
begin
table_Next(t_op_seae);
end;
procedure Tfrm_op_truck.bsSkinButton2Click(Sender: TObject);
begin
t_op_seae.close;
t_op_seae.sql.clear;
t_op_seae.sql.add('select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD>ɳ<EFBFBD>=1 and <20>Ƿ<EFBFBD><C7B7>ɳ<EFBFBD>=0'+default_sort(53,'t_op_seae','','desc'));
t_op_seae.open;
end;
procedure Tfrm_op_truck.t_op_letterAfterInsert(DataSet: TDataSet);
begin
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27>ɳ<EFBFBD>֪ͨ';
t_op_letter['<27><><EFBFBD><EFBFBD>']:=t_op_seae['<27><><EFBFBD><EFBFBD>'];
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD>']:=employee;
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
frm_op_truck_insert:=false;
end;
procedure Tfrm_op_truck.bsSkinButton1Click(Sender: TObject);
begin
if t_op_seae.IsEmpty then
exit;
frm_op_truck_insert:=true;
t_op_letter.Insert;
t_op_letter.Post;
t_op_letter_pc.insert;
end;
procedure Tfrm_op_truck.t_op_letterBeforeInsert(DataSet: TDataSet);
begin
if not frm_op_truck_insert then
abort;
end;
procedure Tfrm_op_truck.t_op_letter_pcBeforeInsert(DataSet: TDataSet);
begin
if t_op_letter.IsEmpty then
abort;
end;
procedure Tfrm_op_truck.t_op_letter_pcAfterInsert(DataSet: TDataSet);
begin
t_op_letter_pc['LE_ID']:=t_op_letter['LE_ID'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_letter.DataSource.DataSet.fieldbyname('<27><>װ<EFBFBD><D7B0>').asstring;
if frm_data_share.t_code_truck_client.Locate('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',t_op_letter.DataSource.DataSet.fieldbyname('ί<>е<EFBFBD>λ').asstring,[])then
begin
t_op_letter_pc['<27><><EFBFBD>ҵ<EFBFBD>ַ']:=frm_data_share.t_code_truck_client['<27><><EFBFBD>ҵ<EFBFBD>ַ'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>']:=frm_data_share.t_code_truck_client['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰']:=frm_data_share.t_code_truck_client['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰'];
end;
t_op_letter_pc['<27><><EFBFBD>䳡վ']:=t_op_letter.DataSource.DataSet.fieldbyname('<27><>վ').asstring;
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ']:=t_op_letter.DataSource.DataSet.fieldbyname('<27><>վ').asstring;
if frm_data_share.t_code_truck_changzhan.Locate('<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>',t_op_letter.DataSource.DataSet.fieldbyname('<27><>վ').asstring,[])then
begin
t_op_letter_pc['<27><><EFBFBD>䳡վ']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>'];
t_op_letter_pc['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>'];
t_op_letter_pc['<27><>վ<EFBFBD>绰']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD>绰'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5>']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>'];
t_op_letter_pc['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>绰']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD>绰'];
end;
end;
procedure Tfrm_op_truck.bsSkinButton3Click(Sender: TObject);
begin
table_post(t_op_letter);
table_post(t_op_letter_pc);
table_post(t_op_letter_pc_ctn);
end;
procedure Tfrm_op_truck.bsSkinButton4Click(Sender: TObject);
begin
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
begin
if not t_op_letter_pc.IsEmpty then
t_op_letter_pc.Delete;
if not t_op_letter.IsEmpty then
t_op_letter.delete;
end;
end;
procedure Tfrm_op_truck.bsSkinButton7Click(Sender: TObject);
begin
if (t_op_letter_pc.State=dsinsert)or(t_op_letter_pc.State=dsedit) then
t_op_letter_pc.cancel;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.cancel;
end;
procedure Tfrm_op_truck.bsSkinButton9Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height));
PopupMenu1.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_op_truck.N1Click(Sender: TObject);
var
book1:Tbookmark;
begin
if t_op_letter.IsEmpty then
exit;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.post;
if (t_op_letter_pc.State=dsinsert)or(t_op_letter_pc.State=dsedit) then
t_op_letter_pc.post;
try
book1:=t_op_letter.GetBookmark;
t_op_letter.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ',1,t_op_letter.DataSource,t_op_letter1,t_op_letter_pc1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_truck.N21Click(Sender: TObject);
var
book1:Tbookmark;
begin
if t_op_letter.IsEmpty then
exit;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.post;
if (t_op_letter_pc.State=dsinsert)or(t_op_letter_pc.State=dsedit) then
t_op_letter_pc.post;
try
book1:=t_op_letter.GetBookmark;
t_op_letter.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ',3,t_op_letter.DataSource,t_op_letter1,t_op_letter_pc1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_truck.N20Click(Sender: TObject);
var
book1:Tbookmark;
begin
if t_op_letter.IsEmpty then
exit;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.post;
if (t_op_letter_pc.State=dsinsert)or(t_op_letter_pc.State=dsedit) then
t_op_letter_pc.post;
try
book1:=t_op_letter.GetBookmark;
t_op_letter.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ɳ<EFBFBD>֪ͨ',2,t_op_letter.DataSource,t_op_letter1,t_op_letter_pc1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_truck.Button5Click(Sender: TObject);
begin
if t_op_letter.isempty then
exit;
if not if_open('144') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
try
frm_code_send_head:=tfrm_code_send_head.Create (self);
code_send_head_num:=4;
frm_code_send_head.ShowModal;
finally
frm_code_send_head.Free;
frm_code_send_head:=nil;
end;
end;
procedure Tfrm_op_truck.Button2Click(Sender: TObject);
begin
if t_op_letter_pc.IsEmpty then
exit;
try
frm_code_truck_changzhan:=tfrm_code_truck_changzhan.Create (self);
code_truck_changzhan_num:=4;
frm_code_truck_changzhan.ShowModal;
finally
frm_code_truck_changzhan.Free;
frm_code_truck_changzhan:=nil;
end;
end;
procedure Tfrm_op_truck.Button1Click(Sender: TObject);
begin
if t_op_letter_pc.IsEmpty then
exit;
try
frm_code_truck_client:=tfrm_code_truck_client.Create (self);
code_truck_client_num:=2;
frm_code_truck_client.ShowModal;
finally
frm_code_truck_client.Free;
frm_code_truck_client:=nil;
end;
end;
procedure Tfrm_op_truck.Button3Click(Sender: TObject);
begin
if t_op_letter_pc.IsEmpty then
exit;
try
frm_code_truck_changzhan:=tfrm_code_truck_changzhan.Create (self);
code_truck_changzhan_num:=5;
frm_code_truck_changzhan.ShowModal;
finally
frm_code_truck_changzhan.Free;
frm_code_truck_changzhan:=nil;
end;
end;
procedure Tfrm_op_truck.dxDBGrid1DblClick(Sender: TObject);
begin
bsSkinTabSheet2.Show;
end;
procedure Tfrm_op_truck.t_op_letterBeforeEdit(DataSet: TDataSet);
begin
if t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD>']<>employee then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD><EFBFBD><EFBFBD>'+t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD>']+'¼<><C2BC><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_op_truck.bsSkinButton14Click(Sender: TObject);
var
afield,bfield: variant;
i: Integer;
pc:boolean;
begin
if t_op_letter.IsEmpty then
begin
showmessage('û<>и<EFBFBD><D0B8><EFBFBD>ĸ<EFBFBD><EFBFBD><E5A3AC><EFBFBD>ܸ<EFBFBD><DCB8><EFBFBD><EFBFBD>½<EFBFBD><C2BD><EFBFBD>');
exit;
end;
afield := vararraycreate([0,t_op_letter.fieldcount-1],varvariant);
for i := 0 to (t_op_letter.fieldcount-1) do
begin
afield[i] :=t_op_letter.fields[i].value ;
end;
if not t_op_letter_pc.IsEmpty then
begin
bfield := vararraycreate([0,t_op_letter_pc.fieldcount-1],varvariant);
for i := 0 to (t_op_letter_pc.fieldcount-1) do
begin
bfield[i] :=t_op_letter_pc.fields[i].value ;
end;
pc:=true;
end;
frm_op_truck_insert:=true;
t_op_letter.append;
for i := 0 to (t_op_letter.fieldcount-1) do
begin
if t_op_letter.fields[i].FieldName<>'LE_ID'then
t_op_letter.fields[i].value := afield[i] ;
end;
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD>']:=employee;
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_op_letter.post;
t_op_letter_pc.append;
for i := 0 to (t_op_letter_pc.fieldcount-1) do
begin
if t_op_letter_pc.fields[i].FieldName<>'LE_ID'then
t_op_letter_pc.fields[i].value := bfield[i] ;
end;
t_op_letter_pc.post;
end;
procedure Tfrm_op_truck.bsSkinButton16Click(Sender: TObject);
begin
table_post(t_op_seae);
end;
procedure Tfrm_op_truck.t_op_seaeBeforeEdit(DataSet: TDataSet);
begin
if t_op_seae.FieldByName('ҵ<><D2B5>״̬').asstring='ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
begin
showmessage('<27><>ǰҵ<C7B0><D2B5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8><C4A3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_op_truck.bsSkinButton15Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD>ɳ<EFBFBD>ͳ<EFBFBD><CDB3>',2,nil,nil,nil,nil,t_op_seae1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_op_truck.t_op_seaeBeforePost(DataSet: TDataSet);
begin
t_op_seae['½<><C2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_seae.fieldbyname('Ӧ<><D3A6>½<EFBFBD><C2BD>').asfloat-t_op_seae.fieldbyname('Ӧ<><D3A6>½<EFBFBD><C2BD>').asfloat;
end;
procedure Tfrm_op_truck.Panel2Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel2.width/10);
bsSkinButton8.width:=i;
bsSkinButton11.width:=i;
bsSkinButton15.width:=i;
bsSkinButton6.width:=i;
bsSkinButton10.width:=i;
bsSkinButton2.width:=i;
bsSkinButton13.width:=i;
bsSkinButton12.width:=i;
bsSkinButton16.width:=i;
end;
procedure Tfrm_op_truck.t_op_letter_pc_ctnAfterInsert(DataSet: TDataSet);
begin
t_op_letter_pc_ctn['LE_ID']:=t_op_letter['LE_ID'];
end;
end.