⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 untgoodcodeselpei.pas

📁 适合行业为眼镜业
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  screen.Cursor :=  crdefault;
end;


//////选定数据 多行
procedure TfmgoodCodeSelPei.btnQueryClick(Sender: TObject);
var x,i,countmy:integer;
   BookmarkList: TBookmarkList;
   TempBookmark: TBookmark;
begin


DBGrid1.Datasource.Dataset.DisableControls;

with DBgrid1.SelectedRows do
  if Count > 0 then
      begin

        if show_mode = '门店退货出库单' then
        begin
        countmy :=FmPosQuestBillstr.sgorder.RowCount -1;
        FmPosQuestBillstr.sgorder.RowCount := FmPosQuestBillstr.sgorder.RowCount + count -1;   ///新行数
        TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
        for x:= 0 to Count - 1 do
        begin
          if IndexOf(Items[x]) > -1 then
          begin
            DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
            //得到选定的数据
        //    showmessage(DBGrid1.Datasource.Dataset.Fields[1].AsString);

            with  FmPosQuestBillStr do
            begin
              sgorder.cells[0,countmy+ x] := inttostr(countmy+ x);
              sgorder.Cells[1,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
              sgorder.Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
              sgorder.Cells[3,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
              sgorder.Cells[6,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('base_unit').AsString);
              sgorder.Cells[19,countmy +x ] := '0000100001';
              sgorder.Cells[16,countmy +x ] := '10';
            end;
          end;
        end;
        DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
        DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
       end;
///////其他调用
        if show_mode = '配送需求单' then
        begin
        countmy :=FmAskGoodsPlan.sgorder.RowCount -1;
        FmAskGoodsPlan.sgorder.RowCount := FmAskGoodsPlan.sgorder.RowCount + count -1;   ///新行数
        TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
        for x:= 0 to Count - 1 do
        begin
          if IndexOf(Items[x]) > -1 then
          begin
            DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
            //得到选定的数据
        //    showmessage(DBGrid1.Datasource.Dataset.Fields[1].AsString);

            with  FmAskGoodsPlan do
            begin
              sgorder.cells[0,countmy+ x] := inttostr(countmy+ x);
              sgorder.Cells[1,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
              sgorder.Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
              sgorder.Cells[3,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
              sgorder.Cells[4,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('base_unit').AsString);
              sgorder.Cells[6,countmy +x] :='1';
              sgorder.Cells[8,countmy +x] :='1';
              sgorder.Cells[10,countmy +x] :='0';
              sgorder.Cells[11,countmy +x ] := '10';
            end;
          end;
        end;
        DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
        DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
       end;

        if show_mode = '门店配送退货申请单' then
        begin
        countmy :=FmPosAskBackBill.sgorder.RowCount -1;
        FmPosAskBackBill.sgorder.RowCount := FmPosAskBackBill.sgorder.RowCount + count -1;   ///新行数
        TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
        for x:= 0 to Count - 1 do
        begin
          if IndexOf(Items[x]) > -1 then
          begin
            DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
            //得到选定的数据
        //    showmessage(DBGrid1.Datasource.Dataset.Fields[1].AsString);

            with  FmPosAskBackBill do
            begin
              sgorder.cells[0,countmy+ x] := inttostr(countmy+ x);
              sgorder.Cells[1,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
              sgorder.Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
              sgorder.Cells[3,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
              sgorder.Cells[4,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('base_unit').AsString);
              sgorder.Cells[11,countmy +x ] := '10';
            end;
          end;
        end;
        DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
        DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
       end;

//////////////////////
        if show_mode = '配送收货单' then
        begin
        countmy :=FmPosSendBill.sgorder.RowCount -1;
        FmPosSendBill.sgorder.RowCount := FmPosSendBill.sgorder.RowCount + count -1;   ///新行数
        TempBookmark:= DBGrid1.Datasource.Dataset.GetBookmark;
        for x:= 0 to Count - 1 do
        begin
          if IndexOf(Items[x]) > -1 then
          begin
            DBGrid1.Datasource.Dataset.Bookmark:= Items[x];
            //得到选定的数据
        //    showmessage(DBGrid1.Datasource.Dataset.Fields[1].AsString);

            with  FmPosSendBill do
            begin
              sgorder.cells[0,countmy+ x] := inttostr(countmy+ x);
              sgorder.Cells[1,countmy+ x] := trim(DBGrid1.Datasource.Dataset.fieldbyname('type').AsString);
              sgorder.Cells[2,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_NO').AsString);
              sgorder.Cells[3,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('Goods_Name').AsString);
              sgorder.Cells[6,countmy +x] := trim(DBGrid1.Datasource.Dataset.Fieldbyname('base_unit').AsString);
              sgorder.Cells[8,countmy +x] := trim('0');
              sgorder.Cells[21,countmy +x] := trim(inttostr(DBGrid1.Datasource.Dataset.Fieldbyname('stock_amount').AsInteger));
              sgorder.Cells[19,countmy +x ] := '0000100001';    ////???
              sgorder.Cells[16,countmy +x ] := '10';
            end;
          end;
        end;
        DBGrid1.Datasource.Dataset.GotoBookmark(TempBookmark);
        DBGrid1.Datasource.Dataset.FreeBookmark(TempBookmark);
       end;

  end else
  begin
    Application.MessageBox('您没有选择商品,请选定商品!',pchar(application.Title),mb_iconinformation);
    exit;
  end;

  DBGrid1.Datasource.Dataset.EnableControls;
  close;


end;

procedure TfmgoodCodeSelPei.DBGrid1KeyPress(Sender: TObject;
  var Key: Char);
begin
  inherited;
  if key=#13 then btnquery.Click;
end;

procedure TfmgoodCodeSelPei.DBGrid1TitleClick(Column: TColumn);
begin
  inherited;
  if (not dbgrid1.DataSource.DataSet.Active ) then exit;
  if trim(column.Field.AsString)='' then exit;
  sortgrid(column.Field.FieldName,dmmain.DSquery,dbgrid1,column);
end;

procedure TfmgoodCodeSelPei.DBGrid1DblClick(Sender: TObject);
var
  rows:integer;
begin
  inherited;

  if not dbgrid1.DataSource.DataSet.Active then
  begin
    application.MessageBox('请选择商品!',pchar(application.Title),mb_iconinformation);
    exit;
  end;

///报损单2004-4-14
  if show_mode = '配送需求单' then
  begin
    with FmAskGoodsPlan do
    begin
      rows:=sgorder.RowCount;
      if  sgorder.Cells[1,rows-1] = '' then rows := rows -1   //ydy 2004-14 add
      else  sgorder.RowCount := sgorder.RowCount + 1;
      sgorder.Cells[0,rows] := inttostr(rows);   //编号
      sgorder.Cells[1,rows]:=trim(dmmain.dsquery.fieldbyname('type').AsString);
      sgorder.Cells[2,rows]:=trim(dmmain.dsquery.fieldbyname('goods_no').AsString);
      sgorder.Cells[3,rows]:=trim(dmmain.dsquery.fieldbyname('goods_name').AsString);
      sgorder.Cells[4,rows] := trim(dmmain.dsquery.Fieldbyname('base_unit').AsString);
      sgorder.Cells[6,rows] :='1';
      sgorder.Cells[8,rows] :='1';
      sgorder.Cells[10,rows] :='0';
      sgorder.Cells[11,rows ] := '10';
      dmmain.dsquery.Close;
      self.close;
    end;
  end;
  if show_mode='配送收货单' then
  begin
    with FmPosSendBill do
    begin
      rows:=sgorder.RowCount;
      if  sgorder.Cells[1,rows-1] = '' then rows := rows -1   //ydy 2004-14 add
      else  sgorder.RowCount := sgorder.RowCount + 1;
       sgorder.Cells[0,rows] := inttostr(rows);   //编号
      sgorder.Cells[1,rows]:=trim(dmmain.dsquery.fieldbyname('type').AsString);
      sgorder.Cells[2,rows]:=trim(dmmain.dsquery.fieldbyname('goods_no').AsString);
      sgorder.Cells[3,rows]:=trim(dmmain.dsquery.fieldbyname('goods_name').AsString);
      sgorder.Cells[6,rows] := trim(dmmain.dsquery.Fieldbyname('base_unit').AsString);
      sgorder.Cells[8,rows] := trim('0');
      sgorder.Cells[21,rows] := trim(inttostr(dmmain.dsquery.Fieldbyname('stock_amount').AsInteger));
      sgorder.Cells[19,rows ] := '0000100001';    ////???
      sgorder.Cells[16,rows ] := '10';
      dmmain.dsquery.Close;
      self.close;
    end;
  end;

end;

procedure TfmgoodCodeSelPei.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  DMMAIN.DSquery.Close;
  dmmain.DSquery.Data:=null;
  inherited;

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -