|
|
unit u_info_price_managelistset;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, dbcgrids, bsSkinCtrls, bsdbctrls, StdCtrls, Mask, DBCtrls, DB,
|
|
|
ADODB;
|
|
|
|
|
|
type
|
|
|
Tfrm_info_price_managelistset = class(TForm)
|
|
|
t_price_Detail: TADOQuery;
|
|
|
t_price_Detail1: TDataSource;
|
|
|
t_price_List_Detail1: TDataSource;
|
|
|
t_price_List_Detail: TADOQuery;
|
|
|
bsSkinPanel4: TbsSkinPanel;
|
|
|
Label4: TLabel;
|
|
|
bsSkinButton15: TbsSkinButton;
|
|
|
bsSkinButton16: TbsSkinButton;
|
|
|
DBEdit1: TDBEdit;
|
|
|
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
|
|
|
bsSkinGroupBox1: TbsSkinGroupBox;
|
|
|
DBCtrlGrid1: TDBCtrlGrid;
|
|
|
Label1: TLabel;
|
|
|
Label5: TLabel;
|
|
|
DBEdit2: TDBEdit;
|
|
|
bsSkinButton17: TbsSkinButton;
|
|
|
bsSkinButton18: TbsSkinButton;
|
|
|
bsSkinButton19: TbsSkinButton;
|
|
|
bsSkinColorDialog1: TColorDialog;
|
|
|
DBCheckBox1: TDBCheckBox;
|
|
|
DBCheckBox2: TDBCheckBox;
|
|
|
DBCheckBox3: TDBCheckBox;
|
|
|
DBCheckBox4: TDBCheckBox;
|
|
|
DBCheckBox5: TDBCheckBox;
|
|
|
DBCheckBox6: TDBCheckBox;
|
|
|
DBCheckBox7: TDBCheckBox;
|
|
|
DBComboBoxGoods: TDBComboBox;
|
|
|
bsSkinDBCheckRadioBox2: TbsSkinDBCheckRadioBox;
|
|
|
DBEdit3: TDBEdit;
|
|
|
Label2: TLabel;
|
|
|
Label3: TLabel;
|
|
|
DBText1: TDBText;
|
|
|
DBEdit5: TDBEdit;
|
|
|
DBEdit4: TDBEdit;
|
|
|
Label6: TLabel;
|
|
|
procedure bsSkinButton15Click(Sender: TObject);
|
|
|
procedure DBEdit1Click(Sender: TObject);
|
|
|
procedure bsSkinButton17Click(Sender: TObject);
|
|
|
procedure bsSkinButton19Click(Sender: TObject);
|
|
|
procedure bsSkinButton18Click(Sender: TObject);
|
|
|
procedure bsSkinButton16Click(Sender: TObject);
|
|
|
procedure t_price_List_DetailAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_price_DetailBeforeDelete(DataSet: TDataSet);
|
|
|
procedure t_price_DetailAfterInsert(DataSet: TDataSet);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure t_price_DetailBeforePost(DataSet: TDataSet);
|
|
|
procedure t_price_List_DetailBeforeEdit(DataSet: TDataSet);
|
|
|
procedure DBEdit5Change(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_info_price_managelistset: Tfrm_info_price_managelistset;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_info_price_managelist, my_sys_function, u_data_share;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.bsSkinButton15Click(
|
|
|
Sender: TObject);
|
|
|
var
|
|
|
S:String;
|
|
|
begin
|
|
|
if t_price_Detail.State in [dsedit,dsinsert] then
|
|
|
t_price_Detail.Post;
|
|
|
|
|
|
if t_price_List_Detail.State in [dsedit,dsinsert] then
|
|
|
t_price_List_Detail.Post;
|
|
|
t_price_Detail.First;
|
|
|
S:='';
|
|
|
if t_price_List_Detail['<27>Ƿ<EFBFBD><C7B7><EFBFBD>'] then begin
|
|
|
while not t_price_Detail.Eof do begin
|
|
|
if t_price_Detail['<27><>һ'] then
|
|
|
S:=S+'һ';
|
|
|
if t_price_Detail['<27>ܶ<EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if S<>'' then
|
|
|
if t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString<>'' then
|
|
|
S:=S+':'+t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString+':'+t_price_Detail.FieldByName('<27>˼<EFBFBD>').AsString+';'
|
|
|
else
|
|
|
S:=S+':'+t_price_Detail.FieldByName('<27>˼<EFBFBD>').AsString+';'
|
|
|
else
|
|
|
if t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString<>'' then
|
|
|
S:=t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString+':'+t_price_Detail.FieldByName('<27>˼<EFBFBD>').AsString+';'
|
|
|
else
|
|
|
S:=t_price_Detail.FieldByName('<27>˼<EFBFBD>').AsString+';';
|
|
|
|
|
|
t_price_Detail.Next;
|
|
|
end;
|
|
|
end else begin
|
|
|
while not t_price_Detail.Eof do begin
|
|
|
if t_price_Detail['<27><>һ'] then
|
|
|
S:=S+'һ';
|
|
|
if t_price_Detail['<27>ܶ<EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if S<>'' then
|
|
|
if t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString<>'' then
|
|
|
S:=S+':'+t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString+':'+t_price_Detail.FieldByName('<27><>ע').AsString+';'
|
|
|
else
|
|
|
S:=S+':'+t_price_Detail.FieldByName('<27><>ע').AsString+';'
|
|
|
else
|
|
|
if t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString<>'' then
|
|
|
S:=t_price_Detail.FieldByName('Ʒ<><C6B7>').AsString+':'+t_price_Detail.FieldByName('<27><>ע').AsString+';'
|
|
|
else
|
|
|
S:=t_price_Detail.FieldByName('<27><>ע').AsString+';';
|
|
|
|
|
|
t_price_Detail.Next;
|
|
|
end;
|
|
|
S:='<27><>'+S;
|
|
|
end;
|
|
|
|
|
|
|
|
|
frm_info_price_managelist.t_price_list.Edit;
|
|
|
frm_info_price_managelist.t_price_list.fieldByName(t_price_List_Detail['<27>ֶ<EFBFBD>']).asString:=S;
|
|
|
frm_info_price_managelist.t_price_list.Post;
|
|
|
Close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.DBEdit1Click(Sender: TObject);
|
|
|
begin
|
|
|
if bsSkinColorDialog1.Execute then
|
|
|
begin
|
|
|
|
|
|
t_price_List_Detail.edit;
|
|
|
t_price_List_Detail['<27><>ɫ']:=ColorToString(bsSkinColorDialog1.Color);
|
|
|
t_price_List_Detail.post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.bsSkinButton17Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
t_price_Detail.Insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.bsSkinButton19Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
t_price_Detail.Delete;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.bsSkinButton18Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
if t_price_Detail.State in [dsedit,dsinSert] then
|
|
|
t_price_Detail.Post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.bsSkinButton16Click(
|
|
|
Sender: TObject);
|
|
|
begin
|
|
|
t_price_Detail.Cancel;
|
|
|
t_price_List_Detail.Cancel;
|
|
|
close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.t_price_List_DetailAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
var
|
|
|
cntrstr:String;
|
|
|
begin
|
|
|
// cntrstr:=RxDBLookupCombo4.DisplayValues[0];
|
|
|
{
|
|
|
t_price_List_Detail.Close;
|
|
|
t_price_List_Detail.SQL.Add('select * from t_price_List_Detail where <20><><EFBFBD><EFBFBD>='''+cntrstr+''' and <20><><EFBFBD><EFBFBD>='+wwDBComboBox20.Text+' and <20>ܴ<EFBFBD>='+Edit1.Text+' AND Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>='''+t_price_list['Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>']+''' and <20>ֶ<EFBFBD>='''+dxDBGrid1.FocusedField.FieldName+'''');
|
|
|
t_price_List_Detail.Open;
|
|
|
t_price_Detail.Open;
|
|
|
|
|
|
t_price_List_Detail['<27><><EFBFBD><EFBFBD>']:=wwDBComboBox20.Text;
|
|
|
t_price_List_Detail['<27>ܴ<EFBFBD>']:=Edit1.Text;
|
|
|
t_price_List_Detail['<27><><EFBFBD>뷢<EFBFBD><EBB7A2><EFBFBD>˼<EFBFBD>']:=1;
|
|
|
t_price_List_Detail['<27><><EFBFBD><EFBFBD>']:=cntrstr;
|
|
|
t_price_List_Detail['Ŀ<>ĸ<EFBFBD>']:=t_price_list['Ŀ<>ĸ<EFBFBD>'];
|
|
|
t_price_List_Detail['Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>']:=t_price_list['Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>'];
|
|
|
t_price_List_Detail['<27><>ɫ']:='clblack';
|
|
|
t_price_List_Detail['<27><><EFBFBD><EFBFBD>˾']:=cntrstr;
|
|
|
t_price_List_Detail['<27>ֶ<EFBFBD>']:=cntrstr;
|
|
|
}
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.t_price_DetailBeforeDelete(
|
|
|
DataSet: TDataSet);
|
|
|
var
|
|
|
aQuery:TADOQuery;
|
|
|
begin
|
|
|
if t_price_List_Detail['<27><><EFBFBD><EFBFBD>״̬']='ͨ<><CDA8>' then begin
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB7><EFBFBD>');
|
|
|
Abort;
|
|
|
end;
|
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
try
|
|
|
with aQuery do begin
|
|
|
Close;SQL.Clear;
|
|
|
sql.Add('Select * from t_ch_fee where <20>˼۱<CBBC><DBB1><EFBFBD>='+t_price_Detail.FieldByName('ID').AsString);
|
|
|
Open;
|
|
|
if not IsEmpty then begin
|
|
|
MessageDlg('<27><><EFBFBD>˼<EFBFBD><CBBC>ѷ<EFBFBD><D1B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>˼ۣ<CBBC>',mtWarning,[mbOk],0);
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
finally
|
|
|
FreeAndNil(aQuery);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.t_price_DetailAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
var
|
|
|
aQuery3:TADOQuery;
|
|
|
begin
|
|
|
t_price_detail['LD_ID']:=t_price_List_Detail['LD_ID'];
|
|
|
t_price_detail['<27>˼<EFBFBD>']:=0;
|
|
|
t_price_detail['<27><>һ']:=0;
|
|
|
t_price_detail['<27>ܶ<EFBFBD>']:=0;
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=0;
|
|
|
aQuery3:=CreateAdoQuery;
|
|
|
try
|
|
|
aQuery3.Close;aQuery3.SQL.Clear;
|
|
|
aQuery3.SQL.Add('Select <20><><EFBFBD><EFBFBD> from t_vessel_plan where <20><><EFBFBD><EFBFBD>='+t_price_List_Detail['<27><><EFBFBD><EFBFBD>']+' and <20>ܴ<EFBFBD>='+t_price_List_Detail['<27>ܴ<EFBFBD>']+' and <20><><EFBFBD><EFBFBD>˾='''+t_price_List_Detail['<27><><EFBFBD><EFBFBD>˾']+'''');
|
|
|
aQuery3.Open;
|
|
|
t_price_detail.Insert;
|
|
|
aQuery3.First;
|
|
|
while not aQuery3.Eof do begin
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='һ' then
|
|
|
t_price_detail['<27><>һ']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27>ܶ<EFBFBD>']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
if Trim(aQuery3['<27><><EFBFBD><EFBFBD>'])='<27><>' then
|
|
|
t_price_detail['<27><><EFBFBD><EFBFBD>']:=1;
|
|
|
aQuery3.Next;
|
|
|
end;
|
|
|
t_price_detail.Post;
|
|
|
finally
|
|
|
FreeAndNil(aQuery3);
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
if frm_data_share.t_code_goods.Active then
|
|
|
frm_data_share.t_code_goods.Open;
|
|
|
frm_data_share.t_code_goods.First;
|
|
|
DBComboBoxGoods.Items.Clear;
|
|
|
while not frm_data_share.t_code_goods.Eof do begin
|
|
|
DBComboBoxGoods.Items.Add(frm_data_share.t_code_goods.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString);
|
|
|
frm_data_share.t_code_goods.Next;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.t_price_DetailBeforePost(
|
|
|
DataSet: TDataSet);
|
|
|
var
|
|
|
S:String;
|
|
|
begin
|
|
|
if t_price_List_Detail['<27>Ƿ<EFBFBD><C7B7><EFBFBD>'] then begin
|
|
|
if t_price_Detail['<27>˼<EFBFBD>']=0 then begin
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD>ǵۣ<D7BC><DBA3>˼۱<CBBC><DBB1><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
if t_price_Detail['<27><>һ'] then
|
|
|
S:=S+'һ';
|
|
|
if t_price_Detail['<27>ܶ<EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
if t_price_Detail['<27><><EFBFBD><EFBFBD>'] then
|
|
|
S:=S+'<27><>';
|
|
|
// t_price_Detail['<27><>ע']:=S;
|
|
|
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.t_price_List_DetailBeforeEdit(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_price_List_Detail['<27><><EFBFBD><EFBFBD>״̬']='ͨ<><CDA8>' then begin
|
|
|
ShowMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB7><EFBFBD>');
|
|
|
Abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_price_managelistset.DBEdit5Change(Sender: TObject);
|
|
|
begin
|
|
|
if DBEdit5.Text='<27><><EFBFBD><EFBFBD>' then begin
|
|
|
Label6.Visible:=True;
|
|
|
DBEdit4.Visible:=True;
|
|
|
end else begin
|
|
|
Label6.Visible:=false;
|
|
|
DBEdit4.Visible:=false;
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|