unit U_DyeProcessDefin; 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, cxCheckBox, cxDropDownEdit, dxSkinBasic, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark, dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray, dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI, dxSkinXmas2008Blue, cxContainer, cxLabel, cxPC, dxScrollbarAnnotations, cxMaskEdit, Vcl.Menus, cxButtons; type TfrmDyeProcessDefin = class(TForm) ToolBar1: TToolBar; TbSave: TToolButton; TBClose: TToolButton; ADOQueryCmd: TADOQuery; ADOQueryTemp: TADOQuery; TbUpFile: TToolButton; CDS_1: TClientDataSet; DS_1: TDataSource; GPM_1: TcxGridPopupMenu; cxPageControl1: TcxPageControl; cxTabSheet2: TcxTabSheet; DX: TcxTabSheet; cxTabSheet4: TcxTabSheet; cxGrid2: TcxGrid; Tv1: TcxGridDBTableView; Tv11fs_Name: TcxGridDBColumn; Tv11fs_spel: TcxGridDBColumn; Tv1fs_unit: TcxGridDBColumn; Tv11fs_rate: TcxGridDBColumn; Tv11fs_precautions: TcxGridDBColumn; cxGridLevel1: TcxGridLevel; cxTabSheet5: TcxTabSheet; cxGrid1: TcxGrid; Tv2: TcxGridDBTableView; Tv2fp_Name: TcxGridDBColumn; Tv2fp_spel: TcxGridDBColumn; Tv2fp_unit: TcxGridDBColumn; Tv2fp_rate: TcxGridDBColumn; Tv2fp_precautions: TcxGridDBColumn; cxGridDBColumn16: TcxGridDBColumn; cxGridDBColumn17: TcxGridDBColumn; cxGridDBColumn18: TcxGridDBColumn; cxGridLevel2: TcxGridLevel; cxTabSheet6: TcxTabSheet; cxGrid3: TcxGrid; Tv3: TcxGridDBTableView; Tv3gj_Name: TcxGridDBColumn; Tv3gj_spel: TcxGridDBColumn; Tv3gj_unit: TcxGridDBColumn; TV3gj_rate: TcxGridDBColumn; Tv3gj_precautions: TcxGridDBColumn; cxGridDBColumn26: TcxGridDBColumn; cxGridDBColumn27: TcxGridDBColumn; cxGridDBColumn28: TcxGridDBColumn; cxGridLevel3: TcxGridLevel; Panel2: TPanel; cxLabel10: TcxLabel; cxLabel11: TcxLabel; cxLabel12: TcxLabel; cxLabel13: TcxLabel; cxLabel14: TcxLabel; cxLabel15: TcxLabel; cxLabel16: TcxLabel; cxLabel17: TcxLabel; cxLabel18: TcxLabel; cxLabel19: TcxLabel; cxLabel20: TcxLabel; cxLabel7: TcxLabel; cxLabel8: TcxLabel; cxLabel9: TcxLabel; qx_WaterContentDQ: TcxTextEdit; qx_Add_NameDQ: TcxTextEdit; qx_speedDQ: TcxTextEdit; qx_ReduceAmplitudeDQ: TcxTextEdit; Panel_dx: TPanel; cxLabel2: TcxLabel; cxLabel21: TcxLabel; cxLabel22: TcxLabel; cxLabel23: TcxLabel; cxLabel24: TcxLabel; cxLabel25: TcxLabel; cxLabel27: TcxLabel; cxLabel3: TcxLabel; cxLabel4: TcxLabel; cxLabel5: TcxLabel; cxLabel55: TcxLabel; cxLabel56: TcxLabel; cxLabel57: TcxLabel; cxLabel58: TcxLabel; cxLabel6: TcxLabel; cxLabel60: TcxLabel; cxLabel61: TcxLabel; cxLabel62: TcxLabel; cxLabel63: TcxLabel; cxLabel64: TcxLabel; cxLabel65: TcxLabel; dx_temperature1: TcxTextEdit; dx_WidthAmplitude: TcxTextEdit; dx_temperature5: TcxTextEdit; dx_temperature9: TcxTextEdit; dx_RosePower: TcxTextEdit; dx_upperNeedle: TcxTextEdit; dx_Precautions: TcxTextEdit; dx_UpSuperRate: TcxTextEdit; dx_speed: TcxTextEdit; dx_TubePress: TcxTextEdit; dx_temperature6: TcxTextEdit; dx_DownSuperRate: TcxTextEdit; dx_temperature3: TcxTextEdit; dx_temperature4: TcxTextEdit; dx_temperature7: TcxTextEdit; dx_temperature8: TcxTextEdit; dx_temperature10: TcxTextEdit; dx_temperature2: TcxTextEdit; Panel4: TPanel; cxLabel100: TcxLabel; cxLabel101: TcxLabel; cxLabel102: TcxLabel; cxLabel103: TcxLabel; cxLabel104: TcxLabel; cxLabel105: TcxLabel; cxLabel106: TcxLabel; cxLabel109: TcxLabel; cxLabel110: TcxLabel; cxLabel111: TcxLabel; cxLabel82: TcxLabel; cxLabel83: TcxLabel; cxLabel84: TcxLabel; cxLabel85: TcxLabel; cxLabel86: TcxLabel; cxLabel87: TcxLabel; cxLabel88: TcxLabel; cxLabel89: TcxLabel; cxLabel90: TcxLabel; cxLabel91: TcxLabel; cxLabel92: TcxLabel; cxLabel93: TcxLabel; cxLabel94: TcxLabel; cxLabel95: TcxLabel; cxLabel96: TcxLabel; cxLabel97: TcxLabel; cxLabel98: TcxLabel; cxLabel99: TcxLabel; fs_OutFanSpeedDQ: TcxTextEdit; fs_WidthAmplitudeDQ: TcxTextEdit; fs_RosePowerDQ: TcxTextEdit; fs_BrushSuperRateDQ: TcxTextEdit; fs_UpSuperRateDQ: TcxTextEdit; fs_speedDQ: TcxTextEdit; fs_TubePressDQ: TcxTextEdit; fs_CycleFanSpeedDQ: TcxTextEdit; fs_DownSuperRateDQ: TcxTextEdit; fs_CarPressDQ: TcxTextEdit; fs_PressWaterContentDQ: TcxTextEdit; Panel5: TPanel; cxLabel107: TcxLabel; cxLabel108: TcxLabel; cxLabel112: TcxLabel; cxLabel29: TcxLabel; cxLabel30: TcxLabel; cxLabel31: TcxLabel; cxLabel32: TcxLabel; cxLabel33: TcxLabel; cxLabel34: TcxLabel; cxLabel35: TcxLabel; cxLabel36: TcxLabel; cxLabel49: TcxLabel; cxLabel50: TcxLabel; cxLabel51: TcxLabel; cxLabel52: TcxLabel; cxLabel53: TcxLabel; cxLabel54: TcxLabel; cxLabel66: TcxLabel; cxLabel67: TcxLabel; cxLabel68: TcxLabel; cxLabel69: TcxLabel; cxLabel70: TcxLabel; cxLabel71: TcxLabel; cxLabel72: TcxLabel; cxLabel73: TcxLabel; cxLabel74: TcxLabel; cxLabel75: TcxLabel; cxLabel76: TcxLabel; cxLabel77: TcxLabel; cxLabel78: TcxLabel; cxLabel79: TcxLabel; cxLabel80: TcxLabel; cxLabel81: TcxLabel; fp_OutFanSpeedDQ: TcxTextEdit; fp_WidthAmplitudeDQ: TcxTextEdit; fp_RosePowerDQ: TcxTextEdit; fp_BrushSuperRateDQ: TcxTextEdit; fp_UpSuperRateDQ: TcxTextEdit; fp_speedDQ: TcxTextEdit; fp_TubePressDQ: TcxTextEdit; fp_CycleFanSpeedDQ: TcxTextEdit; fp_DownSuperRateDQ: TcxTextEdit; fp_LeftHeightDQ: TcxTextEdit; fp_RightHeightDQ: TcxTextEdit; fp_PumbMixElectricFrequency: TcxTextEdit; fp_SystemPress: TcxTextEdit; fp_MixElectricFrequency: TcxTextEdit; fp_GasFlow: TcxTextEdit; Panel6: TPanel; cxLabel116: TcxLabel; cxLabel117: TcxLabel; cxLabel118: TcxLabel; cxLabel119: TcxLabel; cxLabel120: TcxLabel; cxLabel121: TcxLabel; cxLabel122: TcxLabel; cxLabel123: TcxLabel; cxLabel124: TcxLabel; cxLabel125: TcxLabel; cxLabel126: TcxLabel; cxLabel127: TcxLabel; cxLabel128: TcxLabel; cxLabel129: TcxLabel; cxLabel130: TcxLabel; cxLabel131: TcxLabel; cxLabel132: TcxLabel; cxLabel133: TcxLabel; cxLabel134: TcxLabel; cxLabel135: TcxLabel; cxLabel136: TcxLabel; cxLabel137: TcxLabel; cxLabel138: TcxLabel; cxLabel139: TcxLabel; cxLabel140: TcxLabel; cxLabel141: TcxLabel; cxLabel142: TcxLabel; cxLabel143: TcxLabel; gj_WidthAmplitudeDQ: TcxTextEdit; gj_RosePowerDQ: TcxTextEdit; gj_BrushSuperRateDQ: TcxTextEdit; gj_UpSuperRateDQ: TcxTextEdit; gj_speedDQ: TcxTextEdit; gj_TubePressDQ: TcxTextEdit; gj_CycleFanSpeedDQ: TcxTextEdit; gj_DownSuperRateDQ: TcxTextEdit; gj_LeftHeightDQ: TcxTextEdit; gj_RightHeightDQ: TcxTextEdit; gj_OutFanSpeedDQ: TcxTextEdit; cxtabsheet7: TcxTabSheet; panel7: TPanel; cxLabel115: TcxLabel; cxLabel144: TcxLabel; cxLabel145: TcxLabel; cxLabel146: TcxLabel; cxLabel147: TcxLabel; cxLabel154: TcxLabel; cxLabel155: TcxLabel; cxLabel156: TcxLabel; zm_inoutSpeedDQ: TcxTextEdit; zm_needleDQ: TcxTextEdit; zm_PrecautionsDQ: TcxTextEdit; zm_frequencyDQ: TcxTextEdit; zm_WidthAmplitudeDQ: TcxTextEdit; cxLabel148: TcxLabel; qx_Add_NumberDQ: TcxTextEdit; cxLabel149: TcxLabel; GPM_2: TcxGridPopupMenu; DS_2: TDataSource; cds_2: TClientDataSet; GPM_3: TcxGridPopupMenu; DS_3: TDataSource; CDS_3: TClientDataSet; Tv3Column1: TcxGridDBColumn; Tv1Column1: TcxGridDBColumn; Tv2Column1: TcxGridDBColumn; cxGridPopupMenu1: TcxGridPopupMenu; dx_RollMethod: TcxComboBox; fs_UnpackingMethodDQ: TcxComboBox; fs_OpenAmplitudeDQ: TcxComboBox; fs_RollMethodDQ: TcxComboBox; zm_UnpackingMethodDQ: TcxComboBox; zm_RollMethodDQ: TcxComboBox; cxLabel151: TcxLabel; cxLabel152: TcxLabel; cxLabel153: TcxLabel; cxLabel157: TcxLabel; cxLabel158: TcxLabel; fs_meterDQ: TcxTextEdit; fs_useGlubDQ: TcxTextEdit; fs_waterDistributionDQ: TcxTextEdit; fs_useOneGlubDQ: TcxTextEdit; fs_useOneMeterDQ: TcxTextEdit; cxLabel159: TcxLabel; fp_useOneMeterDQ: TcxTextEdit; cxLabel160: TcxLabel; fp_useOneGlubDQ: TcxTextEdit; cxLabel161: TcxLabel; gj_useOneMeterDQ: TcxTextEdit; cxLabel162: TcxLabel; gj_useOneGlubDQ: TcxTextEdit; qx_UnpackingMethodDQ: TcxComboBox; qx_RollMethodDQ: TcxComboBox; zm_wagClothDQ: TcxTextEdit; fp_RollMethodDQ: TcxComboBox; fp_UnpackingMethodDQ: TcxComboBox; gj_RollMethodDQ: TcxComboBox; gj_UnpackingMethodDQ: TcxComboBox; fp_OpenAmplitudeDQ: TcxComboBox; gj_OpenAmplitudeDQ: TcxComboBox; ToolBar3: TToolBar; TbAdd2: TToolButton; TbDel2: TToolButton; ToolBar4: TToolBar; TbAdd1: TToolButton; TbDel1: TToolButton; ToolBar5: TToolBar; TbAdd3: TToolButton; TbDel3: TToolButton; TbDXReplace2: TcxButton; TbDXClear2: TcxButton; Panel1: TPanel; PSName: TcxTextEdit; cxLabel43: TcxLabel; CDS_HZ: TClientDataSet; DS_HZ: TDataSource; Label5: TLabel; WorkHour: TEdit; Label2: TLabel; MachineName: TEdit; Label1: TLabel; note: TEdit; CCQX: TcxTabSheet; RGQX: TcxTabSheet; cxLabel174: TcxLabel; dx_tubeTemper: TcxTextEdit; cxLabel1: TcxLabel; cxLabel28: TcxLabel; cxLabel59: TcxLabel; cxLabel175: TcxLabel; cxLabel176: TcxLabel; cxLabel177: TcxLabel; cxLabel178: TcxLabel; cxLabel179: TcxLabel; cxLabel180: TcxLabel; cxLabel181: TcxLabel; cxLabel182: TcxLabel; dx_hotWind1: TcxTextEdit; dx_hotWind5: TcxTextEdit; dx_hotWind9: TcxTextEdit; dx_hotWind6: TcxTextEdit; dx_hotWind3: TcxTextEdit; dx_hotWind4: TcxTextEdit; dx_hotWind7: TcxTextEdit; dx_hotWind8: TcxTextEdit; dx_hotWind10: TcxTextEdit; dx_hotWind2: TcxTextEdit; TbDXReplace1: TcxButton; TbDXClear1: TcxButton; cxLabel183: TcxLabel; cxLabel184: TcxLabel; cxLabel185: TcxLabel; cxLabel186: TcxLabel; cxLabel187: TcxLabel; dx_rowWind1: TcxTextEdit; dx_rowWind3: TcxTextEdit; dx_rowWind4: TcxTextEdit; dx_rowWind2: TcxTextEdit; cxLabel188: TcxLabel; dx_hotWind11: TcxTextEdit; cxLabel189: TcxLabel; dx_temperature11: TcxTextEdit; cxLabel190: TcxLabel; dx_WidthFinish: TcxTextEdit; FS: TcxTabSheet; FP: TcxTabSheet; GJ: TcxTabSheet; JGQX: TcxTabSheet; ZM: TcxTabSheet; Panel_FP: TPanel; TbFPReplace2: TcxButton; TbFPClear2: TcxButton; TbFPReplace1: TcxButton; TbFPClear1: TcxButton; cxLabel283: TcxLabel; cxLabel284: TcxLabel; cxLabel285: TcxLabel; cxLabel286: TcxLabel; cxLabel287: TcxLabel; cxLabel288: TcxLabel; cxLabel289: TcxLabel; cxLabel290: TcxLabel; cxLabel291: TcxLabel; cxLabel292: TcxLabel; cxLabel293: TcxLabel; cxLabel294: TcxLabel; cxLabel295: TcxLabel; cxLabel296: TcxLabel; cxLabel297: TcxLabel; cxLabel298: TcxLabel; cxLabel299: TcxLabel; cxLabel300: TcxLabel; cxLabel301: TcxLabel; cxLabel302: TcxLabel; cxLabel303: TcxLabel; cxLabel304: TcxLabel; cxLabel305: TcxLabel; cxLabel306: TcxLabel; cxLabel307: TcxLabel; cxLabel308: TcxLabel; cxLabel309: TcxLabel; cxLabel310: TcxLabel; cxLabel311: TcxLabel; cxLabel312: TcxLabel; cxLabel313: TcxLabel; cxLabel314: TcxLabel; cxLabel315: TcxLabel; cxLabel316: TcxLabel; cxLabel317: TcxLabel; cxLabel318: TcxLabel; cxLabel319: TcxLabel; cxLabel320: TcxLabel; cxLabel321: TcxLabel; cxLabel322: TcxLabel; cxLabel323: TcxLabel; cxLabel324: TcxLabel; cxLabel325: TcxLabel; cxLabel326: TcxLabel; cxLabel327: TcxLabel; cxLabel328: TcxLabel; cxLabel329: TcxLabel; cxLabel330: TcxLabel; cxLabel331: TcxLabel; cxLabel332: TcxLabel; fp_CarPress: TcxTextEdit; fp_DownSuperRate: TcxTextEdit; fp_fallCloth: TcxTextEdit; fp_hotWind1: TcxTextEdit; fp_hotWind10: TcxTextEdit; fp_hotWind11: TcxTextEdit; fp_hotWind2: TcxTextEdit; fp_hotWind3: TcxTextEdit; fp_hotWind4: TcxTextEdit; fp_hotWind5: TcxTextEdit; fp_hotWind6: TcxTextEdit; fp_hotWind7: TcxTextEdit; fp_hotWind8: TcxTextEdit; fp_hotWind9: TcxTextEdit; fp_leftGap: TcxTextEdit; fp_Precautions: TcxTextEdit; fp_rightGap: TcxTextEdit; fp_Rolling: TcxTextEdit; fp_RollMethod: TcxComboBox; fp_RosePower: TcxTextEdit; fp_rowWind1: TcxTextEdit; fp_rowWind2: TcxTextEdit; fp_rowWind3: TcxTextEdit; fp_rowWind4: TcxTextEdit; fp_speed: TcxTextEdit; fp_temperature1: TcxTextEdit; fp_temperature10: TcxTextEdit; fp_temperature11: TcxTextEdit; fp_temperature2: TcxTextEdit; fp_temperature3: TcxTextEdit; fp_temperature4: TcxTextEdit; fp_temperature5: TcxTextEdit; fp_temperature6: TcxTextEdit; fp_temperature7: TcxTextEdit; fp_temperature8: TcxTextEdit; fp_temperature9: TcxTextEdit; fp_TubePress: TcxTextEdit; fp_tubeTemper: TcxTextEdit; fp_upperNeedle: TcxTextEdit; fp_UpSuperRate: TcxTextEdit; fp_WidthAmplitude: TcxTextEdit; fp_WidthEnterCloth: TcxTextEdit; fp_WidthMiddle1: TcxTextEdit; fp_WidthMiddle2: TcxTextEdit; fp_WidthOutLet: TcxTextEdit; fp_WidthShape: TcxTextEdit; Panel_gj: TPanel; TbGJReplace2: TcxButton; TbGJClear2: TcxButton; TbGJReplace1: TcxButton; TbGjClear1: TcxButton; cxLabel233: TcxLabel; cxLabel234: TcxLabel; cxLabel235: TcxLabel; cxLabel236: TcxLabel; cxLabel237: TcxLabel; cxLabel238: TcxLabel; cxLabel239: TcxLabel; cxLabel240: TcxLabel; cxLabel241: TcxLabel; cxLabel242: TcxLabel; cxLabel243: TcxLabel; cxLabel244: TcxLabel; cxLabel245: TcxLabel; cxLabel246: TcxLabel; cxLabel247: TcxLabel; cxLabel248: TcxLabel; cxLabel249: TcxLabel; cxLabel250: TcxLabel; cxLabel251: TcxLabel; cxLabel252: TcxLabel; cxLabel253: TcxLabel; cxLabel254: TcxLabel; cxLabel255: TcxLabel; cxLabel256: TcxLabel; cxLabel257: TcxLabel; cxLabel258: TcxLabel; cxLabel259: TcxLabel; cxLabel260: TcxLabel; cxLabel261: TcxLabel; cxLabel262: TcxLabel; cxLabel263: TcxLabel; cxLabel264: TcxLabel; cxLabel265: TcxLabel; cxLabel266: TcxLabel; cxLabel267: TcxLabel; cxLabel268: TcxLabel; cxLabel269: TcxLabel; cxLabel270: TcxLabel; cxLabel271: TcxLabel; cxLabel272: TcxLabel; cxLabel273: TcxLabel; cxLabel274: TcxLabel; cxLabel275: TcxLabel; cxLabel276: TcxLabel; cxLabel277: TcxLabel; cxLabel278: TcxLabel; cxLabel279: TcxLabel; cxLabel280: TcxLabel; cxLabel281: TcxLabel; cxLabel282: TcxLabel; gj_CarPress: TcxTextEdit; gj_DownSuperRate: TcxTextEdit; gj_fallCloth: TcxTextEdit; gj_hotWind1: TcxTextEdit; gj_hotWind10: TcxTextEdit; gj_hotWind11: TcxTextEdit; gj_hotWind2: TcxTextEdit; gj_hotWind3: TcxTextEdit; gj_hotWind4: TcxTextEdit; gj_hotWind5: TcxTextEdit; gj_hotWind6: TcxTextEdit; gj_hotWind7: TcxTextEdit; gj_hotWind8: TcxTextEdit; gj_hotWind9: TcxTextEdit; gj_leftGap: TcxTextEdit; gj_Precautions: TcxTextEdit; gj_rightGap: TcxTextEdit; gj_Rolling: TcxTextEdit; gj_RollMethod: TcxComboBox; gj_RosePower: TcxTextEdit; gj_rowWind1: TcxTextEdit; gj_rowWind2: TcxTextEdit; gj_rowWind3: TcxTextEdit; gj_rowWind4: TcxTextEdit; gj_speed: TcxTextEdit; gj_temperature1: TcxTextEdit; gj_temperature10: TcxTextEdit; gj_temperature11: TcxTextEdit; gj_temperature2: TcxTextEdit; gj_temperature3: TcxTextEdit; gj_temperature4: TcxTextEdit; gj_temperature5: TcxTextEdit; gj_temperature6: TcxTextEdit; gj_temperature7: TcxTextEdit; gj_temperature8: TcxTextEdit; gj_temperature9: TcxTextEdit; gj_TubePress: TcxTextEdit; gj_tubeTemper: TcxTextEdit; gj_upperNeedle: TcxTextEdit; gj_UpSuperRate: TcxTextEdit; gj_WidthAmplitude: TcxTextEdit; gj_WidthEnterCloth: TcxTextEdit; gj_WidthMiddle1: TcxTextEdit; gj_WidthMiddle2: TcxTextEdit; gj_WidthOutLet: TcxTextEdit; gj_WidthShape: TcxTextEdit; Panel_fs: TPanel; TbFSReplace1: TcxButton; TbFSClear1: TcxButton; TbFSReplace2: TcxButton; TBFScLEAR2: TcxButton; cxLabel191: TcxLabel; cxLabel192: TcxLabel; cxLabel193: TcxLabel; cxLabel194: TcxLabel; cxLabel195: TcxLabel; cxLabel196: TcxLabel; cxLabel197: TcxLabel; cxLabel198: TcxLabel; cxLabel199: TcxLabel; cxLabel200: TcxLabel; cxLabel201: TcxLabel; cxLabel202: TcxLabel; cxLabel203: TcxLabel; cxLabel204: TcxLabel; cxLabel205: TcxLabel; cxLabel206: TcxLabel; cxLabel207: TcxLabel; cxLabel208: TcxLabel; cxLabel209: TcxLabel; cxLabel210: TcxLabel; cxLabel211: TcxLabel; cxLabel212: TcxLabel; cxLabel213: TcxLabel; cxLabel214: TcxLabel; cxLabel215: TcxLabel; cxLabel216: TcxLabel; cxLabel217: TcxLabel; cxLabel218: TcxLabel; cxLabel219: TcxLabel; cxLabel220: TcxLabel; cxLabel221: TcxLabel; cxLabel222: TcxLabel; cxLabel223: TcxLabel; cxLabel224: TcxLabel; cxLabel225: TcxLabel; cxLabel226: TcxLabel; cxLabel227: TcxLabel; cxLabel228: TcxLabel; cxLabel229: TcxLabel; cxLabel230: TcxLabel; cxLabel231: TcxLabel; cxLabel232: TcxLabel; cxLabel333: TcxLabel; fs_CarPress: TcxTextEdit; fs_DownSuperRate: TcxTextEdit; fs_gram: TcxTextEdit; fs_hotWind1: TcxTextEdit; fs_hotWind10: TcxTextEdit; fs_hotWind11: TcxTextEdit; fs_hotWind2: TcxTextEdit; fs_hotWind3: TcxTextEdit; fs_hotWind4: TcxTextEdit; fs_hotWind5: TcxTextEdit; fs_hotWind6: TcxTextEdit; fs_hotWind7: TcxTextEdit; fs_hotWind8: TcxTextEdit; fs_hotWind9: TcxTextEdit; fs_Precautions: TcxTextEdit; fs_RollMethod: TcxComboBox; fs_RosePower: TcxTextEdit; fs_rowWind1: TcxTextEdit; fs_rowWind2: TcxTextEdit; fs_rowWind3: TcxTextEdit; fs_rowWind4: TcxTextEdit; fs_speed: TcxTextEdit; fs_temperature1: TcxTextEdit; fs_temperature10: TcxTextEdit; fs_temperature11: TcxTextEdit; fs_temperature2: TcxTextEdit; fs_temperature3: TcxTextEdit; fs_temperature4: TcxTextEdit; fs_temperature5: TcxTextEdit; fs_temperature6: TcxTextEdit; fs_temperature7: TcxTextEdit; fs_temperature8: TcxTextEdit; fs_temperature9: TcxTextEdit; fs_TubePress: TcxTextEdit; fs_tubeTemper: TcxTextEdit; fs_upperNeedle: TcxTextEdit; fs_UpSuperRate: TcxTextEdit; fs_WidthAmplitude: TcxTextEdit; fs_WidthFinish: TcxTextEdit; Panel_jgqx: TPanel; cxLabel340: TcxLabel; cxLabel341: TcxLabel; cxLabel343: TcxLabel; cxLabel346: TcxLabel; cxLabel347: TcxLabel; cxLabel348: TcxLabel; cxLabel350: TcxLabel; cxLabel351: TcxLabel; jgqx_keepTemper: TcxTextEdit; jgqx_keepTime: TcxTextEdit; jgqx_note: TcxTextEdit; jgqx_reagentRatio: TcxTextEdit; jgqx_reagentUse: TcxTextEdit; jgqx_water: TcxTextEdit; jgqx_WidthAmplitude: TcxTextEdit; Panel_rgqx: TPanel; cxLabel114: TcxLabel; cxLabel150: TcxLabel; cxLabel163: TcxLabel; cxLabel164: TcxLabel; cxLabel165: TcxLabel; cxLabel166: TcxLabel; rgqx_daoSet: TcxTextEdit; rgqx_note: TcxTextEdit; rgqx_speed: TcxTextEdit; rgqx_waterTemper: TcxTextEdit; rgqx_WidthAmplitude: TcxTextEdit; Panel_zm: TPanel; cxLabel335: TcxLabel; cxLabel336: TcxLabel; cxLabel337: TcxLabel; cxLabel339: TcxLabel; cxLabel342: TcxLabel; cxLabel344: TcxLabel; cxLabel345: TcxLabel; zm_inout: TcxTextEdit; zm_mainElec: TcxTextEdit; zm_needleHigh: TcxTextEdit; zm_Precautions: TcxTextEdit; zm_style: TcxComboBox; zm_WidthAmplitude: TcxTextEdit; Panel_ccqx: TPanel; ccqx_note: TcxTextEdit; ccqx_speed: TcxTextEdit; ccqx_temperature1: TcxTextEdit; ccqx_temperature2: TcxTextEdit; ccqx_temperature3: TcxTextEdit; ccqx_temperature4: TcxTextEdit; ccqx_temperature5: TcxTextEdit; ccqx_temperature6: TcxTextEdit; ccqx_WidthAmplitude: TcxTextEdit; TbCCQXReplace: TcxButton; TbccqxClear: TcxButton; cxLabel113: TcxLabel; cxLabel38: TcxLabel; cxLabel39: TcxLabel; cxLabel40: TcxLabel; cxLabel41: TcxLabel; cxLabel42: TcxLabel; cxLabel44: TcxLabel; cxLabel45: TcxLabel; cxLabel46: TcxLabel; cxLabel47: TcxLabel; cxLabel48: TcxLabel; cxLabel37: TcxLabel; cxLabel167: TcxLabel; cxLabel168: TcxLabel; cxLabel169: TcxLabel; cxLabel170: TcxLabel; cxLabel171: TcxLabel; cxLabel172: TcxLabel; jgqx_leftMouthPress: TcxTextEdit; jgqx_rightMouthPress: TcxTextEdit; jgqx_mainGangPress: TcxTextEdit; jgqx_mainBengSpeed: TcxTextEdit; jgqx_rightWheelSpeed: TcxTextEdit; jgqx_leftWheelSpeed: TcxTextEdit; cxLabel173: TcxLabel; cxLabel334: TcxLabel; jgqx_upperSpeed: TcxTextEdit; jgqx_downSpeed: TcxTextEdit; cxLabel338: TcxLabel; jgqx_bathRatio: TcxTextEdit; cxLabel349: TcxLabel; dx_WidthOutLet: TcxTextEdit; cxLabel26: TcxLabel; cxLabel352: TcxLabel; FS_Style: TcxComboBox; cxLabel353: TcxLabel; fs_WidthOutLet: TcxTextEdit; cxLabel354: TcxLabel; fs_isVacuun: TcxComboBox; procedure FormShow(Sender: TObject); procedure TBCloseClick(Sender: TObject); procedure TbSaveClick(Sender: TObject); procedure CYColorKeyPress(Sender: TObject; var Key: Char); procedure CYJGGYBtnDnClick(Sender: TObject); procedure C_WidthBtnDnClick(Sender: TObject); procedure C_WidthBtnUpClick(Sender: TObject); procedure SetXH(); procedure Tv11fs_unitPropertiesEditValueChanged(Sender: TObject); procedure Tv2fp_unitPropertiesEditValueChanged(Sender: TObject); procedure Tv3gj_unitPropertiesEditValueChanged(Sender: TObject); procedure fs_meterPropertiesChange(Sender: TObject); procedure TbAdd2Click(Sender: TObject); procedure TbDel2Click(Sender: TObject); procedure Tv2fp_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure TbAdd1Click(Sender: TObject); procedure TbDel1Click(Sender: TObject); procedure TbAdd3Click(Sender: TObject); procedure TbDel3Click(Sender: TObject); procedure Tv11fs_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure Tv3gj_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure TbCPReplaceClick(Sender: TObject); procedure TbDXReplace2Click(Sender: TObject); procedure TbFSReplace2Click(Sender: TObject); procedure TbFPReplaceClick(Sender: TObject); procedure TbGJReplaceClick(Sender: TObject); procedure cxButton1Click(Sender: TObject); procedure cxButton2Click(Sender: TObject); procedure TbDXClear2Click(Sender: TObject); procedure cxButton4Click(Sender: TObject); procedure TbGJClearClick(Sender: TObject); procedure TBFScLEAR2Click(Sender: TObject); procedure TbCCQXReplaceClick(Sender: TObject); procedure TbccqxClearClick(Sender: TObject); procedure TbDXReplace1Click(Sender: TObject); procedure TbDXClear1Click(Sender: TObject); procedure TbFSReplace1Click(Sender: TObject); procedure TbFSClear1Click(Sender: TObject); procedure TbGJReplace1Click(Sender: TObject); procedure TbGJReplace2Click(Sender: TObject); procedure TbGjClear1Click(Sender: TObject); procedure TbGJClear2Click(Sender: TObject); procedure TbFPReplace1Click(Sender: TObject); procedure TbFPReplace2Click(Sender: TObject); procedure TbFPClear1Click(Sender: TObject); procedure TbFPClear2Click(Sender: TObject); private canshu1: string; Fint: Integer; procedure InitGrid(); procedure ArrangeTabsByDataset; function SaveData(): Boolean; function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string; procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil); function CheckData(): Boolean; { Private declarations } public BtnInt: Integer; FPSType: string; FPSID: string; { Public declarations } end; var frmDyeProcessDefin: TfrmDyeProcessDefin; implementation uses U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload, U_ClothInfoSel, U_DyeProcessList, U_ProductInfoSel; // U_ProductInfoSel; {$R *.dfm} procedure TfrmDyeProcessDefin.SetXH(); var i: Integer; begin // with CDS_GX do // begin // First; // i := 1; // while not Eof do // begin // with CDS_GX do // begin // Edit; // FieldByName('XHNoTemp').Value := i; // Post; // end; // i := i + 1; // Next; // end; // end; // // with CDS_GX do // begin // CDS_GX.IndexFieldNames := ''; // First; // i := 1; // while not Eof do // begin // with CDS_GX do // begin // Edit; // FieldByName('SerialNo').Value := FieldByName('XHNoTemp').AsInteger; // Post; // end; // i := i + 1; // Next; // end; // CDS_GX.IndexFieldNames := 'SerialNo'; // end; end; procedure TfrmDyeProcessDefin.ArrangeTabsByDataset; var I: Integer; TabSheet: TcxTabSheet; CurrentIndex: Integer; begin // 初始化隐藏所有其他页面 for I := 0 to cxPageControl1.PageCount - 1 do cxPageControl1.Pages[I].TabVisible := False; // 设置当前索引 CurrentIndex := 0; // 根据工序名查找对应的页面 for I := 0 to cxPageControl1.PageCount - 1 do begin TabSheet := cxPageControl1.Pages[I] as TcxTabSheet; // 匹配工序名 if (Trim(TabSheet.Caption) = FPSType) then begin TabSheet.PageIndex := CurrentIndex; TabSheet.TabVisible := True; Inc(CurrentIndex); Break; end; end; // 刷新页面控件 cxPageControl1.Invalidate; end; procedure TfrmDyeProcessDefin.InitGrid(); var i: integer; begin with ADOQueryTemp do begin Close; sql.Clear; sql.Add('select A.* from Bs_Cloth_GY_sub A '); sql.Add(' where gytype=''下水定型'' and A.PSID=''' + Trim(FPSID) + ''''); Open; end; SCreateCDS(ADOQueryTemp, CDS_1); SInitCDSData(ADOQueryTemp, CDS_1); with ADOQueryTemp do begin Close; sql.Clear; sql.Add('select A.* from Bs_Cloth_GY_sub A '); sql.Add(' where gytype=''下水定型'' and A.PSID=''' + Trim(FPSID) + ''''); Open; end; SCreateCDS(ADOQueryTemp, CDS_2); SInitCDSData(ADOQueryTemp, CDS_2); with ADOQueryTemp do begin Close; sql.Clear; sql.Add('select A.* from Bs_Cloth_GY_sub A '); sql.Add(' where gytype=''刮胶'' and A.PSID=''' + Trim(FPSID) + ''''); Open; end; SCreateCDS(ADOQueryTemp, CDS_3); SInitCDSData(ADOQueryTemp, CDS_3); // C_FromName.TxtCode := Trim(ADOQueryTemp.fieldbyname('FromBCIID').AsString); // C_FromName.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName').AsString); end; procedure TfrmDyeProcessDefin.FormShow(Sender: TObject); var MaxPSID, MaxProcessID, MaxBCPID: string; Maxid1, maxid2, maxid3, maxgx: string; begin InitGrid(); ArrangeTabsByDataset; if BtnInt = 0 then //新增 begin FPSID := ''; end; if (BtnInt = 1) or (BtnInt = 3) then //修改 begin with ADOQueryTemp do begin Close; SQL.Clear; SQL.Add('select * from Dye_Process where PSID=''' + Trim(FPSID) + ''''); Open; end; SCSHData(ADOQueryTemp, Panel1, 2); with ADOQueryTemp do begin Close; SQL.Clear; SQL.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(FPSID) + ''''); Open; end; if FPSType = '长车清洗' then begin SCSHData(ADOQueryTemp, Panel_ccqx, 2); end else if FPSType = '卷染缸清洗' then begin SCSHData(ADOQueryTemp, Panel_rgqx, 2); end else if FPSType = '机缸清洗' then begin SCSHData(ADOQueryTemp, Panel_jgqx, 2); end else if FPSType = '干定型' then begin SCSHData(ADOQueryTemp, Panel_dx, 2); end else if FPSType = '下水定型' then begin SCSHData(ADOQueryTemp, Panel_fs, 2); end else if FPSType = '发泡' then begin SCSHData(ADOQueryTemp, Panel_fp, 2); end else if FPSType = '刮胶' then begin SCSHData(ADOQueryTemp, Panel_gj, 2); end else if FPSType = '轧毛' then begin SCSHData(ADOQueryTemp, Panel_zm, 2); end; end; if BtnInt = 2 then //复制 begin with ADOQueryTemp do begin Close; SQL.Clear; SQL.Add('select * from Dye_Process where PSID=''' + Trim(FPSID) + ''''); Open; end; SCSHData(ADOQueryTemp, Panel1, 2); with ADOQueryTemp do begin Close; SQL.Clear; SQL.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(FPSID) + ''''); Open; end; if FPSType = '长车清洗' then begin SCSHData(ADOQueryTemp, Panel_ccqx, 2); end else if FPSType = '卷染缸清洗' then begin SCSHData(ADOQueryTemp, Panel_rgqx, 2); end else if FPSType = '机缸清洗' then begin SCSHData(ADOQueryTemp, Panel_jgqx, 2); end else if FPSType = '干定型' then begin SCSHData(ADOQueryTemp, Panel_dx, 2); end else if FPSType = '防水' then begin SCSHData(ADOQueryTemp, Panel_fs, 2); // with CDS_1 do // begin // First; // while not Eof do // begin // Edit; // CDS_1.fieldbyname('BCPID').AsString := ''; // Post; // Next; // end; // end; end else if FPSType = '发泡' then begin SCSHData(ADOQueryTemp, Panel_fp, 2); // with CDS_2 do // begin // First; // while not Eof do // begin // Edit; // CDS_2.fieldbyname('BCPID').AsString := ''; // Post; // Next; // end; // end; end else if FPSType = '刮胶' then begin SCSHData(ADOQueryTemp, Panel_gj, 2); // with CDS_3 do // begin // First; // while not Eof do // begin // Edit; // CDS_3.fieldbyname('BCPID').AsString := ''; // Post; // Next; // end; // end; end else if FPSType = '轧毛' then begin SCSHData(ADOQueryTemp, Panel_zm, 2); end; end; if BtnInt = 3 then //查看 begin TbSave.Visible := False; TbUpFile.Visible := False; end; end; procedure TfrmDyeProcessDefin.fs_meterPropertiesChange(Sender: TObject); var mfs_meter, mfs_useOneMeter, mfs_useGlub: Double; begin if fs_meterDQ.Text <> '' then begin mfs_meter := StrToFloat(fs_meterDQ.Text); end else begin fs_meterDQ.Text := '0'; mfs_meter := 0; end; if fs_useOneMeterDQ.Text <> '' then begin mfs_useOneMeter := StrToFloat(fs_useOneMeterDQ.Text); end else begin fs_useOneMeterDQ.Text := '0'; mfs_useOneMeter := 0; end; ///计算部分 mfs_useGlub := mfs_meter * mfs_useOneMeter / 1000; fs_useGlubDQ.Text := FloatToStr(mfs_useGlub); end; procedure TfrmDyeProcessDefin.TBCloseClick(Sender: TObject); begin Close; end; function TfrmDyeProcessDefin.CheckData(): Boolean; begin if Trim(PSName.Text) = '' then begin Application.MessageBox('工序名称不能为空!', '提示信息', MB_OK); Result := False; Exit; end; with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Dye_Process where PSName=''' + trim(PSName.Text) + ''''); Open; end; if ADOQueryCmd.RecordCount > 1 then begin application.MessageBox(PChar('工序名称' + trim(PSName.text) + '已存在'), '提示'); Result := false; Exit; end; Result := True; end; function TfrmDyeProcessDefin.SaveData(): Boolean; var MaxProcessID, MaxBCPID, MaxPSID: string; maxid1, maxid2, maxid3, maxgx, maxId: string; begin try ADOQueryCmd.Connection.BeginTrans; ///////////////////////////保存主表Dye_process//////////////////////////// with ADOQueryCmd do begin Filtered := False; Close; SQL.Clear; sql.Add(' select * from Dye_Process where PSID=''' + Trim(FPSID) + ''''); Open; end; with ADOQueryCmd do begin if Trim(fieldbyname('PSID').AsString) = '' then begin if GetLSNo(ADOQueryCmd, maxId, 'JP', 'Dye_Process', 4, 1) = False then begin Result := False; ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('取最大号失败!', '提示', 0); Exit; end; end else begin maxId := Trim(FPSID); end; with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Dye_Process where PSID=''' + Trim(maxId) + ''''); Open; end; with ADOQueryCmd do begin if Trim(FPSID) = '' then begin Append; FieldByName('Filler').Value := Trim(DName); end else begin Edit; FieldByName('Editer').Value := Trim(DName); FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp); end; RTSetsavedata(ADOQueryCmd, 'Dye_Process', panel1, 2); FieldByName('PSID').Value := Trim(maxId); FieldByName('PSType').Value := Trim(FPSType); Post; end; end; ///////////////////保存主表Dye_process//////////////////////////// //////////////// 保存主表 ////////////////////// with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(maxId) + ''''); Open; end; with ADOQueryCmd do begin if Trim(FPSID) = '' then begin Append; end else begin Edit; end; FieldByName('PSID').Value := Trim(maxId); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_zm, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_ccqx, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_rgqx, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_jgqx, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_dx, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fs, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_gj, 2); RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fp, 2); Post; end; //////////////// 保存主表 ////////////////////// /// /// ////////////////// 保存防水子表 ////////////////////// with CDS_1 do begin First; while not Eof do begin if Trim(CDS_1.fieldbyname('BCPID').AsString) = '' then begin if GetLSNo(ADOQueryTemp, maxid1, 'FS', 'Bs_Cloth_GY_Sub', 5, 1) = False then begin ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('取配比子流水号失败!', '提示', 0); Exit; end; end else begin maxid1 := Trim(CDS_1.fieldbyname('BCPID').AsString); end; with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Bs_Cloth_GY_Sub where '); sql.Add(' BCPID=''' + Trim(maxid1) + ''''); Open; end; with ADOQueryCmd do begin if Trim(CDS_1.fieldbyname('BCPID').AsString) = '' then begin Append; end else begin Edit; end; FieldByName('GYType').Value := '下水定型'; FieldByName('PSID').Value := Trim(maxId); FieldByName('BCPID').Value := Trim(maxid1); RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'Bs_Cloth_GY_Sub', 0); Post; end; CDS_1.Edit; CDS_1.FieldByName('PSID').Value := Trim(maxId); CDS_1.FieldByName('BCPID').Value := Trim(maxid1); Next; end; end; //////////////// 保存子表 ////////////////////// ////////////////// 保存发泡子表 ////////////////////// with CDS_2 do begin First; while not Eof do begin if Trim(CDS_2.fieldbyname('BCPID').AsString) = '' then begin if GetLSNo(ADOQueryTemp, maxid2, 'FP', 'Bs_Cloth_GY_Sub', 5, 1) = False then begin ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('取配比子流水号失败!', '提示', 0); Exit; end; end else begin maxid2 := Trim(CDS_2.fieldbyname('BCPID').AsString); end; with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Bs_Cloth_GY_Sub where '); sql.Add(' BCPID=''' + Trim(maxid2) + ''''); Open; end; with ADOQueryCmd do begin if Trim(CDS_2.fieldbyname('BCPID').AsString) = '' then begin Append; end else begin Edit; end; FieldByName('GYType').Value := '发泡'; FieldByName('PSID').Value := Trim(maxId); FieldByName('PSID').Value := Trim(maxid2); RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_2, 'Bs_Cloth_GY_Sub', 0); Post; end; CDS_2.Edit; CDS_2.FieldByName('PSID').Value := Trim(maxId); CDS_2.FieldByName('PSID').Value := Trim(maxid2); Next; end; end; //////////////// 保存发泡子表 ////////////////////// /// /// ////////////////// 保存刮胶子表 ////////////////////// with CDS_3 do begin First; while not Eof do begin if Trim(CDS_3.fieldbyname('BCPID').AsString) = '' then begin if GetLSNo(ADOQueryTemp, maxid3, 'GJ', 'Bs_Cloth_GY_Sub', 5, 1) = False then begin ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('取配比子流水号失败!', '提示', 0); Exit; end; end else begin maxid3 := Trim(CDS_3.fieldbyname('BCPID').AsString); end; with ADOQueryCmd do begin Close; SQL.Clear; sql.Add('select * from Bs_Cloth_GY_Sub where '); sql.Add('BCPID=''' + Trim(maxid3) + ''''); Open; end; with ADOQueryCmd do begin if Trim(CDS_3.fieldbyname('BCPID').AsString) = '' then begin Append; end else begin Edit; end; FieldByName('GYType').Value := '刮胶'; FieldByName('PSID').Value := Trim(maxId); FieldByName('PSID').Value := Trim(maxid3); RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Bs_Cloth_GY_Sub', 0); Post; end; CDS_3.Edit; CDS_3.FieldByName('PSID').Value := Trim(maxId); CDS_3.FieldByName('PSID').Value := Trim(maxid3); Next; end; end; //////////////// 保存刮胶子表 ////////////////////// /// /// ADOQueryCmd.Connection.CommitTrans; FPSID := maxId; Result := True; except Result := False; ADOQueryCmd.Connection.RollbackTrans; Application.MessageBox('保存失败!', '提示', 0); end; end; procedure TfrmDyeProcessDefin.CYJGGYBtnDnClick(Sender: TObject); begin TBtnEditC(Sender).Text := ''; end; procedure TfrmDyeProcessDefin.TbSaveClick(Sender: TObject); var MC_Code: string; begin if CheckData() and SaveData() then begin Application.MessageBox('保存成功!', '提示', 0); ModalResult := 1; end; end; procedure TfrmDyeProcessDefin.TbDXReplace1Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_dx, '干定型热风', FindLastEditedTextEdit(panel_dx, '干定型热风')); end; procedure TfrmDyeProcessDefin.TbDXReplace2Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_dx, '干定型温控', FindLastEditedTextEdit(panel_dx, '干定型温控')); end; procedure TfrmDyeProcessDefin.TbFPClear1Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_Fp, '发泡热风'); end; procedure TfrmDyeProcessDefin.TbFPClear2Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_Fp, '发泡温控'); end; procedure TfrmDyeProcessDefin.TbFPReplace1Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_fp, '发泡热风', FindLastEditedTextEdit(panel_fp, '发泡热风')); end; procedure TfrmDyeProcessDefin.TbFPReplace2Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_fp, '发泡温控', FindLastEditedTextEdit(panel_fp, '发泡温控')); end; procedure TfrmDyeProcessDefin.TbFPReplaceClick(Sender: TObject); begin FillAllTextEditsWithValue(panel5, '发泡烘箱温度', FindLastEditedTextEdit(panel5, '发泡烘箱温度')); end; procedure TfrmDyeProcessDefin.TbFSClear1Click(Sender: TObject); begin ClearAllTextEditsByHint(Panel_fs, '防水热风'); end; procedure TfrmDyeProcessDefin.TBFScLEAR2Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_FS, '防水温控'); end; procedure TfrmDyeProcessDefin.TbGJReplace1Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_gj, '刮胶热风', FindLastEditedTextEdit(Panel_gj, '刮胶热风')); end; procedure TfrmDyeProcessDefin.TbGJReplace2Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_gj, '刮胶温控', FindLastEditedTextEdit(panel_gj, '刮胶温控')); end; procedure TfrmDyeProcessDefin.TbGJReplaceClick(Sender: TObject); begin FillAllTextEditsWithValue(panel6, '刮胶烘箱温度', FindLastEditedTextEdit(panel6, '刮胶烘箱温度')); end; procedure TfrmDyeProcessDefin.TbAdd1Click(Sender: TObject); begin with CDS_1 do begin Append; CDS_1.FieldByName('serialno').Value := CDS_1.RecordCount + 1; CDS_1.FieldByName('fs_unit').Value := '%'; Post; end; end; procedure TfrmDyeProcessDefin.TbAdd2Click(Sender: TObject); begin with CDS_2 do begin Append; CDS_2.FieldByName('serialno').Value := CDS_2.RecordCount + 1; CDS_2.FieldByName('fp_unit').Value := '%'; Post; end; end; procedure TfrmDyeProcessDefin.TbAdd3Click(Sender: TObject); begin with CDS_3 do begin Append; CDS_3.FieldByName('serialno').Value := CDS_3.RecordCount + 1; CDS_3.FieldByName('gj_unit').Value := '%'; Post; end; end; procedure TfrmDyeProcessDefin.TbccqxClearClick(Sender: TObject); begin ClearAllTextEditsByHint(panel_ccqx, '长车清洗温控'); end; procedure TfrmDyeProcessDefin.TbDel1Click(Sender: TObject); var i: Integer; begin if not CDS_1.IsEmpty then begin if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then begin if Trim(CDS_1.fieldbyname('BCPID').AsString) <> '' then begin with ADOQueryCmd do begin Close; sql.Clear; sql.Add('delete BS_Cloth_GY_Sub where BCPID=''' + Trim(CDS_1.fieldbyname('BCPID').AsString)); ExecSQL; end; end; CDS_1.Delete; end else exit; i := 0; CDS_1.First; while not CDS_1.Eof do begin i := i + 1; CDS_1.Edit; CDS_1.fieldByName('serialno').value := i; CDS_1.Post; CDS_1.Next; end; end else begin Application.MessageBox('无可删除数据!', '提示', 0); Exit; end; end; procedure TfrmDyeProcessDefin.TbDel2Click(Sender: TObject); var i: Integer; begin if not CDS_3.IsEmpty then begin if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then begin if Trim(CDS_3.fieldbyname('BCPID').AsString) <> '' then begin with ADOQueryCmd do begin Close; sql.Clear; sql.Add('delete BS_Cloth_GY_Sub where BCPID=''' + Trim(CDS_3.fieldbyname('BCPID').AsString) + ''''); ExecSQL; end; end; CDS_3.Delete; end else exit; i := 0; CDS_3.First; while not CDS_3.Eof do begin i := i + 1; CDS_3.Edit; CDS_3.fieldByName('serialno').value := i; CDS_3.Post; CDS_3.Next; end; end else begin Application.MessageBox('无可删除数据!', '提示', 0); Exit; end; end; procedure TfrmDyeProcessDefin.TbDel3Click(Sender: TObject); var i: Integer; begin if not CDS_3.IsEmpty then begin if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) = IDYES then begin if Trim(CDS_3.fieldbyname('BCPID').AsString) <> '' then begin with ADOQueryCmd do begin Close; sql.Clear; sql.Add('delete BS_Cloth_GY_Sub where BCPID=''' + Trim(CDS_3.fieldbyname('BCPID').AsString) + ''''); ExecSQL; end; end; CDS_3.Delete; end else exit; i := 0; CDS_3.First; while not CDS_3.Eof do begin i := i + 1; CDS_3.Edit; CDS_3.fieldByName('serialno').value := i; CDS_3.Post; CDS_3.Next; end; end else begin Application.MessageBox('无可删除数据!', '提示', 0); Exit; end; end; procedure TfrmDyeProcessDefin.TbCPReplaceClick(Sender: TObject); begin FillAllTextEditsWithValue(panel2, '清洗水温', FindLastEditedTextEdit(panel2, '清洗水温')); end; function TfrmDyeProcessDefin.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string; var i, j: Integer; AControl: TControl; SortedControls: TList; TempControl: TControl; begin Result := ''; // 如果没有子控件,直接返回空 if AParent.ControlCount = 0 then Exit; // 使用 TList 存储控件(兼容旧版 Delphi) SortedControls := TList.Create; try // 将所有子控件添加到列表 for i := 0 to AParent.ControlCount - 1 do SortedControls.Add(AParent.Controls[i]); // 手动排序:按 Top(Y坐标)和 Left(X坐标)升序排列 for i := 0 to SortedControls.Count - 1 do begin for j := i + 1 to SortedControls.Count - 1 do begin // 比较两个控件的 Top 和 Left if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then begin // 交换位置 TempControl := TControl(SortedControls[i]); SortedControls[i] := SortedControls[j]; SortedControls[j] := TempControl; end; end; end; // 遍历排序后的控件 for i := 0 to SortedControls.Count - 1 do begin AControl := TControl(SortedControls[i]); if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then begin Result := TcxTextEdit(AControl).Text; // 最后一个符合条件的会被保留 end; end; finally SortedControls.Free; end; end; procedure TfrmDyeProcessDefin.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // 可选:排除特定控件 var i: Integer; AControl: TControl; ATextEdit: TcxTextEdit; begin for i := 0 to AParent.ControlCount - 1 do begin AControl := AParent.Controls[i]; if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then begin ATextEdit := AControl as TcxTextEdit; if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then ATextEdit.Text := AValue; end; end; end; procedure TfrmDyeProcessDefin.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil); var i: Integer; AControl: TControl; begin for i := 0 to AParent.ControlCount - 1 do begin AControl := AParent.Controls[i]; // 检查是否是 TcxTextEdit,并且 Hint 匹配,且不是排除的控件 if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then begin TcxTextEdit(AControl).Text := ''; // 直接清空 end; end; end; procedure TfrmDyeProcessDefin.cxButton1Click(Sender: TObject); begin ClearAllTextEditsByHint(panel4, '防水烘箱温度'); end; procedure TfrmDyeProcessDefin.cxButton2Click(Sender: TObject); begin ClearAllTextEditsByHint(panel2, '清洗水温'); end; procedure TfrmDyeProcessDefin.TbCCQXReplaceClick(Sender: TObject); begin FillAllTextEditsWithValue(panel_ccqx, '长车清洗温控', FindLastEditedTextEdit(panel_ccqx, '长车清洗温控')); end; procedure TfrmDyeProcessDefin.TbDXClear1Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_DX, '干定型热风'); end; procedure TfrmDyeProcessDefin.TbDXClear2Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_DX, '干定型温控'); end; procedure TfrmDyeProcessDefin.cxButton4Click(Sender: TObject); begin ClearAllTextEditsByHint(panel5, '发泡烘箱温度'); end; procedure TfrmDyeProcessDefin.TbGjClear1Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_gj, '刮胶热风'); end; procedure TfrmDyeProcessDefin.TbGJClear2Click(Sender: TObject); begin ClearAllTextEditsByHint(panel_gj, '刮胶温控'); end; procedure TfrmDyeProcessDefin.TbGJClearClick(Sender: TObject); begin ClearAllTextEditsByHint(panel6, '刮胶烘箱温度'); end; procedure TfrmDyeProcessDefin.TbFSReplace1Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_fs, '防水热风', FindLastEditedTextEdit(panel_fs, '防水热风')); end; procedure TfrmDyeProcessDefin.TbFSReplace2Click(Sender: TObject); begin FillAllTextEditsWithValue(panel_fs, '防水温控', FindLastEditedTextEdit(panel_fs, '防水温控')); end; procedure TfrmDyeProcessDefin.CYColorKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then begin Key := #0; SelectNext(ActiveControl as TWinControl, True, True); end; end; procedure TfrmDyeProcessDefin.C_WidthBtnDnClick(Sender: TObject); begin TBtnEditC(Sender).Text := ''; TBtnEditC(Sender).TxtCode := ''; end; procedure TfrmDyeProcessDefin.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 TfrmDyeProcessDefin.Tv11fs_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try frmProductInfoSel := TfrmProductInfoSel.Create(Application); with frmProductInfoSel do begin FSTKName := '助剂'; if ShowModal = 1 then begin with Self.CDS_1 do begin Edit; FieldByName('fs_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value; FieldByName('fs_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Spec').value; end; end; end; finally frmProductInfoSel.Free; end; end; procedure TfrmDyeProcessDefin.Tv11fs_unitPropertiesEditValueChanged(Sender: TObject); var s: string; begin s := TcxTextEdit(Sender).EditingText; if (s <> '') and (s[Length(s)] <> '%') then begin Tv1.Controller.FocusedColumn.EditValue := s + '%'; end; end; procedure TfrmDyeProcessDefin.Tv2fp_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try frmProductInfoSel := TfrmProductInfoSel.Create(Application); with frmProductInfoSel do begin FSTKName := '助剂'; if ShowModal = 1 then begin with Self.CDS_2 do begin Edit; FieldByName('fp_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value; FieldByName('fp_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Spec').value; end; end; end; finally frmProductInfoSel.Free; end; end; procedure TfrmDyeProcessDefin.Tv2fp_unitPropertiesEditValueChanged(Sender: TObject); var s: string; begin s := TcxTextEdit(Sender).EditingText; if (s <> '') and (s[Length(s)] <> '%') then begin Tv2.Controller.FocusedColumn.EditValue := s + '%'; end; end; procedure TfrmDyeProcessDefin.Tv3gj_NamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try frmProductInfoSel := TfrmProductInfoSel.Create(Application); with frmProductInfoSel do begin FSTKName := '助剂'; if ShowModal = 1 then begin with Self.CDS_3 do begin Edit; FieldByName('gj_Name').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Name').value; FieldByName('gj_spel').Value := frmProductInfoSel.CDS_1.fieldbyname('P_Spec').value; end; end; end; finally frmProductInfoSel.Free; end; end; procedure TfrmDyeProcessDefin.Tv3gj_unitPropertiesEditValueChanged(Sender: TObject); var s: string; begin s := TcxTextEdit(Sender).EditingText; if (s <> '') and (s[Length(s)] <> '%') then begin Tv3.Controller.FocusedColumn.EditValue := s + '%'; end; end; end.