📄 sjrcbase.pas
字号:
unit sjrcbase;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, spbaseinfoadd_un, DB, ADODB, ActnList, bsMessages, bsSkinData,
BusinessSkinForm, bsSkinGrids, bsDBGrids, StdCtrls, Mask, bsSkinBoxCtrls,
bsSkinCtrls, ExtCtrls, bsdbctrls;
type
Tsjycbase_frm = class(Tspbaseinfoadd_frm)
ds_sjcs: TDataSource;
ds_sjxh: TDataSource;
ds_sjco: TDataSource;
tbl_sjco: TADOTable;
ds_sjpz: TDataSource;
tbl_sjpz: TADOTable;
tbl_sjcs: TADOQuery;
tbl_sjxh: TADOTable;
bsSkinDBEdit1: TbsSkinDBEdit;
bsSkinPanel1: TbsSkinPanel;
bsSkinStdLabel2: TbsSkinStdLabel;
bsSkinStdLabel4: TbsSkinStdLabel;
bsSkinStdLabel7: TbsSkinStdLabel;
bsSkinStdLabel6: TbsSkinStdLabel;
bsSkinDBLookupComboBox3: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox4: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox2: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox1: TbsSkinDBLookupComboBox;
bsSkinStdLabel5: TbsSkinStdLabel;
bsSkinStdLabel8: TbsSkinStdLabel;
bsSkinDBEdit2: TbsSkinDBEdit;
bsSkinDBLookupComboBox5: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox6: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox7: TbsSkinDBLookupComboBox;
bsSkinDBLookupComboBox8: TbsSkinDBLookupComboBox;
bsSkinDBEdit3: TbsSkinDBEdit;
bsSkinEdit2: TbsSkinEdit;
bsSkinEdit3: TbsSkinEdit;
bsSkinDBEdit4: TbsSkinDBEdit;
bsSkinStdLabel9: TbsSkinStdLabel;
bsSkinDBText2: TbsSkinDBText;
bsSkinEdit4: TbsSkinEdit;
bsSkinStdLabel10: TbsSkinStdLabel;
bsSkinStdLabel11: TbsSkinStdLabel;
bsSkinStdLabel3: TbsSkinStdLabel;
bsSkinEdit5: TbsSkinEdit;
bsSkinScrollBar1: TbsSkinScrollBar;
bsSkinScrollBar2: TbsSkinScrollBar;
bsSkinDateEdit1: TbsSkinDateEdit;
bsSkinDBDateEdit1: TbsSkinDBDateEdit;
bsSkinStdLabel33333: TbsSkinStdLabel;
procedure FormCreate(Sender: TObject);
procedure acModifyExecute(Sender: TObject);
procedure acSaveExecute(Sender: TObject);
procedure acNewExecute(Sender: TObject);
procedure acDeleteExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure spdispAfterOpen(DataSet: TDataSet);
private
{ Private declarations }
acti:integer; //1为add,2为修改3为删除
public
hylx:string; //货源类型
hyd:string; //货源地名称
hydid:string; //货源地ID
lh:Integer;//是否删除领货记录
vbsid:string;
vcmon,vomon,num:integer;
duo:integer;//多机入库标志,2为多机入库
{ Public declarations }
end;
var
sjycbase_frm: Tsjycbase_frm;
implementation
uses data_un;
{$R *.dfm}
procedure Tsjycbase_frm.FormCreate(Sender: TObject);
begin
if not tbl_sjcs.Active then
tbl_sjcs.Open;
if not tbl_sjxh.Active then
tbl_sjxh.Open;
if not tbl_sjco.Active then
tbl_sjco.Open;
if not tbl_sjpz.Active then
tbl_sjpz.Open;
inherited;
spdisp.Parameters.ParamValues['@hylx']:=hylx;
num:=1;
duo:=1;
bsSkinDateEdit1.Date:=Date();
end;
procedure Tsjycbase_frm.acModifyExecute(Sender: TObject);
begin
inherited;
acti:=2;
bsSkinDBLookupComboBox5.KeyValue:=bsSkinDBLookupComboBox1.KeyValue;
bsSkinDBLookupComboBox6.KeyValue:=bsSkinDBLookupComboBox2.KeyValue;
bsSkinDBLookupComboBox7.KeyValue:=bsSkinDBLookupComboBox4.KeyValue;
bsSkinDBLookupComboBox8.KeyValue:=bsSkinDBLookupComboBox3.KeyValue;
bsSkinEdit2.Text:=bsSkinDBEdit3.Text;
bsSkinEdit3.Text:=bsSkinDBEdit4.Text;
bsSkinEdit4.Text:=bsSkinDBEdit2.Text;
bsSkinStdLabel10.Caption:=bsSkinDBText2.Caption;
bsSkinDateEdit1.Date:=bsSkinDBDateEdit1.Date;
end;
procedure Tsjycbase_frm.acSaveExecute(Sender: TObject);
begin
if (acti=2) then
spsave.Parameters.ParamValues['@VId']:=bsSkinStdLabel10.Caption; //收购流水线
//查找领货记录
spsave.Parameters.ParamValues['@VModel']:=tbl_sjxh.FieldValues['fid'];
spsave.Parameters.ParamValues['@VColor']:=tbl_sjco.FieldValues['fid'];
spsave.Parameters.ParamValues['@VNo']:=bsSkinEdit2.Text;//手机串号
spsave.Parameters.ParamValues['@Vbsid']:=vbsid;
spsave.Parameters.ParamValues['@vcmon']:=vcmon;
//原价应当是手机串号入库的时所记录的价格,因为会发生保价行为,
spsave.Parameters.ParamValues['@vomon']:=vomon;
spsave.Parameters.ParamValues['@VJbpz']:=tbl_sjpz.FieldValues['fid'];
spsave.Parameters.ParamValues['@VMoney']:=bsSkinEdit3.Text;//价格
spsave.Parameters.ParamValues['@VGl']:=bsSkinEdit4.Text;//基本功能
spsave.Parameters.ParamValues['@Vhyd']:=hydid;//货源地ID
spsave.Parameters.ParamValues['@dat']:=bsSkinDateEdit1.Date;
spsave.Parameters.ParamValues['@VAct']:=acti;//操作类型是插入,删除,还是修改
spsave.Parameters.ParamValues['@VHylx']:=hylx;//货源类型
inherited;
end;
procedure Tsjycbase_frm.acNewExecute(Sender: TObject);
begin
inherited;
acti:=1;
end;
procedure Tsjycbase_frm.acDeleteExecute(Sender: TObject);
begin
acti:=3;
spsave.Parameters.ParamValues['@VId']:=bsSkinDBText2.Caption; //收购流水线
spsave.Parameters.ParamValues['@VAct']:=acti;
inherited;
end;
procedure Tsjycbase_frm.FormShow(Sender: TObject);
var i:integer;
begin
inherited;
bsSkinEdit5.Text:=hyd;
for i:=0 to ComponentCount-1 do
begin
if Components[i].Tag=2 then
begin
TbsSkinDBText(Components[i]).Enabled:=false;
TbsSkinDBLookupComboBox(Components[i]).Enabled:=false;
end;
end;
bsSkinDateEdit1.Date:=Date();
end;
procedure Tsjycbase_frm.spdispAfterOpen(DataSet: TDataSet);
begin
inherited;
if spdisp.Active then
IF spdisp.RecordCount>0 then
bsSkinStdLabel10.Caption:=bsSkinDBText2.Caption;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -