using DevExpress.XtraGrid.Views.Grid; using Lskj.Business; using Lskj.Business.Impl; using Lskj.Control; using Lskj.Control.Model; using Lskj.Core; using Lskj.Data; using Lskj.Model; using Lskj.Util; 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; namespace Lskj.PubArtwork { public partial class Accraditation : UserControl { /// /// 系统模块配置 /// public DynamicBaseAccraditionPopModel SysModel; /// /// 基础审批用表模型 /// public BaseAuditCommonModel BaseAuditModelObj = new BaseAuditCommonModel(); /// /// 基础档案模型 /// public BaseAuditModel ModuleModelObj; /// /// 审批模型 /// public AccraditationModel AccditModelObj; /// /// 主表控件 /// public MyControl ControlObj; /// /// 系统数据行 /// private DataRow mRowItem; /// /// 当前流转数据 /// private DataRow _flowRowData; /// /// 流转步骤模型 /// private FlowTypeStepModel _flowTypeStepModel; /// /// 单据水印 /// private WaterMark _waterMark; /// /// 推送菜单名 /// private string _beforeMenuName; /// /// 推送操作人员 /// private string _beforeUsers; /// /// 当前窗体控件数据来源(配置的) /// private DataRow _baseRowData; /// /// 推送模块 /// private int _beforeId; /// /// 返退意见 /// private string _auditAdvic; /// /// 操作字段 /// private DataTable _dtFileds; /// /// 分组控件字段 /// private DataTable _dtAddGroup; public Accraditation() { InitializeComponent(); } #region 事件 /// /// 初始化界面数据 /// public void InitaMain(DynamicBaseAccraditionPopModel dynamic) { WaitForm.ShowForm(); try { this.SysModel = dynamic; if (this.SysModel == null) return; if (string.IsNullOrEmpty(this.SysModel.StepCode) || string.IsNullOrEmpty(this.SysModel.PrimaryValue)) return; this.InitializeSetting(); this.InitPushOpers(); this.InitControl(); if (SystemInfo.Instance.ReviewCommentsRequired) { label_auditPerson.ForeColor = string.IsNullOrEmpty(SystemInfo.Instance.ControlRequiredColor) ? Color.Blue : ColorTranslator.FromHtml(SystemInfo.Instance.ControlRequiredColor); this.txt_remark.Text = ""; } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); LogHelper.Instance.WriteError(ex, ResourceKeys.BaseModuleAudit); } finally { WaitForm.HideForm(); this.InitButLocation(); } } /// /// 说明:绘制水印 /// 创建人:龚宇超 /// 创建日期:2017-12-21 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void gridFlow_Panint(object sender, PaintEventArgs e) { try { if (this._waterMark != null) { System.Windows.Forms.Control control = sender as System.Windows.Forms.Control; GraphicsText graphicsText = new GraphicsText(); graphicsText.Graphics = e.Graphics; // 绘制围绕点旋转的文本 StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Center; int x = (control.Width - 90) / 2; int y = (control.Height - 32) / 2; // 绘制单据状态文本 if (!string.IsNullOrEmpty(this._waterMark.Text)) { graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 20, FontStyle.Bold), new SolidBrush(Color.Red), new PointF(x, y), format, -20f); e.Graphics.TranslateTransform(x, y); e.Graphics.RotateTransform(-20f); e.Graphics.DrawRectangle(new Pen(Color.Red, 2f), new Rectangle(-45, -19, 90, 32)); } } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:流转表格行样式 /// 创建人:龚宇超 /// 创建日期:2017-12-15 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void gridFlowRecord_RowStyle(object sender, RowStyleEventArgs e) { try { if (e.RowHandle > 0) { DataRow dr = this.gridFlowRecord.GridView.GetDataRow(e.RowHandle); if (dr["sh"] + "" == "审") e.Appearance.ForeColor = Color.Blue; } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:审核 /// 创建人:龚宇超 /// 创建日期:2017-12-21 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The source of the event. /// The instance containing the event data. private void btnAudit_Click(object sender, EventArgs e) { try { if (VerificationRequired()) return; string nextSelectStepCode = string.Empty; string nextSelectStepOper = string.Empty; if (this.SysModel.ConfirmId == "1") { if (BaseAuditImpl.SetBaseFlowComfirm(this.SysModel.UserId, this.SysModel.ModuleCode, this.SysModel.PrimaryValue, this.txt_remark.Text) > 0) { MessageUtil.Show(ResourceKeys.ConfirmSuccess); return; } else { MessageUtil.Show(ResourceKeys.ConfirmFail); } } else { string confirmOpers = string.Empty, remindOpers = string.Empty; if (SystemInfo.Instance.auditComfirmOpers.Split(',').Contains(ERPInfo.Instance.UserName) || "1".Equals(SystemInfo.Instance.auditComfirmOpers)) { if (MessageUtil.Show(string.Format(ResourceKeys.ConfirmIsAudit), MessageBoxButtons.YesNo) == DialogResult.No) { return; } } if (this.ControlObj.VerifyNull()) { if (!this.ControlObj.isRequiredFields(this.AccditModelObj.RequiredFields)) return; string parmaryValue = this.SysModel.PrimaryValue; if (this.ControlObj.SaveBaseModuleData(this.SysModel.ModuleCode, this.ModuleModelObj.MenuTable, this.ModuleModelObj.ParmaryKey, ref parmaryValue, false, "", false, this.ModuleModelObj.NewVer)) { string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "F", this._flowTypeStepModel.RemindSelect, this.txt_remark.Text, remindOpers, confirmOpers); if ("1".Equals(result)) { //推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); #region 审核成功后调用API if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0)) { ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, parmaryValue, this.ModuleModelObj.ParmaryKey, this.ModuleModelObj.MenuTable, 0); apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.Audit);//审核 if (!string.IsNullOrEmpty(apiHelper.apiResutMsg)) MessageUtil.Show(apiHelper.apiResutMsg); } #endregion return; //this.DialogResult = DialogResult.OK; //if (refreshThePage != null) refreshThePage("审核成功", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); //else //{ // //上一次点开page 当前打开page删除后要选中的page // if (ERPInfo.Instance.PageControl != null) // { // string id = ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""; // XtraTabPage beforePage = ERPInfo.Instance.ModuleForms[id].BeforePage; // if (beforePage != null) // { // //MessageUtil.Show("审核成功"); // //要删除的page // XtraTabPage removePage = new XtraTabPage(); // ERPInfo.Instance.ModuleForms.Remove(id); // foreach (XtraTabPage tablepage in ERPInfo.Instance.PageControl.TabPages) // { // if (tablepage.Tag == null) continue; // if (tablepage.Tag.ToString().Equals(id)) removePage = tablepage; // if (tablepage == beforePage) ERPInfo.Instance.PageControl.SelectedTabPage = beforePage; // } // ERPInfo.Instance.PageControl.TabPages.Remove(removePage); // removePage.Dispose(); // } // } //} } else if ("-10".Equals(result)) { DataRow NextStepFlag = BaseAuditImpl.SetUpNextStep(this.SysModel.ModuleCode, this.ModuleModelObj.BillType, this.SysModel.StepCode); if (NextStepFlag != null) { Lskj.BaseAccraditation.FrmLookupData lookup = new Lskj.BaseAccraditation.FrmLookupData(); lookup.ModuleCode = this.SysModel.ModuleCode; lookup.BillType = this.ModuleModelObj.BillType; lookup.StepCode = this.SysModel.StepCode; lookup.nextSelectStepCode = nextSelectStepCode; lookup.nextSelectStepCode = nextSelectStepCode; bool isAginAudit = lookup.ShowDialog() == DialogResult.Yes; nextSelectStepCode = lookup.nextSelectStepCode; nextSelectStepCode = lookup.nextSelectStepCode; if (isAginAudit) { string Aginresult = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "F", this._flowTypeStepModel.RemindSelect, this.txt_remark.Text, remindOpers, confirmOpers, false, 0, 1); } } else { MessageUtil.Show("配置新版审批失败!" + "\r\n" + result); } } else { MessageUtil.Show(ResourceKeys.AuditFail + "\r\n" + result); } } } } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:提醒审核审核 /// 创建人:王一帆 /// 创建日期:2020-08-20 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The source of the event. /// The instance containing the event data. private void btnRemindAudit_Click(object sender, EventArgs e) { try { if (VerificationRequired()) return; if (this.SysModel.ConfirmId == "1") { if (BaseAuditImpl.SetBaseFlowComfirm(this.SysModel.UserId, this.SysModel.ModuleCode, this.SysModel.PrimaryValue, this.txt_remark.Text) > 0) { MessageUtil.Show(ResourceKeys.ConfirmSuccess); return; } else { MessageUtil.Show(ResourceKeys.ConfirmFail); } } else { bool isAudit = true; string confirmOpers = string.Empty, remindOpers = string.Empty; string nextSelectStepCode = string.Empty; string nextSelectStepOper = string.Empty; Lskj.BaseAccraditation.FrmRemindSelectForm formRemind = new Lskj.BaseAccraditation.FrmRemindSelectForm(); formRemind.KeyValue = this.SysModel.PrimaryValue; formRemind.MenuCode = this.SysModel.ModuleCode; isAudit = formRemind.ShowDialog() == DialogResult.Yes; confirmOpers = formRemind.ConfirmOpers; remindOpers = formRemind.RemindOpers; if (isAudit) { if (this.ControlObj.VerifyNull()) { string parmaryValue = this.SysModel.PrimaryValue; if (this.ControlObj.SaveBaseModuleData(this.SysModel.ModuleCode, this.ModuleModelObj.MenuTable, this.ModuleModelObj.ParmaryKey, ref parmaryValue, false, "", false, this.ModuleModelObj.NewVer)) { string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "F", this._flowTypeStepModel.RemindSelect, this.txt_remark.Text, remindOpers, confirmOpers); if ("1".Equals(result)) { //推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); return; // this.DialogResult = DialogResult.OK; // if (refreshThePage != null) refreshThePage("审核成功", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); } else { MessageUtil.Show(ResourceKeys.AuditFail + "\r\n" + result); } } } } } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:提醒返退 /// 创建人:王一帆 /// 创建日期:2020-08-20 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The source of the event. /// The instance containing the event data. private void btnRemindReturn_Click(object sender, EventArgs e) { try { if (VerificationRequired()) return; string nextSelectStepCode = string.Empty; string nextSelectStepOper = string.Empty; int returnd = ExecuteBackSelect(this._baseRowData); if (returnd == -9) return; _auditAdvic = string.IsNullOrWhiteSpace(_auditAdvic) ? txt_remark.Text : string.Empty; if (this.SysModel.StepOver == "1") { //确认审核不通过并反退该单据? if (MessageUtil.Show(string.Format(ResourceKeys.ConfimAuditFailAndReturnBill), MessageBoxButtons.YesNo) == DialogResult.Yes) { string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "F", this._flowTypeStepModel.RemindSelect, this.txt_remark.Text, "", "", false, returnd, 0, true); if ("1".Equals(result)) { MessageUtil.Show(ResourceKeys.ForcedSuccess); //暂未推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); return; //this.DialogResult = DialogResult.OK; //if (refreshThePage != null) refreshThePage("", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); } else { MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + result); } } } else { bool isAudit = true; string confirmOpers = string.Empty, remindOpers = string.Empty; Lskj.BaseAccraditation.FrmRemindSelectForm formRemind = new Lskj.BaseAccraditation.FrmRemindSelectForm(); formRemind.KeyValue = this.SysModel.PrimaryValue; formRemind.MenuCode = this.SysModel.ModuleCode; isAudit = formRemind.ShowDialog() == DialogResult.Yes; confirmOpers = formRemind.ConfirmOpers; remindOpers = formRemind.RemindOpers; if (isAudit) { string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "R", "", _auditAdvic, remindOpers, confirmOpers, true, returnd); if (result == "1") { MessageUtil.Show(ResourceKeys.ForcedSuccess); //推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); return; //this.DialogResult = DialogResult.OK; //if (refreshThePage != null) refreshThePage("", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); } else { MessageUtil.Show(string.Format(ResourceKeys.ForcedFail, result)); } } } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:返退 /// 创建人:龚宇超 /// 创建日期:2017-12-22 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The source of the event. /// The instance containing the event data. private void btnReturnd_Click(object sender, EventArgs e) { try { if (VerificationRequired()) return; int returnd = ExecuteBackSelect(this._baseRowData); if (returnd == -9) return; string nextSelectStepCode = string.Empty; string nextSelectStepOper = string.Empty; _auditAdvic = string.IsNullOrWhiteSpace(_auditAdvic) ? txt_remark.Text : _auditAdvic; if (this.SysModel.StepOver == "1") { //确认审核不通过并反退该单据? if (MessageUtil.Show(string.Format(ResourceKeys.ConfimAuditFailAndReturnBill), MessageBoxButtons.YesNo) == DialogResult.Yes) { string parmaryValue = this.SysModel.PrimaryValue; if (this.ControlObj.SaveBaseModuleData(this.SysModel.ModuleCode, this.ModuleModelObj.MenuTable, this.ModuleModelObj.ParmaryKey, ref parmaryValue, false, "", false, this.ModuleModelObj.NewVer)) { string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "R", "", _auditAdvic, "", "", true, returnd, 0, true); if ("1".Equals(result)) { MessageUtil.Show(ResourceKeys.ForcedSuccess); //暂未推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); return; //this.DialogResult = DialogResult.OK; //if (refreshThePage != null) refreshThePage("", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); } else { MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + result); } } } } else { if (SystemInfo.Instance.backAuditComfirmOpers.Split(',').Contains(ERPInfo.Instance.UserName) || "1".Equals(SystemInfo.Instance.backAuditComfirmOpers)) { if (MessageUtil.Show(string.Format(ResourceKeys.ConfimAuditFailAndReturnBill), MessageBoxButtons.YesNo) == DialogResult.No) { return; } } string confirmOpers = string.Empty, remindOpers = string.Empty; string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, this.SysModel.StepCode, this.SysModel.PrimaryValue, "", this.BaseAuditModelObj.ProcedureName, "R", "", _auditAdvic, remindOpers, confirmOpers, true, returnd); if (result == "1") { MessageUtil.Show(ResourceKeys.ForcedSuccess); //推送消息 PushHelper push = new PushHelper(this.SysModel.PrimaryValue, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Base_Oper_Message(); return; //this.DialogResult = DialogResult.OK; //if (refreshThePage != null) refreshThePage("", ERPInfo.Instance.PageControl.SelectedTabPage.Tag + ""); } else { MessageUtil.Show(string.Format(ResourceKeys.ForcedFail, result)); } } } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:执行返退选择 /// 创建人:龚宇超 /// 创建日期:2017-12-22 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The row. /// System.Int32. private int ExecuteBackSelect(DataRow row) { if (row == null) { MessageUtil.Show(ResourceKeys.NoFindAntiauditBill); return -9; } if (this.ModuleModelObj.BackSelected == "0") return -1; if (this.SysModel.StepCode == "100") return 0; FrmBackSelect frmBackSel = new FrmBackSelect(); frmBackSel.Sysmodel = this.SysModel; frmBackSel.ModuleModelObj = this.ModuleModelObj; frmBackSel.InitControl(); if (frmBackSel.ShowDialog() != DialogResult.OK) return -9; this._auditAdvic = frmBackSel.ComfirmMsg; return frmBackSel.SelectStepCode; } /// /// 说明:审核意见下拉框事件 /// 创建人:王一帆 /// 创建日期:2021-02-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The source of the event. /// The instance containing the event data. private void OnSelectValueChanged(object sender, EventArgs e) { try { this.txt_remark.Text = this.combox_Suggestion.EditText; } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } /// /// 说明:数据源绑定完成后执行 /// 创建人:龚宇超 /// 创建日期: /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The sender. /// The instance containing the event data. void OnControlObjOnDataSourceBindCallBack(object sender, EventArgs e) { try { this.ControlObj.CanExecControl = false; this.ControlObj.SetAllControlValue(this._baseRowData); this.ControlObj.CanExecControl = true; //this.InitTabData(); //this.InitEditTabControl(); } catch (Exception ex) { string Message = ErrorMessage.PromptErrorMessage(ex); MessageUtil.Show(Message, ex.Message); } } #endregion #region 方法 /// /// 初始化控件 /// private void InitControl() { //设置控件文本属性 this.Text = this.SysModel.FormText; this.btnAudit.Text = this.AccditModelObj.StepApplyText; this.labeltxt_managerAudit.EditText = this.SysModel.UserName; ////设置流转记录的列 this.gridFlowRecord.GridView.RowStyle += new RowStyleEventHandler(gridFlowRecord_RowStyle); DataRow dr = null; this.gridFlowRecord.SetReadOnlyColumns(BaseAuditImpl.GetFlowRecordColumn(), GridCustomColumnStruct.AuditPopupAttachGridView + this.ModuleModelObj.FormKey); this.gridFlowRecord.gridControl.Paint += new PaintEventHandler(gridFlow_Panint); this.gridFlowRecord.SetGridViewDataSource(BaseAuditImpl.GetFlowRecordData(this.BaseAuditModelObj.SystemTabFlowStep, this.SysModel.PrimaryValue, this.SysModel.ModuleCode)); dr = BaseAuditImpl.GetCurrentStepFlow(this.SysModel.ModuleCode, this.SysModel.StepCode); if (dr != null) { //初始化流转标题 this.label_auditPerson.Text = this.labeltxt_managerAudit.LabelText = dr["stepName"] + ""; } this.combox_Suggestion.ValueField = this.combox_Suggestion.TextField = "Mix_apellation"; this.combox_Suggestion.SetDataSource(BaseImpl.GetDataTableResult(this.AccditModelObj.SuggestionSql)); this.combox_Suggestion.TextEdit.SelectedIndex = 0; this.combox_Suggestion.TextEdit.SelectedValueChanged += new EventHandler(OnSelectValueChanged); //单据水印 this._waterMark = new WaterMark(this.ModuleModelObj.PrefixKey, this._baseRowData); //this.SetFormSize(); this.SetButtonStatus(); this.CreateAccraditationControl(); //this.LoadRemindRecord(); //this.LoadSignRecord(); //this.BindTab(); //this.InitCommonTools(); } /// /// 刷新 /// public void RefControl() { if (string.IsNullOrEmpty(this.SysModel.StepCode) || string.IsNullOrEmpty(this.SysModel.PrimaryValue)) return; this.InitializeSetting(); this.gridFlowRecord.SetGridViewDataSource(BaseAuditImpl.GetFlowRecordData(this.BaseAuditModelObj.SystemTabFlowStep, this.SysModel.PrimaryValue, this.SysModel.ModuleCode)); //单据水印 this._waterMark = new WaterMark(this.ModuleModelObj.PrefixKey, this._baseRowData); } /// /// 说明:初始化属性配置 /// 创建人:龚宇超 /// 创建日期:2017-12-15 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void InitializeSetting() { this.mRowItem = MainImpl.GetSystemdllTab(this.SysModel.ModuleCode); this.ModuleModelObj = new BaseAuditModel(this.mRowItem); if (string.IsNullOrEmpty(this.ModuleModelObj.FormKey)) { MessageUtil.Show(ResourceKeys.ModuleConfigError); return; } this.ModuleModelObj.PrefixKey = BaseImpl.GetColumnPrefix(this.ModuleModelObj.MenuTable); this.ModuleModelObj.ParmaryKey = BaseImpl.GetBasePrimaryKey(this.SysModel.ModuleCode); this._flowRowData = BaseAuditImpl.GetCurrentFlowRowData(this.ModuleModelObj.MenuTable, this.ModuleModelObj.ParmaryKey, this.SysModel.PrimaryValue); string billType = this._flowRowData != null ? _flowRowData[this.ModuleModelObj.BillType] + "" : ""; if (string.IsNullOrEmpty(billType) || billType == "0") { //MessageUtil.Show(ResourceKeys.NotSetFlowType); return; } this.AccditModelObj = new AccraditationModel(BaseAuditImpl.GetCurrentStepFlow(this.SysModel.ModuleCode, this.SysModel.StepCode)); this._baseRowData = BaseAuditImpl.GetCurrentControlData(ReplaceHelper.ReplaceWhereCond(ReplaceHelper.ReplaceUserInfo(this.ModuleModelObj.MenuSql)), this.ModuleModelObj.ParmaryKey, this.SysModel.PrimaryValue); //this.btnFileManger.Text += "(" + AttachImpl.GetFileCount(this.ModuleModelObj.MenuDirId + "", this.SysModel.PrimaryValue) + ")"; this.btnReturnd.Text = this.AccditModelObj.StepBackText; if (this._baseRowData == null) this._baseRowData = this._flowRowData; } /// /// 说明:初始化设置按钮状态 /// 创建人:龚宇超 /// 创建日期:2017-12-15 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void SetButtonStatus() { //获取当前流转步骤 DataRow currentFlowStep = currentFlowStep = BaseAuditImpl.GetCurrentFlowStep(this.SysModel.ModuleCode, this._flowRowData[this.ModuleModelObj.BillType] + "", this.SysModel.StepCode); if (currentFlowStep == null) { MessageUtil.Show(ResourceKeys.FlowStepConfigError); return; } this._flowTypeStepModel = new FlowTypeStepModel(currentFlowStep); string operUser = this._flowTypeStepModel.OperUser; if (BaseImpl.GetDataRowResult(this.AccditModelObj.FlowOperSql) != null) { DataRow flowOper = flowOper = BaseAuditImpl.GetFlowOperators(this.SysModel.ModuleCode, this.SysModel.PrimaryValue, this.SysModel.StepCode); operUser = flowOper == null ? operUser : flowOper["operators"] + ""; } //确认权限判断 this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this._flowTypeStepModel.RemindSelect == "1"; this.btnReturnd.Enabled = operUser.Contains(this.SysModel.UserName); this.btnAudit.Enabled = true; //如果已经终审按钮为窗口默认设置,否则 if (this.SysModel.StepOver == "1") { this.combox_Suggestion.Enabled = false; this.btnAudit.Enabled = false; this.btnRemindAccradit.Enabled = false; //this.pl_bottom.Visible = true; } if (this.SysModel.ConfirmId == "1") { this.btnAudit.Enabled = true; this.btnRemindAccradit.Visible = this.btnRemindBack.Visible = this.btnReturnd.Visible = false; this.btnAudit.Text = "确认(&Y)"; this.label_auditPerson.Text = "确认意见"; this.labeltxt_managerAudit.Text = "会签人"; this.txt_remark.Text = "确认"; } } /// /// 说明:录所有按钮的位置 /// 创建人:王一帆 /// 创建日期:2020-11-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void InitButLocation() { if (!btnRemindAccradit.Visible) { combox_Suggestion.Width = btnRemindAccradit.Location.X + btnRemindAccradit.Width - combox_Suggestion.Location.X; } if (!btnRemindBack.Visible) { labeltxt_managerAudit.Width = btnRemindBack.Location.X + btnRemindBack.Width - labeltxt_managerAudit.Location.X; if (!btnReturnd.Visible) { labeltxt_managerAudit.Width = btnReturnd.Location.X + btnReturnd.Width - labeltxt_managerAudit.Location.X; } } } private bool VerificationRequired() { bool results = false; if (SystemInfo.Instance.ReviewCommentsRequired && string.IsNullOrWhiteSpace(this.txt_remark.Text)) { MessageUtil.Show("请输入审核意见"); results = true; } return results; } /// /// 说明:初始化本次推送人员 /// 创建人:龚宇超 /// 创建日期:2018-05-22 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void InitPushOpers() { DataRow rowItem = BaseAuditImpl.GetPushedOpers(this.SysModel.PrimaryValue, this.SysModel.StepCode); if (rowItem != null) { //记录本次操作信息 this._beforeMenuName = rowItem["menuname"] + ""; this._beforeUsers = rowItem["operators"] + ""; this._beforeId = Convert.ToInt32(rowItem["id"]); } } /// /// 说明:动态创建控件 /// 创建人:龚宇超 /// 创建日期:2017-12-15 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// private void CreateAccraditationControl() { this._dtFileds = BaseModuleImpl.GetControlLocation(this.ModuleModelObj.FormKey, this.SysModel.ModuleCode); this._dtAddGroup = BaseModuleImpl.GetAddGroupData(this.ModuleModelObj.FormKey); this.ControlObj = new MyControl(); this.ControlObj.PrimaryValue = this.SysModel.PrimaryValue; this.ControlObj.InitControl(this._dtFileds, new DevExpress.XtraEditors.XtraScrollableControl(), this._dtAddGroup); this.ControlObj.OnDataSourceBindCallBack += new EventHandler(OnControlObjOnDataSourceBindCallBack); if (this.AccditModelObj.BillModifyFields != "-1") this.ControlObj.SetReadOnlyAllControl(true); //改变控件状态 foreach (string item in this.AccditModelObj.BillModifyFields.Trim(',').Split(',')) { this.ControlObj.SetReadOnlyControl(item, false, false); } } #endregion } }