瀏覽代碼

1、周進度表新增日期格式修正功能。

B70340 4 年之前
父節點
當前提交
8b15e0e4ee

二進制
.vs/TENDEN-MES-SYS/v16/.suo 查看文件


+ 1
- 1
TENDEN-MES-SYS/Module/全域變數.vb 查看文件

@@ -4,7 +4,7 @@
4 4
     Public Target As String : Public Target1 As String : Public Target2 As String : Public FTP帳號 As String : Public FTP密碼 As String : Public 登入人IP As String
5 5
     Public CC(99) As Boolean : Public AA(99) As String : Public 登入判斷 As Boolean
6 6
     '----系統版本-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7
-    Public 版本 As String = "2021022401"
7
+    Public 版本 As String = "2021022402"
8 8
     '----系統用全域變數-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 9
     Public 匯率 As Double
10 10
 

二進制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.exe 查看文件


二進制
TENDEN-MES-SYS/bin/Debug/TENDEN-ERP-SYS.pdb 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.exe 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/TENDEN-ERP-SYS.pdb 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbproj.GenerateResource.cache 查看文件


二進制
TENDEN-MES-SYS/obj/Debug/天盾系統.vbprojAssemblyReference.cache 查看文件


+ 29
- 5
TENDEN-MES-SYS/量產訂單管理/周進度表.Designer.vb 查看文件

@@ -55,6 +55,8 @@ Partial Class 周進度表
55 55
         Me.資料庫選擇2_bt = New System.Windows.Forms.Button()
56 56
         Me.資料庫選擇1_bt = New System.Windows.Forms.Button()
57 57
         Me.Label20 = New System.Windows.Forms.Label()
58
+        Me.日期格式修正_bt = New System.Windows.Forms.Button()
59
+        Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
58 60
         CType(Me.訂單種類_dgv, System.ComponentModel.ISupportInitialize).BeginInit()
59 61
         CType(Me.圖片_pb, System.ComponentModel.ISupportInitialize).BeginInit()
