产品
This commit is contained in:
parent
bd6327d636
commit
66e9c63b6e
|
|
@ -25,13 +25,17 @@ uses
|
||||||
U_ClothType in 'U_ClothType.pas' {frmClothType},
|
U_ClothType in 'U_ClothType.pas' {frmClothType},
|
||||||
U_CloInfoFileUp in 'U_CloInfoFileUp.pas' {frmCloInfoFileUp},
|
U_CloInfoFileUp in 'U_CloInfoFileUp.pas' {frmCloInfoFileUp},
|
||||||
U_TatClothInfo in 'U_TatClothInfo.pas' {frmTatClothInfo},
|
U_TatClothInfo in 'U_TatClothInfo.pas' {frmTatClothInfo},
|
||||||
|
U_CraftInfoInput in 'U_CraftInfoInput.pas' {frmCraftInfoInput},
|
||||||
|
U_CraftInfoSel in 'U_CraftInfoSel.pas' {frmCraftInfoSel},
|
||||||
|
U_CraftSync in 'U_CraftSync.pas',
|
||||||
U_LabelMapSet in '..\A00通用窗体\U_LabelMapSet.pas' {frmLabelMapSet},
|
U_LabelMapSet in '..\A00通用窗体\U_LabelMapSet.pas' {frmLabelMapSet},
|
||||||
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
|
U_LabelPrint in '..\A00通用窗体\U_LabelPrint.pas' {frmLabelPrint},
|
||||||
U_KnitClothInfoSel in '..\A00通用窗体\U_KnitClothInfoSel.pas' {frmKnitClothInfoSel},
|
U_KnitClothInfoSel in '..\A00通用窗体\U_KnitClothInfoSel.pas' {frmKnitClothInfoSel},
|
||||||
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
|
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
|
||||||
U_ClothInfoSel in '..\A00通用窗体\U_ClothInfoSel.pas' {frmClothInfoSel},
|
U_ClothInfoSel in '..\A00通用窗体\U_ClothInfoSel.pas' {frmClothInfoSel},
|
||||||
U_YarnInfoSel in '..\A00通用窗体\U_YarnInfoSel.pas' {frmYarnInfoSel},
|
U_YarnInfoSel in '..\A00通用窗体\U_YarnInfoSel.pas' {frmYarnInfoSel},
|
||||||
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas';
|
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
|
||||||
|
U_CraftInfo in 'U_CraftInfo.pas';
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,13 @@
|
||||||
<Form>frmTatClothInfo</Form>
|
<Form>frmTatClothInfo</Form>
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
|
<DCCReference Include="U_CraftInfoInput.pas">
|
||||||
|
<Form>frmCraftInfoInput</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="U_CraftInfoSel.pas">
|
||||||
|
<Form>frmCraftInfoSel</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="U_CraftSync.pas"/>
|
||||||
<DCCReference Include="..\A00通用窗体\U_LabelMapSet.pas">
|
<DCCReference Include="..\A00通用窗体\U_LabelMapSet.pas">
|
||||||
<Form>frmLabelMapSet</Form>
|
<Form>frmLabelMapSet</Form>
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
|
|
@ -162,6 +169,7 @@
|
||||||
<FormType>dfm</FormType>
|
<FormType>dfm</FormType>
|
||||||
</DCCReference>
|
</DCCReference>
|
||||||
<DCCReference Include="..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas"/>
|
<DCCReference Include="..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas"/>
|
||||||
|
<DCCReference Include="U_CraftInfo.pas"/>
|
||||||
<BuildConfiguration Include="Debug">
|
<BuildConfiguration Include="Debug">
|
||||||
<Key>Cfg_2</Key>
|
<Key>Cfg_2</Key>
|
||||||
<CfgParent>Base</CfgParent>
|
<CfgParent>Base</CfgParent>
|
||||||
|
|
|
||||||
361
A02基础产品管理/U_CraftInfo.dfm
Normal file
361
A02基础产品管理/U_CraftInfo.dfm
Normal file
|
|
@ -0,0 +1,361 @@
|
||||||
|
inherited frmCraftInfo: TfrmCraftInfo
|
||||||
|
Left = 117
|
||||||
|
Top = 154
|
||||||
|
Caption = #20135#21697#24037#33402#31649#29702
|
||||||
|
ClientHeight = 620
|
||||||
|
ClientWidth = 1200
|
||||||
|
FormStyle = fsMDIChild
|
||||||
|
Visible = True
|
||||||
|
ExplicitWidth = 1216
|
||||||
|
ExplicitHeight = 659
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar [0]
|
||||||
|
Tag = 1
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1200
|
||||||
|
Height = 38
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 38
|
||||||
|
ButtonWidth = 91
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_ClothInfo.ImageList_new32
|
||||||
|
Images = DataLink_ClothInfo.ImageList_new32
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 1
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 71
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 142
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 213
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 5
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 284
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 20
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 355
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384#26684#24335
|
||||||
|
ImageIndex = 16
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 450
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 7
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel [1]
|
||||||
|
Left = 0
|
||||||
|
Top = 38
|
||||||
|
Width = 1200
|
||||||
|
Height = 45
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = 16242829
|
||||||
|
ParentBackground = False
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 22
|
||||||
|
Top = 15
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #24037#33402#32534#21495#65306
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 262
|
||||||
|
Top = 15
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #24037#33402#21517#31216#65306
|
||||||
|
end
|
||||||
|
object CR_Code: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 88
|
||||||
|
Top = 11
|
||||||
|
Width = 150
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = CRCodeKeyPress
|
||||||
|
end
|
||||||
|
object CR_Name: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 328
|
||||||
|
Top = 11
|
||||||
|
Width = 220
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnKeyPress = CRCodeKeyPress
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid [2]
|
||||||
|
Left = 0
|
||||||
|
Top = 83
|
||||||
|
Width = 1200
|
||||||
|
Height = 537
|
||||||
|
Align = alClient
|
||||||
|
PopupMenu = PM_1
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
ScrollbarAnnotations.CustomAnnotations = <>
|
||||||
|
DataController.DataSource = DS_1
|
||||||
|
DataController.Filter.AutoDataSetFilter = True
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.IncSearch = DataLink_ClothInfo.SHuangSe
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Styles.Inactive = DataLink_ClothInfo.SHuangSe
|
||||||
|
Styles.Selection = DataLink_ClothInfo.SHuangSe
|
||||||
|
object Tv1SSel: TcxGridDBColumn
|
||||||
|
Caption = #36873#25321
|
||||||
|
DataBinding.FieldName = 'SSel'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 41
|
||||||
|
end
|
||||||
|
object Tv1CR_Code: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#32534#21495
|
||||||
|
DataBinding.FieldName = 'CR_Code'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 92
|
||||||
|
end
|
||||||
|
object Tv1CR_Name: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#21517#31216
|
||||||
|
DataBinding.FieldName = 'CR_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 150
|
||||||
|
end
|
||||||
|
object Tv1C_Width: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'C_Width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_GramWeight: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'C_GramWeight'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1C_Color: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'C_Color'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_YarnQty: TcxGridDBColumn
|
||||||
|
Caption = #22836#32441
|
||||||
|
DataBinding.FieldName = 'C_YarnQty'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1head_count: TcxGridDBColumn
|
||||||
|
Caption = #22836#20221
|
||||||
|
DataBinding.FieldName = 'head_count'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1strip_width: TcxGridDBColumn
|
||||||
|
Caption = #26465#23485
|
||||||
|
DataBinding.FieldName = 'strip_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_MachLatitudeDensity: TcxGridDBColumn
|
||||||
|
Caption = #19978#26426#32428#23494
|
||||||
|
DataBinding.FieldName = 'C_MachLatitudeDensity'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1row_count_top: TcxGridDBColumn
|
||||||
|
Caption = #19978#25490#25968
|
||||||
|
DataBinding.FieldName = 'row_count_top'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1displace: TcxGridDBColumn
|
||||||
|
Caption = #20301#31227
|
||||||
|
DataBinding.FieldName = 'displace'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1reed_width: TcxGridDBColumn
|
||||||
|
Caption = #23450#24133#31576
|
||||||
|
DataBinding.FieldName = 'reed_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1C_ReedNo: TcxGridDBColumn
|
||||||
|
Caption = #31576#21495
|
||||||
|
DataBinding.FieldName = 'C_ReedNo'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1FILLER: TcxGridDBColumn
|
||||||
|
Caption = #24405#20837#20154
|
||||||
|
DataBinding.FieldName = 'FILLER'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1FILLTIME: TcxGridDBColumn
|
||||||
|
Caption = #24405#20837#26102#38388
|
||||||
|
DataBinding.FieldName = 'FILLTIME'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
inherited ADOQueryBaseCmd: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
end
|
||||||
|
inherited ADOQueryBaseTemp: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
Left = 201
|
||||||
|
Top = 105
|
||||||
|
end
|
||||||
|
object GPM_1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 880
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object PM_1: TPopupMenu
|
||||||
|
Left = 960
|
||||||
|
Top = 80
|
||||||
|
object N1: TMenuItem
|
||||||
|
Caption = #20840#36873
|
||||||
|
OnClick = N1Click
|
||||||
|
end
|
||||||
|
object N2: TMenuItem
|
||||||
|
Caption = #20840#24323
|
||||||
|
OnClick = N2Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DS_1: TDataSource
|
||||||
|
DataSet = CDS_1
|
||||||
|
Left = 640
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 720
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object CDS_1: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 560
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 800
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 720
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
end
|
||||||
323
A02基础产品管理/U_CraftInfo.pas
Normal file
323
A02基础产品管理/U_CraftInfo.pas
Normal file
|
|
@ -0,0 +1,323 @@
|
||||||
|
unit U_CraftInfo;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxFilter, cxData, cxDataStorage,
|
||||||
|
cxEdit, DB, cxDBData, ADODB, DBClient, ComCtrls, ToolWin, StdCtrls, ExtCtrls, Menus,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||||
|
cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu,
|
||||||
|
cxGridPopupMenu, cxNavigator, dxDateRanges, dxBarBuiltInMenu, cxCheckBox,
|
||||||
|
dxScrollbarAnnotations, U_BaseList, cxLookAndFeels, cxLookAndFeelPainters,
|
||||||
|
dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCraftInfo = class(TfrmBaseList)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
CR_Code: TEdit;
|
||||||
|
CR_Name: TEdit;
|
||||||
|
GPM_1: TcxGridPopupMenu;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
Tv1SSel: TcxGridDBColumn;
|
||||||
|
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;
|
||||||
|
Tv1FILLER: TcxGridDBColumn;
|
||||||
|
Tv1FILLTIME: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
DS_1: TDataSource;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
CDS_1: TClientDataSet;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
PM_1: TPopupMenu;
|
||||||
|
N1: TMenuItem;
|
||||||
|
N2: TMenuItem;
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure CRCodeKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure N1Click(Sender: TObject);
|
||||||
|
procedure N2Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCraftInfo: TfrmCraftInfo;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_RTFun, U_CraftInfoInput;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.InitGrid();
|
||||||
|
var
|
||||||
|
fwhere, Pwhere: string;
|
||||||
|
begin
|
||||||
|
Panel1.Refresh;
|
||||||
|
fwhere := '';
|
||||||
|
Pwhere := SGetFilters(Panel1, 1, 2);
|
||||||
|
|
||||||
|
if trim(Pwhere) <> '' then
|
||||||
|
fwhere := ' where ' + trim(Pwhere);
|
||||||
|
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
Filtered := False;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select A.* from BS_Craft_Info A' + fwhere + ' order by CR_Code');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||||
|
SCreateCDS(ADOQueryMain, CDS_1);
|
||||||
|
SInitCDSData(ADOQueryMain, CDS_1);
|
||||||
|
TV1.DataController.Filter.Clear;
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
TV1.DataController.Filter.Clear;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
Action := caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
frmCraftInfo := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
ReadCxGrid(self.Caption + 'TV1', Tv1, '工艺管理');
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmCraftInfoInput := TfrmCraftInfoInput.Create(Application);
|
||||||
|
with frmCraftInfoInput do
|
||||||
|
begin
|
||||||
|
FCRID := '';
|
||||||
|
if ShowModal = 1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCraftInfoInput.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
try
|
||||||
|
frmCraftInfoInput := TfrmCraftInfoInput.Create(Application);
|
||||||
|
with frmCraftInfoInput do
|
||||||
|
begin
|
||||||
|
FCRID := Trim(Self.CDS_1.fieldbyname('CRID').AsString);
|
||||||
|
if ShowModal = 1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCraftInfoInput.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBDelClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
MRefCodes: string;
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
if not CDS_1.Locate('SSel', True, []) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
//先整体检查:勾选中任一工艺被产品引用则全部阻止(避免删一半)
|
||||||
|
MRefCodes := '';
|
||||||
|
CDS_1.DisableControls;
|
||||||
|
try
|
||||||
|
CDS_1.First;
|
||||||
|
while not CDS_1.Eof do
|
||||||
|
begin
|
||||||
|
if CDS_1.fieldbyname('SSel').AsBoolean then
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select count(*) as AA from BS_Cloth_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
if ADOQueryTemp.FieldByName('AA').AsInteger > 0 then
|
||||||
|
begin
|
||||||
|
if MRefCodes <> '' then
|
||||||
|
MRefCodes := MRefCodes + ',';
|
||||||
|
MRefCodes := MRefCodes + Trim(CDS_1.fieldbyname('CR_Code').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_1.Next;
|
||||||
|
end;
|
||||||
|
CDS_1.Locate('SSel', True, []);
|
||||||
|
finally
|
||||||
|
CDS_1.EnableControls;
|
||||||
|
end;
|
||||||
|
if MRefCodes <> '' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('工艺 ' + MRefCodes + ' 已被产品使用,不能删除!请先解除产品的工艺绑定。'), '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
//与产品删除一致:循环删除勾选行(主表+配比子表+纹版图子表)
|
||||||
|
while CDS_1.Locate('SSel', true, []) do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_1.fieldbyname('CRID').AsString) <> '' then
|
||||||
|
begin
|
||||||
|
//先备份到工艺删除表(备份表与主表结构完全一致,select * 免列清单,主表加字段无需改代码)
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('insert into BS_Craft_Info_Del select * from BS_Craft_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('delete BS_Craft_Yarn where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('delete BS_Craft_Info_WB where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('delete BS_Craft_Info where CRID=' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
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('删除工艺')));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim(CDS_1.fieldbyname('CRID').AsString)));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||||
|
SQL.Add(')');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_1.Delete;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('删除成功!', '提示信息');
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('删除失败!', '提示信息', 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.N1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SelOKNoFiler(Tv1, True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.N2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SelOKNoFiler(Tv1, False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
TcxGridToExcel(self.Caption, cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid(self.Caption + 'TV1', Tv1, '工艺管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfo.CRCodeKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key = #13 then
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
2118
A02基础产品管理/U_CraftInfoInput.dfm
Normal file
2118
A02基础产品管理/U_CraftInfoInput.dfm
Normal file
File diff suppressed because it is too large
Load Diff
744
A02基础产品管理/U_CraftInfoInput.pas
Normal file
744
A02基础产品管理/U_CraftInfoInput.pas
Normal file
|
|
@ -0,0 +1,744 @@
|
||||||
|
unit U_CraftInfoInput;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||||
|
cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
||||||
|
cxGrid, ComCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit,
|
||||||
|
cxButtonEdit, StdCtrls, ExtCtrls, cxCurrencyEdit, BtnEdit, U_BaseList,
|
||||||
|
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||||||
|
cxNavigator, dxDateRanges, dxBarBuiltInMenu, cxPC, dxScrollbarAnnotations,
|
||||||
|
cxCheckBox, dxSkinWXI;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCraftInfoInput = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton9: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
Label7: TLabel;
|
||||||
|
Label8: TLabel;
|
||||||
|
Label9: TLabel;
|
||||||
|
Label10: TLabel;
|
||||||
|
Label11: TLabel;
|
||||||
|
Label12: TLabel;
|
||||||
|
Label13: TLabel;
|
||||||
|
CR_Code: TEdit;
|
||||||
|
CR_Name: TEdit;
|
||||||
|
C_Width: TBtnEditC;
|
||||||
|
C_GramWeight: TBtnEditC;
|
||||||
|
C_Color: TEdit;
|
||||||
|
C_YarnQty: TEdit;
|
||||||
|
head_count: TEdit;
|
||||||
|
strip_width: TEdit;
|
||||||
|
C_MachLatitudeDensity: TEdit;
|
||||||
|
row_count_top: TEdit;
|
||||||
|
displace: TEdit;
|
||||||
|
reed_width: TEdit;
|
||||||
|
C_ReedNo: TEdit;
|
||||||
|
cxPageControl3: TcxPageControl;
|
||||||
|
cxTabSheet1: TcxTabSheet;
|
||||||
|
Panel1: TPanel;
|
||||||
|
cxPageControl2: TcxPageControl;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
TV1: TcxGridDBTableView;
|
||||||
|
TV1SeqNo: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn3: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn4: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn5: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn8: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn7: TcxGridDBColumn;
|
||||||
|
TV1Column1: TcxGridDBColumn;
|
||||||
|
TV1Column2: TcxGridDBColumn;
|
||||||
|
cxGridLevel2: TcxGridLevel;
|
||||||
|
Panel3: TPanel;
|
||||||
|
Panel4: TPanel;
|
||||||
|
Label20: TLabel;
|
||||||
|
ToolBar2: TToolBar;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
ToolButton5: TToolButton;
|
||||||
|
Panel2: TPanel;
|
||||||
|
cxPageControl1: TcxPageControl;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
Tv2SeqNo: TcxGridDBColumn;
|
||||||
|
v2Column10: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn1: TcxGridDBColumn;
|
||||||
|
v2Column2: TcxGridDBColumn;
|
||||||
|
v2Column5: TcxGridDBColumn;
|
||||||
|
v2Column6: TcxGridDBColumn;
|
||||||
|
Tv2Column1: TcxGridDBColumn;
|
||||||
|
Tv2Column2: TcxGridDBColumn;
|
||||||
|
cxGridLevel1: TcxGridLevel;
|
||||||
|
Panel5: TPanel;
|
||||||
|
Panel6: TPanel;
|
||||||
|
Label21: TLabel;
|
||||||
|
ToolBar3: TToolBar;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
ToolButton7: TToolButton;
|
||||||
|
ToolButton8: TToolButton;
|
||||||
|
cxTabSheet2: TcxTabSheet;
|
||||||
|
Panel7: TPanel;
|
||||||
|
Label35: TLabel;
|
||||||
|
Label34: TLabel;
|
||||||
|
Label36: TLabel;
|
||||||
|
Label37: TLabel;
|
||||||
|
Label38: TLabel;
|
||||||
|
Label39: TLabel;
|
||||||
|
Label40: TLabel;
|
||||||
|
Label41: TLabel;
|
||||||
|
Label42: TLabel;
|
||||||
|
Label44: TLabel;
|
||||||
|
Label45: TLabel;
|
||||||
|
Label46: TLabel;
|
||||||
|
Label48: TLabel;
|
||||||
|
Label49: TLabel;
|
||||||
|
Label50: TLabel;
|
||||||
|
Label51: TLabel;
|
||||||
|
Label52: TLabel;
|
||||||
|
Label53: TLabel;
|
||||||
|
Label54: TLabel;
|
||||||
|
Label55: TLabel;
|
||||||
|
Label57: TLabel;
|
||||||
|
Label58: TLabel;
|
||||||
|
Label59: TLabel;
|
||||||
|
Label60: TLabel;
|
||||||
|
Label61: TLabel;
|
||||||
|
Label62: TLabel;
|
||||||
|
Label63: TLabel;
|
||||||
|
Label64: TLabel;
|
||||||
|
Label65: TLabel;
|
||||||
|
Label66: TLabel;
|
||||||
|
Label67: TLabel;
|
||||||
|
Label68: TLabel;
|
||||||
|
Label69: TLabel;
|
||||||
|
Label70: TLabel;
|
||||||
|
Label71: TLabel;
|
||||||
|
Label72: TLabel;
|
||||||
|
WB_2: TEdit;
|
||||||
|
WB_1: TEdit;
|
||||||
|
WB_4: TEdit;
|
||||||
|
WB_3: TEdit;
|
||||||
|
WB_6: TEdit;
|
||||||
|
WB_5: TEdit;
|
||||||
|
WB_8: TEdit;
|
||||||
|
WB_7: TEdit;
|
||||||
|
WB_10: TEdit;
|
||||||
|
WB_9: TEdit;
|
||||||
|
WB_12: TEdit;
|
||||||
|
WB_11: TEdit;
|
||||||
|
WB_14: TEdit;
|
||||||
|
WB_13: TEdit;
|
||||||
|
WB_16: TEdit;
|
||||||
|
WB_15: TEdit;
|
||||||
|
WB_18: TEdit;
|
||||||
|
WB_17: TEdit;
|
||||||
|
WB_20: TEdit;
|
||||||
|
WB_19: TEdit;
|
||||||
|
WB_22: TEdit;
|
||||||
|
WB_21: TEdit;
|
||||||
|
WB_24: TEdit;
|
||||||
|
WB_23: TEdit;
|
||||||
|
WB_26: TEdit;
|
||||||
|
WB_25: TEdit;
|
||||||
|
WB_28: TEdit;
|
||||||
|
WB_27: TEdit;
|
||||||
|
WB_30: TEdit;
|
||||||
|
WB_29: TEdit;
|
||||||
|
WB_32: TEdit;
|
||||||
|
WB_31: TEdit;
|
||||||
|
WB_34: TEdit;
|
||||||
|
WB_33: TEdit;
|
||||||
|
WB_36: TEdit;
|
||||||
|
WB_35: TEdit;
|
||||||
|
WB_38: TEdit;
|
||||||
|
WB_37: TEdit;
|
||||||
|
WB_40: TEdit;
|
||||||
|
WB_39: TEdit;
|
||||||
|
WB_42: TEdit;
|
||||||
|
WB_41: TEdit;
|
||||||
|
WB_44: TEdit;
|
||||||
|
WB_43: TEdit;
|
||||||
|
WB_46: TEdit;
|
||||||
|
WB_45: TEdit;
|
||||||
|
WB_48: TEdit;
|
||||||
|
WB_47: TEdit;
|
||||||
|
WB_50: TEdit;
|
||||||
|
WB_49: TEdit;
|
||||||
|
WB_52: TEdit;
|
||||||
|
WB_51: TEdit;
|
||||||
|
WB_54: TEdit;
|
||||||
|
WB_53: TEdit;
|
||||||
|
WB_56: TEdit;
|
||||||
|
WB_55: TEdit;
|
||||||
|
WB_58: TEdit;
|
||||||
|
WB_57: TEdit;
|
||||||
|
WB_60: TEdit;
|
||||||
|
WB_59: TEdit;
|
||||||
|
WB_62: TEdit;
|
||||||
|
WB_61: TEdit;
|
||||||
|
WB_64: TEdit;
|
||||||
|
WB_63: TEdit;
|
||||||
|
WB_66: TEdit;
|
||||||
|
WB_65: TEdit;
|
||||||
|
WB_68: TEdit;
|
||||||
|
WB_67: TEdit;
|
||||||
|
WB_70: TEdit;
|
||||||
|
WB_69: TEdit;
|
||||||
|
WB_72: TEdit;
|
||||||
|
WB_71: TEdit;
|
||||||
|
cxTabSheet5: TcxTabSheet;
|
||||||
|
warp_arrange: TMemo;
|
||||||
|
cxTabSheet6: TcxTabSheet;
|
||||||
|
weft_arrange: TMemo;
|
||||||
|
cxTabSheet7: TcxTabSheet;
|
||||||
|
Panel9: TPanel;
|
||||||
|
Label26: TLabel;
|
||||||
|
threading_method: TMemo;
|
||||||
|
CDS_1: TClientDataSet;
|
||||||
|
DS_1: TDataSource;
|
||||||
|
CDS_2: TClientDataSet;
|
||||||
|
DS_2: TDataSource;
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure CYColorKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure C_WidthBtnDnClick(Sender: TObject);
|
||||||
|
procedure C_WidthBtnUpClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure ToolButton7Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure ToolButton5Click(Sender: TObject);
|
||||||
|
procedure ToolButton8Click(Sender: TObject);
|
||||||
|
procedure ToolButton9Click(Sender: TObject);
|
||||||
|
procedure TV1YRatioPropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure Tv2YRatioPropertiesEditValueChanged(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure AddPresetYarnRows(ACDS: TClientDataSet);
|
||||||
|
function SaveData(): Boolean;
|
||||||
|
procedure CALCYarnQty();
|
||||||
|
procedure CalcGramWeight();
|
||||||
|
procedure SyncYRatioFromEditor(ACDS: TClientDataSet; Sender: TObject);
|
||||||
|
public
|
||||||
|
FCRID: string;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCraftInfoInput: TfrmCraftInfoInput;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_RTFun, U_ZDYHelp, U_CraftSync;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.CALCYarnQty();
|
||||||
|
var
|
||||||
|
MYarnQty, MOrdQty, MWidth, MMachLatitudeDensity: Double;
|
||||||
|
begin
|
||||||
|
MYarnQty := STRTOFLOATDEF(C_YarnQty.Text, 0);
|
||||||
|
MOrdQty := 10000;
|
||||||
|
MWidth := STRTOFLOATDEF(StringReplace(C_Width.Text, 'CM', '', [rfReplaceAll, rfIgnoreCase]), 0);
|
||||||
|
MMachLatitudeDensity := STRTOFLOATDEF(C_MachLatitudeDensity.Text, 0);
|
||||||
|
with CDS_1 do
|
||||||
|
begin
|
||||||
|
DisableControls;
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Y_Qty').Value := MYarnQty * MOrdQty * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with CDS_2 do
|
||||||
|
begin
|
||||||
|
DisableControls;
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Y_Qty').Value := MMachLatitudeDensity * MOrdQty * MWidth * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.SyncYRatioFromEditor(ACDS: TClientDataSet; Sender: TObject);
|
||||||
|
var
|
||||||
|
MValue: Double;
|
||||||
|
begin
|
||||||
|
MValue := StrToFloatDef(Trim(TcxTextEdit(Sender).EditingText), -1);
|
||||||
|
if MValue < 0 then
|
||||||
|
Exit;
|
||||||
|
if ACDS.FieldByName('Y_Ratio').AsFloat <> MValue then
|
||||||
|
begin
|
||||||
|
ACDS.Edit;
|
||||||
|
ACDS.FieldByName('Y_Ratio').AsFloat := MValue;
|
||||||
|
ACDS.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.CalcGramWeight();
|
||||||
|
|
||||||
|
function SumViewRatio(AView: TcxGridDBTableView; ARatioColumn: TcxGridDBColumn): Double;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
v: Variant;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
for i := 0 to AView.DataController.RecordCount - 1 do
|
||||||
|
begin
|
||||||
|
v := AView.DataController.Values[i, ARatioColumn.Index];
|
||||||
|
if not VarIsNull(v) then
|
||||||
|
Result := Result + v;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
C_GramWeight.Text := FormatFloat('0.######',
|
||||||
|
(SumViewRatio(TV1, cxGridDBColumn7) + SumViewRatio(Tv2, v2Column5)) / 1000);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.TV1YRatioPropertiesEditValueChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SyncYRatioFromEditor(CDS_1, Sender);
|
||||||
|
CalcGramWeight();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.Tv2YRatioPropertiesEditValueChanged(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SyncYRatioFromEditor(CDS_2, Sender);
|
||||||
|
CalcGramWeight();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.InitGrid();
|
||||||
|
begin
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from BS_Craft_Info where CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//memo fields on tab sheets are not reached by SCSHData, load manually
|
||||||
|
warp_arrange.Text := Trim(ADOQueryTemp.fieldbyname('warp_arrange').AsString);
|
||||||
|
weft_arrange.Text := Trim(ADOQueryTemp.fieldbyname('weft_arrange').AsString);
|
||||||
|
threading_method.Text := Trim(ADOQueryTemp.fieldbyname('threading_method').AsString);
|
||||||
|
SCSHData(ADOQueryTemp, ScrollBox1, 2);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from BS_Craft_Info_WB where CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
|
||||||
|
SCSHData(ADOQueryTemp, PANEL7, 2);
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select A.* from BS_Craft_Yarn A ');
|
||||||
|
sql.Add(' where YRType=' + quotedstr('经丝') + ' and A.CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS(ADOQueryTemp, CDS_1);
|
||||||
|
SInitCDSData(ADOQueryTemp, CDS_1);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select A.* from BS_Craft_Yarn A ');
|
||||||
|
sql.Add(' where YRType=' + quotedstr('纬丝') + ' and A.CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS(ADOQueryTemp, CDS_2);
|
||||||
|
SInitCDSData(ADOQueryTemp, CDS_2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.AddPresetYarnRows(ACDS: TClientDataSet);
|
||||||
|
const
|
||||||
|
CSeq: array[0..5] of string = ('甲', '乙', '丙', '丁', '戊', '己');
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
for i := 0 to 5 do
|
||||||
|
begin
|
||||||
|
ACDS.Append;
|
||||||
|
ACDS.FieldByName('seq_no').Value := CSeq[i];
|
||||||
|
ACDS.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid(self.Caption + 'TV1', Tv1, '经纱配比');
|
||||||
|
ReadCxGrid(self.Caption + 'TV2', Tv2, '纬纱配比');
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmCraftInfoInput.SaveData(): Boolean;
|
||||||
|
var
|
||||||
|
maxId, maxpbno: string;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
if Trim(FCRID) = '' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd, maxId, 'GY', 'BS_Craft_Info', 4, 1) = False then
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取工艺编号失败!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
maxId := Trim(FCRID);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from BS_Craft_Info where CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if IsEmpty then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('FILLID').Value := Trim(DCode);
|
||||||
|
FieldByName('FILLER').Value := Trim(DName);
|
||||||
|
FieldByName('FILLTIME').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('EDITER').Value := Trim(DName);
|
||||||
|
FieldByName('EDITTIME').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
if trim(CR_Code.Text) = '' then
|
||||||
|
CR_Code.Text := Trim(maxId);
|
||||||
|
RTSetsavedata(ADOQueryCmd, 'BS_Craft_Info', ScrollBox1, 2);
|
||||||
|
//memo fields on tab sheets, save manually
|
||||||
|
if Trim(warp_arrange.Text) = '' then
|
||||||
|
ADOQueryCmd.FieldByName('warp_arrange').Value := null
|
||||||
|
else
|
||||||
|
ADOQueryCmd.FieldByName('warp_arrange').Value := Trim(warp_arrange.Text);
|
||||||
|
if Trim(weft_arrange.Text) = '' then
|
||||||
|
ADOQueryCmd.FieldByName('weft_arrange').Value := null
|
||||||
|
else
|
||||||
|
ADOQueryCmd.FieldByName('weft_arrange').Value := Trim(weft_arrange.Text);
|
||||||
|
if Trim(threading_method.Text) = '' then
|
||||||
|
ADOQueryCmd.FieldByName('threading_method').Value := null
|
||||||
|
else
|
||||||
|
ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
////////////////////////// 保存纹版图 //////////////////////////
|
||||||
|
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from BS_Craft_Info_WB where CRID=''' + Trim(FCRID) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if IsEmpty then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
|
||||||
|
RTSetsavedata(ADOQueryCmd, 'BS_Craft_Info_WB', Panel7, 2);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
////////////////////////// 保存纹版图 //////////////////////////
|
||||||
|
|
||||||
|
////////////////////////// 保存经丝配比表 //////////////////////////
|
||||||
|
with CDS_1 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_1.fieldbyname('YRId').AsString) = '' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryTemp, maxpbno, 'RJ', 'BS_Craft_Yarn', 4, 1) = False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取配比子流水号失败!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
maxpbno := Trim(CDS_1.fieldbyname('YRId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from BS_Craft_Yarn where ');
|
||||||
|
sql.Add(' YRId=''' + Trim(maxpbno) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_1.fieldbyname('YRId').AsString) = '' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('Filler').Value := Trim(DName);
|
||||||
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Editer').Value := Trim(DName);
|
||||||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
FieldByName('YRType').Value := '经丝';
|
||||||
|
FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
FieldByName('YRId').Value := Trim(maxpbno);
|
||||||
|
RTSetSaveDataCDS(ADOQueryCmd, TV1, CDS_1, 'BS_Craft_Yarn', 0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
CDS_1.Edit;
|
||||||
|
CDS_1.FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
CDS_1.FieldByName('YRId').Value := Trim(maxpbno);
|
||||||
|
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
////////////////////////// 保存经丝配比表 //////////////////////////
|
||||||
|
|
||||||
|
////////////////////////// 保存纬丝配比表 //////////////////////////
|
||||||
|
with CDS_2 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_2.fieldbyname('YRId').AsString) = '' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryTemp, maxpbno, 'RJ', 'BS_Craft_Yarn', 4, 1) = False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取配比子流水号失败!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
maxpbno := Trim(CDS_2.fieldbyname('YRId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from BS_Craft_Yarn where ');
|
||||||
|
sql.Add(' YRId=''' + Trim(maxpbno) + '''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_2.fieldbyname('YRId').AsString) = '' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('Filler').Value := Trim(DName);
|
||||||
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Editer').Value := Trim(DName);
|
||||||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
FieldByName('YRType').Value := '纬丝';
|
||||||
|
FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
FieldByName('YRId').Value := Trim(maxpbno);
|
||||||
|
RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_2, 'BS_Craft_Yarn', 0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
CDS_2.Edit;
|
||||||
|
CDS_2.FieldByName('CRID').Value := Trim(maxId);
|
||||||
|
CDS_2.FieldByName('YRId').Value := Trim(maxpbno);
|
||||||
|
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
////////////////////////// 保存纬丝配比表 //////////////////////////
|
||||||
|
|
||||||
|
////////////////////////// 工艺保存后静默同步到所有绑定产品 //////////////////////////
|
||||||
|
SyncCraftToProduct(Trim(maxId));
|
||||||
|
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
FCRID := maxId;
|
||||||
|
Result := True;
|
||||||
|
except
|
||||||
|
Result := False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!', '提示', 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CR_Name.SetFocus;
|
||||||
|
if Trim(CR_Name.Text) = '' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('工艺名称不能为空!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!', '提示', 0);
|
||||||
|
ModalResult := 1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.C_WidthBtnDnClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
TBtnEditC(Sender).Text := '';
|
||||||
|
TBtnEditC(Sender).TxtCode := '';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.C_WidthBtnUpClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
fsj: string;
|
||||||
|
FWZ: Integer;
|
||||||
|
begin
|
||||||
|
fsj := Trim(TEdit(Sender).Hint);
|
||||||
|
FWZ := Pos('/', fsj);
|
||||||
|
try
|
||||||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag := Copy(fsj, 1, FWZ - 1);
|
||||||
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
||||||
|
if ShowModal = 1 then
|
||||||
|
begin
|
||||||
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
//增行固定新增甲乙丙丁戊己六行(无论表中是否已有数据)
|
||||||
|
AddPresetYarnRows(CDS_1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
if Trim(CDS_1.fieldbyname('YRId').AsString) <> '' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||||
|
Exit;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete BS_Craft_Yarn where YRId=''' + Trim(CDS_1.fieldbyname('YRId').AsString) + '''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_1.Delete;
|
||||||
|
CalcGramWeight();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton4Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
//增行固定新增甲乙丙丁戊己六行(无论表中是否已有数据)
|
||||||
|
AddPresetYarnRows(CDS_2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton5Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CR_Name.SetFocus;
|
||||||
|
CALCYarnQty();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.CYColorKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key = #13 then
|
||||||
|
begin
|
||||||
|
Key := #0;
|
||||||
|
SelectNext(ActiveControl as TWinControl, True, True);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton7Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_2.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
if Trim(CDS_2.fieldbyname('YRId').AsString) <> '' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||||
|
Exit;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete BS_Craft_Yarn where YRId=''' + Trim(CDS_2.fieldbyname('YRId').AsString) + '''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_2.Delete;
|
||||||
|
CalcGramWeight();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton8Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CR_Name.SetFocus;
|
||||||
|
CALCYarnQty();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoInput.ToolButton9Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid(self.Caption + 'TV1', Tv1, '经纱配比');
|
||||||
|
WriteCxGrid(self.Caption + 'TV2', Tv2, '纬纱配比');
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
265
A02基础产品管理/U_CraftInfoSel.dfm
Normal file
265
A02基础产品管理/U_CraftInfoSel.dfm
Normal file
|
|
@ -0,0 +1,265 @@
|
||||||
|
object frmCraftInfoSel: TfrmCraftInfoSel
|
||||||
|
Left = 400
|
||||||
|
Top = 200
|
||||||
|
Caption = #36873#25321#24037#33402
|
||||||
|
ClientHeight = 520
|
||||||
|
ClientWidth = 980
|
||||||
|
Color = clWhite
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Tag = 1
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 980
|
||||||
|
Height = 38
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 38
|
||||||
|
ButtonWidth = 91
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_ClothInfo.ImageList_new32
|
||||||
|
Images = DataLink_ClothInfo.ImageList_new32
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26597#35810
|
||||||
|
ImageIndex = 0
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBSave: TToolButton
|
||||||
|
Left = 71
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #30830#23450
|
||||||
|
ImageIndex = 16
|
||||||
|
OnClick = TBSaveClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 142
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 7
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 38
|
||||||
|
Width = 980
|
||||||
|
Height = 45
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = 16242829
|
||||||
|
ParentBackground = False
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 22
|
||||||
|
Top = 15
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #24037#33402#32534#21495#65306
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 262
|
||||||
|
Top = 15
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #24037#33402#21517#31216#65306
|
||||||
|
end
|
||||||
|
object CR_Code: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 88
|
||||||
|
Top = 11
|
||||||
|
Width = 150
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = CRCodeKeyPress
|
||||||
|
end
|
||||||
|
object CR_Name: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 328
|
||||||
|
Top = 11
|
||||||
|
Width = 220
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnKeyPress = CRCodeKeyPress
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 83
|
||||||
|
Width = 980
|
||||||
|
Height = 437
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
OnDblClick = Tv1DblClick
|
||||||
|
ScrollbarAnnotations.CustomAnnotations = <>
|
||||||
|
DataController.DataSource = DS_1
|
||||||
|
DataController.Filter.AutoDataSetFilter = True
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Editing = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
object Tv1CR_Code: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#32534#21495
|
||||||
|
DataBinding.FieldName = 'CR_Code'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 92
|
||||||
|
end
|
||||||
|
object Tv1CR_Name: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#21517#31216
|
||||||
|
DataBinding.FieldName = 'CR_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 150
|
||||||
|
end
|
||||||
|
object Tv1C_Width: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'C_Width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_GramWeight: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'C_GramWeight'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1C_Color: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'C_Color'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_YarnQty: TcxGridDBColumn
|
||||||
|
Caption = #22836#32441
|
||||||
|
DataBinding.FieldName = 'C_YarnQty'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1head_count: TcxGridDBColumn
|
||||||
|
Caption = #22836#20221
|
||||||
|
DataBinding.FieldName = 'head_count'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1strip_width: TcxGridDBColumn
|
||||||
|
Caption = #26465#23485
|
||||||
|
DataBinding.FieldName = 'strip_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_MachLatitudeDensity: TcxGridDBColumn
|
||||||
|
Caption = #19978#26426#32428#23494
|
||||||
|
DataBinding.FieldName = 'C_MachLatitudeDensity'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1row_count_top: TcxGridDBColumn
|
||||||
|
Caption = #19978#25490#25968
|
||||||
|
DataBinding.FieldName = 'row_count_top'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1displace: TcxGridDBColumn
|
||||||
|
Caption = #20301#31227
|
||||||
|
DataBinding.FieldName = 'displace'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1reed_width: TcxGridDBColumn
|
||||||
|
Caption = #23450#24133#31576
|
||||||
|
DataBinding.FieldName = 'reed_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1C_ReedNo: TcxGridDBColumn
|
||||||
|
Caption = #31576#21495
|
||||||
|
DataBinding.FieldName = 'C_ReedNo'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DS_1: TDataSource
|
||||||
|
DataSet = CDS_1
|
||||||
|
Left = 640
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object CDS_1: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 560
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_ClothInfo.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 720
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
end
|
||||||
134
A02基础产品管理/U_CraftInfoSel.pas
Normal file
134
A02基础产品管理/U_CraftInfoSel.pas
Normal file
|
|
@ -0,0 +1,134 @@
|
||||||
|
unit U_CraftInfoSel;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCraftInfoSel = 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;
|
||||||
|
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
|
||||||
|
frmCraftInfoSel: TfrmCraftInfoSel;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_RTFun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.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 TfrmCraftInfoSel.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmCraftInfoSel := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.TBSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
ModalResult := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.Tv1DblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
ModalResult := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCraftInfoSel.CRCodeKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key = #13 then
|
||||||
|
begin
|
||||||
|
Key := #0;
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
170
A02基础产品管理/U_CraftSync.pas
Normal file
170
A02基础产品管理/U_CraftSync.pas
Normal file
|
|
@ -0,0 +1,170 @@
|
||||||
|
unit U_CraftSync;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Variants, DB, ADODB;
|
||||||
|
|
||||||
|
//将工艺数据静默同步到所有绑定该工艺的产品:
|
||||||
|
// 主表工艺字段(含工艺编号/名称) + 经纬纱配比子表 + 纹版图子表
|
||||||
|
//注意:必须在调用方的事务内执行,本过程不自己开事务
|
||||||
|
procedure SyncCraftToProduct(const ACRID: string);
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_RTFun;
|
||||||
|
|
||||||
|
function StrSQL(const AValue: Variant): string;
|
||||||
|
begin
|
||||||
|
if VarIsNull(AValue) then
|
||||||
|
Result := 'null'
|
||||||
|
else
|
||||||
|
Result := QuotedStr(Trim(VarToStr(AValue)));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function NumSQL(const AValue: Variant): string;
|
||||||
|
begin
|
||||||
|
if VarIsNull(AValue) then
|
||||||
|
Result := 'null'
|
||||||
|
else
|
||||||
|
Result := FormatFloat('0.##########', VarAsType(AValue, varDouble));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function WBColList(const APrefix: string): string;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
for i := 1 to 72 do
|
||||||
|
begin
|
||||||
|
if Result <> '' then
|
||||||
|
Result := Result + ',';
|
||||||
|
Result := Result + APrefix + 'WB_' + IntToStr(i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SyncCraftToProduct(const ACRID: string);
|
||||||
|
var
|
||||||
|
Qry, QryYarn: TADOQuery;
|
||||||
|
Products: TStringList;
|
||||||
|
i: Integer;
|
||||||
|
NewNo: string;
|
||||||
|
begin
|
||||||
|
if Trim(ACRID) = '' then
|
||||||
|
Exit;
|
||||||
|
Qry := TADOQuery.Create(nil);
|
||||||
|
QryYarn := TADOQuery.Create(nil);
|
||||||
|
Products := TStringList.Create;
|
||||||
|
try
|
||||||
|
Qry.Connection := DataLink_ClothInfo.ADOLink;
|
||||||
|
QryYarn.Connection := DataLink_ClothInfo.ADOLink;
|
||||||
|
|
||||||
|
//1.主表工艺字段镜像(只更新工艺管辖列,不碰产品自有字段)
|
||||||
|
with Qry do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('update B set B.CRID=C.CRID,B.CR_Code=C.CR_Code,B.CR_Name=C.CR_Name');
|
||||||
|
SQL.Add(',B.C_Width=C.C_Width,B.C_GramWeight=C.C_GramWeight,B.C_Color=C.C_Color');
|
||||||
|
SQL.Add(',B.C_YarnQty=C.C_YarnQty,B.head_count=C.head_count,B.strip_width=C.strip_width');
|
||||||
|
SQL.Add(',B.C_MachLatitudeDensity=C.C_MachLatitudeDensity,B.row_count_top=C.row_count_top');
|
||||||
|
SQL.Add(',B.displace=C.displace,B.reed_width=C.reed_width,B.C_ReedNo=C.C_ReedNo');
|
||||||
|
SQL.Add(',B.warp_arrange=C.warp_arrange,B.weft_arrange=C.weft_arrange,B.threading_method=C.threading_method');
|
||||||
|
SQL.Add('from BS_Cloth_Info B join BS_Craft_Info C on C.CRID=B.CRID');
|
||||||
|
SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID)));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//2.纹版图镜像(每产品一行,整行替换)
|
||||||
|
with Qry do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('delete W from Bs_Cloth_Info_WB W join BS_Cloth_Info B on B.BCIID=W.BCIID');
|
||||||
|
SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID)));
|
||||||
|
ExecSQL;
|
||||||
|
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('insert into Bs_Cloth_Info_WB (BCIID,' + WBColList('') + ')');
|
||||||
|
SQL.Add('select B.BCIID,' + WBColList('C.'));
|
||||||
|
SQL.Add('from BS_Cloth_Info B join BS_Craft_Info_WB C on C.CRID=B.CRID');
|
||||||
|
SQL.Add('where B.CRID=' + QuotedStr(Trim(ACRID)));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//3.经纬纱配比镜像(逐产品整删整插,YRId按产品表自己的流水取号)
|
||||||
|
with Qry do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select BCIID from BS_Cloth_Info where CRID=' + QuotedStr(Trim(ACRID)));
|
||||||
|
Open;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Products.Add(Trim(FieldByName('BCIID').AsString));
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if Products.Count > 0 then
|
||||||
|
begin
|
||||||
|
with QryYarn do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from BS_Craft_Yarn where CRID=' + QuotedStr(Trim(ACRID)));
|
||||||
|
SQL.Add('order by YRType,seq_no,YRId');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
for i := 0 to Products.Count - 1 do
|
||||||
|
begin
|
||||||
|
with Qry do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('delete BS_Cloth_Yarn where BCIID=' + QuotedStr(Products[i]));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
QryYarn.First;
|
||||||
|
while not QryYarn.Eof do
|
||||||
|
begin
|
||||||
|
if GetLSNo(Qry, NewNo, 'RJ', 'BS_Cloth_Yarn', 4, 1) = False then
|
||||||
|
raise Exception.Create('取产品配比流水号失败');
|
||||||
|
with Qry do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('insert into BS_Cloth_Yarn (YRId,BCIID,YRType,seq_no,Y_Code,Y_Name,Brand,Y_Color,Denier,Y_Ratio,Y_Qty,Filler,FillTime)');
|
||||||
|
SQL.Add('values (' + QuotedStr(Trim(NewNo)) + ',' + QuotedStr(Products[i]));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('YRType').Value));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('seq_no').Value));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Code').Value));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Name').Value));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('Brand').Value));
|
||||||
|
SQL.Add(',' + StrSQL(QryYarn.FieldByName('Y_Color').Value));
|
||||||
|
SQL.Add(',' + NumSQL(QryYarn.FieldByName('Denier').Value));
|
||||||
|
SQL.Add(',' + NumSQL(QryYarn.FieldByName('Y_Ratio').Value));
|
||||||
|
SQL.Add(',' + NumSQL(QryYarn.FieldByName('Y_Qty').Value));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim(DName)) + ',getdate())');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
QryYarn.Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
QryYarn.Close;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Products.Free;
|
||||||
|
QryYarn.Free;
|
||||||
|
Qry.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -16,7 +16,7 @@ implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
U_DataLink, U_iniParam, U_ClothType, U_ClothInfo, U_TatClothInfo,
|
U_DataLink, U_iniParam, U_ClothType, U_ClothInfo, U_TatClothInfo,
|
||||||
U_KnitClothInfoList;
|
U_KnitClothInfoList, U_CraftInfo;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// 功能说明:取Dll中得窗体 //
|
// 功能说明:取Dll中得窗体 //
|
||||||
|
|
@ -174,6 +174,18 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
142: // 产品工艺管理
|
||||||
|
begin
|
||||||
|
with TfrmCraftInfo.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
|
||||||
|
begin
|
||||||
|
fFormID := FormID;
|
||||||
|
FormStyle := mstyle;
|
||||||
|
WindowState := mstate;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
mnewHandle := Handle;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
10000:
|
10000:
|
||||||
begin
|
begin
|
||||||
for i := 0 to application.MainForm.MDIChildCount - 1 do
|
for i := 0 to application.MainForm.MDIChildCount - 1 do
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,14 @@ inherited frmTatClothInfo: TfrmTatClothInfo
|
||||||
ImageIndex = 3
|
ImageIndex = 3
|
||||||
OnClick = TBMLEditClick
|
OnClick = TBMLEditClick
|
||||||
end
|
end
|
||||||
|
object TBBindCraft: TToolButton
|
||||||
|
Left = 497
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #32465#23450#24037#33402
|
||||||
|
ImageIndex = 4
|
||||||
|
OnClick = TBBindCraftClick
|
||||||
|
end
|
||||||
object tbStart: TToolButton
|
object tbStart: TToolButton
|
||||||
Left = 521
|
Left = 521
|
||||||
Top = 0
|
Top = 0
|
||||||
|
|
@ -537,6 +545,78 @@ inherited frmTatClothInfo: TfrmTatClothInfo
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
Width = 80
|
Width = 80
|
||||||
end
|
end
|
||||||
|
object Tv1CR_Code: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#32534#21495
|
||||||
|
DataBinding.FieldName = 'CR_Code'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 92
|
||||||
|
end
|
||||||
|
object Tv1CR_Name: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402#21517#31216
|
||||||
|
DataBinding.FieldName = 'CR_Name'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 120
|
||||||
|
end
|
||||||
|
object Tv1head_count: TcxGridDBColumn
|
||||||
|
Caption = #22836#20221
|
||||||
|
DataBinding.FieldName = 'head_count'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1strip_width: TcxGridDBColumn
|
||||||
|
Caption = #26465#23485
|
||||||
|
DataBinding.FieldName = 'strip_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1C_MachLatitudeDensity: TcxGridDBColumn
|
||||||
|
Caption = #19978#26426#32428#23494
|
||||||
|
DataBinding.FieldName = 'C_MachLatitudeDensity'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
|
object Tv1row_count_top: TcxGridDBColumn
|
||||||
|
Caption = #19978#25490#25968
|
||||||
|
DataBinding.FieldName = 'row_count_top'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1displace: TcxGridDBColumn
|
||||||
|
Caption = #20301#31227
|
||||||
|
DataBinding.FieldName = 'displace'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object Tv1reed_width: TcxGridDBColumn
|
||||||
|
Caption = #23450#24133#31576
|
||||||
|
DataBinding.FieldName = 'reed_width'
|
||||||
|
DataBinding.IsNullValueType = True
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_ClothInfo.Default
|
||||||
|
Width = 81
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGrid1Level1: TcxGridLevel
|
object cxGrid1Level1: TcxGridLevel
|
||||||
GridView = Tv1
|
GridView = Tv1
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ type
|
||||||
TBAdd: TToolButton;
|
TBAdd: TToolButton;
|
||||||
TBEdit: TToolButton;
|
TBEdit: TToolButton;
|
||||||
TBMLEdit: TToolButton;
|
TBMLEdit: TToolButton;
|
||||||
|
TBBindCraft: TToolButton;
|
||||||
OpenDialog1: TOpenDialog;
|
OpenDialog1: TOpenDialog;
|
||||||
Label9: TLabel;
|
Label9: TLabel;
|
||||||
C_GramWeight: TEdit;
|
C_GramWeight: TEdit;
|
||||||
|
|
@ -122,6 +123,14 @@ type
|
||||||
ToolButton4: TToolButton;
|
ToolButton4: TToolButton;
|
||||||
Tv1C_Color: TcxGridDBColumn;
|
Tv1C_Color: TcxGridDBColumn;
|
||||||
Tv1estimated_diff: TcxGridDBColumn;
|
Tv1estimated_diff: TcxGridDBColumn;
|
||||||
|
Tv1CR_Code: TcxGridDBColumn;
|
||||||
|
Tv1CR_Name: TcxGridDBColumn;
|
||||||
|
Tv1head_count: TcxGridDBColumn;
|
||||||
|
Tv1strip_width: TcxGridDBColumn;
|
||||||
|
Tv1C_MachLatitudeDensity: TcxGridDBColumn;
|
||||||
|
Tv1row_count_top: TcxGridDBColumn;
|
||||||
|
Tv1displace: TcxGridDBColumn;
|
||||||
|
Tv1reed_width: TcxGridDBColumn;
|
||||||
cxTabControl1: TcxTabControl;
|
cxTabControl1: TcxTabControl;
|
||||||
tbStart: TToolButton;
|
tbStart: TToolButton;
|
||||||
tbPause: TToolButton;
|
tbPause: TToolButton;
|
||||||
|
|
@ -142,6 +151,7 @@ type
|
||||||
procedure TBAddClick(Sender: TObject);
|
procedure TBAddClick(Sender: TObject);
|
||||||
procedure TBEditClick(Sender: TObject);
|
procedure TBEditClick(Sender: TObject);
|
||||||
procedure TBMLEditClick(Sender: TObject);
|
procedure TBMLEditClick(Sender: TObject);
|
||||||
|
procedure TBBindCraftClick(Sender: TObject);
|
||||||
procedure N1Click(Sender: TObject);
|
procedure N1Click(Sender: TObject);
|
||||||
procedure N2Click(Sender: TObject);
|
procedure N2Click(Sender: TObject);
|
||||||
procedure TCBNOR1Change(Sender: TObject);
|
procedure TCBNOR1Change(Sender: TObject);
|
||||||
|
|
@ -186,7 +196,7 @@ implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
U_DataLink, U_RTFun, U_TatClothInfoInput, U_CloInfoFileUp, U_ClothTypeSel,
|
U_DataLink, U_RTFun, U_TatClothInfoInput, U_CloInfoFileUp, U_ClothTypeSel,
|
||||||
U_ZDYHelp, U_LabelPrint;
|
U_ZDYHelp, U_LabelPrint, U_CraftInfoSel, U_CraftSync;
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure TfrmTatClothInfo.LookImage(FileName: string);
|
procedure TfrmTatClothInfo.LookImage(FileName: string);
|
||||||
|
|
@ -976,6 +986,90 @@ begin
|
||||||
WriteCxGrid(self.Caption + 'TV1', Tv1, 'ÑùÆ·¹ÜÀí');
|
WriteCxGrid(self.Caption + 'TV1', Tv1, 'ÑùÆ·¹ÜÀí');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatClothInfo.TBBindCraftClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
MBCIIDS, MCRID: string;
|
||||||
|
begin
|
||||||
|
if CDS_1.IsEmpty then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
//勾选优先,未勾选时取当前行
|
||||||
|
MBCIIDS := '';
|
||||||
|
CDS_1.DisableControls;
|
||||||
|
try
|
||||||
|
CDS_1.First;
|
||||||
|
while not CDS_1.Eof do
|
||||||
|
begin
|
||||||
|
if CDS_1.fieldbyname('SSel').AsBoolean then
|
||||||
|
begin
|
||||||
|
if MBCIIDS <> '' then
|
||||||
|
MBCIIDS := MBCIIDS + ',' + QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString))
|
||||||
|
else
|
||||||
|
MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString));
|
||||||
|
end;
|
||||||
|
CDS_1.Next;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
CDS_1.EnableControls;
|
||||||
|
end;
|
||||||
|
if MBCIIDS = '' then
|
||||||
|
MBCIIDS := QuotedStr(Trim(CDS_1.fieldbyname('BCIID').AsString));
|
||||||
|
|
||||||
|
MCRID := '';
|
||||||
|
try
|
||||||
|
frmCraftInfoSel := TfrmCraftInfoSel.Create(Application);
|
||||||
|
with frmCraftInfoSel do
|
||||||
|
begin
|
||||||
|
if ShowModal = 1 then
|
||||||
|
begin
|
||||||
|
if not CDS_1.IsEmpty then
|
||||||
|
MCRID := Trim(CDS_1.fieldbyname('CRID').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCraftInfoSel.Free;
|
||||||
|
end;
|
||||||
|
if Trim(MCRID) = '' then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
//绑定动作本身只写CRID(工艺字段值由静默同步维护)
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('update BS_Cloth_Info set CRID=' + QuotedStr(Trim(MCRID)));
|
||||||
|
SQL.Add(',EDITER=' + QuotedStr(Trim(DName)) + ',EDITTIME=getdate()');
|
||||||
|
SQL.Add(' where BCIID in (' + MBCIIDS + ')');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
//静默同步工艺数据到绑定产品(主表字段+经纬纱配比+纹版图)
|
||||||
|
SyncCraftToProduct(Trim(MCRID));
|
||||||
|
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('绑定工艺')));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim(MBCIIDS + ' -> ' + MCRID)));
|
||||||
|
SQL.Add(',' + QuotedStr(Trim('成功')));
|
||||||
|
SQL.Add(')');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
|
||||||
|
InitGrid();
|
||||||
|
Application.MessageBox('绑定工艺成功!', '提示信息');
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmTatClothInfo.ToolButton3Click(Sender: TObject);
|
procedure TfrmTatClothInfo.ToolButton3Click(Sender: TObject);
|
||||||
var
|
var
|
||||||
WSql: string;
|
WSql: string;
|
||||||
|
|
|
||||||
|
|
@ -274,6 +274,8 @@ type
|
||||||
private
|
private
|
||||||
canshu1: string;
|
canshu1: string;
|
||||||
Fint: Integer;
|
Fint: Integer;
|
||||||
|
FBound: Boolean;
|
||||||
|
procedure SetCraftFieldsReadOnly(AReadOnly: Boolean);
|
||||||
procedure InitGrid();
|
procedure InitGrid();
|
||||||
procedure AddPresetYarnRows(ACDS: TClientDataSet);
|
procedure AddPresetYarnRows(ACDS: TClientDataSet);
|
||||||
function SaveData(): Boolean;
|
function SaveData(): Boolean;
|
||||||
|
|
@ -421,6 +423,8 @@ end;
|
||||||
|
|
||||||
procedure TfrmTatClothInfoInput.InitGrid();
|
procedure TfrmTatClothInfoInput.InitGrid();
|
||||||
begin
|
begin
|
||||||
|
//先恢复工艺字段可填充状态(绑定态在末尾统一置只读)
|
||||||
|
SetCraftFieldsReadOnly(False);
|
||||||
|
|
||||||
with ADOQueryTemp do
|
with ADOQueryTemp do
|
||||||
begin
|
begin
|
||||||
|
|
@ -430,6 +434,9 @@ begin
|
||||||
Open;
|
Open;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
//是否已绑定工艺
|
||||||
|
FBound := Trim(ADOQueryTemp.fieldbyname('CRID').AsString) <> '';
|
||||||
|
|
||||||
//memo fields on tab sheets are not reached by SCSHData, load manually
|
//memo fields on tab sheets are not reached by SCSHData, load manually
|
||||||
warp_arrange.Text := Trim(ADOQueryTemp.fieldbyname('warp_arrange').AsString);
|
warp_arrange.Text := Trim(ADOQueryTemp.fieldbyname('warp_arrange').AsString);
|
||||||
weft_arrange.Text := Trim(ADOQueryTemp.fieldbyname('weft_arrange').AsString);
|
weft_arrange.Text := Trim(ADOQueryTemp.fieldbyname('weft_arrange').AsString);
|
||||||
|
|
@ -479,6 +486,17 @@ begin
|
||||||
end;
|
end;
|
||||||
SCreateCDS(ADOQueryTemp, CDS_3);
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
||||||
SInitCDSData(ADOQueryTemp, CDS_3);
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
||||||
|
|
||||||
|
//绑定工艺后:工艺管辖字段/配比网格/相关按钮全部只读
|
||||||
|
SetCraftFieldsReadOnly(FBound);
|
||||||
|
TV1.OptionsData.Editing := not FBound;
|
||||||
|
Tv2.OptionsData.Editing := not FBound;
|
||||||
|
ToolButton2.Enabled := not FBound;
|
||||||
|
ToolButton3.Enabled := not FBound;
|
||||||
|
ToolButton4.Enabled := not FBound;
|
||||||
|
ToolButton5.Enabled := not FBound;
|
||||||
|
ToolButton7.Enabled := not FBound;
|
||||||
|
ToolButton8.Enabled := not FBound;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmTatClothInfoInput.AddPresetYarnRows(ACDS: TClientDataSet);
|
procedure TfrmTatClothInfoInput.AddPresetYarnRows(ACDS: TClientDataSet);
|
||||||
|
|
@ -495,6 +513,82 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmTatClothInfoInput.SetCraftFieldsReadOnly(AReadOnly: Boolean);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
//绑定工艺后,工艺管辖字段只作展示:
|
||||||
|
//Tag在2/0间切换,使RTSetsavedata保存产品时自动跳过这些控件;禁用防手工编辑
|
||||||
|
if AReadOnly then
|
||||||
|
begin
|
||||||
|
C_Width.Tag := 0;
|
||||||
|
C_GramWeight.Tag := 0;
|
||||||
|
C_Color.Tag := 0;
|
||||||
|
C_YarnQty.Tag := 0;
|
||||||
|
head_count.Tag := 0;
|
||||||
|
strip_width.Tag := 0;
|
||||||
|
C_MachLatitudeDensity.Tag := 0;
|
||||||
|
row_count_top.Tag := 0;
|
||||||
|
displace.Tag := 0;
|
||||||
|
reed_width.Tag := 0;
|
||||||
|
C_ReedNo.Tag := 0;
|
||||||
|
|
||||||
|
C_Width.Enabled := False;
|
||||||
|
C_GramWeight.Enabled := False;
|
||||||
|
C_Color.Enabled := False;
|
||||||
|
C_YarnQty.Enabled := False;
|
||||||
|
head_count.Enabled := False;
|
||||||
|
strip_width.Enabled := False;
|
||||||
|
C_MachLatitudeDensity.Enabled := False;
|
||||||
|
row_count_top.Enabled := False;
|
||||||
|
displace.Enabled := False;
|
||||||
|
reed_width.Enabled := False;
|
||||||
|
C_ReedNo.Enabled := False;
|
||||||
|
|
||||||
|
warp_arrange.ReadOnly := True;
|
||||||
|
weft_arrange.ReadOnly := True;
|
||||||
|
threading_method.ReadOnly := True;
|
||||||
|
|
||||||
|
for i := 0 to Panel7.ControlCount - 1 do
|
||||||
|
if Panel7.Controls[i] is TEdit then
|
||||||
|
Panel7.Controls[i].Enabled := False;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
C_Width.Tag := 2;
|
||||||
|
C_GramWeight.Tag := 2;
|
||||||
|
C_Color.Tag := 2;
|
||||||
|
C_YarnQty.Tag := 2;
|
||||||
|
head_count.Tag := 2;
|
||||||
|
strip_width.Tag := 2;
|
||||||
|
C_MachLatitudeDensity.Tag := 2;
|
||||||
|
row_count_top.Tag := 2;
|
||||||
|
displace.Tag := 2;
|
||||||
|
reed_width.Tag := 2;
|
||||||
|
C_ReedNo.Tag := 2;
|
||||||
|
|
||||||
|
C_Width.Enabled := True;
|
||||||
|
C_GramWeight.Enabled := True;
|
||||||
|
C_Color.Enabled := True;
|
||||||
|
C_YarnQty.Enabled := True;
|
||||||
|
head_count.Enabled := True;
|
||||||
|
strip_width.Enabled := True;
|
||||||
|
C_MachLatitudeDensity.Enabled := True;
|
||||||
|
row_count_top.Enabled := True;
|
||||||
|
displace.Enabled := True;
|
||||||
|
reed_width.Enabled := True;
|
||||||
|
C_ReedNo.Enabled := True;
|
||||||
|
|
||||||
|
warp_arrange.ReadOnly := False;
|
||||||
|
weft_arrange.ReadOnly := False;
|
||||||
|
threading_method.ReadOnly := False;
|
||||||
|
|
||||||
|
for i := 0 to Panel7.ControlCount - 1 do
|
||||||
|
if Panel7.Controls[i] is TEdit then
|
||||||
|
Panel7.Controls[i].Enabled := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TfrmTatClothInfoInput.FormShow(Sender: TObject);
|
procedure TfrmTatClothInfoInput.FormShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
@ -506,6 +600,11 @@ begin
|
||||||
FBCIID := '';
|
FBCIID := '';
|
||||||
BCIID.text := '';
|
BCIID.text := '';
|
||||||
C_Code.text := '';
|
C_Code.text := '';
|
||||||
|
//复制出的新产品视为未绑定,界面值作为初始数据照常保存
|
||||||
|
FBound := False;
|
||||||
|
SetCraftFieldsReadOnly(False);
|
||||||
|
TV1.OptionsData.Editing := True;
|
||||||
|
Tv2.OptionsData.Editing := True;
|
||||||
ClearCDSColumn(CDS_2, ['YRId', 'bciid']);
|
ClearCDSColumn(CDS_2, ['YRId', 'bciid']);
|
||||||
ClearCDSColumn(CDS_1, ['YRId', 'bciid']);
|
ClearCDSColumn(CDS_1, ['YRId', 'bciid']);
|
||||||
ClearCDSColumn(CDS_3, ['QZID', 'bciid']);
|
ClearCDSColumn(CDS_3, ['QZID', 'bciid']);
|
||||||
|
|
@ -600,22 +699,28 @@ begin
|
||||||
C_Code.Text := Trim(maxId);
|
C_Code.Text := Trim(maxId);
|
||||||
RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', ScrollBox1, 2);
|
RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', ScrollBox1, 2);
|
||||||
//memo fields on tab sheets, save manually
|
//memo fields on tab sheets, save manually
|
||||||
if Trim(warp_arrange.Text) = '' then
|
if not FBound then
|
||||||
ADOQueryCmd.FieldByName('warp_arrange').Value := null
|
begin
|
||||||
else
|
if Trim(warp_arrange.Text) = '' then
|
||||||
ADOQueryCmd.FieldByName('warp_arrange').Value := Trim(warp_arrange.Text);
|
ADOQueryCmd.FieldByName('warp_arrange').Value := null
|
||||||
if Trim(weft_arrange.Text) = '' then
|
else
|
||||||
ADOQueryCmd.FieldByName('weft_arrange').Value := null
|
ADOQueryCmd.FieldByName('warp_arrange').Value := Trim(warp_arrange.Text);
|
||||||
else
|
if Trim(weft_arrange.Text) = '' then
|
||||||
ADOQueryCmd.FieldByName('weft_arrange').Value := Trim(weft_arrange.Text);
|
ADOQueryCmd.FieldByName('weft_arrange').Value := null
|
||||||
|
else
|
||||||
|
ADOQueryCmd.FieldByName('weft_arrange').Value := Trim(weft_arrange.Text);
|
||||||
|
end;
|
||||||
if Trim(reed_weave_method.Text) = '' then
|
if Trim(reed_weave_method.Text) = '' then
|
||||||
ADOQueryCmd.FieldByName('reed_weave_method').Value := null
|
ADOQueryCmd.FieldByName('reed_weave_method').Value := null
|
||||||
else
|
else
|
||||||
ADOQueryCmd.FieldByName('reed_weave_method').Value := Trim(reed_weave_method.Text);
|
ADOQueryCmd.FieldByName('reed_weave_method').Value := Trim(reed_weave_method.Text);
|
||||||
if Trim(threading_method.Text) = '' then
|
if not FBound then
|
||||||
ADOQueryCmd.FieldByName('threading_method').Value := null
|
begin
|
||||||
else
|
if Trim(threading_method.Text) = '' then
|
||||||
ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text);
|
ADOQueryCmd.FieldByName('threading_method').Value := null
|
||||||
|
else
|
||||||
|
ADOQueryCmd.FieldByName('threading_method').Value := Trim(threading_method.Text);
|
||||||
|
end;
|
||||||
if Trim(lifting_method.Text) = '' then
|
if Trim(lifting_method.Text) = '' then
|
||||||
ADOQueryCmd.FieldByName('lifting_method').Value := null
|
ADOQueryCmd.FieldByName('lifting_method').Value := null
|
||||||
else
|
else
|
||||||
|
|
@ -638,7 +743,8 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
////////////////////////// 괏닸廣경暠 //////////////////////////
|
////////////////////////// 괏닸廣경暠 //////////////////////////
|
||||||
|
if not FBound then
|
||||||
|
begin
|
||||||
with ADOQueryCmd do
|
with ADOQueryCmd do
|
||||||
begin
|
begin
|
||||||
Close;
|
Close;
|
||||||
|
|
@ -663,11 +769,14 @@ begin
|
||||||
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_Info_WB', Panel7, 2);
|
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_Info_WB', Panel7, 2);
|
||||||
Post;
|
Post;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////// 괏닸廣경暠 //////////////////////////
|
////////////////////////// 괏닸廣경暠 //////////////////////////
|
||||||
|
|
||||||
////////////////////////// 괏닸쒔介토궐깊 //////////////////////////
|
////////////////////////// 괏닸쒔介토궐깊 //////////////////////////
|
||||||
|
if not FBound then
|
||||||
|
begin
|
||||||
with CDS_1 do
|
with CDS_1 do
|
||||||
begin
|
begin
|
||||||
First;
|
First;
|
||||||
|
|
@ -721,9 +830,12 @@ begin
|
||||||
Next;
|
Next;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
////////////////////////// 괏닸쒔介토궐깊 //////////////////////////
|
////////////////////////// 괏닸쒔介토궐깊 //////////////////////////
|
||||||
|
|
||||||
////////////////////////// 괏닸款介토궐깊 //////////////////////////
|
////////////////////////// 괏닸款介토궐깊 //////////////////////////
|
||||||
|
if not FBound then
|
||||||
|
begin
|
||||||
with CDS_2 do
|
with CDS_2 do
|
||||||
begin
|
begin
|
||||||
First;
|
First;
|
||||||
|
|
@ -777,6 +889,7 @@ begin
|
||||||
Next;
|
Next;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
////////////////////////// 괏닸款介토궐깊 //////////////////////////
|
////////////////////////// 괏닸款介토궐깊 //////////////////////////
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user