workFlow.html 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  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/formSelects/formSelects-v4.css"/>
  10. <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
  11. <link rel="stylesheet" href="../../../assets/module/uParas.css?v=312"/>
  12. </head>
  13. <body>
  14. <style type="text/css">
  15. /*table th{*/
  16. /* color: #ffb800;*/
  17. /*}*/
  18. </style>
  19. <!-- 加载动画 -->
  20. <div class="page-loading">
  21. <div class="ball-loader">
  22. <span></span><span></span><span></span><span></span>
  23. </div>
  24. </div>
  25. <!-- 正文开始 -->
  26. <div class="layui-fluid">
  27. <div class="layui-card">
  28. <div class="layui-card-header">
  29. 隐患流程治理
  30. <div class="layui-inline pull-right">
  31. <button onclick="history.back()" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal"><i class="layui-icon">&#xe65c;</i>返回</button>
  32. </div>
  33. </div>
  34. <form class="layui-form" lay-filter="layuiForm">
  35. <div class="overflow-y-730px">
  36. <div class="layui-card-body ">
  37. <!--流程处理开始---------------------------------------------------------------------------------->
  38. <div class="layui-elem-quote">
  39. <div class="layui-card-body">
  40. <div class="layui-form-item layui-row">
  41. <fieldset class="layui-elem-field layui-field-title">
  42. <legend class="" id="work_flow_hint" style="color: indianred;font-size: 18px;"></legend>
  43. </fieldset>
  44. <input type="hidden" id="hdangerId" name="hdangerId" value="">
  45. <input type="hidden" id="status" name="status" value="">
  46. <input type="hidden" id="entrustType" name="entrustType" value="">
  47. <!--委托处理-->
  48. <div class="layui-inline layui-col-md10 p-top10px">
  49. <label class="layui-form-label">委托处理</label>
  50. <div class="layui-input-block text-left">
  51. <input type="radio" id="0" name="isEntrust" value="0" title="否" checked="" lay-filter="isEntrust">
  52. <input type="radio" id="1" name="isEntrust" value=1 title="是" lay-filter="isEntrust">
  53. </div>
  54. </div>
  55. <div class="layui-inline layui-col-md10 p-top10px isEntrust display-none">
  56. <label class="layui-form-label">委托部门</label>
  57. <div class="layui-input-block">
  58. <input type="text" id="hdangerEntrustGroupName" class="layui-input wthint" name="hdangerEntrustGroupName"
  59. value=""
  60. placeholder="点击选择部门"
  61. class="form-control" readonly >
  62. <input type="hidden" id="hdangerEntrustGroup" name="hdangerEntrustGroup" readonly>
  63. <div id="menuContentEntrust" class="menuContent">
  64. <ul id="threeLevelGroupEntrust" class="ztree" style="margin-top:0;"></ul>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="layui-inline layui-col-md10 p-top10px isEntrust display-none" >
  69. <label class="layui-form-label">委托人员</label>
  70. <div class="layui-input-block">
  71. <select id="entrustUserId" name="entrustUserId" class="layui-input-block" lay-filter="layuiForm">
  72. <option value="">点击选择人员</option>
  73. </select>
  74. </div>
  75. </div>
  76. <!--验收-->
  77. <dev class="work-flow-accept display-none">
  78. </dev>
  79. <!--整改开始---------------------------------------------->
  80. <dev class="work-flow-retify display-none">
  81. <div class="layui-inline layui-col-md10 p-top10px">
  82. <label class="layui-form-label">整改类型</label>
  83. <div class="layui-input-block text-left">
  84. <input type="radio" name="wf_hdangerRetifyType" value="0" title="自行整改" checked="" lay-filter="wf_hdangerRetifyType">
  85. <input type="radio" name="wf_hdangerRetifyType" value=1 title="协助整改" lay-filter="wf_hdangerRetifyType">
  86. </div>
  87. </div>
  88. <div class="layui-inline layui-col-md10 p-top10px display-none wf_hdangerRetifyAssistingunit">
  89. <label class="layui-form-label">协助单位</label>
  90. <div class="layui-input-block">
  91. <input type="text" id="wf_hdangerRetifyAssistingunit"
  92. class="layui-input retifyAssistingunit-hint" name="wf_hdangerRetifyAssistingunit"
  93. value="" placeholder="请输入协助整改的单位名称...(最多输入64个字)" maxlength="64">
  94. </div>
  95. </div>
  96. <div class="layui-inline layui-col-md10 p-top10px ">
  97. <label class="layui-form-label">原因分析</label>
  98. <div class="layui-input-block">
  99. <textarea class="layui-textarea work-flow-retify-hint"
  100. maxlength="256" placeholder="请输入原因分析...(最多输入256个字)"
  101. name="wf_hdangerRetifyReasons"
  102. id="wf_hdangerRetifyReasons"></textarea>
  103. </div>
  104. </div>
  105. <div class="layui-inline layui-col-md10 p-top10px ">
  106. <label class="layui-form-label">整改措施</label>
  107. <div class="layui-input-block">
  108. <textarea class="layui-textarea work-flow-retify-hint"
  109. maxlength="256" placeholder="请输入整改措施...(最多输入256个字)"
  110. name="wf_hdangerRetifyMeasures"
  111. id="wf_hdangerRetifyMeasures"></textarea>
  112. </div>
  113. </div>
  114. <div class="layui-inline layui-col-md3 p-top10px " >
  115. <label class="layui-form-label">整改费用</label>
  116. <div class="layui-input-block">
  117. <input class="layui-input work-flow-retify-hint" type="number"
  118. id="wf_hdangerRetifyAmountspent" name="wf_hdangerRetifyAmountspent" value=""
  119. onkeyup= "if(!/^d*(?:.d{0,2})?$/.test(this.value));"
  120. placeholder="金额 < 9999999.99" max="9999999.99" min="0.00" maxlength="11" >
  121. </div>
  122. </div>
  123. </dev>
  124. <!--整改结束---------------------------------------------->
  125. <!--评审开始---------------------------------------------->
  126. <dev class="work-flow-review isReview display-none">
  127. <div class="layui-inline layui-col-md10 p-top10px">
  128. <label class="layui-form-label">隐患等级</label>
  129. <div class="layui-input-block">
  130. <select id="wf_hdangerLevel" name="wf_hdangerLevel" lay-filter="layuiForm"
  131. class="layui-input-block work-flow-review-hint">
  132. <option value="">点击选择</option>
  133. </select>
  134. </div>
  135. </div>
  136. <div class="layui-inline layui-col-md10 p-top10px">
  137. <label class="layui-form-label">整改部门</label>
  138. <div class="layui-input-block">
  139. <input type="text" id="wf_hdangerRetifyGroupName"
  140. class="layui-input work-flow-review-hint" name="wf_hdangerRetifyGroupName"
  141. value=""
  142. placeholder="点击选择部门"
  143. class="form-control" readonly>
  144. <input type="hidden" id="wf_hdangerRetifyGroup" name="wf_hdangerRetifyGroup" readonly>
  145. <div id="menuContentRetify" class="menuContent">
  146. <ul id="threeLevelGroupRetify" class="ztree" style="margin-top:0;"></ul>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="layui-inline layui-col-md10 p-top10px">
  151. <label class="layui-form-label ">整改人员</label>
  152. <div class="layui-input-block">
  153. <select id="wf_hdangerRetifyBy" name="wf_hdangerRetifyBy" class="layui-input-block work-flow-review-hint"
  154. lay-filter="layuiForm">
  155. <option value="">点击选择人员</option>
  156. </select>
  157. </div>
  158. </div>
  159. <div class="layui-inline layui-col-md10 p-top10px">
  160. <label class="layui-form-label">整改期限</label>
  161. <div class="layui-input-block">
  162. <input type="text" name="wf_hdangerRetifyDeadline" id="wf_hdangerRetifyDeadline"
  163. placeholder="点击选择整改期限"
  164. lay-verify="datetime" autocomplete="off" class="layui-input work-flow-review-hint">
  165. </div>
  166. </div>
  167. <div class="layui-inline layui-col-md10 p-top10px">
  168. <label class="layui-form-label">验收部门</label>
  169. <div class="layui-input-block">
  170. <input type="text" id="wf_hdangerAcceptedGroupName"
  171. class="layui-input work-flow-review-hint" name="wf_hdangerAcceptedGroupName"
  172. value=""
  173. placeholder="点击选择部门"
  174. class="form-control" readonly>
  175. <input type="hidden" id="wf_hdangerAcceptedGroup" name="wf_hdangerAcceptedGroup" readonly>
  176. <div id="menuContentAccepted" class="menuContent">
  177. <ul id="threeLevelGroupAccepted" class="ztree" style="margin-top:0;"></ul>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="layui-inline layui-col-md10 p-top10px">
  182. <label class="layui-form-label ">验收人员</label>
  183. <div class="layui-input-block">
  184. <select id="wf_hdangerAcceptedBy" name="wf_hdangerAcceptedBy" class="layui-input-block work-flow-review-hint"
  185. lay-filter="layuiForm">
  186. <option value="">点击选择人员</option>
  187. </select>
  188. </div>
  189. </div>
  190. <div class="layui-inline layui-col-md10 p-top10px">
  191. <label class="layui-form-label">递交整改方案</label>
  192. <div class="layui-input-block text-left">
  193. <input type="radio" checked name="programmeRetify" value="1" title="是" lay-filter="isProgramme">
  194. <input type="radio" name="programmeRetify" value="0" title="否" lay-filter="isProgramme">
  195. </div>
  196. </div>
  197. <div class="layui-inline layui-col-md10 p-top10px is-programme" >
  198. <label class="layui-form-label">整改方案</label>
  199. <div class="layui-input-block">
  200. <select id="programmeId" name="programmeId" class="layui-input-block programme-retify" lay-filter="programmeForm">
  201. <option value="">点击选择方案</option>
  202. </select>
  203. </div>
  204. </div>
  205. </dev>
  206. <!--评审结束---------------------------------------------------------------->
  207. <div class="layui-inline layui-col-md10 p-top10px wf_desc display-none">
  208. <label class="layui-form-label">备注信息</label>
  209. <div class="layui-input-block">
  210. <textarea class="layui-textarea" placeholder="请输入备注信息...(最多输入256个字)"
  211. name="wf_desc" id="wf_desc" maxlength="256"></textarea>
  212. </div>
  213. </div>
  214. <div class="layui-inline layui-col-md10 p-top10px isAdopt display-none">
  215. <label class="layui-form-label">处理结果</label>
  216. <div class="layui-input-block text-left">
  217. <input type="radio" name="isAdopt" value="1" title="通过" checked="" lay-filter="isAdopt">
  218. <input type="radio" name="isAdopt" value="0" title="不通过" lay-filter="isAdopt">
  219. </div>
  220. </div>
  221. <!--附件-->
  222. <div class="layui-inline layui-col-md10 p-top10px work-flow-upload-file display-none">
  223. <label class="layui-form-label">现场附件</label>
  224. <div class="layui-input-block text-left">
  225. <button type="button" class="layui-btn" id="uploadFile">
  226. <i class="layui-icon">&#xe67c;</i>上传照片
  227. </button>
  228. <span style="color: indianred;font-size: 16px;">支持图片格式:jpg / png /gif / jpeg / bmp / tga / fpx / raw</span>
  229. <input type="hidden" name="attachTitle" id="attachTitle"/>
  230. <input type="hidden" name="attachPath" id="attachPath"/>
  231. <input type="hidden" name="attachExt" id="attachExt"/>
  232. <div id="fileDiv" style="padding-top: 10px;"></div>
  233. </div>
  234. </div>
  235. <div class="layui-inline layui-col-md5" style="padding-left: 40px;">
  236. <button onclick="save()" lay-filter="formSubmit" lay-submit
  237. class=" layui-btn layui-btn-radius bg-c-submit" style="height: 30px;line-height: 0px;">提&nbsp;&nbsp;&nbsp;交</button>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <!--流程处理结束------------------------------------------------------------------------------>
  244. <!--隐患基本信息开始-------------------------------------------------------------------------->
  245. <div class="layui-tab layui-tab-brief" lay-filter="">
  246. <div class="layui-tab-content" style="height: auto;">
  247. <div class="layui-tab-item layui-show">
  248. <fieldset class="layui-elem-field layui-field-title">
  249. <legend>隐患基本信息</legend>
  250. </fieldset>
  251. <div class="layui-row" >
  252. <!--<script type="text/html">-->
  253. <div class="layui-col-xs12">
  254. <div class="layui-form">
  255. <table class="layui-table">
  256. <!--<colgroup>-->
  257. <!--<col width="150">-->
  258. <!--<col width="150">-->
  259. <!--<col width="200">-->
  260. <!--<col>-->
  261. <!--</colgroup>-->
  262. <thead>
  263. </thead>
  264. <tbody>
  265. <tr>
  266. <th width="150" >隐患名称</th>
  267. <td id="hdangerTitle"></td>
  268. <th width="150">隐患类型</th>
  269. <td id="hdangerCatTitle">
  270. </td>
  271. </tr>
  272. <tr>
  273. <th width="150">单位名称</th>
  274. <td id="companyName" ></td>
  275. <th width="150">部门名称</th>
  276. <td id="groupName"></td>
  277. </tr>
  278. <tr>
  279. <th width="150">隐患等级</th>
  280. <td id="hdangerLevelName"></td>
  281. <th width="150">隐患状态</th>
  282. <td id="statusStr"></td>
  283. </tr>
  284. <tr>
  285. <th width="150">现场描述</th>
  286. <td id="hdangerDesc" colspan="3"></td>
  287. </tr>
  288. <tr>
  289. <th width="150">风险点名称</th>
  290. <td id="riskPointName"></td>
  291. <th width="150">风险点等级</th>
  292. <td id="riskPointLevelName"></td>
  293. </tr>
  294. <tr>
  295. <th width="150">检查表名称</th>
  296. <td id="bizCheckDefName"></td>
  297. <th width="150">风险点类型</th>
  298. <td id="riskPointTypeName"></td>
  299. </tr>
  300. <tr>
  301. <th width="150">危险源 / 检查项</th>
  302. <td id="checkItemName" colspan="3"></td>
  303. </tr>
  304. <tr>
  305. <th width="150">管控措施 / 检查内容</th>
  306. <td id="checkContentName" colspan="3"></td>
  307. </tr>
  308. <tr>
  309. <th width="150">当前处理人</th>
  310. <td id="executor"></td>
  311. <th width="150">整改期限</th>
  312. <td id="hdangerRetifyDeadline"></td>
  313. </tr>
  314. <tr>
  315. <th width="150">提交人员</th>
  316. <td id="hdangerCreatedByName"></td>
  317. <th width="150">提交时间</th>
  318. <td id="createdTime"></td>
  319. </tr>
  320. <tr>
  321. <th width="150">发生时间</th>
  322. <td id="happenedTime"></td>
  323. <th width="150">闭环时间</th>
  324. <td id="finishedTime"></td>
  325. </tr>
  326. <tr class="getHdangerAtt" style="display: none">
  327. <th colspan="4" style="border-bottom: 0px">隐患现场照片</th>
  328. </tr>
  329. <tr class="getHdangerAtt" style="display: none">
  330. <td id="hdangerAtt" colspan="4"></td>
  331. </tr>
  332. <tr class="getHdangerVideo" style="display: none">
  333. <th colspan="4" style="border-bottom: 0px">隐患现场视频</th>
  334. </tr>
  335. <tr class="getHdangerVideo" style="display: none">
  336. <td id="hdangerVideo" colspan="4"></td>
  337. </tr>
  338. <tr style="border-left: 0px;border-right: 0px;" >
  339. <td style="border-left: 0px;border-right: 0px;" colspan="4">
  340. <fieldset class="layui-elem-field layui-field-title">
  341. <legend>评审信息</legend>
  342. </fieldset>
  343. </td>
  344. </tr>
  345. <tr>
  346. <th width="150">评审部门</th>
  347. <td id="hdangerReviewGroupName"></td>
  348. <th width="150">评审人员</th>
  349. <td id="hdangerReviewByName"></td>
  350. </tr>
  351. <tr class="getReviewRecord" style="display: none;">
  352. <th width="150">评审结果</th>
  353. <td id="hdangerReviewResult"></td>
  354. <th width="150">评审日期</th>
  355. <td id="hdangerReviewTime"></td>
  356. </tr>
  357. <tr class="getReviewRecord" style="display: none;">
  358. <th width="150">评审说明</th>
  359. <td colspan="3" id="hdangerReviewRemark"></td>
  360. </tr>
  361. <tr style="border-left: 0px;border-right: 0px;" >
  362. <td style="border-left: 0px;border-right: 0px;" colspan="4">
  363. <fieldset class="layui-elem-field layui-field-title">
  364. <legend>整改信息</legend>
  365. </fieldset>
  366. </td>
  367. </tr>
  368. <tr>
  369. <th width="150">整改部门</th>
  370. <td id="hdangerRetifyGroupName"></td>
  371. <th width="150">整改人员</th>
  372. <td id="hdangerRetifyByName"></td>
  373. </tr>
  374. <tr class="getRetifyRecord" style="display: none;">
  375. <th width="150">整改类型</th>
  376. <td id="hdangerRetifyTypeName"></td>
  377. <th width="150">协助单位</th>
  378. <td id="hdangerRetifyAssistingunit"></td>
  379. </tr>
  380. <tr class="getRetifyRecord" style="display: none;">
  381. <th width="150">整改费用</th>
  382. <td id="hdangerRetifyAmountspent"></td>
  383. <th width="150">整改时间</th>
  384. <td id="hdangerRetifycreatedTime"></td>
  385. </tr>
  386. <tr class="getRetifyRecord" style="display: none;">
  387. <th width="150">原因分析</th>
  388. <td colspan="3" id="hdangerRetifyReasons"></td>
  389. </tr>
  390. <tr class="getRetifyRecord" style="display: none;">
  391. <th width="150">整改措施</th>
  392. <td colspan="3" id="hdangerRetifyMeasures"></td>
  393. </tr>
  394. <tr class="getRetifyAtt" style="display: none">
  395. <th colspan="4" style="border-bottom: 0px">最近整改照片</th>
  396. </tr>
  397. <tr class="getRetifyAtt" style="display: none;border-bottom: 0px;">
  398. <td id="retifyAtt" colspan="4" style="border-bottom: 0px;"></td>
  399. </tr>
  400. <tr class="getRetifyVideo" style="display: none">
  401. <th colspan="4" style="border-bottom: 0px">最近整改视频</th>
  402. </tr>
  403. <tr class="getRetifyVideo" style="display: none">
  404. <td id="retifyVideo" colspan="4"></td>
  405. </tr>
  406. <tr style="border-left: 0px;border-right: 0px;" >
  407. <td style="border-left: 0px;border-right: 0px;" colspan="4">
  408. <fieldset class="layui-elem-field layui-field-title">
  409. <legend>验收信息</legend>
  410. </fieldset>
  411. </td>
  412. </tr>
  413. <tr>
  414. <th width="150">验收部门</th>
  415. <td id="hdangerAcceptedGroupName"></td>
  416. <th width="150">验收人员</th>
  417. <td id="hdangerAcceptedByName"></td>
  418. </tr>
  419. <tr class="getAcceptRecord" style="display: none;">
  420. <th width="150">验收结果</th>
  421. <td id="hdangerAcceptedResult"></td>
  422. <th width="150">验收日期</th>
  423. <td id="hdangerAcceptedTime"></td>
  424. </tr>
  425. <tr class="getAcceptRecord" style="display: none;">
  426. <th width="150">验收说明</th>
  427. <td colspan="3" id="hdangerAcceptedRemark"></td>
  428. </tr>
  429. <tr class="getAcceptAtt" style="display: none">
  430. <th colspan="4" style="border-bottom: 0px">最近验收照片</th>
  431. </tr>
  432. <tr class="getAcceptAtt" style="display: none">
  433. <td id="acceptAtt" colspan="4"></td>
  434. </tr>
  435. <tr class="getRetifyVideo" style="display: none">
  436. <th colspan="4" style="border-bottom: 0px">最近验收视频</th>
  437. </tr>
  438. <tr class="getRetifyVideo" style="display: none;border-bottom: 0px;">
  439. <td id="acceptVideo" colspan="4" style="border-bottom: 0px"></td>
  440. </tr>
  441. </tbody>
  442. </table>
  443. </div>
  444. </div>
  445. <!--// </script>-->
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. <!--隐患基本信息结束-------------------------------------------------------------------------->
  451. <div class="layui-inline layui-col-md5" style="padding-top: 150px;"></div>
  452. </div>
  453. </form>
  454. </div>
  455. </div>
  456. <!-- js部分 -->
  457. <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
  458. <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
  459. <script>
  460. var hdangerId; //隐患ID
  461. var workFlowType; //流程类型:1评审;2整改;3验收;
  462. var hdangerStatus; //隐患状态
  463. var entrustType; //委托类型:委托评审 == 1;委托整改 == 2;委托验收 == 3;
  464. var wfIsEntrust = false; //是否委托
  465. var wfIsAdopt = false; //是否通过
  466. var $;
  467. var layer;
  468. var form;
  469. var util;
  470. var admin;
  471. var uParas;
  472. var element;
  473. var _threeLevelGroupEntrust;
  474. var _groupTree;
  475. layui.use(['layer', 'form', 'table','laydate', 'util','upload','zTree', 'admin', 'uParas', 'element', 'laytpl','_zTree','_groupTree'], function () {
  476. $ = layui.jquery;
  477. layer = layui.layer;
  478. form = layui.form;
  479. util = layui.util;
  480. admin = layui.admin;
  481. uParas = layui.uParas;
  482. element = layui.element, laytpl = layui.laytpl;
  483. threeLevelGroupEntrust = layui._threeLevelGroupEntrust;
  484. _groupTree = layui._groupTree;
  485. var laydate = layui.laydate;
  486. var upload = layui.upload,
  487. hdangerId = uParas.getUrlParam("hdangerId");
  488. workFlowType = uParas.getUrlParam("workFlowType");
  489. hdangerStatus = uParas.getUrlParam("hdangerStatus");
  490. $("#entrustType").val(workFlowType);
  491. /*整改期限*/
  492. laydate.render({
  493. elem: '#wf_hdangerRetifyDeadline',
  494. format: 'yyyy-MM-dd',
  495. type: 'datetime',
  496. min:'date',
  497. });
  498. var groupUrl = '/admin/common/findCompanyGroupLists';
  499. /**
  500. * ztree 整改部门 *******************************************
  501. */
  502. _groupTree.initgroupTreeAndUsers(groupUrl,"threeLevelGroupRetify","wf_hdangerRetifyGroupName",
  503. "wf_hdangerRetifyGroup","menuContentRetify","wf_hdangerRetifyBy","layuiForm");
  504. /**
  505. * ztree 验收部门 *******************************************
  506. */
  507. _groupTree.initgroupTreeAndUsers(groupUrl,"threeLevelGroupAccepted","wf_hdangerAcceptedGroupName",
  508. "wf_hdangerAcceptedGroup","menuContentAccepted","wf_hdangerAcceptedBy","layuiForm");
  509. /**
  510. * ztree 委托部门 *******************************************
  511. */
  512. _groupTree.initgroupTreeAndUsers(groupUrl,"threeLevelGroupEntrust","hdangerEntrustGroupName",
  513. "hdangerEntrustGroup","menuContentEntrust","entrustUserId","layuiForm");
  514. /*隐患整改方案*/
  515. uParas.initSimpleSelect("programmeId", "layuiForm", "/admin/common/getDhangerRetifyProgramme", "programmeName", "programmeId");
  516. admin.req(uParas.baseUrl + '/ent/hiddenDanger/details?hdangerId=' + hdangerId, null, function (res) {
  517. if (res.code == 1) {
  518. var hd = res.data;
  519. if(hd != null){
  520. //console.log(JSON.stringify(hd));
  521. if(workFlowType == 2 && (hdangerStatus == 2 || hdangerStatus == 5)){
  522. //示例
  523. var endTime = new Date(hd.hdangerRetifyDeadline).getTime() //假设为结束日期
  524. ,serverTime = new Date().getTime(); //假设为当前服务器时间,这里采用的是本地时间,实际使用一般是取服务端的
  525. util.countdown(endTime, serverTime, function(date, serverTime, timer){
  526. var str = '已超时('+hd.hdangerRetifyDeadline+')';
  527. if (date[0] > 0 || date[1] > 0 || date[2] > 0 || date[3] > 0) {
  528. str = '<span class="font-weight">'+ date[0] + '</span>天' +
  529. '<span class="font-weight">' + date[1] + '</span>小时' +
  530. '<span class="font-weight">' + date[2] + '</span>分钟' +
  531. '<span class="font-weight">' + date[3] + '</span>秒钟';
  532. }
  533. $('#work_flow_hint').html('隐患整改栏 &nbsp;&nbsp;&nbsp;&nbsp; 倒计时:'+str);
  534. $('#hdangerRetifyDeadline').html(str);
  535. });
  536. }else{
  537. $("#hdangerRetifyDeadline").val(hd.hdangerRetifyDeadline);
  538. }
  539. $("#hdangerId").val(hd.hdangerId);
  540. $("#status").val(hd.status);
  541. $("#hdangerTitle").text(hd.hdangerTitle);
  542. $("#hdangerDesc").text(hd.hdangerDesc);
  543. $("#hdangerLevelName").text(hd.hdangerLevelName);
  544. $("#hdangerCatTitle").text(hd.hdangerCatTitle);
  545. $("#bizCheckDefName").text(hd.bizCheckDefName);
  546. $("#riskPointLevelName").text(hd.riskPointLevelName);
  547. $("#riskPointTypeName").text(hd.riskPointTypeName);
  548. $("#riskPointName").text(hd.riskPointName);
  549. $("#checkItemName").text(hd.checkItemName);
  550. $("#checkContentName").text(hd.checkContentName);
  551. $("#statusStr").text(hd.statusStr);
  552. $("#companyName").text(hd.companyName);
  553. $("#groupName").text(hd.groupName);
  554. $("#hdangerReviewGroupName").text(hd.hdangerReviewGroupName);
  555. $("#hdangerReviewByName").text(hd.hdangerReviewByName);
  556. $("#hdangerRetifyGroupName").text(hd.hdangerRetifyGroupName);
  557. $("#hdangerRetifyByName").text(hd.hdangerRetifyByName);
  558. $("#hdangerAcceptedGroupName").text(hd.hdangerAcceptedGroupName);
  559. $("#hdangerAcceptedByName").text(hd.hdangerAcceptedByName);
  560. $("#hdangerCreatedByName").text(hd.hdangerCreatedByName);
  561. $("#hdangerRetifyDeadline").text(hd.hdangerRetifyDeadline);
  562. $("#executor").text(hd.executor);
  563. $("#createdTime").text(hd.createdTime);
  564. $("#happenedTime").text(hd.happenedTime);
  565. $("#finishedTime").text(hd.finishedTime);
  566. $("#executor").text(hd.executor);
  567. }
  568. var hiddendangerAtt = res.data.attachList;
  569. if(hiddendangerAtt.length > 0){
  570. $('.getHdangerAtt').show();
  571. var html = '';
  572. for (var i = 0; i < hiddendangerAtt.length; i++) {
  573. var att = hiddendangerAtt[i];
  574. if(att.attachType == "image"){
  575. html += '<a onclick="showImg(\''+ att.attachPath +'\');" style="margin-right: 10px;">';
  576. html += '<img style="width: 60px;height: 80px;" src="'+att.attachPath+'">';
  577. html += '</a>';
  578. }
  579. }
  580. $('#hdangerAtt ').html(html);
  581. }
  582. /**
  583. * 隐患等级 下拉 ********************************************
  584. */
  585. uParas.initSimpleSelect("wf_hdangerLevel", "layuiForm", "/admin/common/getHdangerLevelList", "keyName", "keyValue",hd.hdangerLevel);
  586. }
  587. }, 'get');
  588. /*评审记录*/
  589. admin.req(uParas.baseUrl + '/ent/hiddenDanger/getReviewRecord?hdangerId=' + hdangerId, null, function (res) {
  590. if (res.code == 1) {
  591. var records = res.data;
  592. var html = "";
  593. if (records.length > 0) {
  594. $("#hdangerReviewResult").text((records[0].hdangerReviewResult) != null ? (records[0].hdangerReviewResult):'-');
  595. $("#hdangerReviewRemark").text((records[0].hdangerReviewRemark) != null ? (records[0].hdangerReviewRemark):'-');
  596. $("#hdangerReviewTime").text((records[0].hdangerReviewTime) != null ? (records[0].hdangerReviewTime):'-');
  597. $('.getReviewRecord').show();
  598. // for (var i = 0; i < records.length; i++) {
  599. // html += "<tr>";
  600. // var record = records[i];
  601. // html += "<td>" + (i+1) + "</td>";
  602. // html += "<td>" + record.hdangerReviewTime + "</td>";
  603. // html += "<td>" + record.groupName + "</td>";
  604. // html += "<td>" + record.hdangerReviewByName + "</td>";
  605. // html += "<td>" + record.hdangerReviewResult + "</td>";
  606. // html += "<td>" + record.hdangerReviewRemark + "</td>";
  607. // html += "</tr>";
  608. // }
  609. // $('#reviewRecord ').html(html);
  610. }
  611. }
  612. }, 'get');
  613. /*整改记录*/
  614. admin.req(uParas.baseUrl + '/ent/hiddenDanger/getRetifyRecord?hdangerId=' + hdangerId, null, function (res) {
  615. if (res.code == 1) {
  616. var records = res.data;
  617. if (records.length > 0) {
  618. $("#hdangerRetifyAmountspent").text((records[0].hdangerRetifyAmountspent) != null ? (records[0].hdangerRetifyAmountspent + ' 元'):'-');
  619. $("#hdangerRetifyTypeName").text((records[0].hdangerRetifyTypeName) != null ? (records[0].hdangerRetifyTypeName):'-');
  620. $("#hdangerRetifyMeasures").text((records[0].hdangerRetifyMeasures) != null ? (records[0].hdangerRetifyMeasures):'-');
  621. $("#hdangerRetifyReasons").text(((records[0].hdangerRetifyReasons) != null && (records[0].hdangerRetifyReasons) != '') ? (records[0].hdangerRetifyReasons):'-');
  622. $("#hdangerRetifycreatedTime").text((records[0].createdTime) != null ? (records[0].createdTime):'-');
  623. $("#hdangerRetifyAssistingunit").text((records[0].hdangerRetifyAssistingunit) != null ? (records[0].hdangerRetifyAssistingunit):'-');
  624. var retifyAtt = records[0].attachList;
  625. if(retifyAtt.length > 0){
  626. $('#retifyAtt ').html('');
  627. $('.getRetifyAtt').show();
  628. var atthtml = '';
  629. for (var i = 0; i < retifyAtt.length; i++) {
  630. var att = retifyAtt[i];
  631. if(att.attachType == "image"){
  632. atthtml += '<a onclick="showImg(\''+ att.attachPath +'\');" style="margin-right: 10px;">';
  633. atthtml += '<img style="width: 60px;height: 80px;" src="'+att.attachPath+'">';
  634. atthtml += '</a>';
  635. }
  636. }
  637. $('#retifyAtt ').html(atthtml);
  638. }
  639. $('.getRetifyRecord').show();
  640. // var html = "";
  641. // for (var i = 0; i < records.length; i++) {
  642. // html += "<tr>";
  643. // var record = records[i];
  644. // html += "<td>" + (i+1) + "</td>";
  645. // html += "<td>" + record.hdangerRetifyDeadline + "</td>";
  646. // html += "<td>" + record.hdangerRetifyGroupName + "</td>";
  647. // html += "<td>" + record.hdangerRetifyByName + "</td>";
  648. // html += "<td>" + record.hdangerRetifyTypeName + "</td>";
  649. // html += "<td>" + record.hdangerRetifyAssistingunit + "</td>";
  650. // html += "<td>" + record.hdangerRetifyAmountspent + "</td>";
  651. // html += "<td>" + record.hdangerRetifyReasons + "</td>";
  652. // html += "<td>" + record.hdangerRetifyMeasures + "</td>";
  653. // html += "</tr>";
  654. // }
  655. // $('#retifyRecord ').html(html);
  656. }
  657. }
  658. }, 'get');
  659. /*验收记录*/
  660. admin.req(uParas.baseUrl + '/ent/hiddenDanger/getAcceptRecord?hdangerId=' + hdangerId, null, function (res) {
  661. if (res.code == 1) {
  662. var records = res.data;
  663. if (records.length > 0) {
  664. $("#hdangerAcceptedResult").text((records[0].hdangerAcceptedResult) != null ? (records[0].hdangerAcceptedResult):'-');
  665. $("#hdangerAcceptedRemark").text((records[0].hdangerAcceptedRemark) != null ? (records[0].hdangerAcceptedRemark):'-');
  666. $("#hdangerAcceptedTime").text((records[0].hdangerAcceptedTime) != null ? (records[0].hdangerAcceptedTime):'-');
  667. var acceptAtt = records[0].attachList;
  668. if(acceptAtt.length > 0){
  669. $('#acceptAtt ').html('');
  670. $('.getAcceptAtt').show();
  671. var atthtml = '';
  672. for (var i = 0; i < acceptAtt.length; i++) {
  673. var att = acceptAtt[i];
  674. if(att.attachType == "image"){
  675. atthtml += '<a onclick="showImg(\''+ att.attachPath +'\');" style="margin-right: 10px;">';
  676. atthtml += '<img style="width: 60px;height: 80px;" src="'+att.attachPath+'">';
  677. atthtml += '</a>';
  678. }
  679. }
  680. $('#acceptAtt ').html(atthtml);
  681. }
  682. $('.getAcceptRecord').show();
  683. // var html = "";
  684. // for (var i = 0; i < records.length; i++) {
  685. // html += "<tr>";
  686. // var record = records[i];
  687. // html += "<td>" + (i+1) + "</td>";
  688. // html += "<td>" + record.hdangerAcceptedTime + "</td>";
  689. // html += "<td>" + record.groupName + "</td>";
  690. // html += "<td>" + record.hdangerAcceptedByName + "</td>";
  691. // html += "<td>" + record.hdangerAcceptedResult + "</td>";
  692. // html += "<td>" + record.hdangerAcceptedRemark + "</td>";
  693. // html += "</tr>";
  694. // }
  695. // $('#acceptRecord ').html(html);
  696. }
  697. }
  698. }, 'get');
  699. if(workFlowType == 1 && hdangerStatus == 1){
  700. $('#work_flow_hint').text("隐患评审栏");
  701. $('.work-flow-review').show();
  702. $(".wf_desc").show();
  703. $(".isAdopt").show();
  704. $(".work-flow-review-hint").attr("lay-verify", 'required');
  705. $(".work-flow-review-hint").attr("lay-verType", 'tips');
  706. $(".programme-retify").attr("lay-verify", 'required');
  707. $(".programme-retify").attr("lay-verType", 'tips');
  708. entrustType = 1;
  709. }else if(workFlowType == 2 && (hdangerStatus == 2 || hdangerStatus == 5)){
  710. $('#work_flow_hint').text("隐患整改栏");
  711. $('.work-flow-retify').show();
  712. $(".wf_desc").hide();
  713. $(".isAdopt").hide();
  714. $(".work-flow-retify-hint").attr("lay-verify", 'required');
  715. $(".work-flow-retify-hint").attr("lay-verType", 'tips');
  716. $(".work-flow-upload-file").show();
  717. $(".work-flow-review-hint").removeAttr("lay-verify");
  718. $(".work-flow-review-hint").removeAttr("lay-verType", 'tips');
  719. entrustType = 2;
  720. }else if(workFlowType == 3 && hdangerStatus == 3){
  721. $('#work_flow_hint').text("隐患验收栏");
  722. $('.work-flow-accept').show();
  723. $(".wf_desc").show();
  724. $(".isAdopt").show();
  725. $(".work-flow-upload-file").show();
  726. entrustType = 3;
  727. }
  728. //单选框监听(处理结果)
  729. form.on("radio(isAdopt)", function (data) {
  730. if (this.value == 1) {
  731. wfIsAdopt = true;
  732. }else {
  733. wfIsAdopt = false;
  734. }
  735. });
  736. //单选框监听(整改类型)
  737. form.on("radio(wf_hdangerRetifyType)", function (data) {
  738. if (this.value == 1) {
  739. $(".wf_hdangerRetifyAssistingunit").show();
  740. $(".retifyAssistingunit-hint").attr("lay-verify", 'required');
  741. $(".retifyAssistingunit-hint").attr("lay-verType", 'tips');
  742. }else{
  743. $(".wf_hdangerRetifyAssistingunit").hide();
  744. $(".retifyAssistingunit-hint").removeAttr("lay-verify");
  745. $(".retifyAssistingunit-hint").removeAttr("lay-verType", 'tips');
  746. }
  747. });
  748. //单选框监听(整改方案)
  749. form.on("radio(isProgramme)", function (data) {
  750. if (this.value == 1) {
  751. $(".is-programme").show();
  752. $(".programme-retify").attr("lay-verify", 'required');
  753. $(".programme-retify").attr("lay-verType", 'tips');
  754. }else{
  755. $(".is-programme").hide();
  756. $(".programme-retify").removeAttr("lay-verify");
  757. $(".programme-retify").removeAttr("lay-verType", 'tips');
  758. }
  759. });
  760. //单选框监听(委托处理)
  761. form.on("radio(isEntrust)", function (data) {
  762. if (this.value == 1) { //委托处理
  763. wfIsEntrust = true;
  764. $(".isEntrust").show();
  765. $(".wf_desc").show();
  766. $(".wthint").attr("lay-verify", 'required');
  767. $(".wthint").attr("lay-verType", 'tips');
  768. $(".work-flow-upload-file").hide();
  769. $(".work-flow-retify-hint").removeAttr("lay-verify");
  770. $(".work-flow-retify-hint").removeAttr("lay-verType", 'tips');
  771. $(".work-flow-review-hint").removeAttr("lay-verify");
  772. $(".work-flow-review-hint").removeAttr("lay-verType", 'tips');
  773. if(workFlowType == 1 && hdangerStatus == 1){
  774. /*评审*/
  775. $(".work-flow-review").hide();
  776. $(".isReview").hide();
  777. $(".isAdopt").hide();
  778. }else if(workFlowType == 2 && (hdangerStatus == 2 || hdangerStatus == 5)){
  779. /*整改*/
  780. $(".work-flow-retify").hide();
  781. $(".wf_desc").hide();
  782. }else if(workFlowType == 3 && hdangerStatus == 3){
  783. /*验收*/
  784. $(".isAdopt").hide();
  785. }
  786. } else { //不委托
  787. wfIsEntrust = false;
  788. $(".isEntrust").hide();
  789. $(".wthint").removeAttr("lay-verify");
  790. $(".wthint").removeAttr("lay-verType");
  791. $(".work-flow-upload-file").removeAttr("display");
  792. if(workFlowType == 1 && hdangerStatus == 1){
  793. /*评审*/
  794. $(".work-flow-review").show();
  795. $(".isReview").show();
  796. $(".isAdopt").show();
  797. $(".wf_desc").show();
  798. $(".work-flow-retify-hint").removeAttr("lay-verify", 'required');
  799. $(".work-flow-retify-hint").removeAttr("lay-verType", 'tips');
  800. }else if(workFlowType == 2 && (hdangerStatus == 2 || hdangerStatus == 5)){
  801. /*整改*/
  802. $(".work-flow-retify").show();
  803. $(".wf_desc").hide();
  804. $(".work-flow-retify-hint").attr("lay-verify", 'required');
  805. $(".work-flow-retify-hint").attr("lay-verType", 'tips');
  806. $(".work-flow-upload-file").show();
  807. $(".work-flow-review-hint").removeAttr("lay-verify");
  808. $(".work-flow-review-hint").removeAttr("lay-verType", 'tips');
  809. }else if(workFlowType == 3 && hdangerStatus == 3){
  810. /*验收*/
  811. $(".isAdopt").show();
  812. $(".wf_desc").show();
  813. $(".work-flow-upload-file").show();
  814. }
  815. }
  816. });
  817. // 上传实例
  818. var uploadFile = upload.render({
  819. elem: '#uploadFile', //绑定元素
  820. url: uParas.baseUrl+'/admin/uploadFile', //上传接口
  821. accept:'file',
  822. acceptMime: 'image/jpg,image/png,image/gif,image/jpeg,image/bmp,image/tga,image/fpx,image/raw,', //(只显示 jpg 和 png 文件)
  823. size:30720,//设置文件最大可允许上传的大小,单位 KB。不支持ie8/9
  824. done: function(response){
  825. //上传完毕回调
  826. fileHtml(response.data.ext,response.data.path,response.data.oriFileName,true);
  827. }
  828. ,error: function(){
  829. //请求异常回调
  830. }
  831. });
  832. function fileHtml(ext,path,oriFileName,isNew){
  833. var Str = '';
  834. if(isNew){
  835. Str = '<span style="color: #1E9FFF;">(新)</span>';
  836. }
  837. //文件图标
  838. var icon = '';
  839. if(ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif'){
  840. icon = '<img style="width: 60px;height: 80px;" src="'+path+'" alt="">';
  841. }else{
  842. icon = '<img style="width: 60px;height: 80px;" src="'+path+'" alt="">';
  843. }
  844. //文件信息置入隐藏域
  845. var html = '';
  846. html+='<div style="padding-top: 6px;padding-right: 10px;float: left;">';
  847. var titleVal = $("#attachTitle").val();
  848. if(titleVal != ''){
  849. titleVal = titleVal + ',' + oriFileName;
  850. }else{
  851. titleVal = oriFileName;
  852. }
  853. $("#attachTitle").val(titleVal);
  854. var pathVal = $("#attachPath").val();
  855. if(pathVal != ''){
  856. pathVal = pathVal + ',' + path;
  857. }else{
  858. pathVal = path;
  859. }
  860. $("#attachPath").val(pathVal);
  861. var extVal = $("#attachExt").val();
  862. if(extVal != ''){
  863. extVal = extVal + ',' + ext;
  864. }else{
  865. extVal = ext;
  866. }
  867. $("#attachExt").val(extVal);
  868. html+=icon;
  869. //html+='<br><a style="color: blueviolet;margin-left: 5px;" target="_blank" href="' + path + '">' + oriFileName + '</a>';
  870. html+='<br>'+Str+'<a style="color: indianred;float: right;margin-right: 15px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  871. html+='</div>';
  872. $("#fileDiv").append(html);
  873. }
  874. });
  875. function save() {
  876. layer.load(2, { shade: [0.15, '#cccccc'] });
  877. var url = "";
  878. form.on('submit(formSubmit)', function(data) {
  879. layer.closeAll('loading');
  880. if(wfIsEntrust){
  881. //debugger
  882. /*委托*/
  883. url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveEntrust";
  884. if(data.field.entrustUserId == '-1'){
  885. layer.msg("请选择委托人员!");
  886. return false;
  887. }
  888. }else{
  889. //debugger
  890. if(workFlowType == 1 && hdangerStatus == 1){
  891. /*评审*/
  892. url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveReview";
  893. if(data.field.wf_hdangerRetifyBy == '-1'){
  894. layer.msg("请选择整改人员!");
  895. return false;
  896. }
  897. }else if(workFlowType == 2 && (hdangerStatus == 2 || hdangerStatus == 5)){
  898. /*整改*/
  899. url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveRetify";
  900. $(".work-flow-review-hint").removeAttr("lay-verify");
  901. $(".work-flow-review-hint").removeAttr("lay-verType", 'tips');
  902. }else if(workFlowType == 3 && hdangerStatus == 3){
  903. /*验收*/
  904. url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveAccept";
  905. }
  906. }
  907. admin.req(url, data.field, function(res) {
  908. layer.closeAll('loading');
  909. if (res.code == 1) {
  910. //layer.msg(res.msg);
  911. location.href = "./index.html?status="+hdangerStatus;
  912. // location.reload();
  913. } else {
  914. layer.msg(res.msg);
  915. return false;
  916. }
  917. },'POST');
  918. return false;
  919. });
  920. layer.closeAll('loading');
  921. }
  922. /**
  923. * 隐患整改
  924. */
  925. function saveRetify() {
  926. //
  927. // var datamap = {
  928. // "hdangerAcceptedResult":acceptedResult,
  929. // "desc":$("#wf_desc").val(),
  930. // "hdangerId":$("#hdangerId").val()
  931. // };
  932. layer.confirm('确认整改?', {
  933. skin: 'layui-layer-admin',
  934. shade: .1
  935. }, function (i) {
  936. layer.close(i);
  937. layer.load(2, { shade: [0.15, '#cccccc'] });
  938. var url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveRetify";
  939. form.on('submit(formSubmit)', function(data) {
  940. //var selectVal = formSelects.value('catId', 'valStr');
  941. // $("#catIds").val(selectVal);
  942. // var url = uParas.baseUrl + "/ent/post/savePost";
  943. admin.req(url, data.field, function(res) {
  944. layer.closeAll('loading');
  945. if (res.code == 1) {
  946. //layer.msg(res.msg);
  947. // location.href = "./index.html";
  948. location.reload();
  949. } else {
  950. layer.msg(res.msg);
  951. }
  952. },'POST');
  953. return false;
  954. });
  955. // admin.req(url, datamap, function(res) {
  956. // layer.closeAll('loading');
  957. // if (res.code == 1) {
  958. // //layer.msg(res.msg);
  959. // location.reload();
  960. // } else {
  961. // layer.msg(res.msg);
  962. // }
  963. // },'POST');
  964. });
  965. }
  966. /**
  967. * 隐患验收
  968. * @param acceptedResult
  969. */
  970. function saveAccept(acceptedResult) {
  971. var hint = '';
  972. if(acceptedResult == 4){
  973. hint = '通过';
  974. }else{
  975. hint = '不通过';
  976. }
  977. // var datamap = {
  978. // "hdangerAcceptedResult":acceptedResult,
  979. // "desc":$("#wf_desc").val(),
  980. // "hdangerId":$("#hdangerId").val()
  981. // };
  982. // //console.log(JSON.stringify(datamap));
  983. layer.confirm('确认验收【' + hint + '】?', {
  984. skin: 'layui-layer-admin',
  985. shade: .1
  986. }, function (i) {
  987. layer.close(i);
  988. layer.load(2, { shade: [0.15, '#cccccc'] });
  989. var url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveAccept";
  990. form.on('submit(formSubmit)', function(data) {
  991. //var selectVal = formSelects.value('catId', 'valStr');
  992. // $("#catIds").val(selectVal);
  993. // var url = uParas.baseUrl + "/ent/post/savePost";
  994. admin.req(url, data.field, function(res) {
  995. layer.closeAll('loading');
  996. if (res.code == 1) {
  997. //layer.msg(res.msg);
  998. // location.href = "./index.html";
  999. location.reload();
  1000. } else {
  1001. layer.msg(res.msg);
  1002. }
  1003. },'POST');
  1004. return false;
  1005. });
  1006. // admin.req(url, datamap, function(res) {
  1007. // layer.closeAll('loading');
  1008. // if (res.code == 1) {
  1009. // //layer.msg(res.msg);
  1010. // location.reload();
  1011. // } else {
  1012. // layer.msg(res.msg);
  1013. // }
  1014. // },'POST');
  1015. });
  1016. }
  1017. /**
  1018. * 委托处理
  1019. */
  1020. function saveEntrust() {
  1021. // var datamap = {
  1022. // "entrustType":entrustType,
  1023. // "hdangerEntrustGroup":$("#hdangerEntrustGroup").val(),
  1024. // "entrustUserId":$("#entrustUserId").val(),
  1025. // "desc":$("#wf_desc").val(),
  1026. // "hdangerId":$("#hdangerId").val().toString()
  1027. // };
  1028. layer.confirm('确认委托处理?', {
  1029. skin: 'layui-layer-admin',
  1030. shade: .1
  1031. }, function (i) {
  1032. layer.close(i);
  1033. layer.load(2, { shade: [0.15, '#cccccc'] });
  1034. var url = uParas.baseUrl + "/ent/hiddenWorkFlow/saveEntrust";
  1035. form.on('submit(formSubmit)', function(data) {
  1036. //var selectVal = formSelects.value('catId', 'valStr');
  1037. // $("#catIds").val(selectVal);
  1038. // var url = uParas.baseUrl + "/ent/post/savePost";
  1039. admin.req(url, data.field, function(res) {
  1040. layer.closeAll('loading');
  1041. if (res.code == 1) {
  1042. //layer.msg(res.msg);
  1043. // location.href = "./index.html";
  1044. location.reload();
  1045. } else {
  1046. layer.msg(res.msg);
  1047. }
  1048. },'POST');
  1049. return false;
  1050. });
  1051. // admin.req(url, datamap, function(res) {
  1052. // layer.closeAll('loading');
  1053. // if (res.code == 1) {
  1054. // //layer.msg(res.msg);
  1055. // location.reload();
  1056. // } else {
  1057. // layer.msg(res.msg);
  1058. // }
  1059. // },'POST');
  1060. });
  1061. }
  1062. //删除附件
  1063. function deleteFile(obj){
  1064. var pDiv = $(obj).parent();
  1065. pDiv.remove();
  1066. }
  1067. function goBack() {
  1068. var url = 'ent/hiddenDanger/index.html?type=1';
  1069. if(workFlowType == 1){
  1070. url = 'ent/hiddenDanger/index.html?type=1';
  1071. }else if(workFlowType == 2){
  1072. url = 'ent/hiddenDanger/index.html?type=2';
  1073. }else if(workFlowType == 3){
  1074. url = 'ent/hiddenDanger/index.html?type=3';
  1075. }
  1076. location.href = url;
  1077. }
  1078. function showImg(src) {
  1079. var imgHtml = "<img src='" + src + "' width='1000px' height='650'/>";
  1080. layer.open({
  1081. type: 1,
  1082. shade: 0.1,
  1083. offset: 'auto',
  1084. area: [1000 + 'px',650+'px'], // area: [width + 'px',height+'px'] //原图显示
  1085. shadeClose:true,
  1086. scrollbar: false,
  1087. title: "图片附件预览", //不显示标题
  1088. content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
  1089. // cancel: function () {
  1090. // layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', { time: 5000, icon: 6 });
  1091. // }
  1092. });
  1093. }
  1094. </script>
  1095. </body>
  1096. </html>