diff --git a/云翔一码通/U_KuWeiList.dfm b/云翔一码通/U_KuWeiList.dfm new file mode 100644 index 0000000..7985259 --- /dev/null +++ b/云翔一码通/U_KuWeiList.dfm @@ -0,0 +1,404 @@ +object frmKuWeiList: TfrmKuWeiList + Left = 954 + Top = 178 + Width = 1215 + Height = 637 + Caption = #24211#20301#31649#29702 + Color = clBtnFace + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + OldCreateOrder = False + OnClose = FormClose + OnCreate = FormCreate + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 12 + object ToolBar1: TToolBar + Left = 0 + Top = 0 + Width = 1207 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 65 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_YXYMT.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 0 + OnClick = TBRafreshClick + end + object TbSelect: TToolButton + Left = 69 + Top = 0 + Caption = #36873#25321 + ImageIndex = 10 + OnClick = TbSelectClick + end + object TBFind: TToolButton + Left = 134 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 20 + OnClick = TBFindClick + end + object TBClose: TToolButton + Left = 203 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 21 + OnClick = TBCloseClick + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 80 + Width = 1207 + Height = 526 + Align = alClient + PopupMenu = PopupMenu1 + TabOrder = 1 + object Tv1: TcxGridDBTableView + OnDblClick = Tv1DblClick + Navigator.Buttons.CustomButtons = <> + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = < + item + Kind = skCount + Position = spFooter + Column = v1Column7 + end + item + Kind = skCount + Column = v1Column7 + end> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skCount + Column = v1Column7 + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + object v1Column1: TcxGridDBColumn + Caption = #21306#22495 + DataBinding.FieldName = 'QuYu' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 79 + end + object v1Column2: TcxGridDBColumn + Caption = #20998#21306 + DataBinding.FieldName = 'FenQu' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object v1Column3: TcxGridDBColumn + Caption = #25490 + DataBinding.FieldName = 'Pai' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 84 + end + object v1Column6: TcxGridDBColumn + Caption = #23618 + DataBinding.FieldName = 'Ceng' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 77 + end + object v1Column7: TcxGridDBColumn + Caption = #24211#20301#21517#31216 + DataBinding.FieldName = 'KWName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 195 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1207 + Height = 48 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 2 + object Label2: TLabel + Left = 19 + Top = 16 + Width = 32 + Height = 15 + Caption = #21306#22495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label1: TLabel + Left = 131 + Top = 16 + Width = 32 + Height = 15 + Caption = #20998#21306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 243 + Top = 16 + Width = 16 + Height = 15 + Caption = #25490 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 432 + Top = 16 + Width = 64 + Height = 15 + Caption = #24211#20301#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label7: TLabel + Left = 339 + Top = 16 + Width = 16 + Height = 15 + Caption = #23618 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object QuYu: TEdit + Tag = 2 + Left = 53 + Top = 12 + Width = 60 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 0 + OnChange = CustomerNoNameChange + end + object FenQu: TEdit + Tag = 2 + Left = 165 + Top = 12 + Width = 60 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 1 + OnChange = CustomerNoNameChange + end + object Pai: TEdit + Tag = 2 + Left = 261 + Top = 12 + Width = 60 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 2 + OnChange = CustomerNoNameChange + end + object KWName: TEdit + Tag = 2 + Left = 497 + Top = 12 + Width = 152 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 3 + OnChange = CustomerNoNameChange + end + object Ceng: TEdit + Tag = 2 + Left = 357 + Top = 12 + Width = 60 + Height = 24 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -15 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + TabOrder = 4 + OnChange = CustomerNoNameChange + end + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 160 + Top = 128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_YXYMT.ADOLink + Parameters = <> + Left = 208 + Top = 208 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_YXYMT.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 208 + Top = 176 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_YXYMT.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 208 + Top = 144 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 160 + Top = 152 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 160 + Top = 184 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, pbExport, pbNavigator] + DefaultCollate = False + ShowPrintDialog = False + SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\' + PreviewOptions.RulerUnit = rmutScreenPixels + PreviewOptions.RulerVisible = False + PreviewOptions.DrawBorder = False + PreviewOptions.BorderPen.Color = clGray + PreviewOptions.BorderPen.Style = psDash + Dataset = RMDBMain + CompressLevel = rmzcFastest + CompressThread = False + LaterBuildEvents = True + OnlyOwnerDataSet = False + Left = 1048 + Top = 8 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 992 + Top = 8 + end + object RMXLSExport2: TRMXLSExport + ShowAfterExport = False + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 1108 + Top = 8 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 1080 + Top = 8 + end + object PopupMenu1: TPopupMenu + Left = 488 + Top = 272 + object N1: TMenuItem + Caption = #20840#36873 + OnClick = N1Click + end + object N2: TMenuItem + Caption = #20840#24323 + OnClick = N2Click + end + end +end diff --git a/云翔一码通/U_KuWeiList.pas b/云翔一码通/U_KuWeiList.pas new file mode 100644 index 0000000..1138ff6 --- /dev/null +++ b/云翔一码通/U_KuWeiList.pas @@ -0,0 +1,305 @@ +unit U_KuWeiList; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, + cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB, + cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, + cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, + RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, + Menus, cxButtonEdit, cxDropDownEdit, cxPC, Buttons, cxLookAndFeels, + cxLookAndFeelPainters, dxSkinsCore, 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, dxSkinPumpkin, + dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, + dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, + dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, + dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter, + cxNavigator; + +type + TfrmKuWeiList = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBClose: TToolButton; + Tv1: TcxGridDBTableView; + cxGrid1Level1: TcxGridLevel; + cxGrid1: TcxGrid; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Order_Main: TClientDataSet; + Panel1: TPanel; + v1Column7: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport2: TRMXLSExport; + CDS_PRT: TClientDataSet; + Label2: TLabel; + QuYu: TEdit; + v1Column1: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + Label1: TLabel; + FenQu: TEdit; + Label5: TLabel; + Pai: TEdit; + Label6: TLabel; + KWName: TEdit; + Label7: TLabel; + Ceng: TEdit; + PopupMenu1: TPopupMenu; + N1: TMenuItem; + N2: TMenuItem; + TbSelect: TToolButton; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure CheckBox1Click(Sender: TObject); + procedure CheckBox2Click(Sender: TObject); + procedure CustomerNoNameChange(Sender: TObject); + procedure N2Click(Sender: TObject); + procedure N1Click(Sender: TObject); + procedure cxTabControl1Change(Sender: TObject); + procedure ZJStatusChange(Sender: TObject); + procedure ToolButton4Click(Sender: TObject); + procedure TbSelectClick(Sender: TObject); + procedure Tv1DblClick(Sender: TObject); + private + canshu1:string; + DQdate:TDateTime; + procedure InitGrid(); + procedure InitForm(); + procedure PrtData(KWID:String); + { Private declarations } + public + FFInt,FCloth:Integer; + + { Public declarations } + end; + +var + frmKuWeiList: TfrmKuWeiList; + +implementation +uses + U_DataLink,U_RTFun; + +{$R *.dfm} + +procedure TfrmKuWeiList.FormDestroy(Sender: TObject); +begin + frmKuWeiList:=nil; +end; + +procedure TfrmKuWeiList.FormClose(Sender: TObject; + var Action: TCloseAction); +begin + Action:=caFree; +end; + +procedure TfrmKuWeiList.FormCreate(Sender: TObject); +begin + cxgrid1.Align:=alClient; + canshu1:=Trim(DParameters1); +end; + +procedure TfrmKuWeiList.TBCloseClick(Sender: TObject); +begin + WriteCxGrid('λб',Tv1,'λ'); + Close; +end; + +procedure TfrmKuWeiList.InitGrid(); +begin + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered:=False; + Close; + sql.Clear; + sql.Add(' select A.* '); + sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' '); + Open; + end; + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); + finally + ADOQueryMain.EnableControls; + end; +end; + + +procedure TfrmKuWeiList.InitForm(); +begin + ReadCxGrid('λб',Tv1,'λ'); + InitGrid(); +end; + +procedure TfrmKuWeiList.TBFindClick(Sender: TObject); +begin + if ADOQueryMain.Active=False then Exit; + SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); +end; + + +procedure TfrmKuWeiList.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmKuWeiList.FormShow(Sender: TObject); +begin + InitForm(); +end; + +procedure TfrmKuWeiList.CheckBox1Click(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmKuWeiList.CheckBox2Click(Sender: TObject); +begin + TBRafresh.Click; +end; + +procedure TfrmKuWeiList.CustomerNoNameChange(Sender: TObject); +begin + if ADOQueryMain.Active=False then Exit; + SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2)); + SCreateCDS20(ADOQueryMain,Order_Main); + SInitCDSData20(ADOQueryMain,Order_Main); +end; + +procedure TfrmKuWeiList.N2Click(Sender: TObject); +begin + SelOKNo(Order_Main,false); +end; + +procedure TfrmKuWeiList.N1Click(Sender: TObject); +begin + SelOKNo(Order_Main,True); +end; + +procedure TfrmKuWeiList.cxTabControl1Change(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmKuWeiList.ZJStatusChange(Sender: TObject); +begin + TBFind.Click; +end; + +procedure TfrmKuWeiList.ToolButton4Click(Sender: TObject); +begin + if Order_Main.IsEmpty then Exit; + if Trim(ComboBox1.Text)='' then + begin + Application.MessageBox('Ϊգ','ʾ',0); + Exit; + end; + if Order_Main.Locate('SSel',True,[])=False then + begin + Application.MessageBox('ûѡ!','ʾ',0); + Exit; + end; + Order_Main.DisableControls; + with Order_Main do + begin + First; + while Locate('SSel',True,[]) do + begin + PrtData(Trim(Order_Main.fieldbyname('KWID').AsString)); + Edit; + FieldByName('SSel').Value:=False; + end; + end; + Order_Main.EnableControls; +end; +procedure TfrmKuWeiList.PrtData(KWID:String); +var + fPrintFile,Txt,fImagePath:string; + i,j:Integer; + Moudle: THandle; + Makebar:TMakebar; + Mixtext:TMixtext; +begin + fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\λǩ.rmf'; + if FileExists(fPrintFile)=False then + begin + Application.MessageBox(PChar('û'+ExtractFilePath(Application.ExeName)+'Report\λǩ.rmf'),'ʾ',0); + exit; + end; + with ADOQueryTemp do + begin + Close; + SQL.Clear; + sql.Add('select * from KuWei where KWID='''+Trim(KWID)+''''); + Open; + end; + SCreateCDS20(ADOQueryTemp,CDS_PRT); + SInitCDSData20(ADOQueryTemp,CDS_PRT); + try + Moudle:=LoadLibrary('MakeQRBarcode.dll'); + @Makebar:=GetProcAddress(Moudle,'Make'); + @Mixtext:=GetProcAddress(Moudle,'MixText'); + Txt:=Trim(KWID); + fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp'; + if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then + CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil); + if FileExists(fImagePath) then DeleteFile(fImagePath); + Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3); + except + application.MessageBox('άʧܣ','ʾϢ',MB_ICONERROR); + exit; + end; + RMVariables['QRBARCODE']:=fImagePath; + if Trim(ComboBox1.Text)='' then + begin + RMVariables['FangXiang']:=''; + end else + if Trim(ComboBox1.Text)='' then + begin + RMVariables['FangXiang']:=''; + end; + RM1.LoadFromFile(fPrintFile); + //RM1.ShowReport; + RM1.PrintReport; +end; + +procedure TfrmKuWeiList.TbSelectClick(Sender: TObject); +begin + WriteCxGrid('λб',Tv1,'λ'); + ModalResult:=1; +end; + +procedure TfrmKuWeiList.Tv1DblClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + ModalResult := 1; +end; + +end. diff --git a/云翔一码通/U_YMTRKInPut.pas b/云翔一码通/U_YMTRKInPut.pas index 35bbc15..8a39030 100644 --- a/云翔一码通/U_YMTRKInPut.pas +++ b/云翔一码通/U_YMTRKInPut.pas @@ -550,10 +550,10 @@ begin with Self.CDS_Sub do begin edit; - FieldByName('FactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('coCode').AsString); - FieldByName('FactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('coName').AsString); - FieldByName('FromFactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('coCode').AsString); - FieldByName('FromFactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('coName').AsString); + FieldByName('FactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyCode').AsString); + FieldByName('FactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString); + FieldByName('FromFactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyCode').AsString); + FieldByName('FromFactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString); //Post; end; end; @@ -619,8 +619,8 @@ begin with Self.CDS_Sub do begin edit; - FieldByName('ToFactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('COCode').AsString); - FieldByName('ToFactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('COName').AsString); + FieldByName('ToFactoryNo').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyCode').AsString); + FieldByName('ToFactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString); //Post; end; end; @@ -655,22 +655,20 @@ end; procedure TfrmYMTRKInPut.v1Column18PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp := TfrmZDYHelp.Create(Application); - with frmZDYHelp do + frmKuWeiList := TfrmKuWeiList.Create(Application); + with frmKuWeiList do begin - flag := 'KuWei'; - flagname := 'λ'; if ShowModal = 1 then begin with Self.CDS_Sub do begin Edit; - FieldByName('KuWei').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString); + FieldByName('KuWei').Value := Trim(frmKuWeiList.Order_Main.fieldbyname('KWName').AsString); end; end; end; finally - frmZDYHelp.Free; + frmKuWeiList.Free; end; end; diff --git a/云翔生产管理(MYSC.dll)/U_ZHCPInPut.pas b/云翔生产管理(MYSC.dll)/U_ZHCPInPut.pas index 2a8dcdf..4dc71a6 100644 --- a/云翔生产管理(MYSC.dll)/U_ZHCPInPut.pas +++ b/云翔生产管理(MYSC.dll)/U_ZHCPInPut.pas @@ -167,30 +167,6 @@ begin Result := False; FDate := SGetServerDate(ADOTemp); try -// ADOCmd.Connection.BeginTrans; -// if GetLSNoHZ(ADOCmd, BJmaxno, 'ZD', 'ZH_KH_DJ', 3, 1, 1) = False then -// begin -// ADOCmd.Connection.RollbackTrans; -// Application.MessageBox('ȡʧ!', 'ʾ', 0); -// Exit; -// end; -// with ADOCmd do -// begin -// Close; -// sql.Clear; -// SQL.Add('select * from ZH_KH_DJ where ZDId=''' + Trim(BJmaxno) + ''''); -// Open; -// end; -// with ADOCmd do -// begin -// Append; -// FieldByName('ZDId').Value := Trim(BJmaxno); -// FieldByName('Filler').Value := Trim(DName); -// FieldByName('FillerCode').Value := Trim(DCode); -// FieldByName('Valid').Value := 'Y'; -// FieldByName('ZDDate').Value := FDate; -// Post; -// end; if GetLSNo(ADOCmd, BJmaxmxno, 'ZC', 'ZH_KH_DJ_CP', 4, 1) = False then begin // Order_Sub.EnableControls; @@ -454,18 +430,6 @@ begin Exit; end; -// if (Trim(DiBu.Text) = '') and (Trim(DiBuName.Text) = '') then -// begin -// Application.MessageBox('ײź͵ײƲܶΪ!', 'ʾ', 0); -// Exit; -// end; -// if Trim(MianBuName.Text) = '' then -// begin -// Application.MessageBox('沼ƲΪ!', 'ʾ', 0); -// Exit; -// end; - - end; if Trim(ZICL.Text) = '' then @@ -494,6 +458,7 @@ begin programIni.Free; end; + procedure TfrmZHCPInPut.SaveImage(maxnoWB: string; FIMNO: string); var ImagePath, ImagName, MaxNo, MaxNoFile: string; @@ -505,9 +470,19 @@ begin if Trim(FIMNO) = 'ͼƬ' then begin ImagePath := Image2.Hint; - ImagName := Image2.Hint; + ImagName := ExtractFileName(Image2.Hint); + if lstPat2.Count > 0 then + begin + LocalFileName := lstPat2[0]; // ʹбе·ȷµ + // ļǷ + if not FileExists(LocalFileName) then + begin + Application.MessageBox('ҲͼƬļѡ!', '', 0); + Exit; + end; end; - + ImagePath := ExtractFilePath(LocalFileName); // ļ· + ImagName := ExtractFileName(LocalFileName); // ļչ AJpeg := TJpegImage.Create(); with ADOCmd do begin @@ -845,6 +820,8 @@ begin ZIName.Text := ChangeFileExt(ExtractFileName(FullFileName), ''); Panel12.Visible := True; + WJName.Text := ChangeFileExt(ExtractFileName(Image2.Hint), ''); + WJName.Hint := ChangeFileExt(ExtractFileName(Image2.Hint), ''); except on E: Exception do @@ -1214,8 +1191,8 @@ begin Cancel.Visible := True; Rename.Visible := True; Panel12.Refresh; - WJName.Text := Trim(Image2.Hint); - WJName.Hint := Trim(Image2.Hint); + WJName.Text := ChangeFileExt(ExtractFileName(Image2.Hint), ''); + WJName.Hint := ChangeFileExt(ExtractFileName(Image2.Hint), ''); end; procedure TfrmZHCPInPut.RenameClick(Sender: TObject);