Browse Source

修改取消下地逻辑

callm 2 days ago
parent
commit
df21dd42d8

+ 68 - 0
UAS_MES_YDCY/.workbuddy/memory/2026-10-14.md

@@ -0,0 +1,68 @@
+# 2026-10-14 Make_MakeCancelDown 序列号累加 + 全选批量取消下地
+
+## 需求
+> Make_MakeCancelDown这个功能,目前是勾选sn_code_rb的时候,每个SN回车刷新一次界面,
+> 需要修改一下,SN回车的时候可以累加在DGV中,然后加一个全选按钮,批量取消下地,所有限制都需要保留
+
+## 确认过的三个设计点(AskUserQuestion)
+1. **重复 SN** → 跳过并提示「序列号 xxx 已在列表中,不重复添加」
+2. **确认后 / 切模式后** → 保留原行为:确认成功后清空列表;切换模式也清空
+3. **全选按钮** → **复用现有 `ChooseAll`**(`ChooseAllButton`,位于 DGV 左下角 `(29,366)`),不新增按钮
+
+## 改动文件
+**只改 `FunctionCode/Make/Make_MakeCancelDown.cs`**(+121/-约20;未动 Designer / resx)
+
+## 原实现的问题
+`sn_code_KeyDown` 每次回车都 `BaseUtil.FillDgvWithDataTable(LabelDataGridView, dtbar)` —— **整表替换**,
+所以连扫 5 个 SN 只会看到最后一个。
+
+## 改法
+
+### 1. `sn_code_KeyDown` 改为「查库校验 → 累加行」
+```
+① sn 为空直接 return
+② 查库 where md_sncode='xx' and md_status=-1
+③ 0 行 → 红字「无未取消下地的数据」+ 清输入框 + return        (原卡控保留)
+④ ExistsSnInGrid(sn) → 红字「已在列表中」+ 清输入框 + return   (新增防重)
+⑤ DataSource != null → 先置 null + Rows.Clear()               (★见下)
+⑥ 逐行 Rows.Add() 手工填 5 列;Choose 默认 false
+⑦ sum=总行数、choosenum=0、_allChecked=false、清输入框
+```
+- 列名用 `row.Cells["md_macode"]` 等 **Name**(不是 HeaderText)
+
+### 2. ★ 必须先解 DataSource(本次最关键的坑)
+**`DataGridView` 挂着 `DataSource` 时调 `Rows.Add()` 会抛 `InvalidOperationException`。**
+事件号模式的 `md_code_KeyDown` 用 `FillDgvWithDataTable` 设了 `DataSource`;
+若不清掉就切到序列号模式累加 → 直接崩。
+→ 累加前加 `if (LabelDataGridView.DataSource != null) { DataSource = null; Rows.Clear(); }`
+
+### 3. 全选按钮改为「本界面自持状态」(**不改公共控件**)
+`ChooseAllButton.ChooseAll(dgv)` 内部把 `Click += ChooseAll_Click`,用一个**私有 `AllChecked` 字段**记录状态,
+外部无法复位 → 累加新行后会出现「按钮语义与实际不符」。
+- 公共控件(`CustomControl/`)**不许改**(用户既定约束)→ 本界面**不再调用 `ChooseAll(dgv)`**,
+  改为 `ChooseAll.Click += ChooseAll_Click;` 挂本界面自己的处理,用本地 `_allChecked`。
+- `ChooseAllButton` 共 4 处使用(`SystemSetting_LabelMaintain`、`OQC_PlanMaintain`、`_Cust`、`_NEW`),
+  它们仍走原 `ChooseAll(dgv)`,**不受影响**(我改的是本界面的调用点,不是控件)。
+- 切换式逻辑照抄 `Query_LoadMan.SelectAll_Click` 范式(见 MEMORY.md「DGV 勾选批量操作范式」):
+  `bool setValue = !_allChecked` → 逐行写 value → **`RefreshEdit()`** → 切文案「全选/取消全选」
+- 新增 `ResetChooseAllState()`,在 **3 个清空点**调用:切模式、事件号整表重建、SN 模式确认清空后。
+
+### 4. `Sure_Click` 只加统计,不动业务
+- 加 `int doneCount`,在成功分支 `doneCount++`
+- SN 模式提示由「序列号xx取消下地成功」改成「**本次取消下地成功 N 条,已清空列表**」(列表是多行,原文案已无意义)
+- **保留**:`inputreson` 必填校验、「没有勾选下地记录」校验、`md_code`+`md_sncode` 更新条件、
+  `makeserial.ms_downstatus=0` 更新、`DoCommandLog` 调用、事件号分支整段不动。
+
+## 保留的全部原有卡控(用户强调)
+- `dh.CheckExist("MakeDown", ...)` 事件号存在性
+- `md_status=-1` 未取消下地过滤
+- 取消下地原因必填
+- 未勾选不允许提交
+- 事件号模式「无数据则清空列表」「确认后重新查询」行为
+- `md_code_rb` / `sn_code_rb` 切换时 `BaseUtil.CleanForm` + 输入框 Enable 互斥
+
+## 自检
+- 括号平衡(Python 剥字面量后):brace 47/47、paren 131/131、bracket 49/49 ✅
+- `git --no-pager diff --stat` 确认**只有本文件**属于本次改动
+  (同仓库另有 Query_LoadMan、UAS_MES_ZDXW、UAS_WinForm.sln 的他人/他轮改动,未触碰)
+- 需在 VS 编译确认(本机无法编译)

