lu
3 天以前 906f79ff500541dda3626f12c1a05f2d2e57f7a8
DevApp/Gs.DevApp/DevFrm/RkQC/Frm_Cqfa.cs
@@ -1,15 +1,11 @@
using DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
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,7 +13,7 @@
{
    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()
@@ -34,7 +30,7 @@
            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);
@@ -167,7 +163,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,7 +174,7 @@
            var _obj = new
            {
                guid = rowGuid,
                mxGuid = Guid.Empty.ToString(),
                mxGuid = "",
            };
            try
            {
@@ -201,7 +197,6 @@
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
@@ -239,13 +234,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);
                txt_fabm.ReadOnly = true;
                txt_fSubsidiary.Enabled = false;
            }
            else
            {
@@ -268,8 +265,7 @@
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
            //增加时,默认组织
            string deftOrg = UtilityHelper.GetFirstOrg(txt_thOrgId);
            string deftOrg = UtilityHelper.GetFirstOrg(txt_fSubsidiary);
        }
        /// <summary>
        /// 保存事件
@@ -279,11 +275,25 @@
        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))
            {
                MsgHelper.ShowError("名称不能为空!");
@@ -310,22 +320,19 @@
            }
            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 = (_fjxz),
                famc = _famc.Trim(),
                fabm = _fabm.Trim(),
                bz = _bz.Trim(),
                fSubsidiary = _fSubsidiary.Trim(),
                list = new List<dynamic>(),
            };
            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);
@@ -378,7 +385,7 @@
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -390,7 +397,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
            {
@@ -476,11 +483,11 @@
                    }
                }
                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 +508,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,29 +519,29 @@
            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());
                    else
                        getPageList(this.pageBar1.CurrentPage);
                    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);
            }
        }