using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Core.Mes.Client.Comm.Tool; using CoreFS.CA06; using com.steering.pss.sale.orderchange.entity; using Core.Mes.Client.Comm.Server; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; using System.Collections; using Core.Mes.Client.Comm.Format; using Core.StlMes.Client.SaleOrder.Dialog; namespace Core.StlMes.Client.SaleOrder.ReviewForm { public partial class FrmPriceConfirm : FrmBase { /// /// 关闭窗体引起主窗体刷新数据 /// public delegate void FrmClosedRefresh(string ordPk); public event FrmClosedRefresh FrmClosedRefreshHandle; public FrmPriceConfirm() { InitializeComponent(); this.IsLoadUserView = true; } private string ordPk; private string saleOrg; public string SaleOrg { get { return saleOrg; } set { saleOrg = value; } } /// /// 窗体的用途 等于0时 表示价格评审的弹窗(只查出销售、钢贸的数据) 等于1时 表示后续价格修改国贸 的数据 等于2时 表示第一次业务员录入价格 等于3时 业务员第二次N次维护价格 /// private string formUse = "0"; /// /// 窗体的用途 /// 等于0时 表示价格评审的弹窗(只查出销售、钢贸的数据)-----弃用大部分功能---保留评审通过、评审不通过功能--第一次评审 涉及到合同状态 /// 等于1时 表示后续价格修改(变更) 销售钢贸 国贸 的数据 ------后改为只针对国贸数据维护 /// 等于2时 表示第一次业务员录入价格 /// 等于3时 表示第二次N次业务员录入价格 /// 等于4时 针对国贸数据确认 或者价格变更的确认(不涉及到合同的状态) /// public string FormUse { get { return formUse; } set { formUse = value; } } public FrmPriceConfirm(OpeBase _ob, string ordPk) { InitializeComponent(); this.ob = _ob; this.ordPk = ordPk; } private void FrmPriceConfirm_Load(object sender, EventArgs e) { /* foreach (UltraGridColumn ugc in gdPrice.DisplayLayout.Bands[0].Columns) { ugc.SortIndicator = SortIndicator.Disabled; }*/ QueryOrder(); if (FormUse == "1" && SaleOrg == "100102") { gdPrice.DisplayLayout.Bands[0].Columns["OUT_PRICE"].Hidden = true; } if (FormUse == "2" || FormUse == "3" || FormUse == "1") { this.ultraToolbarsManager1.Toolbars[0].Tools["Pass"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["Back"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; } else if (FormUse == "0" || FormUse == "4") { this.ultraToolbarsManager1.Toolbars[0].Tools["Save"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["Confirm"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["Print"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["PrintFJ"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["PrintC"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["Delete"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; gdPrice.DisplayLayout.Bands[0].Columns["TRANS_PRICE"].CellAppearance.BackColor = Color.White; gdPrice.DisplayLayout.Bands[0].Columns["PAK_PRICE"].CellAppearance.BackColor = Color.White; gdPrice.DisplayLayout.Bands[0].Columns["BALNCE_PRICE_ORG"].CellAppearance.BackColor = Color.White; } if (saleOrg != "100102") { this.ultraToolbarsManager1.Toolbars[0].Tools["Print"].InstanceProps.Visible = Infragistics.Win.DefaultableBoolean.False; this.ultraToolbarsManager1.Toolbars[0].Tools["PrintC"].SharedPropsInternal.Caption = "打印审批单"; } } private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "Query": QueryOrder(); break; case "Save": //保存价格 SaveData(); break; case "Confirm": //确认价格 DoConfirm(); break; case "Print": //打印短流程 Print(); break; case "PrintFJ": //打印附件 PrintFJ(); break; case "PrintC": //打印长流程 PrintC(); break; case "Export": GridHelper.ulGridToExcel(gdPrice, "价格确认"); break; case "Pass": //评审通过 DoPassPrice(); break; case "Back": //评审不通过 DoBackPrice(); break; case "Delete": //作废 DoDelete(); break; case "Close": this.Close(); break; } } /// /// 打印审批单短流程 /// private void Print() { DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CorePriceConfirm.getOrderPriceNo", new object[] { ordPk }, ob); string priceNo = ""; if (dt != null && dt.Rows.Count > 0) { priceNo = dt.Rows[0][0].ToString(); } string strUrl = ""; if (saleOrg == "100101") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalShort.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } else if (saleOrg == "100105") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalShort.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } else if (saleOrg == "100103") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalGMShort.cpt" + "&PRICE_NO=" + priceNo; } if (strUrl == "") { MessageUtil.ShowWarning("合同销售组织异常,无法打印!"); return; } FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strUrl); fBug.Text = "打印价格审批单(短流程)"; fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Show(); } /// /// 打印附件 /// private void PrintFJ() { DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CorePriceConfirm.getOrderPriceNo", new object[] { ordPk }, ob); string priceNo = ""; if (dt != null && dt.Rows.Count > 0) { priceNo = dt.Rows[0][0].ToString(); } string strUrl = ""; if (saleOrg == "100101") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalAtta.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } else if (saleOrg == "100103") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalAttaGM.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } if (gdPrice.ActiveRow.Cells["SUPPLY_UNIT"].Value.ToString() == "120504") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalAttaTH.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } if (strUrl == "") { MessageUtil.ShowWarning("合同销售组织异常,无法打印!"); return; } FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strUrl); fBug.Text = "打印价格审批单附件"; fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Show(); } /// /// 打印审批单长流程 /// private void PrintC() { DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CorePriceConfirm.getOrderPriceNo", new object[] { ordPk }, ob); string priceNo = ""; if (dt != null && dt.Rows.Count > 0) { priceNo = dt.Rows[0][0].ToString(); } string strUrl = ""; if (saleOrg != "100102") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalLong.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } else if (saleOrg == "100105") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalLong.cpt&__bypagesize__=false" + "&PRICE_NO=" + priceNo; } if (saleOrg == "100103") { strUrl = "http://172.54.10.42:8080/webroot/decision/view/report?viewlet=RepPriceApprovalGMLong.cpt" + "&PRICE_NO=" + priceNo; } if (strUrl == "") { MessageUtil.ShowWarning("合同销售组织异常,无法打印!"); return; } FrmOrderRepExcel fBug = new FrmOrderRepExcel(ob, strUrl); fBug.Text = "打印价格审批单(长流程)"; fBug.AutoSize = true; fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); fBug.WindowState = FormWindowState.Maximized; fBug.Show(); } /// /// 查询合同信息 /// private void QueryOrder() { DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CorePriceConfirm.getOrderInfo", new object[] { this.ordPk }, this.ob); GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true); UltraGridColumn[] col = new UltraGridColumn[] { gdPrice.DisplayLayout.Bands[0].Columns["PRICE_BASE"] }; GridHelper.RefreshAndAutoSizeExceptColumns(gdPrice, col); } /// /// 修改价格保存 /// private void SaveData() { //对于0 2 3 时 修改价格都差不多 等于2 加入了合同状态 2和3 去掉了评审功能 都用了0的保存方法。 gdPrice.UpdateData(); UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("请选择需要修改的记录!"); return; } string priceNo = ugr.Cells["PRICE_NO"].Value.ToString(); //这里需要判断 priceNo的状态 ArrayList parm = new ArrayList(); foreach (UltraGridRow row in gdPrice.Rows) { string containTax = row.Cells["CONTAIN_TAX"].Value.ToString(); string balPrice = row.Cells["BALNCE_PRICE"].Value.ToString(); string balorgPrice = row.Cells["BALNCE_PRICE_ORG"].Value.ToString(); string outPrice = row.Cells["OUT_PRICE"].Value.ToString(); string traPrice = row.Cells["TRANS_PRICE"].Value.ToString(); string pakPrice = row.Cells["PAK_PRICE"].Value.ToString(); string tonPrice = row.Cells["TON_PRICE"].Value.ToString(); string keepType = row.Cells["KEEP_TYPE"].Value.ToString(); string ddzy = row.Cells["DDZY"].Value.ToString(); if (!String.IsNullOrEmpty(balPrice)) { if (!StringUtil.Is_Below_zero(balPrice)) { MessageUtil.ShowWarning("结算价请输入大于0的数字!"); row.Activate(); return; } } else { MessageUtil.ShowWarning("请输入结算价!"); row.Activate(); return; } //内部结算价不强制输入 if (!String.IsNullOrEmpty(balorgPrice)) { if (!StringUtil.Is_Below_zero(balorgPrice)) { MessageUtil.ShowWarning("内部结算价请输入大于0的数字!"); row.Activate(); return; } } if (FormUse != "1" || SaleOrg != "100102") //价格后续N次修改变更 国贸不管出厂价 { if (!String.IsNullOrEmpty(outPrice)) { if (!StringUtil.Is_Below_zero(outPrice)) { MessageUtil.ShowWarning("出厂价请输入大于0的数字!"); row.Activate(); return; } } else { MessageUtil.ShowWarning("请输入出厂!"); row.Activate(); return; } } //运费不强制输入 if (!String.IsNullOrEmpty(traPrice)) { if (!StringUtil.IsNumber(traPrice)) { MessageUtil.ShowWarning("运费请输入数字!"); row.Activate(); return; } } //吊装费不强制输入 if (!String.IsNullOrEmpty(pakPrice)) { if (!StringUtil.IsNumber(pakPrice)) { MessageUtil.ShowWarning("吊装费请输入大于0的数字!"); row.Activate(); return; } } //吨价不强制输入 if (!String.IsNullOrEmpty(tonPrice)) { if (!StringUtil.IsNumber(pakPrice)) { MessageUtil.ShowWarning("吨价请输入大于0的数字!"); row.Activate(); return; } } //保价类型不能为空 if (String.IsNullOrEmpty(keepType)) { MessageUtil.ShowWarning("请选择保价类型!"); row.Activate(); return; } if (containTax.Equals("含税") && keepType.Equals("0")) { MessageUtil.ShowWarning("合同行含税,请选择保价类型为保总价!"); row.Activate(); return; } ArrayList list = new ArrayList(); list.Add(balPrice); list.Add(outPrice); list.Add(traPrice); list.Add(pakPrice); list.Add(row.Cells["ORD_LN_PK"].Value.ToString()); list.Add(balorgPrice); list.Add(tonPrice); list.Add(keepType); list.Add(ddzy); parm.Add(list); } if (txtPriceInfo.Text.Trim() == "") { MessageUtil.ShowWarning("请输入定价说明!"); return; } if (MessageUtil.ShowYesNoAndQuestion("是否保存价格?") == DialogResult.No) return; SlmOrderPriceEntity sop = new SlmOrderPriceEntity(); sop.PriceBase = txtPriceInfo.Text.Trim(); sop.CreateName = UserInfo.GetUserName(); CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CorePriceConfirm"; ccp.MethodName = "savePrice"; ccp.ServerParams = new object[] { ordPk, parm, JSONFormat.Format(sop), saleOrg, FormUse, UserInfo.GetUserName() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp == null) { return; } else { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowWarning("修改成功!"); QueryOrder(); } } private void gdPrice_AfterRowActivate(object sender, EventArgs e) { UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) return; txtPriceInfo.Text = ugr.Cells["PRICE_BASE"].Value.ToString(); if (ugr.Cells["PRICE_STATUS_CODE"].Value.ToString() == "W" && this.FormUse != "0" && FormUse != "1") { ugr.Activation = Activation.ActivateOnly; return; } else { ugr.Activation = Activation.AllowEdit; } if (FormUse == "0" || FormUse == "4") { ugr.Cells["TRANS_PRICE"].Activation = Activation.ActivateOnly; ugr.Cells["PAK_PRICE"].Activation = Activation.ActivateOnly; ugr.Cells["BALNCE_PRICE_ORG"].Activation = Activation.ActivateOnly; } } /// /// 价格确认 /// private void DoConfirm() { //先判断是否有价格评审单号,再判断价格评审单号的状态 UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("不存在需要确认的合同行!"); return; } string priceNo = ugr.Cells["PRICE_NO"].Value.ToString(); if (priceNo == "") { MessageUtil.ShowWarning("该合同尚未启动价格评审,不能确认!"); return; } string priceStatus = ugr.Cells["PRICE_STATUS_CODE"].Value.ToString(); if (priceStatus != "" && priceStatus != "L") { if (priceStatus == "W") { MessageUtil.ShowWarning("该合同价格正在评审中,不必重复确认!"); return; } else if (priceStatus == "S") { MessageUtil.ShowWarning("该合同价格评审已通过,不必重复确认!"); return; } else if (priceStatus == "F") { MessageUtil.ShowWarning("该合同价格评审不通过,请先修改价格,再确认价格!"); return; } else if (priceStatus == "D") { MessageUtil.ShowWarning("该合同价格评审单无效,请先修改价格,再确认价格!"); return; } } if (MessageUtil.ShowYesNoAndQuestion("是否确认价格?") == DialogResult.No) return; SlmOrderPriceEntity sop = new SlmOrderPriceEntity(); sop.ReportName = UserInfo.GetUserName(); sop.ReportUnitcode = UserInfo.GetDeptid(); sop.ReportUnitdesc = UserInfo.GetDepartment(); sop.ReportDeptcode = ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob); sop.ReportDeptdesc = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob); CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CorePriceConfirm"; ccp.MethodName = "confirmPrice"; ccp.ServerParams = new object[] { ordPk, JSONFormat.Format(sop) }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("确认成功,请打印价格审批单进行线外流程!"); QueryOrder(); } } /// /// 作废变更单,以便重新启动价格评审 /// public void DoDelete() { //先判断是否有价格评审单号,再判断价格评审单号的状态 UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("不存在需要删除价格评审的合同行!"); return; } string priceNo = ugr.Cells["PRICE_NO"].Value.ToString(); if (priceNo == "") { MessageUtil.ShowWarning("该合同尚未启动价格评审,不能作废评审单!"); return; } string priceStatus = ugr.Cells["PRICE_STATUS_CODE"].Value.ToString(); if (priceStatus != "" && priceStatus != "L") { if (priceStatus == "S") { MessageUtil.ShowWarning("该合同价格评审已通过,不能作废!"); return; } else if (priceStatus == "F") { MessageUtil.ShowWarning("该合同价格评审已不通过,不能作废!"); return; } else if (priceStatus == "D") { MessageUtil.ShowWarning("该合同价格评审已经无效,不能作废!"); return; } } if (MessageUtil.ShowYesNoAndQuestion("是否确认作废价格评审单?") == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CorePriceConfirm"; ccp.MethodName = "deletePrice"; ccp.ServerParams = new object[] { ordPk, UserInfo.GetUserName() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("作废成功!"); QueryOrder(); } } /// /// 价格评审通过 /// public void DoPassPrice() { //先判断是否有价格评审单号,再判断价格评审单号的状态 UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("不存在需要价格评审通过的合同行!"); return; } gdPrice.UpdateData(); string priceNo = ugr.Cells["PRICE_NO"].Value.ToString(); if (priceNo == "") { MessageUtil.ShowWarning("该合同尚未启动价格评审,不能评审通过!"); return; } string priceStatus = ugr.Cells["PRICE_STATUS_CODE"].Value.ToString(); if (priceStatus != "") { if (priceStatus == "L") { MessageUtil.ShowWarning("该合同价格尚未确认,不能评审通过!"); return; } else if (priceStatus == "S") { MessageUtil.ShowWarning("该合同价格评审已通过,不能重复评审!"); return; } else if (priceStatus == "F") { MessageUtil.ShowWarning("该合同价格评审不通过,请再次启动价格评审!"); return; } else if (priceStatus == "D") { MessageUtil.ShowWarning("该合同价格评审无效,请再次启动价格评审!"); return; } } else { MessageUtil.ShowWarning("价格评审状态异常!"); return; } //暂时放个口子 评审人员可以修改价格 ArrayList price = new ArrayList(); foreach (UltraGridRow row in gdPrice.Rows) { string balPrice = row.Cells["BALNCE_PRICE"].Value.ToString(); string balPriceorg = row.Cells["BALNCE_PRICE_ORG"].Value.ToString(); string outPrice = row.Cells["OUT_PRICE"].Value.ToString(); string traPrice = row.Cells["TRANS_PRICE"].Value.ToString(); string pakPrice = row.Cells["PAK_PRICE"].Value.ToString(); string tonPrice = row.Cells["TON_PRICE"].Value.ToString(); string keepType = row.Cells["KEEP_TYPE"].Value.ToString(); string ddzy = row.Cells["DDZY"].Value.ToString(); if (!String.IsNullOrEmpty(balPrice)) { if (!StringUtil.Is_Below_zero(balPrice)) { MessageUtil.ShowWarning("结算价请输入大于0的数字!"); row.Activate(); return; } } else { MessageUtil.ShowWarning("请输入结算价!"); row.Activate(); return; } if ((FormUse != "1" && FormUse != "4") || SaleOrg != "100102") //价格后续N次修改变更 国贸不管出厂价 { if (!String.IsNullOrEmpty(outPrice)) { if (!StringUtil.Is_Below_zero(outPrice)) { MessageUtil.ShowWarning("出厂价请输入大于0的数字!"); row.Activate(); return; } } else { MessageUtil.ShowWarning("请输入出厂价!"); row.Activate(); return; } } ArrayList list = new ArrayList(); list.Add(balPrice); list.Add(outPrice); list.Add(traPrice); list.Add(pakPrice); list.Add(row.Cells["ORD_LN_PK"].Value.ToString()); list.Add(balPriceorg); list.Add(tonPrice); list.Add(keepType); list.Add(keepType); list.Add(ddzy); price.Add(list); } if (MessageUtil.ShowYesNoAndQuestion("是否确认价格评审通过?") == DialogResult.No) return; SlmOrderPriceEntity sop = new SlmOrderPriceEntity(); sop.DealName = UserInfo.GetUserName(); sop.DealUnitcode = UserInfo.GetDeptid(); sop.DealUnitdesc = UserInfo.GetDepartment(); sop.DealDeptcode = ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob); sop.DealDeptdesc = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob); string name = UserInfo.GetUserName(); string dept = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob); dept = dept + "-" + UserInfo.GetDepartment(); CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CorePriceConfirm"; ccp.MethodName = "passPrice"; ccp.ServerParams = new object[] { ordPk, name, dept, JSONFormat.Format(sop), FormUse, price }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("价格评审通过!"); DialogResult = DialogResult.OK; this.Close(); } } /// /// 价格评审不通过(不再调用原来的价格评审的‘评审不通过‘,合同状态将继续卡在这里 而不是退回给业务员了。 /// public void DoBackPrice() { //先判断是否有价格评审单号,再判断价格评审单号的状态 UltraGridRow ugr = gdPrice.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("不存在需要价格评审不通过的合同行!"); return; } string priceNo = ugr.Cells["PRICE_NO"].Value.ToString(); if (priceNo == "") { MessageUtil.ShowWarning("该合同尚未启动价格评审,不能评审不通过!"); return; } string priceStatus = ugr.Cells["PRICE_STATUS_CODE"].Value.ToString(); if (priceStatus != "") { if (priceStatus == "L") { MessageUtil.ShowWarning("该合同价格尚未确认,不能评审不通过!"); return; } else if (priceStatus == "S") { MessageUtil.ShowWarning("该合同价格评审已通过,不能重复评审!"); return; } else if (priceStatus == "F") { MessageUtil.ShowWarning("该合同价格评审已不通过,请再次启动价格评审!"); return; } else if (priceStatus == "D") { MessageUtil.ShowWarning("该合同价格评审已经无效,请再次启动价格评审!"); return; } } else { MessageUtil.ShowWarning("价格评审状态异常!"); return; } if (MessageUtil.ShowYesNoAndQuestion("是否确认价格评审不通过?") == DialogResult.No) return; SlmOrderPriceEntity sop = new SlmOrderPriceEntity(); sop.DealName = UserInfo.GetUserName(); sop.DealUnitcode = UserInfo.GetDeptid(); sop.DealUnitdesc = UserInfo.GetDepartment(); sop.DealDeptcode = ClsBaseInfo.GetDepartIdBySectionId(UserInfo.GetDeptid(), this.ob); sop.DealDeptdesc = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob); string name = UserInfo.GetUserName(); string dept = ClsBaseInfo.GetDepartBySectionId(UserInfo.GetDeptid(), this.ob); dept = dept + "-" + UserInfo.GetDepartment(); dlgReviewMemo dlg = new dlgReviewMemo(); dlg.ReviewFlag = 0; dlg.ReviewSatus = "评审不通过"; dlg.ShowDialog(); string reviewMemo = dlg.ReviewMemo; if (dlg.DialogResult != DialogResult.OK) return; CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CorePriceConfirm"; ccp.MethodName = "backPrice"; ccp.ServerParams = new object[] { ordPk, JSONFormat.Format(sop), FormUse, name, dept, reviewMemo }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("价格评审不通过完成!"); DialogResult = DialogResult.OK; this.Close(); } } private void gdPrice_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.Cells["PRICE_STATUS_CODE"].Value.ToString().Trim() == "D") { e.Row.Cells["PRICE_STATUS"].Appearance.BackColor = Color.Red; } } private void FrmPriceConfirm_FormClosing(object sender, FormClosingEventArgs e) { if (FormUse == "2") { UltraGridRow ugr = gdPrice.ActiveRow; if (ugr != null) { if (ugr.Cells["PRICE_STATUS_CODE"].Value.ToString().Equals("L")) { if (MessageUtil.ShowYesNoAndQuestion("价格评审单尚未确认,合同无法提报审批,是否退出?") == DialogResult.No) e.Cancel = true; } } } else if (FormUse == "3") { UltraGridRow ugr = gdPrice.ActiveRow; if (ugr != null) { if (ugr.Cells["PRICE_STATUS_CODE"].Value.ToString().Equals("L")) { if (MessageUtil.ShowYesNoAndQuestion("价格评审单尚未确认,无法启动价格评审,是否退出?") == DialogResult.No) e.Cancel = true; } } } if (FrmClosedRefreshHandle != null) FrmClosedRefreshHandle(this.ordPk); } /// /// 维护一行价格 之后的行的价格一样 当时勾选的行不受影响也不影响其他行 /// /// /// private void gdPrice_CellChange(object sender, CellEventArgs e) { try { gdPrice.UpdateData(); } catch { } if (e.Cell.Column.Key.Equals("BALNCE_PRICE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["BALNCE_PRICE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("OUT_PRICE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["OUT_PRICE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("TRANS_PRICE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["TRANS_PRICE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("PAK_PRICE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["PAK_PRICE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("BALNCE_PRICE_ORG") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["BALNCE_PRICE_ORG"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("TON_PRICE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["TON_PRICE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("KEEP_TYPE") && !Convert.ToBoolean(e.Cell.Row.Cells["CHK"].Value)) { if (e.Cell.Value.ToString() == "") return; int rCount = e.Cell.Row.Index; for (int i = rCount + 1; i < gdPrice.Rows.Count; i++) { UltraGridRow row = gdPrice.Rows[i]; if (!Convert.ToBoolean(row.Cells["CHK"].Value)) row.Cells["KEEP_TYPE"].Value = e.Cell.Value; } } else if (e.Cell.Column.Key.Equals("CHK")) { this.toolTips.ShowAlways = true; this.toolTips.SetToolTip(gdPrice, "勾选的行维护数据时不更新其他行也不被其他行的数据所更新"); this.toolTips.ToolTipTitle = "提示"; } } private void gdPrice_CellDataError(object sender, CellDataErrorEventArgs e) { e.RaiseErrorEvent = false; // 阻止弹出错误提示窗口 e.RestoreOriginalValue = true; // 恢复原始值 e.StayInEditMode = true; // 继续保留在编辑模式 } } }