From 7dc26bc31ccb4355e20c07c6a31fae127c979d65 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 17 四月 2025 16:57:47 +0800
Subject: [PATCH] 生产退货
---
DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs | 420 ++++++++++++++++++++++++++++++++---------------------------
1 files changed, 225 insertions(+), 195 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
index 6b97c13..cd9f538 100644
--- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
@@ -3,14 +3,11 @@
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
-using MES.Service.Modes;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
-using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -20,6 +17,7 @@
{
string _webServiceName = "WompbaManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
+ string _cjBm = "";//杞﹂棿
public Frm_Wompba()
{
InitializeComponent();
@@ -32,18 +30,36 @@
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ }, tips);
+ Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+ {
+ getModel(value);
+ }, (value) =>
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ }, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
+ //閫夊瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜岃溅闂达級
+ txt_erpSczz.EditChanged += (s, e) =>
+ {
+ string _orgId = txt_erpSczz.GetId();
+ if (string.IsNullOrEmpty(_orgId))
+ return;
+ txt_pba013.getSuppler(_orgId, _cjBm);
+ };
+ // 閫夋嫨杞﹂棿锛堝彉鏄庣粏涓骇绾匡級
txt_pba013.EditChanged += (s, e) =>
{
- string workGuid = this.txt_pba013.GetGuid();
- txt_pba016.getSuppler(workGuid);
+ string workGuid = this.txt_pba013.GetId();
_getListJybz(workGuid);
};
- //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
+ //閫夋嫨闇�瑕佺殑鏄庣粏
btnSelect.Click += (s, e) =>
{
if (string.IsNullOrEmpty(this.txt_pba013.GetId()))
@@ -51,7 +67,7 @@
Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨杞﹂棿锛屾墠鑳介�夋嫨浠诲姟鍗曪紒");
return;
}
- var frm = new SelectWompba(this.txt_pba013.Text);
+ var frm = new SelectWompba(this.txt_pba013.GetId());
//璧嬪�肩粰鏄庣粏琛�
frm.UpdateParent += (ss, ee) =>
{
@@ -73,7 +89,12 @@
}
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = _oldTable;
+ gvMx1.CloseEditor();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
catch (Exception ex)
{
@@ -83,23 +104,13 @@
frm.ShowDialog();
};
}
- private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
- Task.Delay(100);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ Task.Delay(100);
getPageList(1);
}
- /// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
- }
+
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -116,10 +127,14 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
{
- Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList);
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gridView1.ActiveFilter.Clear();
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
+
/// <summary>
/// 鏌ヨ鍥炶皟
/// </summary>
@@ -127,106 +142,8 @@
/// <param name="e"></param>
private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
{
- gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
- gridView1.ActiveFilter.Clear();
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- var frm = new ShowFilter(gridView1.Columns, _filterList);
- frm.UpdateParent += Frm_UpdateParent;
- frm.ShowDialog();
- }
- /// <summary>
- /// 瀹℃牳浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_hNo, gridView1, "hNo");
- //toolBarMenu1.guidKey = rowGuid;
- if (string.IsNullOrEmpty(rowGuid))
- {
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀹℃牳鍚楋紵"))
- 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.ToString());
- if (_rtn.rtnCode > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
- else
- getPageList(1);
- }
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
-
- }
-
- /// <summary>
- /// 鍙嶅鏍�
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- /// <exception cref="NotImplementedException"></exception>
- private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_hNo, gridView1);
- // toolBarMenu1.guidKey = rowGuid;
- if (string.IsNullOrEmpty(rowGuid))
- {
- MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- //MsgHelper.Warning(rowGuid);
-
- var _obj = new
- {
- guid = rowGuid,
- };
- try
- {
- var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "DeApprove",
- JsonConvert.SerializeObject(_obj));
- var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
- else
- getPageList(1);
- }
- else
- {
- MsgHelper.Warning(_rtn.rtnMsg);
- }
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
-
+ _filterList = e.FilterList;
+ getPageList(1);
}
/// <summary>
@@ -236,7 +153,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
/// <summary>
@@ -269,10 +186,12 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1);
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
-
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
@@ -280,7 +199,6 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
/// <summary>
/// 鍒锋柊浜嬩欢
/// </summary>
@@ -289,19 +207,42 @@
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
else
{
- _filterList.Clear();
- if (gridView1.ActiveFilter.Count > 0)
- {
- gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
- gridView1.ActiveFilter.Clear();
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- }
- getPageList(1);
+ //_filterList.Clear();
+ //if (gridView1.ActiveFilter.Count > 0)
+ //{
+ // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ // gridView1.ActiveFilter.Clear();
+ // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ //}
+ //getPageList(1);
+ getPageList(this.pageBar1.CurrentPage);
}
}
+ /// <summary>
+ /// 瀹℃牳浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+ {
+ _toolCk(1, "EditModelSubmit");
+ }
+
+ /// <summary>
+ /// 鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+ {
+ _toolCk(0, "EditModelSubmitFSH");
+ }
+
+
/// <summary>
/// 淇敼浜嬩欢
/// </summary>
@@ -309,14 +250,25 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
- string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1);
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_hNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- getModel(rowGuid, true, 1);
+ 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);
+ }
}
/// <summary>
/// 鏂板浜嬩欢
@@ -325,11 +277,11 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
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.panel1.Controls, true, gridViews);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
/// <summary>
@@ -347,33 +299,19 @@
txt_pba013.Focus();
return;
}
- string lineId = txt_pba016.GetId();
- if (string.IsNullOrEmpty(lineId.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浜х嚎锛�");
- txt_pba016.Focus();
- return;
- }
- if (string.IsNullOrEmpty(txt_pba015.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("璁″垝浜烘暟涓嶈兘涓虹┖锛�");
- txt_pba015.Focus();
- return;
- }
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
bz = txt_pba009.Text.Trim(),
cjId = workId,
- cxId = lineId,
- jhrs = txt_pba015.Text.Trim(),
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
- MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨浣犵殑鏀舵枡鏄庣粏锛�");
+ MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨鏄庣粏锛�");
return;
}
for (var i = 0; i < gvMx1.DataRowCount; i++)
@@ -385,32 +323,62 @@
string _LineId = row["daa015"].ToString();
if (string.IsNullOrEmpty(_LineId))
{
- MsgHelper.ShowError("浜х嚎涓嶈兘涓虹┖锛�");
+ MsgHelper.ShowError("绾垮埆涓嶈兘涓虹┖锛�");
return;
}
- string _Pcsl = row["daa008"].ToString();
- if (string.IsNullOrEmpty(_LineId))
+ if (Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(row["daa008"].ToString()) <= 0)
{
- MsgHelper.ShowError("鎺掍骇鏁伴噺涓嶈兘涓虹┖锛�");
+ MsgHelper.ShowError("璇疯緭鍏ユ纭殑鎺掍骇鏁伴噺锛�");
return;
}
string _Yjkgsj = row["mesStartProd"].ToString();
- if (string.IsNullOrEmpty(_LineId))
+ if (string.IsNullOrEmpty(_Yjkgsj))
{
MsgHelper.ShowError("棰勮寮�宸ユ椂闂翠笉鑳戒负绌猴紒");
return;
}
+ //string _prepareTime = row["prepareTime"].ToString();
+ //if (string.IsNullOrEmpty(_prepareTime))
+ //{
+ // MsgHelper.ShowError("棰勮澶囨枡鏃堕棿涓嶈兘涓虹┖锛�");
+ // return;
+ //}
+ //string _planPersonnel = row["planPersonnel"].ToString();
+ //if (string.IsNullOrEmpty(_planPersonnel))
+ //{
+ // MsgHelper.ShowError("璁″垝浜烘暟锛�");
+ // return;
+ //}
+ //string _changeLinetime = row["changeLinetime"].ToString();
+ //if (string.IsNullOrEmpty(_changeLinetime))
+ //{
+ // MsgHelper.ShowError("鎹㈢嚎鏃堕棿涓嶈兘涓虹┖锛�");
+ // return;
+ //}
+ string _mesEndProd = row["mesEndProd"].ToString();
+ if (string.IsNullOrEmpty(_mesEndProd))
+ {
+ MsgHelper.ShowError("棰勮瀹屽伐鏃堕棿涓嶈兘涓虹┖锛�");
+ return;
+ }
+ //string _restTime = row["restTime"].ToString();
+ //if (string.IsNullOrEmpty(_prepareTime))
+ //{
+ // MsgHelper.ShowError("浼戞伅鏃堕棿涓嶈兘涓虹┖锛�");
+ // return;
+ //}
_obj.list.Add(new
{
Guid = _guid,
AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["caaGuid"].ToString()),
- LineId = int.Parse(row["daa015"].ToString()),//浜х嚎id
+ LineId = row["daa015"].ToString(),//浜х嚎id
Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
Jhrs = row["planPersonnel"].ToString(),//璁″垝浜烘暟
Hxsj = row["changeLinetime"].ToString(),//鎹㈢嚎鏃堕棿
Bz = row["daa009"].ToString(),//澶囨敞
Blsj = row["prepareTime"].ToString(),//棰勮澶囨枡鏃堕棿
- Pcsl = row["daa008"].ToString()//鎺掍骇鏁伴噺
+ Pcsl = row["daa008"].ToString(),//鎺掍骇鏁伴噺
+ Yjwgsj = row["mesEndProd"].ToString()//棰勮瀹屽伐鏃堕棿
});
}
}
@@ -421,9 +389,14 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- lbGuid.Text = _rtn.rtnData;
+ lbGuid.Text = _rtn.rtnData.outGuid;
+ txt_hNo.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+ List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+ gvList.Add(gvMx1);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+ toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
}
catch (Exception ex)
@@ -437,9 +410,8 @@
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage)
+ private void getPageList(int curPage)
{
-
var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
@@ -451,15 +423,16 @@
if (dd.rtnCode > 0)
{
DataTable dt = dd.rtnData.list;
- gcMain.BindingContext = new BindingContext();
+ gcMain1.BindingContext = new BindingContext();
gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
if (dt.Rows.Count > 0)
{
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
+ gcMain1.DataSource = dt;
+ gcMain1.ForceInitialize();
+ gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -474,16 +447,18 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid)
{
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
var _obj = new
{
guid = strGuid,//涓诲缓
@@ -495,10 +470,12 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
+ _cjBm = dy.pba013;
lbGuid.Text = strGuid;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
+ _cjBm = "";
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -511,6 +488,8 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -525,7 +504,6 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var rowhandle = gvMx1.FocusedRowHandle;
@@ -555,7 +533,7 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+ if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
}
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -566,24 +544,23 @@
}
}
+ /// <summary>
+ /// 鏍规嵁杞﹂棿璇讳骇绾�
+ /// </summary>
+ /// <param name="workGuid"></param>
private void _getListJybz(string workGuid)
{
+ rptJYBZ.Items.Clear();
if (string.IsNullOrEmpty(workGuid))
return;
- var _obj = new
- {
- guid = workGuid //涓诲缓
- };
- var json = JsonConvert.SerializeObject(_obj);
+ var _sbSqlWhere = " and 1=1 and dpt_id=" + workGuid;
+ var pgq = new PageQueryModel(1, 999999, "a.line_no", "asc", "", _sbSqlWhere.ToString());
+ var json = JsonConvert.SerializeObject(pgq);
try
{
- var strReturn = UtilityHelper.HttpPost("",
- "SysDepartmentManager/GetModel", json);
- var _job = JObject.Parse(strReturn);
- var array = new JArray();
- var d = _job["rtnData"]["list"];
- foreach (var a in d) array.Add(a);
- var dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
+ var strReturn = UtilityHelper.HttpPost("", "MesWorkshopLineManager/GetListPage", json);
+ var dd = UtilityHelper.ReturnToTablePage(strReturn);
+ DataTable dt = dd.rtnData.list;
foreach (DataRow dr in dt.Rows)
{
rptJYBZ.Items.Add((new CboItemEntity(dr["id"].ToString(), dr["name"].ToString())));
@@ -594,7 +571,6 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
private void rptJYBZ_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBoxEdit comboBox = sender as ComboBoxEdit;
@@ -606,10 +582,64 @@
string _val = _itm.Value.ToString();
string _txt = _itm.Text.ToString();
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
gvMx1.SetRowCellValue(dataIndex, "daa015LineName", _txt);
gvMx1.SetRowCellValue(dataIndex, "daa015", _val);
}
}
+
+ /// <summary>
+ /// 宸ュ叿鏉′簨浠�
+ /// </summary>
+ /// <param name="inFieldValue"></param>
+ private void _toolCk(int _inFieldValue, string _mth)
+ {
+ string strMsg = "";
+ switch (_inFieldValue)
+ {
+ case 1:
+ strMsg = "瀹℃牳";
+ break;
+ case 0:
+ strMsg = "鍙嶅鏍�";
+ break;
+ };
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1, "hNo");
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+ return;
+ var _obj = new
+ {
+ guid = rowGuid,
+ inFieldValue = _inFieldValue,
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", _webServiceName + _mth, JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+ if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+ {
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(lbGuid.Text.Trim());
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
+ UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3