📄 sjxc_un.pas
字号:
unit sjxc_un;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, frmbase_un, bsMessages, bsSkinData, BusinessSkinForm,
bsSkinCtrls, bsdbctrls, StdCtrls, bsSkinGrids, bsDBGrids, DB, ADODB,
bsSkinBoxCtrls, Mask;
type
Tsjxc_frm = class(Tbase_frm)
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinExPanel1: TbsSkinExPanel;
bsSkinExPanel2: TbsSkinExPanel;
bsSkinStdLabel3: TbsSkinStdLabel;
bsSkinDBText2: TbsSkinDBText;
bsSkinStdLabel4: TbsSkinStdLabel;
bsSkinDBText3: TbsSkinDBText;
bsSkinStdLabel5: TbsSkinStdLabel;
bsSkinDBText4: TbsSkinDBText;
bsSkinStdLabel6: TbsSkinStdLabel;
bsSkinDBText5: TbsSkinDBText;
bsSkinStdLabel7: TbsSkinStdLabel;
bsSkinDBText6: TbsSkinDBText;
bsSkinStdLabel8: TbsSkinStdLabel;
bsSkinDBText7: TbsSkinDBText;
bsSkinDBText8: TbsSkinDBText;
bsSkinDBText9: TbsSkinDBText;
bsSkinStdLabel11: TbsSkinStdLabel;
bsSkinDBText10: TbsSkinDBText;
bsSkinStdLabel12: TbsSkinStdLabel;
bsSkinPanel3: TbsSkinPanel;
spsjxc: TADOStoredProc;
ds_sjxc: TDataSource;
qry_sjcs: TADOQuery;
ds_sjcs: TDataSource;
ds_sjxh: TDataSource;
tbl_sjxh: TADOQuery;
bsSkinStdLabel9: TbsSkinStdLabel;
bsSkinDBText1: TbsSkinDBText;
bsSkinPanel4: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinStdLabel13: TbsSkinStdLabel;
bsSkinStdLabel14: TbsSkinStdLabel;
bsSkinStdLabel15: TbsSkinStdLabel;
bsSkinStdLabel16: TbsSkinStdLabel;
bsSkinStdLabel17: TbsSkinStdLabel;
bsSkinStdLabel18: TbsSkinStdLabel;
bsSkinDBText11: TbsSkinDBText;
bsSkinDBLookupComboBox3: TbsSkinDBLookupComboBox;
bsSkinDBEdit1: TbsSkinDBEdit;
bsSkinDBEdit2: TbsSkinDBEdit;
bsSkinDBEdit3: TbsSkinDBEdit;
bsSkinStdLabel19: TbsSkinStdLabel;
tbl_hxc: TADOTable;
ds_hxc: TDataSource;
tbl_ygzl: TADOTable;
ds_ygzl: TDataSource;
spgetid: TADOStoredProc;
bsSkinButton2: TbsSkinButton;
bsSkinExPanel3: TbsSkinExPanel;
bsSkinExPanel4: TbsSkinExPanel;
bsSkinDBGrid2: TbsSkinDBGrid;
bsSkinScrollBar3: TbsSkinScrollBar;
bsSkinScrollBar4: TbsSkinScrollBar;
bsSkinPanel5: TbsSkinPanel;
bsSkinStdLabel2: TbsSkinStdLabel;
bsSkinDBLookupComboBox2: TbsSkinDBLookupComboBox;
bsSkinStdLabel1: TbsSkinStdLabel;
bsSkinDBLookupComboBox1: TbsSkinDBLookupComboBox;
bsSkinButton3: TbsSkinButton;
bsSkinStdLabel35: TbsSkinStdLabel;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinExPanel5: TbsSkinExPanel;
bsSkinStdLabel10: TbsSkinStdLabel;
bsSkinDBText12: TbsSkinDBText;
bsSkinStdLabel32: TbsSkinStdLabel;
bsSkinDBText13: TbsSkinDBText;
bsSkinDBText14: TbsSkinDBText;
bsSkinDBText15: TbsSkinDBText;
bsSkinStdLabel33: TbsSkinStdLabel;
bsSkinDBText16: TbsSkinDBText;
bsSkinStdLabel34: TbsSkinStdLabel;
bsSkinStdLabel36: TbsSkinStdLabel;
bsSkinDBText17: TbsSkinDBText;
bsSkinStdLabel37: TbsSkinStdLabel;
bsSkinStdLabel41: TbsSkinStdLabel;
bsSkinStdLabel42: TbsSkinStdLabel;
bsSkinStdLabel43: TbsSkinStdLabel;
bsSkinGroupBox1: TbsSkinGroupBox;
bsSkinStdLabel38: TbsSkinStdLabel;
bsSkinStdLabel39: TbsSkinStdLabel;
bsSkinStdLabel40: TbsSkinStdLabel;
bsSkinDBEdit4: TbsSkinDBEdit;
bsSkinDBEdit5: TbsSkinDBEdit;
bsSkinDBEdit6: TbsSkinDBEdit;
bsSkinDBEdit7: TbsSkinDBEdit;
bsSkinStdLabel20: TbsSkinStdLabel;
bsSkinStdLabel21: TbsSkinStdLabel;
bsSkinStdLabel22: TbsSkinStdLabel;
bsSkinStdLabel23: TbsSkinStdLabel;
bsSkinStdLabel24: TbsSkinStdLabel;
bsSkinStdLabel25: TbsSkinStdLabel;
bssl_1: TbsSkinDBText;
procedure FormShow(Sender: TObject);
procedure bsSkinDBLookupComboBox2Change(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinCheckRadioBox1Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure spsjxcAfterOpen(DataSet: TDataSet);
procedure bsSkinDBLookupComboBox1Click(Sender: TObject);
procedure bsSkinDBLookupComboBox2Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure state();
{ Private declarations }
public
{ Public declarations }
end;
var
sjxc_frm: Tsjxc_frm;
implementation
uses data_un;
{$R *.dfm}
procedure tsjxc_frm.state();
begin
bsSkinExPanel1.Enabled:=bsSkinCheckRadioBox1.Checked;
if bsSkinExPanel1.Enabled then
begin
bsSkinExPanel5.Visible:=true;
tbl_ygzl.Open;
if not tbl_hxc.Active then
tbl_hxc.Active:=true;
tbl_hxc.Append;
bsSkinDBEdit1.Text:=bsSkinStdLabel25.Caption;
bsSkinDBEdit2.Text:=bsSkinStdLabel22.Caption;
bsSkinDBEdit3.Text:=bsSkinStdLabel23.Caption;
bsSkinDBEdit7.Text:=bsSkinStdLabel24.Caption;
bsSkinButton1.Caption:='确定';
bsSkinExPanel3.Enabled:=false;
bsSkinCheckRadioBox1.Caption:='进行新的操作'
end
else
begin
bsSkinExPanel5.Visible:=false;
tbl_hxc.Close;
tbl_ygzl.Close;
bsSkinExPanel3.Enabled:=true;
bsSkinCheckRadioBox1.Caption:='是否选中这部手机';
bsSkinButton1.Caption:='确定';
end;
end;
procedure Tsjxc_frm.FormShow(Sender: TObject);
begin
inherited;
bsSkinExPanel1.Enabled:=false;
//bsSkinCheckRadioBox1.Enabled:=false;
bsSkinExPanel3.Enabled:=true;
bsSkinDBText8.Caption:='';
bsSkinDBText2.Caption:='';
bsSkinDBText9.Caption:='';
bsSkinDBText1.Caption:='';
bsSkinDBText10.Caption:='';
bsSkinDBText11.Caption:='';
end;
procedure Tsjxc_frm.bsSkinDBLookupComboBox2Change(Sender: TObject);
begin
inherited;
spsjxc.Close;
spsjxc.Parameters.ParamValues['@fid']:=tbl_sjxh.FieldValues['fid'];
spsjxc.ExecProc;
spsjxc.Open;
end;
procedure Tsjxc_frm.bsSkinButton2Click(Sender: TObject);
begin
inherited;
if bsSkinMessage1.MessageDlg('请在交易完成后关闭,'+#13+'一旦关闭以后就只能做退货处理'+#13+'交易完成请按Yes,重新核对资料请按No',mtinformation,[mbyes,mbno],0)=mryes then
close;
end;
procedure Tsjxc_frm.bsSkinCheckRadioBox1Click(Sender: TObject);
begin
inherited;
bsSkinDBText16.Caption:=bsSkinDBText10.Caption;
bsSkinDBText14.Caption:=bsSkinDBText8.Caption;
bsSkinDBText13.Caption:=bsSkinDBText7.Caption;
bsSkinDBText15.Caption:= bsSkinDBText9.Caption ;
bsSkinDBText12.Caption:=bsSkinDBText2.Caption;
bsSkinDBText17.Caption:=bsSkinDBText1.Caption;
bssl_1.Caption:=spsjxc.FieldValues['fmon'];
state();
bsSkinButton3.Enabled:=false;
end;
procedure Tsjxc_frm.bsSkinButton1Click(Sender: TObject);
begin
inherited;
if bsSkinButton1.Caption='修改' then
if bsSkinMessage1.MessageDlg('是否真的修改客户资料',mtinformation,[mbyes,mbno],0)=mryes then
begin
tbl_hxc.Post;
tbl_hxc.Locate('fid',bsSkinDBText11.Caption,[]);
tbl_hxc.Edit;
bsSkinMessage1.MessageDlg('修改成功',mtInformation,[mbYes],0);
end;
if bsSkinButton1.Caption='确定' then
if bsSkinMessage1.MessageDlg('是否真的将这部手机卖给客户',mtinformation,[mbyes,mbno],0)=mryes then
begin
if tbl_hxc.State=dsinsert then
begin
//取流水号
try
with spgetid do
begin
parameters.ParamValues['@IDType']:='XC';
parameters.ParamValues['@numb']:=4;
Execproc;
end;
except
on E:Exception do
begin
bsSkinMessage1.MessageDlg('取工艺流程流水号失败!'+#13#10+E.Message,mterror,[mbOk],0);
Abort;
end;
end;
tbl_hxc.FieldByName('fid').AsString:= Trim(spgetid.Parameters.ParamValues['@OutNumber']);
tbl_hxc.FieldValues['fdate']:=datetostr(date());
tbl_hxc.FieldValues['fcode']:=bsSkinDBText17.Caption;
tbl_hxc.FieldValues['fjhmon']:=bssl_1.Caption;
tbl_hxc.Post;
tbl_hxc.Locate('fcode',bsSkinDBText1.Caption,[]);
tbl_hxc.Edit;
bsSkinButton1.Caption:='修改';
bsSkinMessage1.MessageDlg('添加记录成功',mtInformation,[mbYes],0);
end;
spsjxc.Close;
spsjxc.Open;
bsSkinButton3.Enabled:=true;
//if dm.ADOConnection1.InTransaction then
//dm.ADOConnection1.CommitTrans ;
end;
end;
procedure Tsjxc_frm.spsjxcAfterOpen(DataSet: TDataSet);
begin
inherited;
if spsjxc.RecordCount>0 then
bsSkinCheckRadioBox1.Enabled:=true
else
bsSkinCheckRadioBox1.Enabled:=false;
end;
procedure Tsjxc_frm.bsSkinDBLookupComboBox1Click(Sender: TObject);
begin
inherited; {
bsSkinCheckRadioBox1.Enabled:=false;
bsSkinCheckRadioBox1.Checked:=false;
state(); }
end;
procedure Tsjxc_frm.bsSkinDBLookupComboBox2Click(Sender: TObject);
begin
inherited; {
bsSkinCheckRadioBox1.Enabled:=false;
bsSkinCheckRadioBox1.Checked:=false;
state(); }
end;
procedure Tsjxc_frm.bsSkinButton3Click(Sender: TObject);
begin
inherited;
if bsSkinMessage1.MessageDlg('是否真的删除本条记录',mtinformation,[mbyes,mbno],0)=mryes then
begin
tbl_hxc.Delete;
tbl_hxc.Close;
bsSkinCheckRadioBox1.Caption:='是否选中这部手机' ;
bsSkinExPanel3.Enabled:=true;
bsSkinCheckRadioBox1.Checked:=false;
bsSkinExPanel5.Visible:=false;
end;
end;
procedure Tsjxc_frm.FormCreate(Sender: TObject);
begin
inherited;
//bsSkinExPanel5.Left:=bsSkinExPanel2.Left;
//bsSkinExPanel5.Top:=bsSkinExPanel2.Top;
//bsSkinExPanel5.Height:=bsSkinExPanel2.Height;
//bsSkinExPanel5.Width:=bsSkinExPanel2.Width;
bsSkinExPanel5.Visible:=false;
qry_sjcs.Open;
tbl_sjxh.Open;
bsSkinDBEdit7.Text:='';
bsSkinDBEdit1.Text:='';
bsSkinDBEdit2.Text:='';
bsSkinDBEdit3.Text:='';
bsSkinDBText7.Caption:='';
bsSkinStdLabel25.Caption:='';
bsSkinStdLabel22.Caption:='';
bsSkinStdLabel23.Caption:='';
bsSkinStdLabel24.Caption:='';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -