LayUI发送Ajax请求

页面初始化操作

var processData = null
$(function () {initView();initTable();// test();
})function initView() {layui.use(['laydate', 'form'], function () {var laydate = layui.laydate;laydate.render({elem: '#applyDateTimeRange',type: 'datetime',range: true});});
}

初始化表格操作


function initTable() {//初始化tablevar headerObj = [[{title: '序号', width: 60, templet: function (d) {return d.LAY_TABLE_INDEX + 1;}},{field: "systemType", title: "平台", width: 100, sort: false,},{field: "applyOrderDetailId", title: "工单号", minWidth: 70, sort: false},{field: "createTime", title: "申请时间", minWidth: 60, sort: false},{field: "applyUserName", title: "申请人", width: 100, sort: false},{field: "dealState", title: "状态", width: 100, sort: false, templet: function (d) {if (d.dealState == 0) {return "未开启";} else if (d.dealState == 1) {return "流程中";} else if (d.dealState == 2) {return "已完成";} else{return "未知(" + d.applyStatus + ")";}}},{field: "", title: "操作", minWidth: 200, toolbar: '#startFlowTableBar',}]];layui.use(['table', 'form'], function (exports) {var table = layui.table;table.render({elem: '#searchTable',url: 'http://localhost:8080/getStartList',page: true,     //显示分页默认不显示cols: headerObj,// request: {//     pageName: 'page',//     limitName: 'limit'// },// where: {//     applyStatus: $("#applyStatus").val()// },response: {statusName: 'status',statusCode: 'normal',countName: 'count',dataName: 'data'},parseData: function (res) {console.log("+++",res)return {"count": res.data.total,"data": res.data.list,"status": "normal"};}});//table操作事件table.on('tool(searchTable)', function (row) {var data = row.data;var layEvent = row.event;var tr = row.tr;if (layEvent == 'level2Check') {initStartFlowView(data);} else if (layEvent == 'showDetailEvent') {// showDetailView(data)ajax_load_detail(data)}else if (layEvent == 'showFlowEvent'){ajax_load_flow(data)}});//搜索按钮$('#searchBtn').on('click', function () {var moduleType = $("#moduleType").val();var applyStatus = $("#applyStatus").val();var applyDateTimeRange = $("#applyDateTimeRange").val();table.reload('searchTable', {page: {curr: 1 //重新从第 1 页开始},where: {moduleType: moduleType,applyStatus: applyStatus,applyDateTimeRange: applyDateTimeRange}});});});
}

function showDetailView(data) {console.log("data",data)var resApplyId = data.resApplyId;var moduleType = data.moduleType;layui.use(['layer', 'laytpl', 'form', 'table'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var tplHtml = insertFormTpl.innerHTML;var index;laytpl(tplHtml).render({}, function (html) {index = layer.open({type: 1,title: '展示详情',area: ['600px', '310px'],offset: 'auto',maxmin: true,content: html});form.render();});form.on('submit(insertFormBtn)', function (data) {console.log("获取到监听事件")$.ajax({url: "http://localhost:8080/getApplyOrderDetail?orderId=" + resApplyId,type: "POST",dataType: "json",data: {moduleType: moduleType,checkResult: data.field.checkResult,description: data.field.description},success: function (data) {if (data.status == 'normal') {layer.msg("审批成功");table.reload("searchTable", {});layer.close(index);} else {layer.msg(data.exception.error_msg || '审批失败!');}}});return false;});});
}