60 62
         CType(Me.驗貨報告圖片_pb, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -189,11 +191,11 @@ Partial Class 周進度表
189 191
         '注释_lb
190 192
         '
191 193
         Me.注释_lb.AutoSize = True
192
-        Me.注释_lb.Font = New System.Drawing.Font("微軟正黑體", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
194
+        Me.注释_lb.Font = New System.Drawing.Font("微軟正黑體", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(136, Byte))
193 195
         Me.注释_lb.ForeColor = System.Drawing.Color.Red
194
-        Me.注释_lb.Location = New System.Drawing.Point(12, 93)
196
+        Me.注释_lb.Location = New System.Drawing.Point(231, 414)
195 197
         Me.注释_lb.Name = "注释_lb"
196
-        Me.注释_lb.Size = New System.Drawing.Size(124, 24)
198
+        Me.注释_lb.Size = New System.Drawing.Size(106, 21)
197 199
         Me.注释_lb.TabIndex = 462
198 200
         Me.注释_lb.Text = "資料尚未存檔"
199 201
         Me.注释_lb.Visible = False
@@ -211,9 +213,9 @@ Partial Class 周進度表
211 213
         '存檔_bt
212 214
         '
213 215
         Me.存檔_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
214
-        Me.存檔_bt.Location = New System.Drawing.Point(12, 61)
216
+        Me.存檔_bt.Location = New System.Drawing.Point(126, 61)
215 217
         Me.存檔_bt.Name = "存檔_bt"
216
-        Me.存檔_bt.Size = New System.Drawing.Size(321, 24)
218
+        Me.存檔_bt.Size = New System.Drawing.Size(207, 24)
217 219
         Me.存檔_bt.TabIndex = 463
218 220
         Me.存檔_bt.Text = "Special Packaging與Remarks存檔"
219 221
         Me.存檔_bt.UseVisualStyleBackColor = True
@@ -341,11 +343,31 @@ Partial Class 周進度表
341 343
         Me.Label20.TabIndex = 554
342 344
         Me.Label20.Text = "選擇訂" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "單品牌"
343 345
         '
346
+        '日期格式修正_bt
347
+        '
348
+        Me.日期格式修正_bt.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
349
+        Me.日期格式修正_bt.Location = New System.Drawing.Point(12, 61)
350
+        Me.日期格式修正_bt.Name = "日期格式修正_bt"
351
+        Me.日期格式修正_bt.Size = New System.Drawing.Size(108, 24)
352
+        Me.日期格式修正_bt.TabIndex = 557
353
+        Me.日期格式修正_bt.Text = "日期格式修正"
354
+        Me.日期格式修正_bt.UseVisualStyleBackColor = True
355
+        '
356
+        'ProgressBar1
357
+        '
358
+        Me.ProgressBar1.Location = New System.Drawing.Point(11, 91)
359
+        Me.ProgressBar1.Maximum = 10000
360
+        Me.ProgressBar1.Name = "ProgressBar1"
361
+        Me.ProgressBar1.Size = New System.Drawing.Size(120, 30)
362
+        Me.ProgressBar1.TabIndex = 565
363
+        '
344 364
         '周進度表
345 365
         '
346 366
         Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
347 367
         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
348 368
         Me.ClientSize = New System.Drawing.Size(1914, 991)
369
+        Me.Controls.Add(Me.ProgressBar1)
370
+        Me.Controls.Add(Me.日期格式修正_bt)
349 371
         Me.Controls.Add(Me.資料庫選擇2_bt)
350 372
         Me.Controls.Add(Me.資料庫選擇1_bt)
351 373
         Me.Controls.Add(Me.Label20)
@@ -420,5 +442,7 @@ Partial Class 周進度表
420 442
     Friend WithEvents 資料庫選擇2_bt As Button
421 443
     Friend WithEvents 資料庫選擇1_bt As Button
422 444
     Friend WithEvents Label20 As Label
445
+    Friend WithEvents 日期格式修正_bt As Button
446
+    Friend WithEvents ProgressBar1 As ProgressBar
423 447
 End Class
424 448
 

+ 59
- 5
TENDEN-MES-SYS/量產訂單管理/周進度表.vb 查看文件

@@ -5,7 +5,7 @@ Public Class 周進度表
5 5
     Dim xlApp As Microsoft.Office.Interop.Excel.Application
6 6
     ReadOnly xlBook As Microsoft.Office.Interop.Excel.Workbook
7 7
     Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
8
-    Dim file_name As String = ""
8
+    Dim file_name As String = "" : Public 平均數 As Integer : Public 最終數 As Integer = 0 : Public 資料數 As Integer = 0
9 9
     Private Sub Set_訂單清單()
10 10
         訂單種類_dgv.DataSource = Nothing : ds.Clear()
11 11
         訂單種類_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
@@ -217,8 +217,7 @@ Public Class 周進度表
217 217
     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles 關鍵字查詢_bt.Click
218 218
         PA = InputBox("請輸入要查詢的資料")
219 219
         If PA = "" Then
220
-            Set_訂單清單() : Set_grid() : Timer1.Enabled = False
221
-            日期存檔_bt.Enabled = False : 存檔_bt.Enabled = False
220
+            Set_訂單清單() : Set_grid() : Timer1.Enabled = False : 日期存檔_bt.Enabled = False : 存檔_bt.Enabled = False
222 221
         Else
223 222
             Set_訂單清單() : Set_grid()
224 223
             If CC(37) = True Then
@@ -254,8 +253,8 @@ Public Class 周進度表
254 253
                                           "Requested_XF = '" & 訂單種類_dgv.Rows(i).Cells("Requested_XF").Value & "', " &
255 254
                                             "Confirm_XF = '" & 訂單種類_dgv.Rows(i).Cells("Confirm_XF").Value & "', " &
256 255
                                             "Revised_XF = '" & 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value & "', " &
257
-                                              "客戶交期 = '" & 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value & "' " &
258
-                       "WHERE (客戶訂單號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("PO#").Value & "') AND (形體號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Style_Name").Value & "') " &
256
+                                              "客戶交期 = '" & 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value & "' 
257
+                        WHERE (客戶訂單號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("PO#").Value & "') AND (形體號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Style_Name").Value & "') " &
259 258
                        "AND (顏色 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Color").Value & "') AND (楦型 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Width").Value & "') " &
