通用 产品 合同 仓库 资料
This commit is contained in:
parent
2a8919f3aa
commit
aba33485a5
3966
A00通用窗体/U_CraftSel.dfm
Normal file
3966
A00通用窗体/U_CraftSel.dfm
Normal file
File diff suppressed because it is too large
Load Diff
154
A00通用窗体/U_CraftSel.pas
Normal file
154
A00通用窗体/U_CraftSel.pas
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
unit U_CraftSel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ADODB, DBClient, ToolWin, ComCtrls, StdCtrls, ExtCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
||||
dxDateRanges, dxBarBuiltInMenu, dxScrollbarAnnotations, cxCheckBox,
|
||||
System.ImageList, dxSkinWXI, Vcl.ImgList;
|
||||
|
||||
//通用工艺选择窗体(自包含连接,供各模块DLL使用,连接串取自各工程自己的U_DataLink.DConString)
|
||||
|
||||
type
|
||||
TfrmCraftSel = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBFind: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
CR_Code: TEdit;
|
||||
CR_Name: TEdit;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
Tv1CR_Code: TcxGridDBColumn;
|
||||
Tv1CR_Name: TcxGridDBColumn;
|
||||
Tv1C_Width: TcxGridDBColumn;
|
||||
Tv1C_GramWeight: TcxGridDBColumn;
|
||||
Tv1C_Color: TcxGridDBColumn;
|
||||
Tv1C_YarnQty: TcxGridDBColumn;
|
||||
Tv1head_count: TcxGridDBColumn;
|
||||
Tv1strip_width: TcxGridDBColumn;
|
||||
Tv1C_MachLatitudeDensity: TcxGridDBColumn;
|
||||
Tv1row_count_top: TcxGridDBColumn;
|
||||
Tv1displace: TcxGridDBColumn;
|
||||
Tv1reed_width: TcxGridDBColumn;
|
||||
Tv1C_ReedNo: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
DS_1: TDataSource;
|
||||
CDS_1: TClientDataSet;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOConnection1: TADOConnection;
|
||||
ImageList1: TImageList;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure Tv1DblClick(Sender: TObject);
|
||||
procedure CRCodeKeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCraftSel: TfrmCraftSel;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCraftSel.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
Connected := true;
|
||||
end;
|
||||
except
|
||||
application.MessageBox('网络连接失败!', '提示信息');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.InitGrid();
|
||||
var
|
||||
fwhere: string;
|
||||
begin
|
||||
fwhere := ' where 1=1 ';
|
||||
if Trim(CR_Code.Text) <> '' then
|
||||
fwhere := fwhere + ' and CR_Code like ' + QuotedStr('%' + Trim(CR_Code.Text) + '%');
|
||||
if Trim(CR_Name.Text) <> '' then
|
||||
fwhere := fwhere + ' and CR_Name like ' + QuotedStr('%' + Trim(CR_Name.Text) + '%');
|
||||
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered := False;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from BS_Craft_Info' + fwhere + ' order by CR_Code');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, CDS_1);
|
||||
SInitCDSData(ADOQueryMain, CDS_1);
|
||||
TV1.DataController.Filter.Clear;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCraftSel := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_1.IsEmpty then
|
||||
Exit;
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.Tv1DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_1.IsEmpty then
|
||||
Exit;
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmCraftSel.CRCodeKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key = #13 then
|
||||
begin
|
||||
Key := #0;
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
@ -130,6 +130,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
TabOrder = 2
|
||||
object TV1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
DataController.DataSource = DS_1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
|
|
@ -171,6 +172,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object TV1Column7: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
|
|
@ -179,36 +181,42 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object TV1Column1: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object TV1Column6: TcxGridDBColumn
|
||||
Caption = #23458#25143#21333#21495
|
||||
DataBinding.FieldName = 'BuyConNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 88
|
||||
end
|
||||
object TV1Column5: TcxGridDBColumn
|
||||
Caption = #32463#33829#21333#20301
|
||||
DataBinding.FieldName = 'SellName'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object TV1Column3: TcxGridDBColumn
|
||||
Caption = #23458#25143
|
||||
DataBinding.FieldName = 'BuyName'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object TV1Column4: TcxGridDBColumn
|
||||
Caption = #20013#38388#21830
|
||||
DataBinding.FieldName = 'MiddleName'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'C_Spec'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
|
|
@ -216,6 +224,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object TV1Column2: TcxGridDBColumn
|
||||
Caption = #20132#36135#26085#26399
|
||||
DataBinding.FieldName = 'DlyDate'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
|
|
@ -223,6 +232,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object VC_SCSCode: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'C_Code'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
|
|
@ -237,6 +247,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'C_Name'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
|
|
@ -244,6 +255,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20135#21697#33521#25991#21517
|
||||
DataBinding.FieldName = 'C_EName'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
|
|
@ -258,6 +270,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #25104#20998
|
||||
DataBinding.FieldName = 'C_Composition'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
|
|
@ -265,6 +278,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'C_Color'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
|
|
@ -272,6 +286,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn6: TcxGridDBColumn
|
||||
Caption = #33394#21495
|
||||
DataBinding.FieldName = 'C_ColorNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 57
|
||||
|
|
@ -279,6 +294,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn7: TcxGridDBColumn
|
||||
Caption = #27454#21495
|
||||
DataBinding.FieldName = 'C_StyleNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 77
|
||||
|
|
@ -286,6 +302,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'C_Pattern'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
|
|
@ -300,6 +317,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'C_Width'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
|
|
@ -313,6 +331,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'C_GramWeight'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
|
|
@ -326,6 +345,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object v1PRTOrderQty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'ConQty'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
|
|
@ -334,6 +354,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object v1OrderUnit: TcxGridDBColumn
|
||||
Caption = #21333#20301
|
||||
DataBinding.FieldName = 'ConUnit'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsEditFixedList
|
||||
Properties.Items.Strings = (
|
||||
|
|
@ -347,6 +368,7 @@ inherited frmSalesContractSel: TfrmSalesContractSel
|
|||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'ConSNote'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ uses
|
|||
cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
||||
dxDateRanges, dxBarBuiltInMenu, System.ImageList, U_BaseInput, cxButtonEdit,
|
||||
cxDropDownEdit, cxCheckBox, Vcl.Menus;
|
||||
cxDropDownEdit, cxCheckBox, Vcl.Menus, dxSkinWXI, dxScrollbarAnnotations;
|
||||
|
||||
type
|
||||
TfrmSalesContractSel = class(TfrmBaseHelp)
|
||||
|
|
|
|||
|
|
@ -84,8 +84,6 @@ inherited frmTatClothInfoSel: TfrmTatClothInfoSel
|
|||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
TabOrder = 1
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
ExplicitLeft = -4
|
||||
ExplicitTop = 88
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CTName'
|
||||
Width = 210
|
||||
|
|
@ -225,6 +223,14 @@ inherited frmTatClothInfoSel: TfrmTatClothInfoSel
|
|||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object Tv1conno: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'conno'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ uses
|
|||
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
||||
dxDateRanges, dxBarBuiltInMenu, System.ImageList, U_BaseInput, cxTL,
|
||||
cxMaskEdit, cxTLdxBarBuiltInMenu, cxCheckBox, cxInplaceContainer, cxDBTL,
|
||||
cxTLData, math, dxScrollbarAnnotations;
|
||||
cxTLData, math, dxScrollbarAnnotations, dxSkinWXI;
|
||||
|
||||
type
|
||||
TfrmTatClothInfoSel = class(TfrmBaseHelp)
|
||||
|
|
@ -80,6 +80,7 @@ type
|
|||
Tv1Column3: TcxGridDBColumn;
|
||||
Tv1Column4: TcxGridDBColumn;
|
||||
Tv1Column5: TcxGridDBColumn;
|
||||
Tv1conno: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ uses
|
|||
U_YarnInfoSel in '..\A00通用窗体\U_YarnInfoSel.pas' {frmYarnInfoSel},
|
||||
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
|
||||
U_CraftInfo in 'U_CraftInfo.pas',
|
||||
U_TatClothInfoInput in 'U_TatClothInfoInput.pas' {frmTatClothInfoInput};
|
||||
U_TatClothInfoInput in 'U_TatClothInfoInput.pas' {frmTatClothInfoInput},
|
||||
U_SalesContractSel in '..\A00通用窗体\U_SalesContractSel.pas' {frmSalesContractSel};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
|
|
|||
|
|
@ -174,6 +174,10 @@
|
|||
<Form>frmTatClothInfoInput</Form>
|
||||
<FormType>dfm</FormType>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\A00通用窗体\U_SalesContractSel.pas">
|
||||
<Form>frmSalesContractSel</Form>
|
||||
<FormType>dfm</FormType>
|
||||
</DCCReference>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
|
|
|
|||
|
|
@ -185,6 +185,7 @@ end;
|
|||
procedure TfrmCraftInfo.TBDelClick(Sender: TObject);
|
||||
var
|
||||
MRefCodes: string;
|
||||
MConRefCodes: string;
|
||||
begin
|
||||
if CDS_1.IsEmpty then
|
||||
Exit;
|
||||
|
|
@ -196,8 +197,9 @@ begin
|
|||
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
|
||||
//先整体检查:勾选中任一工艺被产品引用则全部阻止(避免删一半)
|
||||
//先整体检查:勾选中任一工艺被产品或合同明细引用则全部阻止(避免删一半)
|
||||
MRefCodes := '';
|
||||
MConRefCodes := '';
|
||||
CDS_1.DisableControls;
|
||||
try
|
||||
CDS_1.First;
|
||||
|
|
@ -218,6 +220,20 @@ begin
|
|||
MRefCodes := MRefCodes + ',';
|
||||
MRefCodes := MRefCodes + Trim(CDS_1.fieldbyname('CR_Code').AsString);
|
||||
end;
|
||||
//合同明细占用检查
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select count(*) as AA from BS_Contract_Sub where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('AA').AsInteger > 0 then
|
||||
begin
|
||||
if MConRefCodes <> '' then
|
||||
MConRefCodes := MConRefCodes + ',';
|
||||
MConRefCodes := MConRefCodes + Trim(CDS_1.fieldbyname('CR_Code').AsString);
|
||||
end;
|
||||
end;
|
||||
CDS_1.Next;
|
||||
end;
|
||||
|
|
@ -230,6 +246,11 @@ begin
|
|||
Application.MessageBox(PChar('工艺 ' + MRefCodes + ' 已被产品使用,不能删除!请先解除产品的工艺绑定。'), '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if MConRefCodes <> '' then
|
||||
begin
|
||||
Application.MessageBox(PChar('工艺 ' + MConRefCodes + ' 已被合同明细使用,不能删除!请先在合同中改选其他工艺。'), '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -613,6 +613,8 @@ begin
|
|||
|
||||
////////////////////////// 工艺保存后静默同步到所有绑定产品 //////////////////////////
|
||||
SyncCraftToProduct(Trim(maxId));
|
||||
//工艺改动同步到绑定该工艺的合同明细行
|
||||
SyncCraftToContract(Trim(maxId));
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
FCRID := maxId;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ uses
|
|||
// 主表工艺字段(含工艺编号/名称) + 经纬纱配比子表 + 纹版图子表
|
||||
//注意:必须在调用方的事务内执行,本过程不自己开事务
|
||||
procedure SyncCraftToProduct(const ACRID: string);
|
||||
//将工艺数据同步到所有绑定该工艺的合同明细行(仅工艺管辖列:编号/名称/门幅/克重/颜色)
|
||||
//注意:必须在调用方的事务内执行,本过程不自己开事务
|
||||
procedure SyncCraftToContract(const ACRID: string);
|
||||
|
||||
implementation
|
||||
|
||||
|
|
@ -168,4 +171,28 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure SyncCraftToContract(const ACRID: string);
|
||||
var
|
||||
Qry: TADOQuery;
|
||||
begin
|
||||
if Trim(ACRID) = '' then
|
||||
Exit;
|
||||
Qry := TADOQuery.Create(nil);
|
||||
try
|
||||
Qry.Connection := DataLink_ClothInfo.ADOLink;
|
||||
with Qry do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update S set S.C_Code=C.CR_Code,S.C_Name=C.CR_Name');
|
||||
SQL.Add(',S.C_Width=C.C_Width,S.C_GramWeight=C.C_GramWeight,S.C_Color=C.C_Color');
|
||||
SQL.Add('from BS_Contract_Sub S join BS_Craft_Info C on C.CRID=S.CRID');
|
||||
SQL.Add('where S.CRID=' + QuotedStr(Trim(ACRID)));
|
||||
ExecSQL;
|
||||
end;
|
||||
finally
|
||||
Qry.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -409,6 +409,14 @@ inherited frmTatClothInfo: TfrmTatClothInfo
|
|||
HeaderAlignmentHorz = taCenter
|
||||
Width = 96
|
||||
end
|
||||
object Tv1conno: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'conno'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'C_Width'
|
||||
|
|
@ -879,8 +887,6 @@ inherited frmTatClothInfo: TfrmTatClothInfo
|
|||
#20840#37096
|
||||
#27491#22312#20351#29992)
|
||||
OnChange = cxTabControl1Change
|
||||
ExplicitLeft = 6
|
||||
ExplicitTop = 4
|
||||
ClientRectBottom = 23
|
||||
ClientRectLeft = 2
|
||||
ClientRectRight = 1210
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ type
|
|||
Tv1C_LatitudeBatchNo: TcxGridDBColumn;
|
||||
Tv1C_LongitudeBatchShort: TcxGridDBColumn;
|
||||
Tv1C_LatitudeBatchShort: TcxGridDBColumn;
|
||||
Tv1conno: TcxGridDBColumn;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -34,6 +34,7 @@ type
|
|||
C_FinishLatitudeDensity: TEdit;
|
||||
C_Width: TBtnEditC;
|
||||
C_GramWeight: TBtnEditC;
|
||||
ConNo: TBtnEditC;
|
||||
Label12: TLabel;
|
||||
C_FinishLongitudeDensity: TEdit;
|
||||
ToolButton6: TToolButton;
|
||||
|
|
@ -263,6 +264,8 @@ type
|
|||
procedure CYMFExit(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure CYJGGYBtnDnClick(Sender: TObject);
|
||||
procedure ConNoBtnDnClick(Sender: TObject);
|
||||
procedure ConNoBtnUpClick(Sender: TObject);
|
||||
procedure C_WidthBtnDnClick(Sender: TObject);
|
||||
procedure C_WidthBtnUpClick(Sender: TObject);
|
||||
procedure ToolButton6Click(Sender: TObject);
|
||||
|
|
@ -302,7 +305,8 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload, U_YarnInfoSel;
|
||||
U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload, U_YarnInfoSel,
|
||||
U_CraftSync, U_SalesContractSel;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmTatClothInfoInput.Button1Click(Sender: TObject);
|
||||
|
|
@ -976,6 +980,91 @@ begin
|
|||
TBtnEditC(Sender).Text := '';
|
||||
end;
|
||||
|
||||
procedure TfrmTatClothInfoInput.ConNoBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
end;
|
||||
|
||||
procedure TfrmTatClothInfoInput.ConNoBtnUpClick(Sender: TObject);
|
||||
var
|
||||
MConNo, MCRID, MOldCRID: string;
|
||||
begin
|
||||
if Trim(FBCIID) = '' then
|
||||
begin
|
||||
Application.MessageBox('请先保存产品后再选择合同!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
MConNo := '';
|
||||
MCRID := '';
|
||||
try
|
||||
frmSalesContractSel := TfrmSalesContractSel.Create(Application);
|
||||
if frmSalesContractSel.ShowModal = 1 then
|
||||
begin
|
||||
if not frmSalesContractSel.CDS_1.IsEmpty then
|
||||
begin
|
||||
MConNo := Trim(frmSalesContractSel.CDS_1.fieldbyname('ConNo').AsString);
|
||||
MCRID := Trim(frmSalesContractSel.CDS_1.fieldbyname('CRID').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmSalesContractSel.Free;
|
||||
end;
|
||||
if MConNo = '' then
|
||||
Exit;
|
||||
|
||||
//选中合同行的工艺与产品当前绑定不同时,确认后覆盖
|
||||
if MCRID <> '' then
|
||||
begin
|
||||
MOldCRID := '';
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select CRID from BS_Cloth_Info where BCIID=' + QuotedStr(Trim(FBCIID)));
|
||||
Open;
|
||||
MOldCRID := Trim(FieldByName('CRID').AsString);
|
||||
Close;
|
||||
end;
|
||||
if (MOldCRID <> '') and (UpperCase(MOldCRID) <> UpperCase(MCRID)) then
|
||||
begin
|
||||
if Application.MessageBox('产品已绑定其他工艺,是否覆盖为所选合同行的工艺?', '提示', 32 + 4) <> IDYES then
|
||||
MCRID := '';
|
||||
end;
|
||||
end;
|
||||
|
||||
if MCRID = '' then
|
||||
begin
|
||||
//合同行未带工艺或放弃覆盖:仅带合同号,随保存写入
|
||||
ConNo.Text := MConNo;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update BS_Cloth_Info set CRID=' + QuotedStr(MCRID));
|
||||
SQL.Add(',ConNo=' + QuotedStr(MConNo));
|
||||
SQL.Add(',EDITER=' + QuotedStr(Trim(DName)) + ',EDITTIME=getdate()');
|
||||
SQL.Add(' where BCIID=' + QuotedStr(Trim(FBCIID)));
|
||||
ExecSQL;
|
||||
end;
|
||||
//绑定合同行工艺后,静默同步工艺数据到本产品
|
||||
SyncCraftToProduct(MCRID);
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
//重新加载:工艺字段按绑定态填充并置只读
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmTatClothInfoInput.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
MC_Code: string;
|
||||
|
|
|
|||
|
|
@ -92,14 +92,6 @@ inherited frmMachineManage: TfrmMachineManage
|
|||
ImageIndex = 4
|
||||
OnClick = tbBindProdClick
|
||||
end
|
||||
object tbBindCon1: TToolButton
|
||||
Left = 598
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #32465#23450#21512#21516'1'
|
||||
ImageIndex = 4
|
||||
OnClick = tbBindCon1Click
|
||||
end
|
||||
object tbBindProd2: TToolButton
|
||||
Left = 699
|
||||
Top = 0
|
||||
|
|
@ -108,14 +100,6 @@ inherited frmMachineManage: TfrmMachineManage
|
|||
ImageIndex = 4
|
||||
OnClick = tbBindProd2Click
|
||||
end
|
||||
object tbBindCon2: TToolButton
|
||||
Left = 800
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #32465#23450#21512#21516'2'
|
||||
ImageIndex = 4
|
||||
OnClick = tbBindCon2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 901
|
||||
Top = 0
|
||||
|
|
@ -383,13 +367,5 @@ inherited frmMachineManage: TfrmMachineManage
|
|||
Caption = #35299#32465#20135#21697'2'
|
||||
OnClick = N4Click
|
||||
end
|
||||
object N5: TMenuItem
|
||||
Caption = #35299#32465#21512#21516'1'
|
||||
OnClick = N5Click
|
||||
end
|
||||
object N6: TMenuItem
|
||||
Caption = #35299#32465#21512#21516'2'
|
||||
OnClick = N6Click
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ type
|
|||
N2: TMenuItem;
|
||||
N3: TMenuItem;
|
||||
N4: TMenuItem;
|
||||
N5: TMenuItem;
|
||||
N6: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
MCNO: TEdit;
|
||||
v2Column8: TcxGridDBColumn;
|
||||
|
|
@ -55,8 +53,6 @@ type
|
|||
tbPause: TToolButton;
|
||||
tbBindProd: TToolButton;
|
||||
tbBindProd2: TToolButton;
|
||||
tbBindCon1: TToolButton;
|
||||
tbBindCon2: TToolButton;
|
||||
Tv2C_Name: TcxGridDBColumn;
|
||||
v2Column10: TcxGridDBColumn;
|
||||
Tv2C_Name2: TcxGridDBColumn;
|
||||
|
|
@ -87,17 +83,11 @@ type
|
|||
procedure tbPauseClick(Sender: TObject);
|
||||
procedure tbBindProdClick(Sender: TObject);
|
||||
procedure tbBindProd2Click(Sender: TObject);
|
||||
procedure tbBindCon1Click(Sender: TObject);
|
||||
procedure tbBindCon2Click(Sender: TObject);
|
||||
procedure N5Click(Sender: TObject);
|
||||
procedure N6Click(Sender: TObject);
|
||||
procedure TbSaveFormatClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure BindProduct(AFieldName, ALogAction: string);
|
||||
procedure UnbindProduct(AFieldName, ALogAction: string);
|
||||
procedure BindContract(AFieldName, AConFieldName, ALogAction: string);
|
||||
procedure UnbindContract(AFieldName, AConFieldName, ALogAction: string);
|
||||
procedure InitGrid();
|
||||
procedure EditValueT();
|
||||
procedure EditValueF();
|
||||
|
|
@ -113,8 +103,7 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun, U_ZDYHelp, U_LabelPrint, U_TatClothInfoSel,
|
||||
U_SalesContractSel;
|
||||
U_DataLink, U_RTFun, U_ZDYHelp, U_LabelPrint, U_TatClothInfoSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
|
@ -395,20 +384,16 @@ begin
|
|||
BindProduct('C_CodeName2', '绑定产品2');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.tbBindCon1Click(Sender: TObject);
|
||||
begin
|
||||
BindContract('C_CodeName', 'm_ConNo', '绑定合同1');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.tbBindCon2Click(Sender: TObject);
|
||||
begin
|
||||
BindContract('C_CodeName2', 'm_ConNo2', '绑定合同2');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.BindProduct(AFieldName, ALogAction: string);
|
||||
var
|
||||
MMCIDS, MCodeName: string;
|
||||
MMCIDS, MCodeName, MConNo, MConField: string;
|
||||
begin
|
||||
//绑定产品时同步带出产品绑定的合同号(产品1写m_ConNo,产品2写m_ConNo2)
|
||||
if AFieldName = 'C_CodeName2' then
|
||||
MConField := 'm_ConNo2'
|
||||
else
|
||||
MConField := 'm_ConNo';
|
||||
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
if not CDS_HZ.Locate('SSel', True, []) then
|
||||
|
|
@ -453,6 +438,20 @@ begin
|
|||
if MCodeName = '' then
|
||||
Exit;
|
||||
|
||||
//带出产品绑定的合同号(产品未绑合同时清空机台对应合同号)
|
||||
MConNo := '';
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select top 1 ConNo from BS_Cloth_Info where C_Code=' + QuotedStr(MCodeName));
|
||||
SQL.Add(' order by BCIID');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
MConNo := Trim(FieldByName('ConNo').AsString);
|
||||
Close;
|
||||
end;
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
|
|
@ -460,6 +459,7 @@ begin
|
|||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(MCodeName));
|
||||
SQL.Add(' , ' + MConField + '=' + QuotedStr(MConNo));
|
||||
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||
SQL.Add(' , Edittime=getdate()');
|
||||
SQL.Add(' where MCID in (' + MMCIDS + ')');
|
||||
|
|
@ -474,7 +474,7 @@ begin
|
|||
SQL.Add(',getdate() ');
|
||||
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
|
||||
SQL.Add(',' + QuotedStr(Trim(ALogAction)));
|
||||
SQL.Add(',' + QuotedStr(Trim(MMCIDS + ' -> ' + MCodeName)));
|
||||
SQL.Add(',' + QuotedStr(Trim(MMCIDS + ' -> ' + MCodeName + '/' + MConNo)));
|
||||
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||
SQL.Add(')');
|
||||
ExecSQL;
|
||||
|
|
@ -490,6 +490,7 @@ begin
|
|||
begin
|
||||
CDS_HZ.Edit;
|
||||
CDS_HZ.fieldbyname(AFieldName).AsString := MCodeName;
|
||||
CDS_HZ.fieldbyname(MConField).AsString := MConNo;
|
||||
CDS_HZ.Post;
|
||||
end;
|
||||
CDS_HZ.Next;
|
||||
|
|
@ -507,8 +508,14 @@ end;
|
|||
|
||||
procedure TfrmMachineManage.UnbindProduct(AFieldName, ALogAction: string);
|
||||
var
|
||||
MMCID, MCodeName: string;
|
||||
MMCID, MCodeName, MConField: string;
|
||||
begin
|
||||
//解绑产品时同步清空对应合同号(产品1清m_ConNo,产品2清m_ConNo2)
|
||||
if AFieldName = 'C_CodeName2' then
|
||||
MConField := 'm_ConNo2'
|
||||
else
|
||||
MConField := 'm_ConNo';
|
||||
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
|
||||
|
|
@ -525,7 +532,7 @@ begin
|
|||
end;
|
||||
|
||||
if Application.MessageBox(PChar('确定要解绑机台 ' + Trim(CDS_HZ.fieldbyname('MCNO').AsString)
|
||||
+ ' 绑定的产品 ' + MCodeName + ' 吗?'), '提示', 32 + 4) <> IDYES then
|
||||
+ ' 绑定的产品 ' + MCodeName + ' 吗?(同时清空对应合同号)'), '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
|
||||
try
|
||||
|
|
@ -535,6 +542,7 @@ begin
|
|||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(''));
|
||||
SQL.Add(' , ' + MConField + '=' + QuotedStr(''));
|
||||
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||
SQL.Add(' , Edittime=getdate()');
|
||||
SQL.Add(' where MCID=' + QuotedStr(MMCID));
|
||||
|
|
@ -558,178 +566,7 @@ begin
|
|||
|
||||
CDS_HZ.Edit;
|
||||
CDS_HZ.fieldbyname(AFieldName).AsString := '';
|
||||
CDS_HZ.Post;
|
||||
InitGrid();
|
||||
Application.MessageBox('解绑成功!', '提示信息');
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.BindContract(AFieldName, AConFieldName, ALogAction: string);
|
||||
var
|
||||
MMCIDS, MCodeName, MConNo: string;
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
if not CDS_HZ.Locate('SSel', True, []) then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
MMCIDS := '';
|
||||
CDS_HZ.DisableControls;
|
||||
try
|
||||
CDS_HZ.First;
|
||||
while not CDS_HZ.Eof do
|
||||
begin
|
||||
if CDS_HZ.fieldbyname('SSel').AsBoolean then
|
||||
begin
|
||||
if MMCIDS <> '' then
|
||||
MMCIDS := MMCIDS + ',' + QuotedStr(Trim(CDS_HZ.fieldbyname('MCID').AsString))
|
||||
else
|
||||
MMCIDS := QuotedStr(Trim(CDS_HZ.fieldbyname('MCID').AsString));
|
||||
end;
|
||||
CDS_HZ.Next;
|
||||
end;
|
||||
finally
|
||||
CDS_HZ.EnableControls;
|
||||
end;
|
||||
|
||||
if MMCIDS = '' then
|
||||
Exit;
|
||||
|
||||
//选择合同行,同时带出合同号和对应产品编号
|
||||
MCodeName := '';
|
||||
MConNo := '';
|
||||
try
|
||||
frmSalesContractSel := TfrmSalesContractSel.Create(Application);
|
||||
if frmSalesContractSel.ShowModal = 1 then
|
||||
begin
|
||||
if not frmSalesContractSel.CDS_1.IsEmpty then
|
||||
begin
|
||||
MConNo := Trim(frmSalesContractSel.CDS_1.fieldbyname('ConNo').AsString);
|
||||
MCodeName := Trim(frmSalesContractSel.CDS_1.fieldbyname('C_Code').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmSalesContractSel.Free;
|
||||
end;
|
||||
if (MConNo = '') or (MCodeName = '') then
|
||||
Exit;
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(MCodeName));
|
||||
SQL.Add(' , ' + AConFieldName + '=' + QuotedStr(MConNo));
|
||||
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||
SQL.Add(' , Edittime=getdate()');
|
||||
SQL.Add(' where MCID in (' + MMCIDS + ')');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
||||
SQL.Add(' ' + QuotedStr(Trim(DName)));
|
||||
SQL.Add(',getdate() ');
|
||||
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
|
||||
SQL.Add(',' + QuotedStr(Trim(ALogAction)));
|
||||
SQL.Add(',' + QuotedStr(Trim(MMCIDS + ' -> ' + MConNo + '/' + MCodeName)));
|
||||
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||
SQL.Add(')');
|
||||
ExecSQL;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
|
||||
CDS_HZ.DisableControls;
|
||||
try
|
||||
CDS_HZ.First;
|
||||
while not CDS_HZ.Eof do
|
||||
begin
|
||||
if CDS_HZ.fieldbyname('SSel').AsBoolean then
|
||||
begin
|
||||
CDS_HZ.Edit;
|
||||
CDS_HZ.fieldbyname(AFieldName).AsString := MCodeName;
|
||||
CDS_HZ.fieldbyname(AConFieldName).AsString := MConNo;
|
||||
CDS_HZ.Post;
|
||||
end;
|
||||
CDS_HZ.Next;
|
||||
end;
|
||||
finally
|
||||
CDS_HZ.EnableControls;
|
||||
end;
|
||||
InitGrid();
|
||||
Application.MessageBox('绑定成功!', '提示信息');
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.UnbindContract(AFieldName, AConFieldName, ALogAction: string);
|
||||
var
|
||||
MMCID, MConNo: string;
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
|
||||
//解绑针对焦点行(光标所在机台),不用勾选
|
||||
MMCID := Trim(CDS_HZ.fieldbyname('MCID').AsString);
|
||||
if MMCID = '' then
|
||||
Exit;
|
||||
|
||||
MConNo := Trim(CDS_HZ.fieldbyname(AConFieldName).AsString);
|
||||
if MConNo = '' then
|
||||
begin
|
||||
Application.MessageBox('当前焦点行没有绑定该合同,无需解绑!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if Application.MessageBox(PChar('确定要解绑机台 ' + Trim(CDS_HZ.fieldbyname('MCNO').AsString)
|
||||
+ ' 绑定的合同 ' + MConNo + ' 吗?(同时解绑对应产品)'), '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('update BS_Machine set ' + AFieldName + '=' + QuotedStr(''));
|
||||
//解绑合同同时清空对应产品
|
||||
SQL.Add(' , ' + AConFieldName + '=' + QuotedStr(''));
|
||||
SQL.Add(' , Editer=''' + Trim(DName) + '''');
|
||||
SQL.Add(' , Edittime=getdate()');
|
||||
SQL.Add(' where MCID=' + QuotedStr(MMCID));
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
||||
SQL.Add(' ' + QuotedStr(Trim(DName)));
|
||||
SQL.Add(',getdate() ');
|
||||
SQL.Add(',' + QuotedStr(Trim(self.Caption)));
|
||||
SQL.Add(',' + QuotedStr(Trim(ALogAction)));
|
||||
SQL.Add(',' + QuotedStr(Trim(MMCID + ' -> ' + MConNo)));
|
||||
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||
SQL.Add(')');
|
||||
ExecSQL;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
|
||||
CDS_HZ.Edit;
|
||||
CDS_HZ.fieldbyname(AFieldName).AsString := '';
|
||||
CDS_HZ.fieldbyname(AConFieldName).AsString := '';
|
||||
CDS_HZ.fieldbyname(MConField).AsString := '';
|
||||
CDS_HZ.Post;
|
||||
InitGrid();
|
||||
Application.MessageBox('解绑成功!', '提示信息');
|
||||
|
|
@ -763,16 +600,6 @@ begin
|
|||
UnbindProduct('C_CodeName2', '解绑产品2');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.N5Click(Sender: TObject);
|
||||
begin
|
||||
UnbindContract('C_CodeName', 'm_ConNo', '解绑合同1');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.N6Click(Sender: TObject);
|
||||
begin
|
||||
UnbindContract('C_CodeName2', 'm_ConNo2', '解绑合同2');
|
||||
end;
|
||||
|
||||
procedure TfrmMachineManage.CustomerChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ uses
|
|||
U_LabelMapSet in '..\A00通用窗体\U_LabelMapSet.pas' {frmLabelMapSet},
|
||||
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
|
||||
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
|
||||
U_CraftSel in '..\A00通用窗体\U_CraftSel.pas' {frmCraftSel},
|
||||
U_KnitClothInfoSel in '..\A00通用窗体\U_KnitClothInfoSel.pas' {frmKnitClothInfoSel},
|
||||
U_BaseDataLink in '..\..\..\public10\design\U_BaseDataLink.pas' {BaseDataLink: TDataModule},
|
||||
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas';
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_tatClothInfoSel,
|
||||
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_CraftSel,
|
||||
U_PictureUpload, U_KnitClothInfoSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
|
@ -685,6 +685,10 @@ begin
|
|||
else
|
||||
Edit;
|
||||
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'BS_Contract_Sub', 0);
|
||||
if Trim(Order_Sub.fieldbyname('CRID').AsString) <> '' then
|
||||
FieldByName('CRID').Value := Trim(Order_Sub.fieldbyname('CRID').AsString)
|
||||
else
|
||||
FieldByName('CRID').Value := null;
|
||||
FieldByName('ConMId').Value := Trim(FConMId);
|
||||
FieldByName('ConSId').Value := Trim(maxno);
|
||||
|
||||
|
|
@ -994,27 +998,29 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmSalesConInPut.v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
var
|
||||
MCYNo: string;
|
||||
begin
|
||||
frmtatClothInfoSel := TfrmtatClothInfoSel.Create(self);
|
||||
with frmtatClothInfoSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
//Ñ¡¹¤ÒÕ:¹¤ÒÕ±àºÅ/Ãû³Æ/ÑÕÉ«/ÃÅ·ù/¿ËÖØ´øÈë²úÆ·±àºÅ/Ãû³ÆµÈÁÐ,²¢¼Ç¼CRID¹©¹¤ÒÕͬ²½
|
||||
try
|
||||
frmCraftSel := TfrmCraftSel.Create(self);
|
||||
with frmCraftSel do
|
||||
begin
|
||||
Order_Sub.Edit;
|
||||
Order_Sub.fieldbyname('C_Code').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Code').asstring;
|
||||
|
||||
Order_Sub.fieldbyname('C_Name').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Name').asstring;
|
||||
Order_Sub.fieldbyname('C_EName').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_EName').asstring;
|
||||
Order_Sub.fieldbyname('C_Spec').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Spec').asstring;
|
||||
Order_Sub.fieldbyname('C_Composition').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Composition').asstring;
|
||||
Order_Sub.fieldbyname('C_Color').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Color').asstring;
|
||||
Order_Sub.fieldbyname('C_Width').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_Width').asstring;
|
||||
Order_Sub.fieldbyname('C_GramWeight').Value := frmtatClothInfoSel.CDS_1.fieldbyname('C_GramWeight').asstring;
|
||||
Order_Sub.Post;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
if not CDS_1.IsEmpty then
|
||||
begin
|
||||
Order_Sub.Edit;
|
||||
Order_Sub.fieldbyname('C_Code').Value := Trim(CDS_1.fieldbyname('CR_Code').AsString);
|
||||
Order_Sub.fieldbyname('C_Name').Value := Trim(CDS_1.fieldbyname('CR_Name').AsString);
|
||||
Order_Sub.fieldbyname('C_Color').Value := Trim(CDS_1.fieldbyname('C_Color').AsString);
|
||||
Order_Sub.fieldbyname('C_Width').Value := Trim(CDS_1.fieldbyname('C_Width').AsString);
|
||||
Order_Sub.fieldbyname('C_GramWeight').Value := Trim(CDS_1.fieldbyname('C_GramWeight').AsString);
|
||||
Order_Sub.fieldbyname('CRID').Value := Trim(CDS_1.fieldbyname('CRID').AsString);
|
||||
Order_Sub.Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
finally
|
||||
frmCraftSel.Free;
|
||||
end;
|
||||
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
|
|
|
|||
|
|
@ -229,6 +229,10 @@ inherited frmTatClothCKHZList: TfrmTatClothCKHZList
|
|||
Kind = skSum
|
||||
Column = v1Column23
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column27
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
|
|
@ -267,6 +271,30 @@ inherited frmTatClothCKHZList: TfrmTatClothCKHZList
|
|||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object Tv1carno: TcxGridDBColumn
|
||||
Caption = #26426#21488#21495
|
||||
DataBinding.FieldName = 'carno'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object v1Column25: TcxGridDBColumn
|
||||
Caption = #23458#25143
|
||||
DataBinding.FieldName = 'ContractBuyName'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 100
|
||||
end
|
||||
object v1Column26: TcxGridDBColumn
|
||||
Caption = #20986#24211#21333#21495
|
||||
DataBinding.FieldName = 'IONo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 100
|
||||
end
|
||||
object v1Column23: TcxGridDBColumn
|
||||
Caption = #21367#25968
|
||||
DataBinding.FieldName = 'js'
|
||||
|
|
@ -283,6 +311,14 @@ inherited frmTatClothCKHZList: TfrmTatClothCKHZList
|
|||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object v1Column27: TcxGridDBColumn
|
||||
Caption = #37325#37327
|
||||
DataBinding.FieldName = 'StkWeight'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
|
|
@ -305,8 +341,8 @@ inherited frmTatClothCKHZList: TfrmTatClothCKHZList
|
|||
Properties.Style = 9
|
||||
Properties.TabIndex = 0
|
||||
Properties.Tabs.Strings = (
|
||||
#26377#26465#30721#20986#24211#27719#24635
|
||||
#26080#26465#30721#20986#24211#27719#24635)
|
||||
#20135#21697#27719#24635
|
||||
#23458#25143#27719#24635)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 32
|
||||
ClientRectRight = 1540
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ type
|
|||
v1Column23: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
Tv1Column3: TcxGridDBColumn;
|
||||
Tv1carno: TcxGridDBColumn;
|
||||
v1Column25: TcxGridDBColumn;
|
||||
v1Column26: TcxGridDBColumn;
|
||||
v1Column27: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
Label5: TLabel;
|
||||
C_Name: TEdit;
|
||||
|
|
@ -133,20 +137,25 @@ begin
|
|||
Close;
|
||||
sql.Clear;
|
||||
|
||||
sql.Add('select C_NAME,COUNT(*)JS,SUM(Meter)stkMeter,SUM(Yardage)StkYardage FROM V_Tat_Cloth_IO A where A.IOFlag = ''³ö¿â'' ' + WSql);
|
||||
if cxTabControl1.TabIndex = 0 then
|
||||
begin
|
||||
SQL.Add('AND CHARINDEX(''T'',STKID )>0');
|
||||
sql.Add('select C_NAME,carno,COUNT(*)JS,SUM(Meter)stkMeter,SUM(Yardage)StkYardage,SUM(NetWeight)StkWeight');
|
||||
sql.Add(' FROM V_Tat_Cloth_IO A where A.IOFlag = ''łöżâ'' ' + WSql);
|
||||
sql.Add(' group by C_NAME,carno');
|
||||
end
|
||||
else
|
||||
begin
|
||||
SQL.Add('AND CHARINDEX(''S'',STKID )>0');
|
||||
sql.Add('select ContractBuyName,IONo,C_NAME,COUNT(*)JS,SUM(Meter)stkMeter,SUM(Yardage)StkYardage,SUM(NetWeight)StkWeight');
|
||||
sql.Add(' FROM V_Tat_Cloth_IO A where A.IOFlag = ''łöżâ'' ' + WSql);
|
||||
sql.Add(' group by ContractBuyName,IONo,C_NAME');
|
||||
end;
|
||||
sql.Add('group by C_NAME');
|
||||
|
||||
// showmessage(sql.text);
|
||||
Open;
|
||||
end;
|
||||
Tv1carno.Visible := cxTabControl1.TabIndex = 0;
|
||||
v1Column25.Visible := cxTabControl1.TabIndex = 1;
|
||||
v1Column26.Visible := cxTabControl1.TabIndex = 1;
|
||||
SCreateCDS(ADOQueryMain, CDS_1);
|
||||
SInitCDSData(ADOQueryMain, CDS_1);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user