function ajax_load_detail(data) {var resApplyId = data.applyOrderDetailId;$.ajax({url: "http://localhost:8080/getApplyOrderDetail?orderId=" + resApplyId,type: "GET",dataType: "json",success: function (data_r) {console.log("+++++++" + data_r)console.log("====" + JSON.stringify(data_r))if (data_r.msg == 'NORMAL') {layui.use(['layer', 'laytpl', 'form', 'table'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var tplHtml = detailHtml.innerHTML;laytpl(tplHtml).render({}, function (html) {index = layer.open({type: 1,title: '展示详情',area: ['600px', '310px'],offset: 'auto',maxmin: true,content: html});form.render();});//TODO 设置每个字段对应的值form.val("showApplyDetail", {"applyOrderDetailId": data_r.data.applyOrderDetailId,"applyOrderDetail": data_r.data.applyOrderDetail})})} else {layer.msg();}}});
}

整个页面的HTML

<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>海燕-国美统一开发者平台 - 我的申请</title><meta content="text/html;charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE-edge" /><meta name="viewport" content="width=device-width,initial-scale=1" /><link rel="stylesheet" th:href="@{/css/cat-common.css}" /><link rel="stylesheet" th:href="@{/css/font.css}"><link rel="stylesheet" th:href="@{/css/xadmin.css}"><link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" /><link rel="stylesheet" th:href="@{/css/common.css}"><style>.user_left{width: 45%;float: left;margin: 20px 0 0 5%;}</style></head><body><div class="cat-body"><h1 style="color: red">开启流程相关操作(开发中。。。。)</h1><!--<div class="layui-row">--><!--<form class="layui-form layui-col-md12 x-so" style="text-align: justify">--><!--<div class="layui-inline">--><!--<label class="layui-form-label">申请类型:</label>--><!--<div class="layui-input-inline">--><!--<select name="moduleType" id="moduleType">--><!--<option value="">全部</option>--><!--<option value="domain_scan_new">域名扫描</option>--><!--<option value="kvm_new">虚拟机</option>--><!--<option value="db_new">数据库</option>--><!--<option value="appDeploy_new">应用服务部署</option>--><!--<option value="net-acl">网络权限</option>--><!--<option value="net-lvs">负载均衡</option>--><!--<option value="nginx_conf_update_new">Nginx配置变更</option>--><!--<option value="cdn_link_up_new">CDN接入</option>--><!--<option value="cdn_cache_clean_new">CDN缓存清理</option>--><!--<option value="code_auth_new">代码权限申请</option>--><!--<option value="jms">堡垒机申请</option>--><!--<option value="domainHighDefense_new">域名高防</option>--><!--<option value="net-dns">域名解析</option>--><!--</select>--><!--</div>--><!--</div>--><!--<div class="layui-inline">--><!--<label class="layui-form-label">申请时间:</label>--><!--<input type="text" class="layui-input" id="applyDateTimeRange" placeholder="开始日期 - 结束日期" readonly style="width:300px">--><!--</div>--><!--<div class="layui-inline">--><!--<label class="layui-form-label">受理部门:</label>--><!--<div class="layui-input-inline">--><!--<select name="applyDept" id="applyDept">--><!--<option value="0">全部</option>--><!--<option value="1">DBA-数据库运维</option>--><!--<option value="2">SRE-应用运维</option>--><!--<option value="3">SA-云科</option>--><!--<option value="4">DTM-桌面运维</option>--><!--<option value="5">NS-网安</option>--><!--<option value="6">CR-代码</option>--><!--</select>--><!--</div>--><!--</div>--><!--<div class="layui-btn" title="查询" id="searchBtn">--><!--<i class="layui-icon">&#xe615;</i>查询--><!--</div>--><!--</form>--><!--</div>--><div class="layui-row"><div class="cat-block"><!-- TODO 1.修改button名称; --><!--<button class="layui-btn _add_apply" οnclick="applyNew();">--><!--<i class="layui-icon">&#xe608;</i>新建自定义工单</button>--><button class="layui-btn" onclick="reload_data();"><i class="layui-icon">&#xe669;</i>刷新数据</button></div></div><!--结果  --><table id="searchTable" lay-filter="searchTable" lay-size="sm"></table></div><script type="text/html" id="startFlowTableBar">
{{# if(d.dealState==0){ }}
<a class="layui-btn layui-btn-normal layui-btn-xs" style="color: #0f3788;" lay-event="level2Check">开启流程</a>
{{# } }}
<a class="layui-btn layui-btn-normal layui-btn-xs" style="color: blue" lay-event="showFlowEvent">查看进度</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" style="color: green" lay-event="showDetailEvent">工单详情</a><!--{{# if(d.applyStatus==1 || d.applyStatus==6){ }}-->
<!--<a class="layui-btn layui-btn-lg layui-btn-xs" lay-event="detail">详情</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="applyFlow">进度</a>-->
<!--{{# }else if((d.applyStatus==2 || d.applyStatus==5) && (d.applyStar==null || d.applyStar==0)){ }}-->
<!--<a class="layui-btn layui-btn-lg layui-btn-xs" lay-event="detail">详情</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="applyFlow">进度</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="comment">评论</a>-->
<!--{{# }else if((d.applyStatus==2 || d.applyStatus==5) && (d.applyStar!=null && d.applyStar!=0)){ }}-->
<!--<a class="layui-btn layui-btn-lg layui-btn-xs" lay-event="detail">详情</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="applyFlow">进度</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="lookComment">查看评论</a>-->
<!--{{# }else if(d.applyStatus==4 || d.applyStatus==7){ }}-->
<!--<a class="layui-btn layui-btn-lg layui-btn-xs" lay-event="detail">详情</a>-->
<!--<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="applyFlow">进度</a>-->
<!--<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="reApply">重新提交</a>-->
<!--{{# }else{ }}-->
<!--<a class="layui-btn layui-btn-lg layui-btn-xs" lay-event="detail">详情</a>-->
<!--{{# } }}-->
</script><script type="text/html" id="insertFormTpl">
<div class="x-body"><form class="layui-form" action="" lay-filter="insertForm"><div class="layui-form-item"><label class="layui-form-label">审批结果</label><div class="layui-input-block"><input type="radio" name="checkResult" value="2" title="通过" checked><input type="radio" name="checkResult" value="3" title="拒绝"></div></div><div class="layui-form-item"><label class="layui-form-label">审批意见</label><div class="layui-input-block"><textarea name="description" lay-verify="required" placeholder="请输入内容" class="layui-textarea"></textarea></div></div><div class="layui-form-item"><div class="layui-input-block"><button class='layui-btn' lay-submit lay-filter='insertFormBtn'>提交</button></div></div></form>
</div>
</script><script type="text/html" id="detailHtml"><div class="x-body"><h1 lay-filter="detailString">展示详情</h1><form class="layui-form" action="" lay-filter="showApplyDetail"><!-- 表单类型 --><div class="layui-form-item"><label class="layui-form-label">工单号</label><div class="layui-input-block"><input type="text" name="applyOrderDetailId" class="layui-input" disabled></div></div><!-- 申请原因 --><div class="layui-form-item"><label class="layui-form-label">工单详情</label><div class="layui-input-block"><textarea name="applyOrderDetail" class="layui-textarea" disabled></textarea></div></div></form></div></script><script type="text/html" id="startFlow"><div class="x-body"><h1>开启流程操作待开发</h1><form class="layui-form" name="addForm" id="addForm"><div class="user_left" id="selectPerson"><!-- 一个标准的input组合,这个是固定项 --><div class="layui-form-item"><label class="layui-form-label">申请人</label><div class="layui-input-block"><input type="text" id="title" name="title" lay-verify="required" class="layui-input"></div></div><!-- 根据属性List生成的input追加在这里--></div><div class="layui-form-item"><label class="layui-form-label">开启备注信息</label><div class="layui-input-block"><textarea name="description" lay-verify="required" placeholder="请输入内容" class="layui-textarea"></textarea></div></div><!-- buttons --><div class="layui-form-item" style="margin-left: 5%;"><div class="layui-input-block"><!-- 这里的提交按钮是button形式,不是submit --><!--<input type="button" id="insert" onclick="return check()" class="layui-btn" value="开启流程" />--><input type="button" id="insert" lay-submit lay-filter='startFormBtn' class="layui-btn" value="开启流程" /><!-- 清空表单,这个按钮隐藏了 --><input type="button" name="reset" class="layui-btn" value="重置" /></div></div></form></div></script><script type="text/html" id="showFlow"><div class="x-body"><h1>开启流程操作待开发</h1><form class="layui-form" name="addForm" ><div class="user_left" id="showPerson"><!-- 一个标准的input组合,这个是固定项 --><div class="layui-form-item"><label class="layui-form-label">申请人</label><div class="layui-input-block"><input type="text" id="person" name="title" lay-verify="required" class="layui-input"></div></div><!-- 根据属性List生成的input追加在这里--></div></form></div></script><script type="text/html" id="insertTpl"><div class="x-body"><form class="layui-form" action=""><!-- 域账号 --><div class="layui-form-item  layui-form-text"><label class="layui-form-label">主题</label><div class="layui-input-block"><input type="text" name="topic" autocomplete="off" class="layui-input"></div></div><!-- 权限 --><div class="layui-form-item"><label class="layui-form-label">受理部门</label><div class="layui-input-block"><select name="dept" lay-verify="dept" lay-filter="dept"><option value="-1">请选择一个受理部门</option><option value="1">DBA-数据库运维</option><option value="2">SRE-应用运维</option><option value="3">SA-云科</option><option value="4">DTM-桌面运维</option><option value="5">NS-网安</option><option value="6">CR-代码</option></select></div></div><div class="layui-form-item"><label class="layui-form-label">具体描述</label><div class="layui-input-block"><textarea name="applyDesc" lay-filter="required" class="layui-textarea"></textarea></div></div><!-- <div class="layui-form-item"></div> --><div class="layui-form-item"><div class="layui-input-block"><button class='layui-btn' lay-submit lay-filter="insertApply">提交</button></div></div></form></div></script><script type="text/javascript" th:src="@{/lib/jquery/jquery-3.3.1.min.js}"></script><script type="text/javascript" th:src="@{/lib/layui/layui.js}" charset="utf-8"></script><script type="text/javascript" th:src="@{/js/common.js}"></script><script type="text/javascript" th:src="@{/js/approval/startApproval.js}"></script></body>

整个页面的JS代码

var processData = null
$(function () {initView();initTable();// test();
})function initView() {layui.use(['laydate', 'form'], function () {var laydate = layui.laydate;laydate.render({elem: '#applyDateTimeRange',type: 'datetime',range: true});});
}function initTable() {//初始化tablevar headerObj = [[{title: '序号', width: 60, templet: function (d) {return d.LAY_TABLE_INDEX + 1;}},{field: "systemType", title: "平台", width: 100, sort: false,},{field: "applyOrderDetailId", title: "工单号", minWidth: 70, sort: false},{field: "createTime", title: "申请时间", minWidth: 60, sort: false},{field: "applyUserName", title: "申请人", width: 100, sort: false},{field: "dealState", title: "状态", width: 100, sort: false, templet: function (d) {if (d.dealState == 0) {return "未开启";} else if (d.dealState == 1) {return "流程中";} else if (d.dealState == 2) {return "已完成";} else{return "未知(" + d.applyStatus + ")";}}},{field: "", title: "操作", minWidth: 200, toolbar: '#startFlowTableBar',}]];layui.use(['table', 'form'], function (exports) {var table = layui.table;table.render({elem: '#searchTable',url: 'http://localhost:8080/getStartList',page: true,     //显示分页默认不显示cols: headerObj,// request: {//     pageName: 'page',//     limitName: 'limit'// },// where: {//     applyStatus: $("#applyStatus").val()// },response: {statusName: 'status',statusCode: 'normal',countName: 'count',dataName: 'data'},parseData: function (res) {console.log("+++",res)return {"count": res.data.total,"data": res.data.list,"status": "normal"};}});//table操作事件table.on('tool(searchTable)', function (row) {var data = row.data;var layEvent = row.event;var tr = row.tr;if (layEvent == 'level2Check') {initStartFlowView(data);} else if (layEvent == 'showDetailEvent') {// showDetailView(data)ajax_load_detail(data)}else if (layEvent == 'showFlowEvent'){ajax_load_flow(data)}});//搜索按钮$('#searchBtn').on('click', function () {var moduleType = $("#moduleType").val();var applyStatus = $("#applyStatus").val();var applyDateTimeRange = $("#applyDateTimeRange").val();table.reload('searchTable', {page: {curr: 1 //重新从第 1 页开始},where: {moduleType: moduleType,applyStatus: applyStatus,applyDateTimeRange: applyDateTimeRange}});});});
}//开启流程
function initStartFlowView(data) {console.log("开启流程操作",data)var resApplyId = data.applyOrderDetailId;layui.use(['layer', 'laytpl', 'form', 'table'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var tplHtml = startFlow.innerHTML;// console.log("---------",tplHtml)var index;laytpl(tplHtml).render({}, function (html) {index = layer.open({type: 1,title: '开启流程',area: ['800px', '700px'],offset: 'auto',maxmin: true,content: html});form.render();});// test();initInputView()form.on('submit(startFormBtn)', function (data) {console.log("获取到监听事件")// jsonToObject(data,processData.data.length)var jsonStr = initFlowData(data,resApplyId,processData)console.log("获取全局数据",processData)console.log(jsonStr)$.ajax({url: "http://localhost:8080/startTask",type: "POST",dataType: "json",contentType:"application/json",data:jsonStr,success: function (data) {console.log(data)if (data.msg == 'NORMAL') {layer.msg("审批成功");table.reload("searchTable", {});layer.close(index);} else {layer.msg();}}});return false;});});
}// 展示详情
function showDetailView(data) {console.log("data",data)var resApplyId = data.resApplyId;var moduleType = data.moduleType;layui.use(['layer', 'laytpl', 'form', 'table'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var tplHtml = insertFormTpl.innerHTML;var index;laytpl(tplHtml).render({}, function (html) {index = layer.open({type: 1,title: '展示详情',area: ['600px', '310px'],offset: 'auto',maxmin: true,content: html});form.render();});form.on('submit(insertFormBtn)', function (data) {console.log("获取到监听事件")$.ajax({url: "http://localhost:8080/getApplyOrderDetail?orderId=" + resApplyId,type: "POST",dataType: "json",data: {moduleType: moduleType,checkResult: data.field.checkResult,description: data.field.description},success: function (data) {if (data.status == 'normal') {layer.msg("审批成功");table.reload("searchTable", {});layer.close(index);} else {layer.msg(data.exception.error_msg || '审批失败!');}}});return false;});});
}function ajax_load_detail(data) {var resApplyId = data.applyOrderDetailId;$.ajax({url: "http://localhost:8080/getApplyOrderDetail?orderId=" + resApplyId,type: "GET",dataType: "json",success: function (data_r) {console.log("+++++++" + data_r)console.log("====" + JSON.stringify(data_r))if (data_r.msg == 'NORMAL') {layui.use(['layer', 'laytpl', 'form', 'table'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var tplHtml = detailHtml.innerHTML;laytpl(tplHtml).render({}, function (html) {index = layer.open({type: 1,title: '展示详情',area: ['600px', '310px'],offset: 'auto',maxmin: true,content: html});form.render();});//TODO 设置每个字段对应的值form.val("showApplyDetail", {"applyOrderDetailId": data_r.data.applyOrderDetailId,"applyOrderDetail": data_r.data.applyOrderDetail})})} else {layer.msg();}}});
}function ajax_load_flow(data) {initFlow(data)// layui.use(['layer', 'laytpl', 'form', 'table'], function () {//     var layer = layui.layer;//     var form = layui.form;//     var laytpl = layui.laytpl;//     var table = layui.table;////     var tplHtml = showFlow.innerHTML;//     // console.log("---------",tplHtml)////     var index;//     laytpl(tplHtml).render({}, function (html) {//         index = layer.open({//             type: 1,//             title: '开启流程',//             area: ['800px', '700px'],//             offset: 'auto',//             maxmin: true,//             content: html//         });//         form.render();//     });//     initFlow(data)// });}function initFlow(data_p) {var resApplyId = data_p.applyOrderDetailId;$.ajax({url: "http://localhost:8080/getApprovalFlowDetail?applyId=" + resApplyId,type: "GET",dataType: "json",success: function (data) {console.log("+++++++" + data)console.log("====" + JSON.stringify(data))initApplyFlowView(data.data)//// //遍历List// for (var i = 0; i < data.data.length; i++) {//     //根据属性List拼接LayUI风格的input代码//     str = "<div class='layui-form-item'><label class='layui-form-label'>"//         + data.data[i].currentNodeDealId//         + "</label><div class='layui-input-block'><input type='text' id='"//         + data.data[i].approvalPersonName//         + "' name='"//         + data.data[i].approvalPersonName//         + "' placeholder='"//         + data.data[i].approvalPersonNote//         + "' class='layui-input'></div></div>"////     //追加到界面,property是后面div的id<div class="user_left" id="property">//     var html = document.getElementById("showPerson").innerHTML;//     document.getElementById("showPerson").innerHTML = html + str;// }}});}function test() {var jsonData ="[{\"propertyShow\":\"一级审批\",\"propertyName\":\"test\",\"propertyTips\":\"test\"},{\"propertyShow\":\"二级审批\",\"propertyName\":\"test\",\"propertyTips\":\"test\"},{\n" +"\"propertyShow\":\"三级审批\",\"propertyName\":\"test\",\"propertyTips\":\"test\"}]"var data = JSON.parse(jsonData)//遍历Listfor (var i = 0; i < data.length; i++) {//根据属性List拼接LayUI风格的input代码str = "<div class='layui-form-item'><label class='layui-form-label'>"+ data[i].propertyShow+ "</label><div class='layui-input-block'><input type='text' id='"+ data[i].propertyName+ "' name='"+ data[i].propertyName+ "' placeholder='"+ data[i].propertyTips+ "' class='layui-input'></div></div>"//追加到界面,property是后面div的id<div class="user_left" id="property">// var html = document.getElementById("property").innerHTML;// document.getElementById("property").innerHTML = html + str;// var html = property.innerHTML;// property.innerHTML = html + str;var html = document.getElementById("selectPerson").innerHTML;document.getElementById("selectPerson").innerHTML=html+str;}}function initInputView() {$.ajax({   //获取属性List<Map>数据return data_r;type: "get",url: "http://localhost:8080/getProcess",dataType: "json",success: function (data) {//遍历ListloadData(data)for (var i = 0; i < data.data.length; i++) {//根据属性List拼接LayUI风格的input代码str = "<div class='layui-form-item'>" +"<label class='layui-form-label'>"+ data.data[i].nodeName + "</label>" +"<div class='layui-input-block'>" +"<input type='text' id='"+data.data[i].nodeId +"' name='"+"no"+data.data[i].nodeOrder+ "' placeholder='"+ "审批人域账户" + "' class='layui-input'>" +"</div>" +"</div>"//追加到界面,property是后面div的id<div class="user_left" id="property">var html = document.getElementById("selectPerson").innerHTML;document.getElementById("selectPerson").innerHTML = html + str;}}});}function loadData(data) {processData = data;return data;
}function jsonToObject(data ,len,applyOrderDetailId,process) {var object = {};var params = [];console.log("开始进入方法")for(var i = 0; i < len; i++){console.log("组装数据")var obj = {};console.log(i)switch (i) {case 0:obj["approvalOrder"] = process[0].nodeOrder ;obj["approvalUserName"] = data.field.no1;obj["nodeId"] = process[0].nodeId;params.push(obj);console.log(i)continue;case 1:obj["approvalOrder"] = process[1].nodeOrder;obj["approvalUserName"] = data.field.no2;obj["nodeId"] = process[1].nodeId;params.push(obj);console.log(i)continue;case 2:obj["approvalOrder"] = process[2].nodeOrder;obj["approvalUserName"] = data.field.no3;obj["nodeId"] = process[2].nodeId;params.push(obj);console.log(i)continue;case 3:obj["approvalOrder"] = process[3].nodeOrder;obj["approvalUserName"] = data.field.no4;obj["nodeId"] = process[3].nodeId;params.push(obj);console.log(i)continue;case 4:obj["approvalOrder"] = process[4].nodeOrder;obj["approvalUserName"] = data.field.no5;obj["nodeId"] = process[4].nodeId;params.push(obj);console.log(i)continue;}}object['applyId'] = applyOrderDetailId;object['processId'] = process[0].processId;object['approvalUserVoList'] = params;var json = JSON.stringify(object);// console.log(json);return json;
}function initFlowData(data,applyOrderDetailId,process){return jsonToObject(data ,process.data.length ,applyOrderDetailId,process.data)
}//表单提交时调用的验证及提交方法
function check() {var data = new FormData($("#addForm")[0]); //获取表单数据,addForm是表单idconsole.log(data)// if ($("#title").val() == '') {//     alert("请填写完整信息");// } else {//     $.ajax({//         type: "POST",//         url: getURL("insert"),//         data: new FormData($("#addForm")[0]),   //获取表单数据,addForm是表单id//         processData: false,//         contentType: false,//         success: function (data) {//             alert(data)//             if (data == 'success') {//                 $("input[type=reset]").trigger("click");    //清空表单//             }//         }//     })// }
}function reload_data() {layui.use(['table'], function () {var table = layui.table;table.reload("searchTable", {});});
}function applyFlowView(data) {var resApplyId = data.applyId;$.ajax({//TODO1 填写流程进度请求地址url: "/v1/devTool/codeAuth/apply/flow",type: "GET",dataType: "json",data: {resApplyId: resApplyId},success: function (data) {if (data.status == 'normal') {initApplyFlowView(data.response);} else {layer.msg(data.exception.error_msg || '获取表结构失败!');}}});
}function initApplyFlowView(applyFlows) {layui.use(['layer', 'laytpl'], function () {var layer = layui.layer;var form = layui.form;var laytpl = layui.laytpl;var table = layui.table;var applyFlowTplHtml = "";applyFlowTplHtml += '<div class="x-body">';applyFlowTplHtml += '<ul class="layui-timeline">';$.each(applyFlows, function (index, step) {applyFlowTplHtml += '<li class="layui-timeline-item">';applyFlowTplHtml += '<i class="layui-icon layui-timeline-axis">&#xe63f;</i>';applyFlowTplHtml += '<div class="layui-timeline-content layui-text">';var title ="处理人: " + step.approvalPersonName+" - "+ "处理时间 "+step.lastUpdateTimeapplyFlowTplHtml += '<h3 class="layui-timeline-title">' + title + '</h3>';applyFlowTplHtml += '<p>';applyFlowTplHtml += (step.approvalPersonNote);applyFlowTplHtml += '</p>';applyFlowTplHtml += '</div>';applyFlowTplHtml += '</li>';});applyFlowTplHtml += '</ul>';applyFlowTplHtml += '</div>';var index;laytpl(applyFlowTplHtml).render({}, function (html) {index = layer.open({type: 1,title: '申请进度查询',area: ['700px', '510px'],offset: 'auto',maxmin: true,content: html});});});
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/698040.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【spring】 ApplicationListener的使用及原理简析

文章目录 使用示例&#xff1a;原理简析&#xff1a; 前言&#xff1a;ApplicationListener 是spring提供的一个监听器&#xff0c;它可以实现一个简单的发布-订阅功能&#xff0c;用有点外行但最简单通俗的话来解释&#xff1a;监听到主业务在执行到了某个节点之后&#xff0c…

Elasticsearch中可避免的坑

版本定位&#xff1a;7.x 总结的坑&#xff1a; term及terms词条查询时&#xff0c;如果有text及keyword类型&#xff0c;则需加.keywordqueryString全字段搜索时&#xff0c;最好指定字段&#xff1b;并要提前设置好字段mapping&#xff1a;keyword并指定分词器。reindex做数…

【ACM出版】第五届计算机信息和大数据应用国际学术会议(CIBDA 2024)

第五届计算机信息和大数据应用国际学术会议&#xff08;CIBDA 2024&#xff09; 2024 5th International Conference on Computer Information and Big Data Applications 重要信息 大会官网&#xff1a;www.ic-cibda.org 大会时间&#xff1a;2024年3月22-24日 大会地点&#…

Atcoder ABC341 A-D题解

比赛链接:ABC341 Problem A: 先签个到。 #include <bits/stdc.h> using namespace std; int main() {int n;cin>>n;for(int i0;i<n;i)cout<<"10"<<endl;cout<<"1"<<endl;return 0; } Problem B: 继续签。 #i…

week04day03(爬虫 beautifulsoup4、)

一. 使用bs4解析网页 下载bs4 - pip install beautifulsoup4 使用的时候 import bs4专门用于解析网页的第三方库 在使用bs4的时候往往会依赖另一个库lxml pip install lxml 网页代码 <!DOCTYPE html> <html><head><meta charset"utf-8"><…

【Python笔记-设计模式】对象池模式

一、说明 用于管理对象的生命周期&#xff0c;重用已经创建的对象&#xff0c;从而减少资源消耗和创建对象的开销 (一) 解决问题 主要解决频繁创建和销毁对象所带来的性能开销问题。如数据库连接、线程管理、网络连接等&#xff0c;对象的创建和销毁成本相对较高&#xff0c…

冬眠...

链接&#xff1a;登录—专业IT笔试面试备考平台_牛客网 来源&#xff1a;牛客网 阿宁生活在一个 nnn 行 mmm 列的字符矩阵中&#xff0c;阿宁打算在第 xxx 行 yyy 列冬眠。 在每一天&#xff0c;都会有 qqq 次行循环移动或列循环移动。 如果是第 zzz 行循环移动&#xff0c;…

IC卡批量加密软件使用

IC卡出厂是默认的密码FFFFFFFFFFFF空白卡&#xff0c;IC卡在门禁、电梯、食堂消费、洗浴一卡通等系统上使用前是需要初始化的&#xff0c;即加密的同时写入基础数据。 为什么要用批量加密软件呢&#xff0c;以为需要加密的卡有几百张&#xff0c;几千张&#xff0c;数量比较多&…

shiro 整合 springmvc 实战及源码详解

序言 前面我们学习了如下内容&#xff1a; 5 分钟入门 shiro 安全框架实战笔记 shiro 整合 spring 实战及源码详解 相信大家对于 shiro 已经有了最基本的认识&#xff0c;这一节我们一起来学习写如何将 shiro 与 springmvc 进行整合。 spring mvc 整合源码 maven 依赖 版…

水务界的“数字蝶变”:水务公司重构自我,开启智慧供水新时代

历经六十余载的稳健前行&#xff0c;某水务公司已发展成为国有一档企业中的供水行业佼佼者&#xff0c;不仅主营业务突出&#xff0c;更拥有完善的产业链条。然而&#xff0c;面对供水业务24小时连续作业的高要求&#xff0c;以及业务管理需求的日益复杂化&#xff0c;公司意识…

Qt中添加Mysql驱动

qt连接mysql报错&#xff1a;QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7 - №点缀 - 博客园 (cnblogs.com)

【Django开发】0到1开发美多shop项目:Celery短信和用户注册。全md文档笔记(附代码,已分享)

本系列文章md笔记&#xff08;已分享&#xff09;主要讨论django商城项目开发相关知识。本项目利用Django框架开发一套前后端不分离的商城项目&#xff08;4.0版本&#xff09;含代码和文档。功能包括前后端不分离&#xff0c;方便SEO。采用Django Jinja2模板引擎 Vue.js实现…

Python网络爬虫实战:从入门到进阶

Python网络爬虫是一种自动化程序&#xff0c;用于从互联网上抓取、解析和提取数据。这种技术广泛应用于数据分析、机器学习、搜索引擎优化等领域。下面是一个Python网络爬虫的入门到进阶的实战指南&#xff1a; 入门篇 环境准备 安装Python和pip安装必要的库&#xff1a;reque…

突破编程_C++_高级教程(内存管理(1))

1 内存管理基础 C 的内存管理主要涉及如何分配、使用和释放计算机内存&#xff0c;以确保程序的正确运行和性能优化。其重要任务是避免内存泄漏和野指针等问题。 C 的内存管理是一个涉及多个方面和复杂概念的重要主题。正确地管理内存对于编写高效、稳定和安全的程序至关重要。…

网页403错误(Spring Security报异常 Encoded password does not look like BCrypt)

这个错误通常表现为"403 Forbidden"或"HTTP Status 403"&#xff0c;它指的是访问资源被服务器理解但拒绝授权。换句话说&#xff0c;服务器可以理解你请求看到的页面&#xff0c;但它拒绝给你权限。 也就是说很可能测试给定的参数有问题&#xff0c;后端…

学习Redis基础篇

1.初识Redis 1.认识NoSQL 2.认识Redis 3.连接redis命令 4.数据结构的介绍 5.通用命令 2.数据类型 1.String类型 常见命令&#xff1a;例子&#xff1a;set key value

Vue3实现页面顶部进度条

Vue3页面增加进度条 新建进度条组件新建bar.ts导航守卫中使用 Vue3项目使用导航守卫给页面增加进度条 新建进度条组件 loadingBar.vue <template><div class"wraps"><div ref"bar" class"bar"></div></div> <…

VSCODE上使用python_Django_创建最小项目

接上篇 https://blog.csdn.net/weixin_44741835/article/details/136135996?csdn_share_tail%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22136135996%22%2C%22source%22%3A%22weixin_44741835%22%7D VSCODE官网&#xff1a; Editing Python …

精酿啤酒:麦芽与啤酒花搭配的奥秘

麦芽和啤酒花是啤酒酿造过程中不可或缺的原料&#xff0c;它们的风味和特点对啤酒的口感和品质产生着深远的影响。Fendi Club啤酒在麦芽与啤酒花的搭配方面有着与众不同的技巧和见解&#xff0c;让啤酒的口感更加丰富和迷人。 首先&#xff0c;麦芽的选择是啤酒酿造的关键之一。…

mysql之CRUD常见函数union查询

select select * from c insert 字段设置自增后&#xff0c;当我们指定增加一条数据后&#xff0c;往后增加的数据都会在该条数据后进行递增&#xff0c;但是可以认为的指定增加某条id不存在的数据 insert into c values(7,‘政治’) insert into c(c2) values(‘历史1’),(…