engineering.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <%include ./common.html %>
  2. <div class="panel-content">
  3. <div class="panel-title">
  4. <div class="title-main">
  5. <h2>
  6. <a href="javascript:void(0);" id="save-lib" class="btn btn-primary btn-sm pull-right">保存</a>
  7. <a href="/compilation/valuation/<%= section %>/<%= valuationId %>" class="btn btn-default btn-sm pull-right">返回</a>
  8. </h2>
  9. </div>
  10. </div>
  11. <div class="content-wrap">
  12. <div class="c-header" style="padding:0">
  13. <ul class="nav nav-tabs">
  14. <li role="presentation" class="active"><a href="javascript:void(0);"><%= libData.name %> - <%= libData.feeName %></a></li>
  15. </ul>
  16. </div>
  17. <div class="c-body">
  18. <form method="post" action="/compilation/save-lib" enctype="application/x-www-form-urlencoded21">
  19. <div class="row">
  20. <div class="col-md-12">
  21. <div class="row">
  22. <div class="form-group col-md-3">
  23. <label>标准清单</label>
  24. <div class="bill-list">
  25. <% if (Object.keys(libData).length > 0 && libData.bill_lib.length > 0) { %>
  26. <% libData.bill_lib.forEach(function (bill, index){ %>
  27. <p class="form-control-static">
  28. <a class="pull-right text-danger remove-lib" data-model="bill" title="移除">
  29. <span class="glyphicon glyphicon-remove"></span>
  30. </a>
  31. <input type="hidden" name="bill_lib" data-id="<%= bill.id %>" value="<%= JSON.stringify({id: bill.id, name: bill.name}) %>">
  32. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= bill.name %>
  33. </p>
  34. <% }) %>
  35. <% } %>
  36. </div>
  37. <a class="btn btn-link btn-sm add-compilation" href="javascript:void(0)" data-model="bill">添加</a>
  38. </div>
  39. <div class="form-group col-md-3">
  40. <label>人材机库</label>
  41. <div class="glj-list">
  42. <% if (Object.keys(libData).length > 0 && libData.glj_lib.length > 0) { %>
  43. <% libData.glj_lib.forEach(function (glj, index){ %>
  44. <p class="form-control-static">
  45. <a class="pull-right text-danger remove-lib" data-model="glj" title="移除" data-id="<%= glj.id %>">
  46. <span class="glyphicon glyphicon-remove"></span>
  47. </a>
  48. <input type="hidden" name="glj_lib" data-id="<%= glj.id %>" value="<%= JSON.stringify({id: glj.id, name: glj.name}) %>">
  49. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= glj.name %>
  50. </p>
  51. <% }) %>
  52. <% } %>
  53. </div>
  54. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="glj">添加</a>
  55. </div>
  56. <div class="form-group col-md-3">
  57. <label>清单指引库</label>
  58. <div class="billsGuidance-list">
  59. <% if (Object.keys(libData).length > 0 && libData.billsGuidance_lib.length > 0) { %>
  60. <% libData.billsGuidance_lib.forEach(function (billsGuidance, index){ %>
  61. <p class="form-control-static">
  62. <a class="pull-right text-danger remove-lib" data-model="billsGuidance" title="移除" data-id="<%= billsGuidance.id %>">
  63. <span class="glyphicon glyphicon-remove"></span>
  64. </a>
  65. <input type="hidden" name="billsGuidance_lib" data-id="<%= billsGuidance.id %>" value="<%= JSON.stringify({id: billsGuidance.id, name: billsGuidance.name}) %>">
  66. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= billsGuidance.name %>
  67. </p>
  68. <% }) %>
  69. <% } %>
  70. </div>
  71. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="billsGuidance">添加</a>
  72. </div>
  73. <div class="form-group col-md-3">
  74. <label>人工系数</label>
  75. <div class="artificial-list">
  76. <% if (Object.keys(libData).length > 0 && libData.artificial_lib.length > 0) { %>
  77. <% libData.artificial_lib.forEach(function (artificial, index){ %>
  78. <p class="form-control-static">
  79. <a class="pull-right text-danger remove-lib" data-model="artificial" title="移除" data-id="<%= artificial.id %>">
  80. <span class="glyphicon glyphicon-remove"></span>
  81. </a>
  82. <input type="hidden" name="artificial_lib" data-id="<%= artificial.id %>" value="<%= JSON.stringify({id: artificial.id, name: artificial.name}) %>">
  83. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= artificial.name %>
  84. </p>
  85. <% }) %>
  86. <% } %>
  87. </div>
  88. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="artificial">添加</a>
  89. </div>
  90. </div>
  91. <div class="row">
  92. <div class="form-group col-md-3">
  93. <label>工程特征</label>
  94. <div class="feature-list">
  95. <% if (Object.keys(libData).length > 0 && libData.feature_lib && libData.feature_lib.length > 0) { %>
  96. <% libData.feature_lib.forEach(function (feature, index){ %>
  97. <p class="form-control-static">
  98. <a class="pull-right text-danger remove-lib" data-model="feature" title="移除" data-id="<%= feature.id %>">
  99. <span class="glyphicon glyphicon-remove"></span>
  100. </a>
  101. <input type="hidden" name="feature_lib" data-id="<%= feature.id %>" value="<%= JSON.stringify({id: feature.id, name: feature.name}) %>">
  102. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= feature.name %>
  103. </p>
  104. <% }) %>
  105. <% } %>
  106. </div>
  107. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="feature">添加</a>
  108. </div>
  109. <div class="form-group col-md-3">
  110. <label>基本信息</label>
  111. <div class="info-list">
  112. <% if (Object.keys(libData).length > 0 && libData.info_lib && libData.info_lib.length > 0) { %>
  113. <% libData.info_lib.forEach(function (info, index){ %>
  114. <p class="form-control-static">
  115. <a class="pull-right text-danger remove-lib" data-model="info" title="移除" data-id="<%= info.id %>">
  116. <span class="glyphicon glyphicon-remove"></span>
  117. </a>
  118. <input type="hidden" name="info_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  119. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  120. </p>
  121. <% }) %>
  122. <% } %>
  123. </div>
  124. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="info">添加</a>
  125. </div>
  126. <div class="form-group col-md-3">
  127. <label>工程信息</label>
  128. <div class="engineer_info-list">
  129. <% if (Object.keys(libData).length > 0 && libData.engineer_info_lib && libData.engineer_info_lib.length > 0) { %>
  130. <% libData.engineer_info_lib.forEach(function (info, index){ %>
  131. <p class="form-control-static">
  132. <a class="pull-right text-danger remove-lib" data-model="engineer_info" title="移除" data-id="<%= info.id %>">
  133. <span class="glyphicon glyphicon-remove"></span>
  134. </a>
  135. <input type="hidden" name="engineer_info_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  136. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  137. </p>
  138. <% }) %>
  139. <% } %>
  140. </div>
  141. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="engineer_info">添加</a>
  142. </div>
  143. <div class="form-group col-md-3">
  144. <label>工程特征指标</label>
  145. <div class="engineer_feature-list">
  146. <% if (Object.keys(libData).length > 0 && libData.engineer_feature_lib && libData.engineer_feature_lib.length > 0) { %>
  147. <% libData.engineer_feature_lib.forEach(function (info, index){ %>
  148. <p class="form-control-static">
  149. <a class="pull-right text-danger remove-lib" data-model="engineer_feature" title="移除" data-id="<%= info.id %>">
  150. <span class="glyphicon glyphicon-remove"></span>
  151. </a>
  152. <input type="hidden" name="engineer_feature_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  153. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  154. </p>
  155. <% }) %>
  156. <% } %>
  157. </div>
  158. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="engineer_feature">添加</a>
  159. </div>
  160. <div class="form-group col-md-3">
  161. <label>主要工料指标</label>
  162. <div class="material-list">
  163. <% if (Object.keys(libData).length > 0 && libData.material_lib && libData.material_lib.length > 0) { %>
  164. <% libData.material_lib.forEach(function (info, index){ %>
  165. <p class="form-control-static">
  166. <a class="pull-right text-danger remove-lib" data-model="material" title="移除" data-id="<%= info.id %>">
  167. <span class="glyphicon glyphicon-remove"></span>
  168. </a>
  169. <input type="hidden" name="material_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  170. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  171. </p>
  172. <% }) %>
  173. <% } %>
  174. </div>
  175. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="material">添加</a>
  176. </div>
  177. <div class="form-group col-md-3">
  178. <label>主要工程量指标</label>
  179. <div class="main_quantity-list">
  180. <% if (Object.keys(libData).length > 0 && libData.main_quantity_lib && libData.main_quantity_lib.length > 0) { %>
  181. <% libData.main_quantity_lib.forEach(function (info, index){ %>
  182. <p class="form-control-static">
  183. <a class="pull-right text-danger remove-lib" data-model="main_quantity" title="移除" data-id="<%= info.id %>">
  184. <span class="glyphicon glyphicon-remove"></span>
  185. </a>
  186. <input type="hidden" name="main_quantity_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  187. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  188. </p>
  189. <% }) %>
  190. <% } %>
  191. </div>
  192. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="main_quantity">添加</a>
  193. </div>
  194. <div class="form-group col-md-3">
  195. <label>主要经济指标</label>
  196. <div class="economic-list">
  197. <% if (Object.keys(libData).length > 0 && libData.economic_lib && libData.economic_lib.length > 0) { %>
  198. <% libData.economic_lib.forEach(function (info, index){ %>
  199. <p class="form-control-static">
  200. <a class="pull-right text-danger remove-lib" data-model="economic" title="移除" data-id="<%= info.id %>">
  201. <span class="glyphicon glyphicon-remove"></span>
  202. </a>
  203. <input type="hidden" name="economic_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  204. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  205. </p>
  206. <% }) %>
  207. <% } %>
  208. </div>
  209. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="economic">添加</a>
  210. </div>
  211. <div class="form-group col-md-3">
  212. <label>超高降效</label>
  213. <div class="over_height-list">
  214. <% if (Object.keys(libData).length > 0 && libData.over_height_lib && libData.over_height_lib.length > 0) { %>
  215. <% libData.over_height_lib.forEach(function (info, index){ %>
  216. <p class="form-control-static">
  217. <a class="pull-right text-danger remove-lib" data-model="economic" title="移除" data-id="<%= info.id %>">
  218. <span class="glyphicon glyphicon-remove"></span>
  219. </a>
  220. <input type="hidden" name="over_height_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  221. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  222. </p>
  223. <% }) %>
  224. <% } %>
  225. </div>
  226. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="over_height">添加</a>
  227. </div>
  228. </div>
  229. <div class="col-md-12">
  230. <a data-toggle="modal" data-target="#other_setting" class="btn btn-primary btn-sm " style="margin-right:5px">显示设置</a>
  231. </div>
  232. <div class="col-md-12" style="padding-top:20px">
  233. <legend>计算程序/清单模板/列设置/费率标准</legend>
  234. <a data-toggle="modal" data-target="#addTaxGroup" class="btn btn-link btn-sm " id="addTaxGroupBtn" style="margin-right:5px">添加</a>
  235. <table class="table engineer_table">
  236. <thead>
  237. <tr>
  238. <th>计税方式</th>
  239. <th>计算程序</th>
  240. <th>清单模板</th>
  241. <th>列设置</th>
  242. <th>费率标准</th>
  243. <th>操作</th>
  244. </tr>
  245. </thead>
  246. <tbody id="tax_group_tbody">
  247. <% if (Object.keys(libData).length > 0 && libData.tax_group.length > 0) { %>
  248. <% for(let tax of libData.tax_group) {%>
  249. <% let groupIndex = "";%>
  250. <tr class='taxGroup_tr'>
  251. <td>
  252. <% if(tax.taxType === "1") { %>
  253. <% groupIndex = groupIndex + tax.taxType;%>
  254. <span>一般计税</span>
  255. <% } else if(tax.taxType === "2"){%>
  256. <% groupIndex = groupIndex + tax.taxType;%>
  257. <span>简易计税</span>
  258. <% } %>
  259. </td>
  260. <td>
  261. <% if(tax.program_lib && tax.program_lib.id) { %>
  262. <% groupIndex = groupIndex + tax.program_lib.id;%>
  263. <span><%= tax.program_lib.displayName%></span>
  264. <% } %>
  265. </td>
  266. <td>
  267. <% if(tax.template_lib && tax.template_lib.id) { %>
  268. <% groupIndex = groupIndex + tax.template_lib.id;%>
  269. <span><%= tax.template_lib.name%></span>
  270. <% } %>
  271. </td>
  272. <td>
  273. <% if(tax.col_lib && tax.col_lib.id) { %>
  274. <% groupIndex = groupIndex + tax.col_lib.id;%>
  275. <span><%= tax.col_lib.name%></span>
  276. <% } %>
  277. </td>
  278. <td>
  279. <% if(tax.fee_lib && tax.fee_lib.id) { %>
  280. <% groupIndex = groupIndex + tax.fee_lib.id;%>
  281. <span><%= tax.fee_lib.name%></span>
  282. <% } %>
  283. </td>
  284. <td><a class='btn btn-link btn-sm ' style="padding: 0px" onclick='editTaxGroup(this)'>编辑</a>/<a class='btn btn-link btn-sm ' style="padding: 0px" onclick='deleteTableTr(this,"taxGroup_tr")'>删除</a>
  285. <input type='hidden' name='tax_group' data-id ="<%= groupIndex%>" value="<%= JSON.stringify(tax) %>">
  286. </td>
  287. </tr>
  288. <% } %>
  289. <% } %>
  290. </tbody>
  291. </table>
  292. </div>
  293. <div class="col-md-12" style="padding-top:20px">
  294. <legend>定额库</legend>
  295. <a data-toggle="modal" data-target="#addRation" class="btn btn-link btn-sm " id="addRatioBtn" style="margin-right:5px">添加</a>
  296. <table class="table engineer_table">
  297. <thead>
  298. <tr>
  299. <th>定额库名称</th>
  300. <th>默认</th>
  301. <th>操作</th>
  302. </tr>
  303. </thead>
  304. <tbody id="ration_tbody">
  305. <% if (Object.keys(libData).length > 0 && libData.ration_lib.length > 0) { %>
  306. <% libData.ration_lib.forEach(function (ration, index){ %>
  307. <tr class='ration_tr'>
  308. <td>
  309. <span><%= ration.name%></span>
  310. </td>
  311. <td>
  312. <label class="form-check-label">
  313. <% if(ration.isDefault == true){%>
  314. <input class="form-check-input" name="ration_isDefault" checked value="<%= ration.id %>" type="radio">
  315. <% }else{ %>
  316. <input class="form-check-input" name="ration_isDefault" value="<%= ration.id %>" type="radio">
  317. <% } %>
  318. </label>
  319. </td>
  320. <td><a class='btn btn-link btn-sm ' style="padding: 0px" onclick='deleteTableTr(this,"ration_tr")'>删除</a>
  321. <input type="hidden" name="ration_lib" data-id="<%= ration.id %>" value="<%= JSON.stringify(ration) %>">
  322. </td>
  323. </tr>
  324. <% }) %>
  325. <% } %>
  326. </tbody>
  327. </table>
  328. </div>
  329. </div>
  330. <input type="hidden" name="glj_col" value="<%= gljCol %>" id="glj_col">
  331. <input type="hidden" name="isInstall" value="<%= libData.isInstall %>" id="isInstall">
  332. <input type="hidden" name="isItemIncrease" value="<%= libData.isItemIncrease %>" id="isItemIncrease">
  333. <input type="hidden" name="isAreaIncrease" value="<%= libData.isAreaIncrease %>" id="isAreaIncrease">
  334. <input type="hidden" name="engineering" value="<%= libData.engineering %>" id="engineering">
  335. <input type="hidden" name="section" value="<%= section %>" id="section">
  336. <input type="hidden" name="id" value="<%= libData._id.toString()%>">
  337. </div>
  338. </form>
  339. </div>
  340. </div>
  341. </div>
  342. <script type="text/javascript">
  343. let billList = '<%- billList %>';
  344. let rationList = '<%- rationList %>';
  345. let gljList = '<%- gljList %>';
  346. let feeRateList = '<%- feeRateList %>';
  347. let artificialCoefficientList = '<%- artificialCoefficientList %>';
  348. let programList = '<%- calculationList %>';
  349. let billsTemplateData = '<%- billsTemplateData %>';
  350. let billsGuidanceList = '<%- billsGuidanceList %>';
  351. let gljCol = '<%- gljCol %>';
  352. let billTemplateList = '<%- billTemplateList %>';
  353. let mainTreeColList = '<%- mainTreeColList %>';
  354. let featureList = '<%- featureList %>';
  355. let infoList = '<%- infoList %>';
  356. let engineerInfoList ='<%- engineerInfoList %>';
  357. let engineerFeatureList ='<%- engineerFeatureList %>';
  358. let materialList ='<%- materialList %>';
  359. let mainQuantityList ='<%- mainQuantityList %>';
  360. let economicList ='<%- economicList %>';
  361. let overHeightList = '<%- overHeightList %>';
  362. let colSpread = null;
  363. let colEditSpread = null;
  364. </script>
  365. <script type="text/javascript" src="/public/web/id_tree.js"></script>
  366. <script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
  367. <script type="text/javascript" src="/web/users/js/compilation.js"></script>
  368. <%include ../compilation/modal.html %>