var ids = ''; $(function() { // agreementInfo(); layui.use('laydate', function(){ var laydate = layui.laydate; //日期时间选择器 laydate.render({ elem: '#startTime', done:function (data) { var endTime=$("#endTime").val(); if(data>endTime && endTime!=''){ layer.msg("开始时间不能大于结束时间"); $("#startTime").val(''); } } }); laydate.render({ elem: '#endTime', done:function (data) { var startTime=$("#startTime").val(); if(data 0) { var leng = (pageNum - 1) * pageSize; for (var i = 0; i < results.length; i++) { var l = results[i]; html += ""; html += ""; html += "" + (i + leng + 1) + ""; html += ""+ JY.Object.notEmpty(l.agreeCode) + ""; html += ""+ JY.Object.notEmpty(l.unitName) + ""; html += ""+ JY.Object.notEmpty(l.projectName) + ""; html += ""+ JY.Object.notEmpty(l.companyName) + ""; html += ""+ JY.Object.notEmpty(l.number) + ""; html += ""+ JY.Object.notEmpty(l.typeName) + ""; html += ""+ JY.Object.notEmpty(l.modelName) + ""; html += ""+ JY.Object.notEmpty(l.maNum) + ""; html += ""+ JY.Object.notEmpty(l.leasePerson) + ""; html += ""+ JY.Object.notEmpty(l.operator) + ""; html += ""+ JY.Object.notEmpty(l.operationTime) + ""; if(l.isApproval==0 || l.isApproval=='0'){ html += "未批准"; }else if(l.isApproval==1 || l.isApproval=='1'){ html += "已通过"; }else{ html += "未通过"; } html += rowFunction(l.id,l.taskId,l.modelId,l.maNum,l.isApproval,l.checkerId,l.agreementId); html += ""; } $("#baseTable tbody").append(html); JY.Page.setPage("baseForm", "pageing", pageSize,pageNum, totalRecord, "getbaseList"); } else { html += "没有相关数据"; $("#baseTable tbody").append(html); $("#pageing ul").empty();// 清空分页 } JY.Model.loadingClose(); }); } /** * @author 守约 * @date 2020-10-12 * @function 查询ids * @returns */ function backShowChenkStatus(){ ids = ""; $('input[type=checkbox]:checked').each(function(){ var id = $(this).val(); var taskId = $(this).next().val(); if(taskId ===undefined){ }else{ var modelId = $(this).next().next().val(); var checkerId = $(this).next().next().next().val(); var allId = id+","+taskId+","+modelId+","+checkerId; console.log("allId=",allId); ids += allId+"-"; } console.log("ids=",JSON.stringify(ids)); }) } /** * @author 守约 * @date 2020-10-12 * @function 生成字符串数组 * @returns */ function getIdsString(){ var idsArr = []; var idsStr = ""; for ( var property in ids){ if(idsStr == ""){ idsStr = property; } else { idsStr += ","+property; } idsArr.push(idsStr); } return idsArr; } function batchAudit() { backShowChenkStatus(); //var idsStr = getIdsString(); var idsStr = ids; if(idsStr == "" ){ layer.msg("请选择想要审核的信息!",{icon:7,time:2000}); return; } console.log("idsStr=",idsStr); var idx = layer.msg('审核申请提交中,请稍等...', { icon: 16 ,shade: 0.01 ,time:'-1' }); var data = { ids:idsStr } $.ajax({ type:'POST', url:bonuspath+'/backstage/audit/batchApproval', async:true, data:data, success:function(data) { data = JSON.parse(data); layer.msg("审核提交成功!",{icon:1,time:2000},function(){ ids = ''; getbaseList(1); }); layer.close(idx); }, error:function(data){ layer.msg("审核提交失败!",{icon:2,time:2000}); layer.close(idx); } }); } function rowFunction(id,taskId,modelId,maNum,isApproval,checkerId,agreementId) { var h = ""; h += ""; h += ""; h += ""; h += ""; return h; } function check(id,taskId,modelId,maNum,checkerId) { JY.Model.confirm("确认批准吗?", function() { JY.Ajax.doRequest(null, bonuspath + '/backstage/audit/isApproval', { taskId:taskId, modelId:modelId, maNum:maNum, id:id, checkerId:checkerId }, function(data) { JY.Model.info(data.resMsg, function() { search(); getbaseList(1); }); }); }); } function cancelCheck(id,taskId,modelId,maNum,agreementId) { console.info("taskId"+taskId+"modelId"+modelId+"maNum"+maNum+"id"+id+"agreementId"+agreementId) JY.Model.edit("auDiv", "批准驳回", function() { var that = $(this); if (JY.Validate.form("auForm")) { var approvalRemark = $("#remarks").val(); JY.Model.confirm("确认批准驳回吗?", function() { JY.Ajax.doRequest(null, bonuspath + '/backstage/audit/putCancelApproval', { taskId:taskId, modelId:modelId, maNum:maNum, id:id, agreementId:agreementId, approvalRemark:approvalRemark }, function(data) { JY.Model.info(data.resMsg, function() { search(); getbaseList(1); }); }); }); } that.dialog("close"); }); } function setForm(data) { var l = data.obj; $("#auForm input[name$='id']").val(l.id); $("#auForm input[name$='contractNumber']").val(JY.Object.notEmpty(l.contractNumber)); $("#auForm input[name$='startTime']").val(JY.Object.notEmpty(l.startTime)); $("#auForm input[name$='leaseTerm']").val(JY.Object.notEmpty(l.leaseTerm)); $("#auForm input[name$='advanceCharge']").val(JY.Object.notEmpty(l.advanceCharge)); $("#auForm input[name$='authorizingPerson']").val(JY.Object.notEmpty(l.authorizingPerson)); $("#auForm input[name$='authorizingPhone']").val(JY.Object.notEmpty(l.authorizingPhone)); $("#auForm input[name$='remark']").val(JY.Object.notEmpty(l.remark)); } function cleanForm() { JY.Tags.isValid("auForm", "1"); JY.Tags.cleanForm("auForm"); $("#auForm input[name$='id']").val('0');// 上级资源 $("#auForm input[name$='projectName']").val(''); $("#auForm input[name$='startTime']").val(''); $("#auForm input[name$='leaseTerm']").val(''); $("#auForm input[name$='advanceCharge']").val(''); $("#auForm input[name$='authorizingPerson']").val(''); $("#auForm input[name$='authorizingPhone']").val(''); $("#auForm input[name$='remark']").val(''); hideRole(); } function search() { $("#searchBtn").trigger("click"); } function details(id){ localStorage.setItem("taskId",id); //iframe层-父子操作 layer.open({ type: 2, title:['协议明细','background-color: #27A3D9;color:#fff'], shadeClose:true, shade:false, maxmin: true, area: ['1000px', '600px'], content:bonuspath + '/backstage/agreementDetails/list' }); }