From 3c4abaeaffd0a25641312d6124c6414940d9ed04 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 11 四月 2025 08:06:56 +0800
Subject: [PATCH] qc
---
DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs | 134 +++++++++++++++++++++++++++++++++++++++++---
1 files changed, 125 insertions(+), 9 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
index d7af265..2ae2272 100644
--- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs
@@ -1,22 +1,138 @@
-锘縰sing DevExpress.XtraEditors;
+锘縰sing Gs.DevApp.Entity;
+using Gs.DevApp.ToolBox;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm.Work
{
public partial class Frm_Work01 : DevExpress.XtraEditors.XtraForm
{
- public Frm_Work01()
+ string _webServiceName = "WorkCollect/";
+ string fGx = "";
+ string fBc = "";
+ string goodTag = "鈭�";
+ string badTag = "脳";
+ public Frm_Work01(string _fGx, string _fBc)
{
InitializeComponent();
-
+ this.Text = "宸ュ簭閲囬泦 - " + _fGx + " - " + fBc;
+ this.fGx = _fGx;
+ this.fBc = _fBc;
+ txt_gx.Text = fGx;
+ txt_bc.Text = fBc;
+ txt_barCode.KeyDown += (s, e) =>
+ {
+ if (e.KeyCode == Keys.Enter) { getModel("", goodTag); };
+ };
+ btnGood.Click += (s, e) =>
+ {
+ getModel("", goodTag);
+ };
+ btnBad.Click += (s, e) =>
+ {
+ getModel("", badTag);
+ };
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="_checkVal">妫�娴嬪��</param>
+ /// <param name="_checkResult">妫�娴嬬粨鏋�</param>
+ private void getModel(string _checkVal, string _checkResult)
+ {
+ string _barCode = txt_barCode.Text.Trim();
+ string _inBz = ""; ; //澶囨敞
+ if (string.IsNullOrEmpty(_barCode))
+ {
+ Toast vm = new Toast(-1, "~璇峰厛鎵拷婧爜~");
+ vm.Show();
+ return;
+ }
+ var _obj = new
+ {
+ barCode = _barCode,
+ inBz = _inBz,
+ checkVal = _checkVal,
+ checkResult = _checkResult,
+ processNo = txt_gx.Text.Trim(),//宸ュ簭
+ banCi = txt_bc.Text.Trim(),//鐝
+ gongWei = txt_gw.Text.Trim(),//宸ヤ綅
+ };
+ try
+ {
+ string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
+ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ dynamic dy = _rtn.rtnData;
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, false);
+ lbSum1.Text = dy.lbSum1;
+ lbSum2.Text = dy.lbSum2;
+ lbSum3.Text = dy.lbSum3;
+ lbSum4.Text = dy.lbSum4;
+ prog1.Position = dy.jd;
+ txt_barCode.ReadOnly = false;
+ JObject _job = JObject.Parse(strJson);
+ JArray array = new JArray();
+ foreach (var a in _job["rtnData"]["list"])
+ {
+ array.Add(a);
+ }
+ DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
+ if (dt.Rows.Count > 0)
+ {
+ gcMx1.BindingContext = new BindingContext();
+ gcMx1.DataSource = dt;
+ gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+ }
+ JArray array2 = new JArray();
+ foreach (var a in _job["rtnData"]["list2"])
+ {
+ array2.Add(a);
+ }
+ DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
+ if (dt2.Rows.Count > 0)
+ {
+ gcMx2.BindingContext = new BindingContext();
+ gcMx2.DataSource = dt2;
+ gcMx2.ForceInitialize();
+ gvMx2.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+ }
+ string _msg = _rtn.rtnMsg;
+ if (!string.IsNullOrEmpty(_msg))
+ {
+
+ Toast vm = new Toast( (goodTag== "鈭�" ? 1:-1), _msg);
+ vm.Show();
+ };
+ }
+ else
+ {
+ Toast vm = new Toast(-1, _rtn.rtnMsg);
+ vm.Show();
+ }
+
+ }
+ catch (Exception ex)
+ {
+ Toast vm = new Toast(-1, ex.Message);
+ vm.Show();
+ }
}
}
}
\ No newline at end of file
--
Gitblit v1.9.3