let form, laydate, layer; let objParams = {}; function setParams(obj) { objParams = JSON.parse(obj); console.log(objParams); layui.use(["form", 'layer'], function () { form = layui.form; layer = layui.layer; form.on('radio', function (data) { if (data.value === '1') { if ($('#measures').length === 0) { setMeasures(); } } else { $('#measures').remove(); } }); form.on('submit(formData)', function (data) { submitApply(data); }); layui.form.render(); }); $('.content-info').eq(0).append('

' + objParams.createTime + '

'); $('.content-info').eq(1).append('

今日无作业票

'); $('.content-info').eq(2).append('

现场有人员逗留,请确认!

'); if (objParams.isSure === '1') { $('#statusItem').remove(); $('#measures').remove(); $('#save').remove(); $('#lastContent-info').after('

已确认

处置措施:' + objParams.remark + '

'); } else if (objParams.isSure === '2') { $('#statusItem').remove(); $('#measures').remove(); $('#save').remove(); $('#lastContent-info').after('

系统误判

'); } let filePath = imgUrl + objParams.image + "?token=" + sessionStorage.getItem("zhgd_token"); $('#img-show').find('img').attr('src', filePath); } function setMeasures() { let html = '
' + '' + '
' + '' + '
' + '
'; $('#statusItem').after(html); } function saveData2() { $('#formSubmit').trigger('click') } // 保存数据 function submitApply(data) { let field = data.field; // 获取表单字段值 field.id = objParams.id; const url = commonUrl + "screen/largeScreen/constrDisplay/updateImage"; let encryptStr = encryptCBC(JSON.stringify(field)); let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' }); ajaxRequest(url, "POST", encryptStr, true, function () { }, function (result) { layer.close(loadingMsg); // 关闭提示层 if (result.code === 200) { parent.layer.msg(result.msg, { icon: 1, offset: 't' }); closePage(1); } else if (result.code === 500) { layer.msg(result.msg, { icon: 2 }); } else if (result.code === 401) { loginout(1) } }, function (xhr) { layer.close(loadingMsg); // 关闭提示层 error(xhr) }, "application/json", aqEnnable); } // 关闭页面 function closePage(type) { let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引 if (type == 1) { objParams.remark = $('#remark').val(); objParams.isSure = $('input[name="isSure"]:checked').val(); window.parent.changeData(JSON.stringify(objParams)); } parent.layer.close(index); // 再执行关闭 }