lu
2025-05-05 60128ac8cb2998f4679fde2b23cbebb11d608986
DevApp/Gs.DevApp/DevFrm/WW/Frm_ProductionOrder.cs
@@ -1,3 +1,4 @@
using Gs.DevApp.DevFrm.WOM;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -20,6 +21,8 @@
            InitializeComponent();
            this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            this.toolBarMenu1.btnJieAnClick += ToolBarMenu1_btnJieAnClick1;
            this.toolBarMenu1.btnFjieAnClick += ToolBarMenu1_btnFjieAnClick;
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "auditStatusChk", "", (value) =>
@@ -99,7 +102,43 @@
                getPageList(this.pageBar1.CurrentPage);
            }
        }
        /// <summary>
        /// 结案
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnJieAnClick1(object sender, EventArgs e)
        {
            var frm = new ShowJieAn();
            frm.UpdateParent += (ss, ee) =>
            {
                string strType = ee.StringSingle.Replace("(执行至结案)", "").Replace("(强制结案)", "");
                if (strType == "toclose")
                {
                    _toolCk(1);
                }
                else
                {
                    if (strType == "closure")
                    {
                        _toolCk(2);
                    }
                }
            };
            frm.ShowDialog();
        }
        /// <summary>
        /// 反结案
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void ToolBarMenu1_btnFjieAnClick(object sender, EventArgs e)
        {
            _toolCk(3);
        }
        /// <summary>
        /// 
        /// </summary>
@@ -107,7 +146,7 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "order_no", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
            try
@@ -195,5 +234,70 @@
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 工具条事件
        /// </summary>
        /// <param name="inFieldValue"></param>
        private void _toolCk(int _inFieldValue)
        {
            string strMsg = "";
            switch (_inFieldValue)
            {
                case 1:
                    strMsg = "执行至结案";
                    break;
                case 2:
                    strMsg = "强制结案";
                    break;
                case 3:
                    strMsg = "反结案(反执行至完工)";
                    break;
            };
            toolBarMenu1.guidKey = "";
            string rowGuid, rowName;
            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_orderNo, gridView1, "orderNo");
            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 + "EditModelSubmit",
                    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());
                    }
                    else
                    {
                        //注意,这里和其它页面有点不一样
                        getPageList(this.pageBar1.CurrentPage);
                        int rowHandle = gridView1.LocateByValue("guid", rowGuid);
                        gridView1.FocusedRowHandle = rowHandle;
                    }
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}