O2O项目总结-流程管理-流程审核
审核流程
-
由前端发送一个审核请求,前端发起审核是需要进行前端按钮的逻辑判断
- 不是套餐按钮"disabled"
- 多选按钮"disabled",只能单选一个套餐进行审核
- 审核进行中或者审核通过按钮"disabled"
- 这里值得一提的bootstrap-table的一个API, var rows = $(‘#bootstrap-table’).bootstrapTable(‘getSelections’);可以获取选中行数据的放入到一个数组中方便了进行判断
<div class="btn-group-sm" id="toolbar" role="group"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:serviceItem:add"> <i class="fa fa-plus"></i> 新增 </a> <a class="btn btn-primary disabled" id="startAudit" onclick="startAudit()" shiro:hasPermission="business:serviceItem:audit"> <i class="fa fa-edit"></i> 发起审核 </a> </div>
function startAudit(){ //获取选中行的数据,是一个数组 var rows = $('#bootstrap-table').bootstrapTable('getSelections'); var row = rows[0]; $.modal.open("发起审核", prefix + "/startAuditPage?id="+row.id); } <!--按钮使用的一个判断--> $("#bootstrap-table").on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table",function () { //得到的是一个数组 var rows = $('#bootstrap-table').bootstrapTable('getSelections'); //没有或者一个以上的流程不能发起审核 var row = rows[0]; if (row) { if(rows.length>1||row.length==0 ){ console.log(1); $("#startAudit").addClass("disabled"); return; } //不是套餐不能发起审核 if (row.carPackage==0){ $("#startAudit").addClass("disabled"); return; } //审核中或者审核通过不需要发起审核 if (row.auditStatus == 1 || row.auditStatus == 2) { $("#startAudit").addClass("disabled"); return; } $("#startAudit").removeClass("disabled"); } });
-
点击发起审核
-
"$.modal.open(“发起审核”, prefix + “/startAuditPage?id=”+row.id);"前端发送过来的一个serviceItemId
-
需要展示这样的画面,[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gHHph4ef-1654688504083)(D:\思维导图\O2O总结\images\发起审核.png)]
-
后端则需要从数据库中查询audit.html的数据,(serviceItem,finances,directors,bpnmInfo)
@RequestMapping("/startAuditPage") public String startAuditPage(Long id ,Model model){ model.addAttribute("serviceItem", serviceItemService.get(id)); List< User > directors = userService.queryByRoleKey("shopOwner"); List< User > finances = userService.queryByRoleKey("financial"); model.addAttribute("finances",finances); model.addAttribute("directors",directors); BpmnInfo bpmnInfo = bpmnInfoService. queryByNameType("car_package"); model.addAttribute("bpmnInfo",bpmnInfo); return prefix + "audit"; }
-
前端页面audit.html需要做的逻辑任务就是,当不需要财务审核时财务的栏是不需要显示的
//从数据库中查出需要财务审核的优惠金额阈值然后做出比较,得出结果决定是否将财务审核人显示出来 var bus_carPackageLimit = [[${ @config.getValue('bus_car_package_limit')}]]; $(function () { if($("#discountPriceId").val() < bus_carPackageLimit){ console.log($("#discountPriceId").val()); $("#financeId").remove(); } });
-
audit.html
<!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" > <head> <th:block th:include="common/include :: header('流程定义审核确认')" /> </head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-bpmnInfo-edit" th:object="${serviceItem}"> <!-- 隐藏域中返回 需要审核服务单项的id及 审核流程的id--> <input name="id" th:field="*{id}" type="hidden"> <!--传过来的bpmnInfo可能是个空值这里加一个判断--> <input name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.id:''}" type="hidden" > <div class="form-group"> <label class="col-sm-3 control-label">流程名称:</label> <div class="col-sm-8"> <input name="name" th:field="*{name}" class="form-control" type="text" readonly disabled="disabled"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">原价:</label> <div class="col-sm-8"> <input name="originalPrice" th:field="*{originalPrice}" class="form-control" type="text" readonly disabled="disabled"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">折扣价:</label> <div class="col-sm-8"> <input name="discountPrice" id="discountPriceId" th:field="*{discountPrice}" class="form-control" type="text" readonly disabled="disabled"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">审核流程:</label> <div class="col-sm-8"> <input name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.bpmnName:''}" class="form-control" type="text" readonly disabled="disabled"> </div> </div> <div class="form-group" id="directorId"> <label class="col-sm-3 control-label">审核人(店长):
-