From ddcd06bd597a722931e9d154d70b3cf57759b850 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 26 六月 2025 11:03:07 +0800
Subject: [PATCH] srm名单
---
DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs | 321 ++++++++++++++++++++---------------------------------
1 files changed, 123 insertions(+), 198 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
index 9ba2217..63142db 100644
--- a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
+++ b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
@@ -1,15 +1,10 @@
-锘縰sing DevExpress.XtraEditors;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
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;
@@ -17,9 +12,8 @@
{
public partial class Frm_Cqfa : DevExpress.XtraEditors.XtraForm
{
- string _webServiceName = "MesCgthSqManager/";
+ string _webServiceName = "RkqcfaManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
- string _ucGys = "";//渚涘簲鍟�
public Frm_Cqfa()
{
InitializeComponent();
@@ -33,8 +27,7 @@
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, "status", "", (value) =>
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
}, tips);
@@ -47,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)
@@ -167,7 +151,7 @@
{
string rowGuid = "", rowName = "";
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_fabm, gridView1, "billNo");
+ lbGuid, txt_fabm, gridView1, "fabm");
if (string.IsNullOrEmpty(rowGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -178,30 +162,30 @@
var _obj = new
{
guid = rowGuid,
- mxGuid = Guid.Empty.ToString(),
+ mxGuid = "",
};
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);
}
-
}
/// <summary>
@@ -239,19 +223,15 @@
lbGuid, txt_fabm, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(rowGuid);
- }
- 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);
+ txt_fabm.ReadOnly = true;
+ txt_fSubsidiary.Enabled = false;
}
}
/// <summary>
@@ -263,13 +243,11 @@
{
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_thOrgId);
-
+ string deftOrg = UtilityHelper.GetFirstOrg(txt_fSubsidiary);
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -282,8 +260,14 @@
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("鍚嶇О涓嶈兘涓虹┖锛�");
@@ -302,83 +286,39 @@
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 = int.Parse(_yjrq),
- bzqx = int.Parse(_bzqx),
- fjxz = int.Parse(_fjxz),
+ guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()),
+ yjrq = (_yjrq),
+ bzqx = (_bzqx),
+ fjxz = (0),
famc = _famc.Trim(),
bz = _bz.Trim(),
- list = new List<dynamic>(),
+ fSubsidiary = _fSubsidiary.Trim(),
};
- gvMx1.CloseEditor();
- gvMx1.PostEditor();
- gvMx1.UpdateCurrentRow();
- if (gvMx1.DataRowCount <= 0)
- {
- MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨浣犵殑鏀舵枡鏄庣粏锛�");
- return;
- }
- 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);
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
@@ -390,7 +330,7 @@
private void getPageList(int curPage)
{
gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
- PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "BILL_NO", "asc", "", _sbSqlWhere.ToString());
+ PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "a.fabm", "desc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
{
@@ -435,7 +375,7 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
var _obj = new
@@ -449,38 +389,17 @@
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.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
/// <summary>
@@ -501,7 +420,7 @@
};
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fabm, gridView1, "billNo");
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_fabm, gridView1, "fabm");
if (string.IsNullOrEmpty(rowGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -512,79 +431,85 @@
var _obj = new
{
guid = rowGuid,
- inFieldValue = _inFieldValue,
+ ckValue = _inFieldValue,
+ parameter = "MES_CQJY_FA,checkDate,checkStatus,checkBy"
};
try
{
- var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "EditModelSubmit",
+ var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
- if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+ if (_rtn.rtnCode > 0)
{
+ MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
if (xtraTabControl1.SelectedTabPageIndex == 1)
{
getModel(lbGuid.Text.Trim());
}
int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
gridView1.FocusedRowHandle = rowHandle;
- UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+ UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
+ else
+ MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
}
catch (Exception ex)
{
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+
/// <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.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ 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