'**********************************************************************************************************************************************************
'* 模 块 名 称 : 订单信息-生产计划表(表:ddxx_Main; ddxx_Sub;ddxx_Mlxx;ddxx_Flxx;ddxx_Bwcm;ddxx_Bzxx)
'* 描 述 : 通过表:Xt_Grid 中的 Grid_Code 作为标识来操作。首先在表Xt_Grid中添加要操作的字段,并与VSFGrid中的列对应,
'* 说 明: gridcol_fieldlx(1、字符型;2、数值型;3、日期型;4、逻辑型(Bit);0、uniqueidentifier型(该字段不保存,主键值,自动生成)
'*
'* 程 序 员 : LMS/2017.10.18
'**********************************************************************************************************************************************************
Option Explicit
'针对VSFlexGrid,复制、粘贴、移除选中行
Private Sub VSFGrid_Sub_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then PopupMenu XT_Main.c_Edit
End Sub
Private Sub VSFGrid_Ml_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then PopupMenu XT_Main.c_Edit1
End Sub
Private Sub Form_Load()
If DataEnv.DataConn.State = 0 Then DataEnv.DataConn.Open Glmk.PconnString
MyVsf.VSFGrid_Header VSFGrid_Main, 1, 1, 21, False: MyVsf.VSFGrid_Header VSFGrid_Sub, 2, 1, 16, False
MyVsf.VSFGrid_Header VSFGrid_Ml, 1, 1, 8, False: MyVsf.VSFGrid_Header VSFGrid_Cm, 1, 1, 4, False
MyVsf.VSFGrid_Header VSFGrid_Bwcm, 1, 1, 3, False: MyVsf.VSFGrid_Header VSFGrid_Fl, 1, 1, 8, False
DTP1.value = Glmk.PXtrq: TYwdh.Width = 1210
With VSFGrid_Main
' .ColHidden(VSFGrid_Main.Cols - 1) = True '----隐藏 PmKey=最后一列
End With
With fpSpread_Bzxx
.LoadFromFile (App.Path & "\ExcelModel\frmscjh_main_bzxx1.ss8")
End With
Frame2.Top = -90: Frame2.Left = 30
Glmk.System_Log Me.Caption, 1 '----写日志
End Sub
Private Sub Form_Resize()
On Error Resume Next
VSFGrid_Main.Width = Me.ScaleWidth - 90
With SSTab1
.Height = Me.ScaleHeight - ToolBar1.Height - VSFGrid_Main.Height - 150
.Width = Me.ScaleWidth - 120
End With
With VSFGrid_Sub
.Height = SSTab1.Height - SSTab1.TabHeight - 180
.Width = SSTab1.Width - 180
End With
With VSFGrid_Ml
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With VSFGrid_Cm
.Height = VSFGrid_Sub.Height - Frame1.Height - 60
End With
Frame1.Width = VSFGrid_Sub.Width
With VSFGrid_Bwcm
.Height = VSFGrid_Cm.Height
.Width = VSFGrid_Sub.Width - VSFGrid_Cm.Width - 90
End With
With VSFGrid_Fl
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With fpSpread_Bzxx
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With fpSpread_Scbb
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
End Sub
Private Sub VSFGrid_Sub_CellChanged(ByVal Row As Long, ByVal Col As Long)
XT_Main.StatusBar1.Panels(2).Text = "总计划数: " + CStr(MdlVsf.VSFG_SumCol(VSFGrid_Sub, 7))
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Main_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Main
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Sub_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Sub
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Ml_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Ml
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Cm_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Cm
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Bwcm_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Bwcm
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Fl_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Fl
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'装入表内容和主表信息(制单日期)
Private Sub TYwdh_Change()
Me.MousePointer = 11
Dim rst As New ADODB.RecordSet, SQL As String, II As Integer, KK As Integer
DTP1.value = MyNormal.GetFsrq_BySQL("select * from ddxx_Main where ywdh='" + Trim(TYwdh.Text) + "'")
MyVsf.FillVSFGrid VSFGrid_Main, "select * from ddxx_Main where ywdh='" + Trim(TYwdh.Text) + "'", "ddxx_Main" '----订单信息-主表信息(ddxx_Main)
MyVsf.FillVSFGrid VSFGrid_Sub, "select * from ddxx_Sub where ywdh='" + Trim(TYwdh.Text) + "' order by fl_id", "ddxx_sub" '----订单信息-产品信息(ddxx_Sub)
MyVsf.FillVSFGrid VSFGrid_Ml, "select * from ddxx_Mlxx where ywdh='" + Trim(TYwdh.Text) + "' order by fl_id", "ddxx_mlxx" '----订单信息-面料信息(ddxx_Mlxx)
MyVsf.FillVSFGrid VSFGrid_Cm, "select * from ddxx_Cmxx where ywdh='" + Trim(TYwdh.Text) + "' order
'* 模 块 名 称 : 订单信息-生产计划表(表:ddxx_Main; ddxx_Sub;ddxx_Mlxx;ddxx_Flxx;ddxx_Bwcm;ddxx_Bzxx)
'* 描 述 : 通过表:Xt_Grid 中的 Grid_Code 作为标识来操作。首先在表Xt_Grid中添加要操作的字段,并与VSFGrid中的列对应,
'* 说 明: gridcol_fieldlx(1、字符型;2、数值型;3、日期型;4、逻辑型(Bit);0、uniqueidentifier型(该字段不保存,主键值,自动生成)
'*
'* 程 序 员 : LMS/2017.10.18
'**********************************************************************************************************************************************************
Option Explicit
'针对VSFlexGrid,复制、粘贴、移除选中行
Private Sub VSFGrid_Sub_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then PopupMenu XT_Main.c_Edit
End Sub
Private Sub VSFGrid_Ml_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then PopupMenu XT_Main.c_Edit1
End Sub
Private Sub Form_Load()
If DataEnv.DataConn.State = 0 Then DataEnv.DataConn.Open Glmk.PconnString
MyVsf.VSFGrid_Header VSFGrid_Main, 1, 1, 21, False: MyVsf.VSFGrid_Header VSFGrid_Sub, 2, 1, 16, False
MyVsf.VSFGrid_Header VSFGrid_Ml, 1, 1, 8, False: MyVsf.VSFGrid_Header VSFGrid_Cm, 1, 1, 4, False
MyVsf.VSFGrid_Header VSFGrid_Bwcm, 1, 1, 3, False: MyVsf.VSFGrid_Header VSFGrid_Fl, 1, 1, 8, False
DTP1.value = Glmk.PXtrq: TYwdh.Width = 1210
With VSFGrid_Main
' .ColHidden(VSFGrid_Main.Cols - 1) = True '----隐藏 PmKey=最后一列
End With
With fpSpread_Bzxx
.LoadFromFile (App.Path & "\ExcelModel\frmscjh_main_bzxx1.ss8")
End With
Frame2.Top = -90: Frame2.Left = 30
Glmk.System_Log Me.Caption, 1 '----写日志
End Sub
Private Sub Form_Resize()
On Error Resume Next
VSFGrid_Main.Width = Me.ScaleWidth - 90
With SSTab1
.Height = Me.ScaleHeight - ToolBar1.Height - VSFGrid_Main.Height - 150
.Width = Me.ScaleWidth - 120
End With
With VSFGrid_Sub
.Height = SSTab1.Height - SSTab1.TabHeight - 180
.Width = SSTab1.Width - 180
End With
With VSFGrid_Ml
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With VSFGrid_Cm
.Height = VSFGrid_Sub.Height - Frame1.Height - 60
End With
Frame1.Width = VSFGrid_Sub.Width
With VSFGrid_Bwcm
.Height = VSFGrid_Cm.Height
.Width = VSFGrid_Sub.Width - VSFGrid_Cm.Width - 90
End With
With VSFGrid_Fl
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With fpSpread_Bzxx
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
With fpSpread_Scbb
.Height = VSFGrid_Sub.Height
.Width = VSFGrid_Sub.Width
End With
End Sub
Private Sub VSFGrid_Sub_CellChanged(ByVal Row As Long, ByVal Col As Long)
XT_Main.StatusBar1.Panels(2).Text = "总计划数: " + CStr(MdlVsf.VSFG_SumCol(VSFGrid_Sub, 7))
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Main_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Main
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Sub_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Sub
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Ml_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Ml
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Cm_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Cm
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Bwcm_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Bwcm
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'第 列不允许编辑
Private Sub VSFGrid_Fl_BeforeEdit(ByVal Row As Long, ByVal Col As Long, Cancel As Boolean)
With VSFGrid_Fl
If Col = .Cols - 1 Then Cancel = True
End With
End Sub
'装入表内容和主表信息(制单日期)
Private Sub TYwdh_Change()
Me.MousePointer = 11
Dim rst As New ADODB.RecordSet, SQL As String, II As Integer, KK As Integer
DTP1.value = MyNormal.GetFsrq_BySQL("select * from ddxx_Main where ywdh='" + Trim(TYwdh.Text) + "'")
MyVsf.FillVSFGrid VSFGrid_Main, "select * from ddxx_Main where ywdh='" + Trim(TYwdh.Text) + "'", "ddxx_Main" '----订单信息-主表信息(ddxx_Main)
MyVsf.FillVSFGrid VSFGrid_Sub, "select * from ddxx_Sub where ywdh='" + Trim(TYwdh.Text) + "' order by fl_id", "ddxx_sub" '----订单信息-产品信息(ddxx_Sub)
MyVsf.FillVSFGrid VSFGrid_Ml, "select * from ddxx_Mlxx where ywdh='" + Trim(TYwdh.Text) + "' order by fl_id", "ddxx_mlxx" '----订单信息-面料信息(ddxx_Mlxx)
MyVsf.FillVSFGrid VSFGrid_Cm, "select * from ddxx_Cmxx where ywdh='" + Trim(TYwdh.Text) + "' order