+ 10 - 0
UAS_MES_YDCY/.workbuddy/memory/MEMORY.md

@@ -97,6 +97,16 @@
 - ⚠️ **删除 DGV 列要同时改 3 处**:`AddRange` 数组、该列的属性设置块(`// 列名` 注释段)、
   末尾的 `private ... 列字段;` 声明。漏任一处要么编译报错(字段不存在),要么运行期多/少一列。
   若 `.cs` 里有 `row.Cells["列名"]` 引用该列,**必须一起删**,否则运行期抛 `ArgumentException`。
+- **手工累加行(不用 DataSource)**:`int idx = dgv.Rows.Add(); dgv.Rows[idx].Cells["列Name"].Value = ...`
+  —— 用列的 **`Name`** 取值(不是 `HeaderText`)。
+  ⚠️ **累加前必须先解 DataSource**:`dgv.DataSource` 非 null 时调 `Rows.Add()` 会抛
+  `InvalidOperationException`。同一界面的另一模式若用过 `FillDgvWithDataTable`(会设 DataSource),
+  模式切换后就会踩到。加 `if (dgv.DataSource != null) { dgv.DataSource = null; dgv.Rows.Clear(); }`。
+- **`ChooseAllButton`(`CustomControl.ButtonUtil`)的状态复位问题**:
+  `ChooseAll(dgv)` 内部 `Click +=` 一个用**私有 `AllChecked` 字段**记状态的处理器,**外部无法复位**;
+  一旦界面会「清空列表 / 累加新行」,按钮语义就会与实际勾选错位。
+  → 因公共控件不许改,**该界面改为不调 `ChooseAll(dgv)`,自己 `Click +=` 本地处理器 + 本地 `_allChecked`**,
+  并抽出 `ResetChooseAllState()` 在所有清空点调用。其他界面仍走原 `ChooseAll(dgv)`,互不影响。
 
 ## 扫码输入框(SnCollectionBox)的回车坑 —— 只在功能界面内解决
 - `SnCollectionBox_KeyDown`(在 `SnCollectionBox.Designer.cs` 里 hook)的 Enter 分支末尾有 **`this.SelectAll()`**。

+ 113 - 8
UAS_MES_YDCY/FunctionCode/Make/Make_MakeCancelDown.cs

@@ -36,10 +36,40 @@ namespace UAS_MES_NEW.Make
         {
             asc.controllInitializeSize(this);
             md_code_rb.Focus();
-            ChooseAll.ChooseAll(LabelDataGridView);
+            //ChooseAllButton 内部用私有字段记录「是否已全选」,累加新行后无法复位其状态;
+            //公共控件不允许改动,故本界面不再调用 ChooseAll(dgv)(避免挂上控件自带的 Click),
+            //改为挂本界面自己的切换式全选处理。
+            ChooseAll.Click += ChooseAll_Click;
             dh = SystemInf.dh;
         }
 
+        //是否已全选:累加新行后需要复位,否则会出现「按钮写着全选、其实已经全选过」的错位
+        private bool _allChecked = false;
+
+        /// <summary>
+        /// 全选/取消全选(切换式):点击时若已全部勾选则全部取消,否则全部勾选
+        /// 只改复选框状态,不触发数据刷新
+        /// </summary>
+        private void ChooseAll_Click(object sender, EventArgs e)
+        {
+            if (LabelDataGridView.Rows.Count == 0)
+            {
+                OperateResult.AppendText(">>当前没有可勾选的下地记录\n", Color.Red);
+                return;
+            }
+            bool setValue = !_allChecked;
+            for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
+            {
+                LabelDataGridView.Rows[i].Cells["Choose"].Value = setValue;
+            }
+            //只改 cell value 时复选框显示可能不刷新
+            LabelDataGridView.RefreshEdit();
+            _allChecked = setValue;
+            ChooseAll.Text = setValue ? "取消全选" : "全选";
+            choosenum.Text = setValue ? LabelDataGridView.Rows.Count.ToString() : "0";
+            OperateResult.AppendText(setValue ? ">>已全选当前列表\n" : ">>已取消全选\n", Color.Black);
+        }
+
         private void Make_MakeCancelDown_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);
