cb.jsp 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742
  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. </style>
  90. </head>
  91. <body>
  92. <div id="app"></div>
  93. <template id="template">
  94. <div class="layui-layout layui-layout-admin pd0">
  95. <!-- 内容区域 -->
  96. <div class="right_title">
  97. <div class="txt">储备项目库 <div class="top-breadcrumb"></div></div>
  98. <div class="layui-collapse search_form">
  99. <div class="layui-colla-item">
  100. <div class="layui-colla-content layui-show">
  101. <form class="layui-form" lay-filter="searchForm" id="searchForm">
  102. <input type="hidden" name="queryType" value="1">
  103. <div class="layui-row">
  104. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  105. <div class="layui-form-item">
  106. <label class="layui-form-label label-longers required">项目名称</label>
  107. <div class="layui-input-block">
  108. <input type="text" name="subName" placeholder="请输入" autocomplete="off"
  109. class="layui-input">
  110. </div>
  111. </div>
  112. </div>
  113. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  114. <div class="layui-form-item">
  115. <label class="layui-form-label required label-longers">项目属地</label>
  116. <div class="layui-input-block">
  117. <select name="subjectId">
  118. <option value="">请选择</option>
  119. <c:forEach items="${JSDD }" var="hy">
  120. <option value="${hy.code }">${hy.title }</option>
  121. </c:forEach>
  122. </select>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3">
  127. <div class="layui-form-item">
  128. <label class="layui-form-label required label-longers">行业类别</label>
  129. <div class="layui-input-block">
  130. <%-- <div id="indusKind"></div>--%>
  131. <select name="indusKind">
  132. <option value="">请选择</option>
  133. <c:forEach items="${HYFL }" var="hy">
  134. <option value="${hy.code }">${hy.title}
  135. <c:forEach items="${hy.children }" var="hy2">
  136. <option value="${hy2.code }">&ensp;&ensp;${hy2.title}
  137. </c:forEach>
  138. </option>
  139. </c:forEach>
  140. </select>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3 hiddenParam">
  145. <div class="layui-form-item">
  146. <label class="layui-form-label required label-longers" style="width: 100px;">项目总投资(亿元)</label>
  147. <div class="layui-input-block time_box">
  148. <input type="number" name="startAmt" placeholder="请输入最小金额"
  149. autocomplete="off"
  150. class="layui-input">
  151. <span class="split_txt">至</span>
  152. <input type="number" name="endAmt" placeholder="请输入最大金额" autocomplete="off"
  153. class="layui-input">
  154. </div>
  155. </div>
  156. </div>
  157. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3 hiddenParam">
  158. <div class="layui-form-item">
  159. <label class="layui-form-label label-longers">项目单位</label>
  160. <div class="layui-input-block">
  161. <input type="text" name="sbdw" placeholder="请输入项目项目单位名称"
  162. autocomplete="off"
  163. class="layui-input">
  164. </div>
  165. </div>
  166. </div>
  167. <div class="layui-col-xs3 layui-col-sm3 layui-col-md3 hiddenParams">
  168. <div class="layui-form-item">
  169. <label class="layui-form-label"></label>
  170. <div class="layui-input-block">
  171. <button type="button" class="layui-btn layui-btn-normal" @click="search">查询
  172. </button>
  173. <span class="morePan" @click="showMore"><a v-if="!showMoreFlag">更多 <ion-icon
  174. name="chevron-forward-outline"></ion-icon></a><a
  175. v-if="showMoreFlag">收起 V</a></span>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </form>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. <div>
  186. <div class="layui-row class_ls">
  187. <%-- <div style="display: flex;margin-bottom: 3px">--%>
  188. <%-- <label class="juli">--%>
  189. <%-- 储备项目总数--%>
  190. <%-- <span class="info-icon" title="A类项目:成熟类项目,可研或初设已编制并完成初审,达到项目等资金的进度"></span>--%>
  191. <%-- <span class="lanse-first">{{beginRate.num}}</span>--%>
  192. <%-- </label>--%>
  193. <%-- <label class="juli" onclick="levelList('abcs','A类','A')">--%>
  194. <%-- A类项目数--%>
  195. <%-- <span class="info-icon" title="A类项目:成熟类项目,可研或初设已编制并完成初审,达到项目等资金的进度"></span>--%>
  196. <%-- <span class="lanse-first">{{beginRate.anum}}</span>--%>
  197. <%-- </label>--%>
  198. <%-- <label class="juli">--%>
  199. <%-- B类项目数--%>
  200. <%-- <span class="info-icon" title="B类项目:推进类项目,正在抓紧推进前期手续,预计6-12个月可开工项目"></span>--%>
  201. <%-- <span class="lanse-first" onclick="levelList('abcs','B类','B')" style="color: #FFAD0D">{{beginRate.bnum}}</span>--%>
  202. <%-- </label>--%>
  203. <%-- <label class="juli" onclick="levelList('abcs','C类','C')">--%>
  204. <%-- C类项目数--%>
  205. <%-- <span class="info-icon" title="C类项目:意向类项目,还处于谋划论证阶段项目"></span>--%>
  206. <%-- <span class="lanse-first" style="color: #E0534E">{{beginRate.cnum}}</span>--%>
  207. <%-- </label>--%>
  208. <%-- <label class="juli" onclick="levelList('abcs','D类','D')">--%>
  209. <%-- D类项目数--%>
  210. <%-- <span class="info-icon" title="D类项目"></span>--%>
  211. <%-- <span class="lanse-first" style="color: #405dee">{{beginRate.dnum}}</span>--%>
  212. <%-- </label>--%>
  213. <%-- <label class="juli" onclick="levelList('abcs','其它类','UNKNOWN_CATEGORY')">--%>
  214. <%-- 其它项目数--%>
  215. <%-- <span class="info-icon" title="其它类项目"></span>--%>
  216. <%-- <span class="lanse-first" style="color: #ba22ec">{{beginRate.nnum}}</span>--%>
  217. <%-- </label>--%>
  218. <%-- </div>--%>
  219. <div style="display: flex;margin-bottom: 3px">
  220. <label class="juli">
  221. 储备项目总数
  222. <span class="info-icon" title="储备项目总数"></span>
  223. <span class="lanse-first">{{beginRate.num}}</span>
  224. </label>
  225. <label class="juli" onclick="levelList('cbStatus','正在谋划','1')">
  226. 正在谋划
  227. <span class="info-icon" title="正在谋划"></span>
  228. <span class="lanse-first">{{beginRate.bePlanningNum}}</span>
  229. </label>
  230. <label class="juli" onclick="levelList('cbStatus','正在洽谈','2')">
  231. 正在洽谈
  232. <span class="info-icon" title="正在洽谈"></span>
  233. <span class="lanse-first">{{beginRate.negotiationNum}}</span>
  234. </label>
  235. <label class="juli" onclick="levelList('cbStatus','已签约','3')">
  236. 已签约
  237. <span class="info-icon" title="已签约"></span>
  238. <span class="lanse-first" style="color: #FFAD0D">{{beginRate.signedNum}}</span>
  239. </label>
  240. <label class="juli" onclick="levelList('cbStatus','已备案/已核准','4')">
  241. 已备案/已核准
  242. <span class="info-icon" title="已备案/已核准"></span>
  243. <span class="lanse-first" style="color: #E0534E">{{beginRate.recordAndApproveNum}}</span>
  244. </label>
  245. </div>
  246. <div style="display: flex;margin-bottom: 3px">
  247. <label class="juli"
  248. @click="levelList('subjects',item.name,item.code)"
  249. v-for="(item, index) in beginRate.jsddList" :key="index">
  250. {{item.name}} <span class="lanse-first">{{item.num}}</span>
  251. </label>
  252. </div>
  253. <div class="second_line" style="margin-bottom: 3px">
  254. <label class="juli"
  255. @click="levelList('indusKinds',item.name?item.name:item.code,item.code)"
  256. v-for="(item, index) in beginRate.hyflList" :key="index">
  257. {{item.name?item.name:item.code}}
  258. <span class="lanse-first">{{item.num}}</span>
  259. </label>
  260. </div>
  261. </div>
  262. </div>
  263. <div class="table_box" style="padding-top: 0;">
  264. <div class="table_process" style="position: relative">
  265. <div style="position: relative; display: inline-block" @mouseover="openExport" @mouseout="choseExport">
  266. <div class="export">
  267. <img src="${WebSite.asset}/css/images/left/export.svg"/>
  268. <span>导出</span>
  269. </div>
  270. <div class="export-item" v-if="showExport" :style="{ top: '-93px' }">
  271. <button type="button" class="" @click="exportDetailExcel">导出明细</button>
  272. <button type="button" class="" @click="exportTotalExcel">导出总表</button>
  273. <button type="button" class="" @click="exportMoreExcel">自定义导出</button>
  274. </div>
  275. </div>
  276. <table id="table1" lay-filter="test"></table>
  277. <div class="pagination-box" id="pagination"></div>
  278. </div>
  279. </div>
  280. <div style="height: 20px;"></div>
  281. </div>
  282. </template>
  283. <script type="text/html" id="subName">
  284. <span lay-event="toDetail" title="{{d.subName}}">{{d.subName}}</span>
  285. </script>
  286. <script type="text/html" id="progress">
  287. <span title="{{d.progress}}">{{d.progress}}</span>
  288. </script>
  289. <script type="text/html" id="unitName">
  290. <span lay-event="toQcc" title="{{d.unitName}}">{{d.unitName}}</span>
  291. </script>
  292. <script type="text/html" id="date">
  293. <div title="">
  294. <div class="line"><span class="qianse">计划开工:</span> <span class="shense">{{d.beginDate}}</span>
  295. </div>
  296. <div class="line"><span class="qianse">计划竣工:</span> <span class="shense">{{d.endDate}}</span>
  297. </div>
  298. </div>
  299. </script>
  300. <script type="text/html" id="amtTotal">
  301. <div title="">
  302. <span class="qianse">总投资金额:</span><span class="lanse">{{d.amtTotal}}</span> 万元<br/>
  303. </div>
  304. </script>
  305. <%-- table操作按钮 --%>
  306. <script type="text/html" id="toolBar">
  307. <div class="toolBar">
  308. <span title="项目查询" lay-event="toDetail" class="no-wrap">项目查询</span>
  309. {{# if("${currUser.edit}" == 'true'||( d.propKind == '3' && "${currUser.id}" == d.create_user_id )) { }}
  310. <span title="编辑" lay-event="toEditSubInfo" class="no-wrap">&nbsp;编辑</span>
  311. {{#} }}
  312. <span title="转库" lay-event="move" class="no-wrap">转库</span>
  313. </div>
  314. </script>
  315. <script type="text/html" id="moveForm">
  316. <div class="layui-form" style="padding: 20px;">
  317. <div class="layui-form-item" style="display: flex; align-items: center;">
  318. <label class="layui-form-label" style="text-align: right; width: 90px;">当前状态:</label>
  319. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px);">
  320. <input type="text" name="currentState" value="储备库" disabled class="layui-input">
  321. </div>
  322. </div>
  323. <div class="layui-form-item" style="display: flex; align-items: center;">
  324. <label class="layui-form-label" style="text-align: right; width: 90px;">转库到:</label>
  325. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px);">
  326. <select class="custom-select" lay-filter="moveStatus" lay-verify="required">
  327. <option value="">请选择</option>
  328. <option value="2">新建</option>
  329. <option value="3">在建</option>
  330. <option value="9">投产</option>
  331. </select>
  332. </div>
  333. </div>
  334. <div class="layui-form-item" style="display: flex; align-items: center;">
  335. <label class="layui-form-label" style="text-align: right; width: 90px;"></label>
  336. <div class="layui-input-block" style="flex: 1; max-width: calc(100% - 120px); text-align: right;">
  337. <button type="button" class="layui-btn layui-btn-primary layui-border" onclick="vm.closeAllLayers()">取消</button>
  338. <button type="button" class="layui-btn moveConfirm" onclick="vm.confirmMove()">确认转库</button>
  339. </div>
  340. </div>
  341. </div>
  342. </script>
  343. <script>
  344. layui.use('element', function () {
  345. let element = layui.element;
  346. });
  347. let vm = new Vue({
  348. el: "#app",
  349. template: "#template",
  350. data: {
  351. JSDD: [],
  352. HYFL: [],
  353. winH: 0,
  354. dataList: [],
  355. startDate: "",
  356. endDate: "",
  357. tableName: 'test',
  358. cacheName: 'TzQueryParam_cb_${currUser.id}',
  359. pageNo: 1,
  360. kind: {},
  361. beginRate: {},
  362. showMoreFlag: false,
  363. light: null,
  364. sort: {field: "abc", type: ""},
  365. pageSize: 10,
  366. showExport: false,
  367. moveDbParam: {
  368. status: "",
  369. id: "",
  370. statusName: ""
  371. }
  372. },
  373. mounted: function () {
  374. this.init()
  375. },
  376. methods: {
  377. closeAllLayers() {
  378. layui.layer.closeAll(); // 关闭所有弹框
  379. },
  380. confirmMove: function () {
  381. let param = this.moveDbParam
  382. // 数据验证
  383. if (!param || !param.status) {
  384. App.msg.error("请选择转库状态");
  385. return;
  386. }
  387. const statusMap = {
  388. 1: "储备",
  389. 2: "新建",
  390. 3: "在建",
  391. 9: "投产"
  392. };
  393. param.statusName = statusMap[param.status] || "未知状态";
  394. let self = this;
  395. self.closeAllLayers();
  396. App.msg.confirm(`是否转入` + param.statusName + `库?`, () => {
  397. App.postJson("/api/subject/subInfo/moveDb", {id: param.id, status: param.status}, (res) => {
  398. if (res.success) {
  399. App.msg.success("转库成功");
  400. self.getData()
  401. } else {
  402. App.msg.error(res.message || "转库失败,请重试");
  403. }
  404. })
  405. });
  406. },
  407. init: function () {
  408. let self = this;
  409. layui.form.on("select(moveStatus)", function (data) {
  410. self.moveDbParam.status = data.value;
  411. });
  412. this.winH = document.body.clientHeight;
  413. var nowdate = new Date();
  414. nowdate.setMonth(nowdate.getMonth() + 1);
  415. var y = nowdate.getFullYear();
  416. var m = nowdate.getMonth() + 1;
  417. var d = nowdate.getDate();
  418. layui.laydate.render({
  419. elem: '#startTime',
  420. range: '~',
  421. theme: layDateTheme,
  422. /* value: y + "-01-01 ~ " + y + "-12-31"*/
  423. });
  424. var formatwdate = y + '-' + m + '-' + d;
  425. layui.laydate.render({
  426. elem: '#dateConfirm',
  427. theme: layDateTheme,
  428. value: formatwdate
  429. });
  430. /* $("#month").val(new Date().getMonth() + 1);*/
  431. var xmlx = [];
  432. <c:forEach items="${XMLX}" var="xm">
  433. xmlx.push({value: "${xm.code}", name: "${xm.title}"});
  434. </c:forEach>
  435. <%--var indusKindData = [];--%>
  436. <%--<c:forEach items="${HYFL}" var="xm">--%>
  437. <%-- var childData = [];--%>
  438. <%-- <c:forEach items="${xm.children}" var="c">--%>
  439. <%-- childData.push({--%>
  440. <%-- value: "${c.code}",--%>
  441. <%-- name: "${c.title}",--%>
  442. <%-- })--%>
  443. <%-- </c:forEach>--%>
  444. <%-- indusKindData.push(--%>
  445. <%-- {--%>
  446. <%-- value: "${xm.code}",--%>
  447. <%-- name: "${xm.title}",--%>
  448. <%-- children: childData--%>
  449. <%-- });--%>
  450. <%--</c:forEach>--%>
  451. // this.indusKind = layui.xmSelect.render({
  452. // el: "#indusKind",
  453. // language: 'zn',
  454. // data: indusKindData,
  455. // });
  456. layui.laydate.render({
  457. elem: '#year',
  458. type: 'year',
  459. theme: layDateTheme,
  460. /* value: new Date().getFullYear()*/
  461. })
  462. var params = window.localStorage.getItem(this.cacheName);
  463. if (params) {
  464. layui.form.val("searchForm", JSON.parse(params));
  465. }
  466. this.getData();
  467. window.addEventListener('message', this.receiveMessage, false);
  468. window.parent.postMessage('init loaded')
  469. window.toDetail = this.toDetail;
  470. window.levelList = this.levelList;
  471. $(".hiddenParams").show();
  472. },
  473. showMore: function () {
  474. this.showMoreFlag = !this.showMoreFlag;
  475. if (this.showMoreFlag) {
  476. $(".hiddenParam").show();
  477. } else {
  478. $(".hiddenParam").hide();
  479. }
  480. },
  481. getSearchParams: function () {
  482. var param = layui.form.getValue("searchForm");
  483. if (param.rangeDate) {
  484. param.beginDate = param.rangeDate.split(" ~ ")[0];
  485. param.endDate = param.rangeDate.split(" ~ ")[1];
  486. param.rangeDate = null;
  487. }
  488. if (this.light) {
  489. param.light = this.light.getValue("valueStr");
  490. }
  491. // if (this.indusKind) {
  492. // param.indusKind = this.indusKind.getValue("valueStr");
  493. // }
  494. delete (param.select);
  495. /* param.kind = this.kind.getValue("value").sort().join(",");*/
  496. return param;
  497. },
  498. getData: function () {
  499. var self = this;
  500. var param = this.getSearchParams();
  501. param.pageNo = this.pageNo;
  502. param.pageSize = this.pageSize;
  503. param.orderBy = this.sort.field;
  504. param.orderType = this.sort.type || "asc";
  505. // 表格分页数据
  506. param.status = 1;
  507. App.postJson("/api/subInfo/query/queryPage", param, function (res) {
  508. self.dataList = res.rows;
  509. self.loadPage(res.total);
  510. self.loadTable();
  511. });
  512. // 统计数据
  513. App.postJson("/api/subInfo/query/statistics", param, function (res) {
  514. if (res.success) {
  515. self.beginRate = res.data;
  516. self.beginRate.hyflList = self.beginRate.hyflData;
  517. self.beginRate.jsddList = self.beginRate.jsddData;
  518. }
  519. });
  520. },
  521. getStatusName: function (status) {
  522. const statusMap = {
  523. '0': '暂存',
  524. '1': '项目前期',
  525. '6': '待开工',
  526. '7': '施工中',
  527. '8': '暂停施工',
  528. 'A': '已竣工'
  529. };
  530. return statusMap[status] || '未知状态';
  531. },
  532. adjustFrozenRowHeight: function () {
  533. $(".layui-table-body tr").each(function (index, val) {
  534. const fixedRow = $(".layui-table-fixed .layui-table-body table tr")[index];
  535. $(fixedRow).height($(val).height());
  536. });
  537. },
  538. loadTable: function () {
  539. // 状态名称映射
  540. // this.dataList.forEach(item => {
  541. // item.statusName = this.getStatusName(item.status);
  542. // });
  543. const self = this;
  544. layui.table.render({
  545. elem: '#table1',
  546. even: true,
  547. autoSort: false,
  548. initSort: self.sort,
  549. cols: [[
  550. {type: 'numbers', align: 'center', width: 44, title: '序号', fixed: 'left'},
  551. {field: 'subName', fixed: 'left', title: '项目名称', width: 200, templet: '#subName'},
  552. {field: 'subjectName', title: '项目所在地', width: 100},
  553. {field: 'content', title: '项目建设内容', minWidth: 300,
  554. templet: function (row) {
  555. // row.content = row.content.replace(/(\d+)/g, '<span class="new-roman">$1</span>');
  556. return row.content ? '<span class="cut" title="' + row.content + '">' + row.content + '</span>' : '';
  557. }},
  558. {
  559. field: 'amtTotal',
  560. title: '计划总投资(亿元)',
  561. width: 80,
  562. templet: d => (d.amtTotal / 10000).toFixed(2) + "亿元"
  563. },
  564. {field: 'progress', title: '进展情况', minWidth: 300,
  565. templet: function (row) {
  566. return row.progress ? '<span class="cut" title="' + row.progress + '">' + row.progress + '</span>' : '';
  567. }},
  568. {field: 'remark', title: '备注', minWidth: 200},
  569. {title: '操作', width: 150, toolbar: '#toolBar', fixed: 'right'},
  570. ]],
  571. fixed: true,
  572. height: $(window).height() - $('#table1').offset().top - 50,
  573. data: self.dataList,
  574. done: function () {
  575. self.adjustFrozenRowHeight();
  576. }
  577. });
  578. layui.table.on('tool(' + this.tableName + ')', obj => {
  579. const {event} = obj;
  580. if (typeof self[event] === 'function') {
  581. self[event](obj);
  582. } else {
  583. console.warn(`未定义的事件: ${event}`);
  584. }
  585. });
  586. layui.table.on('sort(' + this.tableName + ')', function (obj) {
  587. self.sort = obj;
  588. self.getData();
  589. });
  590. },
  591. move(obj) {
  592. this.moveDbParam.id = obj.data.id
  593. const formTemplate = document.getElementById('moveForm').innerHTML;
  594. layer.open({
  595. type: 1,
  596. title: '转库',
  597. content: formTemplate,
  598. area: ['350px', '300px'],
  599. success: function (layero, index) {
  600. layui.form.render();
  601. }
  602. });
  603. },
  604. loadPage: function (totalCount) {
  605. var self = this;
  606. layui.laypage.render({
  607. elem: 'pagination',
  608. count: totalCount,
  609. curr: self.pageNo,
  610. limit: self.pageSize,
  611. layout: ['count', 'prev', 'page', 'next', 'skip'],
  612. jump: function (obj, first) {
  613. //首次不执行
  614. if (!first) {
  615. self.pageNo = obj.curr;
  616. self.getData();
  617. }
  618. }
  619. });
  620. },
  621. exportExcel: function () {
  622. var param = this.getSearchParams();
  623. App.common.utils.downFile(App.getUrl("subInfoExport/exportSumExcel"), "POST", param, "项目情况表.xlsx", "导出失败");
  624. },
  625. exportTotalExcel: function () {
  626. var param = this.getSearchParams();
  627. param.status = '1'
  628. App.common.utils.downFile(App.getUrl("subInfoExport/exportTotalExcelByStatus"), "POST", param, "项目情况表(储备库).xlsx", "导出失败");
  629. },
  630. exportDetailExcel: function () {
  631. var param = this.getSearchParams();
  632. param.status = '1'
  633. App.common.utils.downFile(App.getUrl("subInfoExport/exportDetailExcel"), "POST", param, "项目明细(储备库).xlsx", "导出失败");
  634. },
  635. exportExcelByIndusKind: function () {
  636. var param = this.getSearchParams();
  637. App.common.utils.downFile(App.getUrl("subInfoExport/exportExcelByIndusKind"), "POST", param, "项目情况表(按所属行业统计).xlsx", "导出失败");
  638. },
  639. exportSchedulingExcel: function () {
  640. var param = this.getSearchParams();
  641. App.common.utils.downFile(App.getUrl("subInfoExport/exportSchedulingExcel"), "POST", param, "项目调度表.xlsx", "导出失败");
  642. },
  643. exportMoreExcel: function () {
  644. top.window.getSearchParams = this.getSearchParams;
  645. App.openLayer({
  646. title: "自定义导出",
  647. content: App.getUrl("/subInfoExport/index"),
  648. height: "800",
  649. width: "1000"
  650. })
  651. },
  652. toQcc: function (obj) {
  653. window.open('https://www.qcc.com/web/search?key=' + obj.data.unitName, '_blank')
  654. },
  655. toDetail: function (obj) {
  656. //详情
  657. var index = layer.open({
  658. type: 2,
  659. title: '',
  660. area: ['1000px', '800px'],
  661. content: App.getUrl("/subject/subInfo/detailView2?layer=true&subId=" + obj.data.id + "&lastUrl=" + window.location.href),
  662. });
  663. layui.layer.full(index);
  664. },
  665. levelList: function (field, title, val) {
  666. //详情
  667. var param = field + "," + title + "," + val
  668. var params = encodeURIComponent(JSON.stringify(this.getSearchParams()));
  669. var index = top.layer.open({
  670. type: 2,
  671. title: '',
  672. area: ['90%', '90%'],
  673. content: App.getUrl("/subject/subInfo/levelList?layer=true&type=" + this.getSearchParams().queryType + "&curParam=" + param + "&params=" + params),
  674. });
  675. //top.layer.full(index);
  676. },
  677. toEditSubInfo: function (obj) {
  678. window.location.href = App.getUrl("/subject/subInfo/editSubInfo2?subId=" + obj.data.id + "&queryType=3");
  679. },
  680. search: function () {
  681. var param = layui.form.getValue("searchForm");
  682. window.localStorage.setItem(this.cacheName, JSON.stringify(param));
  683. this.pageNo = 1;
  684. this.getData();
  685. },
  686. openExport: function () {
  687. this.showExport = true;
  688. },
  689. choseExport: function () {
  690. this.showExport = false;
  691. },
  692. receiveMessage (e) {
  693. console.log('cb receiveMessage: ', e.data)
  694. if (e.data.topBreadcrumb) {
  695. $(".top-breadcrumb").html(e.data.topBreadcrumb)
  696. }
  697. },
  698. }
  699. });
  700. </script>
  701. </body>
  702. </html>