📄 main.pas
字号:
end;
{权限设定}
procedure TfrmMain.mUserMenuClick(Sender: TObject);
begin
strCaption :=copy(mUserMenu.Caption,0,pos('(',mUserMenu.Caption)-1) ;
if not CheckMenu('mUserMenu') then exit ;
FormIndex := FindForm(56);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMUserMenu')=nil then
begin
FMUserMenu:=TFMUserMenu.create(self);
FMUserMenu.aMenuCaptionList.AddStrings(MenuCaptionList) ;
FMUserMenu.aMenuList.AddStrings(MenuList) ;
end ;
end ;
FMUserMenu.Caption :=strCaption ;
FMUserMenu.Tag :=56;
end;
{客户设置}
procedure TfrmMain.mCustParaClick(Sender: TObject);
begin
strCaption :=copy(mCustPara.Caption,0,pos('(',mCustPara.Caption)-1) ;
if not CheckMenu('mCustPara') then exit ;
FormIndex := FindForm(55);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMCustPara')=nil then
FMCustPara:=TFMCustPara.create(self);
end ;
FMCustPara.Caption :=strCaption ;
FMCustPara.Tag :=55;
end;
{注册}
procedure TfrmMain.mRegClick(Sender: TObject);
begin
if Application.FindComponent('frmRegCount')=nil then
frmRegCount:=TfrmRegCount.create(self);
frmRegCount.Show ;
end;
{验收单}
procedure TfrmMain.mReceiveClick(Sender: TObject);
begin
strCaption :=copy(mReceive.Caption,0,pos('(',mReceive.Caption)-1) ;
if not CheckMenu('mReceive') then exit ;
FormIndex := FindForm(21);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsReceive')=nil then
FMTsReceive:=TFMTsReceive.create(self);
end ;
FMTsReceive.aCompany :=strCustName;
FMTsReceive.aUserId :=strUser;
FMTsReceive.Caption :=strCaption ;
FMTsReceive.Tag :=21;
end;
{供商资料}
procedure TfrmMain.mSupplierClick(Sender: TObject);
begin
strCaption :=copy(mSupplier.Caption,0,pos('(',mSupplier.Caption)-1) ;
if not CheckMenu('mSupplier') then exit ;
FormIndex := FindForm(11);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMSupplier')=nil then
FMSupplier:=TFMSupplier.create(self);
end ;
FMSupplier.Caption :=strCaption ;
FMSupplier.Tag :=11;
end;
{客户资料}
procedure TfrmMain.mCustClick(Sender: TObject);
begin
strCaption :=copy(mCust.Caption,0,pos('(',mCust.Caption)-1) ;
if not CheckMenu('mCust') then exit ;
FormIndex := FindForm(12);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMCustomer')=nil then
FMCustomer:=TFMCustomer.create(self);
end ;
FMCustomer.Caption :=strCaption ;
FMCustomer.Tag :=12;
end;
{产品分类}
procedure TfrmMain.mClassClick(Sender: TObject);
begin
strCaption :=copy(mClass.Caption,0,pos('(',mClass.Caption)-1) ;
if not CheckMenu('mClass') then exit ;
FormIndex := FindForm(13);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMClass')=nil then
FMClass:=TFMClass.create(self);
end ;
FMClass.Caption :=strCaption ;
FMClass.Tag :=13;
end;
{产品}
procedure TfrmMain.mItemClick(Sender: TObject);
begin
strCaption :=copy(mItem.Caption,0,pos('(',mItem.Caption)-1) ;
if not CheckMenu('mItem') then exit ;
FormIndex := FindForm(14);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMItem')=nil then
FMItem:=TFMItem.create(self);
end ;
FMItem.Caption :=strCaption ;
FMItem.Tag :=14;
end;
{退货单}
procedure TfrmMain.mReturnClick(Sender: TObject);
begin
strCaption :=copy(mReturn.Caption,0,pos('(',mReturn.Caption)-1) ;
if not CheckMenu('mReturn') then exit ;
FormIndex := FindForm(22);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsReturn')=nil then
FMTsReturn:=TFMTsReturn.create(self);
end ;
FMTsReturn.aCompany :=strCustName;
FMTsReturn.aUserId :=strUser;
FMTsReturn.Caption :=strCaption ;
FMTsReturn.Tag :=22;
end;
{领料单}
procedure TfrmMain.mSaleClick(Sender: TObject);
begin
strCaption :=copy(mSale.Caption,0,pos('(',mSale.Caption)-1) ;
if not CheckMenu('mSale') then exit ;
FormIndex := FindForm(23);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsSale')=nil then
FMTsSale:=TFMTsSale.create(self);
end ;
FMTsSale.aCompany :=strCustName;
FMTsSale.aUserId :=strUser;
FMTsSale.Caption :=strCaption ;
FMTsSale.Tag :=23;
end;
{退料单}
procedure TfrmMain.mSaleReturnClick(Sender: TObject);
begin
strCaption :=copy(mSaleReturn.Caption,0,pos('(',mSaleReturn.Caption)-1) ;
if not CheckMenu('mSaleReturn') then exit ;
FormIndex := FindForm(24);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsSaleReturn')=nil then
FMTsSaleReturn:=TFMTsSaleReturn.create(self);
end ;
FMTsSaleReturn.aCompany :=strCustName;
FMTsSaleReturn.aUserId :=strUser;
FMTsSaleReturn.Caption :=strCaption ;
FMTsSaleReturn.Tag :=24 ;
end;
{期初开帐}
procedure TfrmMain.mBegStockClick(Sender: TObject);
begin
strCaption :=copy(mBegStock.Caption,0,pos('(',mBegStock.Caption)-1) ;
if not CheckMenu('mBegStock') then exit ;
FormIndex := FindForm(31);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsBegstock')=nil then
FMTsBegstock:=TFMTsBegstock.create(self);
end ;
FMTsBegstock.aCompany :=strCustName;
FMTsBegstock.aUserId :=strUser;
FMTsBegstock.Caption :=strCaption ;
FMTsBegstock.Tag :=31;
end;
{调整}
procedure TfrmMain.mLostClick(Sender: TObject);
begin
strCaption :=copy(mLost.Caption,0,pos('(',mLost.Caption)-1) ;
if not CheckMenu('mLost') then exit ;
FormIndex := FindForm(32);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsLost')=nil then
FMTsLost:=TFMTsLost.create(self);
end ;
FMTsLost.aCompany :=strCustName;
FMTsLost.aUserId :=strUser;
FMTsLost.Caption :=strCaption ;
FMTsLost.Tag :=32;
end;
procedure TfrmMain.mQryStockClick(Sender: TObject);
begin
strCaption :=copy(mQryStock.Caption,0,pos('(',mQryStock.Caption)-1) ;
if not CheckMenu('mQryStock') then exit ;
FormIndex := FindForm(44);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMQryStock')=nil then
FMQryStock:=TFMQryStock.create(self);
end ;
FMQryStock.aCompany :=strCustName;
FMQryStock.aUserId :=strUser;
FMQryStock.Caption :=strCaption ;
FMQryStock.Tag :=44;
end;
{月结}
procedure TfrmMain.mMonthClick(Sender: TObject);
begin
strCaption :=copy(mMonth.Caption,0,pos('(',mMonth.Caption)-1) ;
if not CheckMenu('mMonth') then exit ;
FormIndex := FindForm(41);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMQryMonth')=nil then
FMQryMonth:=TFMQryMonth.create(self);
end ;
FMQryMonth.aCompany :=strCustName;
FMQryMonth.aUserId :=strUser;
FMQryMonth.Caption :=strCaption ;
FMQryMonth.Tag :=41;
end;
{盘点}
procedure TfrmMain.mCheckStockClick(Sender: TObject);
begin
strCaption :=copy(mCheckStock.Caption,0,pos('(',mCheckStock.Caption)-1) ;
if not CheckMenu('mCheckStock') then exit ;
FormIndex := FindForm(34);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMTsCheckstock')=nil then
FMTsCheckstock:=TFMTsCheckstock.create(self);
end ;
FMTsCheckstock.aCompany :=strCustName;
FMTsCheckstock.aUserId :=strUser;
FMTsCheckstock.Caption :=strCaption ;
FMTsCheckstock.Tag :=34;
end;
{综合库存}
procedure TfrmMain.mAllStockClick(Sender: TObject);
begin
strCaption :=copy(mAllStock.Caption,0,pos('(',mAllStock.Caption)-1) ;
if not CheckMenu('mAllStock') then exit ;
FormIndex := FindForm(43);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMQryAllStock')=nil then
FMQryAllStock:=TFMQryAllStock.create(self);
end ;
FMQryAllStock.aCompany :=strCustName;
FMQryAllStock.aUserId :=strUser;
FMQryAllStock.Caption :=strCaption ;
FMQryAllStock.Tag :=43;
end;
{月结查询}
procedure TfrmMain.mQryMonthClick(Sender: TObject);
begin
strCaption :=copy(mQryMonth.Caption,0,pos('(',mQryMonth.Caption)-1) ;
if not CheckMenu('mQryMonth') then exit ;
FormIndex := FindForm(42);
if (FormIndex > -1) then
Screen.CustomForms[FormIndex].Show
else
begin
if Application.FindComponent('FMQryMonthData')=nil then
FMQryMonthData:=TFMQryMonthData.create(self);
end ;
FMQryMonthData.aCompany :=strCustName;
FMQryMonthData.Caption :=strCaption ;
FMQryMonthData.Tag :=42;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -