📄 umanage_fad.pas
字号:
L1.Caption:=LevelName1+':';
Flag1:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan2)<>'' then
begin
tempstr:=ExamineMan2;
tt:=0;
while pos(',',tempstr)>0 do //取得逗号的位置
begin
temppos:=pos(',',tempstr); //取得逗号的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P2.Visible:=True; L2.Caption:=LevelName2+':'+ss;
if ee2='' then
begin
L2.Caption:=LevelName2+':'+ss;
Flag2:=1;
end;
if ee2<>'' then
begin
L2.Caption:=LevelName2+':';
Flag2:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan3)<>'' then
begin
tempstr:=ExamineMan3;
tt:=0;
while pos(',',tempstr)>0 do //取得逗号的位置
begin
temppos:=pos(',',tempstr); //取得逗号的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P3.Visible:=True; L3.Caption:=LevelName3+':'+ss;
if ee3='' then
begin
L3.Caption:=LevelName3+':'+ss;
Flag3:=1;
end;
if ee3<>'' then
begin
L3.Caption:=LevelName3+':';
Flag3:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan4)<>'' then
begin
tempstr:=ExamineMan4;
tt:=0;
while pos(',',tempstr)>0 do //取得逗号的位置
begin
temppos:=pos(',',tempstr); //取得逗号的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P4.Visible:=True; L4.Caption:=LevelName4+':'+ss;
if ee4='' then
begin
L4.Caption:=LevelName4+':'+ss;
Flag4:=1;
end;
if ee1<>'' then
begin
L4.Caption:=LevelName4+':';
Flag4:=2;
end;
end;
end;
Next;
end;
if Trim(ExamineMan5)<>'' then
begin
tempstr:=ExamineMan5;
tt:=0;
while pos(',',tempstr)>0 do //取得逗号的位置
begin
temppos:=pos(',',tempstr); //取得逗号的位置
ss:=copy(tempstr,1,temppos-1);
tempstr:=copy(tempstr,temppos+1,length(tempstr)-temppos);
if ss=Handle_Man then
begin
P5.Visible:=True; L5.Caption:=LevelName5+':'+ss;
if ee1='' then
begin
L5.Caption:=LevelName5+':'+ss;
Flag5:=1;
end;
if ee5<>'' then
begin
L5.Caption:=LevelName5+':';
Flag5:=2;
end;
end;
end;
Next;
end;
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='Select * from [V_Storage_Out_View] where Receipt_No='''+List_No+'''';
Open;
k:=frm_data.ClientDataSet_Add.RecordCount;
StringGrid1.RowCount:=k+1;
//自动加载STRINGGRID的行数
for K:=1 to StringGrid1.RowCount do
begin
StringGrid1.Cells[0,K]:=IntTostr(k); //表示第0列第i行的名称
end;
//******************
Edit1.Text:=frm_data.ClientDataSet_Add.FieldByName('Copy_Date').AsString;
Edit2.Text:=frm_data.ClientDataSet_Add.FieldByName('Receipt_No').AsString;
Edit3.Text:=frm_data.ClientDataSet_Add.FieldByName('Gatrher_monad').AsString;
Edit4.Text:=frm_data.ClientDataSet_Add.FieldByName('Storage_NO').AsString;
Edit_Storage_Name.Text:=frm_data.ClientDataSet_Add.FieldByName('Storage_Name').AsString;
Edit5.Text:=frm_data.ClientDataSet_Add.FieldByName('Transactor').AsString;
Edit6.Text:=frm_data.ClientDataSet_Add.FieldByName('Shop_NO').AsString;
Edit7.Text:=frm_data.ClientDataSet_Add.FieldByName('proposer').AsString;
Edit8.Text:=frm_data.ClientDataSet_Add.FieldByName('Condense').AsString;
Edit9.Text:=frm_data.ClientDataSet_Add.FieldByName('Out_Remark').AsString;
Edit10.Text:=frm_data.ClientDataSet_Add.FieldByName('Business_No').AsString;
Edit11.Text:=frm_data.ClientDataSet_Add.FieldByName('Out_Type').AsString;
for k:=1 to k do
begin
StringGrid1.Cells[1,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_NO'];//商品编号
StringGrid1.Cells[2,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Name'];//商品名称
StringGrid1.Cells[3,k]:=frm_data.ClientDataSet_Add.FieldValues['Pass_NO'];//数量
StringGrid1.Cells[4,k]:=frm_data.ClientDataSet_Add.FieldValues['Price'];//单价
StringGrid1.Cells[5,k]:=frm_data.ClientDataSet_Add.FieldValues['amount'];//金额
StringGrid1.Cells[6,k]:=frm_data.ClientDataSet_Add.FieldValues['Money'];//类别编号
//StringGrid1.Cells[7,k]:=frm_data.ClientDataSet_Add.FieldValues['agio']; //类别名称
//StringGrid1.Cells[8,k]:=frm_data.ClientDataSet_Add.FieldValues['agio_price'];//品牌编号
//StringGrid1.Cells[9,k]:=frm_data.ClientDataSet_Add.FieldValues['agio_money']; //品牌名称
//StringGrid1.Cells[10,k]:=frm_data.ClientDataSet_Add.FieldValues['tax_rate'];//品种编号
//StringGrid1.Cells[11,k]:=frm_data.ClientDataSet_Add.FieldValues['tax_rate_price']; //品种名称
//StringGrid1.Cells[12,k]:=frm_data.ClientDataSet_Add.FieldValues['tax_money'];//规格型号代码
//StringGrid1.Cells[13,k]:=frm_data.ClientDataSet_Add.FieldValues['quality'];//规格型号名称
StringGrid1.Cells[14,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Modal'];//球面度数
StringGrid1.Cells[15,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Cards'];//柱面度数
StringGrid1.Cells[16,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Brand'];//颜色代码
StringGrid1.Cells[17,k]:=frm_data.ClientDataSet_Add.FieldValues['Norms_Type'];//颜色名称
StringGrid1.Cells[18,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Sphere'];//商品条玛
StringGrid1.Cells[19,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Column'];//注册商标
StringGrid1.Cells[20,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Color'];//生产厂家
StringGrid1.Cells[21,k]:=frm_data.ClientDataSet_Add.FieldValues['Goods_Coding'];//商品简称
StringGrid1.Cells[22,k]:=frm_data.ClientDataSet_Add.FieldValues['Enroll_Brand'];//基本单位
StringGrid1.Cells[23,k]:=frm_data.ClientDataSet_Add.FieldValues['Base_Monad'];//整件单位
StringGrid1.Cells[24,k]:=frm_data.ClientDataSet_Add.FieldValues['Valid_Month']; //有效日期
StringGrid1.Cells[25,k]:=frm_data.ClientDataSet_Add.FieldValues['Valid_Day']; //有效日期
StringGrid1.Cells[26,k]:=frm_data.ClientDataSet_Add.FieldValues['Remark']; //备注说明
Next;
end;
end;
end;
end;
procedure Tfrm_Umanage_Fad.Cmd_CancelClick(Sender: TObject);
var
i,j,icol:integer;
Check_Flag:string;
begin
frm_Public_Don:=Tfrm_Public_Don.Create(self);
frm_Public_Don.ShowModal;
if Public_Do='Storage_Umanage_Fad' then
begin
if Public_Do_Result='02' then
begin
if Trim(Edit1.Text)='' then
begin
application.MessageBox('操作错误,【录单日期】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit1.SetFocus;
Exit;
end;
if Trim(Edit2.Text)='' then
begin
application.MessageBox('操作错误,【单据编号】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit2.SetFocus;
Exit;
end;
if Trim(Edit3.Text)='' then
begin
application.MessageBox('操作错误,【收货单位】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit3.SetFocus;
Exit;
end;
if Trim(Edit4.Text)='' then
begin
application.MessageBox('操作错误,【发货仓库】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit4.SetFocus;
Exit;
end;
if Trim(Edit5.Text)='' then
begin
application.MessageBox('操作错误,【经手人】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit5.SetFocus;
Exit;
end;
if Trim(Edit7.Text)='' then
begin
application.MessageBox('操作错误,【制单人】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Edit7.SetFocus;
Exit;
end;
for i:=1 to Total_Count-1 do
begin
if StringGrid1.Cells[1,i]='' then
begin
application.MessageBox('操作错误,【商品编号】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
if StringGrid1.Cells[5,i]='' then
begin
application.MessageBox('操作错误,【数量】不能为空!,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end;
end;
try
with frm_data.ClientDataSet_Add do
begin
Close;
frm_data.ClientDataSet_Add.CommandText:='';
CommandText:='Select * from [Out_strip] where Copy_Date='''+Trim(Edit1.Text)+''' and Out_NO='''+Trim(Edit2.Text)+''' ';
try
open;
if frm_data.ClientDataSet_Add.RecordCount>0 then
begin
Application.MessageBox('添加失败,该记录已经存在,请确认!',pchar(application.Title),mb_iconwarning);
Exit;
end
else
begin
try
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='Insert into [Out_strip] (Copy_Date,Out_NO,Gatrher_monad,Storage_NO,Transactor,Shop_NO,proposer,Condense,Out_Remark,Business_No,Out_Type) values ('''+Trim(Edit1.Text)+''','''+Trim(Edit2.Text)+''','''+Trim(Edit3.Text)+''','''+Trim(Edit4.Text)+''','''+Trim(Edit5.Text)+''','''+Trim(Edit6.Text)+''','''+Trim(Edit7.Text)+''','''+Trim(Edit8.Text)+''','''+Trim(Edit9.Text)+''','''+Trim(Edit10.Text)+''','''+Trim(Edit11.Text)+''')';
try
Execute;
try
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='Insert into [Receipt](Receipt_NO,Receipt_Name,Copy_Date,Proposer,Condense) values ('''+Trim(Edit2.Text)+''',''出库单'','''+Trim(Edit1.Text)+''','''+Trim(Edit7.Text)+''','''+Trim(Edit8.Text)+''')';
try
Execute;
try
for i:=1 to Total_Count-1 do
begin
with frm_data.ClientDataSet_Add do
begin
Close;
CommandText:='';
CommandText:='Insert into [Out_strip_detail](Out_NO,Goods_NO,Pass_NO,amount,price,money,Out_Remark) values ('''+Trim(Edit2.Text)+''','''+Trim(StringGrid1.Cells[1,i])+''','''+Trim(StringGrid1.Cells[3,i])+''','''+Trim(StringGrid1.Cells[5,i])+''','''+Trim(StringGrid1.Cells[11,i])+''','''+Trim(StringGrid1.Cells[12,i])+''','''+Trim(StringGrid1.Cells[26,i])+''')';
try
Execute;
except
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -