框架使用记录
一、流程表
1.我的审批查看
具体代码见service中。
-- 用户审批 = 1 (UserInfo.User_Id), 角色审批 = 2 (UserInfo.Role_Id),部门审批 = 3(user.DeptIds)
select * from Sys_WorkFlowTable where WorkFlowTable_Id in(
select WorkFlowTable_Id from Sys_WorkFlowTableStep s
where (StepType=1 and StepValue='3365') or (StepType=2 and StepValue='9') or(StepType=3 and StepValue in('',''))
);
select s.StepType,s.StepValue,s.* from Sys_WorkFlowTableStep s
-- where (StepType=1 and StepValue='3365') or (StepType=2 and StepValue='9') or(StepType=3 and StepValue in('',''))
order by CreateDate desc;
删除某个流程:
delete from Sys_WorkFlowTableStep where WorkFlowTable_Id in('A539703A-8DC6-4EBE-B63D-5B41DE07C7CF','01544834-6E18-4EDD-8745-71F919BAE27B');
delete from Sys_WorkFlowTable where WorkFlowTable_Id in('A539703A-8DC6-4EBE-B63D-5B41DE07C7CF','01544834-6E18-4EDD-8745-71F919BAE27B');
2.流程节点设置表:Sys_WorkFlowStep、Sys_WorkFlow
StepType存的是“审批类型,1、用户;2角色” 如果StepType是1(用户) StepValue 存的是用户id,如果 StepType是2(角色)存的是 角色ID
如果指定用,且指定的用户要动态的,那可以建一个不用的用户,指定它,主要用他的名称对就可以。
3.具体某个业务的流程表:Sys_WorkFlowTableStep
Sys_WorkFlowTableStep 中的AuditStatus必须是审批中、待审批, 且StepId= Sys_WorkFlowTable.CurrentStepId,审核页面的 isCurrentUser才会是true ,且Sys_WorkFlowTable 中的AuditStatus必须是审批中、待审批 如此才出现审批按钮
4.换了一个环境流程不可用了
手工重新分配。
二、修改了本地的生成的配置,对应两张表
Sys_TableColumn、Sys_TableInfo
三、控制主从表,保存不关闭当前页面。
updateAfter(formData) { //控制 保存不关闭当前页面。 this.search(); return false; },
四、控制 弹出框保存不关闭。保存成功后并处理状态为修改。
addAfter(result) { // console.info(result); // console.info(result.status); // console.info(JSON.parse(result.data)); // console.info(JSON.parse(result.data).data.PriceSheetId); // console.info(result.data.Data); if(result.status===true) { // console.info('this.editFormFields:'+this.editFormFields["PriceSheetId"]); let resultData = JSON.parse(result.data).data; Object.keys(resultData).forEach(key=>{ this.editFormFields[key] = resultData[key]; }); this.boxButtons[0].hidden=false; this.boxButtons[1].hidden=false; this.currentAction="update"; // console.info('extendsPriceSheetId:'+extendsPriceSheetId); // console.info('this.editFormFields:'+JSON.parse(this.editFormFields)); // console.info('this.editFormFields:'+this.editFormFields["PriceSheetId"]); console.info(this.currentAction); this.search(); } // this.refresh(); //控制 保存不关闭当前页面。 return false; },
四、禁用页面缓存keepAlive
meta: {
keepAlive: false
}
四、导入增加固定参数
JS:
importExcelBefore (formData) { //导入excel导入前 //往formData写一些其他参数提交到后台, // alert(store.getters.data().Warehouse); formData.append("strWarehouseCode", store.getters.data().Warehouse); //后台按下面方法获取请求的参数 // Core.Utilities.HttpContext.Current.Request("val2"); return true; },
后台:

//导入后处理(已经写入到数据库了) ImportOnExecuted = (List<PutIntoStorageTmp> list) => { try { string strWarehouseCode = Core.Utilities.HttpContext.Current.Request("strWarehouseCode"); } catch (Exception err) { return webResponse.Error("导入出错,请联系管理员!"); } return webResponse.OK(); };
五、前端
1.明细是否可编辑,且动态绑定下拉数据。

//可编辑 this.columns.forEach(row => { //加载列下拉数据 // this.AddColumnsSelectData(); if (row.field == "Quality") { row.edit = { type: "select",keep: true }; //如果设置key的字典编号,data设置空数组会自动绑定数据源 row.bind = { key:'QualityState',data:[]}; } if (row.field == "MoveQty") { row.edit = { keep: true }; } })
六、明细表添加行

addRow () { //明细表添加行,在此处可以设置添加的默认值 let obj = {}; //给明细表添加行时,设置默认值。--onInited方法中对this.detailOptions.columns进行formatter也可以实现) //obj.xx=123; this.$refs.detail.addRow(obj); //明细表批量添加行this.$refs. detail.rowData.push(...[{},{}]); },
七、select 下拉框 选择过多 不显示
1 2 | select2Count 下拉框选项超出500个后会启用element plus中的select2组件 修改 前端 select2Count 默认值 就好了。 |
八、同一栏位,取不同数据字典
如下只介绍了主从表方式 修改方法

//编辑方法保存数据库前处理 UpdateOnExecuting = (PriceSheetHead head, object addList, object updateList, List<object> delKeys) => { int intPriceSheetId = head.PriceSheetId; List<PriceSheetList> listAll = null; if (addList != null) { //新增的明细表 List<PriceSheetList> add = addList as List<PriceSheetList>; listAll = add; } if (addList != null) { //修改的明细表 List<PriceSheetList> update = updateList as List<PriceSheetList>; listAll = listAll.Concat(update).ToList(); } if (listAll != null) { List<Sys_DictionaryShow> arrFromAddress = new List<Sys_DictionaryShow>(); List<Sys_DictionaryShow> arrToAddress = new List<Sys_DictionaryShow>(); //验证 导入数据,并根据进出口标志 返回不同的起始地和目的地。 string strCheckResult = _serviceSheetList.CheckImport(listAll, "当前数据存在", intPriceSheetId, head.SummaryCompanyCode,head.IEFlag.ToString(),head.AgentName,head.BusinessType,head.TradeTerm, out arrFromAddress, out arrToAddress); if (!string.IsNullOrEmpty(strCheckResult)) { //设置webResponse.Code = "-1"会中止后面代码执行,与返回 webResponse.Error()一样,区别在于前端提示的是成功或失败 webResponse.Code = "-1"; webResponse.Message = strCheckResult; return webResponse.Error(strCheckResult); } else { foreach (PriceSheetList item in listAll) { var arrFromTmp = arrFromAddress.Where(x => x.DicName == item.FromAddress).ToList(); var arrToTmp = arrToAddress.Where(x => x.DicName == item.ToAddress).ToList(); if (arrFromTmp != null && arrFromTmp.Count > 0 && arrToTmp != null && arrToTmp.Count > 0) { item.FromAddress = arrFromTmp[0].DicValue; item.ToAddress = arrToTmp[0].DicValue; } else { webResponse.Code = "-1"; strCheckResult = string.Format("起始地:【{0}】或目的地:【{1}】在数据字典中不存在!", item.FromAddress, item.ToAddress); webResponse.Message = strCheckResult; return webResponse.Error(strCheckResult); } } return webResponse.OK(); } } return webResponse.OK(); };
九、增加自定义按钮权限
增加其他权限,保存的时候一定要把前面的复选框选择好。
十、审批状态有负值时,编辑界面显示不了中文

Object.keys(row).forEach(key=>{ if(key==="AuditStatus") { this.formHeadFields[key] = String(row[key]); } else { this.formHeadFields[key] = row[key]; } });
十一、新建页面对话框—“确定”后 页面上的信息 与对话框填写的不一致。
解决:“实际表名”做下修改,可能是先新建了菜单。
十二、数据默认不加载
this.load=false
十三、显示按钮数
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
2013-10-31 oracle 导入导出