From 6c4f48c41bca123db3c3aac7955b785569112542 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 29 十一月 2024 13:53:38 +0800
Subject: [PATCH] 基础信息
---
DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs | 374 +++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 332 insertions(+), 42 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
index 09579c6..1f7d248 100644
--- a/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WOM/Frm_Wompba.cs
@@ -1,13 +1,16 @@
+using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
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.Windows.Forms;
namespace Gs.DevApp.DevFrm
@@ -26,6 +29,8 @@
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
getPageList(1, UtilityHelper.GetPageSize());
pageBar1.PagerEvent += PageBar1_PagerEvent;
@@ -43,6 +48,53 @@
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);
};
+ txt_pba013.EditChanged += (s, e) =>
+ {
+ string workGuid = this.txt_pba013.GetGuid();
+ txt_pba016.getSuppler(workGuid);
+ _getListJybz(workGuid);
+ };
+ //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
+ btnSelect.Click += (s, e) =>
+ {
+ if (string.IsNullOrEmpty(this.txt_pba013.GetId()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨杞﹂棿锛屾墠鑳介�夋嫨浠诲姟鍗曪紒");
+ return;
+ }
+ var frm = new SelectWompba(this.txt_pba013.Text);
+ //璧嬪�肩粰鏄庣粏琛�
+ frm.UpdateParent += (ss, ee) =>
+ {
+ try
+ {
+ var lst = new List<string>();
+ lst = ee.StringList;
+ var _obj = lst;
+ var strReturn = UtilityHelper.HttpPost("",
+ "WompbaManager/SelectPbaToView",
+ 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();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ };
+ frm.ShowDialog();
+ };
+
+
}
/// <summary>
@@ -86,6 +138,100 @@
_filterList = e.FilterList;
getPageList(1, pageBar1.RowsCount);
}
+ /// <summary>
+ /// 瀹℃牳浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private async 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;
+ UcLoading _loading = new UcLoading();
+ var _obj = new
+ {
+ guid = rowGuid,
+ };
+ try
+ {
+ var strJson = await UtilityHelper.HttpPostAsync("",
+ _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, UtilityHelper.GetPageSize());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ _loading.Stop();
+ }
+
+ /// <summary>
+ /// 鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private async 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);
+ UcLoading _loading = new UcLoading();
+ var _obj = new
+ {
+ guid = rowGuid,
+ };
+ try
+ {
+ var strJson = await UtilityHelper.HttpPostAsync("",
+ _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, UtilityHelper.GetPageSize());
+ }
+ else
+ {
+ MsgHelper.Warning(_rtn.rtnMsg);
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ _loading.Stop();
+ }
/// <summary>
/// 鍙栨秷浜嬩欢
@@ -105,31 +251,37 @@
private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_hNo, gridView1, "hNo");
if (string.IsNullOrEmpty(rowGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
return;
- List<dynamic> lst = new List<dynamic>();
- lst.Add(rowGuid);
- var _obj = lst;
+ var _obj = new
+ {
+ guid = rowGuid,
+ mxGuid = Guid.Empty.ToString(),
+ };
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "DeleteModelOrMx",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
UtilityHelper.JumpToTab(xtraTabControl1, 0);
getPageList(1, UtilityHelper.GetPageSize());
}
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
@@ -140,10 +292,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
- else
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim(), false, 999);
+ else
+ getPageList(1, UtilityHelper.GetPageSize());
}
/// <summary>
/// 淇敼浜嬩欢
@@ -153,7 +305,7 @@
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1);
if (string.IsNullOrEmpty(rowGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -168,12 +320,12 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
- lbGuid.Text = "";
- List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gridViews.Add(gvMx1);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+ UtilityHelper.JumpToTab(xtraTabControl1, 1);
+ lbGuid.Text = "";
+ List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+ gridViews.Add(gvMx1);
+ UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -183,16 +335,68 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- //if (string.IsNullOrEmpty(txt_account.Text.Trim()))
+ string workId = txt_pba013.GetId();
+ if (string.IsNullOrEmpty(workId.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�");
- // txt_account.Focus();
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨杞﹂棿锛�");
+ 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()), //涓诲缓
+ 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.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["guid"].ToString());
+ //string _msl = row["quantity"].ToString();
+ //if (string.IsNullOrEmpty(_msl))
+ //{
+ // 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
+ Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
+ Jhrs = row["planPersonnel"].ToString(),//璁″垝浜烘暟
+ Hxsj = row["changeLinetime"].ToString(),//鎹㈢嚎鏃堕棿
+ Bz = row["daa009"].ToString(),//澶囨敞
+ Blsj = row["prepareTime"].ToString(),//棰勮澶囨枡鏃堕棿
+ Pcsl = row["daa008"].ToString()//鎺掍骇鏁伴噺
+ });
+ }
+ }
try
{
string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
@@ -230,22 +434,22 @@
string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
if (dd.rtnCode > 0)
- {
- DataTable dt = dd.rtnData.list;
- gcMain.BindingContext = new BindingContext();
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
- int dddd = dd.rtnData.pages;//鎬婚〉
- pageBar1.TotalPages = dddd;
- pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
- pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- pageBar1.setTxt();
- }
- else
- {
- ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
- }
+ {
+ DataTable dt = dd.rtnData.list;
+ gcMain.BindingContext = new BindingContext();
+ gcMain.DataSource = dt;
+ gcMain.ForceInitialize();
+ int dddd = dd.rtnData.pages;//鎬婚〉
+ pageBar1.TotalPages = dddd;
+ pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
+ pageBar1.CurrentPage = curPage;//褰撳墠椤�
+ pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
+ pageBar1.setTxt();
+ }
+ else
+ {
+ ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+ }
}
catch (Exception ex)
{
@@ -266,7 +470,7 @@
};
try
{
- string strJson = UtilityHelper.HttpPost("", _webServiceName +"GetModel", JsonConvert.SerializeObject(_obj));
+ string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
@@ -301,5 +505,91 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+
+ private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx1.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ if (e.Button.Index == 0)
+ {
+ var dr = gvMx1.GetDataRow(rowhandle);
+ var mxGuid = dr["guid"].ToString();
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+ return;
+ if (string.IsNullOrEmpty(mxGuid))
+ {
+ gvMx1.DeleteRow(rowhandle);
+ return;
+ }
+ 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, true, 1);
+ }
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ }
+
+ private void _getListJybz(string workGuid)
+ {
+ if (string.IsNullOrEmpty(workGuid))
+ return;
+ var _obj = new
+ {
+ guid = workGuid //涓诲缓
+ };
+ var json = JsonConvert.SerializeObject(_obj);
+ 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());
+ foreach (DataRow dr in dt.Rows)
+ {
+ rptJYBZ.Items.Add((new CboItemEntity(dr["id"].ToString(), dr["name"].ToString())));
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+
+ private void rptJYBZ_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ ComboBoxEdit comboBox = sender as ComboBoxEdit;
+ if (comboBox != null)
+ {
+ GridView myView = (gcMx1.MainView as GridView);
+ int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
+ CboItemEntity _itm = comboBox.EditValue as CboItemEntity;
+ string _val = _itm.Value.ToString();
+ string _txt = _itm.Text.ToString();
+ gvMx1.CloseEditor();
+ gvMx1.UpdateCurrentRow();
+ gvMx1.SetRowCellValue(dataIndex, "daa015LineName", _txt);
+ gvMx1.SetRowCellValue(dataIndex, "daa015", _val);
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3