wbslist.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: user
  4. Date: 2019/8/7
  5. Time: 18:39
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  9. <%@ include file="/webpage/include/taglib.jsp"%>
  10. <html>
  11. <head>
  12. <title>wbs</title>
  13. <link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
  14. <link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
  15. <script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
  16. </head>
  17. <style>
  18. .btn_out{
  19. width: 100px;
  20. margin: 0;
  21. float: right;
  22. margin-right:2%;
  23. }
  24. .div_main_form{
  25. width: 50%;
  26. margin-left: 10px;
  27. }
  28. .layui-table-view .layui-table {width:100%}
  29. </style>
  30. <body style="background-color: white">
  31. <sys:message content="${message}"/>
  32. <!-----------本体部分--------->
  33. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  34. <legend>本体部分</legend>
  35. </fieldset>
  36. <div class="" style="margin-left: 10px;margin-right: 10px;margin-top: 10px;">
  37. <%--<button type="button" class="layui-btn layui-btn-fluid btn_out" onclick="export()">导出</button>--%>
  38. <c:forEach items="${map.list1}" var="data1" varStatus="index">
  39. <a class="layui-btn" href="${ctx}/jkxl/export?id=${data1.id}">导出</a>
  40. </c:forEach>
  41. <%--<table:importExcel url="${ctx}/propertycostreminder/propertyCostReminder/import"></table:importExcel>--%>
  42. <table id="table1" class="layui-table" lay-filter="table1"></table>
  43. </div>
  44. <!-----------其他部分--------->
  45. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  46. <legend>其他部分</legend>
  47. </fieldset>
  48. <div class="" style="margin-left: 10px;margin-right: 10px;">
  49. <table id="table2" class="layui-table" lay-filter="table2"></table>
  50. </div>
  51. <!-----------未识别部分--------->
  52. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  53. <legend>未识别部分</legend>
  54. </fieldset>
  55. <table class="layui-table" lay-data="{ url:'json/xmmc.json', page:false, id:'idTest'}" lay-filter="freestr">
  56. <thead>
  57. <tr>
  58. <!--<th lay-data="{type:'checkbox', fixed: 'left'}"></th>-->
  59. <th lay-data="{field:'xmmc', width:200}">项目名称</th>
  60. <th lay-data="{field:'fyje', width:200}">费用金额</th>
  61. <th lay-data="{width:178, align:'center', toolbar: '#barDemo'}"></th>
  62. </tr>
  63. </thead>
  64. </table>
  65. <table class="layui-table" id="layui_table_id" lay-filter="dataTable"></table>
  66. <script type="text/html" id="barDemo">
  67. <a class="layui-btn layui-btn-xs" lay-event="fttz">分摊调整</a>
  68. <a class="layui-btn layui-btn-xs" lay-event="ddtz">单独调整</a>
  69. <!--<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
  70. </script>
  71. </body>
  72. <script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
  73. <script>
  74. layui.config({
  75. base: '${ctxp}/static/plugin/assets/'
  76. }).extend({
  77. treetable: 'treetable-lay/treetable'
  78. }).use(['layer', 'table', 'treetable'], function () {
  79. var $ = layui.jquery;
  80. var table = layui.table;
  81. var layer = layui.layer;
  82. var treetable = layui.treetable;
  83. var renderTable1 = function () {
  84. layer.load(2);
  85. treetable.render({
  86. treeColIndex: 1,
  87. treeSpid: -1,
  88. treeIdName: 'id',
  89. treePidName: 'pid',
  90. treeDefaultClose: false,
  91. treeLinkage: false,
  92. elem: '#table1',
  93. <%--url: '${ctxp}/webpage/modules/sys/free/selfwbs.json',--%>
  94. page: false,
  95. cols: [[
  96. {type:'numbers',title: '序号', rowspan: 2, totalRowText: "合计",},
  97. {field: 'wbsys', title: 'WBS要素',width:200, rowspan:'2'},
  98. {field:'wbssbm',width:100, align:'center',rowspan:'2',title:"wbs识别码",rowspan:'2'},
  99. {field:'fbfxysj', align:'center', title: '分布分项(原数据)',colspan:'6'},
  100. {field:'fbfxtch',align:'center',title:'分布分项(调差后)',colspan:'4'},
  101. {field:'fbfxtch',align:'center',title:'共性分摊费用',colspan:'10'},
  102. {field:'hj',align:'center',width:80,title:'合计',rowspan:'2',totalRow: true}
  103. // {templet: '#oper-col', title: 'oper'}
  104. ],[
  105. {field:'hjje', width:90,align:'center',title:'合计金额',totalRow: true},
  106. {field:'zjgcf', width:100,align:'center',title:'直接工程费',totalRow: true},
  107. {field:'rgf1', width:80,align:'center',title:'人工费',totalRow: true},
  108. {field:'cbrcg1', width:100,align:'center',title:'承包人采购',totalRow: true},
  109. {field:'fbrcg1', width:100,align:'center',title:'发包人采购',totalRow: true},
  110. {field:'jxf1', width:80,align:'center',title:'机械费',totalRow: true},
  111. {field:'rgf2', width:80,align:'center',title:'人工费',totalRow: true},
  112. {field:'cbrcg2', width:100,align:'center',title:'承包人采购',totalRow: true},
  113. {field:'fbrcg2', width:100,align:'center',title:'发包人采购',totalRow: true},
  114. {field:'jxf2', width:80,align:'center',title:'机械费',totalRow: true},
  115. {field:'rgf3', width:80,align:'center',title:'人工费',totalRow: true},
  116. {field:'cbrcg3', width:100,align:'center',title:'承包人采购',totalRow: true},
  117. {field:'fbrcg3', width:100,align:'center',title:'发包人采购',totalRow: true},
  118. {field:'jxf3', width:80,align:'center',title:'机械费',totalRow: true},
  119. {field:'csf_1',width:100,title:'措施费-1',align:'center',totalRow: true},
  120. {field:'csf_2',width:100,title:'措施费-2',align:'center',totalRow: true},
  121. {field:'csf2',align:'center',width:90,title:'措施费二',totalRow: true},
  122. {field:'qtf',align:'center',width:80,title:'其他费',totalRow: true},
  123. {field:'gf',align:'center',width:60,title:'规费',totalRow: true},
  124. {field:'sf',align:'center',width:60,title:'税金',totalRow: true},
  125. ]]
  126. ,data: [
  127. <c:if test="${ not empty map.list}">
  128. <c:forEach items="${map.list}" var="data" varStatus="index">
  129. <c:if test="${data.state eq '1'}">
  130. {
  131. "id": "${data.wbsCode}",
  132. "wbsys":"${data.describe}",
  133. "wbssbm": "${data.wbsCode}",
  134. "hjje": "${data.originalTotalCost}",
  135. "zjgcf":"${data.zjgcFee}",
  136. "rgf1": "${data.originalRgCost}",
  137. "cbrcg1": "${data.originalCbrCost}",
  138. "fbrcg1": "${data.originalFbrCost}",
  139. "jxf1": "${data.originalJxCost}",
  140. "rgf2": "${data.jxCost}",
  141. "cbrcg2": "${data.cbrCost}",
  142. "fbrcg2":"${data.fbrCost}",
  143. "jxf2": "${data.jxCost}",
  144. <%--"rgf3": "${data.rgFtFee}",--%>
  145. "rgf3": "${data.rgFtFee}",
  146. "cbrcg3": "${data.cbrFtFee}",
  147. "fbrcg3": "${data.fbrFtFee}",
  148. "jxf3": "${data.jxFtFee}",
  149. "csf_1": "${data.measuresFee1}",
  150. "csf_2": "${data.measuresFee2}",
  151. "csf2": "${data.measuresFee3}",
  152. "qtf":"${data.otherCost}",
  153. "gf":"${data.fees}",
  154. "sf":"${data.tex}",
  155. "hj": "${data.totalFee}",
  156. "pid": "${data.parentNode}"
  157. },
  158. </c:if>
  159. </c:forEach>
  160. </c:if>
  161. ],
  162. done: function () {
  163. layer.closeAll('loading');
  164. }
  165. });
  166. };
  167. renderTable1();
  168. });
  169. </script>
  170. <script>
  171. layui.use(['table', 'form', 'element', 'treetable'], function () {
  172. var $ = layui.jquery;
  173. var table = layui.table;
  174. var form = layui.form;
  175. var element = layui.element;
  176. var treetable = layui.treetable;
  177. // 渲染表格
  178. var renderTable2 = function () {
  179. layer.load(2);
  180. treetable.render({
  181. treeColIndex: 1,
  182. treeSpid: -1,
  183. treeIdName: 'd_id',
  184. treePidName: 'd_pid',
  185. elem: '#table2',
  186. <%--url: '${ctxp}/webpage/modules/sys/free/other.json',--%>
  187. page: false,
  188. cols: [[
  189. {type: 'numbers'},
  190. // {field: 'id', title: 'WBS要素'},
  191. {field: 'wbsys', title: 'WBS要素'},
  192. {field: 'wbssbm', title: 'WBS识别码'},
  193. {field: 'money', title: '金额'},
  194. // {field: 'pid', title: 'pid'},
  195. ]]
  196. ,data: [
  197. <c:if test="${ not empty map.list}">
  198. <c:forEach items="${map.list}" var="data" varStatus="index">
  199. <c:if test="${data.state eq '0'}">
  200. {
  201. "d_id": "${data.wbsCode}",
  202. "wbsys": "${data.describe}",
  203. "wbssbm": "${data.wbsCode}",
  204. "money": "${data.totalFee}",
  205. "d_pid": "${data.parentNode}"
  206. },
  207. </c:if>
  208. </c:forEach>
  209. </c:if>
  210. ],
  211. done: function () {
  212. layer.closeAll('loading');
  213. }
  214. });
  215. };
  216. renderTable2();
  217. });
  218. </script>
  219. <script>
  220. layui.use('table', function(){
  221. var table = layui.table;
  222. });
  223. </script>
  224. <script>
  225. layui.use('table', function(){
  226. var table = layui.table;
  227. //监听表格复选框选择
  228. table.on('checkbox(freestr)', function(obj){
  229. console.log(obj)
  230. });
  231. //监听工具条
  232. table.on('tool(freestr)', function(obj){
  233. var datacount="";
  234. var data = obj.data;
  235. alert(data);
  236. if(obj.event === 'fttz'){
  237. datacount=JSON.stringify(data);
  238. // layer.msg('ID:'+JSON.stringify(data));
  239. } else if(obj.event === 'ddtz'){
  240. datacount=JSON.stringify(data);
  241. // layer.alert('编辑行:<br>'+ JSON.stringify(data));
  242. }
  243. $.ajax({
  244. type : "post",
  245. url : "#",
  246. contentType : "application/json;charset=UTF-8",
  247. data:datacount,
  248. success : function(result) {
  249. window.location.reload();
  250. }
  251. });
  252. });
  253. });
  254. </script>
  255. </html>