@@ -65,9 +95,21 @@ namespace UAS_MES_NEW.Make
                     mdcode.Enabled = false;
                     sn_code.Focus();
                 }
+                //切换模式会清空列表,全选按钮状态同步复位
+                ResetChooseAllState();
             }
         }
 
+        /// <summary>
+        /// 复位「全选」按钮的内部状态与文案(列表被清空/重建后必须调用,
+        /// 否则会出现按钮写着「取消全选」但实际一个都没勾的错位)
+        /// </summary>
+        private void ResetChooseAllState()
+        {
+            _allChecked = false;
+            ChooseAll.Text = "全选";
+        }
+
         private void md_code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -88,6 +130,9 @@ namespace UAS_MES_NEW.Make
                     }
                     sum.Text = dt1.Rows.Count.ToString();
                     make_count.Text = dt1.Rows.Count.ToString();
+                    //列表被整表重建,全选按钮状态复位
+                    ResetChooseAllState();
+                    choosenum.Text = "0";
                 }
                 else
                 {
@@ -100,19 +145,74 @@ namespace UAS_MES_NEW.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
+                string sn = sn_code.Text.Trim();
+                if (sn == "")
+                {
+                    return;
+                }
+                //累加前先查库:只有存在未取消下地的记录才加进列表(保留原有卡控)
                 sql.Clear();
-                sql.Append("select md_code,md_sncode,md_macode,md_prodcode,pr_detail from makedown left join product on pr_code=md_prodcode where md_sncode='" + sn_code.Text + "' and md_status=-1");
+                sql.Append("select md_code,md_sncode,md_macode,md_prodcode,pr_detail from makedown left join product on pr_code=md_prodcode where md_sncode='" + sn + "' and md_status=-1");
                 dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dtbar.Rows.Count > 0)
+                if (dtbar.Rows.Count == 0)
                 {
-                    BaseUtil.FillDgvWithDataTable(LabelDataGridView, dtbar);
+                    OperateResult.AppendText(">>序列号" + sn + "无未取消下地的数据\n", Color.Red);
+                    sn_code.Clear();
+                    sn_code.Focus();
+                    return;
                 }
-                else
+                //同一序列号已在列表中则跳过,避免重复取消下地
+                if (ExistsSnInGrid(sn))
+                {
+                    OperateResult.AppendText(">>序列号" + sn + "已在列表中,不重复添加\n", Color.Red);
+                    sn_code.Clear();
+                    sn_code.Focus();
+                    return;
+                }
+                //把本次扫描到的记录累加到DGV中(保留原有列:工单编号/序列号/产品代码/产品名称/事件号)
+                //注意:事件号模式用过 FillDgvWithDataTable 后 DGV 还挂着 DataSource,
+                //此时 Rows.Add() 会抛 InvalidOperationException,故先解绑定再手工加行
+                if (LabelDataGridView.DataSource != null)
+                {
+                    LabelDataGridView.DataSource = null;
+                    LabelDataGridView.Rows.Clear();
+                }
+                for (int i = 0; i < dtbar.Rows.Count; i++)
+                {
+                    int idx = LabelDataGridView.Rows.Add();
+                    DataGridViewRow row = LabelDataGridView.Rows[idx];
+                    row.Cells["md_macode"].Value = dtbar.Rows[i]["md_macode"].ToString();
+                    row.Cells["md_sncode"].Value = dtbar.Rows[i]["md_sncode"].ToString();
+                    row.Cells["md_prodcode"].Value = dtbar.Rows[i]["md_prodcode"].ToString();
+                    row.Cells["pr_detail"].Value = dtbar.Rows[i]["pr_detail"].ToString();
+                    row.Cells["md_code"].Value = dtbar.Rows[i]["md_code"].ToString();
+                    //新累加的行默认不勾选,由用户自己勾选或点「全选」
+                    row.Cells["Choose"].Value = false;
+                }
+                OperateResult.AppendText(">>序列号" + sn + "已累加,当前共" + LabelDataGridView.Rows.Count + "条\n", Color.Black);
+                //累加后新行未勾选,把全选按钮拉回「未全选」状态,避免与界面显示错位
+                _allChecked = false;
+                sum.Text = LabelDataGridView.Rows.Count.ToString();
+                choosenum.Text = "0";
+                sn_code.Clear();
+                sn_code.Focus();
+            }
+        }
+
+        /// <summary>
+        /// 判断指定的序列号是否已存在于DGV列表中
+        /// </summary>
+        private bool ExistsSnInGrid(string sn)
+        {
+            for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
+            {
+                if (LabelDataGridView.Rows[i].Cells["md_sncode"].Value != null
+                    && LabelDataGridView.Rows[i].Cells["md_sncode"].Value.ToString() == sn)
                 {
-                    OperateResult.AppendText(">>序列号" + sn_code.Text + "无未取消下地的数据\n", Color.Red);
+                    return true;
                 }
-                sum.Text = dtbar.Rows.Count.ToString();
             }
+            return false;
         }
 
         private void Sure_Click(object sender, EventArgs e)
