From fddd16cf2a5bda8198d678062f3fc72e90e78b4b Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期二, 23 九月 2025 17:33:23 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs | 278 ++++++++++++++++++++-----------------------------------
1 files changed, 100 insertions(+), 178 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
index 4aa4936..d887c58 100644
--- a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
+++ b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
@@ -2,7 +2,6 @@
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -15,7 +14,6 @@
{
string _webServiceName = "RkqcfaManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
- string _ucGys = "";//渚涘簲鍟�
public Frm_Cqfa()
{
InitializeComponent();
@@ -29,7 +27,6 @@
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
this.toolBarMenu1.getXmlConfig();
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
@@ -43,46 +40,37 @@
}, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- //閫夋嫨闇�瑕佺殑鏄庣粏
- btnSelect.Click += (s, e) =>
+ //绉诲叆
+ btnIn.Click += (s, e) =>
{
- //if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
- //{
- // Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紒");
- // return;
- //}
- //var frm = new SelectMesCgthSq(this.txt_suppId.GetId(), this.txt_thOrgId.GetId());
- ////璧嬪�肩粰鏄庣粏琛�
- //frm.UpdateParent += (ss, ee) =>
- //{
- // try
- // {
- // var lst = new List<string>();
- // lst = ee.StringList;
- // var _obj = lst;
- // var strReturn = UtilityHelper.HttpPost("",
- // _webServiceName + "SelectFormTo",
- // JsonConvert.SerializeObject(_obj));
- // var dt = UtilityHelper.ReturnToList(strReturn);
- // DataTable _newTable = dt.rtnData;
- // DataTable _oldTable = (DataTable)gcMx1.DataSource;
- // DataRow[] sourceRows = _newTable.Select();
- // for (int i = 0; i < sourceRows.Length; i++)
- // {
- // _oldTable.ImportRow(sourceRows[i]);
- // }
- // gcMx1.BindingContext = new BindingContext();
- // gcMx1.DataSource = _oldTable;
- // gcMx1.ForceInitialize();
- // gvMx1.BestFitColumns();
- // Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
- // }
- // catch (Exception ex)
- // {
- // MessageBox.Show(ex.Message);
- // }
- //};
- //frm.ShowDialog();
+ if (lbGuid.Text.Length <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堜繚瀛樻柟妗堬紒");
+ return;
+ }
+ string strItemsGuids = frm_CqfaItems2.GetSelect();
+ if (string.IsNullOrEmpty(strItemsGuids))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堝嬀閫夐渶瑕佺Щ鍏ョ殑鐗╂枡锛�");
+ return;
+ }
+ _toolOutIn(1, strItemsGuids);
+ };
+ //绉诲嚭
+ btnOut.Click += (s, e) =>
+ {
+ if (lbGuid.Text.Length <= 0)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堜繚瀛樻柟妗堬紒");
+ return;
+ }
+ string strItemsGuids = frm_CqfaItems1.GetSelect();
+ if (string.IsNullOrEmpty(strItemsGuids))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("鎻愮ず锛氳鍏堝嬀閫夐渶瑕佺Щ鍑虹殑鐗╂枡锛�");
+ return;
+ }
+ _toolOutIn(0, strItemsGuids);
};
}
private async void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -179,23 +167,24 @@
try
{
var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "DeleteModelOrMx",
+ _webServiceName + "DeleteModel",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
if (xtraTabControl1.SelectedTabPageIndex == 0)
{ }
else
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
getPageList(this.pageBar1.CurrentPage);
}
-
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ else
+ MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -241,15 +230,9 @@
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(rowGuid);
- txt_fabm.ReadOnly = true;
- txt_fSubsidiary.Enabled = false;
}
- else
- {
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
- }
+ //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+ txt_fSubsidiary.IsReadly = true;
}
/// <summary>
/// 鏂板浜嬩欢
@@ -260,10 +243,9 @@
{
lbGuid.Text = "";
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
- List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gridViews.Add(gvMx1);
- UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true);
+ frm_CqfaItems1.Clean();
+ frm_CqfaItems2.Clean();
//澧炲姞鏃讹紝榛樿缁勭粐
string deftOrg = UtilityHelper.GetFirstOrg(txt_fSubsidiary);
}
@@ -275,23 +257,15 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- string _fabm = txt_fabm.Text.Trim();
string _famc = txt_famc.Text.Trim();
string _yjrq = txt_yjrq.Text.Trim();
string _bzqx = txt_bzqx.Text.Trim();
- string _fjxz = txt_fjxz.Text.Trim();
string _bz = txt_bz.Text.Trim();
string _fSubsidiary = txt_fSubsidiary.GetId();
if (string.IsNullOrEmpty(_fSubsidiary))
{
MsgHelper.ShowError("缁勭粐涓嶈兘涓虹┖锛�");
txt_fSubsidiary.Focus();
- return;
- }
- if (string.IsNullOrEmpty(_famc))
- {
- MsgHelper.ShowError("鏂规缂栫爜涓嶈兘涓虹┖锛�");
- txt_fabm.Focus();
return;
}
if (string.IsNullOrEmpty(_famc))
@@ -312,73 +286,32 @@
txt_bzqx.Focus();
return;
}
- if (string.IsNullOrEmpty(_fjxz))
- {
- MsgHelper.ShowError("澶嶆闄愬��(娆�)涓嶈兘涓虹┖锛�");
- txt_fjxz.Focus();
- return;
- }
var _obj = new
{
guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()),
yjrq = (_yjrq),
bzqx = (_bzqx),
- fjxz = (_fjxz),
+ fjxz = (0),
famc = _famc.Trim(),
- fabm = _fabm.Trim(),
bz = _bz.Trim(),
fSubsidiary = _fSubsidiary.Trim(),
- list = new List<dynamic>(),
};
- gvMx1.CloseEditor();
- gvMx1.PostEditor();
- gvMx1.UpdateCurrentRow();
- for (var i = 0; i < gvMx1.DataRowCount; i++)
- {
- var row = gvMx1.GetDataRow(i);
- if (row != null)
- {
- Guid _guid = UtilityHelper.ToGuid(row["id"].ToString());
- string _msl = row["sqNum"].ToString();
- if (string.IsNullOrEmpty(_msl))
- {
- MsgHelper.ShowError("鐢宠鏁伴噺涓嶈兘涓虹┖锛�");
- return;
- }
- string _depotId = row["depotId"].ToString();
- if (string.IsNullOrEmpty(_depotId))
- {
- MsgHelper.ShowError("浠撳簱涓嶈兘涓虹┖锛�");
- return;
- }
- _obj.list.Add(new
- {
- Guid = _guid,
- AboutGuid = UtilityHelper.ToGuid(row["rkmxGuid"].ToString()),
- Quantity = decimal.Parse(row["sqNum"].ToString()),
- Bz = row["remark"].ToString(),
- DepotId = row["depotId"].ToString(),
- });
- }
- }
try
{
var strJson = UtilityHelper.HttpPost("",
_webServiceName + "EditModel",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
if (_rtn.rtnCode > 0)
{
MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
lbGuid.Text = _rtn.rtnData.outGuid;
txt_fabm.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
toolBarMenu1.currentAction = "";
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
+ getModel(lbGuid.Text);
}
else
MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -396,7 +329,11 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;
+ System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+ _sbSqlWhere.Append(" and A.fSubsidiary in");
+ _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+ _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.fabm", "desc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -442,7 +379,7 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -456,31 +393,10 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
- _ucGys = dy.suppId;
lbGuid.Text = strGuid;
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
- _ucGys = "";
- 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);
- }
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
+ frm_CqfaItems1.Initialize(lbGuid.Text.Trim(), QcSeason.cqcjyes.ToString(), txt_fSubsidiary.GetId());
+ frm_CqfaItems2.Initialize(lbGuid.Text.Trim(), QcSeason.cqcjno.ToString(), txt_fSubsidiary.GetId());
}
else
ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -531,9 +447,11 @@
{
MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
getModel(lbGuid.Text.Trim());
- else
- getPageList(this.pageBar1.CurrentPage);
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
else
@@ -545,53 +463,57 @@
}
}
+
/// <summary>
- /// 鍒犻櫎鏄庣粏
+ /// 宸ュ叿鏉′簨浠�
/// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ /// <param name="inFieldValue"></param>
+ private void _toolOutIn(int _inFieldValue, string _itemGuids)
{
- gvMx1.CloseEditor();
- gvMx1.PostEditor();
- gvMx1.UpdateCurrentRow();
- var rowhandle = gvMx1.FocusedRowHandle;
- if (rowhandle < 0)
- return;
- if (e.Button.Index == 0)
+ string strMsg = "";
+ switch (_inFieldValue)
{
- var dr = gvMx1.GetDataRow(rowhandle);
- var mxGuid = dr["id"].ToString();
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
- return;
- if (string.IsNullOrEmpty(mxGuid))
+ case 1:
+ strMsg = "绉诲叆";
+ break;
+ case 0:
+ strMsg = "绉诲嚭";
+ break;
+ };
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fabm, gridView1, "fabm");
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("纭畾鎶婃墍閫夋嫨鐨勭墿鏂欍��"+ strMsg + "銆戞柟妗堛��" + rowName + "銆戝悧锛�"))
+ return;
+ var _obj = new
+ {
+ guid = rowGuid,
+ inFieldValue = _inFieldValue,
+ inItemsGuids = _itemGuids
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "EditModelOutIn",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
- gvMx1.DeleteRow(rowhandle);
- return;
+ MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg.ToString());
+ frm_CqfaItems1.Initialize(lbGuid.Text.Trim(), QcSeason.cqcjyes.ToString(), txt_fSubsidiary.GetId());
+ frm_CqfaItems2.Initialize(lbGuid.Text.Trim(), QcSeason.cqcjno.ToString(), txt_fSubsidiary.GetId());
}
- var _obj = new
- {
- guid = lbGuid.Text.Trim(),
- mxGuid = mxGuid,
- };
- try
- {
- var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "DeleteModelOrMx",
- JsonConvert.SerializeObject(_obj));
- var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
- }
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
+ else
+ MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
-
}
}
\ No newline at end of file
--
Gitblit v1.9.3