From d94eb90043cf42cc003ac10d5d35024346f4f183 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E401PHE\\Administrator" Date: Tue, 29 Apr 2025 10:36:16 +0800 Subject: [PATCH] ~ --- 管理系统/U_ClothContractInPut.dfm | 1 - 管理系统/U_ClothContractInPut.pas | 815 ++++++++++++----------- 管理系统/U_ClothContractInPut_Dp.dfm | 8 - 管理系统/U_ClothContractInPut_Dp.pas | 5 +- 管理系统/U_ClothContractInPut_Tp.dfm | 25 + 管理系统/U_ClothContractInPut_Tp.pas | 29 + 管理系统/U_ClothContractList.dfm | 6 + 管理系统/U_ClothContractList.pas | 5 +- 管理系统/U_ClothContractList_DY.dfm | 823 +++++++++++++++++++++++ 管理系统/U_ClothContractList_DY.pas | 900 ++++++++++++++++++++++++++ 管理系统/U_ClothContractList_XPKF.dfm | 823 +++++++++++++++++++++++ 管理系统/U_ClothContractList_XPKF.pas | 900 ++++++++++++++++++++++++++ 管理系统/U_GetDllForm.pas | 47 +- 13 files changed, 3955 insertions(+), 432 deletions(-) create mode 100644 管理系统/U_ClothContractList_DY.dfm create mode 100644 管理系统/U_ClothContractList_DY.pas create mode 100644 管理系统/U_ClothContractList_XPKF.dfm create mode 100644 管理系统/U_ClothContractList_XPKF.pas diff --git a/管理系统/U_ClothContractInPut.dfm b/管理系统/U_ClothContractInPut.dfm index b03f336..060eaff 100644 --- a/管理系统/U_ClothContractInPut.dfm +++ b/管理系统/U_ClothContractInPut.dfm @@ -343,7 +343,6 @@ object frmClothContractInPut: TfrmClothContractInPut Width = 392 end object fromConNo: TcxButtonEdit - Tag = 1 Left = 633 Top = 10 BeepOnEnter = False diff --git a/管理系统/U_ClothContractInPut.pas b/管理系统/U_ClothContractInPut.pas index c7d4c53..5f432fa 100644 --- a/管理系统/U_ClothContractInPut.pas +++ b/管理系统/U_ClothContractInPut.pas @@ -3,28 +3,27 @@ unit U_ClothContractInPut; interface uses - Windows, Messages,strUtils, SysUtils, cxTextEdit,Variants, Classes, Graphics, Controls, Forms, - Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, + Windows, Messages, strUtils, SysUtils, cxTextEdit, Variants, Classes, Graphics, + Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, - cxGridTableView, cxGridDBTableView, cxClasses, cxControls, - cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer, - cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB, - ExtCtrls, BtnEdit, cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, - cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore, - dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, - dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, - dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, - dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, - dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis, + cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, + cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer, cxMaskEdit, cxButtonEdit, + StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxDropDownEdit, + cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters, + cxNavigator, 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; + dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, + dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, + dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, + dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, + dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, + dxSkinscxPCPainter; type TfrmClothContractInPut = class(TForm) @@ -95,61 +94,45 @@ type Tv1Column2: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn; procedure TBCloseClick(Sender: TObject); - procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; - ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; - AShift: TShiftState; var AHandled: Boolean); + procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure Button1Click(Sender: TObject); procedure TVZDYKeyPress(Sender: TObject; var Key: Char); procedure FormShow(Sender: TObject); procedure TBSaveClick(Sender: TObject); - procedure v1OrderUnitPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1PRTUnitPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1PRTColorPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure ToolButton1Click(Sender: TObject); procedure ToolButton2Click(Sender: TObject); - procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1Column1PropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1PRTMFPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1OrderQtyPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1ClothQtyPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure v1Column2PropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure FactoryNoNamePropertiesChange(Sender: TObject); - procedure CompanyNamePropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); - procedure JHPlacePropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure v1Column1PropertiesEditValueChanged(Sender: TObject); procedure fromConNoKeyPress(Sender: TObject; var Key: Char); procedure v1ClothUnitPropertiesEditValueChanged(Sender: TObject); - procedure fromConNoPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); + procedure fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure v1Column6PropertiesEditValueChanged(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); - procedure Tv1CellClick(Sender: TcxCustomGridTableView; - ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; - AShift: TShiftState; var AHandled: Boolean); + procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); private - FXS:Integer; + FXS: Integer; procedure InitData(); - procedure ZDYHelp(FButn:TcxButtonEdit;LType:string); - function SaveData():Boolean; - function YFData(fMainID,FsubID:string):Boolean; - procedure DoQuery(fkeyNo:string); + procedure ZDYHelp(FButn: TcxButtonEdit; LType: string); + function SaveData(): Boolean; + function YFData(fMainID, FsubID: string): Boolean; + procedure DoQuery(fkeyNo: string); procedure DoKc(); { Private declarations } public - PState:Integer; - FMainId:String; + PState: Integer; + FMainId: string; { Public declarations } end; @@ -158,58 +141,63 @@ var frmClothContractInPut: TfrmClothContractInPut; implementation + uses - U_DataLink,U_ZDYHelp,U_Fun, U_ZdyAttachGYS,U_ClothContractList_CG_help, + U_DataLink, U_ZDYHelp, U_Fun, U_ZdyAttachGYS, U_ClothContractList_CG_help, U_ZdyAttachCP; {$R *.dfm} procedure TfrmClothContractInPut.DoKc(); begin - Label11.Caption:='ۣ0'; - IF Order_Sub.IsEmpty then exit; - IF trim(Order_Sub.fieldbyname('C_CodeName').AsString)='' then exit; + Label11.Caption := 'ۣ0'; + if Order_Sub.IsEmpty then + exit; + if trim(Order_Sub.fieldbyname('C_CodeName').AsString) = '' then + exit; with ADOTemp do begin - close; - sql.Clear; - SQL.Add(' SELECT Top 1 Price FROM YF_Money_CR A'); - sql.Add(' where P_CodeName='+quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); - sql.Add(' and factoryName='+quotedstr(trim(FactoryNoName.Text))); - sql.Add(' and CRType=''ӦǼ'' '); - sql.Add(' and price>0 '); - sql.Add(' order by FillTime desc'); - open; + close; + sql.Clear; + SQL.Add(' SELECT Top 1 Price FROM YF_Money_CR A'); + sql.Add(' where P_CodeName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); + sql.Add(' and factoryName=' + quotedstr(trim(FactoryNoName.Text))); + sql.Add(' and CRType=''ӦǼ'' '); + sql.Add(' and price>0 '); + sql.Add(' order by FillTime desc'); + open; end; - IF not ADOTemp.IsEmpty then + if not ADOTemp.IsEmpty then begin - Label11.Caption:='ۣ'+trim(ADOTemp.fieldbyname('price').AsString); + Label11.Caption := 'ۣ' + trim(ADOTemp.fieldbyname('price').AsString); end; end; -procedure TfrmClothContractInPut.DoQuery(fkeyNo:string); + +procedure TfrmClothContractInPut.DoQuery(fkeyNo: string); begin - IF trim(fkeyNo)='' then exit; + if trim(fkeyNo) = '' then + exit; with ADOTemp do begin close; sql.Clear; sql.Add('select A.* from Contract_Main A '); sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); - sql.Add('where A.conNo='+quotedstr(trim(fkeyNo))); + sql.Add('where A.conNo=' + quotedstr(trim(fkeyNo))); sql.Add('and Isnull(B.C_status,''0'')=''0'' '); open; - IF not IsEmpty then + if not IsEmpty then begin - FactoryNoName.Text:=fieldbyname('FactoryNoName').AsString; - LXPerson.Text:=fieldbyname('LXPerson').AsString; - LXPerson.Text:=fieldbyname('LXPerson').AsString; - LXTel.Text:=fieldbyname('LXPerson').AsString; - fromConNo.Hint:=fieldbyname('mainID').AsString; - JHPlace.Text:=fieldbyname('QDPalce').AsString; + FactoryNoName.Text := fieldbyname('FactoryNoName').AsString; + LXPerson.Text := fieldbyname('LXPerson').AsString; + LXPerson.Text := fieldbyname('LXPerson').AsString; + LXTel.Text := fieldbyname('LXPerson').AsString; + fromConNo.Hint := fieldbyname('mainID').AsString; + JHPlace.Text := fieldbyname('QDPalce').AsString; end else begin - application.MessageBox('˲ɹƻŴ','ʾϢ',0); + application.MessageBox('˲ɹƻŴ', 'ʾϢ', 0); exit; end; end; @@ -221,13 +209,13 @@ begin sql.Add('select * '); sql.Add('from Contract_Main A'); sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); - sql.Add('where A.conNo='+quotedstr(trim(fkeyNo))); + sql.Add('where A.conNo=' + quotedstr(trim(fkeyNo))); sql.Add('and Isnull(B.C_status,''0'')=''0'' '); open; - IF not IsEmpty then + if not IsEmpty then begin - SCreateCDS20(ADOTemp,Order_Sub); - SInitCDSData20(ADOTemp,Order_Sub); + SCreateCDS20(ADOTemp, Order_Sub); + SInitCDSData20(ADOTemp, Order_Sub); end else begin @@ -240,10 +228,10 @@ begin while not eof do begin edit; - fieldbyname('fromMainID').Value:= fieldbyname('MainID').AsString; - fieldbyname('fromsubID').Value:= fieldbyname('subID').AsString; - fieldbyname('MainID').Value:= ''; - fieldbyname('subID').Value:= ''; + fieldbyname('fromMainID').Value := fieldbyname('MainID').AsString; + fieldbyname('fromsubID').Value := fieldbyname('subID').AsString; + fieldbyname('MainID').Value := ''; + fieldbyname('subID').Value := ''; post; next; end; @@ -252,22 +240,23 @@ begin end; end; -function TfrmClothContractInPut.YFData(fMainID,FsubID:string):Boolean; + +function TfrmClothContractInPut.YFData(fMainID, FsubID: string): Boolean; var - CRID,OrdMainId,YFID,FComTaiTou,FCRID,FFactoryName:String; + CRID, OrdMainId, YFID, FComTaiTou, FCRID, FFactoryName: string; begin - Result:=False; + Result := False; try with ADOQueryTmp do begin Close; SQL.Clear; - sql.Add('select * from YF_Money_KC where FactoryName='''+Trim(FactoryNoName.Text)+''''); + sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(FactoryNoName.Text) + ''''); Open; end; if not ADOQueryTmp.IsEmpty then begin - CRID:=ADOQueryTmp.fieldbyname('CRID').AsString; + CRID := ADOQueryTmp.fieldbyname('CRID').AsString; end else begin @@ -279,21 +268,21 @@ begin sql.Add('select * from YF_Money_CRID '); Open; end; - CRID:=ADOCmd.fieldbyname('CRID').AsString; + CRID := ADOCmd.fieldbyname('CRID').AsString; with ADOCmd do begin Close; SQL.Clear; sql.Add('select * from YF_Money_KC '); - sql.add('where CRID='+quotedstr(trim(CRID))); + sql.add('where CRID=' + quotedstr(trim(CRID))); Open; end; with ADOCmd do begin Append; - FieldByName('CRID').Value:=StrToInt(CRID); - FieldByName('FactoryName').Value:=Trim(FactoryNoName.Text); - FieldByName('ZdyStr1').Value:='Ӧ'; + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('FactoryName').Value := Trim(FactoryNoName.Text); + FieldByName('ZdyStr1').Value := 'Ӧ'; Post; end; end; @@ -302,28 +291,28 @@ begin begin Close; sql.Clear; - sql.Add('select * from YF_Money_CR where mainID='''+Trim(FmainID)+''''); - sql.Add('and subID='''+Trim(FsubID)+''''); + sql.Add('select * from YF_Money_CR where mainID=''' + Trim(fMainID) + ''''); + sql.Add('and subID=''' + Trim(FsubID) + ''''); sql.Add('and YFName='''' '); Open; end; if ADOQueryTmp.IsEmpty then begin - if GetLSNo(ADOCmd,YFID,'YF','YF_Money_CR',3,1)=False then + if GetLSNo(ADOCmd, YFID, 'YF', 'YF_Money_CR', 3, 1) = False then begin - Application.MessageBox('ȡӦʧ!','ʾ',0); + Application.MessageBox('ȡӦʧ!', 'ʾ', 0); Exit; end; end else begin - YFID:=Trim(ADOQueryTmp.fieldbyname('YFID').AsString); + YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString); end; with ADOCmd do begin Close; sql.Clear; - sql.Add('select * from YF_Money_CR where YFID='''+Trim(YFID)+''''); + sql.Add('select * from YF_Money_CR where YFID=''' + Trim(YFID) + ''''); Open; end; with ADOCmd do @@ -332,31 +321,31 @@ begin Append else Edit; - FieldByName('YFID').Value:=Trim(YFID); - FieldByName('YFTypeId').Value:=Trim(ConNo.Text); - FieldByName('CRID').Value:=StrToInt(CRID); - FieldByName('Filler').Value:=Trim(DName); - FieldByName('CRType').Value:='ӦǼ'; - FieldByName('CRFlag').Value:='Ӧ'; - FieldByName('QtyFlag').Value:=1; - FieldByName('FactoryName').Value:=Trim(FactoryNoName.Text); - FieldByName('CRTime').Value:=formatDateTime('yyyy-MM-dd',DeliveryDate.Date); - FieldByName('Qty').Value:=Order_Sub.fieldbyname('C_Qty').AsFloat; - FieldByName('PS').Value:=Order_Sub.fieldbyname('Qty1').AsFloat; - FieldByName('T_Ps').Value:=Order_Sub.fieldbyname('T_Ps').AsFloat; - FieldByName('T_Qty').Value:=Order_Sub.fieldbyname('T_Qty').AsFloat; - FieldByName('YFType').Value:='Զ'; - FieldByName('Price').Value:=Order_Sub.fieldbyname('Price').asfloat; - FieldByName('T_Price').Value:=Order_Sub.fieldbyname('T_Price').asfloat; - FieldByName('HuiLv').Value:=1; - FieldByName('BZType').Value:=''; - FieldByName('ComTaiTou').Value:=Trim(FComTaiTou); - FieldByName('QtyUnit').Value:=Trim(Order_Sub.fieldbyname('C_Unit').AsString); - FieldByName('YFName').Value:=''; - FieldByName('MainId').Value:=Trim(fMainID); - FieldByName('subID').Value:=Trim(fsubID); - FieldByName('P_CodeName').Value:=Trim(Order_Sub.fieldbyname('C_CodeName').AsString); - FieldByName('P_Color').Value:=Trim(Order_Sub.fieldbyname('C_color').AsString); + FieldByName('YFID').Value := Trim(YFID); + FieldByName('YFTypeId').Value := Trim(ConNo.Text); + FieldByName('CRID').Value := StrToInt(CRID); + FieldByName('Filler').Value := Trim(DName); + FieldByName('CRType').Value := 'ӦǼ'; + FieldByName('CRFlag').Value := 'Ӧ'; + FieldByName('QtyFlag').Value := 1; + FieldByName('FactoryName').Value := Trim(FactoryNoName.Text); + FieldByName('CRTime').Value := formatDateTime('yyyy-MM-dd', DeliveryDate.Date); + FieldByName('Qty').Value := Order_Sub.fieldbyname('C_Qty').AsFloat; + FieldByName('PS').Value := Order_Sub.fieldbyname('Qty1').AsFloat; + FieldByName('T_Ps').Value := Order_Sub.fieldbyname('T_Ps').AsFloat; + FieldByName('T_Qty').Value := Order_Sub.fieldbyname('T_Qty').AsFloat; + FieldByName('YFType').Value := 'Զ'; + FieldByName('Price').Value := Order_Sub.fieldbyname('Price').asfloat; + FieldByName('T_Price').Value := Order_Sub.fieldbyname('T_Price').asfloat; + FieldByName('HuiLv').Value := 1; + FieldByName('BZType').Value := ''; + FieldByName('ComTaiTou').Value := Trim(FComTaiTou); + FieldByName('QtyUnit').Value := Trim(Order_Sub.fieldbyname('C_Unit').AsString); + FieldByName('YFName').Value := ''; + FieldByName('MainId').Value := Trim(fMainID); + FieldByName('subID').Value := Trim(FsubID); + FieldByName('P_CodeName').Value := Trim(Order_Sub.fieldbyname('C_CodeName').AsString); + FieldByName('P_Color').Value := Trim(Order_Sub.fieldbyname('C_color').AsString); Post; end; @@ -365,7 +354,7 @@ begin Close; sql.Clear; sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty,T_money=T_Price*T_Qty '); - sql.Add(' where YFID='''+Trim(YFID)+''''); + sql.Add(' where YFID=''' + Trim(YFID) + ''''); ExecSQL; end; with ADOCmd do @@ -374,13 +363,14 @@ begin sql.Clear; sql.Add(' Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); - sql.Add(' where CRID='+CRID); + sql.Add(' where CRID=' + CRID); ExecSQL; end; - Result:=True; + Result := True; except end; end; + procedure TfrmClothContractInPut.TBCloseClick(Sender: TObject); begin Close; @@ -395,20 +385,20 @@ begin sql.Add('select * '); sql.Add('from Contract_Main A'); sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); - sql.Add('where A.mainID= '''+Trim(fMainID)+''' '); + sql.Add('where A.mainID= ''' + Trim(fMainID) + ''' '); sql.Add('and A.conType='''' '); Open; end; - SCreateCDS20(ADOQueryTmp,Order_Sub); - SInitCDSData20(ADOQueryTmp,Order_Sub); - SCSHData(ADOQueryTmp,ScrollBox1,0); - IF not ADOQueryTmp.IsEmpty then + SCreateCDS20(ADOQueryTmp, Order_Sub); + SInitCDSData20(ADOQueryTmp, Order_Sub); + SCSHData(ADOQueryTmp, ScrollBox1, 0); + if not ADOQueryTmp.IsEmpty then begin - fromConNo.Hint:=trim(ADOQueryTmp.fieldbyname('fromMainID').AsString); - fromConNo.Text:=trim(ADOQueryTmp.fieldbyname('fromConNo').AsString); + fromConNo.Hint := trim(ADOQueryTmp.fieldbyname('fromMainID').AsString); + fromConNo.Text := trim(ADOQueryTmp.fieldbyname('fromConNo').AsString); end; - if PState=0 then + if PState = 0 then begin with ADOTemp do begin @@ -417,66 +407,66 @@ begin sql.Add('select Top 1* from Contract_Main order by FillTime desc '); Open; end; - QDTime.DateTime:=SGetServerDate(ADOTemp); - DeliveryDate.DateTime:=SGetServerDate(ADOTemp); - QDTime.Checked:=True; - DeliveryDate.Checked:=False; + QDTime.DateTime := SGetServerDate(ADOTemp); + DeliveryDate.DateTime := SGetServerDate(ADOTemp); + QDTime.Checked := True; + DeliveryDate.Checked := False; // ConNo.Text:='Զ'; //CompanyName.Text:='¡֯'; end; - PanZDY.Visible:=False; + PanZDY.Visible := False; end; -procedure TfrmClothContractInPut.ZDYHelp(FButn:TcxButtonEdit;LType:string); +procedure TfrmClothContractInPut.ZDYHelp(FButn: TcxButtonEdit; LType: string); var - FType,ZDYName,FText:String; + FType, ZDYName, FText: string; begin - PanZDY.Visible:=True; - PanZDY.Left:=FButn.Left; - PanZDY.Top:=FButn.Top+FButn.Height; + PanZDY.Visible := True; + PanZDY.Left := FButn.Left; + PanZDY.Top := FButn.Top + FButn.Height; with ADOZDY do begin - Filtered:=False; + Filtered := False; Close; SQL.Clear; - SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type='''+Trim(LType)+''''); + SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type=''' + Trim(LType) + ''''); Open; end; - FText:=Trim(FButn.Text); - if FText<>'' then - SDofilter(ADOZDY,' ZDYName like '+QuotedStr('%'+Trim(FText)+'%')) + FText := Trim(FButn.Text); + if FText <> '' then + SDofilter(ADOZDY, ' ZDYName like ' + QuotedStr('%' + Trim(FText) + '%')) else - SDofilter(ADOZDY,''); - VHelpZDYName.Summary.GroupFormat:=Trim(FButn.Name); + SDofilter(ADOZDY, ''); + VHelpZDYName.Summary.GroupFormat := Trim(FButn.Name); end; -procedure TfrmClothContractInPut.TVZDYCellDblClick(Sender: TcxCustomGridTableView; - ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; - AShift: TShiftState; var AHandled: Boolean); +procedure TfrmClothContractInPut.TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); var - FName:string; + FName: string; begin - if ADOZDY.IsEmpty then Exit; - FName:=Trim(VHelpZDYName.Summary.GroupFormat); - TcxButtonEdit(FindComponent(FName)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString); - TcxButtonEdit(FindComponent(FName)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString); - PanZDY.Visible:=False; + if ADOZDY.IsEmpty then + Exit; + FName := Trim(VHelpZDYName.Summary.GroupFormat); + TcxButtonEdit(FindComponent(FName)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(FName)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; end; procedure TfrmClothContractInPut.Button1Click(Sender: TObject); begin - PanZDY.Visible:=False; + PanZDY.Visible := False; end; procedure TfrmClothContractInPut.TVZDYKeyPress(Sender: TObject; var Key: Char); begin - if Key=#13 then + if Key = #13 then begin - if ADOZDY.IsEmpty then Exit; - TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString); - TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString); - PanZDY.Visible:=False; - ADOZDY.Active:=False; + if ADOZDY.IsEmpty then + Exit; + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString); + TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString); + PanZDY.Visible := False; + ADOZDY.Active := False; end; end; @@ -493,13 +483,13 @@ begin v1ClothQty.Visible:=True; v1PRTQty.Visible:=True; end;} - readCXgrid(self.Caption,tv1); + readCXgrid(self.Caption, tv1); InitData(); end; -function TfrmClothContractInPut.SaveData():Boolean; +function TfrmClothContractInPut.SaveData(): Boolean; var - maxno:String; + maxno: string; begin try ADOCmd.Connection.BeginTrans; @@ -508,165 +498,176 @@ begin begin Close; sql.Clear; - SQL.Add('select * from Contract_Main where MainId='''+Trim(FMainId)+''''); + SQL.Add('select * from Contract_Main where MainId=''' + Trim(fMainID) + ''''); Open; end; with ADOCmd do begin - if Trim(FMainId)='' then + if Trim(fMainID) = '' then begin Append; - if GetLSNo(ADOTemp,maxno,'CM','Contract_Main',3,1)=False then + if GetLSNo(ADOTemp, maxno, '', 'Contract_Main', 3, 1) = False then begin ADOCmd.Connection.RollbackTrans; - Application.MessageBox('ˮ쳣','ʾ',0); + Application.MessageBox('ˮ쳣', 'ʾ', 0); + exit; + end; + conNo.Text := trim(maxno); + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then + begin + ADOCmd.Connection.RollbackTrans; + Application.MessageBox('ˮ쳣', 'ʾ', 0); exit; end; end - else begin - maxno:=Trim(FMainId); + else + begin + maxno := Trim(fMainID); Edit; end; - FieldByName('MainId').Value:=Trim(maxno); - SSetsaveSql(ADOCmd,'Contract_Main',ScrollBox1,0); - FieldByName('LXPerson').Value:=Trim(LXPerson.Text); - FieldByName('LXTel').Value:=Trim(LXTel.Text); - if Trim(FMainId)='' then + FieldByName('MainId').Value := Trim(maxno); + SSetsaveSql(ADOCmd, 'Contract_Main', ScrollBox1, 0); +// FieldByName('conno').Value := Trim(LXPerson.Text); + FieldByName('LXPerson').Value := Trim(LXPerson.Text); + FieldByName('LXTel').Value := Trim(LXTel.Text); + if Trim(fMainID) = '' then begin - FieldByName('Filler').Value:=Trim(DName); - end else + FieldByName('Filler').Value := Trim(DName); + end + else begin - FieldByName('Editer').Value:=Trim(DName); - FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp); + FieldByName('Editer').Value := Trim(DName); + FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp); end; - FieldByName('ConType').Value:=''; - FieldByName('status').Value:='0'; - FieldByName('fromconNo').Value:=Trim(fromConNo.Text); - FieldByName('fromMainID').Value:=Trim(fromConNo.Hint); + FieldByName('ConType').Value := ''; + FieldByName('status').Value := '0'; + FieldByName('fromconNo').Value := null; + FieldByName('fromMainID').Value := Trim(fromConNo.Hint); + FieldByName('fromConNO').Value := Trim(fromConNo.text); Post; end; - FMainId:=Trim(maxno); + fMainID := Trim(maxno); ///ӱ with Order_Sub do begin First; while not Eof do begin - if Trim(Order_Sub.fieldbyname('C_Unit').AsString)='Kg' then + if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then begin end; - if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then begin - if GetLSNo(ADOTemp,maxno,'CS','Contract_Sub',3,1)=False then + if GetLSNo(ADOTemp, maxno, 'CS', 'Contract_Sub', 3, 1) = False then begin ADOCmd.Connection.RollbackTrans; - Application.MessageBox('ȡˮʧܣ','ʾ',0); + Application.MessageBox('ȡˮʧܣ', 'ʾ', 0); Exit; end; - end else + end + else begin - maxno:=Trim(Order_Sub.fieldbyname('SubId').AsString); + maxno := Trim(Order_Sub.fieldbyname('SubId').AsString); end; with ADOCmd do begin Close; SQL.Clear; - sql.Add('select * from Contract_Sub where MainId='''+Trim(FMainId)+''''); - sql.Add(' and SubId='''+Trim(maxno)+''''); + sql.Add('select * from Contract_Sub where MainId=''' + Trim(fMainID) + ''''); + sql.Add(' and SubId=''' + Trim(maxno) + ''''); Open; end; with ADOCmd do begin - if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then + if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then Append else Edit; - FieldByName('MainId').Value:=Trim(FMainId); - FieldByName('SubId').Value:=Trim(maxno); - FieldByName('ConNo').Value:=Trim(ConNo.Text); - RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'Contract_Sub',0); - FieldByName('fromMainID').Value:=Trim(Order_Sub.fieldbyname('fromMainID').AsString); - FieldByName('fromsubID').Value:=Trim(Order_Sub.fieldbyname('fromsubID').AsString); - FieldByName('mrate').Value:=Trim(Order_Sub.fieldbyname('mrate').AsString); - FieldByName('C_status').Value:='0'; - FieldByName('MFQty').Value:=Order_Sub.fieldbyname('MFQty').AsFloat; - FieldByName('KZQty').Value:=Order_Sub.fieldbyname('KZQty').AsFloat; - FieldByName('C_Qty').Value:=Order_Sub.fieldbyname('C_Qty').AsFloat; - FieldByName('Qty1').Value:=Order_Sub.fieldbyname('Qty1').AsFloat; - FieldByName('Qty2').Value:=Order_Sub.fieldbyname('Qty2').AsFloat; - FieldByName('Qty3').Value:=Order_Sub.fieldbyname('Qty3').AsFloat; - FieldByName('Price').Value:=Order_Sub.fieldbyname('Price').AsFloat; - FieldByName('money').Value:=Order_Sub.fieldbyname('money').AsFloat; - FieldByName('T_ps').Value:=Order_Sub.fieldbyname('T_ps').AsFloat; - FieldByName('T_Qty').Value:=Order_Sub.fieldbyname('T_Qty').AsFloat; - FieldByName('T_Price').Value:=Order_Sub.fieldbyname('T_Price').AsFloat; - FieldByName('T_money').Value:=Order_Sub.fieldbyname('T_money').AsFloat; - FieldByName('H_ps').Value:=Order_Sub.fieldbyname('H_ps').AsFloat; - FieldByName('H_Qty').Value:=Order_Sub.fieldbyname('H_Qty').AsFloat; - if Trim(Order_Sub.fieldbyname('C_Unit').AsString)='Kg' then + FieldByName('MainId').Value := Trim(fMainID); + FieldByName('SubId').Value := Trim(maxno); + FieldByName('ConNo').Value := Trim(ConNo.Text); + RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'Contract_Sub', 0); + FieldByName('fromMainID').Value := Trim(Order_Sub.fieldbyname('fromMainID').AsString); + FieldByName('fromsubID').Value := Trim(Order_Sub.fieldbyname('fromsubID').AsString); + FieldByName('mrate').Value := Trim(Order_Sub.fieldbyname('mrate').AsString); + FieldByName('C_status').Value := '0'; + FieldByName('MFQty').Value := Order_Sub.fieldbyname('MFQty').AsFloat; + FieldByName('KZQty').Value := Order_Sub.fieldbyname('KZQty').AsFloat; + FieldByName('C_Qty').Value := Order_Sub.fieldbyname('C_Qty').AsFloat; + FieldByName('Qty1').Value := Order_Sub.fieldbyname('Qty1').AsFloat; + FieldByName('Qty2').Value := Order_Sub.fieldbyname('Qty2').AsFloat; + FieldByName('Qty3').Value := Order_Sub.fieldbyname('Qty3').AsFloat; + FieldByName('Price').Value := Order_Sub.fieldbyname('Price').AsFloat; + FieldByName('money').Value := Order_Sub.fieldbyname('money').AsFloat; + FieldByName('T_ps').Value := Order_Sub.fieldbyname('T_ps').AsFloat; + FieldByName('T_Qty').Value := Order_Sub.fieldbyname('T_Qty').AsFloat; + FieldByName('T_Price').Value := Order_Sub.fieldbyname('T_Price').AsFloat; + FieldByName('T_money').Value := Order_Sub.fieldbyname('T_money').AsFloat; + FieldByName('H_ps').Value := Order_Sub.fieldbyname('H_ps').AsFloat; + FieldByName('H_Qty').Value := Order_Sub.fieldbyname('H_Qty').AsFloat; + if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then begin - if Order_Sub.fieldbyname('MFQty').AsFloat*Order_Sub.fieldbyname('KZQty').AsFloat >0 then - FieldByName('MQty').Value:=Order_Sub.fieldbyname('C_Qty').Value*1.00*1000 - /(Order_Sub.fieldbyname('MFQty').Value*1.00/100*Order_Sub.fieldbyname('KZQty').Value); - end else + if Order_Sub.fieldbyname('MFQty').AsFloat * Order_Sub.fieldbyname('KZQty').AsFloat > 0 then + FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value * 1.00 * 1000 / (Order_Sub.fieldbyname('MFQty').Value * 1.00 / 100 * Order_Sub.fieldbyname('KZQty').Value); + end + else begin - FieldByName('MQty').Value:=Order_Sub.fieldbyname('C_Qty').Value; + FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value; end; - FieldByName('C_Valid').Value:='Y'; + FieldByName('C_Valid').Value := 'Y'; Post; end; Order_Sub.Edit; - Order_Sub.FieldByName('SubId').Value:=Trim(maxno); + Order_Sub.FieldByName('SubId').Value := Trim(maxno); - if not YFData(FMainId,maxno) then - begin - ADOCmd.Connection.RollbackTrans; - exit; - end; +// if not YFData(fMainID, maxno) then +// begin +// ADOCmd.Connection.RollbackTrans; +// exit; +// end; //Order_Sub.Post; Next; end; end; - ADOCmd.Connection.CommitTrans; - Result:=True; + Result := True; except - Result:=False; + Result := False; ADOCmd.Connection.RollbackTrans; - if GetLSNo(ADOTemp,maxno,'CM','Contract_Main',3,1)=False then + if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then begin end; - Application.MessageBox('ʧܣ','ʾ',0); + Application.MessageBox('ʧܣ', 'ʾ', 0); end; end; procedure TfrmClothContractInPut.TBSaveClick(Sender: TObject); begin cxGrid1.SetFocus; - if Trim(ConNo.Text)='' then +// if Trim(ConNo.Text)='' then +// begin +// Application.MessageBox('ͬŲΪգ','ʾ',0); +// Exit; +// end; + if Trim(FactoryNoName.Text) = '' then begin - Application.MessageBox('ͬŲΪգ','ʾ',0); - Exit; - end; - if Trim(FactoryNoName.Text)='' then - begin - Application.MessageBox('Ϊգ','ʾ',0); + Application.MessageBox('Ϊգ', 'ʾ', 0); Exit; end; if Order_Sub.IsEmpty then begin - Application.MessageBox('ϸΪգ','ʾ',0); + Application.MessageBox('ϸΪգ', 'ʾ', 0); exit; end; - if Order_Sub.Locate('C_Qty',null,[]) then + if Order_Sub.Locate('C_Qty', null, []) then begin - Application.MessageBox('Ϊ!','ʾ',0); + Application.MessageBox('Ϊ!', 'ʾ', 0); Exit; end; - if Order_Sub.Locate('C_Unit',null,[]) then + if Order_Sub.Locate('C_Unit', null, []) then begin - Application.MessageBox('λΪ!','ʾ',0); + Application.MessageBox('λΪ!', 'ʾ', 0); Exit; end; { if Order_Sub.Locate('KZQty',null,[]) then @@ -684,20 +685,20 @@ begin close; sql.Clear; sql.Add('select MainID from Contract_Main A'); - sql.Add('where mainID<>'+quotedstr(trim(FMainId))); - sql.Add('and conNo='+quotedstr(trim(conNo.Text))); + sql.Add('where mainID<>' + quotedstr(trim(fMainID))); + sql.Add('and conNo=' + quotedstr(trim(conNo.Text))); sql.Add('and conType='''''); open; end; - IF not ADOTemp.IsEmpty then + if not ADOTemp.IsEmpty then begin - application.MessageBox('񵥺ظ','ʾϢ',0); + application.MessageBox('񵥺ظ', 'ʾϢ', 0); exit; end; if SaveData() then begin - Application.MessageBox('ɹ','ʾ',0); - ModalResult:=1; + Application.MessageBox('ɹ', 'ʾ', 0); + ModalResult := 1; // ConNo.Text:='Զ'; { FactoryNoName.Text:=''; CompanyName.Text:='֯'; @@ -706,23 +707,22 @@ begin JHPlace.Text:=''; Order_Sub.EmptyDataSet; PState:=0; - FMainId:=''; } + FMainId:=''; } end; end; -procedure TfrmClothContractInPut.v1OrderUnitPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='OrdUnit'; - flagname:='λ'; - if ShowModal=1 then + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('OrderUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('OrderUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -730,19 +730,18 @@ begin end; end; -procedure TfrmClothContractInPut.v1PRTUnitPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='OrdUnit'; - flagname:='λ'; - if ShowModal=1 then + flag := 'OrdUnit'; + flagname := 'λ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('PRTUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('PRTUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -750,19 +749,18 @@ begin end; end; -procedure TfrmClothContractInPut.v1PRTColorPropertiesButtonClick(Sender: TObject; - AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='OrdColor'; - flagname:='ɫ'; - if ShowModal=1 then + flag := 'OrdColor'; + flagname := 'ɫ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('PRTColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('PRTColor').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -775,16 +773,17 @@ begin with Order_Sub do begin Append; - fieldbyname('PriceUnit').Value:=''; - fieldbyname('C_UNit').Value:='M'; + fieldbyname('PriceUnit').Value := ''; + fieldbyname('C_UNit').Value := 'M'; Post; end; end; procedure TfrmClothContractInPut.ToolButton2Click(Sender: TObject); begin - if Order_Sub.IsEmpty then Exit; - if Trim(Order_Sub.fieldbyname('SubId').AsString)<>'' then + if Order_Sub.IsEmpty then + Exit; + if Trim(Order_Sub.fieldbyname('SubId').AsString) <> '' then begin { with ADOTemp do begin @@ -798,23 +797,23 @@ begin Application.MessageBox('ѵɾ!','ʾ',0); Exit; end; } - if Application.MessageBox('ȷҪɾ','ʾ',32+4)<>IDYES then Exit; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; with ADOCmd do begin Close; sql.Clear; - sql.Add('delete YF_Money_CR where subID='''+Trim(Order_Sub.fieldbyname('subID').AsString)+''''); - sql.Add('delete Contract_Sub where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+''''); + sql.Add('delete YF_Money_CR where subID=''' + Trim(Order_Sub.fieldbyname('subID').AsString) + ''''); + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + ''''); ExecSQL; end; end; Order_Sub.Delete; end; -procedure TfrmClothContractInPut.FactoryNoNamePropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin - if Trim(FMainId)<>'' then + if Trim(fMainID) <> '' then begin with ADOTemp do begin @@ -822,27 +821,27 @@ begin sql.Clear; sql.Add('select * from YF_Money_CR A where exists('); sql.Add('select * from Contract_Sub_MX B inner join Contract_Sub C on B.SubId=C.SubId '); - sql.Add(' where C.Mainid='''+Trim(FMainId)+''''); + sql.Add(' where C.Mainid=''' + Trim(fMainID) + ''''); sql.Add(' and B.MXID=A.YFTypeId)'); Open; end; - if ADOTemp.IsEmpty=False then + if ADOTemp.IsEmpty = False then begin - Application.MessageBox('ѾӦ޸ĹӦ!','ʾ',0); + Application.MessageBox('ѾӦ޸ĹӦ!', 'ʾ', 0); Exit; end; end; -try - frmZdyAttachGYS:=TfrmZdyAttachGYS.Create(Application); + try + frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); with frmZdyAttachGYS do begin - if ShowModal=1 then + if ShowModal = 1 then begin - FactoryNoName.Text:=Trim(CDS_HZ.fieldbyname('ZDYName').AsString); - FactoryNoName.Hint:=Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); - LXTel.Text:=Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); - LXPerson.Text:=Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); + FactoryNoName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString); + FactoryNoName.Hint := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + LXTel.Text := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString); + LXPerson.Text := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString); end; end; finally @@ -850,20 +849,19 @@ try end; end; -procedure TfrmClothContractInPut.v1Column1PropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin - try - frmZdyAttachCP:=TfrmZdyAttachCP.Create(Application); + try + frmZdyAttachCP := TfrmZdyAttachCP.Create(Application); with frmZdyAttachCP do begin - fType:=''; - if ShowModal=1 then + FType := ''; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('C_Code').Value:=Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); - Self.Order_Sub.FieldByName('C_CodeName').Value:=Trim(CDS_HZ.fieldbyname('ZdyName').AsString); - Self.Order_Sub.FieldByName('CP_CodeName').Value:=Trim(CDS_HZ.fieldbyname('CPhh').AsString); + Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString); + Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZdyName').AsString); + Self.Order_Sub.FieldByName('CP_CodeName').Value := Trim(CDS_HZ.fieldbyname('CPhh').AsString); // Self.Order_Sub.FieldByName('Color').Value:=Trim(CDS_HZ.fieldbyname('DEFstr3').AsString); // Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString); Self.Order_Sub.Post; @@ -873,22 +871,21 @@ begin frmZdyAttachCP.Free; end; DoKc(); - self.tv1.Controller.EditingController.ShowEdit(); + self.tv1.Controller.EditingController.ShowEdit(); end; -procedure TfrmClothContractInPut.v1PRTMFPropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='KZ'; - flagname:='صλ'; - if ShowModal=1 then + flag := 'KZ'; + flagname := 'صλ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('KZUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('KZUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -896,19 +893,18 @@ begin end; end; -procedure TfrmClothContractInPut.v1OrderQtyPropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='MF'; - flagname:='ŷλ'; - if ShowModal=1 then + flag := 'MF'; + flagname := 'ŷλ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('MFUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('MFUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -916,19 +912,18 @@ begin end; end; -procedure TfrmClothContractInPut.v1ClothQtyPropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='PriceUnit'; - flagname:='Ƽ۵λ'; - if ShowModal=1 then + flag := 'PriceUnit'; + flagname := 'Ƽ۵λ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('PriceUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('PriceUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -936,19 +931,18 @@ begin end; end; -procedure TfrmClothContractInPut.v1Column2PropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='OrderUnit'; - flagname:='λ'; - if ShowModal=1 then + flag := 'OrderUnit'; + flagname := 'λ'; + if ShowModal = 1 then begin Self.Order_Sub.Edit; - Self.Order_Sub.FieldByName('C_Unit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + Self.Order_Sub.FieldByName('C_Unit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -956,8 +950,7 @@ begin end; end; -procedure TfrmClothContractInPut.FactoryNoNamePropertiesChange( - Sender: TObject); +procedure TfrmClothContractInPut.FactoryNoNamePropertiesChange(Sender: TObject); begin {if FXS=99 then begin @@ -968,19 +961,18 @@ begin ZDYHelp(FactoryNoName,'FactoryNo1Name'); } end; -procedure TfrmClothContractInPut.CompanyNamePropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin try - frmZDYHelp:=TfrmZDYHelp.Create(Application); + frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - flag:='OrdDefStr2'; - flagname:='跽'; - if ShowModal=1 then + flag := 'OrdDefStr2'; + flagname := '跽'; + if ShowModal = 1 then begin - FXS:=99; - CompanyName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); + FXS := 99; + CompanyName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); end; end; finally @@ -988,17 +980,16 @@ begin end; end; -procedure TfrmClothContractInPut.JHPlacePropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin - try - frmZdyAttachGYS:=TfrmZdyAttachGYS.Create(Application); + try + frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application); with frmZdyAttachGYS do begin - if ShowModal=1 then + if ShowModal = 1 then begin - JHPlace.Text:=Trim(CDS_HZ.fieldbyname('zdyName').AsString); + JHPlace.Text := Trim(CDS_HZ.fieldbyname('zdyName').AsString); end; end; finally @@ -1007,24 +998,24 @@ begin end; -procedure TfrmClothContractInPut.v1Column1PropertiesEditValueChanged( - Sender: TObject); +procedure TfrmClothContractInPut.v1Column1PropertiesEditValueChanged(Sender: TObject); var - mvalue:string; + mvalue: string; begin - mvalue:=TcxTextEdit(Sender).EditingText; + mvalue := TcxTextEdit(Sender).EditingText; - IF trim(mvalue)='' then exit; + if trim(mvalue) = '' then + exit; - IF rightBstr(trim(mvalue),1)<>'#'THEN - BEGIn - mvalue:=trim(mvalue)+'#'; - END; + if rightBstr(trim(mvalue), 1) <> '#' then + begin + mvalue := trim(mvalue) + '#'; + end; with Order_Sub do begin Edit; - FieldByName('C_CodeName').Value:=Trim(mvalue); + FieldByName('C_CodeName').Value := Trim(mvalue); Post; end; @@ -1033,16 +1024,16 @@ begin close; sql.Clear; sql.Add('select * from KH_Zdy_Attachment A '); - sql.Add('where zdyName='+quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); + sql.Add('where zdyName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString))); open; end; - IF ADOTemp.IsEmpty then + if ADOTemp.IsEmpty then begin - application.MessageBox('Ʒڣ','ʾϢ',0); + application.MessageBox('Ʒڣ', 'ʾϢ', 0); with Order_Sub do begin Edit; - FieldByName('C_CodeName').Value:=''; + FieldByName('C_CodeName').Value := ''; Post; end; end; @@ -1050,107 +1041,101 @@ begin self.tv1.Controller.EditingController.ShowEdit(); end; -procedure TfrmClothContractInPut.fromConNoKeyPress(Sender: TObject; - var Key: Char); +procedure TfrmClothContractInPut.fromConNoKeyPress(Sender: TObject; var Key: Char); begin - if key=#13 then + if Key = #13 then begin DoQuery(fromConNo.text); end; end; -procedure TfrmClothContractInPut.v1ClothUnitPropertiesEditValueChanged( - Sender: TObject); - var - mvalue,fieldname:String; +procedure TfrmClothContractInPut.v1ClothUnitPropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; begin - If Trim(TcxTextEdit(Sender).EditingText)<>'' then + if Trim(TcxTextEdit(Sender).EditingText) <> '' then begin - mvalue:=TcxTextEdit(Sender).EditingText; - end else + mvalue := TcxTextEdit(Sender).EditingText; + end + else begin - mvalue:='0'; + mvalue := '0'; end; - fieldname:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; with Order_Sub do begin Edit; - FieldByName(Trim(fieldname)).Value:=mvalue; + FieldByName(Trim(fieldname)).Value := mvalue; Post; end; with Order_Sub do begin Edit; - FieldByName('money').Value:=strtofloat(format('%.2f',[FieldByName('C_Qty').AsFloat*FieldByName('Price').AsFloat])); + FieldByName('money').Value := strtofloat(format('%.2f', [FieldByName('C_Qty').AsFloat * FieldByName('Price').AsFloat])); Post; end; self.tv1.Controller.EditingController.ShowEdit(); end; -procedure TfrmClothContractInPut.fromConNoPropertiesButtonClick( - Sender: TObject; AButtonIndex: Integer); +procedure TfrmClothContractInPut.fromConNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); begin -try - frmClothContractList_CG_help:=TfrmClothContractList_CG_help.Create(Application); + try + frmClothContractList_CG_help := TfrmClothContractList_CG_help.Create(Application); with frmClothContractList_CG_help do begin - if ShowModal=1 then + if ShowModal = 1 then begin - fromConNO.Text:=Trim(Order_Main.fieldbyname('ConNO').AsString); + fromConNO.Text := Trim(Order_Main.fieldbyname('ConNO').AsString); end; end; finally frmClothContractList_CG_help.Free; end; - DoQuery(fromConNo.text); + DoQuery(fromConNo.text); end; -procedure TfrmClothContractInPut.v1Column6PropertiesEditValueChanged( - Sender: TObject); - var - mvalue,fieldname:String; +procedure TfrmClothContractInPut.v1Column6PropertiesEditValueChanged(Sender: TObject); +var + mvalue, fieldname: string; begin - If Trim(TcxTextEdit(Sender).EditingText)<>'' then + if Trim(TcxTextEdit(Sender).EditingText) <> '' then begin - mvalue:=TcxTextEdit(Sender).EditingText; - end else + mvalue := TcxTextEdit(Sender).EditingText; + end + else begin - mvalue:='0'; + mvalue := '0'; end; - fieldname:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; + fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName; with Order_Sub do begin Edit; - FieldByName(Trim(fieldname)).Value:=mvalue; + FieldByName(Trim(fieldname)).Value := mvalue; Post; end; with Order_Sub do begin Edit; - FieldByName('T_money').Value:=strtofloat(format('%.2f',[FieldByName('T_Qty').AsFloat*FieldByName('T_Price').AsFloat])); + FieldByName('T_money').Value := strtofloat(format('%.2f', [FieldByName('T_Qty').AsFloat * FieldByName('T_Price').AsFloat])); Post; end; self.tv1.Controller.EditingController.ShowEdit(); end; - -procedure TfrmClothContractInPut.FormClose(Sender: TObject; - var Action: TCloseAction); +procedure TfrmClothContractInPut.FormClose(Sender: TObject; var Action: TCloseAction); begin - writeCXgrid(self.Caption,tv1); + writeCXgrid(self.Caption, tv1); end; procedure TfrmClothContractInPut.FormCreate(Sender: TObject); begin - cxGrid1.Align:=Alclient; + cxGrid1.Align := Alclient; end; -procedure TfrmClothContractInPut.Tv1CellClick( - Sender: TcxCustomGridTableView; - ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; - AShift: TShiftState; var AHandled: Boolean); +procedure TfrmClothContractInPut.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); begin DoKc(); end; end. + diff --git a/管理系统/U_ClothContractInPut_Dp.dfm b/管理系统/U_ClothContractInPut_Dp.dfm index 7cf163f..74cf3ed 100644 --- a/管理系统/U_ClothContractInPut_Dp.dfm +++ b/管理系统/U_ClothContractInPut_Dp.dfm @@ -501,14 +501,6 @@ object frmClothContractInPut_Dp: TfrmClothContractInPut_Dp Styles.Header = DataLink_TradeManage.handBlack Width = 103 end - object v1C_Color: TcxGridDBColumn - Caption = #39068#33394 - DataBinding.FieldName = 'C_Color' - PropertiesClassName = 'TcxTextEditProperties' - Properties.OnEditValueChanged = v1C_ColorPropertiesEditValueChanged - HeaderAlignmentHorz = taCenter - Width = 60 - end object v1PRTColor: TcxGridDBColumn Caption = #20811#37325'(g/'#13217')' DataBinding.FieldName = 'KZQty' diff --git a/管理系统/U_ClothContractInPut_Dp.pas b/管理系统/U_ClothContractInPut_Dp.pas index a1af290..6528ae4 100644 --- a/管理系统/U_ClothContractInPut_Dp.pas +++ b/管理系统/U_ClothContractInPut_Dp.pas @@ -83,7 +83,6 @@ type GxNote1: TEdit; Label11: TLabel; v1Qty2: TcxGridDBColumn; - v1C_Color: TcxGridDBColumn; Panel1: TPanel; Label22: TLabel; Label23: TLabel; @@ -652,7 +651,7 @@ begin Application.MessageBox('ƷΪ!', 'ʾ', 0); Exit; end; - if Order_Sub.Locate('C_Color', null, []) = True then + { if Order_Sub.Locate('C_Color', null, []) = True then begin Application.MessageBox('ɫΪ!', 'ʾ', 0); Exit; @@ -662,7 +661,7 @@ begin Application.MessageBox('ɫΪ!', 'ʾ', 0); Exit; end; - { if Order_Sub.Locate('C_Qty',null,[]) then + if Order_Sub.Locate('C_Qty',null,[]) then begin Application.MessageBox('Ϊ!','ʾ',0); Exit; diff --git a/管理系统/U_ClothContractInPut_Tp.dfm b/管理系统/U_ClothContractInPut_Tp.dfm index d502e29..c5a79e1 100644 --- a/管理系统/U_ClothContractInPut_Tp.dfm +++ b/管理系统/U_ClothContractInPut_Tp.dfm @@ -240,6 +240,20 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp Font.Style = [fsBold] ParentFont = False end + object Label13: TLabel + Left = 723 + Top = 38 + Width = 66 + Height = 12 + Caption = #25171' '#26679' '#20154#65306 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + Visible = False + end object ConNo: TEdit Left = 86 Top = 11 @@ -428,6 +442,17 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp TabOrder = 13 OnBtnUpClick = CustomerNoNameBtnUpClick end + object DYer: TBtnEditC + Tag = 2 + Left = 786 + Top = 34 + Width = 140 + Height = 20 + Hint = 'DYer' + TabOrder = 14 + Visible = False + OnBtnUpClick = DYerBtnUpClick + end end object ToolBar2: TToolBar Left = 0 diff --git a/管理系统/U_ClothContractInPut_Tp.pas b/管理系统/U_ClothContractInPut_Tp.pas index 51dec8b..31c2de8 100644 --- a/管理系统/U_ClothContractInPut_Tp.pas +++ b/管理系统/U_ClothContractInPut_Tp.pas @@ -95,6 +95,8 @@ type Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; Tv1Column3: TcxGridDBColumn; + Label13: TLabel; + DYer: TBtnEditC; procedure TBCloseClick(Sender: TObject); procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); procedure Button1Click(Sender: TObject); @@ -125,6 +127,7 @@ type procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure OrdPerson1BtnClick(Sender: TObject); procedure CustomerNoNameBtnUpClick(Sender: TObject); + procedure DYerBtnUpClick(Sender: TObject); private FXS: Integer; procedure InitData(); @@ -487,6 +490,11 @@ begin v1ClothQty.Visible:=True; v1PRTQty.Visible:=True; end; } + if Trim(FConType) = 'ƻ' then + begin + Label13.Visible := True; + DYer.Visible := True; + end; readCXgrid(self.Caption, tv1); InitData(); end; @@ -1287,5 +1295,26 @@ begin end; end; +procedure TfrmClothContractInPut_Tp.DYerBtnUpClick(Sender: TObject); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'DYer'; + flagname := ''; + if Trim(DParameters1) <> 'Ȩ' then + MainType := Trim(DName); + if ShowModal = 1 then + begin + DYer.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); +// CustomerNoName.TxtCode := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString); + end; + end; + finally + frmZDYHelp.Free; + end; +end; + end. diff --git a/管理系统/U_ClothContractList.dfm b/管理系统/U_ClothContractList.dfm index 62154cf..c838eec 100644 --- a/管理系统/U_ClothContractList.dfm +++ b/管理系统/U_ClothContractList.dfm @@ -668,6 +668,12 @@ object frmClothContractList: TfrmClothContractList HeaderAlignmentHorz = taCenter Width = 80 end + object Tv1Column2: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'SSel' + HeaderAlignmentHorz = taCenter + Width = 60 + end end object cxGrid1Level1: TcxGridLevel GridView = Tv1 diff --git a/管理系统/U_ClothContractList.pas b/管理系统/U_ClothContractList.pas index ba83188..69f09f6 100644 --- a/管理系统/U_ClothContractList.pas +++ b/管理系统/U_ClothContractList.pas @@ -125,6 +125,7 @@ type v1Column22: TcxGridDBColumn; v1Column23: TcxGridDBColumn; Tv1Column1: TcxGridDBColumn; + Tv1Column2: TcxGridDBColumn; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); @@ -255,7 +256,7 @@ begin begin // TBEdit.Enabled := true; TBDel.Enabled := true; - Tchk.Enabled := true; + Tchk.Enabled := true; Tth.Enabled := true; end; if cxTabControl1.TabIndex = 1 then @@ -323,7 +324,7 @@ begin v1T_money.Hidden := true; v1T_price.Visible := false; v1T_price.Hidden := true; - ScrollBox1.Enabled := false; + ScrollBox1.Enabled := false; for i := 0 to tv1.ColumnCount - 1 do begin tv1.Columns[i].Options.Editing := false; diff --git a/管理系统/U_ClothContractList_DY.dfm b/管理系统/U_ClothContractList_DY.dfm new file mode 100644 index 0000000..75d84ca --- /dev/null +++ b/管理系统/U_ClothContractList_DY.dfm @@ -0,0 +1,823 @@ +object frmClothContractList_DY: TfrmClothContractList_DY + Left = 265 + Top = 182 + Width = 1222 + Height = 663 + Caption = #25171#26679#35745#21010#20449#24687 + 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 = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + OnClick = TBAddClick + end + object TJj: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #21152#24613 + ImageIndex = 60 + OnClick = TJjClick + end + object TnoJj: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #25764#38144#21152#24613 + ImageIndex = 99 + OnClick = TnoJjClick + end + object ToolButton2: TToolButton + Left = 339 + Top = 0 + Caption = #22238#20462#26032#22686 + ImageIndex = 57 + Visible = False + OnClick = ToolButton2Click + end + object TBEdit: TToolButton + Left = 422 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 485 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + OnClick = TBDelClick + end + object Tchk: TToolButton + Left = 548 + Top = 0 + AutoSize = True + Caption = #30830#35748#23436#25104 + ImageIndex = 41 + OnClick = TchkClick + end + object TNochk: TToolButton + Left = 635 + Top = 0 + AutoSize = True + Caption = #25764#38144#23436#25104 + ImageIndex = 48 + OnClick = TNochkClick + end + object ToolButton1: TToolButton + Left = 722 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 785 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 848 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 911 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #25237#22383#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #39068#33394 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 39 + Height = 12 + Caption = #21152#24037#21378 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Color: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 748 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 107 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Column9 + end + item + Kind = skSum + Column = v1Qty2 + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1Ssel: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'Ssel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 50 + end + object v1OrderNo: TcxGridDBColumn + Caption = #25237#22383#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #25237#22383#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 73 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1C_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MFQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty2: TcxGridDBColumn + Caption = #32568#25968 + DataBinding.FieldName = 'Qty2' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'C_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1C_Unit: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column9: TcxGridDBColumn + Caption = #26410#23436#25104#25968#37327 + DataBinding.FieldName = 'N_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclFuchsia + Styles.Footer = cxStyle_fontclFuchsia + Styles.Header = cxStyle_fontclFuchsia + Width = 70 + end + object v1Column10: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column11: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column12: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column13: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column1: TcxGridDBColumn + DataBinding.FieldName = 'IsZt' + Visible = False + end + object Tv1Column1: TcxGridDBColumn + Caption = #21152#24613 + DataBinding.FieldName = 'Jiaji' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 85 + Width = 1206 + Height = 22 + Align = alTop + TabOrder = 3 + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 0 + Properties.Tabs.Strings = ( + #26410#23436#25104 + #24050#23436#25104 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectBottom = 22 + ClientRectRight = 1206 + ClientRectTop = 19 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 624 + Top = 248 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 944 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 888 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 924 + Top = 212 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = 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 = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 804 + Top = 44 + end + object cxStyleRepository1: TcxStyleRepository + Left = 69 + Top = 130 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractList_DY.pas b/管理系统/U_ClothContractList_DY.pas new file mode 100644 index 0000000..9bcc8ab --- /dev/null +++ b/管理系统/U_ClothContractList_DY.pas @@ -0,0 +1,900 @@ +unit U_ClothContractList_DY; + +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, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, + 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; + +type + TfrmClothContractList_DY = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Color: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + cxTabControl1: TcxTabControl; + v1C_Unit: TcxGridDBColumn; + Tchk: TToolButton; + TNochk: TToolButton; + ToolButton1: TToolButton; + v1Qty2: TcxGridDBColumn; + v1C_Color: TcxGridDBColumn; + v1Column9: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + v1Ssel: TcxGridDBColumn; + v1Column10: TcxGridDBColumn; + v1Column11: TcxGridDBColumn; + v1Column12: TcxGridDBColumn; + v1Column13: TcxGridDBColumn; + v1Column1: TcxGridDBColumn; + ToolButton2: TToolButton; + TJj: TToolButton; + TnoJj: TToolButton; + Tv1Column1: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure cxTabControl1Change(Sender: TObject); + procedure TchkClick(Sender: TObject); + procedure TNochkClick(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure ToolButton2Click(Sender: TObject); + procedure TJjClick(Sender: TObject); + procedure TnoJjClick(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractList_DY: TfrmClothContractList_DY; + +implementation + +uses + U_DataLink, U_ClothContractInPut_TP, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractList_DY.FormDestroy(Sender: TObject); +begin + frmClothContractList_DY := nil; +end; + +procedure TfrmClothContractList_DY.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractList_DY.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractList_DY.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractList_DY.InitGrid(); +var + strwhere: string; +begin + strwhere := ''; + if cxTabControl1.TabIndex < 2 then +// strwhere := strwhere + ' and isnull(A.status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + strwhere := strwhere + ' and isnull(B.C_status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + if (trim(fDParameters1) = 'ѯ') then + strwhere := strwhere + ' and A.Filler=''''' + Trim(DName) + ''''' '; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('exec P_Get_Contract_TG'); + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); +// sql.Add(',@conType= '''+TconType+''' '); + sql.Add(',@status=''' + strwhere + ''' '); +// ShowMessage(sql.text); + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + end; +end; + +procedure TfrmClothContractList_DY.InitForm(); +begin +// if fDParameters1 = 'ѯ' then +// begin +// TBADD.Visible := false; +// TBEdit.Visible := false; +// TBDel.Visible := false; +// Tchk.Visible := false; +// TNochk.Visible := false; +// // Tth.Visible:=false; +// //ToolButton1.Visible:=false; +// end; + + TBEdit.Enabled := false; + TBDel.Enabled := false; + Tchk.Enabled := false; + TNochk.Enabled := false; + if cxTabControl1.TabIndex = 0 then + begin + TBEdit.Enabled := true; + TBDel.Enabled := true; + Tchk.Enabled := true; + end; + if cxTabControl1.TabIndex = 1 then + begin + TNochk.Enabled := true; + end; +end; + +procedure TfrmClothContractList_DY.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 TfrmClothContractList_DY.TBEditClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + FConType := Trim(Self.Order_Main.fieldbyname('ConType').AsString); + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_DY.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from JYOrder_Sub_AnPai '); + sql.Add('where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('ѻز֣ɾͶƻ', 'ʾ', 0); + Exit; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractList_DY.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_DY.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ɫƻб', cxGrid1); +end; + +procedure TfrmClothContractList_DY.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'), 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_DY.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractList_DY.TBAddClick(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'ƻ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_DY.ConNoChange(Sender: TObject); +var + str1: string; +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_DY.FormShow(Sender: TObject); +begin + InitForm(); + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp); + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + InitGrid(); +end; + +procedure TfrmClothContractList_DY.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractList_DY.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractList_DY.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_DY.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractList_DY.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractList_DY.cxTabControl1Change(Sender: TObject); +begin + initForm(); + InitGrid(); +end; + +procedure TfrmClothContractList_DY.TchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_DY.TNochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_DY.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractList_DY.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + tbsave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractInPut_Tp.Free; + end; +end; + +procedure TfrmClothContractList_DY.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +{ IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('N_Qty').Index]=0 then + begin + ACanvas.Brush.Color:=clSkyBlue; + end; } + if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Jiaji').Index] = 'Ӽ' then + begin + ACanvas.Brush.Color := Clred; + end; + +end; + +procedure TfrmClothContractList_DY.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin + FBounds := AViewInfo.Bounds; + if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then + begin + ACanvas.FillRect(FBounds); + ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); + FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); + InflateRect(FBounds, -1, -1); + ACanvas.Font.Color := clBlack; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); + ADone := True; + end; +end; + +procedure TfrmClothContractList_DY.ToolButton2Click(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'ɫƻ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_DY.TJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji=''Ӽ'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_DY.TnoJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji='''' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +end. + diff --git a/管理系统/U_ClothContractList_XPKF.dfm b/管理系统/U_ClothContractList_XPKF.dfm new file mode 100644 index 0000000..7c9abbd --- /dev/null +++ b/管理系统/U_ClothContractList_XPKF.dfm @@ -0,0 +1,823 @@ +object frmClothContractList_XPKF: TfrmClothContractList_XPKF + Left = 265 + Top = 182 + Width = 1222 + Height = 663 + Caption = #26032#21697#24320#21457#20449#24687 + 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 = 1206 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 83 + Caption = 'ToolBar1' + Color = clSkyBlue + Flat = True + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + Images = DataLink_TradeManage.ThreeImgList + List = True + ParentColor = False + ParentFont = False + ShowCaptions = True + TabOrder = 0 + object TBRafresh: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #21047#26032 + ImageIndex = 2 + OnClick = TBRafreshClick + end + object TBFind: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #36807#28388 + ImageIndex = 59 + OnClick = TBFindClick + end + object TBAdd: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #26032#22686 + ImageIndex = 3 + OnClick = TBAddClick + end + object TJj: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #21152#24613 + ImageIndex = 60 + OnClick = TJjClick + end + object TnoJj: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #25764#38144#21152#24613 + ImageIndex = 99 + OnClick = TnoJjClick + end + object ToolButton2: TToolButton + Left = 339 + Top = 0 + Caption = #22238#20462#26032#22686 + ImageIndex = 57 + Visible = False + OnClick = ToolButton2Click + end + object TBEdit: TToolButton + Left = 422 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 54 + OnClick = TBEditClick + end + object TBDel: TToolButton + Left = 485 + Top = 0 + AutoSize = True + Caption = #21024#38500 + ImageIndex = 17 + OnClick = TBDelClick + end + object Tchk: TToolButton + Left = 548 + Top = 0 + AutoSize = True + Caption = #30830#35748#23436#25104 + ImageIndex = 41 + OnClick = TchkClick + end + object TNochk: TToolButton + Left = 635 + Top = 0 + AutoSize = True + Caption = #25764#38144#23436#25104 + ImageIndex = 48 + OnClick = TNochkClick + end + object ToolButton1: TToolButton + Left = 722 + Top = 0 + AutoSize = True + Caption = #26597#30475 + ImageIndex = 58 + OnClick = ToolButton1Click + end + object TBExport: TToolButton + Left = 785 + Top = 0 + AutoSize = True + Caption = #23548#20986 + ImageIndex = 75 + OnClick = TBExportClick + end + object TBPrint: TToolButton + Left = 848 + Top = 0 + AutoSize = True + Caption = #25171#21360 + ImageIndex = 12 + OnClick = TBPrintClick + end + object TBClose: TToolButton + Left = 911 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 55 + OnClick = TBCloseClick + end + end + object Panel1: TPanel + Left = 0 + Top = 32 + Width = 1206 + Height = 53 + Align = alTop + BevelInner = bvRaised + BevelOuter = bvLowered + Color = clSkyBlue + TabOrder = 1 + object Label1: TLabel + Left = 23 + Top = 22 + Width = 52 + Height = 12 + Caption = #30331#35760#26085#26399 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label2: TLabel + Left = 161 + Top = 22 + Width = 6 + Height = 12 + Caption = '-' + end + object Label3: TLabel + Left = 271 + Top = 22 + Width = 52 + Height = 12 + Caption = #25237#22383#21333#21495 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label5: TLabel + Left = 420 + Top = 22 + Width = 52 + Height = 12 + Caption = #20135#21697#21517#31216 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label4: TLabel + Left = 572 + Top = 22 + Width = 26 + Height = 12 + Caption = #39068#33394 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object Label6: TLabel + Left = 704 + Top = 22 + Width = 39 + Height = 12 + Caption = #21152#24037#21378 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + ParentFont = False + end + object BegDate: TDateTimePicker + Left = 76 + Top = 18 + Width = 85 + Height = 20 + Date = 40675.464742650460000000 + Format = 'yyyy-MM-dd' + Time = 40675.464742650460000000 + TabOrder = 0 + end + object EndDate: TDateTimePicker + Left = 167 + Top = 18 + Width = 86 + Height = 20 + Date = 40675.464761099540000000 + Format = 'yyyy-MM-dd' + Time = 40675.464761099540000000 + TabOrder = 1 + end + object ConNo: TEdit + Tag = 2 + Left = 329 + Top = 18 + Width = 81 + Height = 20 + TabOrder = 2 + OnChange = ConNoChange + end + object C_CodeName: TEdit + Tag = 2 + Left = 473 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 3 + OnChange = ConNoChange + end + object C_Color: TEdit + Tag = 2 + Left = 600 + Top = 18 + Width = 83 + Height = 20 + TabOrder = 4 + OnChange = ConNoChange + end + object FactoryNoName: TEdit + Tag = 2 + Left = 748 + Top = 18 + Width = 80 + Height = 20 + TabOrder = 5 + OnChange = ConNoChange + end + end + object ScrollBox1: TScrollBox + Left = 0 + Top = 107 + Width = 1206 + Height = 497 + Align = alTop + BorderStyle = bsNone + TabOrder = 2 + object cxGrid1: TcxGrid + Left = 0 + Top = 0 + Width = 1206 + Height = 497 + Align = alClient + TabOrder = 0 + object Tv1: TcxGridDBTableView + OnMouseDown = Tv1MouseDown + Navigator.Buttons.CustomButtons = <> + OnCellDblClick = Tv1CellDblClick + OnCustomDrawCell = Tv1CustomDrawCell + DataController.DataSource = DataSource1 + DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost] + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = < + item + Kind = skSum + Column = v1PRTOrderQty + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + end + item + Kind = skSum + Column = v1Column9 + end + item + Kind = skSum + Column = v1Qty2 + end + item + Kind = skSum + Column = v1Qty1 + end + item + Kind = skSum + end + item + Kind = skSum + end> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsView.Footer = True + OptionsView.GroupByBox = False + OptionsView.Indicator = True + OptionsView.IndicatorWidth = 20 + Styles.Inactive = DataLink_TradeManage.SHuangSe + Styles.IncSearch = DataLink_TradeManage.SHuangSe + Styles.Selection = DataLink_TradeManage.SHuangSe + Styles.Header = DataLink_TradeManage.Default + OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell + object v1Ssel: TcxGridDBColumn + Caption = #36873#25321 + DataBinding.FieldName = 'Ssel' + PropertiesClassName = 'TcxCheckBoxProperties' + Properties.ImmediatePost = True + Properties.NullStyle = nssUnchecked + HeaderAlignmentHorz = taCenter + Width = 50 + end + object v1OrderNo: TcxGridDBColumn + Caption = #25237#22383#21333#21495 + DataBinding.FieldName = 'ConNo' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 65 + end + object v1DeliveryDate: TcxGridDBColumn + Caption = #25237#22383#26085#26399 + DataBinding.FieldName = 'DeliveryDate' + PropertiesClassName = 'TcxDateEditProperties' + Properties.SaveTime = False + Properties.ShowTime = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1Column2: TcxGridDBColumn + Caption = #20135#21697#21517#31216 + DataBinding.FieldName = 'C_CodeName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 73 + end + object v1Column5: TcxGridDBColumn + Caption = #31614#35746#26085#26399 + DataBinding.FieldName = 'QDTime' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 70 + end + object v1FactoryNo1Name: TcxGridDBColumn + Caption = #21152#24037#21378 + DataBinding.FieldName = 'FactoryNoName' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 60 + end + object v1PRTSpec: TcxGridDBColumn + Caption = #35268#26684 + DataBinding.FieldName = 'C_Spec' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 66 + end + object v1C_Color: TcxGridDBColumn + Caption = #39068#33394 + DataBinding.FieldName = 'C_Color' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1PRTMF: TcxGridDBColumn + Caption = #38376#24133'(cm)' + DataBinding.FieldName = 'MFQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 61 + end + object v1PRTKZ: TcxGridDBColumn + Caption = #20811#37325'(g/'#13217')' + DataBinding.FieldName = 'KZQty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 83 + end + object v1Qty2: TcxGridDBColumn + Caption = #32568#25968 + DataBinding.FieldName = 'Qty2' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 60 + end + object v1Qty1: TcxGridDBColumn + Caption = #21305#25968 + DataBinding.FieldName = 'Qty1' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 46 + end + object v1PRTOrderQty: TcxGridDBColumn + Caption = #25968#37327 + DataBinding.FieldName = 'C_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclBlue + Styles.Footer = cxStyle_fontclBlue + Styles.Header = cxStyle_fontclBlue + Width = 58 + end + object v1OrderUnit: TcxGridDBColumn + Caption = #21333#20301 + DataBinding.FieldName = 'C_Unit' + Visible = False + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 47 + end + object v1C_Unit: TcxGridDBColumn + Caption = #25968#37327#21333#20301 + DataBinding.FieldName = 'C_Unit' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column4: TcxGridDBColumn + Caption = #22791#27880 + DataBinding.FieldName = 'C_Note' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 68 + end + object v1Column3: TcxGridDBColumn + Caption = #32852#31995#20154 + DataBinding.FieldName = 'LXPerson' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column6: TcxGridDBColumn + Caption = #32852#31995#26041#24335 + DataBinding.FieldName = 'LXTel' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Header = DataLink_TradeManage.Default + Width = 63 + end + object v1Column9: TcxGridDBColumn + Caption = #26410#23436#25104#25968#37327 + DataBinding.FieldName = 'N_Qty' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Styles.Content = cxStyle_fontclFuchsia + Styles.Footer = cxStyle_fontclFuchsia + Styles.Header = cxStyle_fontclFuchsia + Width = 70 + end + object v1Column10: TcxGridDBColumn + Caption = #21046#21333#20154 + DataBinding.FieldName = 'Filler' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column11: TcxGridDBColumn + Caption = #21046#21333#26102#38388 + DataBinding.FieldName = 'FillTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column12: TcxGridDBColumn + Caption = #20462#25913#20154 + DataBinding.FieldName = 'editer' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 60 + end + object v1Column13: TcxGridDBColumn + Caption = #20462#25913#26102#38388 + DataBinding.FieldName = 'editTime' + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object v1Column1: TcxGridDBColumn + DataBinding.FieldName = 'IsZt' + Visible = False + end + object Tv1Column1: TcxGridDBColumn + Caption = #21152#24613 + DataBinding.FieldName = 'Jiaji' + HeaderAlignmentHorz = taCenter + Width = 60 + end + end + object cxGrid1Level1: TcxGridLevel + GridView = Tv1 + end + end + end + object cxTabControl1: TcxTabControl + Left = 0 + Top = 85 + Width = 1206 + Height = 22 + Align = alTop + TabOrder = 3 + Properties.CustomButtons.Buttons = <> + Properties.Style = 9 + Properties.TabIndex = 0 + Properties.Tabs.Strings = ( + #26410#23436#25104 + #24050#23436#25104 + #20840#37096) + OnChange = cxTabControl1Change + ClientRectBottom = 22 + ClientRectRight = 1206 + ClientRectTop = 19 + end + object cxGridPopupMenu1: TcxGridPopupMenu + Grid = cxGrid1 + PopupMenus = <> + Left = 1128 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_TradeManage.ADOLink + Parameters = <> + Left = 936 + end + object ADOQueryMain: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1000 + end + object ADOQueryTemp: TADOQuery + Connection = DataLink_TradeManage.ADOLink + LockType = ltReadOnly + Parameters = <> + Left = 1040 + Top = 8 + end + object DataSource1: TDataSource + DataSet = Order_Main + Left = 1168 + Top = 8 + end + object Order_Main: TClientDataSet + Aggregates = <> + Params = <> + Left = 624 + Top = 248 + end + object ClientDataSet3: TClientDataSet + Aggregates = <> + Params = <> + Left = 944 + Top = 240 + end + object DataSource2: TDataSource + DataSet = ClientDataSet2 + Left = 888 + Top = 176 + end + object DataSource3: TDataSource + DataSet = ClientDataSet3 + Left = 1112 + Top = 216 + end + object ClientDataSet2: TClientDataSet + Aggregates = <> + Params = <> + Left = 924 + Top = 212 + end + object RM1: TRMGridReport + ThreadPrepareReport = True + InitialZoom = pzDefault + PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator] + DefaultCollate = 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 = 352 + Top = 192 + ReportData = {} + end + object RMDBMain: TRMDBDataSet + Visible = True + DataSet = CDS_PRT + Left = 400 + Top = 192 + end + object RMXLSExport1: TRMXLSExport + ShowAfterExport = True + ExportPrecision = 1 + PagesOfSheet = 1 + ExportImages = True + ExportFrames = True + ExportImageFormat = ifBMP + JPEGQuality = 0 + ScaleX = 1.000000000000000000 + ScaleY = 1.000000000000000000 + CompressFile = False + Left = 416 + Top = 248 + end + object CDS_PRT: TClientDataSet + Aggregates = <> + Params = <> + Left = 804 + Top = 44 + end + object cxStyleRepository1: TcxStyleRepository + Left = 69 + Top = 130 + PixelsPerInch = 96 + object cxStyle1: TcxStyle + AssignedValues = [svColor] + Color = clInactiveCaption + end + object cxStyle2: TcxStyle + AssignedValues = [svColor, svTextColor] + Color = 4707838 + TextColor = clBtnText + end + object cxStyle_gridRow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 16311512 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_gridFoot: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clBlack + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridHead: TcxStyle + AssignedValues = [svFont] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_gridGroupBox: TcxStyle + AssignedValues = [svColor, svFont] + Color = clMoneyGreen + Font.Charset = GB2312_CHARSET + Font.Color = clBlue + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_yellow: TcxStyle + AssignedValues = [svColor, svFont] + Color = 8454143 + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [] + end + object cxStyle_Red: TcxStyle + AssignedValues = [svColor, svFont] + Color = clRed + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + end + object cxStyle_fontBlack: TcxStyle + AssignedValues = [svFont] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + end + object cxStyle_fontclFuchsia: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clFuchsia + end + object cxStyle_fontclPurple: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clPurple + end + object cxStyle_fontclGreen: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clGreen + end + object cxStyle_fontclBlue: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = #23435#20307 + Font.Style = [fsBold] + TextColor = clBlue + end + object cxStyle_fontclTeal: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clTeal + end + object cxStyle_fontclOlive: TcxStyle + AssignedValues = [svFont, svTextColor] + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + TextColor = clOlive + end + end +end diff --git a/管理系统/U_ClothContractList_XPKF.pas b/管理系统/U_ClothContractList_XPKF.pas new file mode 100644 index 0000000..da4941c --- /dev/null +++ b/管理系统/U_ClothContractList_XPKF.pas @@ -0,0 +1,900 @@ +unit U_ClothContractList_XPKF; + +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, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class, + RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxPC, cxCheckBox, + cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, + 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; + +type + TfrmClothContractList_XPKF = class(TForm) + ToolBar1: TToolBar; + TBRafresh: TToolButton; + TBFind: TToolButton; + TBAdd: TToolButton; + TBEdit: TToolButton; + TBDel: TToolButton; + TBPrint: TToolButton; + TBClose: TToolButton; + Panel1: TPanel; + BegDate: TDateTimePicker; + EndDate: TDateTimePicker; + Label1: TLabel; + Label2: TLabel; + cxGridPopupMenu1: TcxGridPopupMenu; + ADOQueryCmd: TADOQuery; + ADOQueryMain: TADOQuery; + ADOQueryTemp: TADOQuery; + DataSource1: TDataSource; + Label3: TLabel; + ConNo: TEdit; + Label5: TLabel; + C_CodeName: TEdit; + TBExport: TToolButton; + Order_Main: TClientDataSet; + Label4: TLabel; + C_Color: TEdit; + ScrollBox1: TScrollBox; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + v1OrderNo: TcxGridDBColumn; + v1Column2: TcxGridDBColumn; + v1DeliveryDate: TcxGridDBColumn; + v1FactoryNo1Name: TcxGridDBColumn; + v1PRTSpec: TcxGridDBColumn; + v1PRTMF: TcxGridDBColumn; + v1PRTKZ: TcxGridDBColumn; + v1PRTOrderQty: TcxGridDBColumn; + v1OrderUnit: TcxGridDBColumn; + cxGrid1Level1: TcxGridLevel; + ClientDataSet3: TClientDataSet; + DataSource2: TDataSource; + DataSource3: TDataSource; + ClientDataSet2: TClientDataSet; + v1Qty1: TcxGridDBColumn; + RM1: TRMGridReport; + RMDBMain: TRMDBDataSet; + RMXLSExport1: TRMXLSExport; + v1Column4: TcxGridDBColumn; + v1Column5: TcxGridDBColumn; + v1Column3: TcxGridDBColumn; + v1Column6: TcxGridDBColumn; + CDS_PRT: TClientDataSet; + Label6: TLabel; + FactoryNoName: TEdit; + cxTabControl1: TcxTabControl; + v1C_Unit: TcxGridDBColumn; + Tchk: TToolButton; + TNochk: TToolButton; + ToolButton1: TToolButton; + v1Qty2: TcxGridDBColumn; + v1C_Color: TcxGridDBColumn; + v1Column9: TcxGridDBColumn; + cxStyleRepository1: TcxStyleRepository; + cxStyle1: TcxStyle; + cxStyle2: TcxStyle; + cxStyle_gridRow: TcxStyle; + cxStyle_gridFoot: TcxStyle; + cxStyle_gridHead: TcxStyle; + cxStyle_gridGroupBox: TcxStyle; + cxStyle_yellow: TcxStyle; + cxStyle_Red: TcxStyle; + cxStyle_fontBlack: TcxStyle; + cxStyle_fontclFuchsia: TcxStyle; + cxStyle_fontclPurple: TcxStyle; + cxStyle_fontclGreen: TcxStyle; + cxStyle_fontclBlue: TcxStyle; + cxStyle_fontclTeal: TcxStyle; + cxStyle_fontclOlive: TcxStyle; + v1Ssel: TcxGridDBColumn; + v1Column10: TcxGridDBColumn; + v1Column11: TcxGridDBColumn; + v1Column12: TcxGridDBColumn; + v1Column13: TcxGridDBColumn; + v1Column1: TcxGridDBColumn; + ToolButton2: TToolButton; + TJj: TToolButton; + TnoJj: TToolButton; + Tv1Column1: TcxGridDBColumn; + procedure FormDestroy(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormCreate(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure TBFindClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBExportClick(Sender: TObject); + procedure TBPrintClick(Sender: TObject); + procedure TBRafreshClick(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure ConNoChange(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ToolButton5Click(Sender: TObject); + procedure ToolButton3Click(Sender: TObject); + procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure cxTabControl1Change(Sender: TObject); + procedure TchkClick(Sender: TObject); + procedure TNochkClick(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); + procedure ToolButton1Click(Sender: TObject); + procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); + procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); + procedure ToolButton2Click(Sender: TObject); + procedure TJjClick(Sender: TObject); + procedure TnoJjClick(Sender: TObject); + private + FInt, PFInt: Integer; + procedure InitGrid(); + procedure InitForm(); + function DelData(): Boolean; + { Private declarations } + public + fDParameters1: string; + { Public declarations } + end; + +var + frmClothContractList_XPKF: TfrmClothContractList_XPKF; + +implementation + +uses + U_DataLink, U_ClothContractInPut_TP, U_Fun, U_ProductOrderList, U_ZDYHelp; + +{$R *.dfm} + +procedure TfrmClothContractList_XPKF.FormDestroy(Sender: TObject); +begin + frmClothContractList_XPKF := nil; +end; + +procedure TfrmClothContractList_XPKF.FormClose(Sender: TObject; var Action: TCloseAction); +begin + Action := caFree; +end; + +procedure TfrmClothContractList_XPKF.FormCreate(Sender: TObject); +begin + ScrollBox1.Align := alClient; +end; + +procedure TfrmClothContractList_XPKF.TBCloseClick(Sender: TObject); +begin + Close; + WriteCxGrid(self.Caption, Tv1, 'ָʾ'); +end; + +procedure TfrmClothContractList_XPKF.InitGrid(); +var + strwhere: string; +begin + strwhere := ''; + if cxTabControl1.TabIndex < 2 then +// strwhere := strwhere + ' and isnull(A.status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + strwhere := strwhere + ' and isnull(B.C_status,''''0'''')=''''' + inttostr(cxTabControl1.TabIndex) + ''''''; + if (trim(fDParameters1) = 'ѯ') then + strwhere := strwhere + ' and A.Filler=''''' + Trim(DName) + ''''' '; + try + ADOQueryMain.DisableControls; + with ADOQueryMain do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('exec P_Get_Contract_TG'); + sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' '); +// sql.Add(',@conType= '''+TconType+''' '); + sql.Add(',@status=''' + strwhere + ''' '); +// ShowMessage(sql.text); + Open; + end; + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); + finally + ADOQueryMain.EnableControls; + end; +end; + +procedure TfrmClothContractList_XPKF.InitForm(); +begin +// if fDParameters1 = 'ѯ' then +// begin +// TBADD.Visible := false; +// TBEdit.Visible := false; +// TBDel.Visible := false; +// Tchk.Visible := false; +// TNochk.Visible := false; +// // Tth.Visible:=false; +// //ToolButton1.Visible:=false; +// end; + + TBEdit.Enabled := false; + TBDel.Enabled := false; + Tchk.Enabled := false; + TNochk.Enabled := false; + if cxTabControl1.TabIndex = 0 then + begin + TBEdit.Enabled := true; + TBDel.Enabled := true; + Tchk.Enabled := true; + end; + if cxTabControl1.TabIndex = 1 then + begin + TNochk.Enabled := true; + end; +end; + +procedure TfrmClothContractList_XPKF.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 TfrmClothContractList_XPKF.TBEditClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + FConType := Trim(Self.Order_Main.fieldbyname('ConType').AsString); + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_XPKF.TBDelClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('select * from JYOrder_Sub_AnPai '); + sql.Add('where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + open; + end; + if not ADOQueryCmd.IsEmpty then + begin + Application.MessageBox('ѻز֣ɾͶƻ', 'ʾ', 0); + Exit; + end; + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + if trim(Order_Main.FieldByName('mainID').AsString) = 'CM001' then + exit; + if DelData() then + begin + Order_Main.Delete; + end; +end; + +function TfrmClothContractList_XPKF.DelData(): Boolean; +begin + try + Result := false; + ADOQueryCmd.Connection.BeginTrans; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete YF_Money_CR where MainID=''' + Trim(Order_Main.fieldbyname('MainID').AsString) + ''''); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)'); + // sql.Add(' where CRID='+CRID); + ExecSQL; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Main.fieldbyname('SubId').AsString) + ''''); + ExecSQL; + end; + with ADOQueryTemp do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + Open; + end; + if ADOQueryTemp.IsEmpty then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + if Trim(Order_Main.fieldbyname('SubId').AsString) = '' then + begin + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Main where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + ''''); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Result := True; + except + ADOQueryCmd.Connection.RollbackTrans; + Result := False; + Application.MessageBox('ɾ쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.TBExportClick(Sender: TObject); +begin + if ADOQueryMain.IsEmpty then + Exit; + TcxGridToExcel('ɫƻб', cxGrid1); +end; + +procedure TfrmClothContractList_XPKF.TBPrintClick(Sender: TObject); +var + fPrintFile, FConNoM: string; +begin + if Order_Main.IsEmpty then + Exit; + fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'; + with ADOQueryTemp do + begin + Filtered := False; + Close; + sql.Clear; + sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) '); + sql.Add('from Contract_Main A'); + sql.Add('inner join Contract_sub B on B.MainID=A.mainID '); + sql.Add('where A.FillTime>= ''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' '); + sql.Add('and A.FillTime< ''' + Trim(FormatDateTime('yyyy-MM-dd', endDate.DateTime + 1)) + ''' '); + sql.Add('and A.mainID=' + quotedstr(trim(Order_Main.fieldbyname('MainID').AsString))); + Open; + end; + SCreateCDS20(ADOQueryTemp, CDS_PRT); + SInitCDSData20(ADOQueryTemp, CDS_PRT); + if FileExists(fPrintFile) then + begin + RMVariables['dtxz'] := formatdateTime('yyyy-MM-dd', Now); + RMVariables['zdr'] := Trim(dName); + RM1.LoadFromFile(fPrintFile); + RM1.ShowReport; + end + else + begin + Application.MessageBox(PChar('û' + ExtractFilePath(Application.ExeName) + 'Report\Ͷ.rmf'), 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.TBRafreshClick(Sender: TObject); +begin + InitGrid(); +end; + +procedure TfrmClothContractList_XPKF.TBAddClick(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'Ʒ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_XPKF.ConNoChange(Sender: TObject); +var + str1: string; +begin + if ADOQueryMain.Active = False then + Exit; + SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2)); + + SCreateCDS20(ADOQueryMain, Order_Main); + SInitCDSData20(ADOQueryMain, Order_Main); +end; + +procedure TfrmClothContractList_XPKF.FormShow(Sender: TObject); +begin + InitForm(); + ReadCxGrid(self.Caption, Tv1, 'ָʾ'); + BegDate.DateTime := SGetServerDate10(ADOQueryTemp); + EndDate.DateTime := SGetServerDate10(ADOQueryTemp); + InitGrid(); +end; + +procedure TfrmClothContractList_XPKF.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 2; +end; + +procedure TfrmClothContractList_XPKF.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + FInt := 1; +end; + +procedure TfrmClothContractList_XPKF.ToolButton5Click(Sender: TObject); +var + maxno: string; +begin + if ClientDataSet3.IsEmpty then + Exit; + if ClientDataSet2.IsEmpty then + Exit; + if Trim(ClientDataSet2.fieldbyname('MXId').AsString) = '' then + begin + Application.MessageBox('δȷ', 'ʾ', 0); + Exit; + end; + if ClientDataSet3.Locate('OrderNo', null, []) then + begin + Application.MessageBox('ָŲΪգ', 'ʾ', 0); + Exit; + end; + BegDate.SetFocus; + try + ADOQueryCmd.Connection.BeginTrans; + //ȥ + with ClientDataSet3 do + begin + First; + while not eof do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + begin + if GetLSNo(ADOQueryCmd, maxno, 'To', 'Contract_Sub_MxTo', 4, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('ȡȥˮʧܣ', 'ʾ', 0); + Exit; + end; + end + else + begin + maxno := Trim(ClientDataSet3.fieldbyname('ToId').AsString); + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('select * from Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + Open; + end; + with ADOQueryCmd do + begin + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) = '' then + Append + else + Edit; + FieldByName('MxId').Value := Trim(ClientDataSet2.fieldbyname('MxId').AsString); + FieldByName('ToId').Value := Trim(maxno); + FieldByName('OrdSubId').Value := Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString); + FieldByName('TPDate').Value := ClientDataSet3.fieldbyname('TPDate').Value; + FieldByName('TPPerson').Value := ClientDataSet3.fieldbyname('TPPerson').Value; + FieldByName('TPNote').Value := ClientDataSet3.fieldbyname('TPNote').Value; + if Trim(ClientDataSet3.fieldbyname('TPQty').AsString) <> '' then + FieldByName('TPQty').Value := ClientDataSet3.fieldbyname('TPQty').Value + else + FieldByName('TPQty').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty1').AsString) <> '' then + FieldByName('Qty1').Value := ClientDataSet3.fieldbyname('Qty1').Value + else + FieldByName('Qty1').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty2').AsString) <> '' then + FieldByName('Qty2').Value := ClientDataSet3.fieldbyname('Qty2').Value + else + FieldByName('Qty2').Value := 0; + if Trim(ClientDataSet3.fieldbyname('Qty3').AsString) <> '' then + FieldByName('Qty3').Value := ClientDataSet3.fieldbyname('Qty3').Value + else + FieldByName('Qty3').Value := 0; + Post; + end; + with ClientDataSet3 do + begin + Edit; + FieldByName('ToId').Value := Trim(maxno); + Post; + end; + Next; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + Application.MessageBox('ɹ', 'ʾ', 0); + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('쳣', 'ʾ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.ToolButton3Click(Sender: TObject); +begin + if FInt = 2 then + begin + if ClientDataSet2.IsEmpty then + Exit; + if ClientDataSet3.IsEmpty = false then + begin + Application.MessageBox('Ѳݣɾ¼', 'ʾ', 0); + Exit; + end; + if Trim(ClientDataSet2.fieldbyname('MxId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_Mx where MxId=''' + Trim(ClientDataSet2.fieldbyname('MxId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet2.Delete; + end + else if FInt = 3 then + begin + if ClientDataSet3.IsEmpty then + Exit; + if Trim(ClientDataSet3.fieldbyname('ToId').AsString) <> '' then + begin + if Application.MessageBox('ȷҪɾ', 'ʾ', 32 + 4) <> IDYES then + Exit; + end; + with ADOQueryCmd do + begin + Close; + sql.Clear; + sql.Add('delete Contract_Sub_MxTo where ToId=''' + Trim(ClientDataSet3.fieldbyname('ToId').AsString) + ''''); + ExecSQL; + end; + ClientDataSet3.Delete; + with ClientDataSet2 do + begin + Edit; + if ClientDataSet3.IsEmpty = False then + // FieldByName('KCSL').Value:=ClientDataSet2.fieldbyname('MxQty').Value-tv3.DataController.Summary.FooterSummaryValues[0] + + else + FieldByName('KCSL').Value := ClientDataSet2.fieldbyname('MxQty').Value; + Post; + end; + end; +end; + +procedure TfrmClothContractList_XPKF.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); +begin + try + frmZDYHelp := TfrmZDYHelp.Create(Application); + with frmZDYHelp do + begin + flag := 'RKPlace'; + flagname := 'ص'; + if ShowModal = 1 then + begin + with ClientDataSet2 do + begin + Edit; + FieldByName('RKPlace').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString); + end; + end; + end; + finally + frmZDYHelp.Free; + end; +end; + +procedure TfrmClothContractList_XPKF.cxTabControl1Change(Sender: TObject); +begin + initForm(); + InitGrid(); +end; + +procedure TfrmClothContractList_XPKF.TchkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''1'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.TNochkClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_sub SET C_status=''0'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); + sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean); +begin + ToolButton1.Click; +end; + +procedure TfrmClothContractList_XPKF.ToolButton1Click(Sender: TObject); +begin + if Order_Main.IsEmpty then + Exit; + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 1; + tbsave.Enabled := false; + FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString); + if ShowModal = 1 then + begin + + end; + end; + finally + frmClothContractInPut_Tp.Free; + end; +end; + +procedure TfrmClothContractList_XPKF.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); +begin +{ IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('N_Qty').Index]=0 then + begin + ACanvas.Brush.Color:=clSkyBlue; + end; } + if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Jiaji').Index] = 'Ӽ' then + begin + ACanvas.Brush.Color := Clred; + end; + +end; + +procedure TfrmClothContractList_XPKF.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); +var + FValue: string; + FBounds: TRect; +begin + FBounds := AViewInfo.Bounds; + if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then + begin + ACanvas.FillRect(FBounds); + ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); + FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); + InflateRect(FBounds, -1, -1); + ACanvas.Font.Color := clBlack; + ACanvas.Brush.Style := bsClear; + ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); + ADone := True; + end; +end; + +procedure TfrmClothContractList_XPKF.ToolButton2Click(Sender: TObject); +begin + try + frmClothContractInPut_Tp := TfrmClothContractInPut_Tp.Create(Application); + with frmClothContractInPut_Tp do + begin + PState := 0; + FMainId := ''; + FConType := 'ɫƻ'; + if ShowModal = 1 then + begin + TBRafresh.Click; + end; + end; + finally + frmClothContractInPut_Tp.Free; + TBRafresh.Click; + end; +end; + +procedure TfrmClothContractList_XPKF.TJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji=''Ӽ'' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +procedure TfrmClothContractList_XPKF.TnoJjClick(Sender: TObject); +begin + if Order_Main.IsEmpty then + exit; + if Order_Main.Locate('ssel', true, []) = false then + begin + Application.MessageBox('ûѡ!', 'ʾ', 0); + Exit; + end; + try + ADOQueryCmd.Connection.BeginTrans; + with Order_Main do + begin + DisableControls; + First; + while not eof do + begin + if Fieldbyname('ssel').AsBoolean then + begin + with ADOQueryCmd do + begin + close; + sql.Clear; + sql.Add('update Contract_main SET Jiaji='''' '); + sql.Add('where mainID =' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString))); +// sql.Add('and subID =' + quotedstr(trim(Order_Main.fieldbyname('subID').AsString))); + execsql; + end; + end; + next; + end; + First; + EnableControls; + end; + + InitGrid(); + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + application.MessageBox('ʧܣ', 'ʾϢ', 0); + end; +end; + +end. + diff --git a/管理系统/U_GetDllForm.pas b/管理系统/U_GetDllForm.pas index cf1b930..d0133c2 100644 --- a/管理系统/U_GetDllForm.pas +++ b/管理系统/U_GetDllForm.pas @@ -33,7 +33,8 @@ uses U_CP_COL_XL_ZD, U_CKPDlist, U_ClothContractList_HZ, U_ProductOrderNewList_ZD, U_ClothContractList_SJDCK, U_KH_XS_YP_list, U_ProductOrderNewList_BH, U_ClothContractList_HZ1, U_ClothContractList_CP, U_ClothContractList_SJD, - U_ClothContractList_Dp, U_ClothContractList_SJDMX, U_ClothContractList_PBKC; + U_ClothContractList_XPKF, U_ClothContractList_DY, U_ClothContractList_Dp, + U_ClothContractList_SJDMX, U_ClothContractList_PBKC; ///////////////////////////////////////////////////////////////// // ˵:ȡDllеô // @@ -658,12 +659,12 @@ begin FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; - //show; + //show; end; end else frmClothContractList_CG.BringToFront; - // + // mnewHandle := frmClothContractList_CG.Handle; end; @@ -729,6 +730,46 @@ begin mnewHandle := frmClothContractList_Dp.Handle; end; + 126: //Ʒƻ + begin + if frmClothContractList_XPKF = nil then + begin + frmClothContractList_XPKF := TfrmClothContractList_XPKF.Create(application.MainForm); + with frmClothContractList_XPKF do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothContractList_XPKF.BringToFront; + // + mnewHandle := frmClothContractList_XPKF.Handle; + end; + 127: //ƻ + begin + if frmClothContractList_DY = nil then + begin + frmClothContractList_DY := TfrmClothContractList_DY.Create(application.MainForm); + with frmClothContractList_DY do + begin + caption := Trim(Title); + fDParameters1 := trim(DParameters1); + FormStyle := mstyle; + windowState := mstate; + BorderStyle := mborderstyle; + //show; + end; + end + else + frmClothContractList_DY.BringToFront; + // + mnewHandle := frmClothContractList_DY.Handle; + end; 154: //ѯ begin if frmClothContractList_Help = nil then