@@ -121,6 +221,8 @@ namespace UAS_MES_NEW.Make
             {
                 Boolean cancle = false;
                 Boolean haveclick = false;
+                //本次处理的取消下地成功数量(SN模式下一个SN可能对应多行,按行统计)
+                int doneCount = 0;
                 for (int i = 0; i < LabelDataGridView.Rows.Count; i++)
                 {
                     if (LabelDataGridView.Rows[i].Cells["Choose"].Value != null)
@@ -149,19 +251,22 @@ namespace UAS_MES_NEW.Make
                             sql.Append("update makeserial set ms_downstatus=0 where ms_sncode='" + LabelDataGridView.Rows[i].Cells["md_sncode"].Value.ToString() + "' and ms_makecode='" + LabelDataGridView.Rows[i].Cells["md_macode"].Value.ToString() + "'");
                             dh.ExecuteSql(sql.GetString(), "update");
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, LabelDataGridView.Rows[i].Cells["md_macode"].Value.ToString(), User.UserLineCode, User.UserSourceCode, "取消下地操作", "序列号" + LabelDataGridView.Rows[i].Cells["md_sncode"].Value.ToString() + "下地成功", LabelDataGridView.Rows[i].Cells["md_sncode"].Value.ToString(), "");
+                            doneCount++;
                         }
                     }
                 }
 
                 if (sn_code.Enabled)
                 {
-                    OperateResult.AppendText(">>>序列号" + sn_code.Text + "取消下地成功\n", Color.Green);
+                    //SN模式:列表是累加出来的,确认后整表清空,提示本次成功条数
+                    OperateResult.AppendText(">>>本次取消下地成功" + doneCount + "条,已清空列表\n", Color.Green);
                     sn_code.Text = "";
                     sn_code.Focus();
                     inputreson.Text = "";
                     sum.Text = "";
                     choosenum.Text = "";
                     BaseUtil.CleanDGVData(LabelDataGridView);
+                    ResetChooseAllState();
                 }
                 else if (mdcode.Enabled)
                 {

+ 147 - 130
UAS_MES_YDCY/FunctionCode/Query/Query_LoadMan.Designer.cs

@@ -28,6 +28,7 @@ namespace UAS_MES_NEW.Query
         /// </summary>
         private void InitializeComponent()
         {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_LoadMan));
             this.linecode_label = new System.Windows.Forms.Label();
             this.emcode_label = new System.Windows.Forms.Label();
             this.DGV = new System.Windows.Forms.DataGridView();
@@ -46,125 +47,31 @@ namespace UAS_MES_NEW.Query
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).BeginInit();
             this.SuspendLayout();
-            //
+            // 
             // linecode_label
-            //
+            // 
             this.linecode_label.AutoSize = true;
             this.linecode_label.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.linecode_label.Location = new System.Drawing.Point(24, 34);
-            this.linecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.linecode_label.Location = new System.Drawing.Point(36, 54);
+            this.linecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.linecode_label.Name = "linecode_label";
-            this.linecode_label.Size = new System.Drawing.Size(64, 31);
+            this.linecode_label.Size = new System.Drawing.Size(98, 50);
             this.linecode_label.TabIndex = 10;
             this.linecode_label.Text = "线别";
-            //
-            // li_code
-            //
-            this.li_code.AllPower = "IFALL";
-            this.li_code.Caller = null;
-            this.li_code.Condition = null;
-            this.li_code.DBTitle = "";
-            this.li_code.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.li_code.FormName = null;
-            this.li_code.Location = new System.Drawing.Point(96, 27);
-            this.li_code.Margin = new System.Windows.Forms.Padding(6);
-            this.li_code.Name = "li_code";
-            this.li_code.Power = "";
-            this.li_code.ReturnData = null;
-            this.li_code.SelectField = null;
-            this.li_code.SetValueField = null;
-            this.li_code.Size = new System.Drawing.Size(282, 46);
-            this.li_code.TabIndex = 1;
-            this.li_code.TableName = null;
-            this.li_code.TextBoxEnable = false;
-            //
+            // 
             // emcode_label
