From 940c90694440abeb2906f8dd1f36f6b6478b3490 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 18 十一月 2024 10:38:40 +0800
Subject: [PATCH] 采购入库
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs | 78 ++++++++++++++++++++++++++++++++++----
1 files changed, 69 insertions(+), 9 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
index a9243a2..2001b1f 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
@@ -45,8 +45,44 @@
Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
e.Graphics.DrawString(str, f, Brushes.Gray, r);
};
+ _setIno();
+ }
+ private void _setIno()
+ {
+ this.txt_itemId.KeyFile = "id";
+ this.txt_suppNo.KeyFile = "suppNo";
+ txt_itemId.EditChanged += (s, e) =>
+ {
+ txt_itemNo.Text = this.txt_itemId.GetCode();
+ //var ItemId = this.txt_itemId.GetId();
+ //var ItemName = this.txt_itemId.GetName();
+ //GetCount(ItemId, ItemName);
+ };
}
+ private int GetCount(string ItemId,string ItemName)
+ {
+ //string rowGuid = "", rowName = "";
+ //(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1);
+ //if (string.IsNullOrEmpty(rowGuid))
+ //{
+ // ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ // return;
+ //}
+
+ try
+ {
+ string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetCount", JsonConvert.SerializeObject(ItemId));
+ ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ return _rtn.rtnCode;
+
+ }
+ catch (Exception ex)
+ {
+ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ return -1;
+ }
+ }
/// <summary>
/// 鍙屽嚮浜嬩欢
/// </summary>
@@ -142,8 +178,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
}
/// <summary>
/// 淇敼浜嬩欢
@@ -189,18 +227,40 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- if (string.IsNullOrEmpty(txt_itemNo.Text.Trim()))
+ string _ItemId = txt_itemId.GetId();
+ string _suppNo = txt_suppNo.GetId();
+ if (string.IsNullOrEmpty(_ItemId))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鐗╂枡缂栫爜涓嶈兘涓虹┖锛�");
- // txt_account.Focus();
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鐗╂枡锛�");
+ txt_itemId.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(_suppNo))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒");
+ txt_suppNo.Focus();
return;
}
var _obj = new MesQaMj
{
Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
- ItemId = Convert.ToInt32(txt_itemId.Text.Trim()),
- ItemNo = txt_itemNo.Text.Trim(),
+ ItemId = Convert.ToInt32(_ItemId),
+ ItemNo = txt_itemId.GetCode(),
+ SuppId = _suppNo,
};
+
+ if (lbGuid.Text.Trim().Length == 0)
+ {
+ var ItemName = txt_itemNo.Text.Trim();
+ var flag = GetCount(_ItemId, ItemName);
+ if (flag > 0)
+ {
+ UtilityHelper.JumpToTab(xtraTabControl1, 0);
+ MsgHelper.Warning("鎻愮ず锛�" + ItemName + "杩欎釜鐗╂枡宸茬粡缁存姢浜嗗厤妫�鏁版嵁");
+ return;
+ }
+ }
+
try
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
@@ -310,7 +370,7 @@
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_itemId, gridView1);
+ lbGuid, txt_itemNo, gridView1);
toolBarMenu1.guidKey = rowGuid;
}
@@ -324,7 +384,7 @@
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_itemId, gridView1);
+ lbGuid, txt_itemNo, gridView1);
toolBarMenu1.guidKey = rowGuid;
}
}
--
Gitblit v1.9.3