procedure.jsp 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <jsp:include page="../../../common/common-meta-include.jsp"></jsp:include>
  8. <jsp:include page="../../../common/common-js-include.jsp"></jsp:include>
  9. <jsp:include page="../../../common/common-css-include.jsp"></jsp:include>
  10. <!--[if lt IE 9]>
  11. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  12. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  13. <![endif]-->
  14. <style type="text/css">
  15. .layui-table-view .layui-table td {
  16. border-right: 1px solid #DDD !important;
  17. }
  18. .layui-table-body .layui-table-cell {
  19. padding: 5px !important;
  20. }
  21. .layui-table-header .layui-table-cell {
  22. height: 42px !important;
  23. }
  24. .qianse {
  25. color: #666666;
  26. }
  27. .lanse {
  28. color: #1869F6;
  29. }
  30. .shense {
  31. color: #111111;
  32. }
  33. .no-wrap {
  34. white-space: nowrap;
  35. }
  36. .lanse-first {
  37. color: #1C56A3;
  38. font-size: 12px;
  39. font-family: "Times New Roman", Times, serif;
  40. }
  41. .layui-table-col-special .layui-table-cell {
  42. display: flex;
  43. justify-content: space-between;
  44. }
  45. .queryTimeType {
  46. margin-top: -4px;
  47. position: absolute;
  48. }
  49. .hiddenParam,
  50. .hiddenParams {
  51. display: none;
  52. }
  53. .morePan {
  54. position: absolute;
  55. margin-left: 11px;
  56. }
  57. .morePan a {
  58. color: #2C6EC6;
  59. }
  60. .table_box .table_process {
  61. height: fit-content;
  62. max-height: 60vh;
  63. overflow-x: scroll;
  64. overflow-y: scroll;
  65. }
  66. .layui-table-body::-webkit-scrollbar {
  67. width: 0px;
  68. /*height: 10px;*/
  69. }
  70. .table_box,
  71. .table_box .table_process {
  72. overflow: visible;
  73. }
  74. .layui-form-select dl {
  75. height: 230px;
  76. }
  77. /* 针对特定 select 的样式 */
  78. .custom-select + .layui-form-select dl {
  79. height: auto; /* 恢复默认高度 */
  80. max-height: 150px; /* 设置一个合适的高度 */
  81. }
  82. .layui-table-cell .cut {
  83. display: -webkit-box; /* 使用旧版的弹性盒子布局 */
  84. -webkit-box-orient: vertical; /* 设置为垂直方向排列 */
  85. overflow: hidden; /* 隐藏溢出内容 */
  86. text-overflow: ellipsis; /* 使用省略号表示溢出内容 */
  87. -webkit-line-clamp: 2; /* 显示的行数 */
  88. }
  89. .search_pop .layui-layer-content {
  90. overflow: visible;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <div id="app"></div>
  96. <template id="template">
  97. <div class="layui-layout layui-layout-admin pd0">
  98. <!-- 内容区域 -->
  99. <div class="right_title">
  100. <div class="txt">项目总库 <div class="top-breadcrumb"></div></div>
  101. <div class="layui-collapse search_form">
  102. <div class="layui-colla-item">
  103. <div class="layui-colla-content layui-show">
  104. <form class="layui-form" lay-filter="searchForm" id="searchForm">
  105. <input type="hidden" name="subId" value="${subId}">
  106. <div class="layui-row">
  107. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  108. <div class="layui-form-item">
  109. <label class="layui-form-label label-longers required">项目名称</label>
  110. <div class="layui-input-block">
  111. <input type="text" name="subName" placeholder="请输入" autocomplete="off"
  112. class="layui-input">
  113. </div>
  114. </div>
  115. </div>
  116. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  117. <div class="layui-form-item">
  118. <label class="layui-form-label required label-longers">项目属地</label>
  119. <div class="layui-input-block">
  120. <select name="subjectId">
  121. <option value="">请选择</option>
  122. <c:forEach items="${JSDD }" var="hy">
  123. <option value="${hy.code }">${hy.title }</option>
  124. </c:forEach>
  125. </select>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  130. <div class="layui-form-item">
  131. <label class="layui-form-label required label-longers">行业类别</label>
  132. <div class="layui-input-block">
  133. <%-- <div id="indusKind"></div>--%>
  134. <select name="indusKind">
  135. <option value="">请选择</option>
  136. <c:forEach items="${HYFL }" var="hy">
  137. <option value="${hy.code }">${hy.title}
  138. <c:forEach items="${hy.children }" var="hy2">
  139. <option value="${hy2.code }">&ensp;&ensp;${hy2.title}
  140. </c:forEach>
  141. </option>
  142. </c:forEach>
  143. </select>
  144. </div>
  145. </div>
  146. </div>
  147. <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 hiddenParam">
  148. <div class="layui-form-item">
  149. <label class="layui-form-label required label-longers">四库</label>
  150. <div class="layui-input-block">
  151. <div id="subInfoStatus"></div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3 hiddenParams">
  156. <div class="layui-form-item">
  157. <label class="layui-form-label"></label>
  158. <div class="layui-input-block">
  159. <button type="button" class="layui-btn layui-btn-normal" @click="search">查询
  160. </button>
  161. <span class="morePan" @click="showMore"><a v-if="!showMoreFlag">更多 <ion-icon
  162. name="chevron-forward-outline"></ion-icon></a><a
  163. v-if="showMoreFlag">收起 V</a></span>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="layui-row">
  169. </div>
  170. </form>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="table_box" style="padding-top: 0;">
  176. <div class="table_process" style="position: relative">
  177. <div style="position: relative; display: inline-block" @mouseover="openExport" @mouseout="choseExport">
  178. <div class="export">
  179. <img src="${WebSite.asset}/css/images/left/export.svg"/>
  180. <span>导出</span>
  181. </div>
  182. <div class="export-item" v-if="showExport" :style="{ top: '-31px' }">
  183. <%-- <button type="button" class="" @click="exportTotalExcel">汇总导出</button>--%>
  184. <button type="button" class="" @click="exportFixDetailExcel">导出明细</button>
  185. <%-- <button type="button" class="" @click="exportAnalysis">分析报告导出</button>--%>
  186. <%-- <button type="button" class="" @click="exportMoreExcel">自定义导出</button>--%>
  187. </div>
  188. </div>
  189. <div style="position: relative; display: inline-block">
  190. <div class="export" id="addProcedure" style="text-align: center" @click="addProcedure">
  191. <span>新建</span>
  192. </div>
  193. </div>
  194. <table id="table1" lay-filter="test"></table>
  195. <div class="pagination-box" id="pagination"></div>
  196. </div>
  197. </div>
  198. <div style="height: 20px;"></div>
  199. </div>
  200. </template>
  201. <div id="setReason" style="display: none;">
  202. <form class="layui-form" lay-filter="reasonForm">
  203. <div class="layui-row">
  204. <div class="layui-col-xs6 layui-col-sm6">
  205. <div class="layui-form-item">
  206. <label class="layui-form-label">已开工未入库原因:</label>
  207. <div class="layui-input-block">
  208. <textarea name="reasonNoRk" maxlength="200" style="height: 50px;width: 80%;" id="reasonNoRk"
  209. autocomplete="off" class="layui-textarea"></textarea>
  210. </div>
  211. </div>
  212. </div>
  213. <div class="layui-col-xs6 layui-col-sm6">
  214. <div class="layui-form-item">
  215. <label class="layui-form-label">已入库无投资原因:</label>
  216. <div class="layui-input-block">
  217. <textarea name="reasonNoAmt" maxlength="200" style="height: 50px;width: 80%;" id="reasonNoAmt"
  218. autocomplete="off" class="layui-textarea"></textarea>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. <div class="layui-row">
  224. <div class="layui-col-xs6 layui-col-sm6">
  225. <div class="layui-form-item">
  226. <label class="layui-form-label">是否入统:</label>
  227. <div class="layui-input-block">
  228. <input type="radio" name="isRk" value="0" title="否" checked="checked"/>
  229. <input type="radio" name="isRk" value="1" title="是"/>
  230. </div>
  231. </div>
  232. </div>
  233. <div class="layui-col-xs6 layui-col-sm6">
  234. <div class="layui-form-item">
  235. <label class="layui-form-label">未开工建设原因:</label>
  236. <div class="layui-input-block">
  237. <textarea name="reasonNoKg" maxlength="200" style="height: 50px;width: 80%;" id="reasonNoKg"
  238. autocomplete="off" class="layui-textarea"></textarea>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <div class="layui-row">
  244. <div class="layui-col-xs6 layui-col-sm6">
  245. <div class="layui-form-item">
  246. <label class="layui-form-label">存在的问题:</label>
  247. <div class="layui-input-block">
  248. <textarea name="reasonq" maxlength="200" style="height: 50px;width: 80%;" id="reasonq"
  249. autocomplete="off" class="layui-textarea"></textarea>
  250. </div>
  251. </div>
  252. </div>
  253. <div class="layui-col-xs6 layui-col-sm6">
  254. <div class="layui-form-item">
  255. <label class="layui-form-label">已开工进度慢原因:</label>
  256. <div class="layui-input-block">
  257. <textarea name="reasonJd" maxlength="200" style="height: 50px;width: 80%;" id="reasonJd"
  258. autocomplete="off" class="layui-textarea"></textarea>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. </form>
  264. </div>
  265. <div id="problem" class="layuimini-main" style="display: none;">
  266. <form class="layui-form" lay-filter="problemForm">
  267. <div class="layui-row">
  268. <div class="layui-col-xs12 layui-col-sm12">
  269. <div class="layui-form-item">
  270. <label class="layui-form-label">状态:</label>
  271. <div class="layui-input-block block-width">
  272. <input type="radio" name="statusF" value="2" title="红灯" checked="checked"/>
  273. <input type="radio" name="statusF" value="1" title="黄灯"/>
  274. <input type="radio" name="statusF" value="0" title="绿灯"/>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <div class="layui-row">
  280. <div class="layui-col-xs12 layui-col-sm12">
  281. <div class="layui-form-item">
  282. <label class="layui-form-label">问题描述:</label>
  283. <div class="layui-input-block block-width">
  284. <textarea name="status_reason" maxlength="400" style="height: 300px;width: 80%;"
  285. id="problemReason" autocomplete="off" class="layui-textarea"></textarea>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. <div class="layui-row">
  291. <div class="layui-col-xs12 layui-col-sm12">
  292. <div class="layui-form-item">
  293. <label class="layui-form-label">要求解决日期:</label>
  294. <div class="layui-input-block block-width" style="width: 25%">
  295. <input type="text" id="dateConfirm" name="dateConfirm" autocomplete="off" class="layui-input">
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. </form>
  301. </div>
  302. <div id="toBack" class="layuimini-main" style="display: none;">
  303. <form class="layui-form" lay-filter="toBackForm">
  304. <div class="layui-row">
  305. <div class="layui-col-xs12 layui-col-sm12">
  306. <div class="layui-form-item">
  307. <label class="layui-form-label" style="width: 100px">退回到状态:</label>
  308. <div class="layui-input-block">
  309. <input type="radio" name="status" value="1" title="项目前期" checked="checked"/>
  310. <input type="radio" name="status" value="6" title="待开工"/>
  311. <input type="radio" name="status" value="7" title="施工中"/>
  312. </div>
  313. </div>
  314. </div>
  315. </div>
  316. </form>
  317. </div>
  318. <script type="text/html" id="subName">
  319. <span lay-event="toDetail" title="{{d.subName}}">{{d.subName}}</span>
  320. </script>
  321. <script type="text/html" id="mainName">
  322. <span lay-event="toManagerUnit" title="{{d.mainName}}">{{d.mainName}}</span>
  323. </script>
  324. <script type="text/html" id="unitName">
  325. <span lay-event="toQcc" title="{{d.unitName}}">{{d.unitName}}</span>
  326. </script>
  327. <script type="text/html" id="date">
  328. <div title="">
  329. <div class="line"><span class="qianse">计划开工:</span> <span class="shense">{{d.beginDate}}</span>
  330. </div>
  331. <div class="line"><span class="qianse">计划竣工:</span> <span class="shense">{{d.endDate}}</span>
  332. </div>
  333. </div>
  334. </script>
  335. <script type="text/html" id="amtTotal">
  336. <div title="">
  337. <span class="qianse">总投资金额:</span><span class="lanse">{{d.amtTotal}}</span> 万元<br/>
  338. </div>
  339. </script>
  340. <script type="text/html" id="zjly">
  341. <div title="">
  342. <span class="lanse">{{d.zjlyName}}</span>
  343. </div>
  344. </script>
  345. <script type="text/html" id="abcSpan">
  346. {{# if(d.abc == "A") { }}
  347. <span style="font-size:16px;font-weigh:500 !important;color: #26B520">{{d.abc||''}}</span>
  348. {{#} }}
  349. {{# if(d.abc == "B") { }}
  350. <span style="font-size:16px;font-weigh:500 !important;color: #1869F6">{{d.abc||''}}</span>
  351. {{#} }}
  352. {{# if(d.abc == "C") { }}
  353. <span style="font-size:16px;font-weigh:500 !important;color: #FF9600">{{d.abc||''}}</span>
  354. {{#} }}
  355. </script>
  356. <%-- table操作按钮 --%>
  357. <%-- table操作按钮 --%>
  358. <script type="text/html" id="toolBar">
  359. <div class="toolBar">
  360. {{# if("${currUser.edit}" == 'true'||( d.propKind == '3' && "${currUser.id}" == d.create_user_id )) { }}
  361. <span title="编辑" lay-event="toEditProcedure" class="no-wrap">&nbsp;编辑</span>
  362. {{#} }}
  363. <span title="删除" lay-event="delProcedure" class="no-wrap">删除</span>
  364. </div>
  365. </script>
  366. <script type="text/html" id="imageDiv">
  367. <div style="width:50px;height:50px" onclick="showImage(this)">
  368. {{# if(d.fileId != null && d.fileId != '') { }}
  369. <img src="${domain}/static/file/{{d.fileId}}/showfile" realUrl="${domain}/static/file/{{d.fileId}}/showfile"
  370. width="50px" height="50px"/>
  371. {{#} }}
  372. </div>
  373. </script>
  374. <script type="text/html" id="offsetLight">
  375. {{#if(d.offset >= -30 && d.offset <= -10 ) { }}
  376. <span style="color: yellow"><image class="light-rgb"
  377. src="${WebSite.asset}/css/images/bigScreen/light-yellow.png"></image></span>
  378. {{#} else if(d.offset < -30) { }}
  379. <span style="color: red"><image class="light-rgb"
  380. src="${WebSite.asset}/css/images/bigScreen/light-red.png"></image></span>
  381. {{#}}}
  382. {{#if(d.offset !="" || d.offset != undefined || d.offset != null) { }}
  383. {{#if(d.offset<0) { }}
  384. <span class="grey">{{d.offset||"--"}}%</span>
  385. {{# } }}
  386. {{#if(d.offset>0) { }}
  387. <span class="green">{{d.offset||"--"}}%</span>
  388. {{# } }}
  389. {{# } }}
  390. </script>
  391. <script type="text/html" id="openLight">
  392. {{# var computedPer1 = function(beginDate){
  393. var beginDate =new Date(beginDate);
  394. var beginDate7 =new Date(beginDate);
  395. var beginDate3 =new Date(beginDate);
  396. beginDate7.setDate(beginDate7.getDate()-7);
  397. beginDate3.setDate(beginDate3.getDate()-3);
  398. var newDate = new Date();
  399. if(newDate.getTime() >=beginDate7.getTime() && newDate.getTime() <=beginDate3.getTime()){
  400. return "yellow";
  401. }else if(newDate.getTime() >=beginDate3.getTime() && newDate.getTime() <= beginDate.getTime() ){
  402. return "red";
  403. }else{
  404. return "-";
  405. }
  406. };
  407. }}
  408. {{#if(computedPer1(d.beginDate)=="yellow" ) { }}
  409. <span style="color: yellow"> <image style="width:20px;height:20px;margin: auto;"
  410. src="${WebSite.asset}/css/images/bigScreen/light-yellow.png"></image></span>
  411. {{#} else if(computedPer1(d.beginDate)=="red") { }}
  412. <span style="color: red"> <image style="width:20px;height:20px;margin: auto;"
  413. src="${WebSite.asset}/css/images/bigScreen/light-red.png"></image></span>
  414. {{#}}}
  415. </script>
  416. <script type="text/html" id="moveForm">
  417. <div class="layui-form" style="padding: 20px;">
  418. <div class="layui-form-item" style="display: flex; align-items: center;">
  419. <label class="layui-form-label" style="text-align: right; width: 90px;">当前状态:</label>
  420. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px);">
  421. <input type="text" name="currentState" value="储备库" disabled class="layui-input">
  422. </div>
  423. </div>
  424. <div class="layui-form-item" style="display: flex; align-items: center;">
  425. <label class="layui-form-label" style="text-align: right; width: 90px;">转库到:</label>
  426. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px);">
  427. <select class="custom-select" lay-filter="moveStatus" lay-verify="required">
  428. <option value="">请选择</option>
  429. <c:forEach items="${subInfoStatus }" var="item">
  430. <option value="${item.code}">${item.desc}</option>
  431. </c:forEach>
  432. </select>
  433. </div>
  434. </div>
  435. <div class="layui-form-item" style="display: flex; align-items: center;">
  436. <label class="layui-form-label" style="text-align: right; width: 90px;"></label>
  437. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px); text-align: right;">
  438. <button type="button" class="layui-btn layui-btn-primary layui-border" onclick="vm.closeAllLayers()">取消</button>
  439. <button type="button" class="layui-btn moveConfirm" onclick="vm.confirmMove()">确认转库</button>
  440. </div>
  441. </div>
  442. </div>
  443. </script>
  444. <script>
  445. layui.use('element', function () {
  446. let element = layui.element;
  447. });
  448. let vm = new Vue({
  449. el: "#app",
  450. template: "#template",
  451. data: {
  452. subInfoStatusData: [],
  453. JSDD: [],
  454. winH: 0,
  455. dataList: [],
  456. startDate: "",
  457. endDate: "",
  458. tableName: 'test',
  459. cacheName: 'TzQueryParam_cb_${currUser.id}',
  460. pageNo: 1,
  461. kind: {},
  462. beginRate: {},
  463. showMoreFlag: false,
  464. light: null,
  465. sort: {field: "abc", type: ""},
  466. pageSize: 10,
  467. showExport: false,
  468. moveDbParam:{
  469. status: "",
  470. id: ""
  471. }
  472. },
  473. mounted: function () {
  474. this.init()
  475. },
  476. methods: {
  477. toEditProcedure: function (obj) {
  478. window.location.href = App.getUrl("/subject/subInfo/editProcedure?subId=" + obj.data.id + "&queryType=3");
  479. },
  480. addProcedure(){
  481. window.location.href = App.getUrl("/subject/subInfo/editProcedure?subId=");
  482. },
  483. delProcedure(obj){
  484. let self = this;
  485. App.msg.confirm(`确认删除` + obj.data.subName + `项目设置的手续?`, () => {
  486. App.postJson("/api/preGxjInfo/delPreInfo", {id: obj.data.subId}, (res) => {
  487. if (res.success) {
  488. App.msg.success("删除成功");
  489. self.getData()
  490. } else {
  491. App.msg.error(res.message || "删除失败,请重试");
  492. }
  493. })
  494. });
  495. },
  496. // 红黄灯
  497. toEditLight(obj){
  498. let self = this;
  499. App.openLayer({
  500. title: "红黄灯设置",
  501. content: App.getUrl("/subject/subInfo/light?subId=" + obj.data.id),
  502. width: 500,
  503. height: 400,
  504. end: function() {
  505. self.getData();
  506. }
  507. })
  508. },
  509. closeAllLayers() {
  510. layui.layer.closeAll(); // 关闭所有弹框
  511. },
  512. confirmMove: function () {
  513. let param = this.moveDbParam
  514. // 数据验证
  515. if (!param || !param.status) {
  516. App.msg.error("请选择转库状态");
  517. return;
  518. }
  519. // param.statusName = this.getStatusName(param.status)
  520. param.statusName = this.subInfoStatusData.find(item => item.value === param.status).name
  521. let self = this;
  522. self.closeAllLayers();
  523. App.msg.confirm(`是否转入` + param.statusName + `库?`, () => {
  524. App.postJson("/api/subject/subInfo/moveDb", {id: param.id, status: param.status}, (res) => {
  525. if (res.success) {
  526. App.msg.success("转库成功");
  527. self.getData()
  528. } else {
  529. App.msg.error(res.message || "转库失败,请重试");
  530. }
  531. })
  532. });
  533. },
  534. removeFour(obj){
  535. let self = this;
  536. App.msg.confirm(`是否移除`, () => {
  537. App.postJson("/api/subject/subInfo/removeFour", {id: obj.data.id}, (res) => {
  538. if (res.success) {
  539. App.msg.success("移除成功");
  540. self.getData()
  541. } else {
  542. App.msg.error(res.message || "移除失败,请重试");
  543. }
  544. })
  545. })
  546. },
  547. cancelRemove(obj){
  548. let self = this;
  549. App.msg.confirm(`是否取消`, () => {
  550. App.postJson("/api/subject/subInfo/cancelRemove", {id: obj.data.id}, (res) => {
  551. if (res.success) {
  552. App.msg.success("取消成功");
  553. self.getData()
  554. } else {
  555. App.msg.error(res.message || "取消失败,请重试");
  556. }
  557. })
  558. })
  559. },
  560. move(obj) {
  561. this.moveDbParam.id = obj.data.id
  562. const formTemplate = document.getElementById('moveForm').innerHTML;
  563. layer.open({
  564. type: 1,
  565. title: '转库',
  566. content: formTemplate,
  567. area: ['350px', '300px'],
  568. skin: 'search_pop',
  569. success: function (layero, index) {
  570. layui.form.render();
  571. }
  572. });
  573. },
  574. init: function () {
  575. let self = this;
  576. layui.form.on("select(moveStatus)", function (data) {
  577. self.moveDbParam.status = data.value;
  578. });
  579. // 文件上传
  580. layui.upload.render({
  581. elem: '#uploadBtn',
  582. url: App.getUrl("/api/subject/subInfo/importXmzkDetailExcel"),
  583. accept: 'file', // 普通文件
  584. exts: 'xls|xlsx', // 限制文件类型
  585. done: function (res) {
  586. if (res.success === true) {
  587. self.getData();
  588. layui.layer.msg('导入成功!');
  589. } else {
  590. layui.layer.msg('导入失败:' + res.message, {icon: 5});
  591. }
  592. },
  593. error: function (res) {
  594. layui.layer.msg('上传失败,请稍后再试' + res.message, {icon: 5});
  595. }
  596. });
  597. App.postJson("/api/dict/query/index", {}, function (res) {
  598. self.JSDD = res.data.JSDD;
  599. })
  600. this.winH = document.body.clientHeight;
  601. var nowdate = new Date();
  602. nowdate.setMonth(nowdate.getMonth() + 1);
  603. var y = nowdate.getFullYear();
  604. var m = nowdate.getMonth() + 1;
  605. var d = nowdate.getDate();
  606. layui.laydate.render({
  607. elem: '#startTime',
  608. range: '~',
  609. theme: layDateTheme,
  610. /* value: y + "-01-01 ~ " + y + "-12-31"*/
  611. });
  612. var formatwdate = y + '-' + m + '-' + d;
  613. layui.laydate.render({
  614. elem: '#dateConfirm',
  615. theme: layDateTheme,
  616. value: formatwdate
  617. });
  618. /* $("#month").val(new Date().getMonth() + 1);*/
  619. var xmlx = [];
  620. <c:forEach items="${XMLX}" var="xm">
  621. xmlx.push({value: "${xm.code}", name: "${xm.title}"});
  622. </c:forEach>
  623. // var subInfoStatusData = [];
  624. <c:forEach items="${subInfoStatus}" var="xm">
  625. <c:if test="${xm.code == '1' || xm.code == '2' || xm.code == '3' || xm.code == '9'}">
  626. self.subInfoStatusData.push({value: "${xm.code}", name: "${xm.desc}"});
  627. </c:if>
  628. </c:forEach>
  629. self.subInfoStatusData = [
  630. {value: '1', name: '储备'},
  631. {value: '2', name: '新建',selected: true},
  632. {value: '3', name: '在建'},
  633. {value: '4', name: '投产'},
  634. ]
  635. this.subInfoStatus = layui.xmSelect.render({
  636. el: "#subInfoStatus",
  637. language: 'zn',
  638. data: self.subInfoStatusData
  639. });
  640. layui.laydate.render({
  641. elem: '#year',
  642. type: 'year',
  643. theme: layDateTheme,
  644. /* value: new Date().getFullYear()*/
  645. })
  646. var params = window.localStorage.getItem(this.cacheName);
  647. if (params) {
  648. layui.form.val("searchForm", JSON.parse(params));
  649. }
  650. this.getData();
  651. window.addEventListener('message', this.receiveMessage, false);
  652. window.parent.postMessage('init loaded')
  653. window.toDetail = this.toDetail;
  654. window.levelList = this.levelList;
  655. window.showImage = this.showImage;
  656. $(".hiddenParams").show();
  657. },
  658. leaderSupervise: function (obj) {
  659. App.openLayer({
  660. title: "督办信息",
  661. content: App.getUrl("/meetingRecords/leaderMeeting?subId=" + obj.data.id),
  662. height: "600",
  663. width: "800"
  664. })
  665. },
  666. setIsNew: function (obj) {
  667. var self = this;
  668. App.msg.confirm("是否移入新建库?", function () {
  669. App.postJson("/api/subject/subInfo/setIsNew", {subId: obj.data.id}, function (res) {
  670. if (res.success) {
  671. App.msg.success("设置成功");
  672. self.getData();
  673. layer.close(index);
  674. }
  675. });
  676. });
  677. },
  678. showImage: function (that) {
  679. var imageUrl = $(that).find("img").eq(0).attr("realUrl");
  680. if (imageUrl) {
  681. // layer.open({
  682. // type: 2,
  683. // content: imageUrl,
  684. // area: ['500px', '1000px'],
  685. // offset: 'auto',
  686. // success: function(obj,index){
  687. // layer.full(index);
  688. // }
  689. // })
  690. layer.photos({
  691. photos: {
  692. "title": "",
  693. "id": "",
  694. "start": 0,
  695. "data": [
  696. {
  697. "alt": "",
  698. "pid": "",
  699. "src": imageUrl,
  700. "thumb": imageUrl
  701. }
  702. ]
  703. },
  704. anim: 5,
  705. closeBtn: "1",
  706. success: function () {
  707. //以鼠标位置为中心的图片滚动放大缩小
  708. $(document).on("mousewheel", ".layui-layer-photos", function (ev) {
  709. var oImg = this;
  710. var ev = event || window.event;//返回WheelEvent
  711. //ev.preventDefault();
  712. var delta = ev.detail ? ev.detail > 0 : ev.wheelDelta < 0;
  713. var ratioL = (ev.clientX - oImg.offsetLeft) / oImg.offsetWidth,
  714. ratioT = (ev.clientY - oImg.offsetTop) / oImg.offsetHeight,
  715. ratioDelta = !delta ? 1 + 0.1 : 1 - 0.1,
  716. w = parseInt(oImg.offsetWidth * ratioDelta),
  717. h = parseInt(oImg.offsetHeight * ratioDelta),
  718. l = Math.round(ev.clientX - (w * ratioL)),
  719. t = Math.round(ev.clientY - (h * ratioT));
  720. $(".layui-layer-photos").css({
  721. width: w, height: h
  722. , left: l, top: t
  723. });
  724. $("#layui-layer-photos").css({width: w, height: h});
  725. $("#layui-layer-photos>img").css({width: w, height: h});
  726. });
  727. }
  728. , end: function () { //销毁回调
  729. }
  730. });
  731. }
  732. },
  733. setQueryForm2: function () {
  734. $("#searchForm").find(".layui-form-item").parent()
  735. .removeClass("layui-col-xs3").removeClass("layui-col-sm3").removeClass("layui-col-md3")
  736. .addClass("layui-col-xs5").addClass("layui-col-sm5").addClass("layui-col-md5");
  737. },
  738. setQueryForm4: function () {
  739. $("#searchForm").find(".layui-form-item").parent()
  740. .removeClass("layui-col-xs5").removeClass("layui-col-sm5").removeClass("layui-col-md5")
  741. .addClass("layui-col-xs3").addClass("layui-col-sm3").addClass("layui-col-md3");
  742. },
  743. showMore: function () {
  744. this.showMoreFlag = !this.showMoreFlag;
  745. if (this.showMoreFlag) {
  746. $(".hiddenParam").show();
  747. } else {
  748. $(".hiddenParam").hide();
  749. }
  750. /* var self = this;
  751. layer.open({
  752. title: "查询条件",
  753. type: 1,
  754. area: ['800px', ''],
  755. offset:0,
  756. shade: 0.1,
  757. shadeClose: true,
  758. content: $("#searchForm"),
  759. btn: ["查询"],
  760. yes: function (index) {
  761. self.search();
  762. layer.close(index);
  763. },
  764. success: function () {
  765. self.setQueryForm2();
  766. $(".hiddenParam").show();
  767. $(".hiddenParams").hide();
  768. },
  769. end: function () {
  770. self.setQueryForm4();
  771. $(".hiddenParam").hide();
  772. $(".hiddenParams").show();
  773. }
  774. })*/
  775. },
  776. getSearchParams: function () {
  777. var param = layui.form.getValue("searchForm");
  778. if (param.rangeDate) {
  779. param.beginDate = param.rangeDate.split(" ~ ")[0];
  780. param.endDate = param.rangeDate.split(" ~ ")[1];
  781. param.rangeDate = null;
  782. }
  783. if (this.light) {
  784. param.light = this.light.getValue("valueStr");
  785. }
  786. if (this.indusKind) {
  787. param.indusKind = this.indusKind.getValue("valueStr");
  788. }
  789. if (this.subInfoStatus) {
  790. param.statusList = this.subInfoStatus.getValue("valueList").map(item => item.value);
  791. }
  792. delete (param.select);
  793. /* param.kind = this.kind.getValue("value").sort().join(",");*/
  794. return param;
  795. },
  796. getData: function () {
  797. var self = this;
  798. var param = this.getSearchParams();
  799. console.log("param====getData",param)
  800. param.pageNo = this.pageNo;
  801. param.pageSize = this.pageSize;
  802. param.orderBy = this.sort.field;
  803. param.orderType = this.sort.type || "asc";
  804. if (param.statusList == null || param.statusList.length === 0){
  805. param.statusList = ["1","2","3","9"]
  806. }
  807. // 表格分页数据
  808. App.postJson("/api/subInfo/query/queryPage", param, function (res) {
  809. self.dataList = res.rows;
  810. self.loadPage(res.total);
  811. self.loadTable();
  812. });
  813. },
  814. getStatusName: function (status) {
  815. const statusMap = {
  816. '0': '待处理',
  817. '1': '储备',
  818. '2': '新建',
  819. '3': '在建',
  820. '5': '移除项目',
  821. '9': '投产'
  822. };
  823. return statusMap[status] || '未知状态';
  824. },
  825. adjustFrozenRowHeight: function () {
  826. $(".layui-table-body tr").each(function (index, val) {
  827. const fixedRow = $(".layui-table-fixed .layui-table-body table tr")[index];
  828. $(fixedRow).height($(val).height());
  829. });
  830. },
  831. loadTable: function () {
  832. this.dataList.forEach(item => {
  833. item.statusName = this.getStatusName(item.status);
  834. });
  835. const self = this;
  836. layui.table.render({
  837. elem: '#table1',
  838. even: true,
  839. autoSort: false,
  840. initSort: self.sort,
  841. cols: [[
  842. {type: 'numbers', align: 'center', width: 44, title: '序号',fixed: 'left'},
  843. {field: 'subName', title: '项目名称', minWidth: 200, templet: '#subName',fixed: 'left'},
  844. {field: 'subjectName', title: '项目所在地', width: 100},
  845. {field: 'content', title: '建设内容', minWidth: 100,
  846. templet: function (row) {
  847. return row.content ? '<span class="cut" title="' + row.content + '">' + row.content + '</span>' : '';
  848. }},
  849. {
  850. field: 'amtTotal',
  851. title: '总投资',
  852. width: 100,
  853. templet: d => `<span class="new-roman">` + (d.amtTotal / 10000).toFixed(2) + `</span>` + "亿元",
  854. },
  855. {field: 'lastUpdateTime', title: '填写时间', width: 140},
  856. {title: '操作', width: 120, toolbar: '#toolBar', fixed: 'right'},
  857. ]],
  858. fixed: true,
  859. height: $(window).height() - $('#table1').offset().top - 50,
  860. data: self.dataList,
  861. done: function () {
  862. self.adjustFrozenRowHeight();
  863. }
  864. });
  865. layui.table.on('tool(' + this.tableName + ')', obj => {
  866. const { event } = obj;
  867. if (typeof self[event] === 'function') {
  868. self[event](obj);
  869. } else {
  870. console.warn(`未定义的事件: ${event}`);
  871. }
  872. });
  873. layui.table.on('sort(' + this.tableName + ')', function (obj) {
  874. self.sort = obj;
  875. self.getData();
  876. });
  877. },
  878. toBack: function (obj) {
  879. layer.open({
  880. type: 1,
  881. title: "退回",
  882. content: $("#toBack"),
  883. area: ['600px', ''],
  884. btn: ["保存", "取消"],
  885. yes: function (index) {
  886. var data = layui.form.val("toBackForm");
  887. var status = data.status;
  888. if (status != undefined) {
  889. if (parseInt(obj.data.status) <= parseInt(data.status)) {
  890. App.msg.warn("只能退回下级状态,请检查!!!!");
  891. return;
  892. }
  893. }
  894. App.postJson("/api/subject/subInfo/toTemp", {
  895. subId: obj.data.id,
  896. status: data.status
  897. }, function (res) {
  898. if (res.success) {
  899. layer.msg("成功", {icon: 6, time: 1000});
  900. //
  901. window.location.href = App.getUrl("subject/subInfo/projTz?type=4");
  902. }
  903. });
  904. },
  905. close: function (index) {
  906. layer.close(index);
  907. }
  908. })
  909. },
  910. isNoHide: function (obj) {
  911. var self = this;
  912. App.msg.confirm("是否移除在建库?", function () {
  913. App.postJson("/api/subject/subInfo/setBackIsHide", {subId: obj.data.id}, function (res) {
  914. if (res.success) {
  915. App.msg.success("设置成功");
  916. self.getData();
  917. layer.close(index);
  918. }
  919. });
  920. });
  921. },
  922. isHide: function (obj) {
  923. var self = this;
  924. App.msg.confirm("是否移入在建库?", function () {
  925. App.postJson("/api/subject/subInfo/setIsHide", {subId: obj.data.id}, function (res) {
  926. if (res.success) {
  927. App.msg.success("设置成功");
  928. self.getData();
  929. layer.close(index);
  930. }
  931. });
  932. });
  933. },
  934. loadPage: function (totalCount) {
  935. var self = this;
  936. layui.laypage.render({
  937. elem: 'pagination',
  938. count: totalCount,
  939. curr: self.pageNo,
  940. limit: self.pageSize,
  941. layout: ['count', 'prev', 'page', 'next', 'skip'],
  942. jump: function (obj, first) {
  943. //首次不执行
  944. if (!first) {
  945. self.pageNo = obj.curr;
  946. self.getData();
  947. }
  948. }
  949. });
  950. },
  951. yearPlan: function (obj) {
  952. window.location.href = App.getUrl("amtPlan/detail?subId=" + obj.data.id);
  953. },
  954. setSubReason: function (obj) {
  955. var self = this;
  956. layui.form.val("reasonForm", obj.data);
  957. layer.open({
  958. type: 1,
  959. title: "项目原因录入",
  960. content: $("#setReason"),
  961. area: ['880px', '560px'],
  962. btn: ["保存", "取消"],
  963. yes: function (index) {
  964. var reason = layui.form.val("reasonForm");
  965. reason.subId = obj.data.id;
  966. App.postJson("/api/subject/subInfo/setSubReason", reason, function (res) {
  967. if (res.success) {
  968. App.msg.success("设置成功");
  969. self.getData();
  970. layer.close(index);
  971. }
  972. });
  973. },
  974. close: function (index) {
  975. layer.close(index);
  976. }
  977. })
  978. },
  979. problem: function (obj) {
  980. var self = this;
  981. obj.data.status_reason = "";
  982. layui.form.val("problemForm", obj.data);
  983. layer.open({
  984. type: 1,
  985. title: "问题督办",
  986. content: $("#problem"),
  987. area: ['800px', '600px'],
  988. btn: ["保存", "取消"],
  989. yes: function (index) {
  990. var reason = layui.form.val("problemForm");
  991. reason.subId = obj.data.id;
  992. if (reason.statusF == "2" || reason.statusF == "1") {
  993. if (reason.status_reason == "" || reason.status_reason == undefined) {
  994. layer.msg("红灯,黄灯必须输入原因");
  995. return;
  996. }
  997. }
  998. App.postJson("/api/subject/subInfo/setStatus", {
  999. subId: obj.data.id,
  1000. statusFgw: reason.statusF,
  1001. reason: reason.status_reason,
  1002. dateConfirm: reason.dateConfirm
  1003. }, function (res) {
  1004. if (res.success) {
  1005. App.msg.success("设置成功");
  1006. self.getData();
  1007. layer.close(index);
  1008. }
  1009. });
  1010. },
  1011. close: function (index) {
  1012. layer.close(index);
  1013. }
  1014. })
  1015. },
  1016. exportTotalExcel: function () {
  1017. var param = this.getSearchParams();
  1018. App.common.utils.downFile(App.getUrl("subInfoExport/exportTotalExcelByStatus"), "POST", param, "项目情况表(总库).xlsx", "导出失败");
  1019. },
  1020. exportFixDetailExcel: function () {
  1021. var param = this.getSearchParams();
  1022. console.log("param====",param)
  1023. App.common.utils.downFile(App.getUrl("/subInfoExport/exportProcedureExcel"), "POST", param, "手续明细.xlsx", "导出失败");
  1024. },
  1025. exportAnalysis: function () {
  1026. var param = this.getSearchParams();
  1027. App.common.utils.downFile(App.getUrl("/subInfoExport/xmzkAnalysisExport"), "POST", param, "“四个一批”工业项目情况分析报告.docx", "导出失败");
  1028. },
  1029. exportDetailExcel: function () {
  1030. var param = this.getSearchParams();
  1031. App.common.utils.downFile(App.getUrl("subInfoExport/exportProcedureExcel"), "POST", param, "手续明细.xlsx", "导出失败");
  1032. },
  1033. exportExcel: function () {
  1034. var param = this.getSearchParams();
  1035. App.common.utils.downFile(App.getUrl("subInfoExport/exportSumExcel"), "POST", param, "项目情况表.xlsx", "导出失败");
  1036. },
  1037. exportExcelByIndusKind: function () {
  1038. var param = this.getSearchParams();
  1039. App.common.utils.downFile(App.getUrl("subInfoExport/exportExcelByIndusKind"), "POST", param, "项目情况表(按所属行业统计).xlsx", "导出失败");
  1040. },
  1041. exportSchedulingExcel: function () {
  1042. var param = this.getSearchParams();
  1043. App.common.utils.downFile(App.getUrl("subInfoExport/exportSchedulingExcel"), "POST", param, "项目调度表.xlsx", "导出失败");
  1044. },
  1045. /* exportExcel2: function(){
  1046. var param = this.getSearchParams();
  1047. App.common.utils.downFile(App.getUrl("subInfoExport/exportExcelTz"),"POST", param,"项目详情信息表.xlsx", "导出失败");
  1048. }, */
  1049. exportMoreExcel: function () {
  1050. top.window.getSearchParams = this.getSearchParams;
  1051. App.openLayer({
  1052. title: "自定义导出",
  1053. content: App.getUrl("/subInfoExport/index"),
  1054. height: "800",
  1055. width: "1000"
  1056. })
  1057. },
  1058. toQcc: function (obj) {
  1059. window.open('https://www.qcc.com/web/search?key=' + obj.data.unitName, '_blank')
  1060. },
  1061. toManagerUnit: function (obj) {
  1062. //详情
  1063. var index = layer.open({
  1064. type: 2,
  1065. title: '',
  1066. area: ['1000px', '800px'],
  1067. // /subject/subInfo/editSubInfo
  1068. content: App.getUrl("/subject/subInfo/manageUnit?subId=" + obj.data.id + "&queryType=3"),
  1069. });
  1070. layui.layer.full(index);
  1071. },
  1072. toDetail: function (obj) {
  1073. //详情
  1074. var index = layer.open({
  1075. type: 2,
  1076. title: '',
  1077. area: ['1000px', '800px'],
  1078. content: App.getUrl("/subject/subInfo/detailView2?layer=true&subId=" + obj.data.id + "&lastUrl=" + window.location.href),
  1079. });
  1080. layui.layer.full(index);
  1081. },
  1082. /* toDetail: function (obj) {
  1083. //详情
  1084. var index = layer.open({
  1085. type: 2,
  1086. title: '',
  1087. area: ['1000px', '800px'],
  1088. content: App.getUrl("/subject/subInfo/detailView?layer=true&subId=" + obj.data.id + "&lastUrl=" + window.location.href),
  1089. });
  1090. layui.layer.full(index);
  1091. },*/
  1092. levelList: function (field, title, val) {
  1093. //详情
  1094. var param = field + "," + title + "," + val
  1095. var params = encodeURIComponent(JSON.stringify(this.getSearchParams()));
  1096. var index = top.layer.open({
  1097. type: 2,
  1098. title: '',
  1099. area: ['90%', '90%'],
  1100. content: App.getUrl("/subject/subInfo/levelList?layer=true&type=" + this.getSearchParams().queryType + "&curParam=" + param + "&params=" + params),
  1101. });
  1102. //top.layer.full(index);
  1103. },
  1104. print: function (obj) {
  1105. window.open(App.getUrl("/subject/apply/downPdf?subId=" + obj.data.id));
  1106. },
  1107. preNew: function (obj) {
  1108. window.location.href = App.getUrl("/subPreNew/todo?subId=" + obj.data.id);
  1109. },
  1110. toTh: function (obj) {
  1111. if (obj.data.statusJh == null || obj.data.statusJh == '0' || obj.data.statusJh == '1') {
  1112. App.msg.confirm("是否需要退回到暂存状态?", function () {
  1113. App.postJson("/api/subject/subInfo/toTemp", {subId: obj.data.id, status: "0"}, function (res) {
  1114. if (res.success) {
  1115. layer.msg("成功", {icon: 6, time: 1000});
  1116. //
  1117. window.location.href = App.getUrl("subject/subInfo/projTz");
  1118. }
  1119. });
  1120. })
  1121. } else {
  1122. App.msg.warn("已做过开工申报,需要走变更流程");
  1123. }
  1124. },
  1125. search: function () {
  1126. var param = layui.form.getValue("searchForm");
  1127. window.localStorage.setItem(this.cacheName, JSON.stringify(param));
  1128. this.pageNo = 1;
  1129. this.getData();
  1130. },
  1131. openExport: function () {
  1132. this.showExport = true;
  1133. console.log('移入了')
  1134. },
  1135. choseExport: function () {
  1136. this.showExport = false;
  1137. console.log('移出了')
  1138. },
  1139. receiveMessage (e) {
  1140. console.log('cb receiveMessage: ', e.data)
  1141. if (e.data.topBreadcrumb) {
  1142. $(".top-breadcrumb").html(e.data.topBreadcrumb)
  1143. }
  1144. }
  1145. }
  1146. });
  1147. </script>
  1148. </body>
  1149. </html>