-            //
+            // 
             this.emcode_label.AutoSize = true;
             this.emcode_label.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.emcode_label.Location = new System.Drawing.Point(408, 34);
-            this.emcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.emcode_label.Location = new System.Drawing.Point(612, 54);
+            this.emcode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.emcode_label.Name = "emcode_label";
-            this.emcode_label.Size = new System.Drawing.Size(94, 31);
+            this.emcode_label.Size = new System.Drawing.Size(174, 50);
             this.emcode_label.TabIndex = 11;
             this.emcode_label.Text = "人员编号";
-            //
-            // em_code
-            //
-            this.em_code.AllPower = null;
-            this.em_code.BackColor = System.Drawing.Color.White;
-            this.em_code.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.em_code.ID = null;
-            this.em_code.Location = new System.Drawing.Point(532, 35);
-            this.em_code.Margin = new System.Windows.Forms.Padding(4);
-            this.em_code.Name = "em_code";
-            this.em_code.Power = null;
-            this.em_code.Size = new System.Drawing.Size(220, 40);
-            this.em_code.TabIndex = 2;
-            this.em_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.em_code_KeyDown);
-            this.em_code.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Em_code_KeyPress);
-            //
-            // UpLoadMan
-            //
-            this.UpLoadMan.AutoSize = true;
-            this.UpLoadMan.Checked = true;
-            this.UpLoadMan.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.UpLoadMan.Location = new System.Drawing.Point(800, 34);
-            this.UpLoadMan.Margin = new System.Windows.Forms.Padding(4);
-            this.UpLoadMan.Name = "UpLoadMan";
-            this.UpLoadMan.Size = new System.Drawing.Size(76, 32);
-            this.UpLoadMan.TabIndex = 3;
-            this.UpLoadMan.TabStop = true;
-            this.UpLoadMan.Text = "上线";
-            this.UpLoadMan.UseVisualStyleBackColor = true;
-            this.UpLoadMan.CheckedChanged += new System.EventHandler(this.UpLoadMan_CheckedChanged);
-            //
-            // DownLoadMan
-            //
-            this.DownLoadMan.AutoSize = true;
-            this.DownLoadMan.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.DownLoadMan.Location = new System.Drawing.Point(912, 34);
-            this.DownLoadMan.Margin = new System.Windows.Forms.Padding(4);
-            this.DownLoadMan.Name = "DownLoadMan";
-            this.DownLoadMan.Size = new System.Drawing.Size(76, 32);
-            this.DownLoadMan.TabIndex = 4;
-            this.DownLoadMan.TabStop = true;
-            this.DownLoadMan.Text = "下线";
-            this.DownLoadMan.UseVisualStyleBackColor = true;
-            this.DownLoadMan.CheckedChanged += new System.EventHandler(this.DownLoadMan_CheckedChanged);
-            //
-            // ConfirmDown
-            //
-            this.ConfirmDown.BackColor = System.Drawing.Color.Transparent;
-            this.ConfirmDown.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ConfirmDown.IsShowBorder = true;
-            this.ConfirmDown.Location = new System.Drawing.Point(1042, 26);
-            this.ConfirmDown.Margin = new System.Windows.Forms.Padding(4);
-            this.ConfirmDown.Name = "ConfirmDown";
-            this.ConfirmDown.Power = null;
-            this.ConfirmDown.Size = new System.Drawing.Size(140, 50);
-            this.ConfirmDown.TabIndex = 7;
-            this.ConfirmDown.Text = "确认下线";
-            this.ConfirmDown.UseVisualStyleBackColor = false;
-            this.ConfirmDown.Click += new System.EventHandler(this.ConfirmDown_Click);
-            //
-            // SelectAll
-            //
-            this.SelectAll.BackColor = System.Drawing.Color.Transparent;
-            this.SelectAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SelectAll.IsShowBorder = true;
-            this.SelectAll.Location = new System.Drawing.Point(894, 26);
-            this.SelectAll.Margin = new System.Windows.Forms.Padding(4);
-            this.SelectAll.Name = "SelectAll";
-            this.SelectAll.Power = null;
-            this.SelectAll.Size = new System.Drawing.Size(140, 50);
-            this.SelectAll.TabIndex = 8;
-            this.SelectAll.Text = "全选";
-            this.SelectAll.UseVisualStyleBackColor = false;
-            this.SelectAll.Click += new System.EventHandler(this.SelectAll_Click);
-            //
+            // 
             // DGV
