📄 price_attemper.pas
字号:
except
Application.MessageBox('系统错误,在操作【同价调拨明细表】循环时出错!请检查连接的远程服务器的情况,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
Application.MessageBox('恭喜你!【同价调拨单】草稿操作保存成功!请确认!',pchar(application.Title),mb_iconwarning);
except
Application.MessageBox('系统错误,在操作【同价调拨审核表】循环时出错!请检查连接的远程服务器的情况,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
except
Application.MessageBox('系统错误,在操作【同价调拨审核表】时出错!请检查连接的远程服务器的情况,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
except
Application.MessageBox('系统错误,请检查连接的远程服务器的情况,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
except
Application.MessageBox('系统错误,在操作【同价调拨表】时出错!请检查连接的远程服务器的情况,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
//废弃退出
if Public_Do_Result='03' then
begin
Close;
end;
end;
if Public_Do='Business_Price_attemper' then
begin
//草稿转为单据
if Public_Do_Result='01' then
begin
with frm_data.ClientDataSet2 do
begin
Close;
CommandText:='';
Commandtext:='Select * from [V_Goods_dispatch_View] where Receipt_No='''+Trim(List_NO)+'''';
try
Open;
Check_Flag:=frm_data.ClientDataSet2.FieldValues['Check_Result'];
if Check_Flag='0' then
begin
Application.MessageBox('单据还没有完全审核,不能过帐',pchar(application.Title),mb_iconwarning);
Exit;
end;
if Check_Flag='1' then
begin
with frm_data.ClientDataSet_Add do
begin
Close;
Commandtext:='';
Commandtext:='Update [Goods_dispatch] set FStorage_NO='''+Trim(Edit3.Text)+''',SStorage_NO='''+Trim(Edit4.Text)+''',FShop_NO='''+Trim(Edit5.Text)+''',SShop_NO='''+Trim(Edit6.Text)+''',Condense='''+Trim(Edit9.Text)+''',D_Remark='''+Trim(Edit10.Text)+''' where dispatch_No='''+Trim(List_NO)+'''';
try
Execute;
try
for i:=1 to Total_Count-1 do
begin
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='update [Goods_dispatch_detail] set Pass_NO='''+Trim(StringGrid1.Cells[3,i])+''',amount='''+Trim(StringGrid1.Cells[5,i])+''' where dispatch_NO='''+Trim(List_NO)+''' and Goods_No='''+Trim(StringGrid1.Cells[1,i])+'''';
try
Execute;
except
Application.MessageBox('保存[同价调拨单明细表]时连接服务器失败,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
try
Stock_States_Total; //执行库存统计过程
if Flag_Str=True then
begin
try
with frm_data.ClientDataSet_Add do
begin
Close;
Commandtext:='';
Commandtext:='Update [Receipt] set Flag_sign=''单据'' where Receipt_No='''+Trim(List_NO)+'''';
try
Execute;
Application.MessageBox('[同价调拨单]单据过帐完毕!',pchar(application.Title),mb_iconwarning);
except
Application.MessageBox('保存[同价调拨单审核表]时连接服务器失败,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
except
Application.MessageBox('操作同价调拨审核表的标志位时出错!',Pchar(application.Title),Mb_ICONwarning)
end;
end
else
begin
Exit;//退出
end;
except
Exit;
end;
except
Application.MessageBox('保存[同价调拨单明细]时循环失败,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
except
Application.MessageBox('保存[同价调拨单]时失败,请检查连接网络是否正常,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
except
Application.MessageBox('打开[同价调拨单视图]时失败,不能过帐,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
end;
if Public_Do_Result='03' then
begin
Close;
end;
end;
frm_Public_Don.free;
end;
procedure Tfrm_price_attemper.Edit1DblClick(Sender: TObject);
begin
Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',now);
end;
procedure Tfrm_price_attemper.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if Key=#13 then
Edit1.Text:=ForMatDateTime('yyyy''-''mm''-''dd',now);
end;
procedure Tfrm_price_attemper.Edit8KeyPress(Sender: TObject;
var Key: Char);
begin
if Key=#13 then
Edit8.Text:=func.Handle_Man;
end;
procedure Tfrm_price_attemper.SpeedButton7Click(Sender: TObject);
begin
Edit8.Text:=func.Handle_Man;
end;
procedure Tfrm_price_attemper.Edit8DblClick(Sender: TObject);
begin
Edit8.Text:=func.Handle_Man;
end;
procedure Tfrm_price_attemper.StringGrid1DrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
with sender as TStringGrid do
begin
if (GDFocused in state) then
begin
Pcol:=Acol;
Prow:=ARow;
func.String_Col:=ARow;
end;
end;
end;
procedure Tfrm_price_attemper.StringGrid1DblClick(Sender: TObject);
begin
if ((PCol=1) or (PCol=2))then //表示选择的是商品编号 选择的是第一列
begin
Check_Storage_Result_NO:=Trim(Edit3.Text);
Goods_Check_str:='';
frm_Goods_Check:=Tfrm_Goods_Check.Create(self);
frm_Goods_Check.ShowModal;
if Goods_Check_str='Storage_price_attemper' then
begin
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='Select * from [Goods_Information] where Goods_No='''+Trim(Goods_No_Str)+'''';
Open;
StringGrid1.Cells[1,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_NO').AsString;//
StringGrid1.Cells[2,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Name').AsString;//
StringGrid1.Cells[4,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Base_Monad').AsString;//
StringGrid1.Cells[16,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Modal').AsString;//
StringGrid1.Cells[17,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Cards').AsString;//
StringGrid1.Cells[18,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Brand').AsString;//
StringGrid1.Cells[19,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Norms_Type').AsString;//
StringGrid1.Cells[20,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Sphere').AsString;//
StringGrid1.Cells[21,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Column').AsString;//
StringGrid1.Cells[22,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Color').AsString;//
StringGrid1.Cells[23,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Goods_Coding').AsString;//
StringGrid1.Cells[24,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Enroll_Brand').AsString;//
StringGrid1.Cells[25,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Factory').AsString;//
StringGrid1.Cells[26,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Month').AsString;//
StringGrid1.Cells[27,String_Col]:=frm_data.ClientDataSet_Add.FieldByName('Valid_Day').AsString;//
end;
end;
end;
end;
procedure Tfrm_price_attemper.SpeedButton1Click(Sender: TObject);
begin
Check_Storage:='';Check_Storage_Result:='';
Check_Storage:='Storage_price_attemperF';
frm_Storage_Select:=Tfrm_Storage_Select.Create(self);
frm_Storage_Select.ShowModal;
Edit_FStorage_Name.Text:=Trim(Check_Storage_Result);
Edit3.Text:=Trim(Check_Storage_Result_NO);
frm_Storage_Select.Free;
end;
procedure Tfrm_price_attemper.SpeedButton5Click(Sender: TObject);
begin
Check_Storage:='';Check_Storage_Result:='';
Check_Storage:='Storage_price_attemperS';
frm_Storage_Select:=Tfrm_Storage_Select.Create(self);
frm_Storage_Select.ShowModal;
Edit_SStorage_Name.Text:=Trim(Check_Storage_Result);
Edit4.Text:=Trim(Check_Storage_Result_NO);
frm_Storage_Select.Free;
end;
procedure Tfrm_price_attemper.SpeedButton9Click(Sender: TObject);
begin
ChildShop_Str:='';
ChildShop_Result_NO:='';
ChildShop_Result_Name:='';
ChildShop_Str:='Storage_price_attemperF';
frm_ChildShop_Select:=Tfrm_ChildShop_Select.Create(self);
frm_ChildShop_Select.ShowModal;
Edit5.Text:=ChildShop_Result_NO;
Edit_FShop_Name.Text:=ChildShop_Result_Name;
frm_ChildShop_Select.Free;
end;
procedure Tfrm_price_attemper.SpeedButton6Click(Sender: TObject);
begin
ChildShop_Str:='';
ChildShop_Result_NO:='';
ChildShop_Result_Name:='';
ChildShop_Str:='Storage_price_attemperS';
frm_ChildShop_Select:=Tfrm_ChildShop_Select.Create(self);
frm_ChildShop_Select.ShowModal;
Edit6.Text:=ChildShop_Result_NO;
Edit_SShop_Name.Text:=ChildShop_Result_Name;
frm_ChildShop_Select.Free;
end;
procedure Tfrm_price_attemper.SpeedButton8Click(Sender: TObject);
begin
Employe_Check:='';
Employe_Check:='Storage_price_attemper';
Employe_Check_Result:='';
frm_Login_Man:=Tfrm_Login_Man.Create(self);
frm_Login_Man.Caption:='经手人选择';
frm_Login_Man.ShowModal;
Edit7.Text:=Employe_Check_Result;
frm_Login_Man.Free;
end;
procedure Tfrm_price_attemper.Cmd_AddClick(Sender: TObject);
var
i:integer;
begin
StringGrid1.RowCount:=StringGrid1.RowCount+1;
Total_Count:=StringGrid1.RowCount;
for i:=1 to StringGrid1.RowCount-1 do
begin
StringGrid1.Cells[0,i]:=IntTostr(i); //表示第0列第i行
end;
end;
procedure Tfrm_price_attemper.Cmd_DeleteClick(Sender: TObject);
var
i:integer;
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -