合同 坯布仓库

This commit is contained in:
funa 2026-11-04 17:22:39 +08:00
parent 764a2b925d
commit 6bdaaf1b9a
8 changed files with 575 additions and 10 deletions

View File

@ -75,7 +75,7 @@ begin
pswd := 'right,.soft@2377';
DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server;
// Parameters1 := '¼Èë';
Parameters1 := '管理';
Parameters1 := '¼Èë';
end
else

View File

@ -883,8 +883,8 @@ begin
with frmCompanySel do
begin
FCoType := '¿Í»§';
if Self.FAuthority = '录入' then
FAuthority := '理单业务';
// if Self.FAuthority = '录入' then
// FAuthority := '理单业务';
if ShowModal = 1 then
begin
self.BuyName.TxtCode := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString);

View File

@ -409,11 +409,11 @@ begin
sql.Add(' from BS_Contract_Main A ) AA ');
sql.Add('where 1=1 ' + (WSql));
sql.Add(' and AA.ConType in (''ÄÚÏú'',''ÍâÏú'') ');
if Trim(FAuthority) = '¼Èë' then
begin
sql.Add(' and ( SalesId=' + quotedstr(trim(DCode)) + ' or exists (select * from [dbo].[F_Tool_SplitString](TallyId,'','') X where X.RTValue =' + quotedstr(trim(DCode)) + '))');
end;
//
// if Trim(FAuthority) = '¼Èë' then
// begin
// sql.Add(' and ( SalesId=' + quotedstr(trim(DCode)) + ' or exists (select * from [dbo].[F_Tool_SplitString](TallyId,'','') X where X.RTValue =' + quotedstr(trim(DCode)) + '))');
// end;
case cxTabControl1.TabIndex of
0:

View File

@ -33,7 +33,8 @@ uses
U_TatClothStkHZListSEL in 'U_TatClothStkHZListSEL.pas' {frmTatClothStkHZListSEL},
U_TatClothInfoSel in '..\A00通用窗体\U_TatClothInfoSel.pas' {frmTatClothInfoSel},
U_SalesContractSel in '..\A00通用窗体\U_SalesContractSel.pas' {frmSalesContractSel},
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas';
uSZHN_JSON in '..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas',
U_TatClothJXCList in 'U_TatClothJXCList.pas' {frmTatClothJXCList};
{$R *.res}

View File

@ -169,6 +169,10 @@
<Form>frmSalesContractSel</Form>
</DCCReference>
<DCCReference Include="..\..\..\public10\ThreeFun\Fun\uSZHN_JSON.pas"/>
<DCCReference Include="U_TatClothJXCList.pas">
<Form>frmTatClothJXCList</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>

View File

@ -17,7 +17,7 @@ implementation
uses
U_DataLink, U_iniParam, U_TatClothInEdit, U_TatClothInList, U_TatDRList,
U_TatClothDROutEdit, U_TatClothOutEdit, U_TatClothOutList, U_TatClothStkList,
U_TatClothStkHZList, U_TatClothCKHZList, U_TatClothRKHZList;
U_TatClothStkHZList, U_TatClothCKHZList, U_TatClothRKHZList, U_TatClothJXCList;
/////////////////////////////////////////////////////////////////
// 功能说明:取Dll中得窗体 //
@ -244,6 +244,18 @@ begin
end;
end;
888: //Å÷²¼½øÏú´æ
begin
with TfrmTatClothJXCList.Create(Application.MainForm, Title, trim(Parameters1), trim(Parameters2), trim(Parameters3), trim(Parameters4), trim(Parameters5), trim(Parameters10)) do //
begin
fFormID := FormID;
FormStyle := mstyle;
WindowState := mstate;
BorderStyle := mborderstyle;
mnewHandle := Handle;
end;
end;
10000:
begin
for i := 0 to application.MainForm.MDIChildCount - 1 do

View File

