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.

829 lines
25 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_cnt_manage;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
dxDBGrid, DB, ADODB, dxDBTLCl, dxGrClms, StdCtrls, Mask, DBCtrls,
wwdbdatetimepicker, ComCtrls, bsSkinTabs, RxLookup, Menus, XPMenu,
wwdbedit, Wwdotdot, Wwdbcomb, cxTextEdit, cxDBEdit, cxControls,
cxContainer, cxEdit, cxLabel, cxMaskEdit, cxDropDownEdit, cxLookupEdit,
cxDBLookupEdit, cxDBLookupComboBox, wwdblook, DBCtrlsEh,DateUtils,
bsSkinBoxCtrls, Grids, Wwdbigrd, Wwdbgrid;
type
Tfrm_op_cnt_manage = class(TForm)
Panel2: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
Notebook1: TNotebook;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridMaskColumn;
dxDBGrid1Column7: TdxDBGridDateColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridDateColumn;
dxDBGrid1Column10: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridDateColumn;
bsSkinButton19: TbsSkinButton;
dxDBGrid1Column22: TdxDBGridColumn;
dxDBGrid1Column23: TdxDBGridColumn;
dxDBGrid1Column24: TdxDBGridColumn;
dxDBGrid1Column25: TdxDBGridColumn;
XPMenu1: TXPMenu;
dxDBGrid1Column26: TdxDBGridColumn;
PopupMenu3: TPopupMenu;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
t_op_ctn_manage: TADOQuery;
t_op_ctn_manage1: TDataSource;
Panel1: TPanel;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinGroupBox2: TbsSkinGroupBox;
Label12: TLabel;
RxDBLookupCombo9: TRxDBLookupCombo;
dxDBGrid1Column17: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column20: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
dxDBGrid1Column27: TdxDBGridColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column29: TdxDBGridColumn;
dxDBGrid1Column30: TdxDBGridColumn;
dxDBGrid1Column31: TdxDBGridColumn;
dxDBGrid1Column32: TdxDBGridColumn;
dxDBGrid1Column33: TdxDBGridColumn;
dxDBGrid1Column34: TdxDBGridColumn;
dxDBGrid1Column35: TdxDBGridColumn;
dxDBGrid1Column36: TdxDBGridColumn;
dxDBGrid1Column37: TdxDBGridColumn;
dxDBGrid1Column38: TdxDBGridColumn;
dxDBGrid1Column39: TdxDBGridColumn;
dxDBGrid1Column40: TdxDBGridColumn;
dxDBGrid1Column41: TdxDBGridColumn;
dxDBGrid1Column42: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
dxDBGrid1Column44: TdxDBGridColumn;
dxDBGrid1Column45: TdxDBGridColumn;
dxDBGrid1Column46: TdxDBGridColumn;
bsSkinPanel1: TbsSkinPanel;
Label1: TLabel;
Label36: TLabel;
DBEdit1: TDBEdit;
DBEdit7: TDBEdit;
Label2: TLabel;
RxDBLookupCombo1: TRxDBLookupCombo;
Label3: TLabel;
DBEdit2: TDBEdit;
bsSkinButton21: TbsSkinButton;
Label4: TLabel;
DBEdit3: TDBEdit;
Label197: TLabel;
wwDBDateTimePicker17: TwwDBDateTimePicker;
Label5: TLabel;
DBEdit4: TDBEdit;
Label6: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label124: TLabel;
wwDBLookupCombo52: TwwDBLookupCombo;
Label7: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label8: TLabel;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label9: TLabel;
wwDBLookupCombo1: TwwDBLookupCombo;
Label10: TLabel;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Label11: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
Label13: TLabel;
wwDBDateTimePicker5: TwwDBDateTimePicker;
Label14: TLabel;
wwDBDateTimePicker6: TwwDBDateTimePicker;
Label15: TLabel;
DBNumberEditEh1: TDBNumberEditEh;
Label16: TLabel;
DBNumberEditEh2: TDBNumberEditEh;
Label17: TLabel;
DBNumberEditEh3: TDBNumberEditEh;
Label18: TLabel;
Label19: TLabel;
DBMemo1: TDBMemo;
Label20: TLabel;
DBNumberEditEh4: TDBNumberEditEh;
Label21: TLabel;
DBEdit5: TDBEdit;
Label22: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
Label23: TLabel;
RxDBLookupCombo4: TRxDBLookupCombo;
Label24: TLabel;
DBEdit6: TDBEdit;
bsSkinButton8: TbsSkinButton;
Label25: TLabel;
wwDBDateTimePicker7: TwwDBDateTimePicker;
Label26: TLabel;
DBEdit8: TDBEdit;
Label27: TLabel;
wwDBDateTimePicker8: TwwDBDateTimePicker;
Label28: TLabel;
wwDBLookupCombo2: TwwDBLookupCombo;
Label29: TLabel;
wwDBDateTimePicker9: TwwDBDateTimePicker;
Label30: TLabel;
wwDBDateTimePicker10: TwwDBDateTimePicker;
Label31: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
Label32: TLabel;
wwDBDateTimePicker11: TwwDBDateTimePicker;
Label33: TLabel;
RxDBLookupCombo5: TRxDBLookupCombo;
Label34: TLabel;
wwDBDateTimePicker12: TwwDBDateTimePicker;
Label35: TLabel;
wwDBDateTimePicker13: TwwDBDateTimePicker;
Label37: TLabel;
DBNumberEditEh5: TDBNumberEditEh;
Label38: TLabel;
DBNumberEditEh6: TDBNumberEditEh;
Label39: TLabel;
DBNumberEditEh7: TDBNumberEditEh;
Label40: TLabel;
DBMemo2: TDBMemo;
Label41: TLabel;
DBNumberEditEh8: TDBNumberEditEh;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinPanel9: TbsSkinPanel;
Label116: TLabel;
Label131: TLabel;
Label213: TLabel;
Edit1: TEdit;
Edit2: TEdit;
bsSkinButton44: TbsSkinButton;
RxDBLookupCombo57: TRxDBLookupCombo;
Label210: TLabel;
wwDBDateTimePicker18: TwwDBDateTimePicker;
wwDBDateTimePicker19: TwwDBDateTimePicker;
DataSource1: TDataSource;
ADOQuery1: TADOQuery;
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormShow(Sender: TObject);
procedure Panel2Resize(Sender: TObject);
procedure dxDBGrid1Column2CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure N2Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure RxDBLookupCombo9KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo9Enter(Sender: TObject);
procedure RxDBLookupCombo9Exit(Sender: TObject);
procedure t_op_ctn_manageBeforePost(DataSet: TDataSet);
procedure bsSkinButton2Click(Sender: TObject);
procedure t_op_ctn_manageAfterInsert(DataSet: TDataSet);
procedure bsSkinButton21Click(Sender: TObject);
procedure RxDBLookupCombo3Enter(Sender: TObject);
procedure RxDBLookupCombo3Exit(Sender: TObject);
procedure RxDBLookupCombo3KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo4KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo1Enter(Sender: TObject);
procedure RxDBLookupCombo1Exit(Sender: TObject);
procedure RxDBLookupCombo1KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo4Enter(Sender: TObject);
procedure RxDBLookupCombo4Exit(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure RxDBLookupCombo2Enter(Sender: TObject);
procedure RxDBLookupCombo2Exit(Sender: TObject);
procedure RxDBLookupCombo2KeyPress(Sender: TObject; var Key: Char);
procedure RxDBLookupCombo5Enter(Sender: TObject);
procedure RxDBLookupCombo5Exit(Sender: TObject);
procedure RxDBLookupCombo5KeyPress(Sender: TObject; var Key: Char);
procedure wwDBDateTimePicker5Change(Sender: TObject);
procedure wwDBDateTimePicker12Change(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure bsSkinButton44Click(Sender: TObject);
procedure DBEdit7KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_op_cnt_manage: Tfrm_op_cnt_manage;
implementation
uses u_main, u_data_share, my_sys_function, u_code_send_address,
u_op_kuaidi_query, my_sys_chat, u_op_cnt_sel;
{$R *.dfm}
procedure Tfrm_op_cnt_manage.bsSkinButton1Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton1.ClientToScreen(Point(0,bsSkinButton1.Height));
PopupMenu3.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_op_cnt_manage.bsSkinButton11Click(Sender: TObject);
var
answer:TModalResult;
begin
if bsSkinButton11.Caption='<27><EFBFBD>޸<EFBFBD>' then
begin
if t_op_ctn_manage.IsEmpty then
exit;
Notebook1.PageIndex:=1;
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end
else
begin
if (t_op_ctn_manage.State=dsinsert)or(t_op_ctn_manage.State=dsedit) then
BEGIN
answer:=messagedlg( '<27><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>޸ģ<DEB8><C4A3>Ƿ񱣴棿',mtWarning,mbYesNoCancel,0);
if answer=mrYes then
begin
t_op_ctn_manage.post;
end;
if answer=mrNo then
begin
t_op_ctn_manage.cancel;
end;
if answer=mrCancel then
begin
exit;
end;
END;
Notebook1.PageIndex:=0;
bsSkinButton11.Caption:='<27><EFBFBD>޸<EFBFBD>';
end;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_op_cnt_manage.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_op_cnt_manage.Hide;
frm_op_cnt_manage.ManualFloat(frm_op_cnt_manage.BoundsRect);
frm_main.freeTabs('frm_op_cnt_manage');
action:=cafree;
frm_op_cnt_manage:=nil;
end;
procedure Tfrm_op_cnt_manage.FormShow(Sender: TObject);
begin
t_op_ctn_manage.Close;
t_op_ctn_manage.open;
Notebook1.PageIndex:=0;
loadreggrid(dxdbgrid1,false,caption);
end;
procedure Tfrm_op_cnt_manage.Panel2Resize(Sender: TObject);
var
i:integer;
begin
i:=round(Panel2.Width/10);
bsSkinButton7.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton11.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton3.Width:=i;
bsSkinButton19.Width:=i;
end;
procedure Tfrm_op_cnt_manage.dxDBGrid1Column2CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
if (ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD><EBB7A2>') then
AColor :=clwhite
else if (ANode.strings[dxDBGrid1Column2.Index]='<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>') then
AColor :=clyellow
else if (ANode.strings[dxDBGrid1Column2.Index]='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')then
AColor :=clred
else if (ANode.strings[dxDBGrid1Column2.Index]='ȷ<>Ϸ<EFBFBD><CFB7><EFBFBD>') then
AColor :=$00DDF21C;
AFont.Color:=clblack;
end;
procedure Tfrm_op_cnt_manage.N2Click(Sender: TObject);
begin
t_op_ctn_manage.insert;
Notebook1.PageIndex:=1;
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end;
procedure Tfrm_op_cnt_manage.N4Click(Sender: TObject);
var
afield : variant;
i: Integer;
begin
if t_op_ctn_manage.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_ctn_manage.fieldcount-1],varvariant);
for i := 0 to (t_op_ctn_manage.fieldcount-1) do
begin
afield[i] :=t_op_ctn_manage.fields[i].value ;
end;
t_op_ctn_manage.append;
for i := 0 to (t_op_ctn_manage.fieldcount-1) do
begin
if (t_op_ctn_manage.fields[i].FieldName<>'<27><><EFBFBD><EFBFBD>')
and (t_op_ctn_manage.fields[i].FieldName<>'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>') then
t_op_ctn_manage.fields[i].value := afield[i] ;
end;
Notebook1.PageIndex:=1;
bsSkinButton11.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo9KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo9);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo9Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo9);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo9Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo9);
end;
procedure Tfrm_op_cnt_manage.t_op_ctn_manageBeforePost(DataSet: TDataSet);
begin
if t_op_ctn_manage.State=dsinsert then
begin
if t_op_ctn_manage.fieldbyname('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring=''then
begin
t_op_ctn_manage['ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=get_no(t_op_ctn_manage.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>').AsDateTime,'CT');
t_op_ctn_manage['<27><><EFBFBD><EFBFBD>']:=get_id;
end;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctn_manage['<27><><EFBFBD><EFBFBD>'];
t_op_ctn_manage['ҵ<><D2B5>״̬']:='<27><><EFBFBD><EFBFBD>ί<EFBFBD><CEAF>';
t_op_ctn_manage['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
end;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton2Click(Sender: TObject);
begin
table_post(t_op_ctn_manage);
end;
procedure Tfrm_op_cnt_manage.t_op_ctn_manageAfterInsert(DataSet: TDataSet);
begin
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>']:=date;
t_op_ctn_manage['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_op_ctn_manage['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_op_ctn_manage['<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>']:=subComp;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD>Ա']:=employee;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>']:=0;
t_op_ctn_manage['Ŀ<>ĸ<EFBFBD><C4B8><EFBFBD>ϴ<EFBFBD><CFB4>']:=0;
t_op_ctn_manage['<27><>ʹ<EFBFBD><CAB9>']:=0;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>']:=0;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>']:=0;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>ϴ<EFBFBD><CFB4>']:=0;
t_op_ctn_manage['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>']:=0;
t_op_ctn_manage['<27><><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>']:=0;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton21Click(Sender: TObject);
begin
frm_main.view_momo(t_op_ctn_manage1,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo3Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo3);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo3Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo3);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo3KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo3);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo4KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo4);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo1Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo1);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo1Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo1);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo1KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo1);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo4Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo4);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo4Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo4);
end;
procedure Tfrm_op_cnt_manage.bsSkinButton8Click(Sender: TObject);
begin
frm_main.view_momo(t_op_ctn_manage1,'<27><><EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_op_cnt_manage.bsSkinButton4Click(Sender: TObject);
begin
if t_op_ctn_manage.IsEmpty then
exit;
// if t_op_ctn_manage.fieldbyname('<27><><EFBFBD><EFBFBD>״̬').asstring='ȷ<>Ϸ<EFBFBD><CFB7><EFBFBD>' then
// exit;
if application.MessageBox('<27><>ȷ<EFBFBD><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?','<27><><EFBFBD><EFBFBD>:',MB_OKCANCEL)<>IDOK then
exit;
t_op_ctn_manage.delete;
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo2Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo2);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo2Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo2);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo2KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo2);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo5Enter(Sender: TObject);
begin
RxLookupComboEnter(RxDBLookupCombo5);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo5Exit(Sender: TObject);
begin
RxLookupComboExit(RxDBLookupCombo5);
end;
procedure Tfrm_op_cnt_manage.RxDBLookupCombo5KeyPress(Sender: TObject;
var Key: Char);
begin
key_RxDBLookupCombo(Key,RxDBLookupCombo5);
end;
procedure Tfrm_op_cnt_manage.wwDBDateTimePicker5Change(Sender: TObject);
var aDays:double;
begin
if t_op_ctn_manage=nil then
exit;
if (t_op_ctn_manage.state=dsinsert)or(t_op_ctn_manage.state=dsedit)then
begin
if (not t_op_ctn_manage.FieldByName('Ŀ<>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull)
and (not t_op_ctn_manage.FieldByName('Ŀ<>ĸۻ<C4B8><DBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull)
and (t_op_ctn_manage.FieldByName('<27><>ʹ<EFBFBD><CAB9>').AsFloat<>0) then
begin
aDays:=DaySpan(wwDBDateTimePicker5.Date,wwDBDateTimePicker6.Date);
// ShowMessage(FloatToStr(aDays));
if (DBNumberEditEh1.Value<>null) and (DBNumberEditEh2.Value<>null) then
if (aDays-DBNumberEditEh1.Value)>0 then
begin
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').AsFloat
:=(aDays-DBNumberEditEh1.Value)*DBNumberEditEh2.Value;
end
else t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').AsFloat:=0;
end;
end;
end;
procedure Tfrm_op_cnt_manage.wwDBDateTimePicker12Change(Sender: TObject);
var aDays:double;
begin
if t_op_ctn_manage=nil then
exit;
if (t_op_ctn_manage.state=dsinsert)or(t_op_ctn_manage.state=dsedit)then
begin
if (not t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull)
and (not t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĸۻ<C4B8><DBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').IsNull)
and (t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').AsFloat<>0) then
begin
aDays:=DaySpan(wwDBDateTimePicker12.Date,wwDBDateTimePicker13.Date);
if (DBNumberEditEh5.Value<>null) and (DBNumberEditEh6.Value<>null) then
if (aDays-DBNumberEditEh5.Value)>0 then
begin
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').AsFloat
:=(aDays-DBNumberEditEh5.Value)*DBNumberEditEh6.Value;
end
else t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>').AsFloat:=0;
end;
end;
end;
procedure Tfrm_op_cnt_manage.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_op_cnt_manage.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_op_cnt_manage.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,212);
end;
procedure Tfrm_op_cnt_manage.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_op_cnt_manage.bsSkinButton3Click(Sender: TObject);
begin
if t_op_ctn_manage=nil then
exit;
if (t_op_ctn_manage.State=dsinsert)or(t_op_ctn_manage.State=dsedit) then
t_op_ctn_manage.cancel;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton12Click(Sender: TObject);
var aAdoquery:TAdoquery;
begin
aAdoquery:=CreateAdoquery;
with aAdoquery do
try
close;sql.clear;
sql.add('select <20><><EFBFBD><EFBFBD><>е<EFBFBD>λ,<2C><>վ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D7B0><EFBFBD><EFBFBD><><D0B6><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E1B5A5>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>');
sql.add('from t_OP_seae');
sql.add('where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>''');
sql.add('and <20><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD> like ''%'+DBEdit7.Text+'%''');
open;First;
if not IsEmpty then
begin
if RecordCount=1 then
begin
t_op_ctn_manage.Edit;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value;
t_op_ctn_manage.FieldByName('ί<>е<EFBFBD>λ').Value:=FieldByName('ί<>е<EFBFBD>λ').Value;
t_op_ctn_manage.FieldByName('<27>Ѵ泡վ').Value:=FieldByName('<27><>վ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>˸<EFBFBD>').Value:=FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('Ŀ<>ĸ<EFBFBD>').Value:=FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.Post;
end
else
begin
try
if not assigned(frm_op_cnt_sel) then
frm_op_cnt_sel:=tfrm_op_cnt_sel.Create (self);
frm_op_cnt_sel.t_op_seae1.Enabled:=false;
frm_op_cnt_sel.t_op_seae1.DataSet:=aAdoquery;
frm_op_cnt_sel.t_op_seae1.Enabled:=true;
frm_op_cnt_sel.t_op_ctn_manage1.Enabled:=false;
frm_op_cnt_sel.t_op_ctn_manage1.DataSet:=t_op_ctn_manage;
frm_op_cnt_sel.t_op_ctn_manage1.Enabled:=true;
if frm_op_cnt_sel.ShowModal = mrOK then
begin
t_op_ctn_manage.Edit;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value;
t_op_ctn_manage.FieldByName('ί<>е<EFBFBD>λ').Value:=FieldByName('ί<>е<EFBFBD>λ').Value;
t_op_ctn_manage.FieldByName('<27>Ѵ泡վ').Value:=FieldByName('<27><>վ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>˸<EFBFBD>').Value:=FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('Ŀ<>ĸ<EFBFBD>').Value:=FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('Ԥ<><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.Post;
end;
finally
frm_op_cnt_sel.free;
frm_op_cnt_sel:=nil;
end;
end;
end
else
begin
ShowMessage('<27><><EFBFBD><EFBFBD>:'+DBEdit7.Text+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
finally
aAdoquery.Free;
end;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton13Click(Sender: TObject);
var aAdoquery:TAdoquery;
begin
aAdoquery:=CreateAdoquery;
with aAdoquery do
try
close;sql.clear;
sql.add('select <20><><EFBFBD><EFBFBD><>е<EFBFBD>λ,<2C><>վ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><D7B0><EFBFBD><EFBFBD><><D0B6><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><E1B5A5>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD>');
sql.add('from t_OP_seai');
sql.add('where ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=''<27><>ͨ<EFBFBD><CDA8>''');
sql.add('and <20><><EFBFBD>ŷ<EFBFBD><C5B7><EFBFBD> like ''%'+DBEdit7.Text+'%''');
open;First;
if not IsEmpty then
begin
if RecordCount=1 then
begin
t_op_ctn_manage.Edit;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>ί<EFBFBD>е<EFBFBD>λ').Value:=FieldByName('ί<>е<EFBFBD>λ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڶѴ泡վ').Value:=FieldByName('<27><>վ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>').Value:=FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĸ<EFBFBD>').Value:=FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.Post;
end
else
begin
try
if not assigned(frm_op_cnt_sel) then
frm_op_cnt_sel:=tfrm_op_cnt_sel.Create (self);
frm_op_cnt_sel.t_op_seae1.Enabled:=false;
frm_op_cnt_sel.t_op_seae1.DataSet:=aAdoquery;
frm_op_cnt_sel.t_op_seae1.Enabled:=true;
frm_op_cnt_sel.t_op_ctn_manage1.Enabled:=false;
frm_op_cnt_sel.t_op_ctn_manage1.DataSet:=t_op_ctn_manage;
frm_op_cnt_sel.t_op_ctn_manage1.Enabled:=true;
if frm_op_cnt_sel.ShowModal = mrOK then
begin
t_op_ctn_manage.Edit;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1B5A5>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><E1B5A5>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>ί<EFBFBD>е<EFBFBD>λ').Value:=FieldByName('ί<>е<EFBFBD>λ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڶѴ泡վ').Value:=FieldByName('<27><>վ').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>').Value:=FieldByName('װ<><D7B0><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>ĸ<EFBFBD>').Value:=FieldByName('ж<><D0B6><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD>ڶ<EFBFBD><DAB6>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD>̿<EFBFBD><CCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value:=FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
t_op_ctn_manage.Post;
end;
finally
frm_op_cnt_sel.free;
frm_op_cnt_sel:=nil;
end;
end;
end
else
begin
ShowMessage('<27><><EFBFBD><EFBFBD>:'+DBEdit7.Text+' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
finally
aAdoquery.Free;
end;
end;
procedure Tfrm_op_cnt_manage.bsSkinButton44Click(Sender: TObject);
var
str:widestring;
begin
str:='';
str:=query_tiaojian(1,str,'t_op_ctn_manage.<2E><><EFBFBD><EFBFBD><E1B5A5>','ģ<><C4A3>',Edit2.text);
str:=query_tiaojian(1,str,'t_op_ctn_manage.<2E><><EFBFBD><EFBFBD>','ģ<><C4A3>',Edit1.text);
str:=query_tiaojian(1,str,'t_op_ctn_manage.ί<>е<EFBFBD>λ','<27><><EFBFBD><EFBFBD>',RxDBLookupCombo57.DisplayValues[1]);
str:=query_tiaojian(1,str,'t_op_ctn_manage.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>',wwDBDateTimePicker18.text);
str:=query_tiaojian(1,str,'t_op_ctn_manage.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','С<><D0A1>',wwDBDateTimePicker19.text);
str:='select * from t_op_ctn_manage where <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_op_ctn_manage '
+str+')';
t_op_ctn_manage.close;
t_op_ctn_manage.sql.clear;
t_op_ctn_manage.sql.add(str);
t_op_ctn_manage.Open;
if t_op_ctn_manage.IsEmpty then
begin
showmessage('û<>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
exit;
end;
end;
procedure Tfrm_op_cnt_manage.DBEdit7KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bsSkinButton12Click(Sender);
end;
end;
end.