260 259
                        "AND (訂單數量 = " & 訂單種類_dgv.Rows(i).Cells("QTY").Value & ")"
261 260
             End If
@@ -302,4 +301,59 @@ Public Class 周進度表
302 301
     Private Sub 資料庫選擇2_bt_Click(sender As Object, e As EventArgs) Handles 資料庫選擇2_bt.Click
303 302
         SQL_訂單資料表選擇_非VIONIC() : Set_訂單清單() : Set_grid()
304 303
     End Sub
304
+    Private Sub 進度條()
305
+        平均數 = 10000 / 資料數
306
+        最終數 += 平均數
307
+        If 最終數 > 10000 Then : 最終數 = 10000 : End If
308
+        ProgressBar1.Value = 最終數
309
+    End Sub
310
+    Private Sub 日期格式修正_bt_Click(sender As Object, e As EventArgs) Handles 日期格式修正_bt.Click
311
+        Dim EU(3) As String
312
+        For i As Integer = 0 To 訂單種類_dgv.Rows.Count - 1
313
+            EU(0) = 訂單種類_dgv(1, i).Value.ToString
314
+            EU(1) = 訂單種類_dgv(8, i).Value.ToString
315
+            EU(2) = 訂單種類_dgv(9, i).Value.ToString
316
+            EU(3) = 訂單種類_dgv(10, i).Value.ToString
317
+            If EU(0) = "" Then
318
+            Else
319
+                日期1_dtp.Text = EU(0)
320
+                訂單種類_dgv.Rows(i).Cells(1).Value = Format(日期1_dtp.Value, "yyyy/MM/dd")
321
+            End If
322
+            If EU(1) = "" Then
323
+            Else
324
+                日期2_dtp.Text = EU(1)
325
+                訂單種類_dgv.Rows(i).Cells(8).Value = Format(日期2_dtp.Value, "yyyy/MM/dd")
326
+            End If
327
+            If EU(2) = "" Then
328
+            Else
329
+                日期3_dtp.Text = EU(2)
330
+                訂單種類_dgv.Rows(i).Cells(9).Value = Format(日期3_dtp.Value, "yyyy/MM/dd")
331
+            End If
332
+            If EU(3) = "" Then
333
+            Else
334
+                日期4_dtp.Text = EU(3)
335
+                訂單種類_dgv.Rows(i).Cells(10).Value = Format(日期4_dtp.Value, "yyyy/MM/dd")
336
+            End If
337
+        Next
338
+        For i As Integer = 0 To 訂單種類_dgv.Rows.Count - 1
339
+            資料數 = 訂單種類_dgv.Rows.Count : 進度條()
340
+            If 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value Is DBNull.Value Then
341
+                Revised_XF1_tb.Text = ""
342
+            Else
343
+                Revised_XF1_tb.Text = 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value
344
+            End If
345
+
346
+            ConnOpen()
347
+            SQL1 = "UPDATE " & 訂單資料表(1) & " SET PO_S_Date = '" & 訂單種類_dgv.Rows(i).Cells("PO_S_Date").Value & "', " &
348
+                                          "Requested_XF = '" & 訂單種類_dgv.Rows(i).Cells("Requested_XF").Value & "', " &
349
+                                            "Confirm_XF = '" & 訂單種類_dgv.Rows(i).Cells("Confirm_XF").Value & "', " &
350
+                                            "Revised_XF = '" & 訂單種類_dgv.Rows(i).Cells("Revised_XF").Value & "' " &
351
+                       "WHERE (客戶訂單號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("PO#").Value & "') AND (形體號 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Style_Name").Value & "') " &
352
+                       "AND (顏色 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Color").Value & "') AND (楦型 LIKE '" & 訂單種類_dgv.Rows(i).Cells("Width").Value & "') " &
353
+                       "AND (訂單數量 = " & 訂單種類_dgv.Rows(i).Cells("QTY").Value & ")"
354
+            CmdSet_For_dr() : conn.Close()
355
+        Next i : ProgressBar1.Value = 0 : 最終數 = 0
356
+        MsgBox("存檔完成")
357
+        Set_訂單清單() : Set_grid()
358
+    End Sub
305 359
 End Class

Loading…
取消
儲存