@ -0,0 +1,366 @@
inherited frmTatClothJXCList: TfrmTatClothJXCList
Left = 184
Top = 138
Caption = #22383#24067#36827#38144#23384
ClientHeight = 600
ClientWidth = 1540
FormStyle = fsMDIChild
Position = poScreenCenter
Visible = True
ExplicitWidth = 1556
ExplicitHeight = 639
PixelsPerInch = 96
TextHeight = 12
object ToolBar1: TToolBar [0]
Tag = 1
Left = 0
Top = 0
Width = 1540
Height = 38
AutoSize = True
ButtonHeight = 38
ButtonWidth = 91
Caption = 'ToolBar1'
Color = clWhite
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_TatClothStk.ImageList_new32
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object TBRafresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 1
OnClick = TBRafreshClick
end
object TBExport: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #23548#20986
ImageIndex = 20
OnClick = TBExportClick
end
object ToolButton4: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 16
OnClick = ToolButton4Click
end
object TBClose: TToolButton
Left = 237
Top = 0
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TBCloseClick
end
end
object Panel1: TPanel [1]
Left = 0
Top = 38
Width = 1540
Height = 67
Align = alTop
BevelInner = bvRaised
BevelOuter = bvLowered
Color = clWhite
ParentBackground = False
TabOrder = 1
object Label2: TLabel
Left = 70
Top = 36
Width = 12
Height = 12
Caption = #33267
end
object Label5: TLabel
Left = 190
Top = 10
Width = 52
Height = 12
Hint = '0'
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 Label1: TLabel
Left = 190
Top = 36
Width = 26
Height = 12
Hint = '0'
Caption = #23458#25143
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
end
object BegDate: TDateTimePicker
Left = 88
Top = 6
Width = 87
Height = 20
Date = 40768.000000000000000000
Time = 0.458268587972270300
TabOrder = 1
end
object EndDate: TDateTimePicker
Left = 88
Top = 32
Width = 87
Height = 20
Date = 40768.000000000000000000
Time = 0.458268587972270300
TabOrder = 2
end
object IsJYTime: TCheckBox
Left = 14
Top = 8
Width = 73
Height = 17
Caption = #26597#35810#26085#26399
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
OnClick = IsJYTimeClick
end
object C_Name: TEdit
Tag = 2
Left = 250
Top = 6
Width = 100
Height = 20
Hint = '0'
TabOrder = 3
OnKeyPress = FilterEditKeyPress
end
object ContractBuyName: TEdit
Tag = 2
Left = 250
Top = 32
Width = 100
Height = 20
Hint = '0'
TabOrder = 4
OnKeyPress = FilterEditKeyPress
end
end
object cxGrid1: TcxGrid [2]
Left = 0
Top = 105
Width = 1540
Height = 495
Align = alClient
BorderStyle = cxcbsNone
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
ParentFont = False
TabOrder = 2
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DS_1
DataController.Filter.AutoDataSetFilter = True
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <
item
Kind = skSum
Column = Tv1InJS
end
item
Kind = skSum
Column = Tv1InMeter
end
item
Kind = skSum
Column = Tv1InYardage
end
item
Kind = skSum
Column = Tv1OutJS
end
item
Kind = skSum
Column = Tv1OutMeter
end
item
Kind = skSum
Column = Tv1OutYardage
end
item
Kind = skSum
Column = Tv1StkJS
end
item
Kind = skSum
Column = Tv1StkMeter
end
item
Kind = skSum
Column = Tv1StkYardage
end>
DataController.Summary.SummaryGroups = <>
OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
OptionsView.IndicatorWidth = 30
Styles.IncSearch = DataLink_TatClothStk.SHuangSe
Styles.Footer = DataLink_TatClothStk.Default
Styles.Header = DataLink_TatClothStk.Default
Styles.Inactive = DataLink_TatClothStk.SHuangSe
Styles.Selection = DataLink_TatClothStk.SHuangSe
object Tv1ContractBuyName: TcxGridDBColumn
Caption = #23458#25143
DataBinding.FieldName = 'ContractBuyName'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 110
end
object Tv1CName: TcxGridDBColumn
Caption = #20135#21697#21517#31216
DataBinding.FieldName = 'C_Name'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 150
end
object Tv1InJS: TcxGridDBColumn
Caption = #20837#24211#21367#25968
DataBinding.FieldName = 'InJS'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
end
object Tv1InMeter: TcxGridDBColumn
Caption = #20837#24211#31859#25968
DataBinding.FieldName = 'InMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1InYardage: TcxGridDBColumn
Caption = #20837#24211#30721#25968
DataBinding.FieldName = 'InYardage'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1OutJS: TcxGridDBColumn
Caption = #20986#24211#21367#25968
DataBinding.FieldName = 'OutJS'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
end
object Tv1OutMeter: TcxGridDBColumn
Caption = #20986#24211#31859#25968
DataBinding.FieldName = 'OutMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1OutYardage: TcxGridDBColumn
Caption = #20986#24211#30721#25968
DataBinding.FieldName = 'OutYardage'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1StkJS: TcxGridDBColumn
Caption = #24211#23384#21367#25968
DataBinding.FieldName = 'StkJS'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 66
end
object Tv1StkMeter: TcxGridDBColumn
Caption = #24211#23384#31859#25968
DataBinding.FieldName = 'StkMeter'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
object Tv1StkYardage: TcxGridDBColumn
Caption = #24211#23384#30721#25968
DataBinding.FieldName = 'StkYardage'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
Options.Editing = False
Width = 70
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1
end
end
inherited ADOQueryBaseCmd: TADOQuery
Connection = DataLink_TatClothStk.ADOLink
Left = 553
Top = 200
end
inherited ADOQueryBaseTemp: TADOQuery
Connection = DataLink_TatClothStk.ADOLink
Left = 425
Top = 201
end
object ADOQueryMain: TADOQuery
Connection = DataLink_TatClothStk.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 252
Top = 260
end
object ADOQueryTemp: TADOQuery
Connection = DataLink_TatClothStk.ADOLink
LockType = ltReadOnly
CommandTimeout = 600
Parameters = <>
Left = 112
Top = 204
end
object DS_1: TDataSource
DataSet = CDS_1
Left = 828
Top = 284
end
object CDS_1: TClientDataSet
Aggregates = <>
Params = <>
Left = 776
Top = 284
end
end