-            //
+            // 
             this.DGV.AllowUserToAddRows = false;
             this.DGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.DGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
@@ -174,22 +81,23 @@ namespace UAS_MES_NEW.Query
             this.lm_linecode,
             this.lm_uptime,
             this.lm_inman});
-            this.DGV.Location = new System.Drawing.Point(24, 96);
+            this.DGV.Location = new System.Drawing.Point(36, 154);
+            this.DGV.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.DGV.Name = "DGV";
             this.DGV.RowHeadersWidth = 82;
             this.DGV.RowTemplate.Height = 37;
-            this.DGV.Size = new System.Drawing.Size(1090, 640);
+            this.DGV.Size = new System.Drawing.Size(1635, 1024);
             this.DGV.TabIndex = 5;
-            //
+            // 
             // choose
-            //
+            // 
             this.choose.HeaderText = "勾选";
             this.choose.MinimumWidth = 10;
             this.choose.Name = "choose";
             this.choose.Width = 70;
-            //
+            // 
             // lm_id
-            //
+            // 
             this.lm_id.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.lm_id.DataPropertyName = "lm_id";
             this.lm_id.HeaderText = "ID";
@@ -197,55 +105,164 @@ namespace UAS_MES_NEW.Query
             this.lm_id.Name = "lm_id";
             this.lm_id.Visible = false;
             this.lm_id.Width = 10;
-            //
+            // 
             // lm_emcode
-            //
+            // 
             this.lm_emcode.DataPropertyName = "lm_emcode";
             this.lm_emcode.HeaderText = "人员编号";
             this.lm_emcode.MinimumWidth = 10;
             this.lm_emcode.Name = "lm_emcode";
             this.lm_emcode.ReadOnly = true;
             this.lm_emcode.Width = 180;
-            //
+            // 
             // lm_linecode
-            //
+            // 
             this.lm_linecode.DataPropertyName = "lm_linecode";
             this.lm_linecode.HeaderText = "线别";
             this.lm_linecode.MinimumWidth = 10;
             this.lm_linecode.Name = "lm_linecode";
             this.lm_linecode.ReadOnly = true;
             this.lm_linecode.Width = 200;
-            //
+            // 
             // lm_uptime
-            //
+            // 
             this.lm_uptime.DataPropertyName = "lm_uptime";
             this.lm_uptime.HeaderText = "上线时间";
             this.lm_uptime.MinimumWidth = 10;
             this.lm_uptime.Name = "lm_uptime";
             this.lm_uptime.ReadOnly = true;
             this.lm_uptime.Width = 200;
-            //
+            // 
             // lm_inman
-            //
+            // 
             this.lm_inman.DataPropertyName = "lm_inman";
             this.lm_inman.HeaderText = "录入人";
             this.lm_inman.MinimumWidth = 10;
             this.lm_inman.Name = "lm_inman";
             this.lm_inman.ReadOnly = true;
             this.lm_inman.Width = 120;
