baseCheckedItem.html 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>基础任务检查项</title>
  8. <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
  9. <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
  10. <!--<link rel="stylesheet" href="../../../assets/module/ztree/css/metroStyle/metroStyle.css"/>-->
  11. <link rel="stylesheet" href="../../../assets/module/icon/icon.css" media="all">
  12. <link rel="stylesheet" href="../../../assets/module/icon/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
  13. <style>
  14. /*@media screen and (max-width: 750px) {*/
  15. /*#treeTbTree {*/
  16. /*height: auto;*/
  17. /*}*/
  18. /*}*/
  19. /*.ztree *{*/
  20. /*font-size: 14px!important;*/
  21. /*}*/
  22. /*.ztree li{*/
  23. /*line-height: 22px!important;*/
  24. /*}*/
  25. /*.ztree li span.button.switch{*/
  26. /*width:22px!important;*/
  27. /*height:28px!important;*/
  28. /*}*/
  29. /*.hide {*/
  30. /*display: none;*/
  31. /*}*/
  32. </style>
  33. </head>
  34. <body>
  35. <!-- 页面加载loading -->
  36. <div class="page-loading">
  37. <div class="ball-loader">
  38. <span></span><span></span><span></span><span></span>
  39. </div>
  40. </div>
  41. <!-- 正文开始 -->
  42. <div class="layui-fluid">
  43. <div class="layui-row layui-col-space15">
  44. <!-- 右栏 -->
  45. <div class="layui-col-sm12 layui-col-md11 layui-col-lg12">
  46. <div class="layui-card">
  47. <div class="layui-card-body">
  48. <div class="layui-form toolbar">
  49. <!--检查表数据-->
  50. <span class="text-left font-weight font-size-16 checkDefName"></span>
  51. <div class="layui-form-item text-right">
  52. <div class="layui-inline pull-left">
  53. <span class=" font-weight layui-badge bg-c-add font-size-14 scheduleCurrentCount"></span>
  54. <!--检查统计开始-->
  55. <span class="m-left20px ">
  56. <!--存在隐患-->
  57. <i class="fa fa-exclamation-triangle c-orange" aria-hidden="true"></i>
  58. <span class="font-weight c-orange CZYHhcount"></span>
  59. </span>
  60. <span class="m-left20px">
  61. <!--通过-->
  62. <i class="fa fa-check-circle c-update"></i>
  63. <span class="font-weight c-update JCTGcount"></span>
  64. </span>
  65. <span class="m-left20px">
  66. <!--不通过-->
  67. <i class="fa fa-times-circle c-submit" aria-hidden="true"></i>
  68. <span class="font-weight c-submit JCBTGcount"></span>
  69. </span>
  70. <span class="m-left20px ">
  71. <!--不涉及-->
  72. <i class="fa fa-ban c-back" aria-hidden="true"></i>
  73. <span class="font-weight c-back BSJcount"></span>
  74. </span>
  75. <span class="m-left20px">
  76. <!--未检查-->
  77. <i class="fa fa-minus-circle c-add" aria-hidden="true"></i>
  78. <span class="font-weight c-add WJCcount"></span>
  79. </span>
  80. <span class="m-left20px">
  81. <!--合计-->
  82. <!-- <i class="fa fa-minus-circle" aria-hidden="true"></i>-->
  83. <span class="font-weight CHECKSUM"></span>
  84. </span>
  85. <!--检查统计结束-->
  86. </div>
  87. <div class="layui-inline">
  88. <button id="checkedAll" class="layui-btn icon-btn layui-btn-sm bg-c-update">全部通过
  89. </button>
  90. </div>
  91. <div class="layui-inline">
  92. <button id="selectedCheckedAll" class="layui-btn icon-btn layui-btn-sm bg-c-update">通过
  93. </button>
  94. </div>
  95. <div class="layui-inline">
  96. <button id="selectedCheckedNotAll" class="layui-btn icon-btn layui-btn-sm bg-c-submit">
  97. 不通过
  98. </button>
  99. </div>
  100. <div class="layui-inline">
  101. <button id="exclusiveCheckedAll" class="layui-btn icon-btn layui-btn-sm bg-c-back">不涉及
  102. </button>
  103. </div>
  104. <div class="layui-inline">
  105. <button id="cancelAll" class="layui-btn icon-btn layui-btn-sm bg-c-back">取消选中</button>
  106. </div>
  107. <div class="layui-inline">
  108. <button id="finishCheck" class="layui-btn icon-btn layui-btn-sm bg-c-orange">检查完成
  109. </button>
  110. </div>
  111. <div class="layui-inline">
  112. <button id="back" class="layui-btn icon-btn layui-btn-sm bg-c-back">返回</button>
  113. </div>
  114. </div>
  115. </div>
  116. <table class="layui-table" id="tableMenu" lay-filter="tableMenu">
  117. </table>
  118. <!--<div class="layui-progress" lay-showpercent="true" lay-filter="demo">-->
  119. <!--<div class="layui-progress-bar check-progress-bar" lay-percent="5 / 10"></div>-->
  120. <!--</div>-->
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!--提交隐患弹框-->
  127. <script type="text/html" id="modelTpl">
  128. <form id="modelForm" lay-filter="modelForm" class="layui-form model-form">
  129. <div class="" style="overflow: scroll;margin-left: 10%;height: 573px;">
  130. <input type="hidden" class="layui-input" id="bizCheckDefType" name="bizCheckDefType" value="1"/>
  131. <input type="hidden" class="layui-input" id="isScheduleCheck" name="isScheduleCheck"/>
  132. <input type="hidden" class="layui-input" id="riskPointId" name="riskPointId"/>
  133. <input type="hidden" class="layui-input" id="bizCheckDefId" name="bizCheckDefId"/>
  134. <input type="hidden" class="layui-input" id="scheduleId" name="scheduleId"/>
  135. <input type="hidden" class="layui-input" id="checkRecordNo" name="checkRecordNo"/>
  136. <input type="hidden" class="layui-input" id="scheduleCurrentCount" name="checkNumber"/>
  137. <input type="hidden" class="layui-input" id="totalCheckCount" name="totalCheckCount"/>
  138. <input type="hidden" class="layui-input" id="checkRecordLogId" name="checkRecordLogId"/>
  139. <input type="hidden" class="layui-input" id="checkContentId" name="checkContentId"/>
  140. <div class="layui-form-item layui-row">
  141. <div class="layui-inline layui-col-md5 p-top10px">
  142. <label class="layui-form-label" style="width: 110px;">
  143. <span class="layui-badge-dot"></span> 隐患标题
  144. </label>
  145. <div class="layui-input-block ">
  146. <input type="text" class="layui-input" id="hdangerTitle" name="hdangerTitle" placeholder="请输入标题"
  147. maxlength="64"
  148. lay-verType="tips" lay-verify="required"/>
  149. </div>
  150. </div>
  151. <div class="layui-inline layui-col-md5 p-top10px">
  152. <label class="layui-form-label" style="width: 110px;">
  153. <span class="layui-badge-dot"></span> 隐患类型
  154. </label>
  155. <div class="layui-input-block">
  156. <select name="hdangerCatId" id="hdangerCatId" lay-verType="tips" lay-verify="required"
  157. class="layui-input-block ">
  158. </select>
  159. </div>
  160. </div>
  161. <div class="layui-inline layui-col-md5 p-top10px">
  162. <label class="layui-form-label " style="width: 110px;">
  163. <span class="layui-badge-dot"></span> 隐患等级
  164. </label>
  165. <div class="layui-input-block">
  166. <select id="hdangerLevel" name="hdangerLevel" lay-filter="layuiForm" lay-verType="tips"
  167. lay-verify="required"
  168. class="layui-input-block ">
  169. <option value="">点击选择</option>
  170. </select>
  171. </div>
  172. </div>
  173. <div class="layui-inline layui-col-md5 p-top10px">
  174. <label class="layui-form-label" style="width: 110px;">
  175. <span class="layui-badge-dot"></span> 整改期限</label>
  176. <div class="layui-input-block">
  177. <input type="text" name="hdangerRetifyDeadline" id="hdangerRetifyDeadline"
  178. placeholder="选择整改期限"
  179. lay-verType="tips" lay-verify="required" class="layui-input" readonly>
  180. </div>
  181. </div>
  182. <div class="hdanger-review">
  183. <div class="layui-inline layui-col-md5 p-top10px">
  184. <label class="layui-form-label" style="width: 110px;">
  185. <span class="layui-badge-dot"></span> 评审部门</label>
  186. <div class="layui-input-block">
  187. <input type="text" id="hdangerReviewGroupName"
  188. class="layui-input work-flow-review-group-hint" name="hdangerReviewGroupName"
  189. value=""
  190. placeholder="点击选择部门"
  191. class="form-control" readonly>
  192. <input type="hidden" id="hdangerReviewGroup" name="hdangerReviewGroup" readonly>
  193. <div id="menuContentReview" class="menuContent">
  194. <ul id="threeLevelGroupReview" class="ztree" style="margin-top:0;"></ul>
  195. </div>
  196. </div>
  197. </div>
  198. <div class="layui-inline layui-col-md5 p-top10px">
  199. <label class="layui-form-label" style="width: 110px;">
  200. <span class="layui-badge-dot"></span> 评审人员</label>
  201. <div class="layui-input-block">
  202. <select id="hdangerReviewBy" name="hdangerReviewBy"
  203. class="layui-input-block work-flow-review-group-hint">
  204. <option value="">点击选择人员</option>
  205. </select>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="hdanger-retify">
  210. <div class="layui-inline layui-col-md5 p-top10px">
  211. <label class="layui-form-label" style="width: 110px;">
  212. <span class="layui-badge-dot"></span> 整改部门</label>
  213. <div class="layui-input-block">
  214. <input type="text" id="hdangerRetifyGroupName"
  215. class="layui-input work-flow-retify-group-hint" name="hdangerRetifyGroupName"
  216. value=""
  217. placeholder="点击选择部门"
  218. class="form-control" readonly>
  219. <input type="hidden" id="hdangerRetifyGroup" name="hdangerRetifyGroup" readonly>
  220. <div id="menuContentRetify" class="menuContent">
  221. <ul id="threeLevelGroupRetify" class="ztree" style="margin-top:0;"></ul>
  222. </div>
  223. </div>
  224. </div>
  225. <div class="layui-inline layui-col-md5 p-top10px">
  226. <label class="layui-form-label " style="width: 110px;">
  227. <span class="layui-badge-dot"></span> 整改人员</label>
  228. <div class="layui-input-block">
  229. <select id="hdangerRetifyBy" name="hdangerRetifyBy"
  230. class="layui-input-block work-flow-retify-group-hint"
  231. lay-filter="layuiFormRetify">
  232. <option value="">点击选择人员</option>
  233. </select>
  234. </div>
  235. </div>
  236. </div>
  237. <div class="hdanger-accepted">
  238. <div class="layui-inline layui-col-md5 p-top10px">
  239. <label class="layui-form-label" style="width: 110px;">
  240. <span class="layui-badge-dot"></span> 验收部门</label>
  241. <div class="layui-input-block">
  242. <input type="text" id="hdangerAcceptedGroupName"
  243. class="layui-input work-flow-accepted-group-hint" name="hdangerAcceptedGroupName"
  244. value=""
  245. placeholder="点击选择部门"
  246. class="form-control" readonly>
  247. <input type="hidden" id="hdangerAcceptedGroup" name="hdangerAcceptedGroup" readonly>
  248. <div id="menuContentAccepted" class="menuContent">
  249. <ul id="threeLevelGroupAccepted" class="ztree" style="margin-top:0;"></ul>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="layui-inline layui-col-md5 p-top10px">
  254. <label class="layui-form-label" style="width: 110px;">
  255. <span class="layui-badge-dot"></span> 验收人员</label>
  256. <div class="layui-input-block">
  257. <select id="hdangerAcceptedBy" name="hdangerAcceptedBy"
  258. class="layui-input-block work-flow-accepted-group-hint"
  259. >
  260. <option value="">点击选择人员</option>
  261. </select>
  262. </div>
  263. </div>
  264. </div>
  265. <div class="layui-inline layui-col-md10 p-top10px">
  266. <label class="layui-form-label" style="width: 110px;">现场描述</label>
  267. <div class="layui-input-block">
  268. <textarea class="layui-textarea" lay-verType="tips" placeholder="请输入描述"
  269. id="hdangerDesc" name="hdangerDesc" maxlength="500"
  270. style="height: 60px;"></textarea>
  271. </div>
  272. </div>
  273. <!--附件-->
  274. <div class="layui-inline layui-col-md10 p-top10px">
  275. <label class="layui-form-label" style="width: 110px;">现场照片</label>
  276. <div class="layui-input-block text-left">
  277. <button type="button" class="layui-btn" id="test1">
  278. <i class="layui-icon">&#xe67c;</i>上传照片
  279. </button>
  280. <span style="color: indianred;font-size: 16px;">支持图片格式:jpg / png / gif / jpeg</span>
  281. <input type="hidden" name="attachPathVal" id="attachPathVal"/>
  282. <div id="fileDiv" style="padding-top: 10px;"></div>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. <div class="layui-form-item text-right" style="z-index: 3">
  288. <button type="button" class="layui-btn layui-btn-sm bg-c-add" lay-filter="formSave" lay-submit>暂存</button>
  289. <button type="button" class="layui-btn layui-btn-sm bg-c-submit" lay-filter="formSubmit" lay-submit>提交
  290. </button>
  291. </div>
  292. </form>
  293. </script>
  294. <!-- js部分 -->
  295. <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
  296. <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
  297. <script type="text/javascript" src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
  298. <script>
  299. var CHECK_RESULT_WJC = 0; //未检查
  300. var CHECK_RESULT_TG = 1; //通过
  301. var CHECK_RESULT_BTG = 2; //不通过
  302. var CHECK_RESULT_CZYH = 3; //存在隐患
  303. var CHECK_RESULT_BSJ = 4; //不涉及
  304. layui.use(['iconPicker', 'layer', 'element', 'form', 'upload', 'table', 'laydate', 'admin', 'treetable', 'uParas', 'util', 'zTree', '_groupTree'], function () {
  305. var $ = layui.jquery;
  306. var layer = layui.layer;
  307. var form = layui.form;
  308. var table = layui.table;
  309. var admin = layui.admin;
  310. var upload = layui.upload;
  311. var treetable = layui.treetable;
  312. var _groupTree = layui._groupTree;
  313. var uParas = layui.uParas;
  314. var laydate = layui.laydate;
  315. var element = layui.element;
  316. //子任务ID
  317. var scheduleId = uParas.getUrlParam("scheduleId");
  318. //风险点ID
  319. var riskPointId = uParas.getUrlParam("riskPointId");
  320. //检查记录编号
  321. var checkRecordNo = uParas.getUrlParam("checkRecordNo");
  322. //检查表ID
  323. var bizCheckDefId = uParas.getUrlParam("bizCheckDefId");
  324. //检查频率
  325. var scheduleFrequency = uParas.getUrlParam("scheduleFrequency");
  326. if (scheduleFrequency == null || scheduleFrequency == '') {
  327. scheduleFrequency = "临时任务";
  328. }
  329. //当前检查次数
  330. var scheduleCurrentCount = uParas.getUrlParam("scheduleCurrentCount");
  331. //总检查次数
  332. var totalCheckCount = uParas.getUrlParam("totalCheckCount");
  333. /*检查频率*/
  334. $(".scheduleCurrentCount").text('当前第 ' + scheduleCurrentCount + ' 次:' + totalCheckCount + ' 次 / ' + scheduleFrequency);
  335. var JCTGcount = 0; //检查通过数量
  336. var CZYHhcount = 0; //存在隐患数量
  337. var BSJcount = 0; //不涉及数量
  338. var WJCcount = 0; //未检查数量
  339. var CHECKSUM = 0; //合计
  340. /*检查表数据展示*/
  341. var url1 = uParas.baseUrl + '/ent/bizCheckDef/getById?checkDefId=' + bizCheckDefId;
  342. admin.req(url1, {}, function (resp) {
  343. if (resp.code == 1) {
  344. $(".checkDefName").text('《' + resp.data.checkDefName + '》');
  345. } else {
  346. layer.msg(resp.msg);
  347. }
  348. }, 'POST');
  349. // 渲染表格
  350. function renderTable() {
  351. JCTGcount = 0; //检查通过数量
  352. JCBTGcount = 0; //检查不通过数量
  353. CZYHhcount = 0; //存在隐患数量
  354. BSJcount = 0; //不涉及数量
  355. WJCcount = 0; //未检查数量
  356. CHECKSUM = 0; //合计
  357. $(".JCTGcount").text('');
  358. $(".JCBTGcount").text('');
  359. $(".CZYHhcount").text('');
  360. $(".WJCcount").text('');
  361. $(".CHECKSUM").text('');
  362. $(".JCTGcount").text('已通过 ' + JCTGcount + ' 项');
  363. $(".JCBTGcount").text('不通过 ' + JCBTGcount + ' 项');
  364. $(".CZYHhcount").text('存在隐患 ' + CZYHhcount + ' 项');
  365. $(".BSJcount").text('不涉及 ' + BSJcount + ' 项');
  366. $(".WJCcount").text('未检查 ' + WJCcount + ' 项');
  367. $(".CHECKSUM").text('合计 ' + CHECKSUM + ' 项');
  368. var url = uParas.baseUrl + '/ent/schduleChecked/getSchduleCheckedItems';
  369. layer.load();
  370. treetable.render({
  371. elem: '#tableMenu',
  372. treeColIndex: 0,
  373. treeSpid: 0,
  374. height: 690,
  375. page: false,
  376. totalRow: false,
  377. treeIdName: 'checkItemDefId',
  378. treePidName: 'parentId',
  379. url: url,
  380. where: {
  381. "bizCheckDefId": bizCheckDefId,
  382. "scheduleId": scheduleId,
  383. "riskPointId": riskPointId,
  384. "checkRecordNo": checkRecordNo,
  385. "checkNumber": scheduleCurrentCount,
  386. },
  387. cellMinWidth: 100,
  388. cols: [[
  389. {type: 'numbers', title: '#'},
  390. {
  391. field: 'checkItemDefId', title: '选择', width: 58, align: 'center',
  392. templet: function (d) {
  393. if (d.parentId != 0 && d.checkResult === CHECK_RESULT_WJC) {
  394. return "<input type='checkbox' lay-skin='primary' name='layTableCheckbox' value='" + d.checkItemDefId + "'>";
  395. } else {
  396. return '';
  397. }
  398. }
  399. },
  400. {field: 'checkItemDefName', title: '检查项 / 检查内容名称', align: 'left', width: 250, minWidth: 120},
  401. {field: 'checkItemDefDesc', title: '具体检查内容', align: 'left'},
  402. {field: 'checkItemDefMethod', title: '检查方法', align: 'left'},
  403. {field: 'checkItemDefRule', title: '检查依据', align: 'left'},
  404. {field: 'punishItemDefRule', title: '处罚依据', align: 'left'},
  405. {
  406. field: 'checkResult', align: 'center', sort: false, title: '检查结果', width: 100,
  407. templet: function (d) {
  408. return setCheckResult(d);
  409. }
  410. },
  411. {
  412. title: '操作', width: 250,
  413. templet: function (d) {
  414. return setOperation(d.checkResult, d.parentId);
  415. }
  416. }
  417. ]],
  418. done: function () {
  419. layer.closeAll('loading');
  420. }
  421. });
  422. }
  423. renderTable();
  424. /*检查结果*/
  425. function setCheckResult(data) {
  426. if (data.checkRecordNo != null && data.checkRecordNo != '') {
  427. checkRecordNo = data.checkRecordNo;
  428. }
  429. var parentId = data.parentId;
  430. var title = '';
  431. if (parentId === 0) {
  432. return '';
  433. } else {
  434. CHECKSUM += 1;
  435. if (data.checkResult === CHECK_RESULT_TG) {
  436. title = '<i class="fa fa-check-circle c-update"></i>';
  437. JCTGcount += 1; //检查通过数量
  438. } else if (data.checkResult === CHECK_RESULT_BTG) {
  439. title = '<i class="fa fa-times-circle c-submit" aria-hidden="true"></i>';
  440. JCBTGcount += 1; //检查不通过数量
  441. } else if (data.checkResult === CHECK_RESULT_CZYH) {
  442. title = '<i class="fa fa-exclamation-triangle c-orange" aria-hidden="true"></i>';
  443. CZYHhcount += 1; //存在隐患数量
  444. } else if (data.checkResult === CHECK_RESULT_BSJ) {
  445. title = '<i class="fa fa-ban c-back" aria-hidden="true"></i>';
  446. BSJcount += 1; //不涉及数量
  447. } else if (data.checkResult === CHECK_RESULT_WJC) {
  448. title = '<i class="fa fa-minus-circle c-add" aria-hidden="true"></i>';
  449. WJCcount += 1; //未检查数量
  450. }
  451. $(".JCTGcount").text('已通过 ' + JCTGcount + ' 项');
  452. $(".JCBTGcount").text('不通过 ' + JCBTGcount + ' 项');
  453. $(".CZYHhcount").text('存在隐患 ' + CZYHhcount + ' 项');
  454. $(".BSJcount").text('不涉及 ' + BSJcount + ' 项');
  455. $(".WJCcount").text('未检查 ' + WJCcount + ' 项');
  456. $(".CHECKSUM").text('合计 ' + CHECKSUM + ' 项');
  457. return title;
  458. }
  459. }
  460. /*操作*/
  461. function setOperation(checkResult, parentId) {
  462. var html = '';
  463. if (parentId == 0) {
  464. return '';
  465. } else {
  466. html += '<a class="layui-btn layui-btn-xs bg-c-orange" lay-event="add-hdanger">提交隐患</a>';
  467. if (checkResult != CHECK_RESULT_TG && checkResult != CHECK_RESULT_CZYH) {
  468. html += '<a class="layui-btn layui-btn-xs bg-c-update" lay-event="check-qualified">通过</a>';
  469. }
  470. if (checkResult != CHECK_RESULT_BTG && checkResult != CHECK_RESULT_CZYH) {
  471. html += '<a class="layui-btn layui-btn-xs bg-c-submit" lay-event="check-un-qualified">不通过</a>';
  472. }
  473. if (checkResult != CHECK_RESULT_BSJ && checkResult != CHECK_RESULT_CZYH) {
  474. html += '<a class="layui-btn layui-btn-xs bg-c-back" lay-event="check-barring">不涉及</a>';
  475. }
  476. return html;
  477. }
  478. }
  479. /*完成*/
  480. $('#finishCheck').click(function () {
  481. if (WJCcount > 0) {
  482. layer.msg("还有【" + WJCcount + "】项未检查!");
  483. return false;
  484. }
  485. var data = {
  486. "scheduleId": scheduleId,
  487. "riskPointId": riskPointId,
  488. "checkRecordNo": checkRecordNo,
  489. "bizCheckDefId": bizCheckDefId,
  490. "checkNumber": scheduleCurrentCount,
  491. "totalCheckCount": totalCheckCount,
  492. "bizCheckDefType": 1, //非分级管控检查表
  493. };
  494. saveCheckFinish(data);
  495. });
  496. /*取消*/
  497. $('#cancelAll').click(function () {
  498. $("table input[name=layTableCheckbox]").prop("checked", false);
  499. form.render();
  500. });
  501. /*全部通过*/
  502. $('#checkedAll').click(function () {
  503. $("table input[name=layTableCheckbox]").prop("checked", true);
  504. form.render();
  505. selectedCheckedAll(1);
  506. });
  507. /*选中的通过*/
  508. $('#selectedCheckedAll').click(function () {
  509. selectedCheckedAll(1);
  510. });
  511. /*选中的不通过*/
  512. $('#selectedCheckedNotAll').click(function () {
  513. selectedCheckedAll(2);
  514. });
  515. /*选中的不涉及*/
  516. $('#exclusiveCheckedAll').click(function () {
  517. selectedCheckedAll(4);
  518. });
  519. /*返回*/
  520. $('#back').click(function () {
  521. location.href = "../schdule/myIndex.html";
  522. });
  523. // 操作栏点击事件
  524. table.on('tool(tableMenu)', function (obj) {
  525. var data = obj.data;
  526. var layEvent = obj.event;
  527. if (layEvent == 'check-qualified') { // 通过
  528. selectedCheckedAll(6, data);
  529. } else if (layEvent == 'add-hdanger') { // 提交隐患
  530. showAddModel(data);
  531. } else if (layEvent == 'check-un-qualified') { // 不通过
  532. selectedCheckedAll(7, data);
  533. } else if (layEvent == 'check-barring') { // 不涉及
  534. selectedCheckedAll(5, data);
  535. }
  536. });
  537. /*检测选中值*/
  538. function selectedCheckedAll(i, data) {
  539. var idList = [];
  540. var checkResult; //检查结果:1检查通过;2存在隐患;3不涉及
  541. var checkRecordLogId; //检查记录ID
  542. var checkItemContentDefIds; //通过
  543. var exclusiveContentIds; //不涉及
  544. //4批量不涉及、1批量通过、1全部通过、2批量不通过
  545. if (i === 1 || i === 2 || i === 4) {
  546. var chkList = $("table input[name=layTableCheckbox]:checked");
  547. if (chkList.length === 0) {
  548. layer.msg('至少选择一项检查内容!');
  549. return;
  550. }
  551. chkList.each(function () {
  552. idList.push($(this).val());
  553. });
  554. if (i === 1) {
  555. checkResult = CHECK_RESULT_TG;
  556. } else if (i === 2) {
  557. checkResult = CHECK_RESULT_BTG;
  558. } else if (i === 4) {
  559. checkResult = CHECK_RESULT_BSJ;
  560. }
  561. checkItemContentDefIds = idList.toString();
  562. } else if (i === 5) { //单条提交【检查不涉及】记录
  563. checkResult = CHECK_RESULT_BSJ;
  564. idList.push(data.checkItemDefId);
  565. checkItemContentDefIds = idList.toString();
  566. checkRecordLogId = data.checkRecordLogId;
  567. } else if (i === 6) { //单条提交【检查通过】记录
  568. checkResult = CHECK_RESULT_TG;
  569. idList.push(data.checkItemDefId);
  570. checkItemContentDefIds = idList.toString();
  571. checkRecordLogId = data.checkRecordLogId;
  572. } else if (i === 7) { //单条提交【检查不通过】记录
  573. checkResult = CHECK_RESULT_BTG;
  574. idList.push(data.checkItemDefId);
  575. checkItemContentDefIds = idList.toString();
  576. checkRecordLogId = data.checkRecordLogId;
  577. }
  578. var dataMap = {
  579. "bizCheckDefType": 1, //非分级管控检查表
  580. 'checkItemContentDefIds': checkItemContentDefIds,
  581. 'scheduleId': scheduleId,
  582. 'riskPointId': riskPointId,
  583. 'bizCheckDefId': bizCheckDefId,
  584. 'checkNumber': scheduleCurrentCount,
  585. 'totalCheckCount': totalCheckCount,
  586. 'checkResult': checkResult,
  587. 'checkRecordNo': checkRecordNo,
  588. 'isScheduleCheck': 0,
  589. 'remark': '检查结果正常',
  590. 'checkRecordLogId': checkRecordLogId,
  591. };
  592. saveCheckRecord(dataMap);
  593. }
  594. // 保存处理
  595. function saveCheckRecord(data) {
  596. layer.confirm('确定要提交吗?', {
  597. skin: 'layui-layer-admin',
  598. shade: .1
  599. }
  600. , function (i) {
  601. layer.close(i);
  602. layer.load();
  603. var url = uParas.baseUrl + '/ent/schduleChecked/saveCheckRecord';
  604. admin.req(url, data, function (resp) {
  605. layer.closeAll('loading');
  606. if (resp.code == 1) {
  607. layer.close();
  608. layer.msg(resp.msg);
  609. renderTable();
  610. } else {
  611. layer.msg(resp.msg);
  612. }
  613. }, 'POST');
  614. });
  615. }
  616. // 检查完成
  617. function saveCheckFinish(data) {
  618. layer.confirm('确定检查完成?', {
  619. skin: 'layui-layer-admin',
  620. shade: .1
  621. }
  622. , function (i) {
  623. layer.close(i);
  624. layer.load();
  625. var url = uParas.baseUrl + '/ent/schduleChecked/schduleCheckFinish';
  626. admin.req(url, data, function (resp) {
  627. layer.closeAll('loading');
  628. if (resp.code == 1) {
  629. layer.close();
  630. layer.msg(resp.msg);
  631. location.href = "../schdule/myIndex.html";
  632. } else {
  633. layer.msg(resp.msg);
  634. }
  635. }, 'POST');
  636. });
  637. }
  638. // 添加隐患
  639. function goAddPage(data) {
  640. location.href = "./addHdanger.html?checkItemDefId=" + data.checkItemDefId +
  641. '&scheduleId=' + scheduleId +
  642. '&riskPointId=' + riskPointId +
  643. '&checkRecordNo=' + checkRecordNo +
  644. '&bizCheckDefId=' + bizCheckDefId +
  645. '&scheduleId=' + scheduleId;
  646. '&scheduleCurrentCount=' + scheduleCurrentCount;
  647. '&totalCheckCount=' + totalCheckCount;
  648. }
  649. //【添加隐患】 显示新增弹窗
  650. function showAddModel(data) {
  651. admin.open({
  652. type: 1,
  653. title: '添加隐患',
  654. area: ['60%', '700px'],
  655. content: $('#modelTpl').html(),
  656. success: function (layero, dIndex) {
  657. /*检查记录ID*/
  658. $("#checkRecordLogId").val(data.checkRecordLogId);
  659. $("#checkContentId").val(data.checkItemDefId);
  660. initData();
  661. // 提交
  662. form.on('submit(formSubmit)', function (data) {
  663. var paths = $('input[name="attachPath"]');
  664. if (paths && paths.length > 0) {
  665. var attachPathVal = [];
  666. paths.each(function () {
  667. attachPathVal.push($(this).val());
  668. });
  669. data.field.attachPathVal = attachPathVal.join(",");
  670. $("#attachPathVal").val(attachPathVal.join(","));
  671. }
  672. submit(1, data);
  673. return false;
  674. });
  675. // 保存至待提交
  676. form.on('submit(formSave)', function (data) {
  677. var paths = $('input[name="attachPath"]');
  678. if (paths && paths.length > 0) {
  679. var attachPathVal = [];
  680. paths.each(function () {
  681. attachPathVal.push($(this).val());
  682. });
  683. data.field.attachPathVal = attachPathVal.join(",");
  684. $("#attachPathVal").val(attachPathVal.join(","));
  685. }
  686. submit(0, data);
  687. return false;
  688. });
  689. }
  690. });
  691. }
  692. // 提交
  693. function submit(status, data) {
  694. var url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveHdanger";
  695. data.field.status = status;
  696. admin.req(url, data.field, function (res) {
  697. layer.closeAll('loading');
  698. if (res.code == 1) {
  699. layer.msg(res.msg);
  700. renderTable();
  701. layer.closeAll();
  702. } else {
  703. // alert();
  704. //console.log(res.msg);
  705. layer.msg(res.msg);
  706. return false;
  707. }
  708. }, 'POST');
  709. }
  710. function initData() {
  711. if (scheduleId != null && scheduleId != '') {
  712. $("#isScheduleCheck").val(1);
  713. $("#scheduleId").val(scheduleId);
  714. } else {
  715. $("#isScheduleCheck").val(0);
  716. }
  717. $("#riskPointId").val(riskPointId);
  718. $("#checkRecordNo").val(checkRecordNo);
  719. $("#bizCheckDefId").val(bizCheckDefId);
  720. $("#scheduleCurrentCount").val(scheduleCurrentCount);
  721. $("#totalCheckCount").val(totalCheckCount);
  722. /*整改期限*/
  723. laydate.render({
  724. elem: '#hdangerRetifyDeadline',
  725. format: 'yyyy-MM-dd HH:mm:ss',
  726. type: 'datetime',
  727. min: 'date',
  728. });
  729. /*检测 隐患评审流程*/
  730. admin.req(uParas.baseUrl + '/ent/hiddenDanger/checkedHdangerReview', null, function (res) {
  731. if (res.code == 1) {
  732. var isHdangerReview = res.data.isHdangerReview;
  733. if (isHdangerReview) {
  734. /*评审*/
  735. $(".hdanger-review").show();
  736. $(".hdanger-retify").hide();
  737. $(".hdanger-accepted").hide();
  738. $(".work-flow-review-group-hint").attr("lay-verify", 'required');
  739. $(".work-flow-review-group-hint").attr("lay-verType", 'tips');
  740. $(".work-flow-review-by-hint").attr("lay-verify", 'required');
  741. $(".work-flow-review-by-hint").attr("lay-verType", 'tips');
  742. $(".work-flow-retify-group-hint").removeAttr("lay-verify", 'required');
  743. $(".work-flow-retify-by-hint").removeAttr("lay-verType", 'tips');
  744. $(".work-flow-accepted-group-hint").removeAttr("lay-verify", 'required');
  745. $(".work-flow-accepted-by-hint").removeAttr("lay-verType", 'tips');
  746. } else {
  747. /*不评审*/
  748. $(".hdanger-review").hide();
  749. $(".hdanger-retify").show();
  750. $(".hdanger-accepted").show();
  751. $(".work-flow-review-group-hint").removeAttr("lay-verify", 'required');
  752. $(".work-flow-review-by-hint").removeAttr("lay-verType", 'tips');
  753. $(".work-flow-retify-group-hint").attr("lay-verify", 'required');
  754. $(".work-flow-retify-group-hint").attr("lay-verType", 'tips');
  755. $(".work-flow-retify-by-hint").attr("lay-verify", 'required');
  756. $(".work-flow-retify-by-hint").attr("lay-verType", 'tips');
  757. $(".work-flow-accepted-group-hint").attr("lay-verify", 'required');
  758. $(".work-flow-accepted-group-hint").attr("lay-verType", 'tips');
  759. $(".work-flow-accepted-by-hint").attr("lay-verify", 'required');
  760. $(".work-flow-accepted-by-hint").attr("lay-verType", 'tips');
  761. }
  762. }
  763. }, 'get');
  764. /*隐患等级*/
  765. uParas.initSimpleSelect("hdangerLevel", "modelForm", "/admin/common/getHdangerLevelList", "keyName", "keyValue");
  766. /*隐患类型*/
  767. uParas.initSimpleSelect("hdangerCatId", "modelForm", "/admin/common/getCommonClassifyesByCatType?catType=1", "catName", "catId");
  768. var groupUrl = '/admin/common/getFindGroupLists';
  769. /*整改部门and人员*/
  770. _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupRetify", "hdangerRetifyGroupName",
  771. "hdangerRetifyGroup", "menuContentRetify", "hdangerRetifyBy", "modelForm");
  772. /*评审部门and人员*/
  773. _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupReview", "hdangerReviewGroupName",
  774. "hdangerReviewGroup", "menuContentReview", "hdangerReviewBy", "modelForm");
  775. /*验收部门and人员*/
  776. _groupTree.initgroupTreeAndUsers(groupUrl, "threeLevelGroupAccepted", "hdangerAcceptedGroupName",
  777. "hdangerAcceptedGroup", "menuContentAccepted", "hdangerAcceptedBy", "modelForm");
  778. // 上传实例
  779. var uploadFile = upload.render({
  780. elem: '#test1', //绑定元素
  781. url: uParas.baseUrl + '/admin/uploadFile', //上传接口
  782. accept: 'file',
  783. acceptMime: 'image/jpg,image/png,image/gif,image/jpeg,image/bmp,image/tga,image/fpx,image/raw,', //(只显示 jpg 和 png 文件)
  784. size: 30720,//设置文件最大可允许上传的大小,单位 KB。不支持ie8/9
  785. done: function (response) {
  786. var paths = $('input[name="attachPath"]');
  787. if (paths && paths.length > 0) {
  788. var attachPathVal = [];
  789. paths.each(function () {
  790. attachPathVal.push($(this).val());
  791. });
  792. if (attachPathVal.length > 6) {
  793. layer.msg("照片数量已达上限");
  794. return false;
  795. }
  796. }
  797. //上传完毕回调
  798. fileHtml(response.data.ext, response.data.path, response.data.oriFileName, true);
  799. }
  800. , error: function () {
  801. //请求异常回调
  802. }
  803. });
  804. }
  805. function fileHtml(ext, path, oriFileName, isNew) {
  806. var Str = '';
  807. if (isNew) {
  808. Str = '<span style="color: #1E9FFF;">(新)</span>';
  809. }
  810. //文件图标
  811. var icon = '';
  812. if (ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif') {
  813. icon = '<img style="width: 60px;height: 80px;" src="' + path + '" alt="">';
  814. } else {
  815. icon = '<img style="width: 60px;height: 80px;" src="' + path + '" alt="">';
  816. }
  817. //文件信息置入隐藏域
  818. var html = '';
  819. html += '<div style="padding-top: 6px;padding-right: 10px;float: left;">';
  820. html += '<input type="hidden" name="attachPath" value="' + path + '"/>';
  821. html += icon;
  822. html += '<br>' + Str + '<a style="color: indianred;float: right;margin-right: 15px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  823. html += '</div>';
  824. $("#fileDiv").append(html);
  825. }
  826. });
  827. //删除附件
  828. function deleteFile(obj) {
  829. var pDiv = $(obj).parent();
  830. pDiv.remove();
  831. }
  832. </script>
  833. </body>
  834. </html>