---------
if (currentCol=5)and(stringgrid1.Cells[2,currentRow]<>'') then
begin
rect := StringGrid1.CellRect(currentCol, currentRow);
combobox3.Visible:=true;
combobox3.Left:=rect.Left ;
combobox3.Top:=StringGrid1.Top+rect.Top;
//------------------------添加数据词典-----------------------
//------------------注意和进货单的不同之处-------------------
//-------------这里是根据商品的编号来查询存有这个商品的仓库-------
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select distinct 仓库 from 库存库 where 货号='''+stringgrid1.Cells[1,currentRow]+'''');
adoquery1.Open;
combobox3.Items.Clear;
while not adoquery1.Eof do
begin
combobox3.Items.Add(adoquery1.FieldByName('仓库').AsString);
adoquery1.Next;
end;
end;
end;
//------------------将选取的值添加到stringgrid单元,并隐藏列表框--------------
procedure Toutput.ComboBox3Select(Sender: TObject);
begin
if currentCol=5 then
begin
stringgrid1.Cells[5,currentRow]:=combobox3.Text;
combobox3.Visible:=false;
combobox3.Items.Clear;
end;
end;
//----------双击货号列读入商品信息----------------------
procedure Toutput.StringGrid1DblClick(Sender: TObject);
begin
//--------只允许在第一列由“(双击)”标示处双击----------
if currentCol=1 then
begin
//---------------显示库存清单---------------------------
manage.button4.click;
//-------------显示商品清单时,不允许对进货单窗体进行操作------
output.Enabled:=false;
end;
end;
//----------------动态添加客户数据词典-----------------------
//--------客户资料窗体中双击读入数据功能见客户资料窗体的代码--------
procedure Toutput.ComboBox2DropDown(Sender: TObject);
begin
//显示客户清单
info.visible:=true;
info.N4.Click;
//显示客户清单时,不允许对进货单窗体进行操作
output.Enabled:=false;
end;
//---------------窗体显示时设置当前值-------------------------
procedure Toutput.FormShow(Sender: TObject);
begin
//制表事件为当前日期
edit1.Text:=datetostr(date);
//制单人即登录用户
edit2.Text:=manage.StatusBar1.Panels[0].Text;
currentRow:=1;
currentCol:=1;
end;
//----------------关闭窗体时打开管理窗体----------------------------
procedure Toutput.FormClose(Sender: TObject; var Action: TCloseAction);
var
i,j:integer;
begin
manage.show;
end;
//-----------------保存销售单,销售单明细数据----------
上一篇:
FormManage.pas
下一篇:
多年来只想说一句,我不怪你