-            //
+            // 
+            // UpLoadMan
+            // 
+            this.UpLoadMan.AutoSize = true;
+            this.UpLoadMan.Checked = true;
+            this.UpLoadMan.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.UpLoadMan.Location = new System.Drawing.Point(1200, 54);
+            this.UpLoadMan.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.UpLoadMan.Name = "UpLoadMan";
+            this.UpLoadMan.Size = new System.Drawing.Size(129, 54);
+            this.UpLoadMan.TabIndex = 3;
+            this.UpLoadMan.TabStop = true;
+            this.UpLoadMan.Text = "上线";
+            this.UpLoadMan.UseVisualStyleBackColor = true;
+            this.UpLoadMan.CheckedChanged += new System.EventHandler(this.UpLoadMan_CheckedChanged);
+            // 
+            // DownLoadMan
+            // 
+            this.DownLoadMan.AutoSize = true;
+            this.DownLoadMan.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.DownLoadMan.Location = new System.Drawing.Point(1368, 54);
+            this.DownLoadMan.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.DownLoadMan.Name = "DownLoadMan";
+            this.DownLoadMan.Size = new System.Drawing.Size(129, 54);
+            this.DownLoadMan.TabIndex = 4;
+            this.DownLoadMan.TabStop = true;
+            this.DownLoadMan.Text = "下线";
+            this.DownLoadMan.UseVisualStyleBackColor = true;
+            this.DownLoadMan.CheckedChanged += new System.EventHandler(this.DownLoadMan_CheckedChanged);
+            // 
+            // li_code
+            // 
+            this.li_code.AllPower = "IFALL";
+            this.li_code.Caller = null;
+            this.li_code.Condition = null;
+            this.li_code.DBTitle = "";
+            this.li_code.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.li_code.FormName = null;
+            this.li_code.Location = new System.Drawing.Point(144, 43);
+            this.li_code.Margin = new System.Windows.Forms.Padding(9, 10, 9, 10);
+            this.li_code.Name = "li_code";
+            this.li_code.Power = "";
+            this.li_code.ReturnData = null;
+            this.li_code.SelectField = null;
+            this.li_code.SetValueField = null;
+            this.li_code.Size = new System.Drawing.Size(423, 74);
+            this.li_code.TabIndex = 1;
+            this.li_code.TableName = null;
+            this.li_code.TextBoxEnable = false;
+            // 
+            // em_code
+            // 
+            this.em_code.AllPower = null;
+            this.em_code.BackColor = System.Drawing.Color.White;
+            this.em_code.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.em_code.ID = null;
+            this.em_code.Location = new System.Drawing.Point(798, 56);
+            this.em_code.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.em_code.Name = "em_code";
+            this.em_code.Power = null;
+            this.em_code.Size = new System.Drawing.Size(328, 57);
+            this.em_code.Str = null;
+            this.em_code.Str1 = null;
+            this.em_code.Str2 = null;
+            this.em_code.TabIndex = 2;
+            this.em_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.em_code_KeyDown);
+            this.em_code.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Em_code_KeyPress);
+            // 
+            // ConfirmDown
+            // 
+            this.ConfirmDown.AllPower = null;
+            this.ConfirmDown.BackColor = System.Drawing.Color.Transparent;
+            this.ConfirmDown.DownImage = ((System.Drawing.Image)(resources.GetObject("ConfirmDown.DownImage")));
+            this.ConfirmDown.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ConfirmDown.Image = null;
+            this.ConfirmDown.IsShowBorder = true;
+            this.ConfirmDown.Location = new System.Drawing.Point(1697, 55);
+            this.ConfirmDown.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.ConfirmDown.MoveImage = ((System.Drawing.Image)(resources.GetObject("ConfirmDown.MoveImage")));
+            this.ConfirmDown.Name = "ConfirmDown";
+            this.ConfirmDown.NormalImage = ((System.Drawing.Image)(resources.GetObject("ConfirmDown.NormalImage")));
+            this.ConfirmDown.Power = null;
+            this.ConfirmDown.Size = new System.Drawing.Size(166, 55);
+            this.ConfirmDown.TabIndex = 7;
+            this.ConfirmDown.Text = "确认下线";
+            this.ConfirmDown.UseVisualStyleBackColor = false;
+            this.ConfirmDown.Click += new System.EventHandler(this.ConfirmDown_Click);
+            // 
+            // SelectAll
+            // 
+            this.SelectAll.AllPower = null;
+            this.SelectAll.BackColor = System.Drawing.Color.Transparent;
+            this.SelectAll.DownImage = ((System.Drawing.Image)(resources.GetObject("SelectAll.DownImage")));
+            this.SelectAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SelectAll.Image = null;
+            this.SelectAll.IsShowBorder = true;
+            this.SelectAll.Location = new System.Drawing.Point(1549, 53);
+            this.SelectAll.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.SelectAll.MoveImage = ((System.Drawing.Image)(resources.GetObject("SelectAll.MoveImage")));
+            this.SelectAll.Name = "SelectAll";
+            this.SelectAll.NormalImage = ((System.Drawing.Image)(resources.GetObject("SelectAll.NormalImage")));
+            this.SelectAll.Power = null;
+            this.SelectAll.Size = new System.Drawing.Size(136, 55);
+            this.SelectAll.TabIndex = 8;
+            this.SelectAll.Text = "全选";
+            this.SelectAll.UseVisualStyleBackColor = false;
+            this.SelectAll.Click += new System.EventHandler(this.SelectAll_Click);
+            // 
             // OperateResult
-            //
-            this.OperateResult.Location = new System.Drawing.Point(1130, 96);
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(1695, 154);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(410, 640);
+            this.OperateResult.Size = new System.Drawing.Size(613, 1022);
             this.OperateResult.TabIndex = 6;
-            //
+            this.OperateResult.Text = "";
+            // 
             // Query_LoadMan
-            //
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1560, 760);
+            this.ClientSize = new System.Drawing.Size(2340, 1216);
             this.Controls.Add(this.SelectAll);
             this.Controls.Add(this.ConfirmDown);
             this.Controls.Add(this.li_code);