View File

@ -0,0 +1,182 @@
unit U_TatClothJXCList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridCustomView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, ADODB, DBClient,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore,
dxScrollbarAnnotations, U_BaseList, dxSkinWXI, dxDateRanges;
type
TfrmTatClothJXCList = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBExport: TToolButton;
ToolButton4: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
Label2: TLabel;
Label5: TLabel;
Label1: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
IsJYTime: TCheckBox;
C_Name: TEdit;
ContractBuyName: TEdit;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
Tv1ContractBuyName: TcxGridDBColumn;
Tv1CName: TcxGridDBColumn;
Tv1InJS: TcxGridDBColumn;
Tv1InMeter: TcxGridDBColumn;
Tv1InYardage: TcxGridDBColumn;
Tv1OutJS: TcxGridDBColumn;
Tv1OutMeter: TcxGridDBColumn;
Tv1OutYardage: TcxGridDBColumn;
Tv1StkJS: TcxGridDBColumn;
Tv1StkMeter: TcxGridDBColumn;
Tv1StkYardage: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DS_1: TDataSource;
CDS_1: TClientDataSet;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure TBExportClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
procedure IsJYTimeClick(Sender: TObject);
procedure FilterEditKeyPress(Sender: TObject; var Key: Char);
private
procedure InitGrid();
{ Private declarations }
public
{ Public declarations }
end;
implementation
uses
U_DataLink, U_RTFun;
{$R *.dfm}
procedure TfrmTatClothJXCList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmTatClothJXCList.FormCreate(Sender: TObject);
begin
inherited;
EndDate.DateTime := SGetServerDateTime(ADOQueryTemp);
BegDate.DateTime := EndDate.DateTime - 20;
end;
procedure TfrmTatClothJXCList.InitGrid();
var
WSql, mDateSql: string;
begin
//出入库统计V_Tat_Cloth_IO(按查询日期), 当前库存统计V_Tat_Cloth_Stk(不受日期限制)
WSql := SGetFilters(Panel1, 1, 2);
if Trim(WSql) <> '' then
WSql := ' and ' + WSql;
mDateSql := '';
if IsJYTime.Checked then
begin
mDateSql := ' and IOTime>=' + QuotedStr(FormatDateTime('yyyy-MM-dd', BegDate.DateTime));
mDateSql := mDateSql + ' and IOTime<' + QuotedStr(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1));
end;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
sql.Add('select isnull(A.ContractBuyName,B.ContractBuyName) as ContractBuyName,');
sql.Add('isnull(A.C_Name,B.C_Name) as C_Name,');
sql.Add('isnull(A.InJS,0) as InJS,isnull(A.InMeter,0) as InMeter,isnull(A.InYardage,0) as InYardage,');
sql.Add('isnull(A.OutJS,0) as OutJS,isnull(A.OutMeter,0) as OutMeter,isnull(A.OutYardage,0) as OutYardage,');
sql.Add('isnull(B.StkJS,0) as StkJS,isnull(B.StkMeter,0) as StkMeter,isnull(B.StkYardage,0) as StkYardage');
sql.Add('from (select ContractBuyName,C_Name,');
sql.Add('sum(case when IOFlag=''入库'' then 1 else 0 end) as InJS,');
sql.Add('sum(case when IOFlag=''入库'' then isnull(Meter,0) else 0 end) as InMeter,');
sql.Add('sum(case when IOFlag=''入库'' then isnull(Yardage,0) else 0 end) as InYardage,');
sql.Add('sum(case when IOFlag=''出库'' then 1 else 0 end) as OutJS,');
sql.Add('sum(case when IOFlag=''出库'' then isnull(Meter,0) else 0 end) as OutMeter,');
sql.Add('sum(case when IOFlag=''出库'' then isnull(Yardage,0) else 0 end) as OutYardage');
sql.Add('from V_Tat_Cloth_IO where 1=1' + mDateSql + WSql);
sql.Add('group by ContractBuyName,C_Name) A');
sql.Add('full outer join');
sql.Add('(select ContractBuyName,C_Name,count(*) as StkJS,');
sql.Add('sum(isnull(StkMeter,0)) as StkMeter,sum(isnull(StkYardage,0)) as StkYardage');
sql.Add('from V_Tat_Cloth_Stk where 1=1' + WSql);
sql.Add('group by ContractBuyName,C_Name) B');
sql.Add('on isnull(A.ContractBuyName,'''')=isnull(B.ContractBuyName,'''')');
sql.Add('and isnull(A.C_Name,'''')=isnull(B.C_Name,'''')');
sql.Add('order by 1,2');
// showmessage(sql.text);
Open;
end;
SCreateCDS(ADOQueryMain, CDS_1);
SInitCDSData(ADOQueryMain, CDS_1);
finally
ADOQueryMain.EnableControls;
Tv1.DataController.Filter.Clear;
end;
end;
procedure TfrmTatClothJXCList.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, '成品仓库');
InitGrid();
end;
procedure TfrmTatClothJXCList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmTatClothJXCList.TBExportClick(Sender: TObject);
begin
if ADOQueryMain.IsEmpty then
exit;
TcxGridToExcel(Self.Caption, cxGrid1);
end;
procedure TfrmTatClothJXCList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmTatClothJXCList.ToolButton4Click(Sender: TObject);
begin
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '成品仓库');
end;
procedure TfrmTatClothJXCList.IsJYTimeClick(Sender: TObject);
begin
inherited;
InitGrid();
end;
procedure TfrmTatClothJXCList.FilterEditKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
InitGrid();
end;
end;
end.