engineering.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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 class="form-group col-md-3">
  247. <label>子目增加费</label>
  248. <div class="item_increase-list">
  249. <% if (Object.keys(libData).length > 0 && libData.item_increase_lib && libData.item_increase_lib.length > 0) { %>
  250. <% libData.item_increase_lib.forEach(function (info, index){ %>
  251. <p class="form-control-static">
  252. <a class="pull-right text-danger remove-lib" data-model="item_increase" title="移除" data-id="<%= info.id %>">
  253. <span class="glyphicon glyphicon-remove"></span>
  254. </a>
  255. <input type="hidden" name="item_increase_lib" data-id="<%= info.id %>" value="<%= JSON.stringify({id: info.id, name: info.name}) %>">
  256. <% if (index === 0) {%><i class="glyphicon glyphicon-flag"></i>&nbsp;<% } %><%= info.name %>
  257. </p>
  258. <% }) %>
  259. <% } %>
  260. </div>
  261. <a href="#" class="btn btn-link btn-sm add-compilation" data-model="item_increase">添加</a>
  262. </div>
  263. </div>
  264. <div class="col-md-12">
  265. <a data-toggle="modal" data-target="#other_setting" class="btn btn-primary btn-sm " style="margin-right:5px">显示设置</a>
  266. </div>
  267. <div class="col-md-12" style="padding-top:20px">
  268. <legend>计算程序/清单模板/列设置/费率标准</legend>
  269. <a data-toggle="modal" data-target="#addTaxGroup" class="btn btn-link btn-sm " id="addTaxGroupBtn" style="margin-right:5px">添加</a>
  270. <table class="table engineer_table">
  271. <thead>
  272. <tr>
  273. <th>计税方式</th>
  274. <th>计算程序</th>
  275. <th>指标分部</th>
  276. <th>清单模板</th>
  277. <th>列设置</th>
  278. <th>费率标准</th>
  279. <th>操作</th>
  280. </tr>
  281. </thead>
  282. <tbody id="tax_group_tbody">
  283. <% if (Object.keys(libData).length > 0 && libData.tax_group.length > 0) { %>
  284. <% for(let tax of libData.tax_group) {%>
  285. <% let groupIndex = "";%>
  286. <tr class='taxGroup_tr'>
  287. <td>
  288. <% if(tax.taxType === "1") { %>
  289. <% groupIndex = groupIndex + tax.taxType;%>
  290. <span>一般计税</span>
  291. <% } else if(tax.taxType === "2"){%>
  292. <% groupIndex = groupIndex + tax.taxType;%>
  293. <span>简易计税</span>
  294. <% } %>
  295. </td>
  296. <td>
  297. <% if(tax.program_lib && tax.program_lib.id) { %>
  298. <% groupIndex = groupIndex + tax.program_lib.id;%>
  299. <span><%= tax.program_lib.displayName%></span>
  300. <% } %>
  301. </td>
  302. <td>
  303. <% if(tax.norm_lib) { %>
  304. <% groupIndex = groupIndex + tax.norm_lib;%>
  305. <span><%= tax.norm_lib%></span>
  306. <% } %>
  307. </td>
  308. <td>
  309. <% if(tax.template_lib && tax.template_lib.id) { %>
  310. <% groupIndex = groupIndex + tax.template_lib.id;%>
  311. <span><%= tax.template_lib.name%></span>
  312. <% } %>
  313. </td>
  314. <td>
  315. <% if(tax.col_lib && tax.col_lib.id) { %>
  316. <% groupIndex = groupIndex + tax.col_lib.id;%>
  317. <span><%= tax.col_lib.name%></span>
  318. <% } %>
  319. </td>
  320. <td>
  321. <% if(tax.fee_lib && tax.fee_lib.id) { %>
  322. <% groupIndex = groupIndex + tax.fee_lib.id;%>
  323. <span><%= tax.fee_lib.name%></span>
  324. <% } %>
  325. </td>
  326. <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>
  327. <input type='hidden' name='tax_group' data-id ="<%= groupIndex%>" value="<%= JSON.stringify(tax) %>">
  328. </td>
  329. </tr>
  330. <% } %>
  331. <% } %>
  332. </tbody>
  333. </table>
  334. </div>
  335. <div class="col-md-12" style="padding-top:20px">
  336. <legend>定额库</legend>
  337. <a data-toggle="modal" data-target="#addRation" class="btn btn-link btn-sm " id="addRatioBtn" style="margin-right:5px">添加</a>
  338. <a data-toggle="modal" data-target="#copy-lib" class="btn btn-link btn-sm " style="margin-right:5px">复制到</a>
  339. <table class="table engineer_table">
  340. <thead>
  341. <tr>
  342. <th>定额库名称</th>
  343. <th>默认</th>
  344. <th>操作</th>
  345. </tr>
  346. </thead>
  347. <tbody id="ration_tbody">
  348. <% if (Object.keys(libData).length > 0 && libData.ration_lib.length > 0) { %>
  349. <% libData.ration_lib.forEach(function (ration, index){ %>
  350. <tr class='ration_tr' draggable="true">
  351. <td>
  352. <span class="cursor-default"><%= ration.name%></span>
  353. </td>
  354. <td>
  355. <label class="form-check-label">
  356. <% if(ration.isDefault == true){%>
  357. <input class="form-check-input" name="ration_isDefault" checked value="<%= ration.id %>" type="radio">
  358. <% }else{ %>
  359. <input class="form-check-input" name="ration_isDefault" value="<%= ration.id %>" type="radio">
  360. <% } %>
  361. </label>
  362. </td>
  363. <td><a class='btn btn-link btn-sm ' style="padding: 0px" onclick='deleteTableTr(this,"ration_tr")'>删除</a>
  364. <input type="hidden" name="ration_lib" data-id="<%= ration.id %>" value="<%= JSON.stringify(ration) %>">
  365. </td>
  366. </tr>
  367. <% }) %>
  368. <% } %>
  369. </tbody>
  370. </table>
  371. </div>
  372. </div>
  373. <input type="hidden" name="glj_col" value="<%= gljCol %>" id="glj_col">
  374. <input type="hidden" name="isInstall" value="<%= libData.isInstall %>" id="isInstall">
  375. <input type="hidden" name="isItemIncrease" value="<%= libData.isItemIncrease %>" id="isItemIncrease">
  376. <input type="hidden" name="isAreaIncrease" value="<%= libData.isAreaIncrease %>" id="isAreaIncrease">
  377. <input type="hidden" name="engineering" value="<%= libData.engineering %>" id="engineering">
  378. <input type="hidden" name="section" value="<%= section %>" id="section">
  379. <input type="hidden" name="id" value="<%= libData._id.toString()%>">
  380. </div>
  381. </form>
  382. </div>
  383. </div>
  384. </div>
  385. <script type="text/javascript">
  386. let billList = '<%- billList %>';
  387. let rationList = '<%- rationList %>';
  388. let gljList = '<%- gljList %>';
  389. let feeRateList = '<%- feeRateList %>';
  390. let artificialCoefficientList = '<%- artificialCoefficientList %>';
  391. let programList = '<%- calculationList %>';
  392. let billsTemplateData = '<%- billsTemplateData %>';
  393. let billsGuidanceList = '<%- billsGuidanceList %>';
  394. let gljCol = '<%- gljCol %>';
  395. let billTemplateList = '<%- billTemplateList %>';
  396. let mainTreeColList = '<%- mainTreeColList %>';
  397. let featureList = '<%- featureList %>';
  398. let infoList = '<%- infoList %>';
  399. let itemIncreaseList = '<%- itemIncreaseList %>';
  400. let progressiveList = '<%- progressiveList %>';
  401. let engineerInfoList ='<%- engineerInfoList %>';
  402. let engineerFeatureList ='<%- engineerFeatureList %>';
  403. let materialList ='<%- materialList %>';
  404. let mainQuantityList ='<%- mainQuantityList %>';
  405. let economicList ='<%- economicList %>';
  406. let overHeightList = '<%- overHeightList %>';
  407. let colSpread = null;
  408. let colEditSpread = null;
  409. </script>
  410. <script type="text/javascript" src="/public/web/id_tree.js"></script>
  411. <script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
  412. <script type="text/javascript" src="/web/users/js/compilation.js"></script>
  413. <%include ../compilation/modal.html %>