|
|
unit u_op_ctn_detail;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, bsSkinCtrls, ExtCtrls, dxExEdtr, dxCntner, dxTL, dxDBCtrl,
|
|
|
dxDBGrid, DB, ADODB, StdCtrls, DBCtrls, wwdbdatetimepicker, wwdbedit,
|
|
|
Wwdotdot, Wwdbcomb, Mask, RxLookup, ComCtrls, bsSkinTabs, wwdblook,
|
|
|
dxDBTLCl, dxGrClms, u_fee,IniFiles, Grids, DBGrids;
|
|
|
|
|
|
type
|
|
|
Tfrm_op_ctn_detail = class(TForm)
|
|
|
Panel1: TPanel;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
t_op_ctn_detail: TADOQuery;
|
|
|
t_op_ctn_detail1: TDataSource;
|
|
|
bsSkinPageControl1: TbsSkinPageControl;
|
|
|
bsSkinTabSheet1: TbsSkinTabSheet;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
bsSkinButton44: TbsSkinButton;
|
|
|
dxDBGrid1Column1: TdxDBGridColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridColumn;
|
|
|
dxDBGrid1Column8: TdxDBGridColumn;
|
|
|
dxDBGrid1Column9: TdxDBGridColumn;
|
|
|
dxDBGrid1Column10: TdxDBGridColumn;
|
|
|
dxDBGrid1Column11: TdxDBGridColumn;
|
|
|
dxDBGrid1Column13: TdxDBGridColumn;
|
|
|
dxDBGrid1Column17: TdxDBGridColumn;
|
|
|
dxDBGrid1Column18: TdxDBGridColumn;
|
|
|
dxDBGrid1Column22: TdxDBGridColumn;
|
|
|
dxDBGrid1Column23: TdxDBGridColumn;
|
|
|
bsSkinButton9: TbsSkinButton;
|
|
|
t_code_ctn_status: TADOQuery;
|
|
|
t_code_ctn_status1: TDataSource;
|
|
|
Panel2: TPanel;
|
|
|
fra_fee1: Tfra_fee;
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
Splitter1: TSplitter;
|
|
|
dxDBGrid1Column25: TdxDBGridColumn;
|
|
|
t_op_status: TADOQuery;
|
|
|
t_op_status1: TDataSource;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Panel3: TPanel;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton11: TbsSkinButton;
|
|
|
DBGrid1: TDBGrid;
|
|
|
t_op_ctn_fee: TADOQuery;
|
|
|
t_op_ctn_fee1: TDataSource;
|
|
|
t_ch_fee: TADOQuery;
|
|
|
v_op_ctn_fee: TADOQuery;
|
|
|
v_op_ctn_fee1: TDataSource;
|
|
|
dxDBGrid1Column15: TdxDBGridColumn;
|
|
|
dxDBGrid1Column16: TdxDBGridCheckColumn;
|
|
|
dxDBGrid1Column19: TdxDBGridColumn;
|
|
|
dxDBGrid1Column20: TdxDBGridColumn;
|
|
|
Label6: TLabel;
|
|
|
Label11: TLabel;
|
|
|
Label12: TLabel;
|
|
|
Label3: TLabel;
|
|
|
Edit1: TEdit;
|
|
|
wwDBDateTimePicker3: TwwDBDateTimePicker;
|
|
|
wwDBDateTimePicker4: TwwDBDateTimePicker;
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
Label1: TLabel;
|
|
|
Edit2: TEdit;
|
|
|
Label13: TLabel;
|
|
|
RxDBLookupCombo4: TRxDBLookupCombo;
|
|
|
Memo1: TMemo;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
Label2: TLabel;
|
|
|
wwDBComboBox3: TwwDBComboBox;
|
|
|
dxDBGrid1Column21: TdxDBGridColumn;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure Panel1Resize(Sender: TObject);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton44Click(Sender: TObject);
|
|
|
procedure bsSkinButton9Click(Sender: TObject);
|
|
|
procedure bsSkinCheckRadioBox1Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure bsSkinButton11Click(Sender: TObject);
|
|
|
procedure t_op_ctn_feeAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_op_ctn_feeBeforeEdit(DataSet: TDataSet);
|
|
|
procedure t_op_ctn_feeBeforeDelete(DataSet: TDataSet);
|
|
|
procedure t_op_ctn_feeAfterPost(DataSet: TDataSet);
|
|
|
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure fra_fee1bsSkinButton4Click(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_op_ctn_detail: Tfrm_op_ctn_detail;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_op_ctn_piliangfee;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
var
|
|
|
inifile1:Tinifile;
|
|
|
begin
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'data.ini');
|
|
|
try
|
|
|
inifile1.writebool('ctndetail','fdisp',bsSkinCheckRadioBox1.Checked);
|
|
|
finally
|
|
|
FreeAndNil(inifile1);
|
|
|
end;
|
|
|
savereggrid(dxdbgrid1,caption);
|
|
|
|
|
|
frm_op_ctn_detail.Hide;
|
|
|
frm_op_ctn_detail.ManualFloat(frm_op_ctn_detail.BoundsRect );
|
|
|
frm_main.freeTabs('frm_op_ctn_detail');
|
|
|
action:=cafree;
|
|
|
frm_op_ctn_detail:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.Panel1Resize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(panel1.Width/8);
|
|
|
bsSkinButton7.Width:=i;
|
|
|
bsSkinButton6.Width:=i;
|
|
|
bsSkinButton9.Width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.FormShow(Sender: TObject);
|
|
|
var
|
|
|
inifile1:Tinifile;
|
|
|
begin
|
|
|
t_code_ctn_status.Open;
|
|
|
t_op_ctn_detail.close;
|
|
|
t_op_ctn_detail.SQL.clear;
|
|
|
t_op_ctn_detail.SQL.add('select top 100 * from v_op_ctnmg_detail where '+open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
|
|
|
t_op_ctn_detail.SQL.add(' order by ctnid');
|
|
|
t_op_ctn_detail.open;
|
|
|
loadreggrid(dxdbgrid1,true,caption);
|
|
|
|
|
|
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'data.ini');
|
|
|
try
|
|
|
bsSkinCheckRadioBox1.Checked:=inifile1.Readbool('ctndetail','fdisp',false);
|
|
|
bsSkinCheckRadioBox1.OnClick(Sender);
|
|
|
finally
|
|
|
FreeAndNil(inifile1);
|
|
|
end;
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton44Click(Sender: TObject);
|
|
|
var
|
|
|
ctnstr:string;
|
|
|
i:integer;
|
|
|
begin
|
|
|
t_op_ctn_detail.close;
|
|
|
t_op_ctn_detail.SQL.clear;
|
|
|
t_op_ctn_detail.SQL.add('select * from v_op_ctnmg_detail where 1=1 and '+open_data('0008','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no') );
|
|
|
|
|
|
|
|
|
|
|
|
if Edit2.Text<>'' then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD><EFBFBD>䵥<EFBFBD><E4B5A5>='+''''+edit2.text+'''');
|
|
|
if RxDBLookupCombo4.DisplayValues[1]<>'' then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+'''');
|
|
|
|
|
|
|
|
|
if wwDBDateTimePicker3.text<>''then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>='+''''+wwDBDateTimePicker3.text+'''');
|
|
|
if wwDBDateTimePicker4.text<>''then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><='+''''+wwDBDateTimePicker4.text+'''');
|
|
|
|
|
|
if Edit1.Text<>'' then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD>='+''''+edit1.Text+'''');
|
|
|
if RxDBLookupCombo1.DisplayValue<>'' then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><>ǰ<EFBFBD><C7B0>̬='+''''+RxDBLookupCombo1.DisplayValue+'''');
|
|
|
if wwDBComboBox3.Text<>'' then
|
|
|
t_op_ctn_detail.SQL.add(' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''');
|
|
|
|
|
|
if Memo1.Lines.Count<>0 then begin
|
|
|
ctnstr:=ctnstr+'and (';
|
|
|
for i:=0 to Memo1.Lines.Count-1 do begin
|
|
|
if i=0 then
|
|
|
ctnstr:=ctnstr+'<27><><EFBFBD><EFBFBD>='+''''+Trim(Memo1.Lines.Strings[i])+''''
|
|
|
else
|
|
|
ctnstr:=ctnstr+' or <20><><EFBFBD><EFBFBD>='+''''+Trim(Memo1.Lines.Strings[i])+'''';
|
|
|
end;
|
|
|
ctnstr:=ctnstr+') ';
|
|
|
end else begin
|
|
|
if Edit1.Text<>'' then
|
|
|
ctnstr:=' and <20><><EFBFBD><EFBFBD>='+''''+Trim(Edit1.Text)+'''';
|
|
|
end;
|
|
|
|
|
|
|
|
|
if ctnstr<>'' then
|
|
|
t_op_ctn_detail.SQL.add(ctnstr);
|
|
|
t_op_ctn_detail.SQL.add(' order by ctnid');
|
|
|
t_op_ctn_detail.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton9Click(Sender: TObject);
|
|
|
begin
|
|
|
sys_print('<27><>װ<EFBFBD>䶯̬<E4B6AF>б<EFBFBD>',2,t_op_ctn_detail1,nil,nil,nil,t_op_ctn_detail1,nil,nil,nil,nil,nil,nil);
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinCheckRadioBox1Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinCheckRadioBox1.Checked then
|
|
|
begin
|
|
|
if not t_op_ctn_fee.Active then t_op_ctn_fee.Open;
|
|
|
if not v_op_ctn_fee.Active then v_op_ctn_fee.Open;
|
|
|
Panel2.Visible:=true;
|
|
|
fra_fee1.edit_type.text:='8';
|
|
|
fra_fee1.edit_data.text:='0008';
|
|
|
fra_fee1.edit_report.text:='<27><><EFBFBD><EFBFBD>';
|
|
|
fra_fee1.t_ch_accept.DataSource:=t_op_ctn_detail1;
|
|
|
// if if_open('373') then
|
|
|
// begin
|
|
|
|
|
|
if strtobool(get_parameters_value(150,'false')) then begin
|
|
|
fra_fee1.bsSkinPanel3.Visible:=true;
|
|
|
fra_fee1.bsSkinPanel3.height:=108;
|
|
|
end;
|
|
|
fra_fee1.DBEdit48.DataSource:=t_op_ctn_detail1;
|
|
|
fra_fee1.t_ch_accept.DataSource:=t_op_ctn_detail1;
|
|
|
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;
|
|
|
fra_fee1.Panel3.Height:=120;
|
|
|
// end else fra_fee1.Panel3.visible:=False;
|
|
|
|
|
|
// if if_open('374') then
|
|
|
// begin
|
|
|
fra_fee1.t_ch_pay.DataSource:=t_op_ctn_detail1;
|
|
|
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;
|
|
|
// fra_fee1.Panel8.Visible:=true;
|
|
|
// fra_fee1.Panel8.Height:=20;
|
|
|
|
|
|
fra_fee1.t_op_gain.DataSource:=t_op_ctn_detail1;
|
|
|
fra_fee1.t_op_gain.open;
|
|
|
fra_fee1.Panel8.Visible:=false;
|
|
|
// end else fra_fee1.Panel1.visible:=false;
|
|
|
end
|
|
|
else
|
|
|
begin
|
|
|
Panel2.Visible:=false;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op_ctn_fee.Insert;
|
|
|
t_op_ctn_fee.post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_op_ctn_fee);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton11Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_op_ctn_fee);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.t_op_ctn_feeAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_op_ctn_fee['<27><><EFBFBD><EFBFBD>']:=get_id;
|
|
|
t_op_ctn_fee['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_op_ctn_detail['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_op_ctn_fee['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_op_ctn_fee['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=Date;
|
|
|
t_op_ctn_fee['<27><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>']:=Date;
|
|
|
t_op_ctn_fee['<27><><EFBFBD><EFBFBD>״̬']:='¼<><C2BC>״̬';
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.t_op_ctn_feeBeforeEdit(DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_op_ctn_fee.FieldByName('<27><><EFBFBD><EFBFBD>״̬').AsString='<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>' then begin
|
|
|
ShowMessage('<27>ѷ<EFBFBD><D1B7>÷<EFBFBD><C3B7>ʲ<EFBFBD><CAB2><EFBFBD><EFBFBD>ģ<DEB8>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.t_op_ctn_feeBeforeDelete(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_ch_fee.Close;
|
|
|
t_ch_fee.Open;
|
|
|
if t_ch_fee.RecordCount<>0 then begin
|
|
|
ShowMessage('<27><><EFBFBD>ڷ<EFBFBD><DAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.t_op_ctn_feeAfterPost(DataSet: TDataSet);
|
|
|
begin
|
|
|
v_op_ctn_fee.Refresh;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.Edit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
begin
|
|
|
if Key<>#13 then exit;
|
|
|
|
|
|
if (Trim(Edit1.Text)<>'') then begin
|
|
|
Memo1.Lines.Add(Trim(Edit1.Text));
|
|
|
Edit1.Text:='';
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_op_ctn_piliangfee:=tfrm_op_ctn_piliangfee.Create (self);
|
|
|
|
|
|
frm_op_ctn_piliangfee.ShowModal;
|
|
|
finally
|
|
|
frm_op_ctn_piliangfee.Free;
|
|
|
frm_op_ctn_piliangfee:=nil;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_op_ctn_detail.fra_fee1bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
fra_fee1.bsSkinButton4Click(Sender);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|