@@ -257,14 +274,14 @@ namespace UAS_MES_NEW.Query
             this.Controls.Add(this.DGV);
             this.Controls.Add(this.OperateResult);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "Query_LoadMan";
             this.Tag = "Query!LoadMan";
             this.Text = "人员上下线";
             this.Load += new System.EventHandler(this.Query_LoadMan_Load);
             this.SizeChanged += new System.EventHandler(this.Query_LoadMan_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.DGV)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }

+ 77 - 0
UAS_MES_YDCY/FunctionCode/Query/Query_LoadMan.resx

@@ -117,4 +117,81 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="ConfirmDown.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="ConfirmDown.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
+</value>
+  </data>
+  <data name="ConfirmDown.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="SelectAll.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFfSURBVFhH5dhNTsJgFIXhM2WiCxL2oAEHrJKhQSYM
+        JIgzjSLIX0sRKPSPtl+Lo2uOgVbWcJu8CzhP8nVwISIAUAFwA+AWQFNh3M39lZMHrgDUu91uyxjji8KP
+        u7mfDgCuiVLt958fkjSTie3I62iqLu7m/sHgpQ2gRpSG6/nmc2bL23imtuHMkp0f5ADuidIMoljev+bq
+        o8PpH4NmcIjlY7JQHx0KlPCQyHBqqY8OJUqcyGhuq48OBUoUJzJeLNVHhwLlkKQysRz10eECZbpcqe8C
+        JU6NzJ1v9dGhQElSI9Zqoz46lCgmE3u9VR8dCpTUZOJsXPXRoUTJclltd+qjQ4FislzW7l59dChR8lw2
+        e099dDijNA5xYnZBKFvPVxv3x0lanA5qT71eOzsexQsjcf1AXdzN/XQ4H5l4fqs/djqtIIzC/Pgj2uJu
+        7i/Okf8O11UAd6c3pS3u5v6/w/UvTaFspAxAMh4AAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="SelectAll.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAF3SURBVFhH5djbSgJRFMbxHsP7wBfYT7jvu46QDIoI
+        C4QNQRAIgVBRSdpxpgZN83wYx5nZOjNqrvgEd73DGvhfzdX3g32ztohoS0iVElLtCakehVQdhmE39qfg
+        AZBtIdX70Y0TjsJ4SQw/7MZ+OAip0kDJnD3UdJAsyXIjKvWm7MJu7M+X6lpIlQWK3ZhEq8pgRvfdKdvK
+        /Rk1/XglpHKA0ulPF3Tb0eyDAzzWKL3pgq7bmn1wMChdPadiK2QfHAxKW8/pqhmwDw4GpRXOqdAI2AcH
+        g9IME7qs++yDg0H5DhK6qE3YBweD0vATOq967IODQfnyE1KOxz44GJTaJKb855h9cDAoVS+mU9tlHxwM
+        iuPFdGK57IPDH8o4ouO3EfvgYFA+xhEdvg7ZB4cNil3uhquc5dLBy5Bt2P/U0+Z0kN0tOhqHlpzt0v7z
+        gF3Yjf1w2ByZ0jjD7RSs8K7l/+Ant7Ab+8058t/hOiOkquBNMQy7sX99uP4F5D4U8hdr4uMAAAAASUVO
+        RK5CYII=
+</value>
+  </data>
+  <data name="SelectAll.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGpSURBVFhH5dg/ayJBGMfxB4YFXTARBAvBQhAsBEEQ
+        ZLnNzFu4I6aYV5kyF9tgbad1jrsYY9T4Z3fcnV2f45e38Sx8q6l+n2IWhpiZjDFVY8wPY8xPY4wVGHZj
+        fxUepLW+0Vrfz+fzR+fclgV+2I39cNBa31Icx/FisXi6XpnL8io27F8ul89xHN9RFEWTPM+ToihZet57
+        F0XRA43HYwsp7wvxwQEeNBqNbFmWnOW5+OAADxoOh7YoS3ZZJj44wIMGg4H1RcGpu4gPDvCgfr9vvfd8
+        TlPxwQEe1Ov1bO49H8+J+OAAD+p2uxaXzNfpJD44wIM6nY69ZDnvDkfxwQEe1G637SXLeLs/iA8O8KBW
+        q2XdJePNbi8+OMCDms2mxe9o/bkTHxzgQY1GwybO8WrzKT44wIPq9bpNUsdv64344AAPqtVq9pw6/vv+
+        IT44wIPCMJzsvg7Jv/UH/1m9iw3794ejC8PwgSqVyt3LbPZ8SpLvg9e3lbiwG/vhAA8KguA2CIL739Pp
+        42a73eNQWtiN/XCAB+GhVilVVUrFSqlfSikrMOzG/u+H6/+yQ4jdXN8e9AAAAABJRU5ErkJggg==
+</value>
+  </data>
 </root>