1989 lines
97 KiB
C#
1989 lines
97 KiB
C#
/***********************
|
|
* 说明:单据审批和基础档案审批主页共用模版
|
|
* 创建人:龚宇超
|
|
* 创建日期:2017-12-27
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
***********************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Data;
|
|
using Lskj.Model;
|
|
using DevExpress.XtraEditors;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using DevExpress.XtraTab;
|
|
using DevExpress.Utils;
|
|
using DevExpress.XtraEditors.Controls;
|
|
using Lskj.Business;
|
|
using DevExpress.XtraGrid.Columns;
|
|
using Lskj.PubAccraditation2;
|
|
using Lskj.Util;
|
|
using DevExpress.XtraBars;
|
|
using Lskj.Core;
|
|
using System.Diagnostics;
|
|
using System.Text.RegularExpressions;
|
|
using DevExpress.Data;
|
|
using DevExpress.XtraGrid;
|
|
using System.Collections;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Lskj.Control
|
|
{
|
|
public partial class AuditPanelEx : UserControl
|
|
{
|
|
private bool mResourcesReleased;
|
|
private readonly AltButtonShortcutManager mAltButtonShortcuts =
|
|
new AltButtonShortcutManager();
|
|
|
|
public AuditPanelEx()
|
|
{
|
|
InitializeComponent();
|
|
InitializeAltButtonShortcuts();
|
|
}
|
|
|
|
private void InitializeAltButtonShortcuts()
|
|
{
|
|
mAltButtonShortcuts.Register(btnOkAudit, Keys.Y);
|
|
mAltButtonShortcuts.Register(btnBackAudit, Keys.B);
|
|
mAltButtonShortcuts.Register(btnRefresh, Keys.R);
|
|
mAltButtonShortcuts.Register(btnBack, Keys.W);
|
|
mAltButtonShortcuts.Register(btnSearch, Keys.Q);
|
|
}
|
|
|
|
protected override bool ProcessCmdKey(
|
|
ref System.Windows.Forms.Message msg, Keys keyData)
|
|
{
|
|
return mAltButtonShortcuts.ProcessKey(keyData) ||
|
|
base.ProcessCmdKey(ref msg, keyData);
|
|
}
|
|
|
|
internal void ReleaseResourcesForDispose()
|
|
{
|
|
if (mResourcesReleased)
|
|
{
|
|
return;
|
|
}
|
|
|
|
mResourcesReleased = true;
|
|
MyControl searchControl = _searchContrl;
|
|
_searchContrl = null;
|
|
if (searchControl != null)
|
|
{
|
|
searchControl.Dispose();
|
|
}
|
|
|
|
try
|
|
{
|
|
if (gridFinish != null && gridFinish.GridView != null)
|
|
{
|
|
gridFinish.GridView.SelectionChanged -= GvFinish_SelectionChangedClick;
|
|
gridFinish.GridView.DoubleClick -= GvFinish_DoubleClick;
|
|
}
|
|
foreach (TabPageObj tabPage in _tabPageObjs)
|
|
{
|
|
foreach (TabPageItemObj item in tabPage.TabPageItemObjs)
|
|
{
|
|
if (item.GridControlObj != null &&
|
|
item.GridControlObj.GridView != null)
|
|
{
|
|
item.GridControlObj.GridView.DoubleClick -=
|
|
OnGridViewDoubleClick;
|
|
item.GridControlObj.Model = null;
|
|
}
|
|
}
|
|
tabPage.TabPageItemObjs.Clear();
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// A partially disposed DevExpress view must not stop cleanup.
|
|
}
|
|
|
|
try
|
|
{
|
|
if (SysModel != null && SysModel.DataCaches != null)
|
|
{
|
|
SysModel.DataCaches.RemoveCache(this);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// Cache cleanup must not interrupt control disposal.
|
|
}
|
|
|
|
_tabPageObjs.Clear();
|
|
_tabPageCount.Clear();
|
|
OnGridViewDoubleCallBack = null;
|
|
OnGridFinshViewDoubleCallBack = null;
|
|
OnBtnSearchCallBack = null;
|
|
SectionAccradit = null;
|
|
AuditComModelObj = null;
|
|
BaseAccraditModelObj = null;
|
|
PubSysModel = null;
|
|
SysModel = null;
|
|
}
|
|
|
|
#region 公有变量
|
|
|
|
/// <summary>
|
|
/// 默认查询框
|
|
/// </summary>
|
|
public bool PanelCondVisible;
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string KeyValue;
|
|
/// <summary>
|
|
/// model的key值模块
|
|
/// </summary>
|
|
public string modelkeyName = string.Empty;
|
|
/// <summary>
|
|
/// 单据前缀
|
|
/// </summary>
|
|
public string TmpPrefix = string.Empty;
|
|
/// <summary>
|
|
/// 分段审批
|
|
/// </summary>
|
|
public DataRow SectionAccradit;
|
|
/// <summary>
|
|
/// 审批公用模型
|
|
/// </summary>
|
|
public AuditCommonModel AuditComModelObj;
|
|
/// <summary>
|
|
/// 基础审批模型
|
|
/// </summary>
|
|
public BaseAccraditationModel BaseAccraditModelObj;
|
|
/// <summary>
|
|
/// 模型
|
|
/// </summary>
|
|
public DynamicModel SysModel;
|
|
/// <summary>
|
|
/// 单据入口参数模型
|
|
/// </summary>
|
|
public DynamicPubAccraditionPopModel PubSysModel;
|
|
/// <summary>
|
|
/// 批量返退意见
|
|
/// </summary>
|
|
public string _auditAdvice = "批量返退";
|
|
/// <summary>
|
|
/// 是否单据
|
|
/// </summary>
|
|
public bool isBill = true;
|
|
/// <summary>
|
|
/// 已完成表格
|
|
/// </summary>
|
|
/// <value>The finish grid object.</value>
|
|
public GridControlEx FinishGridObj { get { return this.gridFinish; } }
|
|
/// <summary>
|
|
/// <para>说明:审批表格双击弹出模块回调</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public event EventHandler OnGridViewDoubleCallBack;
|
|
/// <summary>
|
|
/// <para>说明:已完成表格双击弹出模块回调</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public event EventHandler OnGridFinshViewDoubleCallBack;
|
|
/// <summary>
|
|
/// <para>说明:已完成表格搜索回调</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public event BtnSearchGridFinishEventHandler OnBtnSearchCallBack;
|
|
#endregion
|
|
|
|
#region 私有变量
|
|
/// <summary>
|
|
/// tabpages集合
|
|
/// </summary>
|
|
private List<TabPageObj> _tabPageObjs = new List<TabPageObj>();
|
|
/// <summary>
|
|
/// 自定义搜索控件
|
|
/// </summary>
|
|
private MyControl _searchContrl;
|
|
/// <summary>
|
|
/// tabpages集合
|
|
/// </summary>
|
|
private List<XtraTabPage> _tabPageCount = new List<XtraTabPage>();
|
|
|
|
/// <summary>
|
|
/// 已完成表格
|
|
/// </summary>
|
|
/// <value>The finish grid object.</value>
|
|
public XtraTabControl FinishTabMain { get { return this.tabMain; } }
|
|
|
|
#endregion
|
|
|
|
#region 初始化系统配置
|
|
/// <summary>
|
|
/// <para>说明:初始化系统配置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-30 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="menuCode">The menu code.</param>
|
|
public void InitializeSetting(AuditCommonModel auditComModel, DynamicModel model, BaseAccraditationModel baseAccraditModel)
|
|
{
|
|
try
|
|
{
|
|
this.AuditComModelObj = auditComModel;
|
|
this.isBill = AuditComModelObj.Moduletype == "bill" ? true : false;
|
|
this.modelkeyName = isBill ? GridCustomColumnStruct.AuditMainGridView : GridCustomColumnStruct.BaseAuditMainGridView;
|
|
this.SysModel = model;
|
|
Dictionary<object, Hashtable> dataCaches = model != null ? model.DataCaches : null;
|
|
dataCaches.GetValue(this, "DataCaches", out bool _);//等待缓存数据加载完成
|
|
this.BaseAccraditModelObj = baseAccraditModel;
|
|
this.labeltxt_dataFlag.LabelText = this.AuditComModelObj.DataFlagLabel;
|
|
this.InitTabPages();
|
|
this.InitFinishTabPage();
|
|
this.RefreshTabPage();
|
|
this.InitCommonTools();
|
|
string isBackUsers = BaseAccraditModelObj.OverBackOper;//获取有终审返回权限的人
|
|
|
|
//设置批量操作按钮
|
|
List<SimpleButton> buttons = new List<SimpleButton>();
|
|
if (BaseAccraditModelObj.MuitlAuditBackFlag) buttons.Add(btnBackAudit);
|
|
if (BaseAccraditModelObj.MuitlAuditFlag) buttons.Add(btnOkAudit);
|
|
buttons.Add(btnSelectAll);
|
|
buttons.Add(btnReverseSelection);
|
|
if (BaseAccraditModelObj.MuitlAuditFlag && BaseAccraditModelObj.MuitlAuditBackFlag)
|
|
{
|
|
this.btnReverseSelection.Visible = this.btnSelectAll.Visible = this.btnOkAudit.Visible = this.btnBackAudit.Visible = true;
|
|
}
|
|
else if (BaseAccraditModelObj.MuitlAuditFlag)
|
|
{
|
|
int x = this.dpb_Tools.Location.X - 6;
|
|
foreach (SimpleButton item in buttons)
|
|
{
|
|
item.Location = new Point(x - item.Width, item.Location.Y);
|
|
x = x - item.Width - 6;
|
|
}
|
|
|
|
this.btnReverseSelection.Visible = this.btnSelectAll.Visible = this.btnOkAudit.Visible = true;
|
|
}
|
|
else if (BaseAccraditModelObj.MuitlAuditBackFlag)
|
|
{
|
|
int x = this.dpb_Tools.Location.X - 6;
|
|
foreach (SimpleButton item in buttons)
|
|
{
|
|
item.Location = new Point(x - item.Width, item.Location.Y);
|
|
x = x - item.Width - 6;
|
|
}
|
|
this.btnReverseSelection.Visible = this.btnSelectAll.Visible = this.btnBackAudit.Visible = true;
|
|
}
|
|
|
|
|
|
|
|
if (SysModel.HasReadPrivilege())
|
|
{
|
|
this.btnBack.Enabled = false;
|
|
}
|
|
if (isBackUsers.Contains(ERPInfo.Instance.UserName))
|
|
{
|
|
this.btnBack.Enabled = true;
|
|
}
|
|
if (_tabPageCount.Count > 0)
|
|
{
|
|
tabMain.SelectedTabPage = _tabPageCount[0];
|
|
}
|
|
//翻译固定页签 已完成单据
|
|
if (Business.Impl.LanguageTranslation.Translatable)
|
|
{
|
|
tabpage_finish.Text = Business.Impl.LanguageTranslation.GetTranslatedText(tabpage_finish.Text);
|
|
}
|
|
InitlizeSpiltLocation();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取数据源缓存
|
|
/// </summary>
|
|
/// <param name="cachesDic"></param>
|
|
public void GetDataCaches(Dictionary<object, Hashtable> cachesDic)
|
|
{
|
|
//获取通用数据
|
|
Task<DynamicModel> dynamicModelTask = cachesDic.GetTask<DynamicModel>(this, "DynamicModel");
|
|
Task<BillAuditCommonModel> auditCommonModelTask = cachesDic.GetTask<BillAuditCommonModel>(this, "BillAuditCommonModel");
|
|
Task<BaseAccraditationModel> baseAccraditationModelTask = cachesDic.GetTask<BaseAccraditationModel>(this, "BaseAccraditationModel");
|
|
DynamicModel dynamicModel = dynamicModelTask.Result;
|
|
AuditCommonModel auditCommonModel = auditCommonModelTask.Result;
|
|
BaseAccraditationModel baseAccraditationModel = baseAccraditationModelTask.Result;
|
|
#region InitTabPages
|
|
|
|
Task<bool> TotalExistsTask = cachesDic.AddTask(this, "TotalExists", new Task<bool>(() =>
|
|
{
|
|
if (BaseImpl.HasExistsColumn(auditCommonModel.SystemTable, "isSum"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}));
|
|
|
|
|
|
Task<DataTable> billMainInformationTask = cachesDic.AddTask(this, "BillMainInformation", new Task<DataTable>(() =>
|
|
{
|
|
return isBill ? BillAuditImpl.GetBillMainInformation(dynamicModel.ModuleCode) : BaseModuleImpl.GetBaseGridColumns(dynamicModel.ModuleCode);
|
|
}));
|
|
Task<DataTable> tabPagesTask = cachesDic.AddTask(this, "TabPages", new Task<DataTable>(() =>
|
|
{
|
|
return BaseAuditImpl.GetTabPages(dynamicModel.ModuleCode, baseAccraditationModel.MenuCond, auditCommonModel.FlowStepTable);
|
|
}));
|
|
DataTable dataTable = tabPagesTask.Result;
|
|
foreach (DataRow row in dataTable.Rows)
|
|
{
|
|
Task<FlowTypeStepModel> flowTypeStepModelTask = cachesDic.AddTask(row, "FlowTypeStepModel", new Task<FlowTypeStepModel>(() =>
|
|
{
|
|
return new FlowTypeStepModel(row);
|
|
}));
|
|
Task<DataTable> flowStepTabTask = cachesDic.AddTask(row, "FlowStepTab", new Task<DataTable>(() =>
|
|
{
|
|
DataTable flowList = BaseAuditImpl.GetFlowStepTab(auditCommonModel.SystemFlow, dynamicModel.ModuleCode, flowTypeStepModelTask.Result.StepGroup);
|
|
for (int i = 1; i <= flowList.Rows.Count; i++)
|
|
{
|
|
DataRow dataRow = flowList.Rows[i - 1];
|
|
Task<DataTable> columnPropertiesTask = cachesDic.AddTask(dataRow, "ColumnProperties", new Task<DataTable>(() =>
|
|
{
|
|
string StepCode = flowList.Rows.Count > 1 && flowList.Columns.Contains("StepCode") ? dataRow["StepCode"] + "" : flowTypeStepModelTask.Result.StepCode;
|
|
DataTable dtColumns = BaseAuditImpl.GetGridColumns(auditCommonModel.SystemTable, dynamicModel.ModuleCode, StepCode, dynamicModel.UserName, TotalExistsTask.Result);
|
|
dtColumns = this.GetTableColumnProperties(dtColumns, billMainInformationTask.Result);
|
|
return dtColumns;
|
|
}));
|
|
Task<AccraditationModel> accraditationModelTask = cachesDic.AddTask(dataRow, "AccraditationModel", new Task<AccraditationModel>(() =>
|
|
{
|
|
return new AccraditationModel(dataRow);
|
|
}));
|
|
string key = "FLOWSTEP_" + dynamicModel.ModuleCode + "_" + flowTypeStepModelTask.Result.StepCode + "_" + accraditationModelTask.Result.Id + "";
|
|
Task<DataTable> baseGridRowColorsTask = cachesDic.AddTask(dataRow, "BaseGridRowColors", new Task<DataTable>(() =>
|
|
{
|
|
return BaseModuleImpl.GetBaseGridRowColors(key);
|
|
}));
|
|
Task<DataTable> flowstepGridRightMenusTask = cachesDic.AddTask(dataRow, "FlowstepGridRightMenus", new Task<DataTable>(() =>
|
|
{
|
|
return BaseModuleImpl.GetBaseGridRightMenus($"FLOWSTEP_{accraditationModelTask.Result.Formkey}");
|
|
}));
|
|
//Task<DataTable> dataSourceTableTask = cachesDic.AddTask(gridControlEx, "DataSourceTable", new Task<DataTable>(() =>
|
|
//{
|
|
// return BaseImpl.GetDataTableResult(accraditationModelTask.Result.StepSql);
|
|
//}));
|
|
}
|
|
return flowList;
|
|
}));
|
|
}
|
|
#endregion
|
|
#region InitFinishTabPage
|
|
if (string.IsNullOrWhiteSpace(baseAccraditationModel.OverBackSql))
|
|
{
|
|
//设置默认自动搜索
|
|
Task<DataTable> employeeListTask = cachesDic.AddTask(this, "EmployeeList", new Task<DataTable>(() =>
|
|
{
|
|
return MainImpl.GetEmployeeList();
|
|
}));
|
|
Task<DataTable> readOnlyColumnsTask = cachesDic.AddTask(gridFinish, "ReadOnlyColumns", new Task<DataTable>(() =>
|
|
{
|
|
return BaseAuditImpl.GetDefaultGridMainColumns(auditCommonModel.Moduletype);
|
|
}));
|
|
string customColumKey = GridCustomColumnStruct.AuditOverMainGridView + dynamicModel.ModuleCode;
|
|
cachesDic.AddTask(gridFinish, "DynamicModel", dynamicModelTask);
|
|
gridFinish.GetDataCaches(cachesDic, customColumKey);
|
|
}
|
|
else
|
|
{
|
|
Task<DataTable> auditMainGridCoulmnsTask = cachesDic.AddTask(gridFinish, "ColumnProperties", new Task<DataTable>(() =>
|
|
{
|
|
DataTable dtColumns = BaseAuditImpl.GetAuditMainGridCoulmns(auditCommonModel.SystemTable, dynamicModel.ModuleCode);
|
|
dtColumns = this.GetTableColumnProperties(dtColumns, billMainInformationTask.Result);
|
|
return dtColumns;
|
|
}));
|
|
string modelkeyName = isBill ? GridCustomColumnStruct.AuditMainGridView : GridCustomColumnStruct.BaseAuditMainGridView;
|
|
string key = "FinishFLOWSTEP_" + dynamicModel.ModuleCode + "_" + "999" + "_" + "999" + "";
|
|
string customColumKey = modelkeyName + key;
|
|
cachesDic.AddTask(gridFinish, "DynamicModel", dynamicModelTask);
|
|
gridFinish.GetDataCaches(cachesDic, customColumKey);
|
|
// 创建自定义搜索控件
|
|
Task<DataTable> customQueryFieldsTask = cachesDic.AddTask(this, "CustomQueryFields", new Task<DataTable>(() =>
|
|
{
|
|
return BaseModuleImpl.GetCustomQueryFields(baseAccraditationModel.OverBackKey);
|
|
}));
|
|
}
|
|
// 下面flow明细表格的列
|
|
Task<DataTable> flowReadOnlyColumnsTask = cachesDic.AddTask(gridFlow, "ReadOnlyColumns", new Task<DataTable>(() =>
|
|
{
|
|
return BaseAuditImpl.GetFlowGridColomns();
|
|
}));
|
|
string flowCustomColumKey = GridCustomColumnStruct.AuditOverDetailGridView + dynamicModel.ModuleCode;
|
|
cachesDic.AddTask(gridFlow, "DynamicModel", dynamicModelTask);
|
|
gridFlow.GetDataCaches(cachesDic, flowCustomColumKey);
|
|
//配置的格外明细模块
|
|
if (!string.IsNullOrWhiteSpace(baseAccraditationModel.BelowDetailLine) && !string.IsNullOrWhiteSpace(baseAccraditationModel.BelowDetailSql))
|
|
{
|
|
//加载下方右侧明细
|
|
Task<DataTable> gridDetailReadOnlyColumnsTask = cachesDic.AddTask(gridDetail, "ReadOnlyColumns", new Task<DataTable>(() =>
|
|
{
|
|
return BaseImpl.GetDataTableResult(baseAccraditationModel.BelowDetailLine);
|
|
}));
|
|
cachesDic.AddTask(gridDetail, "DynamicModel", dynamicModelTask);
|
|
gridDetail.GetDataCaches(cachesDic);
|
|
}
|
|
#endregion
|
|
#region InitCommonTools
|
|
Task<DataTable> baseGridRightMenusTask = cachesDic.AddTask(this, "BaseGridRightMenus", new Task<DataTable>(() =>
|
|
{
|
|
return BaseModuleImpl.GetBaseGridRightMenus(dynamicModel.ModuleCode, auditCommonModel.Moduletype == "bill" ? ModuleType.BillDetail : ModuleType.BaseAudit);
|
|
}));
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 顶部查询控件
|
|
/// <summary>
|
|
/// <para>说明:顶部查询条件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-30 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void SearchCreateTopControl()
|
|
{
|
|
//this._searchContrl = new MyControl(this.BaseAccraditModelObj.OverBackSql, this.gridFinish);
|
|
//this.pl_top.Height = this._searchContrl.InitSearchControl(BaseModuleImpl.GetCustomQueryFields(this.BaseAccraditModelObj.OverBackKey), this.pl_top);
|
|
//this._searchContrl.OnSearchAfterCallBack += _searchContrl_OnSearchAfterCallBack;
|
|
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
if (!dataCaches.GetValue(this, "CustomQueryFields", out DataTable dtCustomQueryFields))
|
|
{
|
|
dtCustomQueryFields = BaseModuleImpl.GetCustomQueryFields(this.BaseAccraditModelObj.OverBackKey);
|
|
}
|
|
string tmpsql = this.BaseAccraditModelObj.OverBackSql;
|
|
//if (!string.IsNullOrWhiteSpace(BaseAccraditModelObj.OverBackOper))
|
|
// tmpsql = tmpsql + " and charindex('" + ERPInfo.Instance.UserName + ",','" + BaseAccraditModelObj.OverBackOper + ",')>0";
|
|
this._searchContrl = new MyControl(tmpsql, this.gridFinish);
|
|
this.pl_top.Height = this._searchContrl.InitSearchControl(dtCustomQueryFields, this.pl_top);
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 初始化已完成页
|
|
/// <summary>
|
|
/// <para>说明:初始化已完成page</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitFinishTabPage()
|
|
{
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
//窗口上的条件筛选面板
|
|
this.PanelCondVisible = this.pl_top_searchCond.Visible = string.IsNullOrWhiteSpace(this.BaseAccraditModelObj.OverBackSql);
|
|
|
|
if (this.PanelCondVisible)
|
|
{
|
|
//设置默认自动搜索
|
|
this.SetSearchControl();
|
|
if (!dataCaches.GetValue(gridFinish, "ReadOnlyColumns", out DataTable dtReadOnlyColumns))
|
|
{
|
|
dtReadOnlyColumns = BaseAuditImpl.GetDefaultGridMainColumns(this.AuditComModelObj.Moduletype);
|
|
}
|
|
this.gridFinish.SetReadOnlyColumns(dtReadOnlyColumns, GridCustomColumnStruct.AuditOverMainGridView + this.SysModel.ModuleCode);
|
|
}
|
|
else
|
|
{
|
|
this.TmpPrefix = this.BaseAccraditModelObj.ColumnPrefix;
|
|
this.gridFinish.Model = this.SysModel;
|
|
string key = "FinishFLOWSTEP_" + this.SysModel.ModuleCode + "_" + "999" + "_" + "999" + "";
|
|
|
|
if (!dataCaches.GetValue(gridFinish, "ColumnProperties", out DataTable dtColumns))
|
|
{
|
|
DataTable dt = this.isBill ? BillAuditImpl.GetBillMainInformation(this.SysModel.ModuleCode) : BaseModuleImpl.GetBaseGridColumns(this.SysModel.ModuleCode);
|
|
dtColumns = BaseAuditImpl.GetAuditMainGridCoulmns(AuditComModelObj.SystemTable, this.SysModel.ModuleCode);
|
|
dtColumns = this.GetTableColumnProperties(dtColumns, dt);
|
|
}
|
|
|
|
this.gridFinish.SetReadOnlyColumns(dtColumns, modelkeyName + key);
|
|
// 创建自定义搜索控件
|
|
this.SearchCreateTopControl();
|
|
}
|
|
// 上面主表格的事件注册
|
|
this.gridFinish.GridView.SelectionChanged += new DevExpress.Data.SelectionChangedEventHandler(GvFinish_SelectionChangedClick);
|
|
this.gridFinish.GridView.DoubleClick += new EventHandler(GvFinish_DoubleClick);
|
|
|
|
// 下面flow明细表格的列
|
|
if (!dataCaches.GetValue(gridFlow, "ReadOnlyColumns", out DataTable dtGridFlowColumns))
|
|
{
|
|
dtGridFlowColumns = BaseAuditImpl.GetFlowGridColomns();
|
|
}
|
|
//gridFlow.Model = this.SysModel;
|
|
this.gridFlow.SetReadOnlyColumns(dtGridFlowColumns, GridCustomColumnStruct.AuditOverDetailGridView + this.SysModel.ModuleCode);
|
|
|
|
if (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag)
|
|
{
|
|
GridDragGrid.GridAddCheckBox(this.gridFinish.GridView);
|
|
}
|
|
splitBelow.PanelVisibility = SplitPanelVisibility.Panel1;
|
|
//配置的格外明细模块
|
|
if (!string.IsNullOrWhiteSpace(this.BaseAccraditModelObj.BelowDetailLine) && !string.IsNullOrWhiteSpace(this.BaseAccraditModelObj.BelowDetailSql))
|
|
{
|
|
splitBelow.PanelVisibility = SplitPanelVisibility.Both;
|
|
//加载下方右侧明细
|
|
if (!dataCaches.GetValue(gridDetail, "ReadOnlyColumns", out DataTable dtReadOnlyColumns))
|
|
{
|
|
dtReadOnlyColumns = BaseImpl.GetDataTableResult(this.BaseAccraditModelObj.BelowDetailLine);
|
|
}
|
|
//this.gridDetail.Model = this.SysModel;
|
|
this.gridDetail.SetReadOnlyColumns(dtReadOnlyColumns);
|
|
splitBelow.SplitterPositionChanged += SplitBelow_SplitterPositionChanged;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 初始化自动搜索框
|
|
/// <summary>
|
|
/// <para>说明:初始化配置自动搜索框</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void SetSearchControl()
|
|
{
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
if (!dataCaches.GetValue(this, "EmployeeList", out DataTable employeeList))
|
|
{
|
|
employeeList = MainImpl.GetEmployeeList();
|
|
}
|
|
|
|
this.labelcheck_finalAuditor.AutoTextEdit.ValueMember = "UserId";
|
|
this.labelcheck_finalAuditor.AutoTextEdit.TextField = "UserName";
|
|
this.labelcheck_finalAuditor.AutoTextEdit.ValueField = "UserId";
|
|
this.labelcheck_finalAuditor.AutoTextEdit.SetDataSource(employeeList);
|
|
this.labeldate_start.LabelDateEditObj.EditText = DateTime.Now.ToString();
|
|
this.labeldate_end.LabelDateEditObj.EditText = DateTime.Now.ToString();
|
|
}
|
|
#endregion
|
|
|
|
#region 选项卡相关
|
|
/// <summary>
|
|
/// <para>说明:绑定选项卡</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-08 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="menuCode">The menu code.</param>
|
|
public void InitTabPages()
|
|
{
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
if (!dataCaches.GetValue(this, "TabPages", out DataTable tabPages))
|
|
{
|
|
tabPages = BaseAuditImpl.GetTabPages(this.SysModel.ModuleCode, this.BaseAccraditModelObj.MenuCond, AuditComModelObj.FlowStepTable);
|
|
}
|
|
if (!dataCaches.GetValue(this, "BillMainInformation", out DataTable dt))
|
|
{
|
|
dt = this.isBill ? BillAuditImpl.GetBillMainInformation(this.SysModel.ModuleCode) : BaseModuleImpl.GetBaseGridColumns(this.SysModel.ModuleCode);
|
|
}
|
|
|
|
|
|
|
|
if (!dataCaches.GetValue(this, "TotalExists", out bool TotalExists))
|
|
{
|
|
if (BaseImpl.HasExistsColumn(AuditComModelObj.SystemTable, "isSum"))
|
|
{
|
|
TotalExists = true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
tabMain.BeginUpdate();
|
|
foreach (DataRow row in tabPages.Rows)
|
|
{
|
|
XtraTabPage tabPage = new XtraTabPage();//每个分组一个页签
|
|
tabPage.AutoScroll = true;
|
|
TableLayoutPanel tableLayoutPanel = new TableLayoutPanel();//每个分组创建一个布局
|
|
tableLayoutPanel.Dock = DockStyle.Fill;
|
|
tableLayoutPanel.Parent = tabPage;
|
|
//tableLayoutPanel.AutoScroll = true;
|
|
tableLayoutPanel.RowStyles.Clear();//清理行格式
|
|
tableLayoutPanel.ColumnStyles.Clear();//清理列格式
|
|
tableLayoutPanel.ColumnStyles.Add(new ColumnStyle() { SizeType = SizeType.Percent });//添加两列格式
|
|
tableLayoutPanel.ColumnStyles.Add(new ColumnStyle() { SizeType = SizeType.Percent });
|
|
|
|
PanelControl panel = new PanelControl(); //tabpage里面的panel子集
|
|
List<System.Windows.Forms.Control> panelList = new List<System.Windows.Forms.Control>(); //tabpage里面的panel集合进行顺序反转
|
|
if (!dataCaches.GetValue(row, "FlowTypeStepModel", out FlowTypeStepModel model))
|
|
{
|
|
model = new FlowTypeStepModel(row);
|
|
}
|
|
//创建表格
|
|
if (!dataCaches.GetValue(row, "FlowStepTab", out DataTable flowList))
|
|
{
|
|
flowList = BaseAuditImpl.GetFlowStepTab(AuditComModelObj.SystemFlow, this.SysModel.ModuleCode, model.StepGroup);
|
|
}
|
|
int layoutRowCount = flowList.Rows.Count / 2 + (flowList.Rows.Count % 2 == 0 ? 0 : 1);//总共的行数
|
|
tableLayoutPanel.RowCount = layoutRowCount;
|
|
tableLayoutPanel.ColumnCount = 2;
|
|
for (int i = 1; i <= flowList.Rows.Count; i++)
|
|
{
|
|
DataRow dataRow = flowList.Rows[i - 1];
|
|
if (i % 2 != 0)//奇数位添加行
|
|
{
|
|
RowStyle rowStyle = new RowStyle();
|
|
rowStyle.SizeType = SizeType.Percent;//百分比调整大小
|
|
tableLayoutPanel.RowStyles.Add(rowStyle);
|
|
}
|
|
//单个审批小模块面板由表格和label组合
|
|
PanelControl gridPanel = new PanelControl();
|
|
string StepCode = flowList.Rows.Count > 1 && flowList.Columns.Contains("StepCode") ? flowList.Rows[i - 1]["StepCode"] + "" : model.StepCode;
|
|
if (!dataCaches.GetValue(dataRow, "ColumnProperties", out DataTable dtColumns))
|
|
{
|
|
dtColumns = BaseAuditImpl.GetGridColumns(AuditComModelObj.SystemTable, this.SysModel.ModuleCode, StepCode, this.SysModel.UserName, TotalExists);
|
|
dtColumns = this.GetTableColumnProperties(dtColumns, dt);
|
|
}
|
|
if (!dataCaches.GetValue(dataRow, "AccraditationModel", out AccraditationModel accrModel))
|
|
{
|
|
accrModel = new AccraditationModel(flowList.Rows[i - 1]);
|
|
}
|
|
string key = "FLOWSTEP_" + this.SysModel.ModuleCode + "_" + accrModel.StepCode + "_" + accrModel.Id + "";
|
|
gridPanel.Padding = new System.Windows.Forms.Padding(2);
|
|
gridPanel.Dock = DockStyle.Right;
|
|
gridPanel.BorderStyle = BorderStyles.NoBorder;
|
|
GridControlEx grid = new GridControlEx();
|
|
if (dataCaches != null)
|
|
{
|
|
grid.GetDataCaches(dataCaches, modelkeyName + key);
|
|
}
|
|
grid.Parent = gridPanel;
|
|
grid.Dock = DockStyle.Fill;
|
|
grid.BorderStyle = BorderStyle.None;
|
|
if (!dataCaches.GetValue(dataRow, "BaseGridRowColors", out DataTable dtGridRowColors))
|
|
{
|
|
dtGridRowColors = BaseModuleImpl.GetBaseGridRowColors(key);
|
|
}
|
|
if (!dataCaches.GetValue(dataRow, "FlowstepGridRightMenus", out DataTable dtGridRightMenus))
|
|
{
|
|
dtGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus($"FLOWSTEP_{accrModel.Formkey}");
|
|
}
|
|
grid.SetGridRowColors(dtGridRowColors);
|
|
grid.SetReadOnlyColumns(dtColumns, modelkeyName + key);
|
|
grid.SetGridRightMenus(dtGridRightMenus, SysModel);
|
|
grid.GridView.Tag = accrModel;
|
|
grid.GridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
|
|
grid.Model = this.SysModel;
|
|
// 追加复选框用于批量审批
|
|
if (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag)
|
|
{
|
|
GridDragGrid.GridAddCheckBox(grid.GridView);
|
|
}
|
|
LabelControl lab = new LabelControl();
|
|
lab.AutoSizeMode = LabelAutoSizeMode.None;
|
|
lab.Dock = DockStyle.Top;
|
|
lab.ForeColor = Color.Black;
|
|
lab.Parent = gridPanel;
|
|
lab.Height = 20;
|
|
lab.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
|
|
lab.Visible = flowList.Rows.Count > 1;
|
|
if (i % 2 != 0)
|
|
{
|
|
//这个Panel 为容纳两个审批小模块面板,一左一右
|
|
panel = new PanelControl();
|
|
//panel.Dock = DockStyle.Top;
|
|
panel.Dock = DockStyle.Fill;
|
|
panel.Height = gridPanel.Height = flowList.Rows.Count > 2 ? (this.Height - 70) / 2 : this.Height - 70;
|
|
panel.Width = this.Width;
|
|
//gridPanel.Dock = DockStyle.Left;
|
|
gridPanel.Dock = DockStyle.Fill;
|
|
|
|
}
|
|
panel.BorderStyle = BorderStyles.NoBorder;
|
|
gridPanel.Width = flowList.Rows.Count >= 2 ? (this.Width - 10) / 2 : this.Width - 10;
|
|
//gridPanel.Parent = panel;
|
|
int columnIndex = i % 2 == 0 ? 1 : 0;
|
|
int rowIndex = i / 2 - (i % 2 == 0 ? 1 : 0);
|
|
tableLayoutPanel.Controls.Add(gridPanel, columnIndex, rowIndex);
|
|
gridPanel.Tag = gridPanel.Parent.Tag = "NotChangeLocation";
|
|
panelList.Add(panel);
|
|
TabPageObj tabPageObj = new TabPageObj();
|
|
tabPageObj.FlowStepModel = model;
|
|
tabPageObj.TabPage = tabPage;
|
|
tabPageObj.TabPageItemObjs.Add(new TabPageItemObj()
|
|
{
|
|
GridControlObj = grid,
|
|
LabelObj = lab,
|
|
AuditModel = accrModel
|
|
});
|
|
_tabPageObjs.Add(tabPageObj);
|
|
tabPage.Tag = grid;
|
|
}
|
|
int height = layoutRowCount > 0 ? this.Height / layoutRowCount : this.Height;
|
|
for (int i = 0; i <= tableLayoutPanel.RowCount - 1; i++)
|
|
{
|
|
tableLayoutPanel.RowStyles[i].Height = height;
|
|
}
|
|
tabMain.BorderStylePage = BorderStyles.NoBorder;
|
|
tabPage.Controls.AddRange(panelList.Reverse<System.Windows.Forms.Control>().ToArray());
|
|
tabPage.Padding = new System.Windows.Forms.Padding(2);
|
|
tabMain.TabPages.Insert(tabMain.TabPages.Count - 1, tabPage);
|
|
}
|
|
tabMain.EndUpdate();
|
|
tabMain.SelectedTabPageIndex = 0;
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
#region 表格事件
|
|
|
|
/// <summary>
|
|
/// <para>说明:双击审批列表(动态创建的表格)</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-08 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void OnGridViewDoubleClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.OnGridViewDoubleCallBack != null)
|
|
OnGridViewDoubleCallBack(sender, e);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 刷新多标签
|
|
/// <summary>
|
|
/// <para>说明:刷新窗体</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-08 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="code"></param>
|
|
public void RefreshTabPage()
|
|
{
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
foreach (TabPageObj tab in this._tabPageObjs)
|
|
{
|
|
int cnt = 0;
|
|
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
|
{
|
|
int oldRowHandle = item.GridControlObj.GridView.FocusedRowHandle;
|
|
//if (!dataCaches.GetValue(item.GridControlObj, "DataSourceTable", out DataTable dataSourceTable))
|
|
//{
|
|
// dataSourceTable = BaseImpl.GetDataTableResult(item.AuditModel.StepSql);
|
|
//}
|
|
DataTable dataSourceTable = BaseImpl.GetDataTableResult(item.AuditModel.StepSql);
|
|
item.GridControlObj.SetGridViewDataSource(dataSourceTable);
|
|
item.LabelObj.Text = item.AuditModel.CurstepName + " (" + string.Format(ResourceKeys.RowCountRecond, item.GridControlObj.GridView.RowCount) + " )";
|
|
if (!(BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag))
|
|
{
|
|
item.GridControlObj.GridView.SelectRowHandler(oldRowHandle);
|
|
}
|
|
|
|
cnt += item.GridControlObj.GridView.RowCount;
|
|
}
|
|
tab.TabPage.Text = tab.FlowStepModel.StepGroup + "(" + cnt + ")";
|
|
if (Business.Impl.LanguageTranslation.Translatable)
|
|
{
|
|
tab.TabPage.Text = Business.Impl.LanguageTranslation.GetTranslatedText(tab.FlowStepModel.StepGroup) + "(" + cnt + ")";
|
|
}
|
|
if (cnt > 0) _tabPageCount.Add(tab.TabPage);
|
|
}
|
|
this.label_date.Text = string.Format(ResourceKeys.BeforeRefreshTime, DateTime.Now);
|
|
//已完成单据刷新选中状态
|
|
//DataTable completedTable = gridFinish.gridControl.DataSource as DataTable;
|
|
//if (completedTable != null && !completedTable.Columns.Contains("_check") && (BaseAccraditModelObj.MuitlAuditFlag || BaseAccraditModelObj.MuitlAuditBackFlag))
|
|
//{
|
|
// completedTable.Columns.Add("_check", typeof(bool));
|
|
// foreach (DataRow row in completedTable.Rows)
|
|
// {
|
|
// row["_check"] = 0;
|
|
// }
|
|
//}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:刷新窗体事件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-08 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void BtnReflash_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
RefreshTabPage();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 搜索操作
|
|
/// <summary>
|
|
/// <para>说明:搜索操作</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnSearch_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.OnBtnSearchCallBack != null)
|
|
{
|
|
string cond = string.Empty;
|
|
bool cancelFlag = false;
|
|
|
|
if (BaseImpl.HasExistsColumn(this.BaseAccraditModelObj.BillTable, this.BaseAccraditModelObj.CancelFlag))
|
|
{
|
|
cancelFlag = true;
|
|
}
|
|
if (this.labeldate_start.CheckEdit.Checked)
|
|
{
|
|
cond = string.Format("and convert(varchar(10),a.{0}stepOverTime,120)>='{1}'", this.BaseAccraditModelObj.ColumnPrefix, this.labeldate_start.TextEdit.Text);
|
|
}
|
|
if (this.labeldate_end.CheckEdit.Checked)
|
|
{
|
|
cond = cond + string.Format("and convert(varchar(10),a.{0}stepOverTime,120)<='{1}'", this.BaseAccraditModelObj.ColumnPrefix, this.labeldate_end.TextEdit.Text);
|
|
}
|
|
if (this.labelcheck_finalAuditor.CheckEdit.Checked)
|
|
{
|
|
cond = cond + string.Format("and a.{0}stepOverId='{1}'", this.BaseAccraditModelObj.ColumnPrefix, this.labelcheck_finalAuditor.AutoTextEdit.EditValue);
|
|
}
|
|
if (!string.IsNullOrEmpty(this.labeltxt_dataFlag.EditText.Trim()))
|
|
{
|
|
cond = cond + string.Format("and a.{0} LIKE '%{1}%'", this.KeyValue, this.labeltxt_dataFlag.EditText.Trim());
|
|
}
|
|
|
|
BtnSearchGridFinishArgs args = new BtnSearchGridFinishArgs();
|
|
args.CancelFlag = cancelFlag;
|
|
args.Cond = cond;
|
|
if (OnBtnSearchCallBack != null)
|
|
OnBtnSearchCallBack(sender, args);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show("搜索操作出错!" + Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 单元格点击操作
|
|
/// <summary>
|
|
/// <para>说明:已完成主表格单元格单选中</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="RowCellClickEventArgs"/> instance containing the event data.</param>
|
|
private void GvFinish_SelectionChangedClick(object sender, DevExpress.Data.SelectionChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRow selRow = this.gridFinish.GridView.GetFocusedDataRow();
|
|
if (selRow == null) return;
|
|
// 动态表格和默认主表格的不同键值
|
|
string tmpField = !this.pl_top_searchCond.Visible ? this.KeyValue : this.TmpPrefix + this.BaseAccraditModelObj.DefaultParmaryField;
|
|
DataTable gridFlowData = BaseAuditImpl.GetGridFlowData(selRow[tmpField] + "", AuditComModelObj.SystemTabFlowStep, this.BaseAccraditModelObj.MenuCond);
|
|
gridFlow.SetGridViewDataSource(gridFlowData);
|
|
|
|
if (!string.IsNullOrWhiteSpace(this.BaseAccraditModelObj.BelowDetailLine) && !string.IsNullOrWhiteSpace(this.BaseAccraditModelObj.BelowDetailSql))
|
|
{
|
|
gridDetail.SetGridViewDataSource(BaseImpl.GetDataTableResult(ReplaceHelper.ReplaceRowParam(selRow, ReplaceHelper.ReplaceUserInfo(this.BaseAccraditModelObj.BelowDetailSql))));
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:已完成主表格双击操作</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void GvFinish_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
|
|
if (this.OnGridFinshViewDoubleCallBack != null)
|
|
OnGridFinshViewDoubleCallBack(sender, e);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 返审操作
|
|
/// <summary>
|
|
/// <para>说明:返审操作</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnBack_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRow dr = this.gridFinish.GridView.GetFocusedDataRow();
|
|
if (dr == null)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.NotReturnData);
|
|
return;
|
|
}
|
|
string billDocumentId = this.PanelCondVisible ? dr[this.BaseAccraditModelObj.DefaultParmaryField] + "" : dr[string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField + ""] + "";
|
|
string stepCode = this.PanelCondVisible ? dr[this.TmpPrefix + this.BaseAccraditModelObj.DefaultStepField] + "" : dr[this.BaseAccraditModelObj.TmpStepField] + "";
|
|
//对话框输入
|
|
FrmBack cfd = new FrmBack((string.Format(ResourceKeys.ForcedReturnBill, billDocumentId)));
|
|
DialogResult backResult = cfd.ShowDialog();
|
|
if (backResult == DialogResult.OK)
|
|
{
|
|
string hintMsg = cfd.ComfirmMsg;
|
|
//记录本次推送人员,审核过清除消息
|
|
string beforeMenuname = string.Empty, beforeUsers = string.Empty;
|
|
int beforeId = 0;
|
|
string nextSelectStepCode = string.Empty;
|
|
string nextSelectStepOper = string.Empty;
|
|
DataRow rowItem = BaseAuditImpl.GetSystemOperators(billDocumentId, stepCode, this.AuditComModelObj.Moduletype);
|
|
if (rowItem != null)
|
|
{
|
|
beforeMenuname = rowItem["menuname"] + "";
|
|
beforeUsers = rowItem["operators"] + "";
|
|
beforeId = Convert.ToInt32(rowItem["id"]);
|
|
}
|
|
bool isBack = string.IsNullOrEmpty(this.BaseAccraditModelObj.MenuCond) ||
|
|
this.SectionAccradit == null ||
|
|
Convert.ToInt32(stepCode) >= Convert.ToInt32(this.SectionAccradit["stepCode"] + "");
|
|
|
|
string prodouceName = isBack ? AuditComModelObj.ProcedureName + "back" : AuditComModelObj.ProcedureName;
|
|
//反审前调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
//if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
//{
|
|
// DialogResult dialogResult = MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + apiHelper.apiResutMsg);
|
|
// return;
|
|
//}
|
|
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + apiHelper.apiResutMsg);
|
|
return;
|
|
}
|
|
}
|
|
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, stepCode, billDocumentId, isBack ? string.Format(ResourceKeys.ForcedReturnBill, billDocumentId) + "" : "", prodouceName, "R", "0", hintMsg, "", "", !isBack, -1, 0, true);
|
|
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, stepCode, billDocumentId, isBack ? string.Format(ResourceKeys.ForcedReturnBill, billDocumentId) + "" : "", prodouceName, "R", "0", hintMsg, "", "", !isBack, -1, 0, true);
|
|
string result = this.AuditMethod(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, stepCode, billDocumentId, isBack ? string.Format(ResourceKeys.ForcedReturnBill, billDocumentId) + "" : "", prodouceName, "R", "0", hintMsg, "", "", !isBack, -1, 0, true);
|
|
|
|
string tag = isBack ? "1" : "0";
|
|
if (result == "1")
|
|
{
|
|
MessageUtil.Show(ResourceKeys.ForcedSuccess);
|
|
// 推送消息
|
|
PushHelper push = new PushHelper(billDocumentId, stepCode, this.SysModel.ModuleCode, beforeUsers, beforeMenuname, beforeId);
|
|
if (this.AuditComModelObj.Moduletype == "base")
|
|
{
|
|
push.Push_Base_Oper_Message();
|
|
}
|
|
else
|
|
{
|
|
push.Push_Bill_Oper_Message();
|
|
}
|
|
#region 反审后调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
//if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
// MessageUtil.Show(apiHelper.apiResutMsg);
|
|
|
|
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
|
|
{
|
|
MessageUtil.Show(apiHelper.apiResutMsg);
|
|
}
|
|
}
|
|
#endregion
|
|
if (tag == "1")
|
|
{
|
|
if (this.PanelCondVisible)
|
|
{
|
|
btnSearch.PerformClick();
|
|
}
|
|
else
|
|
{
|
|
this._searchContrl.SearchLastGrid();
|
|
}
|
|
RefreshTabPage();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!"9".Equals(result)) MessageUtil.Show(string.Format(ResourceKeys.ForcedFail, msgText));
|
|
}
|
|
}
|
|
//if (MessageUtil.Show(string.Format(ResourceKeys.ForcedReturnBill, billDocumentId), MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
//{
|
|
|
|
//}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:返审操作(批量)</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-11 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void DoneBackAudit(List<DataRow> rowItems)
|
|
{
|
|
try
|
|
{
|
|
if (rowItems.Count == 0)
|
|
{
|
|
MessageUtil.Show(ResourceKeys.NotReturnData);
|
|
return;
|
|
}
|
|
bool firstLoad = true;
|
|
string hintMsg = string.Empty;
|
|
string tag = string.Empty;
|
|
int success = 0, fault = 0;
|
|
string tipMsg = "";
|
|
|
|
FrmBack cfd = new FrmBack("确定回退" + rowItems.Count + "条数据?");
|
|
DialogResult backResult = cfd.ShowDialog();
|
|
|
|
if (backResult == DialogResult.OK)
|
|
{
|
|
hintMsg = cfd.ComfirmMsg;
|
|
try
|
|
{
|
|
foreach (DataRow dr in rowItems)
|
|
{
|
|
string billDocumentId = this.PanelCondVisible ? dr[this.BaseAccraditModelObj.DefaultParmaryField] + "" : dr[string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField + ""] + "";
|
|
string stepCode = this.PanelCondVisible ? dr[this.TmpPrefix + this.BaseAccraditModelObj.DefaultStepField] + "" : dr[this.BaseAccraditModelObj.TmpStepField] + "";
|
|
|
|
WaitForm.ShowForm("正在返退[" + billDocumentId + "]单据!");
|
|
//记录本次推送人员,审核过清除消息
|
|
string beforeMenuname = string.Empty, beforeUsers = string.Empty;
|
|
int beforeId = 0;
|
|
string nextSelectStepCode = string.Empty;
|
|
string nextSelectStepOper = string.Empty;
|
|
DataRow rowItem = BaseAuditImpl.GetSystemOperators(billDocumentId, stepCode, this.AuditComModelObj.Moduletype);
|
|
if (rowItem != null)
|
|
{
|
|
beforeMenuname = rowItem["menuname"] + "";
|
|
beforeUsers = rowItem["operators"] + "";
|
|
beforeId = Convert.ToInt32(rowItem["id"]);
|
|
}
|
|
bool isBack = string.IsNullOrEmpty(this.BaseAccraditModelObj.MenuCond) ||
|
|
this.SectionAccradit == null ||
|
|
Convert.ToInt32(stepCode) >= Convert.ToInt32(this.SectionAccradit["stepCode"] + "");
|
|
|
|
string prodouceName = isBack ? AuditComModelObj.ProcedureName + "back" : AuditComModelObj.ProcedureName;
|
|
//反审前调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
{
|
|
DialogResult dialogResult = MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + apiHelper.apiResutMsg, MessageBoxButtons.YesNo);
|
|
if (dialogResult == DialogResult.No)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, stepCode, billDocumentId, isBack ? string.Format(ResourceKeys.ForcedReturnBill, billDocumentId) + "" : "", prodouceName, "R", "0", hintMsg, "", "", !isBack, -1, 0, true);
|
|
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, stepCode, billDocumentId, isBack ? string.Format(ResourceKeys.ForcedReturnBill, billDocumentId) + "" : "", prodouceName, "R", "0", hintMsg, "", "", !isBack, -1, 0, true);
|
|
|
|
tag = isBack ? "1" : "0";
|
|
if (result == "1")
|
|
{
|
|
//MessageUtil.Show(ResourceKeys.ForcedSuccess);
|
|
// 推送消息
|
|
PushHelper push = new PushHelper(billDocumentId, stepCode, this.SysModel.ModuleCode, beforeUsers, beforeMenuname, beforeId);
|
|
if (this.AuditComModelObj.Moduletype == "base")
|
|
{
|
|
push.Push_Base_Oper_Message();
|
|
}
|
|
else
|
|
{
|
|
push.Push_Bill_Oper_Message();
|
|
}
|
|
#region 反审后调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
MessageUtil.Show(apiHelper.apiResutMsg);
|
|
}
|
|
#endregion
|
|
success++;
|
|
}
|
|
else
|
|
{
|
|
//MessageUtil.Show(string.Format(ResourceKeys.ForcedFail, result));
|
|
fault++;
|
|
tipMsg += msgText + "\r\n";
|
|
}
|
|
|
|
firstLoad = false;
|
|
}
|
|
if (tag == "1")
|
|
{
|
|
if (this.PanelCondVisible)
|
|
{
|
|
btnSearch.PerformClick();
|
|
}
|
|
else
|
|
{
|
|
this._searchContrl.SearchLastGrid();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
MessageUtil.Show("返退成功:" + success + "\r\n" + "返退失败:" + fault + (string.IsNullOrEmpty(tipMsg) ? "" : "\r\n失败原因如下:" + tipMsg));
|
|
RefreshTabPage();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
private void simpleButton1_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WebBrowserUtil.StartWebBrowser(this.SysModel.ModuleCode, "");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#region 初始化常用工具
|
|
/// <summary>
|
|
/// <para>说明:初始化常用工具</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2021-02-24</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitCommonTools()
|
|
{
|
|
Dictionary<object, Hashtable> dataCaches = SysModel != null ? SysModel.DataCaches : null;
|
|
if (!dataCaches.GetValue(this, "BaseGridRightMenus", out DataTable tableCommon))
|
|
{
|
|
tableCommon = BaseModuleImpl.GetBaseGridRightMenus(this.SysModel.ModuleCode, AuditComModelObj.Moduletype == "bill" ? ModuleType.BillDetail : ModuleType.BaseAudit);
|
|
}
|
|
foreach (DataRow item in tableCommon.Rows)
|
|
{
|
|
BarButtonItem itemCommon = new BarButtonItem();
|
|
itemCommon.Caption = item["menuname"] + "";
|
|
itemCommon.Tag = item;
|
|
itemCommon.ItemClick += new ItemClickEventHandler(itemCommon_ItemClick);
|
|
p_menu.AddItem(itemCommon);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:常用工具点击</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2021-02-24</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="ItemClickEventArgs"/> instance containing the event data.</param>
|
|
protected void itemCommon_ItemClick(object sender, ItemClickEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
DataRow rowItem = e.Item.Tag as DataRow;
|
|
CommonMenu menu = new CommonMenu(this.SysModel, this._searchContrl);
|
|
menu.Apply(rowItem);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
/// <summary>
|
|
/// <para>说明:批量审核</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2020-05-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnBtnOkAuditClick(object sender, EventArgs e)
|
|
{
|
|
List<DataRow> rowItems = new List<DataRow>();
|
|
foreach (TabPageObj tab in this._tabPageObjs)
|
|
{
|
|
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
|
{
|
|
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
|
{
|
|
int[] mSelectRows = item.GridControlObj.GridView.GetSelectedRows();
|
|
foreach (int itemIndex in mSelectRows)
|
|
{
|
|
DataRow selectRow = item.GridControlObj.GridView.GetDataRow(itemIndex);
|
|
rowItems.Add(selectRow);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
if (rowItems.Count == 0)
|
|
{
|
|
MessageUtil.Show("请先勾选需要审批的数据!");
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
|
|
if (MessageUtil.Show("确定审核通过" + rowItems.Count + "条数据?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
int success = 0, fault = 0;
|
|
string tipMsg = "";
|
|
string nextSelectStepCode = string.Empty;
|
|
string nextSelectStepOper = string.Empty;
|
|
try
|
|
{
|
|
List<string> Documents = new List<string>();
|
|
foreach (DataRow item in rowItems)
|
|
{
|
|
string stepCode = item[this.BaseAccraditModelObj.TmpStepField] + "";
|
|
string tmpParmaryField = this.isBill ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField;
|
|
string BillDocumentId = item[tmpParmaryField] + "";
|
|
|
|
if (Documents.Contains(BillDocumentId))
|
|
{
|
|
continue;
|
|
}
|
|
else
|
|
{
|
|
Documents.Add(BillDocumentId);
|
|
}
|
|
|
|
//DataRow _baseRowData = BaseAuditImpl.GetCurrentControlData(ReplaceHelper.ReplaceWhereCond(ReplaceHelper.ReplaceUserInfo(this.AuditComModelObj.MenuSql)), this.ModuleModelObj.ParmaryKey, this.SysModel.PrimaryValue);
|
|
// 判断主表数据是否有未保存列
|
|
DataRow _baseRowData = BaseAuditImpl.GetCurrentFlowRowData(this.BaseAccraditModelObj.BillTable, tmpParmaryField, item[tmpParmaryField] + "");
|
|
DataTable _dtSourceData = null;
|
|
if (isBill)
|
|
{
|
|
BillAuditModel BillModelObj = new BillAuditModel(BillImpl.GetBillInfo(this.SysModel.ModuleCode));
|
|
_dtSourceData = BillImpl.GetDataTableResult(ReplaceHelper.ReplaceParamToValue(BillModelObj.DetailSql, BillDocumentId));
|
|
}
|
|
AccraditationModel AccditModelObj = AuditComModelObj.Moduletype == "bill" ? new AccraditationModel(BillAuditImpl.GetBillFlowData(this.SysModel.ModuleCode, item[this.BaseAccraditModelObj.TmpStepField] + "")) : new AccraditationModel(BaseAuditImpl.GetCurrentStepFlow(this.SysModel.ModuleCode, item[this.BaseAccraditModelObj.TmpStepField] + ""));
|
|
WaitForm.ShowForm("正在审核[" + item[tmpParmaryField] + "]单据!");
|
|
bool isComplete = true;//判断明细是否填完必填项
|
|
if (_baseRowData != null && AccditModelObj != null && !string.IsNullOrEmpty(AccditModelObj.RequiredFields))
|
|
{
|
|
string[] Fields = AccditModelObj.RequiredFields.Split(',');
|
|
|
|
foreach (string RequiredField in Fields)
|
|
{
|
|
if (_baseRowData.Table.Columns.Contains(RequiredField) && string.IsNullOrWhiteSpace(_baseRowData[RequiredField] + ""))
|
|
{
|
|
isComplete = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (_dtSourceData != null && !string.IsNullOrEmpty(AccditModelObj.RequiredDetailFields))
|
|
{
|
|
string[] Fields = AccditModelObj.RequiredDetailFields.Split(',');
|
|
|
|
foreach (string RequiredField in Fields)
|
|
{
|
|
if (_dtSourceData.Columns.Contains(RequiredField) && _dtSourceData.Rows.Cast<DataRow>().FirstOrDefault(x => string.IsNullOrWhiteSpace(x[RequiredField] + "")) != null)
|
|
{
|
|
isComplete = false;
|
|
}
|
|
}
|
|
}
|
|
if (isComplete)
|
|
{
|
|
//审核前调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, BillDocumentId, tmpParmaryField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, Interface.Api.ActionType.Audit);//审核
|
|
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
|
|
{
|
|
DialogResult dialogResult = MessageUtil.Show(ResourceKeys.AuditFail + "\r\n" + apiHelper.apiResutMsg);
|
|
break;
|
|
}
|
|
}
|
|
//string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, this.SysModel, stepCode, BillDocumentId, "", this.AuditComModelObj.ProcedureName, "F", "", "批量审批同意");
|
|
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, stepCode, BillDocumentId, "", this.AuditComModelObj.ProcedureName, "F", "", "批量审批同意");
|
|
|
|
if ("1".Equals(result))
|
|
{
|
|
#region 审核成功后调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, BillDocumentId, tmpParmaryField, this.BaseAccraditModelObj.BillTable, 0);
|
|
this.Info($"进入执行逻辑");
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.Audit);//审核
|
|
if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels))
|
|
{
|
|
MessageUtil.Show(apiHelper.apiResutMsg);
|
|
}
|
|
}
|
|
#endregion
|
|
success++;
|
|
}
|
|
else
|
|
{
|
|
fault++;
|
|
tipMsg += msgText + "\r\n";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
fault++;
|
|
tipMsg += "[" + item[tmpParmaryField] + "]单据内明细存在必填项未处理,请双击查看" + "\r\n";
|
|
}
|
|
|
|
}
|
|
MessageUtil.Show("审核成功:" + success + "\r\n" + "审核失败:" + fault + (string.IsNullOrEmpty(tipMsg) ? "" : "\r\n失败原因如下:" + tipMsg));
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
RefreshTabPage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:批量退回</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2020-05-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnBtnBackAuditClick(object sender, EventArgs e)
|
|
{
|
|
List<DataRow> rowItems = new List<DataRow>();
|
|
foreach (TabPageObj tab in this._tabPageObjs)
|
|
{
|
|
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
|
{
|
|
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
|
{
|
|
int[] mSelectRows = item.GridControlObj.GridView.GetSelectedRows();
|
|
foreach (int itemIndex in mSelectRows)
|
|
{
|
|
DataRow selectRow = item.GridControlObj.GridView.GetDataRow(itemIndex);
|
|
rowItems.Add(selectRow);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
//如果是终审页签,不会进入上方循环,所以rowItems.Count == 0
|
|
if (rowItems.Count == 0 && this.tabMain.SelectedTabPage == this.tabpage_finish && this.btnBack.Enabled)
|
|
{
|
|
int[] mSelectRows = gridFinish.GridView.GetSelectedRows();
|
|
foreach (int itemIndex in mSelectRows)
|
|
{
|
|
DataRow selectRow = gridFinish.GridView.GetDataRow(itemIndex);
|
|
rowItems.Add(selectRow);
|
|
}
|
|
DoneBackAudit(rowItems);
|
|
return;
|
|
}
|
|
|
|
|
|
if (rowItems.Count == 0)
|
|
{
|
|
MessageUtil.Show("请先勾选需要回退的数据!");
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
|
|
if (MessageUtil.Show("确定回退" + rowItems.Count + "条数据?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
int success = 0, fault = 0;
|
|
bool firstLoad = true;
|
|
string tipMsg = "";
|
|
string nextSelectStepCode = string.Empty;
|
|
string nextSelectStepOper = string.Empty;
|
|
try
|
|
{
|
|
int ret = 0;
|
|
List<string> Documents = new List<string>();
|
|
foreach (DataRow item in rowItems)
|
|
{
|
|
//AccraditationModel AccditModelObj = AuditComModelObj.Moduletype == "bill" ? new AccraditationModel(BillAuditImpl.GetBillFlowData(this.SysModel.ModuleCode, item[this.BaseAccraditModelObj.TmpStepField] + "")) : new AccraditationModel(BaseAuditImpl.GetCurrentStepFlow(this.SysModel.ModuleCode, item[this.BaseAccraditModelObj.TmpStepField] + ""));
|
|
string tmpParmaryField = this.isBill ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField;
|
|
WaitForm.ShowForm("正在返退[" + item[tmpParmaryField] + "]单据!");
|
|
string beforeMenuname = string.Empty;
|
|
string beforeUsers = string.Empty;
|
|
int beforeId = 0;
|
|
string stepCode = item[this.BaseAccraditModelObj.TmpStepField] + "";
|
|
string billDocumentId = item[tmpParmaryField] + "";
|
|
|
|
if (Documents.Contains(billDocumentId))
|
|
{
|
|
continue;
|
|
}
|
|
else
|
|
{
|
|
Documents.Add(billDocumentId);
|
|
}
|
|
|
|
//string billDocumentId = item[this.BaseAccraditModelObj.TmpParmaryField] + "";
|
|
bool isBack = string.IsNullOrEmpty(this.BaseAccraditModelObj.MenuCond) ||
|
|
this.SectionAccradit == null ||
|
|
Convert.ToInt32(stepCode) >= Convert.ToInt32(this.SectionAccradit["stepCode"] + "");
|
|
DataRow rowItem = BaseAuditImpl.GetSystemOperators(billDocumentId, stepCode, this.AuditComModelObj.Moduletype);
|
|
if (firstLoad) ret = ExecuteBackSelect(item);
|
|
if (ret == -9) return;
|
|
if (rowItem != null)
|
|
{
|
|
beforeMenuname = rowItem["menuname"] + "";
|
|
beforeUsers = rowItem["operators"] + "";
|
|
beforeId = Convert.ToInt32(rowItem["id"]);
|
|
}
|
|
string confirmOpers = string.Empty, remindOpers = string.Empty;
|
|
string prodouceName = isBack ? AuditComModelObj.ProcedureName + "back" : AuditComModelObj.ProcedureName;
|
|
//反审前调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
{
|
|
DialogResult dialogResult = MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + apiHelper.apiResutMsg);
|
|
break;
|
|
}
|
|
}
|
|
// string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper,
|
|
//this.SysModel, stepCode, billDocumentId, "", this.AuditComModelObj.ProcedureName, "R", "", _auditAdvice, remindOpers, confirmOpers, true, ret);
|
|
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText,
|
|
this.SysModel, stepCode, billDocumentId, "", this.AuditComModelObj.ProcedureName, "R", "", _auditAdvice, remindOpers, confirmOpers, true, ret);
|
|
string tag = isBack ? "1" : "0";
|
|
if (result == "1")
|
|
{
|
|
// 推送消息
|
|
PushHelper push = new PushHelper(billDocumentId, stepCode, this.SysModel.ModuleCode, beforeUsers, beforeMenuname, beforeId);
|
|
if (this.AuditComModelObj.Moduletype == "base")
|
|
{
|
|
push.Push_Base_Oper_Message();
|
|
}
|
|
else
|
|
{
|
|
push.Push_Bill_Oper_Message();
|
|
}
|
|
#region 反审后调用API
|
|
if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0))
|
|
{
|
|
ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, billDocumentId, this.PanelCondVisible ? this.BaseAccraditModelObj.DefaultParmaryField : string.IsNullOrEmpty(this.BaseAccraditModelObj.KeyField + "") ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField, this.BaseAccraditModelObj.BillTable, 0);
|
|
apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.AuditBack);
|
|
if (!string.IsNullOrEmpty(apiHelper.apiResutMsg))
|
|
MessageUtil.Show(apiHelper.apiResutMsg);
|
|
}
|
|
#endregion
|
|
success++;
|
|
}
|
|
else
|
|
{
|
|
fault++;
|
|
tipMsg += msgText + "\r\n";
|
|
}
|
|
firstLoad = false;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
MessageUtil.Show("返退成功:" + success + "\r\n" + "返退失败:" + fault + (string.IsNullOrEmpty(tipMsg) ? "" : "\r\n失败原因如下:" + tipMsg));
|
|
RefreshTabPage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#region 返回审核
|
|
/// <summary>
|
|
/// <para>说明:返回审核</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2021-02-24</para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="row">The row.</param>
|
|
/// <returns>System.Int32.</returns>
|
|
private int ExecuteBackSelect(DataRow item)
|
|
{
|
|
string ParmaryField = this.isBill ? this.BaseAccraditModelObj.TmpParmaryField : this.BaseAccraditModelObj.KeyField;
|
|
//if (this.BillModelObj.BackSelected == "0") return -1;
|
|
//单据审批弹出模块加载
|
|
string[] defaultArgs = string.Format(ModuleArgs.DefaultArgs, this.SysModel.FormText, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.SysModel.Privilege, this.SysModel.ModuleCode).Split('~');
|
|
//string[] menuArgs = { this.SysModel.ModuleId + "", "", item[this.TmpPrefix + this.BaseAccraditModelObj.DefaultStepField] + "", item[this.TmpPrefix + this.BaseAccraditModelObj.DefaultParmaryField] + "", "", "1" };
|
|
string[] menuArgs = { this.SysModel.ModuleId + "", "", item[this.TmpPrefix + this.BaseAccraditModelObj.DefaultStepField] + "", item[ParmaryField] + "", "", "1" };
|
|
string[] args = defaultArgs.Concat(menuArgs).ToArray();
|
|
//初始明细数据
|
|
this.PubSysModel = new DynamicPubAccraditionPopModel(args);
|
|
if (PubSysModel.StepCode == "100") return 0;
|
|
FrmBackSelect frmBackSel = new FrmBackSelect();
|
|
frmBackSel.SysModel = this.PubSysModel;
|
|
frmBackSel.InitControl(BaseAccraditModelObj, isBill);
|
|
if (frmBackSel.ShowDialog() != DialogResult.OK) return -9;
|
|
this._auditAdvice = frmBackSel.ComfirmMsg;
|
|
return frmBackSel.SelectStepCode;
|
|
}
|
|
#endregion
|
|
/// <summary>
|
|
/// tabPage组成结构
|
|
/// </summary>
|
|
public class TabPageItemObj
|
|
{
|
|
/// <summary>
|
|
/// 审批模型
|
|
/// </summary>
|
|
public AccraditationModel AuditModel;
|
|
/// <summary>
|
|
/// 进度流层表格
|
|
/// </summary>
|
|
public GridControlEx GridControlObj;
|
|
/// <summary>
|
|
/// 进度流层名
|
|
/// </summary>
|
|
public LabelControl LabelObj;
|
|
}
|
|
|
|
/// <summary>
|
|
/// tabpage模型
|
|
/// </summary>
|
|
public class TabPageObj
|
|
{
|
|
/// <summary>
|
|
/// 选项卡
|
|
/// </summary>
|
|
public XtraTabPage TabPage;
|
|
/// <summary>
|
|
/// 表格集合
|
|
/// </summary>
|
|
public List<TabPageItemObj> TabPageItemObjs = new List<TabPageItemObj>();
|
|
/// <summary>
|
|
/// 步骤模型
|
|
/// </summary>
|
|
public FlowTypeStepModel FlowStepModel;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取列的具体属性
|
|
/// </summary>
|
|
/// <param name="dtColumns"></param>
|
|
/// <param name="dt"></param>
|
|
/// <returns></returns>
|
|
private DataTable GetTableColumnProperties(DataTable dtColumns, DataTable dt)
|
|
{
|
|
try
|
|
{
|
|
if (dt == null)
|
|
{
|
|
dt = (this.isBill ? BillAuditImpl.GetBillMainInformation(this.SysModel.ModuleCode) : BaseModuleImpl.GetBaseGridColumns(this.SysModel.ModuleCode));
|
|
}
|
|
if (dt != null && SystemInfo.Instance.ReviewToCellTypes)
|
|
{
|
|
dtColumns.Columns.Add("fieldsqltag");
|
|
dtColumns.Columns.Add("fieldsqlname");
|
|
dtColumns.Columns.Add("fieldsqlid");
|
|
dtColumns.Columns.Add("fieldsql");
|
|
foreach (DataRow dataRow in dtColumns.Rows)
|
|
{
|
|
|
|
string fieldName = dataRow["fieldName"] + "";
|
|
if (string.IsNullOrWhiteSpace(fieldName)) continue;
|
|
DataRow[] array = dt.Select("fieldName='" + fieldName + "'");
|
|
if (array.Length == 1)
|
|
{
|
|
dataRow["fieldsqltag"] = array[0]["fieldsqltag"];
|
|
dataRow["fieldsqlname"] = array[0]["fieldsqlname"];
|
|
dataRow["fieldsqlid"] = array[0]["fieldsqlid"];
|
|
dataRow["fieldsql"] = array[0]["fieldsql"];
|
|
}
|
|
}
|
|
}
|
|
return dtColumns;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return dtColumns;
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:全选</para>
|
|
/// <para>创建人:曹屹峰</para>
|
|
/// <para>创建日期:2023-01-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnSelectAll_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.tabMain.SelectedTabPage == this.tabpage_finish)
|
|
{
|
|
if (gridFinish.GridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect && gridFinish.GridView.OptionsSelection.MultiSelect == true)
|
|
{
|
|
int[] selectIndexs = gridFinish.GridView.GetSelectedRows();
|
|
for (int i = 0; i < gridFinish.GridView.RowCount; i++)
|
|
{
|
|
if (!selectIndexs.Contains(i))
|
|
{
|
|
gridFinish.GridView.SelectRow(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (TabPageObj tab in this._tabPageObjs)
|
|
{
|
|
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
|
{
|
|
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
|
{
|
|
if (item.GridControlObj.GridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect && item.GridControlObj.GridView.OptionsSelection.MultiSelect == true)
|
|
{
|
|
int[] selectIndexs = item.GridControlObj.GridView.GetSelectedRows();
|
|
for (int i = 0; i < item.GridControlObj.GridView.RowCount; i++)
|
|
{
|
|
if (!selectIndexs.Contains(i))
|
|
{
|
|
item.GridControlObj.GridView.SelectRow(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:反选</para>
|
|
/// <para>创建人:曹屹峰</para>
|
|
/// <para>创建日期:2023-01-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnReverseSelection_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.tabMain.SelectedTabPage == this.tabpage_finish)
|
|
{
|
|
if (gridFinish.GridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect && gridFinish.GridView.OptionsSelection.MultiSelect == true)
|
|
{
|
|
int[] selectIndexs = gridFinish.GridView.GetSelectedRows();
|
|
for (int i = 0; i < gridFinish.GridView.RowCount; i++)
|
|
{
|
|
if (selectIndexs.Contains(i))
|
|
{
|
|
gridFinish.GridView.UnselectRow(i);
|
|
}
|
|
else
|
|
{
|
|
gridFinish.GridView.SelectRow(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (TabPageObj tab in this._tabPageObjs)
|
|
{
|
|
if (tab.TabPage == this.tabMain.SelectedTabPage)
|
|
{
|
|
foreach (TabPageItemObj item in tab.TabPageItemObjs)
|
|
{
|
|
if (item.GridControlObj.GridView.OptionsSelection.MultiSelectMode == GridMultiSelectMode.CheckBoxRowSelect && item.GridControlObj.GridView.OptionsSelection.MultiSelect == true)
|
|
{
|
|
int[] selectIndexs = item.GridControlObj.GridView.GetSelectedRows();
|
|
for (int i = 0; i < item.GridControlObj.GridView.RowCount; i++)
|
|
{
|
|
if (selectIndexs.Contains(i))
|
|
{
|
|
item.GridControlObj.GridView.UnselectRow(i);
|
|
}
|
|
else
|
|
{
|
|
item.GridControlObj.GridView.SelectRow(i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置分割条移动</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void SplitBelow_SplitterPositionChanged(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.SysModel != null)
|
|
{
|
|
IniHelper.Write(string.Format("BelowDetai_width_{0}", this.SysModel.ModuleCode), this.splitBelow.SplitterPosition + "");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置分割条位置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
protected void InitlizeSpiltLocation()
|
|
{
|
|
try
|
|
{
|
|
if (splitBelow.PanelVisibility == SplitPanelVisibility.Both)
|
|
{
|
|
string width = IniHelper.Read(string.Format("BelowDetai_width_{0}", this.SysModel.ModuleCode));//通过Key获取Value值
|
|
if (!string.IsNullOrEmpty(width))
|
|
{
|
|
this.splitBelow.SplitterPosition = Convert.ToInt32(width);
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 审核或反审
|
|
/// </summary>
|
|
public string AuditMethod(out string nextSelectStepCode,
|
|
out string nextSelectStepOper,
|
|
out string msgText,
|
|
DynamicModel sysModel,
|
|
string stepCode,
|
|
string billDocumentId,
|
|
string message,
|
|
string storedName,
|
|
string accractFlag,
|
|
string remindSelect,
|
|
string remarkText = "",
|
|
string remindOpers = "",
|
|
string confirmOpers = "",
|
|
bool ret = false,
|
|
int returnd = 0,
|
|
int selectConfirmFlag = 0,
|
|
bool IsStepOver = false,
|
|
int comfirm = 0
|
|
)
|
|
{
|
|
string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out msgText, sysModel, stepCode, billDocumentId, message, storedName, accractFlag, remindSelect, remarkText, remindOpers, confirmOpers, ret, returnd, selectConfirmFlag, IsStepOver, comfirm);
|
|
|
|
if ("9".Equals(result))
|
|
{
|
|
// 继续执行保存
|
|
//if (string.IsNullOrWhiteSpace(msgText)) msgText = "失败";
|
|
if (MessageUtil.Show(msgText, MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
result = AuditMethod(out nextSelectStepCode, out nextSelectStepOper, out msgText, sysModel, stepCode, billDocumentId, message, storedName, accractFlag, remindSelect, remarkText, remindOpers, confirmOpers, ret, returnd, selectConfirmFlag, IsStepOver, 1);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
}
|
|
}
|