engineering.html 28 KB

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