ab56a9bcf7
SVN-Revision: r240
464 lines
18 KiB
C#
464 lines
18 KiB
C#
/******************************
|
|
* 说明:审批流程设置界面
|
|
* 创建人:龚宇超
|
|
* 创建日期:2019-06-18
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
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 Lskj.Control;
|
|
using Lskj.Workflow.Model;
|
|
using Lskj.Core;
|
|
using Lskj.Data;
|
|
using Lskj.Model;
|
|
using Lskj.Workflow.Properties;
|
|
using Lskj.Business;
|
|
using Lskj.Business.Impl;
|
|
|
|
namespace Lskj.Workflow
|
|
{
|
|
/// <summary>
|
|
/// 审批流程设置界面
|
|
/// </summary>
|
|
public partial class FrmWork : BaseForm
|
|
{
|
|
/// <summary>
|
|
/// 上一次选中标签
|
|
/// </summary>
|
|
public StepEnum mPrevStepPage;
|
|
/// <summary>
|
|
/// 当前选中标签
|
|
/// </summary>
|
|
public StepEnum mCurrentStepPage;
|
|
/// <summary>
|
|
/// 模块编号
|
|
/// </summary>
|
|
public string MenuCode = string.Empty;
|
|
public DynamicWorkflowModel WorkModel;
|
|
public BillModel BillModel;
|
|
/// <summary>
|
|
/// 判断是否有权力
|
|
/// </summary>
|
|
public bool powerflag;
|
|
public FrmWork()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
#region 方法相关
|
|
/// <summary>
|
|
/// <para>说明:切换</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="stepEnum">The step enum.</param>
|
|
public void SetStepPage(StepEnum stepEnum)
|
|
{
|
|
this.mCurrentStepPage = stepEnum;
|
|
this.btnAdd.Visible = true;
|
|
switch (stepEnum)
|
|
{
|
|
case StepEnum.StepPage1:
|
|
default:
|
|
this.btnSaveAllflow.Visible = this.btnReset.Visible = this.btnInit.Visible = false;
|
|
this.stepPage11.Visible = true;
|
|
this.stepPage21.Visible = false;
|
|
this.stepPage31.Visible = false;
|
|
this.stepPage41.Visible = false;
|
|
this.pllzbzsz.BackgroundImage = Resources.icon_xllzsz_2x;
|
|
this.plxlsz.BackgroundImage = Resources.icon_xlsz_gray_2x;
|
|
this.plxllzsz.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.plzsht.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.btnAdd.Text = "新增(&A)";
|
|
break;
|
|
case StepEnum.StepPage2:
|
|
this.btnSaveAllflow.Visible = this.btnReset.Visible = this.btnInit.Visible = false;
|
|
this.stepPage11.Visible = false;
|
|
this.stepPage21.Visible = true;
|
|
this.stepPage31.Visible = false;
|
|
this.stepPage41.Visible = false;
|
|
this.pllzbzsz.BackgroundImage = Resources.icon_xllzsz_gray_2x;
|
|
this.plxlsz.BackgroundImage = Resources.icon_xlsz_2x;
|
|
this.plxllzsz.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.plzsht.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.btnAdd.Text = "新增(&A)";
|
|
break;
|
|
case StepEnum.StepPage3:
|
|
this.btnSaveAllflow.Visible = this.btnReset.Visible = this.btnInit.Visible = true;
|
|
this.stepPage11.Visible = false;
|
|
this.stepPage21.Visible = false;
|
|
this.stepPage31.Visible = true;
|
|
this.stepPage41.Visible = false;
|
|
this.pllzbzsz.BackgroundImage = Resources.icon_xllzsz_gray_2x;
|
|
this.plxlsz.BackgroundImage = Resources.icon_xlsz_gray_2x;
|
|
this.plxllzsz.BackgroundImage = Resources.icon_lzbzsz_2x;
|
|
this.plzsht.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.btnAdd.Text = "生成(&A)";
|
|
break;
|
|
case StepEnum.StepPage4:
|
|
this.btnSaveAllflow.Visible = this.btnReset.Visible = this.btnInit.Visible = this.btnAdd.Visible = false;
|
|
this.stepPage11.Visible = false;
|
|
this.stepPage21.Visible = false;
|
|
this.stepPage31.Visible = false;
|
|
this.stepPage41.Visible = true;
|
|
this.pllzbzsz.BackgroundImage = Resources.icon_xllzsz_gray_2x;
|
|
this.plxlsz.BackgroundImage = Resources.icon_xlsz_gray_2x;
|
|
this.plxllzsz.BackgroundImage = Resources.icon_lzbzsz_gray_2x;
|
|
this.plzsht.BackgroundImage = Resources.icon_lzbzsz_2x;
|
|
break;
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 事件相关
|
|
/// <summary>
|
|
/// <para>说明:窗口加载</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnWorkLoad(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.BillModel = new BillModel(BillImpl.GetBillInfo(this.WorkModel.ModuleCode));
|
|
if (this.BillModel == null || string.IsNullOrEmpty(this.BillModel.FormKey))
|
|
{
|
|
MessageUtil.Show("无效的模块编号->" + WorkModel.ModuleCode);
|
|
this.Close();
|
|
}
|
|
this.MenuCode = this.WorkModel.ModuleCode;
|
|
this.Text = this.Text + "->" + this.BillModel.TypeName;
|
|
DataTable table = WorkFlowBillImpl.GetPowerTable();
|
|
string[] Purview = table.Rows[0]["BillFlowPurview"].ToString().Trim().TrimEnd(',').Split(',');
|
|
if (Purview.Contains(ERPInfo.Instance.UserName))
|
|
{
|
|
powerflag = true;
|
|
}
|
|
if (!powerflag)
|
|
{
|
|
this.btnAdd.Enabled = this.btnReset.Enabled = this.btnInit.Enabled = false;
|
|
stepPage11.SerpPagePower = true;
|
|
stepPage21.SerpPage2Power = true;
|
|
}
|
|
// 设置默认显示第一个界面
|
|
this.SetStepPage(StepEnum.StepPage1);
|
|
|
|
this.stepPage11.InitializeControl(this.MenuCode);
|
|
this.stepPage21.InitializeControl(this.MenuCode);
|
|
this.stepPage31.InitializeControl(this.MenuCode);
|
|
this.stepPage41.InitializeControl(this.MenuCode);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:添加模块</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnAddClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
switch (mCurrentStepPage)
|
|
{
|
|
case StepEnum.StepPage1:
|
|
{
|
|
// 保存流转步骤
|
|
FrmAddStep frmAddStep = new FrmAddStep();
|
|
frmAddStep.LabelObj.Text = "请输入审批步骤:";
|
|
|
|
if (frmAddStep.ShowDialog() == DialogResult.OK)
|
|
{
|
|
string stepName = frmAddStep.StepName;
|
|
string stepGroup = frmAddStep.StepName;
|
|
|
|
this.stepPage11.AddFlowItem(stepGroup, stepGroup);
|
|
}
|
|
}
|
|
break;
|
|
case StepEnum.StepPage2:
|
|
{
|
|
// 保存小类设置
|
|
FrmAddStep frmAddStep = new FrmAddStep();
|
|
frmAddStep.LabelObj.Text = "请输入审批方案:";
|
|
|
|
if (frmAddStep.ShowDialog() == DialogResult.OK)
|
|
{
|
|
string typeName = frmAddStep.StepName;
|
|
|
|
this.stepPage21.AddFlowTypeItem(typeName);
|
|
}
|
|
}
|
|
break;
|
|
case StepEnum.StepPage3:
|
|
{
|
|
// 生成小类流转步骤设置
|
|
this.stepPage31.CreateFlowTypeStep();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
//MessageUtil.Show(ex.Message);
|
|
//LogUtil.WriteError("单据审批添加模块", ex);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 一键保存所有图像
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
void OnBtnSaveAllFlow(object sender, EventArgs e)
|
|
{
|
|
this.stepPage31.InitAllStepTypeFlow();
|
|
}
|
|
public void OnBtnToword(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
FrmMain fm = new FrmMain();
|
|
fm.modelCound = this.WorkModel.ModuleCode;
|
|
fm.modelName = this.BillModel.TypeName;
|
|
fm.StartPosition = FormStartPosition.CenterScreen;
|
|
fm.ShowDialog();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
//LogUtil.WriteError("转word流程设计出错!", ex);
|
|
//MessageUtil.Show("转word流程设计出错!" + ex);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:保存</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-25 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnBtnSaveClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
switch (mCurrentStepPage)
|
|
{
|
|
case StepEnum.StepPage1:
|
|
// 保存流转步骤
|
|
this.stepPage11.UpdateBillFlow();
|
|
break;
|
|
case StepEnum.StepPage2:
|
|
// 保存小类设置
|
|
this.stepPage21.UpdateBillFlowType();
|
|
break;
|
|
case StepEnum.StepPage3:
|
|
// 保存小类流转设置
|
|
this.stepPage31.UpdateBillFlowTypeStep();
|
|
break;
|
|
case StepEnum.StepPage4:
|
|
// 保存终审回退权限信息
|
|
this.stepPage41.UpdateFinalReturnSettings();
|
|
break;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
//MessageUtil.Show("数据保存失败:" + ex.Message);
|
|
//LogUtil.WriteError("数据保存失败!", ex);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:流转步骤设置点击</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnlzbzszClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SetStepPage(StepEnum.StepPage1);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:小类设置点击</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnxlszClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SetStepPage(StepEnum.StepPage2);
|
|
this.stepPage21.InitializeStepFlow();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:小类流转步骤设置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnxllzszClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SetStepPage(StepEnum.StepPage3);
|
|
this.stepPage31.InitializeStepType();
|
|
this.stepPage31.InitializeStepTypeFlow();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:终审回退设置</para>
|
|
/// <para>创建人:曹屹峰</para>
|
|
/// <para>创建日期:2022-06-08 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnzshtClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SetStepPage(StepEnum.StepPage4);
|
|
this.stepPage41.initialLoad();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:重置权限</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnBtnResetClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.stepPage31.ResetPurview();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化权限</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnBtnInitClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.stepPage31.InitPurview();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |