在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
系列目录步骤设置完毕之后,就要设置好流转了,比如财务申请大于50000元(请假天数>5天)要总经理审批,否则财务审批之后就结束了。 设置分支没有任何关注点,我们把关注点都放在了用户的起草表单。所以本节如同设置字段,设置步骤一样,只需要填充好Flow_StepRule表 表结构:Flow_StepRule表主要是字段对比值,所以需要操作符,我们约定操作符为=、>、<、<=、>=、!=六种 表Flow_StepRule的主表是Flow_Step,所以跟步骤一样为主从关系的设置 我是这样设计的,先获取步骤列表,再按列表的步骤来设置分支,如图 分支具体代码如下 <table id="List"></table> <div id="modalwindow" class="easyui-window" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div> <script type="text/javascript"> $(function () { $('#List').datagrid({ url: '@Url.Action("GetStepList")?id=@(ViewBag.FormId)', width: SetGridWidthSub(10), methord: 'post', height: SetGridHeightSub(39), fitColumns: true, sortName: 'Sort', sortOrder: 'asc', idField: 'Id', pageSize: 15, pageList: [15, 20, 30, 40, 50], pagination: true, striped: true, //奇偶行是否区分 singleSelect: true,//单选模式 //rownumbers: true,//行号 columns: [[ { field: 'StepNo', title: '步骤', width: 80 }, { field: 'Id', title: '', width: 80, hidden: true }, { field: 'Name', title: '步骤名称', width: 80, sortable: true }, { field: 'Remark', title: '步骤说明', width: 280, sortable: true }, { field: 'Sort', title: '排序', width: 80, sortable: true, hidden: true }, { field: 'FormId', title: '所属表单', width: 80, sortable: true, hidden: true }, { field: 'FlowRule', title: '流转规则', width: 80, sortable: true }, { field: 'Action', title: '操作分支',align:'center', width: 80, sortable: true } ]] }); }); //ifram 返回 function frameReturnByClose() { $("#modalwindow").window('close'); } function frameReturnByReload(flag) { if (flag) $("#List").datagrid('load'); else $("#List").datagrid('reload'); } function frameReturnByMes(mes) { $.messageBox5s('提示', mes); } function SetRule(stepId) { $("#modalwindow").html("<iframe width='100%' height='100%' scrolling='no' frameborder='0'' src='/Flow/Form/StepRuleList?stepId=" + stepId + "&formId=@(ViewBag.FormId)'></iframe>"); $("#modalwindow").window({ title: '设置分支', width: 620, height: 300, iconCls: 'icon-add' }).window('open'); } </script> [SupportFilter(ActionName = "Edit")] public ActionResult StepList(string id) { ViewBag.FormId = id; return View(); } [HttpPost] [SupportFilter(ActionName = "Edit")] public JsonResult GetStepList(GridPager pager, string id) { List<Flow_StepModel> stepList = stepBLL.GetList(ref pager, id); int i = 1; var json = new { total = pager.totalRows, rows = (from r in stepList select new Flow_StepModel() { StepNo = "第 "+(i++)+" 步", Id = r.Id, Name = r.Name, Remark = r.Remark, Sort = r.Sort, FormId = r.FormId, FlowRule = r.FlowRule, Action = "<a href='javascript:SetRule(\"" + r.Id + "\")'>分支(" + GetStepRuleListByStepId(r.Id).Count() + ")</a></a>" }).ToArray() }; return Json(json); } 点击操作分支按钮将弹出分支的添加和删除 分支代码如下(增删查) @using App.Admin; @using App.Common; @using App.Models.Sys; @{ ViewBag.Title = "主页"; Layout = "~/Views/Shared/_Index_Layout.cshtml"; List<permModel> perm = (List<permModel>)ViewBag.Perm; if (perm == null) { perm = new List<permModel>(); } } <table> <tr> <td> <table id="List"></table> </td> <td style="width: 180px; vertical-align: top"> <table style="line-height: 40px;"> <tr> <td class="tr">字段:</td> <td> <select id="LeftVal"> @foreach (var r in (List<App.Models.Flow.Flow_FormAttrModel>)ViewBag.AttrList) { <option value="@r.Id">@r.Title</option> } </select></td> </tr> <tr> <td class="tr">操作:</td> <td> <select id="CenterVal"> <option value="=">= </option> <option value=">">> </option> <option value="<">< </option> <option value="<="><= </option> <option value=">=">>= </option> <option value=">=">!= </option> </select></td> </tr> <tr> <td class="tr">值:</td> <td> <input id="RightVal" type="text" style="width: 80px;" /></td> <tr> <td class="tr">下一步:</td> <td> <select id="NextVal"> <option value="0">结束流程</option> @foreach (var r in (List<App.Models.Flow.Flow_StepModel>)ViewBag.StepList) { <option value="@r.Id">@r.Name</option> } </select></td> </tr> <tr><td></td> <td style="line-height:0px"> <a id="Result" href="javascript:AddEvent('@(ViewBag.StepId)')" class="easyui-linkbutton" data-options="iconCls:'icon-add'">添加分支</a> </td> </tr> </table> </td> </tr> </table> <div id="modalwindow" class="easyui-window" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div> @Html.Partial("~/Views/Shared/_Partial_AutoGrid.cshtml") <script type="text/javascript"> $(function () { $('#List').datagrid({ url: '@Url.Action("GetStepRuleList")?stepId=@(ViewBag.StepId)', width: SetGridWidthSub(180), methord: 'post', height: SetGridHeightSub(9), fitColumns: true, sortName: 'Id', sortOrder: 'desc', idField: 'Id', pageSize: 115, pagination: false, striped: true, //奇偶行是否区分 singleSelect: true,//单选模式 //rownumbers: true,//行号 columns: [[ { field: 'Id', title: 'ID', width: 80, hidden: true }, { field: 'Mes', title: 'Mes', width: 80, hidden: true }, { field: 'StepId', title: '步骤ID', width: 80, sortable: true, hidden: true }, { field: 'AttrId', title: '字段ID', width: 80, sortable: true, hidden: true }, { field: 'AttrName', title: '字段', width: 80, sortable: true }, { field: 'Operator', title: '操作', width: 80, sortable: true }, { field: 'Result', title: '值', width: 80, sortable: true }, { field: 'NextStep', title: '下一步ID', width: 80, sortable: true, hidden: true }, { field: 'NextStepName', title: '下一步', width: 80, sortable: true }, { field: 'Action', title: '操作', width: 80}, ]] }); }); //ifram 返回 function frameReturnByClose() { $("#modalwindow").window('close'); } function frameReturnByReload(flag) { if (flag) $("#List").datagrid('load'); else $("#List").datagrid('reload'); } function frameReturnByMes(mes) { $.messageBox5s('提示', mes); } //添加条件 function AddEvent(stepId) { var leftVal 全部评论
专题导读
上一篇:为WebForms说几句话,以及一些ASP.NET开发上的经验(1,2,3)发布时间:2022-07-10下一篇:asp.net使用treeview控件,使用reeNodePopulate事件加载节点发布时间:2022-07-10热门推荐
热门话题
阅读排行榜
|
请发表评论