From 3bce783a7c08190a09aebca59864ada10961ffc2 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期二, 15 七月 2025 08:42:16 +0800
Subject: [PATCH] 采购退货
---
DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs | 333 +++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 261 insertions(+), 72 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
index 088781e..a6fbbc1 100644
--- a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
@@ -14,6 +14,7 @@
{
public partial class Frm_FqcDetect01 : DevExpress.XtraEditors.XtraForm
{
+ string _strTag = "N:涓嶅悎鏍�";
string _webServiceName = "FqcManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
public Frm_FqcDetect01()
@@ -27,7 +28,8 @@
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
- toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
+ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
@@ -70,7 +72,6 @@
txt_lineId.Text = lst[0].lineId;
txt_checkStates.Text = "W:鏈煡";
txt_fcheckResu.Text = "W:鏈煡";
- txt_freceQty.Text = "W:鏈煡";
}
catch (Exception ex)
{
@@ -93,16 +94,19 @@
{
try
{
- var lst = new List<string>();
- lst = ee.StringList;
+ var lst = new List<dynamic>();
+ lst = ee.DynamicList;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ decimal kbSl = 0;
foreach (var item in lst)
{
if (sb.Length > 0)
sb.Append(",");
- sb.Append(item);
+ sb.Append(item.itemBarcode);
+ kbSl += decimal.Parse(item.sl.ToString());
};
txt_kbList.Text = sb.ToString();
+ txt_kbSl.Text = kbSl.ToString();
}
catch (Exception ex)
{
@@ -113,6 +117,8 @@
};
// 璇诲彇缂洪櫡绛夌骇
getRptDefectLevel();
+ //宸ュ簭
+ txt_fmrmode.getSuppler("", " and isnull(isBack,0)=1");
}
/// <summary>
@@ -292,63 +298,19 @@
toolBarMenu1.guidKey = rowGuid;
}
/// <summary>
- ///鎻愪氦妫�楠屼簨浠�
+ ///瀹℃牳浜嬩欢
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
- private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_releaseNo, gridView1, "releaseNo");
- toolBarMenu1.guidKey = rowGuid;
- if (string.IsNullOrEmpty(rowGuid))
- {
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
- return;
- if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
- {
- if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim()))
- {
- MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒");
- return;
- }
- };
- var _obj = new
- {
- guid = rowGuid,
- };
- try
- {
- var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "EditModelSubmit",
- JsonConvert.SerializeObject(_obj));
- var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
- if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- {
- getModel(lbGuid.Text.Trim(), "0");
- }
- int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
- gridView1.FocusedRowHandle = rowHandle;
- int _inFieldValue = 1;
- UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
- }
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
-
+ _toolCk(1);
}
-
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+ {
+ _toolCk(0);
+ }
/// <summary>
/// 鍙栨秷浜嬩欢
/// </summary>
@@ -379,7 +341,6 @@
var _obj = new
{
guid = rowGuid,
- mxGuid = Guid.Empty.ToString(),
};
try
{
@@ -438,6 +399,8 @@
UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
this.ucUpFileList1.pGuid = "";
+ this.ucChouJianList1.pGuid = "";
+ this.setEable(false);
}
/// <summary>
/// 淇敼浜嬩欢
@@ -496,18 +459,114 @@
txt_djType.Focus();
return;
}
- if (string.IsNullOrEmpty(_txt_fbatchQty.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘涓虹┖锛�");
- txt_fbatchQty.Focus();
- return;
- }
if (string.IsNullOrEmpty(_txt_lotNo.Trim()))
{
Gs.DevApp.ToolBox.MsgHelper.Warning("宸ュ崟鍙蜂笉鑳戒负绌猴紒");
txt_lotNo.Focus();
return;
}
+ if (string.IsNullOrEmpty(_kbList.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("閫佹绠辩爜涓嶈兘涓虹┖锛�");
+ txt_kbList.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(txt_kbSl.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("閫佹鏁伴噺涓嶈兘涓虹┖锛�");
+ txt_kbList.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(_txt_fbatchQty.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘涓虹┖锛�");
+ txt_fbatchQty.Focus();
+ return;
+ }
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(_txt_fbatchQty))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇疯緭鍏ユ纭殑鎶芥鏁伴噺锛�");
+ txt_fbatchQty.Focus();
+ return;
+ }
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric2(txt_kbSl.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇疯緭鍏ユ纭殑閫佹鏁伴噺锛�");
+ txt_kbList.Focus();
+ return;
+ }
+ if (Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_txt_fbatchQty) > Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_kbSl.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("鎶芥鏁伴噺涓嶈兘澶т簬閫佹鏁伴噺锛�");
+ txt_fbatchQty.Focus();
+ return;
+ }
+ //褰撲笉鍚堟牸鏃剁殑妫�鏌�
+ string _txt_fngHandle = txt_fngHandle.Text.Trim();
+ string _txt_fmrmode = txt_fmrmode.GetCode();
+ string _txt_fzrId = txt_fzrId.GetId();
+ string _txt_workNo = txt_workNo.Text.Trim();
+ string _txt_zrType = txt_zrType.Text.Trim();
+ if (txt_fcheckResu.Text.Trim() == _strTag)
+ {
+ if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim()))
+ {
+ MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒");
+ txt_msg.Focus();
+ return;
+ }
+
+ if (txt_fngHandle.SelectedIndex <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨澶勭疆缁撴灉锛�");
+ txt_fngHandle.Focus();
+ return;
+ }
+ if (txt_zrType.SelectedIndex <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨璐d换鍒ゅ畾锛�");
+ txt_zrType.Focus();
+ return;
+ }
+ if (_txt_fzrId.Length <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇烽�夋嫨璐d换浜猴紒");
+ txt_fzrId.Focus();
+ return;
+ }
+ //褰撳缃粨鏋滀负鍙嶅伐鏃讹紝瑕侀�夋嫨宸ュ簭鍜屽弽宸ョ紪鍙�
+ if (txt_fngHandle.SelectedIndex == 1)
+ {
+ if (string.IsNullOrEmpty(_txt_workNo))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇峰~鍐欏弽宸ュ崟鍙凤紒");
+ txt_workNo.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(_txt_fmrmode))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("褰撲笉鍚堟牸鏃讹紝璇峰~閫夋嫨鍙嶅伐宸ュ簭锛�");
+ txt_fmrmode.Focus();
+ return;
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(_txt_workNo))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕佸~鍐欏弽宸ュ崟鍙凤紒");
+ txt_workNo.Focus();
+ return;
+ }
+ if (!string.IsNullOrEmpty(_txt_fmrmode))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕侀�夋嫨鍙嶅伐宸ュ簭锛�");
+ txt_fmrmode.Focus();
+ return;
+ }
+ }
+ };
+
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
@@ -523,8 +582,12 @@
fmanageNo = _txt_fmanageNo,//娴佺▼缂栧彿
lotNo1 = _txt_lotNo1,//閫佹鎵瑰彿
lotNo = _txt_lotNo,//鐢熶骇宸ュ崟
- edtType = 0,
kbList = _kbList,
+ fngHandle = _txt_fngHandle,
+ fzrId = _txt_fzrId,
+ workNo = _txt_workNo,
+ fmrmode = _txt_fmrmode,
+ zrType = _txt_zrType,
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
@@ -539,7 +602,7 @@
string _defectLevel = row["defectLevel"].ToString();
string _defectDetails = row["defectDetails"].ToString();
string _fcheckResu = row["fcheckResu"].ToString();
- if (_fcheckResu == "涓嶅悎鏍�")
+ if (_fcheckResu == _strTag)
{
if (string.IsNullOrEmpty(_defectLevel))
{
@@ -590,7 +653,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
// _sbSqlWhere += " and isnull(fsubmit,0)=0";
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
@@ -667,6 +730,7 @@
gcMx1.ForceInitialize();
gvMx1.BestFitColumns();
ucUpFileList1.pGuid = lbGuid.Text.Trim();
+ ucChouJianList1.pGuid = lbGuid.Text.Trim();
if (guid5.Length > 10)
{
int rowHandle = 0;
@@ -749,15 +813,14 @@
}
}
-
-
private void setEable(bool bl)
{
- // txtChouJian.ReadOnly=txtJianYan.ReadOnly = !bl;
+ txtJianYan.ReadOnly = !bl;
btnLoad.Enabled = bl;
+ ucChouJianList1.IsReadOnly(!bl);
btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
- }
+ }
/// <summary>
/// 璇诲彇缂洪櫡绛夌骇
@@ -765,7 +828,7 @@
/// <param name="curPage"></param>
private void getRptDefectLevel()
{
- string _where = " and 1=1 and s_type='缂洪櫡绛夌骇'";
+ string _where = " and 1=1 and a.s_type='缂洪櫡绛夌骇' and a.pid<>'00000000-0000-0000-0000-000000000000'";
var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where);
var json = JsonConvert.SerializeObject(pgq);
try
@@ -793,7 +856,7 @@
var rowhandle = gvMx1.FocusedRowHandle;
if (rowhandle < 0)
return;
- UcDictionarySelect frm = new UcDictionarySelect("缂洪櫡鎻忚堪", " s_type='FQC缂洪櫡鎻忚堪'");
+ UcDictionarySelect frm = new UcDictionarySelect("寮傚父鎻忚堪", " a.s_type='QC寮傚父鎻忚堪' and a.pid<>'00000000-0000-0000-0000-000000000000'");
frm.UpdateParent += (ss, ee) =>
{
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
@@ -809,5 +872,131 @@
};
frm.ShowDialog();
}
+
+
+ /// <summary>
+ /// 妫�楠屽拰鍙嶆楠�
+ /// </summary>
+ /// <param name="inFieldValue"></param>
+ private void _toolCk(int _inFieldValue)
+ {
+ string strMsg = "";
+ switch (_inFieldValue)
+ {
+ case 1:
+ strMsg = "瀹℃牳";
+ break;
+ case 0:
+ strMsg = "鍙嶅鏍�";
+ break;
+ };
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_releaseNo, gridView1, "releaseNo");
+ toolBarMenu1.guidKey = rowGuid;
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+ return;
+ if (_inFieldValue == 1)
+ {
+ if (txt_fcheckResu.Text.Trim() == _strTag)
+ {
+ if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim()))
+ {
+ MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒");
+ return;
+ }
+ string _txt_fngHandle = txt_fngHandle.Text.Trim();
+ string _txt_fmrmode = txt_fmrmode.GetCode();
+ string _txt_fzrId = txt_fzrId.GetId();
+ string _txt_workNo = txt_workNo.Text.Trim();
+ string _txt_msg = txt_msg.TextTxt;
+ string _txt_zrType = txt_zrType.Text.Trim();
+ if (txt_fngHandle.SelectedIndex <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨澶勭疆缁撴灉锛�");
+ txt_fngHandle.Focus();
+ return;
+ }
+ if (txt_zrType.SelectedIndex <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换鍒ゅ畾锛�");
+ txt_zrType.Focus();
+ return;
+ }
+ if (_txt_fzrId.Length <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐d换浜猴紒");
+ txt_fzrId.Focus();
+ return;
+ }
+ //褰撳缃粨鏋滀负鍙嶅伐鏃讹紝瑕侀�夋嫨宸ュ簭鍜屽弽宸ョ紪鍙�
+ if (txt_fngHandle.SelectedIndex == 1)
+ {
+ if (string.IsNullOrEmpty(_txt_workNo))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇峰~鍐欏弽宸ュ崟鍙凤紒");
+ txt_workNo.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(_txt_fmrmode))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇峰~閫夋嫨鍙嶅伐宸ュ簭锛�");
+ txt_fmrmode.Focus();
+ return;
+ }
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(_txt_workNo))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕佸~鍐欏弽宸ュ崟鍙凤紒");
+ txt_workNo.Focus();
+ return;
+ }
+ if (!string.IsNullOrEmpty(_txt_fmrmode))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶉渶瑕侀�夋嫨鍙嶅伐宸ュ簭锛�");
+ txt_fmrmode.Focus();
+ return;
+ }
+ }
+ };
+ }
+
+ var _obj = new
+ {
+ guid = rowGuid,
+ inFieldValue = _inFieldValue,
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "EditModelSubmit",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+ if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+ {
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(lbGuid.Text.Trim(), "0");
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
+ UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3