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.
D6HECHUAN/信息资源/u_info_price_managesales.pas

653 lines
20 KiB
Plaintext

11 months ago
unit u_info_price_managesales;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, bsSkinCtrls, DB, ADODB, Grids, Wwdbigrd, Wwdbgrid,
StdCtrls, wwdblook, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid,
dxDBTLCl, dxGrClms, Mask, DBCtrls, RxLookup, wwdbdatetimepicker, Wwkeycb,
ComCtrls, bsSkinTabs, wwdbedit, Wwdotdot, Wwdbcomb, Menus, DBGridEh;
type
Tfrm_info_price_managelsales = class(TForm)
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
Notebook1: TNotebook;
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
t_price_list: TADOQuery;
ds_vessel_plan1: TDataSource;
bsSkinPanel3: TbsSkinPanel;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
bsSkinPanel5: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
Label10: TLabel;
RxDBLookupCombo4: TRxDBLookupCombo;
wwDBComboBox20: TwwDBComboBox;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N16: TMenuItem;
t_vessel_lines: TADOQuery;
ds_vessel_lines1: TDataSource;
bsSkinButton10: TbsSkinButton;
N1: TMenuItem;
N2: TMenuItem;
t_vessel_ships: TADOQuery;
DataSource1: TDataSource;
bsSkinButton12: TbsSkinButton;
bsSkinButton13: TbsSkinButton;
bsSkinButton14: TbsSkinButton;
DBGridEh1: TDBGridEh;
Label1: TLabel;
RxDBLookupCombo1: TRxDBLookupCombo;
bsSkinPanel4: TbsSkinPanel;
bsSkinButton15: TbsSkinButton;
bsSkinButton16: TbsSkinButton;
Label4: TLabel;
DBEdit1: TDBEdit;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
dxDBGrid1Column13: TdxDBGridColumn;
dxDBGrid1Column14: TdxDBGridColumn;
dxDBGrid1Column15: TdxDBGridColumn;
dxDBGrid1Column16: TdxDBGridColumn;
dxDBGrid1Column17: TdxDBGridColumn;
dxDBGrid1Column18: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column20: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
dxDBGrid1Column22: TdxDBGridColumn;
dxDBGrid1Column23: TdxDBGridColumn;
dxDBGrid1Column24: TdxDBGridColumn;
dxDBGrid1Column25: TdxDBGridColumn;
dxDBGrid1Column26: 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;
dxDBGrid1Column47: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
dxDBGrid1Column49: TdxDBGridColumn;
dxDBGrid1Column50: TdxDBGridColumn;
dxDBGrid1Column51: TdxDBGridColumn;
dxDBGrid1Column52: TdxDBGridColumn;
dxDBGrid1Column53: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridMemoColumn;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton6Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure t_price_shipAfterInsert(DataSet: TDataSet);
procedure FormShow(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure t_price_shipBeforeEdit(DataSet: TDataSet);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure bsSkinPanel3Resize(Sender: TObject);
procedure dxDBGrid2DblClick(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure t_price_listBeforeEdit(DataSet: TDataSet);
procedure t_price_listAfterInsert(DataSet: TDataSet);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure bsSkinButton14Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
procedure t_price_listBeforeDelete(DataSet: TDataSet);
private
function GetCntr(str:String):String;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_info_price_managelsales: Tfrm_info_price_managelsales;
info_price_manage_do1,info_price_manage_do2:boolean;
implementation
uses u_main, u_data_share, my_sys_function, u_info_price_ship,
u_info_price_port, u_info_price_managelist;
{$R *.dfm}
procedure Tfrm_info_price_managelsales.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption+'1');
frm_info_price_managelist.Hide;
frm_info_price_managelist.ManualFloat(frm_info_price_managelist.BoundsRect );
frm_main.freeTabs('frm_info_price_managelist');
action:=cafree;
frm_info_price_managelist:=nil;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_price_list);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_price_list);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton11Click(Sender: TObject);
begin
table_post(t_price_list);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton8Click(Sender: TObject);
begin
table_cancel(t_price_list);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_price_list);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton9Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton2Click(Sender: TObject);
begin
if not t_vessel_ships.Active then Exit;
if t_vessel_ships.IsEmpty then Exit;
if not if_open('231') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
// t_vessel_plan.insert;
frm_info_price_ship:=Tfrm_info_price_ship.Create(Self);
try
frm_info_price_ship.showmodal;
finally
FreeAndNil(frm_info_price_ship);
end;
// bsSkinPageControl1.activePageIndex:=1;
// bsSkinButton10.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>';
end;
procedure Tfrm_info_price_managelsales.bsSkinButton5Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˼۱<CBBC><DBB1><EFBFBD>ӡ',2,ds_vessel_plan1,nil,nil,nil,ds_vessel_plan1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_info_price_managelsales.t_price_shipAfterInsert(
DataSet: TDataSet);
begin
// t_price_ship['<27><>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>']:=date;
end;
procedure Tfrm_info_price_managelsales.FormShow(Sender: TObject);
begin
{
t_vessel_plan.sql.Clear;
t_vessel_plan.sql.add('SELECT * FROM t_vessel_plan where 1=1 ');
t_vessel_plan.sql.add(' and '+open_data('9001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no'));
t_vessel_plan.sql.add(' order by <20><><EFBFBD><EFBFBD>');
t_vessel_plan.open;
t_vessel_plan.SQL.SaveToFile('e:\1.txt');
}
// t_price_agreement.open;
loadreggrid(dxdbgrid1,true,caption+'1');
wwDBComboBox20.Items.IndexOf(FormatDateTime('YYYY',Now));
wwDBComboBox20.Text:=FormatDateTime('YYYY',Now);
Edit1.Text:=IntToStr(WeekofYear(Now));
// bsSkinButton1.OnClick(nil);
end;
procedure Tfrm_info_price_managelsales.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
i:Integer;
cntrstr:string;
function getcarrierFieldName(aYear,aweek:String):string;
var
aQuery:TADOQuery;
S,S1:string;
i,j:Integer;
begin
aQuery:=CreateAdoQuery;
i:=0;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('select <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD> from t_vessel_plan where <20><><EFBFBD><EFBFBD>='+aYear+' and <20>ܴ<EFBFBD>='+aWeek);
SQL.Add(' Order by <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD> Desc');
OPEN;
First;
if (Trim(FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)='') or (FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').IsNull) then begin
Result:='<27>˼<EFBFBD>1';
end else begin
while not eof do begin
if (Trim(FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)='') or (FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').IsNull) then begin
Result:='<27>˼<EFBFBD>'+inttostr(i);
Exit;
end else begin
S:=FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString;
j:=Strtoint(Trim(copy(S,5,Length(s)-4)))+1;
if i<j then i:=j;
Next;
end;
end;
Result:='<27>˼<EFBFBD>'+inttostr(i);
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
begin
if wwDBComboBox20.Text='' then begin
MessageDlg('<27><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbYes],0);
Exit;
end;
if Edit1.Text='' then begin
MessageDlg('<27>ܴβ<DCB4><CEB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbYes],0);
Exit;
end;
if RxDBLookupCombo4.DisplayValue='' then begin
MessageDlg('<27><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>',mtWarning,[mbYes],0);
Exit;
end;
str:='select * from t_vessel_plan where 1=1 ';
str:=Str+' and '+open_data('9001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
if wwDBComboBox20.Text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+wwDBComboBox20.Text;
if Edit1.Text<>''then
str:=str+' and <20>ܴ<EFBFBD>='+Edit1.Text;
t_vessel_ships.close;
t_vessel_ships.sql.Clear;
t_vessel_ships.sql.add(str);
t_vessel_ships.sql.add(' order by <20><><EFBFBD><EFBFBD>');
t_vessel_ships.open;
t_vessel_ships.first;
while not t_vessel_ships.eof do begin
if (Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)<>'') AND (not t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').IsNull) then begin
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).Caption:=Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>˾').AsString)+'/<2F><>'+Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)+'/'+Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).Visible:=True;
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).ReadOnly:=false;
end else begin
t_vessel_ships.Edit;
cntrstr:=getcarrierFieldName(wwDBComboBox20.Text,Edit1.Text);
t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString:=cntrstr;
// ShowMessage(cntrstr);
t_vessel_ships.Post;
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).Caption:=Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>˾').AsString)+'/<2F><>'+Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>').AsString)+'/'+Trim(t_vessel_ships.FieldByName('<27><><EFBFBD><EFBFBD>').AsString);
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).Visible:=True;
dxdbgrid1.ColumnByFieldName(Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)).ReadOnly:=false;
end;
t_vessel_ships.Next;
end;
cntrstr:=RxDBLookupCombo4.DisplayValues[0];
CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]);
str:='SELECT * FROM t_price_list where 1=1 ';
str:=Str+' and '+open_data('9001','¼<><C2BC><EFBFBD><EFBFBD>','no','no','no','no');
if RxDBLookupCombo4.DisplayValue<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+''''+cntrstr+'''';
if wwDBComboBox20.Text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+wwDBComboBox20.Text;
if Edit1.Text<>''then
str:=str+' and <20>ܴ<EFBFBD>='+Edit1.Text;
t_price_list.close;
t_price_list.sql.Clear;
t_price_list.sql.add(str);
t_price_list.sql.add(' order by Ŀ<>ĸ<EFBFBD>');
t_price_list.open;
end;
procedure Tfrm_info_price_managelsales.t_price_shipBeforeEdit(DataSet: TDataSet);
begin
if do_data('3001',t_price_list.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring,'','','','','')=false then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>޸Ĵ<DEB8><C4B4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD>');
abort;
end;
end;
procedure Tfrm_info_price_managelsales.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(t_price_list);
end;
procedure Tfrm_info_price_managelsales.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_price_list,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_info_price_managelsales.bsSkinPanel3Resize(Sender: TObject);
begin
{
wwDBLookupCombo52.Width:=bsSkinPanel3.Width-bsSkinButton13.Width-10;
bsSkinButton13.left:=bsSkinPanel3.Width-bsSkinButton13.Width-2;
bsSkinButton14.left:=bsSkinPanel3.Width-bsSkinButton13.Width-2;
RxDBLookupCombo20.Width:=bsSkinPanel3.Width-RxDBLookupCombo20.left;
Label13.Left:=round((bsSkinPanel3.Width-Label13.Width)/2);
wwDBLookupCombo1.Width:=bsSkinPanel3.Width-bsSkinButton13.Width-10;
Label6.Left:=round((bsSkinPanel3.Width-Label13.Width)/2);
}
end;
procedure Tfrm_info_price_managelsales.dxDBGrid2DblClick(Sender: TObject);
begin
bsSkinPageControl1.ActivePageIndex:=1;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton3Click(Sender: TObject);
begin
if not if_open('236') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if t_price_list.IsEmpty then Exit;
t_price_list.First;
while not t_price_list.Eof do begin
t_price_list.Edit;
t_price_list.FieldByName('״̬').AsString:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
t_price_list.post;
t_price_list.Next
end;
end;
procedure Tfrm_info_price_managelsales.t_price_listBeforeEdit(
DataSet: TDataSet);
begin
if not if_open('232') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if DataSet.FieldByName('״̬').AsString='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then begin
MessageDlg('<27>Ѿ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>',mtWarning,[mbYes],0);
Abort;
end;
end;
procedure Tfrm_info_price_managelsales.t_price_listAfterInsert(
DataSet: TDataSet);
begin
t_price_list['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_price_list['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_price_list['<27><><EFBFBD><EFBFBD>']:=StrToInt(wwDBComboBox20.Text);
t_price_list['<27>ܴ<EFBFBD>']:=StrToInt(Edit1.Text);
t_price_list['<27><><EFBFBD><EFBFBD>']:=RxDBLookupCombo4.KeyValue;
t_price_list['״̬']:='<27>½<EFBFBD>';
end;
procedure Tfrm_info_price_managelsales.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_info_price_managelsales.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_info_price_managelsales.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_info_price_managelsales.N2Click(Sender: TObject);
begin
update_grid(dxdbgrid1,107);
end;
function Tfrm_info_price_managelsales.GetCntr(str: String): String;
var
i:integer;
begin
if str='' then exit;
for i:=1 to Length(Str) do begin
if str[i]<>'''' then
Result:=result+Str[i];
end;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton10Click(Sender: TObject);
begin
if not t_vessel_ships.Active then Exit;
if t_vessel_ships.IsEmpty then Exit;
if not if_open('230') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
// t_vessel_plan.insert;
frm_info_price_port:=Tfrm_info_price_port.Create(Self);
try
frm_info_price_port.showmodal;
finally
FreeAndNil(frm_info_price_port);
end;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton12Click(Sender: TObject);
var
aQuery:TADOQuery;
begin
if not if_open('232') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if not t_price_list.active then begin
MessageDlg('<27><><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD>ٸ<EFBFBD><D9B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',mtError,[mbYes],0);
Exit;
end;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select * from t_price_port order by <20>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>');
Open;
First;
while not eof do begin
if not t_price_list.Locate('Ŀ<>ĸ<EFBFBD>',FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString,[]) then begin
t_price_list.Insert;
t_price_list['Ŀ<>ĸ<EFBFBD>']:=FieldByName('<27>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD><EFBFBD>').AsString;
t_price_list['Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>']:=FieldByName('<27>ۿڴ<DBBF><DAB4><EFBFBD>').AsString;
t_price_list.Post;
end;
Next;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton14Click(Sender: TObject);
var
aQuery:TADOQuery;
subStr,str,cntrstr:string;
function GetCorpID(Corp:string):string;
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
sql.Add('sELECT <20><><EFBFBD><EFBFBD> from t_crm_client where <20>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>='''+Corp+'''');
Open;
Result:=FieldByName('<27><><EFBFBD><EFBFBD>').AsString;
end;
finally
FreeAndNil(aQuery);
end;
end;
begin
if not if_open('235') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if MessageDlg('<27><><EFBFBD><EFBFBD><EFBFBD>˼ۣ<CBBC>ϵͳ<CFB5><CDB3><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ϵͳ<CFB5>з<EFBFBD><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD>Ϣ<EFBFBD><CFA2>ȷʵҪ<CAB5><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?',mtConfirmation,[mbYes,mbNo],0)=mrYes then begin
frm_main.db.BeginTrans;
t_price_list.First;
t_vessel_ships.Close;
t_vessel_ships.Open;
try
try
aQuery:=CreateAdoQuery;
with aQuery do begin
while not t_price_list.Eof do begin
t_vessel_ships.First;
cntrstr:=t_price_list.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring;
CntrStr:=StringReplace(CntrStr,'''','''''',[rfReplaceAll]);
while not t_vessel_ships.eof do begin
if (Trim(t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString)<>'') and (not t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').IsNull) then begin
subStr:='1=1';
subStr:=subStr+' and <20><><EFBFBD><EFBFBD>˾='+''''+t_vessel_ships['<27><><EFBFBD><EFBFBD>˾'].asString+'''';
subStr:=subStr+' and ж<>۴<EFBFBD><DBB4><EFBFBD>='+''''+t_price_list['Ŀ<>ĸ۴<C4B8><DBB4><EFBFBD>'].asString+'''';
subStr:=subStr+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+t_vessel_ships['<27><><EFBFBD><EFBFBD>'].asString+'''';
Close;SQL.Clear;
Str:='Update t_ch_fee set <20><><EFBFBD><EFBFBD>='+t_price_list[t_vessel_ships.FieldByName('<27>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>').AsString]+' where ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>=1 and <20><>׼='+''''+trim(CntrStr)+''''
+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from t_op_seae where '
+subStr+')';
SQL.text:=Str;
ExecSQL;
end;
t_vessel_ships.Next;
end;
{
if t_price_list['״̬']='<27>½<EFBFBD>' then begin
t_price_list.Edit;
t_price_list['״̬']:='<27><><EFBFBD><EFBFBD>';
t_price_list.Post;
end;
}
t_price_list.Next;
end;
end;
finally
FreeAndNil(aQuery);
end;
showmessage('<27>˼۳ɹ<DBB3><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
frm_main.db.CommitTrans;
except
frm_main.db.RollbackTrans;
end;
end;
end;
procedure Tfrm_info_price_managelsales.bsSkinButton13Click(Sender: TObject);
begin
if not if_open('236') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
end;
procedure Tfrm_info_price_managelsales.t_price_listBeforeDelete(
DataSet: TDataSet);
begin
if not if_open('233') then
begin
showmessage('<27>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>д<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>');
exit;
end;
if DataSet.FieldByName('״̬').AsString='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then begin
MessageDlg('<27>Ѿ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ģ<DEB8>',mtWarning,[mbYes],0);
Abort;
end;
end;
end.