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.

1065 lines
30 KiB
Plaintext

11 months ago
unit u_op_letter;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, bsSkinCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
dxDBGrid, StdCtrls, Mask, DBCtrls, Menus, wwdbdatetimepicker, Grids,
DBGrids, XPMenu, bsdbctrls, Wwdbigrd, Wwdbgrid, wwdblook;
type
Tfrm_op_letter = class(TForm)
t_op_letter1: TDataSource;
t_op_letter_cq: TADOQuery;
t_op_letter_cq1: TDataSource;
t_op_letter_cz: TADOQuery;
t_op_letter_cz1: TDataSource;
t_op_letter_df: TADOQuery;
t_op_letter_df1: TDataSource;
t_op_letter_dq: TADOQuery;
t_op_letter_dq1: TDataSource;
t_op_letter_gg: TADOQuery;
t_op_letter_gg1: TDataSource;
t_op_letter_hc: TADOQuery;
t_op_letter_hc1: TDataSource;
t_op_letter_pc: TADOQuery;
t_op_letter_pc1: TDataSource;
t_op_letter_rh: TADOQuery;
t_op_letter_rh1: TDataSource;
t_op_letter_yj1: TDataSource;
t_op_letter_yj: TADOQuery;
bsSkinPanel2: TbsSkinPanel;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1HEAD_TO: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
bsSkinButton9: TbsSkinButton;
bsSkinPanel3: TbsSkinPanel;
bsSkinNotebook1: TbsSkinNotebook;
Label1: TLabel;
DBEdit1: TDBEdit;
Label2: TLabel;
DBEdit2: TDBEdit;
PopupMenu1: TPopupMenu;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
N18: TMenuItem;
N19: TMenuItem;
DBEdit3: TDBEdit;
DataSource1: TDataSource;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
DBMemo1: TDBMemo;
DBMemo2: TDBMemo;
DBMemo3: TDBMemo;
DBMemo4: TDBMemo;
DBMemo5: TDBMemo;
Label8: TLabel;
DBEdit4: TDBEdit;
Label9: TLabel;
DBMemo6: TDBMemo;
Label10: TLabel;
DBEdit5: TDBEdit;
Label11: TLabel;
DBEdit6: TDBEdit;
Label12: TLabel;
DBEdit7: TDBEdit;
Label13: TLabel;
DBMemo7: TDBMemo;
Label14: TLabel;
DBEdit8: TDBEdit;
Label15: TLabel;
DBMemo8: TDBMemo;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
DBMemo9: TDBMemo;
DBMemo10: TDBMemo;
DBMemo11: TDBMemo;
Label19: TLabel;
DBEdit9: TDBEdit;
Label20: TLabel;
DBEdit10: TDBEdit;
Label21: TLabel;
Label22: TLabel;
DBEdit12: TDBEdit;
Label23: TLabel;
DBEdit13: TDBEdit;
Label24: TLabel;
Label25: TLabel;
DBEdit15: TDBEdit;
Label26: TLabel;
DBEdit16: TDBEdit;
Label27: TLabel;
DBMemo12: TDBMemo;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label29: TLabel;
DBEdit14: TDBEdit;
Label30: TLabel;
DBEdit17: TDBEdit;
Label31: TLabel;
DBEdit18: TDBEdit;
Label32: TLabel;
DBEdit19: TDBEdit;
Label33: TLabel;
DBEdit20: TDBEdit;
Label28: TLabel;
DBEdit11: TDBEdit;
Label34: TLabel;
DBEdit21: TDBEdit;
Label35: TLabel;
DBEdit22: TDBEdit;
Label36: TLabel;
DBEdit23: TDBEdit;
Label37: TLabel;
DBEdit24: TDBEdit;
Label38: TLabel;
DBEdit25: TDBEdit;
DBMemo13: TDBMemo;
Label39: TLabel;
Label40: TLabel;
DBEdit26: TDBEdit;
Label41: TLabel;
DBEdit27: TDBEdit;
Label42: TLabel;
DBEdit28: TDBEdit;
Label43: TLabel;
DBEdit29: TDBEdit;
Label44: TLabel;
DBMemo14: TDBMemo;
Label45: TLabel;
DBEdit30: TDBEdit;
Label46: TLabel;
DBMemo15: TDBMemo;
PopupMenu2: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N20: TMenuItem;
t_op_letter: TADOQuery;
XPMenu1: TXPMenu;
N21: TMenuItem;
N22: TMenuItem;
t_op_letter_hd: TADOQuery;
t_op_letter_hd1: TDataSource;
N23: TMenuItem;
N24: TMenuItem;
Label47: TLabel;
DBMemo16: TDBMemo;
Label48: TLabel;
DBMemo17: TDBMemo;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Label49: TLabel;
DBEdit31: TDBEdit;
DBEdit32: TDBEdit;
Label50: TLabel;
N25: TMenuItem;
N26: TMenuItem;
DataSource2: TDataSource;
t_op_letter_pc_ctn1: TDataSource;
t_op_letter_pc_ctn: TADOQuery;
bsSkinPanel4: TbsSkinPanel;
wwDBGrid1: TwwDBGrid;
bsSkinPanel5: TbsSkinPanel;
bsSkinDBNavigator1: TbsSkinDBNavigator;
wwDBLookupCombo1: TwwDBLookupCombo;
procedure bsSkinButton1Click(Sender: TObject);
procedure DBEdit3Change(Sender: TObject);
procedure t_op_letterAfterInsert(DataSet: TDataSet);
procedure N3Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N11Click(Sender: TObject);
procedure N13Click(Sender: TObject);
procedure N19Click(Sender: TObject);
procedure N17Click(Sender: TObject);
procedure N15Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure t_op_letter_yjBeforeInsert(DataSet: TDataSet);
procedure t_op_letter_cqAfterInsert(DataSet: TDataSet);
procedure t_op_letter_czAfterInsert(DataSet: TDataSet);
procedure t_op_letter_dfAfterInsert(DataSet: TDataSet);
procedure t_op_letter_dqAfterInsert(DataSet: TDataSet);
procedure t_op_letter_ggAfterInsert(DataSet: TDataSet);
procedure t_op_letter_hcAfterInsert(DataSet: TDataSet);
procedure t_op_letter_pcAfterInsert(DataSet: TDataSet);
procedure t_op_letter_rhAfterInsert(DataSet: TDataSet);
procedure t_op_letter_yjAfterInsert(DataSet: TDataSet);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure t_op_letterBeforeInsert(DataSet: TDataSet);
procedure N20Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinPanel1Resize(Sender: TObject);
procedure bsSkinPanel3Resize(Sender: TObject);
procedure N21Click(Sender: TObject);
procedure t_op_letter_hdAfterInsert(DataSet: TDataSet);
procedure N23Click(Sender: TObject);
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit5KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit6KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit7KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit8KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit9KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit10KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit12KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit13KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker1KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker2KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit15KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit16KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit14KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit17KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit18KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit19KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit20KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit11KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit21KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit22KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit23KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit24KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit25KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit26KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit27KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit28KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit29KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit30KeyPress(Sender: TObject; var Key: Char);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure DBEdit31KeyPress(Sender: TObject; var Key: Char);
procedure DBEdit32KeyPress(Sender: TObject; var Key: Char);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure N26Click(Sender: TObject);
procedure t_op_letterBeforeEdit(DataSet: TDataSet);
procedure t_op_letter_pc_ctnAfterInsert(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
bsTypeid:Integer;
function GetCorpCName(SName:string):string;
end;
var
frm_op_letter: Tfrm_op_letter;
frm_op_letter_insert:boolean;
implementation
uses u_main, my_sys_function, u_data_share, u_code_truck_client,
u_code_truck_changzhan, u_code_send_head, u_op_letter_his;
{$R *.dfm}
function Tfrm_op_letter.GetCorpCName(SName:string):string;
var AdoQuery:TAdoQuery;
begin
Result:='';
AdoQuery:=CreateAdoQuery;
with AdoQuery do
try
Close;SQL.Clear;
SQL.Add('Select <20>ͻ<EFBFBD>ȫ<EFBFBD><C8AB> From t_crm_Client');
SQL.Add('Where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='+''''+SName+'''');
Open;
if not IsEmpty then Result:=FieldByName('<27>ͻ<EFBFBD>ȫ<EFBFBD><C8AB>').AsString
else Result:='';
finally
FreeAndNil(AdoQuery);
end;
end;
procedure Tfrm_op_letter.bsSkinButton1Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton1.ClientToScreen(Point(0,bsSkinButton1.Height));
PopupMenu1.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_op_letter.DBEdit3Change(Sender: TObject);
begin
DataSource1.Enabled:=false;
if t_op_letter.IsEmpty then
begin
bsSkinNotebook1.PageIndex:=9;
end
else if DBEdit3.Text='<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>' then
begin
bsSkinNotebook1.PageIndex:=0;
DataSource1.Enabled:=false;
DataSource1.DataSet:=t_op_letter_cq;
end
else if DBEdit3.Text='<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>' then
begin
bsSkinNotebook1.PageIndex:=1;
DataSource1.DataSet:=t_op_letter_cz;
end
else if DBEdit3.Text='<27><><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>' then
begin
bsSkinNotebook1.PageIndex:=2;
DataSource1.DataSet:=t_op_letter_df;
end
else if DBEdit3.Text='<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>' then
begin
bsSkinNotebook1.PageIndex:=3;
DataSource1.DataSet:=t_op_letter_dq;
end
else if DBEdit3.Text='<27><><EFBFBD><EFBFBD>֪ͨ' then
begin
bsSkinNotebook1.PageIndex:=4;
DataSource1.DataSet:=t_op_letter_gg;
end
else if DBEdit3.Text='<27><><EFBFBD><EFBFBD>֪ͨ' then
begin
bsSkinNotebook1.PageIndex:=5;
DataSource1.DataSet:=t_op_letter_hc;
end
else if DBEdit3.Text='<27>ɳ<EFBFBD>֪ͨ' then
begin
bsSkinNotebook1.PageIndex:=6;
DataSource1.DataSet:=t_op_letter_pc;
end
else if DBEdit3.Text='<27><><EFBFBD><EFBFBD>֪ͨ' then
begin
bsSkinNotebook1.PageIndex:=7;
DataSource1.DataSet:=t_op_letter_rh;
end
else if DBEdit3.Text='Ԥ<><EFBFBD><E8B1A3>' then
begin
bsSkinNotebook1.PageIndex:=8;
DataSource1.DataSet:=t_op_letter_yj;
end
else if DBEdit3.Text='ҵ<>񺯵<EFBFBD>' then
begin
bsSkinNotebook1.PageIndex:=10;
DataSource1.DataSet:=t_op_letter_hd;
end;
DataSource1.Enabled:=true;
end;
procedure Tfrm_op_letter.t_op_letterAfterInsert(DataSet: TDataSet);
begin
t_op_letter['<27><><EFBFBD><EFBFBD>']:=t_op_letter.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD>']:=employee;
t_op_letter['ǩ<><C7A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
frm_op_letter_insert:=false;
end;
procedure Tfrm_op_letter.N3Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N3.Caption;
t_op_letter.Post;
t_op_letter_pc.insert;
end;
procedure Tfrm_op_letter.N7Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N7.Caption;
t_op_letter.Post;
t_op_letter_rh.insert;
end;
procedure Tfrm_op_letter.N5Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N5.Caption;
t_op_letter.Post;
t_op_letter_hc.insert;
end;
procedure Tfrm_op_letter.N9Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N9.Caption;
t_op_letter.Post;
t_op_letter_gg.insert;
end;
procedure Tfrm_op_letter.N11Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N11.Caption;
t_op_letter.Post;
t_op_letter_yj.insert;
end;
procedure Tfrm_op_letter.N13Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N13.Caption;
t_op_letter.Post;
t_op_letter_dq.insert;
end;
procedure Tfrm_op_letter.N19Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N19.Caption;
t_op_letter.Post;
t_op_letter_cq.insert;
end;
procedure Tfrm_op_letter.N17Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N17.Caption;
t_op_letter.Post;
t_op_letter_cz.insert;
end;
procedure Tfrm_op_letter.N15Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N15.Caption;
t_op_letter.Post;
t_op_letter_df.insert;
end;
procedure Tfrm_op_letter.bsSkinButton2Click(Sender: TObject);
begin
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.post;
if DataSource1.DataSet=nil then
exit;
if (DataSource1.DataSet.State=dsinsert)or(DataSource1.DataSet.State=dsedit) then
DataSource1.DataSet.post;
IF (t_op_letter_pc_ctn.State IN [dsinsert,dsedit]) then t_op_letter_pc_ctn.Post;
end;
procedure Tfrm_op_letter.bsSkinButton3Click(Sender: TObject);
begin
if DataSource1.DataSet=nil then
exit;
if (DataSource1.DataSet.State=dsinsert)or(DataSource1.DataSet.State=dsedit) then
DataSource1.DataSet.cancel;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.cancel;
end;
procedure Tfrm_op_letter.bsSkinButton4Click(Sender: TObject);
begin
if t_op_letter.IsEmpty then
exit;
if DataSource1.DataSet=nil then
exit;
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)=IDOK then
begin
if not DataSource1.DataSet.IsEmpty then
DataSource1.DataSet.Delete;
t_op_letter.delete;
end;
end;
procedure Tfrm_op_letter.t_op_letter_yjBeforeInsert(DataSet: TDataSet);
begin
if (if_open('776')) then begin
showmessage('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
if (t_op_letter.State=dsinsert)or(t_op_letter.State=dsedit) then
t_op_letter.post;
end;
procedure Tfrm_op_letter.t_op_letter_cqAfterInsert(DataSet: TDataSet);
begin
t_op_letter_cq['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.t_op_letter_czAfterInsert(DataSet: TDataSet);
begin
t_op_letter_cz['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.t_op_letter_dfAfterInsert(DataSet: TDataSet);
begin
t_op_letter_df['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.t_op_letter_dqAfterInsert(DataSet: TDataSet);
begin
t_op_letter_dq['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.t_op_letter_ggAfterInsert(DataSet: TDataSet);
begin
t_op_letter_gg['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.t_op_letter_hcAfterInsert(DataSet: TDataSet);
begin
t_op_letter_hc['LE_ID']:=t_op_letter['LE_ID'];
t_op_letter_hc['ԭ<><D4AD><EFBFBD><EFBFBD>']:=t_op_letter.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
t_op_letter_hc['ԭ<><D4AD><EFBFBD><EFBFBD>']:=t_op_letter.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
t_op_letter_hc['ԭ<><D4AD><EFBFBD><EFBFBD>']:=t_op_letter.DataSource.DataSet['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_op_letter_hc['ԭ<><EFBFBD><E1B5A5>']:=t_op_letter.DataSource.DataSet['<27><><EFBFBD><EFBFBD><E1B5A5>'];
end;
procedure Tfrm_op_letter.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_letter.t_op_letter_rhAfterInsert(DataSet: TDataSet);
begin
t_op_letter_rh['LE_ID']:=t_op_letter['LE_ID'];
t_op_letter_rh['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ']:=t_op_letter.DataSource.DataSet['<27><>վ'];
t_op_letter_rh['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>']:=datetostr(now);
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_rh['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>'];
t_op_letter_rh['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD><CFB5>'];
t_op_letter_rh['<27><>վ<EFBFBD><D5BE>ϵ<EFBFBD>绰']:=frm_data_share.t_code_truck_changzhan['<27><>վ<EFBFBD>绰'];
end;
end;
procedure Tfrm_op_letter.t_op_letter_yjAfterInsert(DataSet: TDataSet);
begin
t_op_letter_yj['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_op_letter.Hide;
frm_op_letter.ManualFloat(frm_op_letter.BoundsRect );
action:=cafree;
frm_op_letter:=nil;
end;
procedure Tfrm_op_letter.FormShow(Sender: TObject);
begin
t_op_letter.Open;
t_op_letter_cq.Open;
t_op_letter_cz.Open;
t_op_letter_df.Open;
t_op_letter_dq.Open;
t_op_letter_gg.Open;
t_op_letter_hc.Open;
t_op_letter_pc.Open;
t_op_letter_rh.Open;
t_op_letter_yj.Open;
t_op_letter_hd.Open;
t_op_letter_pc_ctn.Open;
bsSkinButton1.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton2.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton3.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton4.Width:=round(bsSkinPanel1.Width/5);
DBEdit1.Width:=bsSkinPanel3.Width-DBEdit1.Left-6;
DBEdit2.Width:=bsSkinPanel3.Width-DBEdit1.Left-6;
case bsTypeid of
0:
begin
N26.Visible:=True; //<2F><>ʷ<EFBFBD><CAB7><EFBFBD><EFBFBD>
N25.Visible:=True; //---
N23.Visible:=True; //'ҵ<>񺯵<EFBFBD>'
N24.Visible:=True; // '-'
N3.Visible:=True; // '<27>ɳ<EFBFBD>֪ͨ'
N4.Visible:=True; // '-'
N5.Visible:=True; // '<27><><EFBFBD><EFBFBD>֪ͨ'
N6.Visible:=True; // '-'
N7.Visible:=True; //'<27><><EFBFBD><EFBFBD>֪ͨ'
N8.Visible:=True; // '-'
N9.Visible:=True; //'<27><><EFBFBD><EFBFBD>֪ͨ'
// N27.Visible:=True; // '-'
// N28.Visible:=True; //'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>'
N10.Visible:=True; // '-'
N11.Visible:=True; //'Ԥ<><EFBFBD><E8B1A3>'
N12.Visible:=True; // '-'
N13.Visible:=True; //'<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'
N14.Visible:=True; // '-'
N15.Visible:=True; //'<27><><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>'
N16.Visible:=True; //'-'
N17.Visible:=True; //'<27><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD>'
N18.Visible:=True; // '-'
N19.Visible:=True; //'<27><>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>'
end;
1:
begin
// N29.Visible:=True; // '-'
// N30.Visible:=True; //'<27><>ó<EFBFBD>ɳ<EFBFBD>'
end;
end;
end;
procedure Tfrm_op_letter.t_op_letterBeforeInsert(DataSet: TDataSet);
begin
if (if_open('776')) then begin
showmessage('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
if t_op_letter.DataSource.DataSet.State=dsinsert then
t_op_letter.DataSource.DataSet.post;
if not frm_op_letter_insert then
abort;
end;
procedure Tfrm_op_letter.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 (DataSource1.DataSet.State=dsinsert)or(DataSource1.DataSet.State=dsedit) then
DataSource1.DataSet.post;
try
t_op_letter.DataSource.DataSet.DisableControls;
book1:=t_op_letter.GetBookmark;
t_op_letter.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+DBEdit3.Text,2,t_op_letter.DataSource,t_op_letter1,DataSource1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.DataSource.DataSet.EnableControls;
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_letter.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 (DataSource1.DataSet.State=dsinsert)or(DataSource1.DataSet.State=dsedit) then
DataSource1.DataSet.post;
try
book1:=t_op_letter.GetBookmark;
t_op_letter.DisableControls;
t_op_letter.DataSource.DataSet.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+DBEdit3.Text,1,t_op_letter.DataSource,t_op_letter1,DataSource1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.DataSource.DataSet.EnableControls;
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_letter.bsSkinButton9Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height));
PopupMenu2.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_op_letter.bsSkinPanel1Resize(Sender: TObject);
begin
bsSkinButton1.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton2.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton3.Width:=round(bsSkinPanel1.Width/5);
bsSkinButton4.Width:=round(bsSkinPanel1.Width/5);
end;
procedure Tfrm_op_letter.bsSkinPanel3Resize(Sender: TObject);
begin
DBEdit1.Width:=bsSkinPanel3.Width-DBEdit1.Left-6;
DBEdit2.Width:=bsSkinPanel3.Width-DBEdit1.Left-6-Button5.Width;
Button5.left:=DBEdit2.left+DBEdit2.Width;
end;
procedure Tfrm_op_letter.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 (DataSource1.DataSet.State=dsinsert)or(DataSource1.DataSet.State=dsedit) then
DataSource1.DataSet.post;
try
book1:=t_op_letter.GetBookmark;
t_op_letter.DataSource.DataSet.DisableControls;
t_op_letter.DisableControls;
sys_print('<27><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>'+DBEdit3.Text,3,t_op_letter.DataSource,t_op_letter1,DataSource1,nil,nil,nil,nil,nil,nil,nil,nil);
finally
t_op_letter.DataSource.DataSet.EnableControls;
t_op_letter.GotoBookmark(book1);
t_op_letter.EnableControls;
end;
end;
procedure Tfrm_op_letter.t_op_letter_hdAfterInsert(DataSet: TDataSet);
begin
t_op_letter_hd['LE_ID']:=t_op_letter['LE_ID'];
end;
procedure Tfrm_op_letter.N23Click(Sender: TObject);
begin
frm_op_letter_insert:=true;
t_op_letter.Insert;
t_op_letter['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=N23.Caption;
t_op_letter.Post;
t_op_letter_hd.insert;
end;
procedure Tfrm_op_letter.DBEdit1KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit2);
end;
procedure Tfrm_op_letter.DBEdit2KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinNotebook1.SetFocus;
end;
end;
procedure Tfrm_op_letter.DBEdit4KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo6);
end;
procedure Tfrm_op_letter.DBEdit5KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit6);
end;
procedure Tfrm_op_letter.DBEdit6KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit7);
end;
procedure Tfrm_op_letter.DBEdit7KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo7);
end;
procedure Tfrm_op_letter.DBEdit8KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo8);
end;
procedure Tfrm_op_letter.DBEdit9KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit10);
end;
procedure Tfrm_op_letter.DBEdit10KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit12);
end;
procedure Tfrm_op_letter.DBEdit12KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit13);
end;
procedure Tfrm_op_letter.DBEdit13KeyPress(Sender: TObject; var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_op_letter.wwDBDateTimePicker1KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker2);
end;
procedure Tfrm_op_letter.wwDBDateTimePicker2KeyPress(Sender: TObject;
var Key: Char);
begin
key_DBEdit(Key,DBEdit15);
end;
procedure Tfrm_op_letter.DBEdit15KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit16);
end;
procedure Tfrm_op_letter.DBEdit16KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo12);
end;
procedure Tfrm_op_letter.DBEdit14KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit31);
end;
procedure Tfrm_op_letter.DBEdit17KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit18);
end;
procedure Tfrm_op_letter.DBEdit18KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit19);
end;
procedure Tfrm_op_letter.DBEdit19KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit20);
end;
procedure Tfrm_op_letter.DBEdit20KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit11);
end;
procedure Tfrm_op_letter.DBEdit11KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit21);
end;
procedure Tfrm_op_letter.DBEdit21KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit22);
end;
procedure Tfrm_op_letter.DBEdit22KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit23);
end;
procedure Tfrm_op_letter.DBEdit23KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit24);
end;
procedure Tfrm_op_letter.DBEdit24KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit25);
end;
procedure Tfrm_op_letter.DBEdit25KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo13);
end;
procedure Tfrm_op_letter.DBEdit26KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit27);
end;
procedure Tfrm_op_letter.DBEdit27KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit28);
end;
procedure Tfrm_op_letter.DBEdit28KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit29);
end;
procedure Tfrm_op_letter.DBEdit29KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo14);
end;
procedure Tfrm_op_letter.DBEdit30KeyPress(Sender: TObject; var Key: Char);
begin
key_DBMemo(Key,DBMemo15);
end;
procedure Tfrm_op_letter.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:=1;
frm_code_truck_client.ShowModal;
finally
frm_code_truck_client.Free;
frm_code_truck_client:=nil;
end;
end;
procedure Tfrm_op_letter.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:=1;
frm_code_truck_changzhan.ShowModal;
finally
frm_code_truck_changzhan.Free;
frm_code_truck_changzhan:=nil;
end;
end;
procedure Tfrm_op_letter.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:=2;
frm_code_truck_changzhan.ShowModal;
finally
frm_code_truck_changzhan.Free;
frm_code_truck_changzhan:=nil;
end;
end;
procedure Tfrm_op_letter.Button4Click(Sender: TObject);
begin
if t_op_letter_rh.IsEmpty then
exit;
try
frm_code_truck_changzhan:=tfrm_code_truck_changzhan.Create (self);
code_truck_changzhan_num:=3;
frm_code_truck_changzhan.ShowModal;
finally
frm_code_truck_changzhan.Free;
frm_code_truck_changzhan:=nil;
end;
end;
procedure Tfrm_op_letter.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:=1;
frm_code_send_head.ShowModal;
finally
frm_code_send_head.Free;
frm_code_send_head:=nil;
end;
end;
procedure Tfrm_op_letter.DBEdit31KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit32);
end;
procedure Tfrm_op_letter.DBEdit32KeyPress(Sender: TObject; var Key: Char);
begin
key_DBEdit(Key,DBEdit17);
end;
procedure Tfrm_op_letter.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_op_letter,'LF');
end;
procedure Tfrm_op_letter.N26Click(Sender: TObject);
begin
try
if not assigned(frm_op_letter_his) then
frm_op_letter_his:=tfrm_op_letter_his.Create (self);
frm_op_letter_his.ShowModal;
finally
frm_op_letter_his.free;
frm_op_letter_his:=nil;
end;
end;
procedure Tfrm_op_letter.t_op_letterBeforeEdit(DataSet: TDataSet);
begin
if (if_open('776')) then begin
showmessage('<27><>Ʊҵ<C6B1><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>');
abort;
end;
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_letter.t_op_letter_pc_ctnAfterInsert(DataSet: TDataSet);
begin
t_op_letter_pc_ctn['LE_ID']:=t_op_letter['LE_ID'];
end;
end.