123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <title>基础任务检查项</title>
- <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
- <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
- <!--<link rel="stylesheet" href="../../../assets/module/ztree/css/metroStyle/metroStyle.css"/>-->
- <link rel="stylesheet" href="../../../assets/module/icon/icon.css" media="all">
- <link rel="stylesheet" href="../../../assets/module/icon/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
- <style>
- /*@media screen and (max-width: 750px) {*/
- /*#treeTbTree {*/
- /*height: auto;*/
- /*}*/
- /*}*/
- /*.ztree *{*/
- /*font-size: 14px!important;*/
- /*}*/
- /*.ztree li{*/
- /*line-height: 22px!important;*/
- /*}*/
- /*.ztree li span.button.switch{*/
- /*width:22px!important;*/
- /*height:28px!important;*/
- /*}*/
- /*.hide {*/
- /*display: none;*/
- /*}*/
- </style>
- </head>
- <body>
- <!-- 页面加载loading -->
- <div class="page-loading">
- <div class="ball-loader">
- <span></span><span></span><span></span><span></span>
- </div>
- </div>
- <!-- 正文开始 -->
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <!-- 右栏 -->
- <div class="layui-col-sm12 layui-col-md11 layui-col-lg12">
- <div class="layui-card">
- <div class="layui-card-body">
- <div class="layui-form toolbar">
- <!--检查表数据-->
- <span class="text-left font-weight font-size-16 checkDefName"></span>
- <div class="layui-form-item text-right">
- <div class="layui-inline pull-left">
- <span class=" font-weight layui-badge bg-c-add font-size-14 scheduleCurrentCount"></span>
- <!--检查统计开始-->
- <span class="m-left20px ">
- <!--存在隐患-->
- <i class="fa fa-exclamation-triangle c-orange" aria-hidden="true"></i>
- <span class="font-weight c-orange CZYHhcount"></span>
- </span>
- <span class="m-left20px">
- <!--通过-->
- <i class="fa fa-check-circle c-update"></i>
- <span class="font-weight c-update JCTGcount"></span>
- </span>
- <span class="m-left20px">
- <!--不通过-->
- <i class="fa fa-times-circle c-submit" aria-hidden="true"></i>
- <span class="font-weight c-submit JCBTGcount"></span>
- </span>
- <span class="m-left20px ">
- <!--不涉及-->
- <i class="fa fa-ban c-back" aria-hidden="true"></i>
- <span class="font-weight c-back BSJcount"></span>
- </span>
- <span class="m-left20px">
- <!--未检查-->
- <i class="fa fa-minus-circle c-add" aria-hidden="true"></i>
- <span class="font-weight c-add WJCcount"></span>
- </span>
- <span class="m-left20px">
- <!--合计-->
- <!-- <i class="fa fa-minus-circle" aria-hidden="true"></i>-->
- <span class="font-weight CHECKSUM"></span>
- </span>
- <!--检查统计结束-->
- </div>
- <div class="layui-inline">
- <button id="checkedAll" class="layui-btn icon-btn layui-btn-sm bg-c-update">全部通过
- </button>
- </div>
- <div class="layui-inline">
- <button id="selectedCheckedAll" class="layui-btn icon-btn layui-btn-sm bg-c-update">通过
- </button>
- </div>
- <div class="layui-inline">
- <button id="selectedCheckedNotAll" class="layui-btn icon-btn layui-btn-sm bg-c-submit">
- 不通过
- </button>
- </div>
- <div class="layui-inline">
- <button id="exclusiveCheckedAll" class="layui-btn icon-btn layui-btn-sm bg-c-back">不涉及
- </button>
- </div>
- <div class="layui-inline">
- <button id="cancelAll" class="layui-btn icon-btn layui-btn-sm bg-c-back">取消选中</button>
- </div>
- <div class="layui-inline">
- <button id="finishCheck" class="layui-btn icon-btn layui-btn-sm bg-c-orange">检查完成
- </button>
- </div>
- <div class="layui-inline">
- <button id="back" class="layui-btn icon-btn layui-btn-sm bg-c-back">返回</button>
- </div>
- </div>
- </div>
- <table class="layui-table" id="tableMenu" lay-filter="tableMenu">
- </table>
- <!--<div class="layui-progress" lay-showpercent="true" lay-filter="demo">-->
- <!--<div class="layui-progress-bar check-progress-bar" lay-percent="5 / 10"></div>-->
- <!--</div>-->
- </div>
- </div>
- </div>
- </div>
- </div>
- <!--提交隐患弹框-->
- <script type="text/html" id="modelTpl">
- <form id="modelForm" lay-filter="modelForm" class="layui-form model-form">
- <div class="" style="overflow: scroll;margin-left: 10%;height: 573px;">
- <input type="hidden" class="layui-input" id="bizCheckDefType" name="bizCheckDefType" value="1"/>
- <input type="hidden" class="layui-input" id="isScheduleCheck" name="isScheduleCheck"/>
- <input type="hidden" class="layui-input" id="riskPointId" name="riskPointId"/>
- <input type="hidden" class="layui-input" id="bizCheckDefId" name="bizCheckDefId"/>
- <input type="hidden" class="layui-input" id="scheduleId" name="scheduleId"/>
- <input type="hidden" class="layui-input" id="checkRecordNo" name="checkRecordNo"/>
- <input type="hidden" class="layui-input" id="scheduleCurrentCount" name="checkNumber"/>
- <input type="hidden" class="layui-input" id="totalCheckCount" name="totalCheckCount"/>
- <input type="hidden" class="layui-input" id="checkRecordLogId" name="checkRecordLogId"/>
- <input type="hidden" class="layui-input" id="checkContentId" name="checkContentId"/>
- <div class="layui-form-item layui-row">
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 隐患标题
- </label>
- <div class="layui-input-block ">
- <input type="text" class="layui-input" id="hdangerTitle" name="hdangerTitle" placeholder="请输入标题"
- maxlength="64"
- lay-verType="tips" lay-verify="required"/>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 隐患类型
- </label>
- <div class="layui-input-block">
- <select name="hdangerCatId" id="hdangerCatId" lay-verType="tips" lay-verify="required"
- class="layui-input-block ">
- </select>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label " style="width: 110px;">
- <span class="layui-badge-dot"></span> 隐患等级
- </label>
- <div class="layui-input-block">
- <select id="hdangerLevel" name="hdangerLevel" lay-filter="layuiForm" lay-verType="tips"
- lay-verify="required"
- class="layui-input-block ">
- <option value="">点击选择</option>
- </select>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 整改期限</label>
- <div class="layui-input-block">
- <input type="text" name="hdangerRetifyDeadline" id="hdangerRetifyDeadline"
- placeholder="选择整改期限"
- lay-verType="tips" lay-verify="required" class="layui-input" readonly>
- </div>
- </div>
- <div class="hdanger-review">
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 评审部门</label>
- <div class="layui-input-block">
- <input type="text" id="hdangerReviewGroupName"
- class="layui-input work-flow-review-group-hint" name="hdangerReviewGroupName"
- value=""
- placeholder="点击选择部门"
- class="form-control" readonly>
- <input type="hidden" id="hdangerReviewGroup" name="hdangerReviewGroup" readonly>
- <div id="menuContentReview" class="menuContent">
- <ul id="threeLevelGroupReview" class="ztree" style="margin-top:0;"></ul>
- </div>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 评审人员</label>
- <div class="layui-input-block">
- <select id="hdangerReviewBy" name="hdangerReviewBy"
- class="layui-input-block work-flow-review-group-hint">
- <option value="">点击选择人员</option>
- </select>
- </div>
- </div>
- </div>
- <div class="hdanger-retify">
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 整改部门</label>
- <div class="layui-input-block">
- <input type="text" id="hdangerRetifyGroupName"
- class="layui-input work-flow-retify-group-hint" name="hdangerRetifyGroupName"
- value=""
- placeholder="点击选择部门"
- class="form-control" readonly>
- <input type="hidden" id="hdangerRetifyGroup" name="hdangerRetifyGroup" readonly>
- <div id="menuContentRetify" class="menuContent">
- <ul id="threeLevelGroupRetify" class="ztree" style="margin-top:0;"></ul>
- </div>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label " style="width: 110px;">
- <span class="layui-badge-dot"></span> 整改人员</label>
- <div class="layui-input-block">
- <select id="hdangerRetifyBy" name="hdangerRetifyBy"
- class="layui-input-block work-flow-retify-group-hint"
- lay-filter="layuiFormRetify">
- <option value="">点击选择人员</option>
- </select>
- </div>
- </div>
- </div>
- <div class="hdanger-accepted">
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 验收部门</label>
- <div class="layui-input-block">
- <input type="text" id="hdangerAcceptedGroupName"
- class="layui-input work-flow-accepted-group-hint" name="hdangerAcceptedGroupName"
- value=""
- placeholder="点击选择部门"
- class="form-control" readonly>
- <input type="hidden" id="hdangerAcceptedGroup" name="hdangerAcceptedGroup" readonly>
- <div id="menuContentAccepted" class="menuContent">
- <ul id="threeLevelGroupAccepted" class="ztree" style="margin-top:0;"></ul>
- </div>
- </div>
- </div>
- <div class="layui-inline layui-col-md5 p-top10px">
- <label class="layui-form-label" style="width: 110px;">
- <span class="layui-badge-dot"></span> 验收人员</label>
- <div class="layui-input-block">
- <select id="hdangerAcceptedBy" name="hdangerAcceptedBy"
- class="layui-input-block work-flow-accepted-group-hint"
- >
- <option value="">点击选择人员</option>
- </select>
- </div>
- </div>
- </div>
- <div class="layui-inline layui-col-md10 p-top10px">
- <label class="layui-form-label" style="width: 110px;">现场描述</label>
- <div class="layui-input-block">
- <textarea class="layui-textarea" lay-verType="tips" placeholder="请输入描述"
- id="hdangerDesc" name="hdangerDesc" maxlength="500"
- style="height: 60px;"></textarea>
- </div>
- </div>
- <!--附件-->
- <div class="layui-inline layui-col-md10 p-top10px">
- <label class="layui-form-label" style="width: 110px;">现场照片</label>
- <div class="layui-input-block text-left">
- <button type="button" class="layui-btn" id="test1">
- <i class="layui-icon"></i>上传照片
- </button>
- <span style="color: indianred;font-size: 16px;">支持图片格式:jpg / png / gif / jpeg</span>
- <input type="hidden" name="attachPathVal" id="attachPathVal"/>
- <div id="fileDiv" style="padding-top: 10px;"></div>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form-item text-right" style="z-index: 3">
- <button type="button" class="layui-btn layui-btn-sm bg-c-add" lay-filter="formSave" lay-submit>暂存</button>
- <button type="button" class="layui-btn layui-btn-sm bg-c-submit" lay-filter="formSubmit" lay-submit>提交
- </button>
- </div>
- </form>
- </script>
- <!-- js部分 -->
- <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
- <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
- <script type="text/javascript" src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
- <script>
- var CHECK_RESULT_WJC = 0; //未检查
- var CHECK_RESULT_TG = 1; //通过
- var CHECK_RESULT_BTG = 2; //不通过
- var CHECK_RESULT_CZYH = 3; //存在隐患
- var CHECK_RESULT_BSJ = 4; //不涉及
- layui.use(['iconPicker', 'layer', 'element', 'form', 'upload', 'table', 'laydate', 'admin', 'treetable', 'uParas', 'util', 'zTree', '_groupTree'], function () {
- var $ = layui.jquery;
- var layer = layui.layer;
- var form = layui.form;
- var table = layui.table;
- var admin = layui.admin;
- var upload = layui.upload;
- var treetable = layui.treetable;
- var _groupTree = layui._groupTree;
- var uParas = layui.uParas;
- var laydate = layui.laydate;
- var element = layui.element;
- //子任务ID
- var scheduleId = uParas.getUrlParam("scheduleId");
- //风险点ID
- var riskPointId = uParas.getUrlParam("riskPointId");
- //检查记录编号
- var checkRecordNo = uParas.getUrlParam("checkRecordNo");
- //检查表ID
- var bizCheckDefId = uParas.getUrlParam("bizCheckDefId");
- //检查频率
- var scheduleFrequency = uParas.getUrlParam("scheduleFrequency");
- if (scheduleFrequency == null || scheduleFrequency == '') {
- scheduleFrequency = "临时任务";
- }
- //当前检查次数
- var scheduleCurrentCount = uParas.getUrlParam("scheduleCurrentCount");
- //总检查次数
- var totalCheckCount = uParas.getUrlParam("totalCheckCount");
- /*检查频率*/
- $(".scheduleCurrentCount").text('当前第 ' + scheduleCurrentCount + ' 次:' + totalCheckCount + ' 次 / ' + scheduleFrequency);
- var JCTGcount = 0; //检查通过数量
- var CZYHhcount = 0; //存在隐患数量
- var BSJcount = 0; //不涉及数量
- var WJCcount = 0; //未检查数量
- var CHECKSUM = 0; //合计
- /*检查表数据展示*/
- var url1 = uParas.baseUrl + '/ent/bizCheckDef/getById?checkDefId=' + bizCheckDefId;
- admin.req(url1, {}, function (resp) {
- if (resp.code == 1) {
- $(".checkDefName").text('《' + resp.data.checkDefName + '》');
- } else {
- layer.msg(resp.msg);
- }
- }, 'POST');
- // 渲染表格
- function renderTable() {
- JCTGcount = 0; //检查通过数量
- JCBTGcount = 0; //检查不通过数量
- CZYHhcount = 0; //存在隐患数量
- BSJcount = 0; //不涉及数量
- WJCcount = 0; //未检查数量
- CHECKSUM = 0; //合计
- $(".JCTGcount").text('');
- $(".JCBTGcount").text('');
- $(".CZYHhcount").text('');
- $(".WJCcount").text('');
- $(".CHECKSUM").text('');
- $(".JCTGcount").text('已通过 ' + JCTGcount + ' 项');
- $(".JCBTGcount").text('不通过 ' + JCBTGcount + ' 项');
- $(".CZYHhcount").text('存在隐患 ' + CZYHhcount + ' 项');
- $(".BSJcount").text('不涉及 ' + BSJcount + ' 项');
- $(".WJCcount").text('未检查 ' + WJCcount + ' 项');
- $(".CHECKSUM").text('合计 ' + CHECKSUM + ' 项');
- var url = uParas.baseUrl + '/ent/schduleChecked/getSchduleCheckedItems';
- layer.load();
- treetable.render({
- elem: '#tableMenu',
- treeColIndex: 0,
- treeSpid: 0,
- height: 690,
- page: false,
- totalRow: false,
- treeIdName: 'checkItemDefId',
- treePidName: 'parentId',
- url: url,
- where: {
- "bizCheckDefId": bizCheckDefId,
- "scheduleId": scheduleId,
- "riskPointId": riskPointId,
- "checkRecordNo": checkRecordNo,
- "checkNumber": scheduleCurrentCount,
- },
- cellMinWidth: 100,
- cols: [[
- {type: 'numbers', title: '#'},
- {
- field: 'checkItemDefId', title: '选择', width: 58, align: 'center',
- templet: function (d) {
- if (d.parentId != 0 && d.checkResult === CHECK_RESULT_WJC) {
- return "<input type='checkbox' lay-skin='primary' name='layTableCheckbox' value='" + d.checkItemDefId + "'>";
- } else {
- return '';
- }
- }
- },
- {field: 'checkItemDefName', title: '检查项 / 检查内容名称', align: 'left', width: 250, minWidth: 120},
- {field: 'checkItemDefDesc', title: '具体检查内容', align: 'left'},
- {field: 'checkItemDefMethod', title: '检查方法', align: 'left'},
- {field: 'checkItemDefRule', title: '检查依据', align: 'left'},
- {field: 'punishItemDefRule', title: '处罚依据', align: 'left'},
- {
- field: 'checkResult', align: 'center', sort: false, title: '检查结果', width: 100,
- templet: function (d) {
- return setCheckResult(d);
- }
- },
- {
- title: '操作', width: 250,
- templet: function (d) {
- return setOperation(d.checkResult, d.parentId);
- }
- }
- ]],
- done: function () {
- layer.closeAll('loading');
- }
- });
- }
- renderTable();
- /*检查结果*/
- function setCheckResult(data) {
- if (data.checkRecordNo != null && data.checkRecordNo != '') {
- checkRecordNo = data.checkRecordNo;
- }
- var parentId = data.parentId;
- var title = '';
- if (parentId === 0) {
- return '';
- } else {
- CHECKSUM += 1;
- if (data.checkResult === CHECK_RESULT_TG) {
- title = '<i class="fa fa-check-circle c-update"></i>';
- JCTGcount += 1; //检查通过数量
- } else if (data.checkResult === CHECK_RESULT_BTG) {
- title = '<i class="fa fa-times-circle c-submit" aria-hidden="true"></i>';
- JCBTGcount += 1; //检查不通过数量
- } else if (data.checkResult === CHECK_RESULT_CZYH) {
- title = '<i class="fa fa-exclamation-triangle c-orange" aria-hidden="true"></i>';
- CZYHhcount += 1; //存在隐患数量
- } else if (data.checkResult === CHECK_RESULT_BSJ) {
- title = '<i class="fa fa-ban c-back" aria-hidden="true"></i>';
- BSJcount += 1; //不涉及数量
- } else if (data.checkResult === CHECK_RESULT_WJC) {
- title = '<i class="fa fa-minus-circle c-add" aria-hidden="true"></i>';
- WJCcount += 1; //未检查数量
- }
- $(".JCTGcount").text('已通过 ' + JCTGcount + ' 项');
- $(".JCBTGcount").text('不通过 ' + JCBTGcount + ' 项');
- $(".CZYHhcount").text('存在隐患 ' + CZYHhcount + ' 项');
- $(".BSJcount").text('不涉及 ' + BSJcount + ' 项');
- $(".WJCcount").text('未检查 ' + WJCcount + ' 项');
- $(".CHECKSUM").text('合计 ' + CHECKSUM + ' 项');
- return title;
- }
- }
- /*操作*/
- function setOperation(checkResult, parentId) {
- var html = '';
- if (parentId == 0) {
- return '';
- } else {
- html += '<a class="layui-btn layui-btn-xs bg-c-orange" lay-event="add-hdanger">提交隐患</a>';
- if (checkResult != CHECK_RESULT_TG && checkResult != CHECK_RESULT_CZYH) {
- html += '<a class="layui-btn layui-btn-xs bg-c-update" lay-event="check-qualified">通过</a>';
- }
- if (checkResult != CHECK_RESULT_BTG && checkResult != CHECK_RESULT_CZYH) {
- html += '<a class="layui-btn layui-btn-xs bg-c-submit" lay-event="check-un-qualified">不通过</a>';
- }
- if (checkResult != CHECK_RESULT_BSJ && checkResult != CHECK_RESULT_CZYH) {
- html += '<a class="layui-btn layui-btn-xs bg-c-back" lay-event="check-barring">不涉及</a>';
- }
- return html;
- }
- }
- /*完成*/
- $('#finishCheck').click(function () {
- if (WJCcount > 0) {
- layer.msg("还有【" + WJCcount + "】项未检查!");
- return false;
- }
- var data = {
- "scheduleId": scheduleId,
- "riskPointId": riskPointId,
- "checkRecordNo": checkRecordNo,
- "bizCheckDefId": bizCheckDefId,
- "checkNumber": scheduleCurrentCount,
- "totalCheckCount": totalCheckCount,
- "bizCheckDefType": 1, //非分级管控检查表
- };
- saveCheckFinish(data);
- });
- /*取消*/
- $('#cancelAll').click(function () {
- $("table input[name=layTableCheckbox]").prop("checked", false);
- form.render();
- });
- /*全部通过*/
- $('#checkedAll').click(function () {
- $("table input[name=layTableCheckbox]").prop("checked", true);
- form.render();
- selectedCheckedAll(1);
- });
- /*选中的通过*/
- $('#selectedCheckedAll').click(function () {
- selectedCheckedAll(1);
- });
- /*选中的不通过*/
- $('#selectedCheckedNotAll').click(function () {
- selectedCheckedAll(2);
- });
- /*选中的不涉及*/
- $('#exclusiveCheckedAll').click(function () {
- selectedCheckedAll(4);
- });
- /*返回*/
- $('#back').click(function () {
- location.href = "../schdule/myIndex.html";
- });
- // 操作栏点击事件
- table.on('tool(tableMenu)', function (obj) {
- var data = obj.data;
- var layEvent = obj.event;
- if (layEvent == 'check-qualified') { // 通过
- selectedCheckedAll(6, data);
- } else if (layEvent == 'add-hdanger') { // 提交隐患
- showAddModel(data);
- } else if (layEvent == 'check-un-qualified') { // 不通过
- selectedCheckedAll(7, data);
- } else if (layEvent == 'check-barring') { // 不涉及
- selectedCheckedAll(5, data);
- }
- });
- /*检测选中值*/
- function selectedCheckedAll(i, data) {
- var idList = [];
- var checkResult; //检查结果:1检查通过;2存在隐患;3不涉及
- var checkRecordLogId; //检查记录ID
- var checkItemContentDefIds; //通过
- var exclusiveContentIds; //不涉及
- //4批量不涉及、1批量通过、1全部通过、2批量不通过
- if (i === 1 || i === 2 || i === 4) {
- var chkList = $("table input[name=layTableCheckbox]:checked");
- if (chkList.length === 0) {
- layer.msg('至少选择一项检查内容!');
- return;
- }
- chkList.each(function () {
- idList.push($(this).val());
- });
- if (i === 1) {
- checkResult = CHECK_RESULT_TG;
- } else if (i === 2) {
- checkResult = CHECK_RESULT_BTG;
- } else if (i === 4) {
- checkResult = CHECK_RESULT_BSJ;
- }
- checkItemContentDefIds = idList.toString();
- } else if (i === 5) { //单条提交【检查不涉及】记录
- checkResult = CHECK_RESULT_BSJ;
- idList.push(data.checkItemDefId);
- checkItemContentDefIds = idList.toString();
- checkRecordLogId = data.checkRecordLogId;
- } else if (i === 6) { //单条提交【检查通过】记录
- checkResult = CHECK_RESULT_TG;
- idList.push(data.checkItemDefId);
- checkItemContentDefIds = idList.toString();
- checkRecordLogId = data.checkRecordLogId;
- } else if (i === 7) { //单条提交【检查不通过】记录
- checkResult = CHECK_RESULT_BTG;
- idList.push(data.checkItemDefId);
- checkItemContentDefIds = idList.toString();
- checkRecordLogId = data.checkRecordLogId;
- }
- var dataMap = {
- "bizCheckDefType": 1, //非分级管控检查表
- 'checkItemContentDefIds': checkItemContentDefIds,
- 'scheduleId': scheduleId,
- 'riskPointId': riskPointId,
- 'bizCheckDefId': bizCheckDefId,
- 'checkNumber': scheduleCurrentCount,
- 'totalCheckCount': totalCheckCount,
- 'checkResult': checkResult,
- 'checkRecordNo': checkRecordNo,
- 'isScheduleCheck': 0,
- 'remark': '检查结果正常',
- 'checkRecordLogId': checkRecordLogId,
- };
- saveCheckRecord(dataMap);
- }
- // 保存处理
- function saveCheckRecord(data) {
- layer.confirm('确定要提交吗?', {
- skin: 'layui-layer-admin',
- shade: .1
- }
- , function (i) {
- layer.close(i);
- layer.load();
- var url = uParas.baseUrl + '/ent/schduleChecked/saveCheckRecord';
- admin.req(url, data, function (resp) {
- layer.closeAll('loading');
- if (resp.code == 1) {
- layer.close();
- layer.msg(resp.msg);
- renderTable();
- } else {
- layer.msg(resp.msg);
- }
- }, 'POST');
- });
- }
- // 检查完成
- function saveCheckFinish(data) {
- layer.confirm('确定检查完成?', {
- skin: 'layui-layer-admin',
- shade: .1
- }
- , function (i) {
- layer.close(i);
- layer.load();
- var url = uParas.baseUrl + '/ent/schduleChecked/schduleCheckFinish';
- admin.req(url, data, function (resp) {
- layer.closeAll('loading');
- if (resp.code == 1) {
- layer.close();
- layer.msg(resp.msg);
- location.href = "../schdule/myIndex.html";
- } else {
- layer.msg(resp.msg);
- }
- }, 'POST');
- });
- }
- // 添加隐患
- function goAddPage(data) {
- location.href = "./addHdanger.html?checkItemDefId=" + data.checkItemDefId +
- '&scheduleId=' + scheduleId +
- '&riskPointId=' + riskPointId +
- '&checkRecordNo=' + checkRecordNo +
- '&bizCheckDefId=' + bizCheckDefId +
- '&scheduleId=' + scheduleId;
- '&scheduleCurrentCount=' + scheduleCurrentCount;
- '&totalCheckCount=' + totalCheckCount;
- }
- //【添加隐患】 显示新增弹窗
- function showAddModel(data) {
- admin.open({
- type: 1,
- title: '添加隐患',
- area: ['60%', '700px'],
- content: $('#modelTpl').html(),
- success: function (layero, dIndex) {
- /*检查记录ID*/
- $("#checkRecordLogId").val(data.checkRecordLogId);
- $("#checkContentId").val(data.checkItemDefId);
- initData();
- // 提交
- form.on('submit(formSubmit)', function (data) {
- var paths = $('input[name="attachPath"]');
- if (paths && paths.length > 0) {
- var attachPathVal = [];
- paths.each(function () {
- attachPathVal.push($(this).val());
- });
- data.field.attachPathVal = attachPathVal.join(",");
- $("#attachPathVal").val(attachPathVal.join(","));
- }
- submit(1, data);
- return false;
- });
- // 保存至待提交
- form.on('submit(formSave)', function (data) {
- var paths = $('input[name="attachPath"]');
- if (paths && paths.length > 0) {
- var attachPathVal = [];
- paths.each(function () {
- attachPathVal.push($(this).val());
- });
- data.field.attachPathVal = attachPathVal.join(",");
- $("#attachPathVal").val(attachPathVal.join(","));
- }
- submit(0, data);
- return false;
- });
- }
- });
- }
- // 提交
- function submit(status, data) {
- var url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveHdanger";
- data.field.status = status;
- admin.req(url, data.field, function (res) {
- layer.closeAll('loading');
- if (res.code == 1) {
- layer.msg(res.msg);
- renderTable();
- layer.closeAll();
- } else {
- // alert();
- //console.log(res.msg);
- layer.msg(res.msg);
- return false;
- }
- }, 'POST');
- }
- function initData() {
- if (scheduleId != null && scheduleId != '') {
- $("#isScheduleCheck").val(1);
- $("#scheduleId").val(scheduleId);
- } else {
- $("#isScheduleCheck").val(0);
- }
- $("#riskPointId").val(riskPointId);
- $("#checkRecordNo").val(checkRecordNo);
- $("#bizCheckDefId").val(bizCheckDefId);
- $("#scheduleCurrentCount").val(scheduleCurrentCount);
- $("#totalCheckCount").val(totalCheckCount);
- /*整改期限*/
- laydate.render({
- elem: '#hdangerRetifyDeadline',
- format: 'yyyy-MM-dd HH:mm:ss',
- type: 'datetime',
- min: 'date',
- });
- /*检测 隐患评审流程*/
- admin.req(uParas.baseUrl + '/ent/hiddenDanger/checkedHdangerReview', null, function (res) {
- if (res.code == 1) {
- var isHdangerReview = res.data.isHdangerReview;
- if (isHdangerReview) {
- /*评审*/
- $(".hdanger-review").show();
- $(".hdanger-retify").hide();
- $(".hdanger-accepted").hide();
- $(".work-flow-review-group-hint").attr("lay-verify", 'required');
- $(".work-flow-review-group-hint").attr("lay-verType", 'tips');
- $(".work-flow-review-by-hint").attr("lay-verify", 'required');
- $(".work-flow-review-by-hint").attr("lay-verType", 'tips');
- $(".work-flow-retify-group-hint").removeAttr("lay-verify", 'required');
- $(".work-flow-retify-by-hint").removeAttr("lay-verType", 'tips');
- $(".work-flow-accepted-group-hint").removeAttr("lay-verify", 'required');
- $(".work-flow-accepted-by-hint").removeAttr("lay-verType", 'tips');
- } else {
- /*不评审*/
- $(".hdanger-review").hide();
- $(".hdanger-retify").show();
- $(".hdanger-accepted").show();
- $(".work-flow-review-group-hint").removeAttr("lay-verify", 'required');
- $(".work-flow-review-by-hint").removeAttr("lay-verType", 'tips');
- $(".work-flow-retify-group-hint").attr("lay-verify", 'required');
- $(".work-flow-retify-group-hint").attr("lay-verType", 'tips');
- $(".work-flow-retify-by-hint").attr("lay-verify", 'required');
- $(".work-flow-retify-by-hint").attr("lay-verType", 'tips');
- $(".work-flow-accepted-group-hint").attr("lay-verify", 'required');
- $(".work-flow-accepted-group-hint").attr("lay-verType", 'tips');
- $(".work-flow-accepted-by-hint").attr("lay-verify", 'required');
- $(".work-flow-accepted-by-hint").attr("lay-verType", 'tips');
- }
- }
- }, 'get');
- /*隐患等级*/
- uParas.initSimpleSelect("hdangerLevel", "modelForm", "/admin/common/getHdangerLevelList", "keyName", "keyValue");
- /*隐患类型*/
- uParas.initSimpleSelect("hdangerCatId", "modelForm", "/admin/common/getCommonClassifyesByCatType?catType=1", "catName", "catId");
- var groupUrl = '/admin/common/getFindGroupLists';
- /*整改部门and人员*/
- _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupRetify", "hdangerRetifyGroupName",
- "hdangerRetifyGroup", "menuContentRetify", "hdangerRetifyBy", "modelForm");
- /*评审部门and人员*/
- _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupReview", "hdangerReviewGroupName",
- "hdangerReviewGroup", "menuContentReview", "hdangerReviewBy", "modelForm");
- /*验收部门and人员*/
- _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupAccepted", "hdangerAcceptedGroupName",
- "hdangerAcceptedGroup", "menuContentAccepted", "hdangerAcceptedBy", "modelForm");
- // 上传实例
- var uploadFile = upload.render({
- elem: '#test1', //绑定元素
- url: uParas.baseUrl + '/admin/uploadFile', //上传接口
- accept: 'file',
- acceptMime: 'image/jpg,image/png,image/gif,image/jpeg,image/bmp,image/tga,image/fpx,image/raw,', //(只显示 jpg 和 png 文件)
- size: 30720,//设置文件最大可允许上传的大小,单位 KB。不支持ie8/9
- done: function (response) {
- var paths = $('input[name="attachPath"]');
- if (paths && paths.length > 0) {
- var attachPathVal = [];
- paths.each(function () {
- attachPathVal.push($(this).val());
- });
- if (attachPathVal.length > 6) {
- layer.msg("照片数量已达上限");
- return false;
- }
- }
- //上传完毕回调
- fileHtml(response.data.ext, response.data.path, response.data.oriFileName, true);
- }
- , error: function () {
- //请求异常回调
- }
- });
- }
- function fileHtml(ext, path, oriFileName, isNew) {
- var Str = '';
- if (isNew) {
- Str = '<span style="color: #1E9FFF;">(新)</span>';
- }
- //文件图标
- var icon = '';
- if (ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif') {
- icon = '<img style="width: 60px;height: 80px;" src="' + path + '" alt="">';
- } else {
- icon = '<img style="width: 60px;height: 80px;" src="' + path + '" alt="">';
- }
- //文件信息置入隐藏域
- var html = '';
- html += '<div style="padding-top: 6px;padding-right: 10px;float: left;">';
- html += '<input type="hidden" name="attachPath" value="' + path + '"/>';
- html += icon;
- html += '<br>' + Str + '<a style="color: indianred;float: right;margin-right: 15px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
- html += '</div>';
- $("#fileDiv").append(html);
- }
- });
- //删除附件
- function deleteFile(obj) {
- var pDiv = $(obj).parent();
- pDiv.remove();
- }
- </script>
- </body>
- </html>
|