rpt_all_popup.ejs 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. <div class="modal fade" id="paper" data-backdrop="static">
  2. <div class="modal-dialog" role="document">
  3. <div class="modal-content">
  4. <div class="modal-header">
  5. <h5 class="modal-title">页边距(毫米)</h5>
  6. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  7. <span aria-hidden="true">&times;</span>
  8. </button>
  9. </div>
  10. <div class="modal-body">
  11. <div class="row mb-1 justify-content-center">
  12. <div class="col-3">
  13. <div class="input-group input-group-sm ">
  14. <div class="input-group-prepend">
  15. <span class="input-group-text">上</span>
  16. </div>
  17. <input type="number" class="form-control form-control-sm" id="elementMargin_Top" value="12" onchange="rptControlObj.changeMargin('Top', this)" onkeyup="rptControlObj.changeMargin('Top', this)">
  18. </div>
  19. </div>
  20. </div>
  21. <div class="row mb-1 align-items-center">
  22. <div class="col-3">
  23. <div class="input-group input-group-sm ">
  24. <div class="input-group-prepend">
  25. <span class="input-group-text">左</span>
  26. </div>
  27. <input type="number" class="form-control form-control-sm" id="elementMargin_Left" value="12" onchange="rptControlObj.changeMargin('Left', this)" onkeyup="rptControlObj.changeMargin('Left', this)">
  28. </div>
  29. </div>
  30. <div class="col-6">
  31. <h1 class="display-4 text-center"><i class="fa fa-file-o"></i></h1>
  32. </div>
  33. <div class="col-3">
  34. <div class="input-group input-group-sm ">
  35. <div class="input-group-prepend">
  36. <span class="input-group-text">右</span>
  37. </div>
  38. <input type="number" class="form-control form-control-sm" id="elementMargin_Right" value="12" onchange="rptControlObj.changeMargin('Right', this)" onkeyup="rptControlObj.changeMargin('Right', this)">
  39. </div>
  40. </div>
  41. </div>
  42. <div class="row mb-1 justify-content-center">
  43. <div class="col-3">
  44. <div class="input-group input-group-sm ">
  45. <div class="input-group-prepend">
  46. <span class="input-group-text">下</span>
  47. </div>
  48. <input type="number" class="form-control form-control-sm" id="elementMargin_Bottom"value="12" onchange="rptControlObj.changeMargin('Bottom', this)" onkeyup="rptControlObj.changeMargin('Bottom', this)">
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="modal-footer">
  54. <button type="button" class="btn btn-link btn-sm float-left" data-dismiss="modal" onclick="zTreeOprObj.changeCfg(rptControlObj.restoreMargine);">恢复默认值</button>
  55. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal" onclick="rptControlObj.cancelCfgChange()">取消</button>
  56. <a href="javascript:void(0)" class="btn btn-primary btn-sm" data-dismiss="modal" onclick="rptControlObj.confirmCfgChange()">确定</a>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="modal fade" id="format" data-backdrop="static">
  62. <div class="modal-dialog" role="document">
  63. <div class="modal-content">
  64. <div class="modal-header">
  65. <h5 class="modal-title">格式</h5>
  66. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  67. <span aria-hidden="true">&times;</span>
  68. </button>
  69. </div>
  70. <div class="modal-body">
  71. <div class="row mb-1" id="font_cfg_blank_flag"></div>
  72. <div class="row mb-1">
  73. <div class="col-3">边框线粗</div>
  74. <div class="col-4">
  75. <select class="form-control form-control-sm" id="cfg_border_thick" onchange="rptControlObj.changeBorderWeight(this)"><option>1</option><option>2</option></select>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="modal-footer">
  80. <button type="button" class="btn btn-link btn-sm float-left" data-dismiss="modal" onclick="zTreeOprObj.changeCfg(rptControlObj.restoreFormat);">恢复默认值</button>
  81. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal" onclick="rptControlObj.cancelCfgChange()">取消</button>
  82. <a href="javascript:void(0)" class="btn btn-primary btn-sm" data-dismiss="modal" onclick="rptControlObj.confirmCfgChange()">确定</a>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <!--弹出设置-->
  88. <div class="modal fade" id="setting" data-backdrop="static">
  89. <div class="modal-dialog" role="document">
  90. <div class="modal-content">
  91. <div class="modal-header">
  92. <h5 class="modal-title">设置</h5>
  93. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  94. <span aria-hidden="true">&times;</span>
  95. </button>
  96. </div>
  97. <div class="modal-body">
  98. <div class="row mb-1">
  99. <div class="col-12 mb-1">
  100. <div class="form-check">
  101. <label class="form-check-label">
  102. <input type="checkbox" class="form-check-input" id="cfg_rpt_vertical_line" onchange="rptControlObj.changeCfgOption('showVerticalLine', this)">
  103. 报表边框竖线
  104. </label>
  105. </div>
  106. </div>
  107. <div class="col-12 mb-1">
  108. <div class="form-check">
  109. <label class="form-check-label">
  110. <input type="checkbox" class="form-check-input" id="cfg_rpt_narrow" onchange="rptControlObj.changeCfgOption('isNarrow', this)">
  111. 内容窄体输出
  112. </label>
  113. </div>
  114. </div>
  115. <div class="col-12 mb-1">
  116. <div class="form-check">
  117. <label class="form-check-label">
  118. <input type="checkbox" class="form-check-input" id="cfg_rpt_fill_zero" onchange="rptControlObj.changeCfgOption('fillZero', this)">
  119. 小数补0
  120. </label>
  121. </div>
  122. </div>
  123. <div class="col-12 mb-1" id="cfg_rpt_close_warter_mark_div" >
  124. <div class="form-check">
  125. <label class="form-check-label">
  126. <input type="checkbox" class="form-check-input" id="cfg_rpt_close_warter_mark" onchange="rptControlObj.changeCfgOption('closeWarterMark', this)">
  127. 导出Excel-不带水印
  128. </label>
  129. </div>
  130. </div>
  131. <div class="col-12 mb-1">
  132. <div class="form-check">
  133. <label class="form-check-label">
  134. <input type="checkbox" class="form-check-input" id="cfg_rpt_continuous" onchange="rptControlObj.changeCfgOption('continuousOutput', this)">
  135. 导出Excel-连续输出(仅流水内容报表有效)
  136. </label>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. <div class="modal-footer">
  142. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" onclick="rptControlObj.cancelCfgChange()">取消</button>
  143. <a href="javascript:void(0)" class="btn btn-primary btn-sm" data-dismiss="modal" onclick="rptControlObj.confirmCfgChange()">确定</a>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. <div class="modal fade" id="export_excel" data-backdrop="static">
  149. <div class="modal-dialog" role="document">
  150. <div class="modal-content">
  151. <div class="modal-header">
  152. <h5 class="modal-title">批量导出Excel</h5>
  153. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  154. <span aria-hidden="true">&times;</span>
  155. </button>
  156. </div>
  157. <div class="modal-body">
  158. <div class="row">
  159. <div class="col-6">
  160. <div class="card">
  161. <img class="card-img-top" src="/public/images/p2.png">
  162. <div class="card-body px-3">
  163. <div class="form-check">
  164. <input class="form-check-input" type="radio" name="excelExportTypeRadio" id="excelExportType_AllInOneBook" value="option1" checked>
  165. <label class="form-check-label" for="excelExportType_AllInOneBook">
  166. 多个表导出一个Excel文件
  167. </label>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <div class="col-6">
  173. <div class="card">
  174. <img class="card-img-top" src="/public/images/p1.png">
  175. <div class="card-body px-3">
  176. <div class="form-check">
  177. <input class="form-check-input" type="radio" name="excelExportTypeRadio" id="excelExportType_IndividualBook" value="option2" checked>
  178. <label class="form-check-label" for="excelExportType_IndividualBook">
  179. 每个表导出一个Excel文件
  180. </label>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="modal-footer">
  188. <a onclick="rptControlObj.getExcel()" class="btn btn-primary btn-sm" data-dismiss="modal">确定导出</a>
  189. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">取消</button>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <div class="modal fade" id="eSignature" data-backdrop="static">
  195. <div class="modal-dialog modal-lg" role="document">
  196. <div class="modal-content">
  197. <div class="modal-header">
  198. <h5 class="modal-title">设置签字(审核通过后才显示)</h5>
  199. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  200. <span aria-hidden="true">&times;</span>
  201. </button>
  202. </div>
  203. <div class="modal-body" id="eSignatureBodyDiv">
  204. </div>
  205. <div class="modal-footer">
  206. <% if ( stg_id > 0 && pageShow !== null && parseInt(pageShow.openSign) === 1) { %>
  207. <button type="button" id="btn_cross_tender" class="btn btn-sm btn-link float-left" data-dismiss="modal" data-toggle="modal" data-target="#batch-eSignature" id="batch-setupProjSignature" onclick="rptSignatureHelper.resetESignature(zTreeOprObj.currentRptPageRst, 'batch-eSignatureBodyDiv'); buildTendersTree();">批量设置其他标段</button>
  208. <% } %>
  209. <% if (stg_id === -300) { %>
  210. <button type="button" id="btn_cross_tender" class="btn btn-sm btn-link float-left" data-dismiss="modal" data-toggle="modal" data-target="#batch-eSignature" id="batch-setupChangeSignature" onclick="rptSignatureHelper.resetESignature(zTreeOprObj.currentRptPageRst, 'batch-eSignatureBodyDiv', true); buildChangeTree();">批量设置其他变更令</button>
  211. <% } %>
  212. <% if ([-301, -302, -303].indexOf(stg_id) >= 0) { %>
  213. <button type="button" id="btn_cross_tender" class="btn btn-sm btn-link float-left" data-dismiss="modal" data-toggle="modal" data-target="#batch-eSignature"
  214. onclick="rptSignatureHelper.resetESignature(zTreeOprObj.currentRptPageRst, 'batch-eSignatureBodyDiv', true); buildOtherTree(ALL_OTHER);">
  215. 批量设置其他<%- otherHintName %>
  216. </button>
  217. <% } %>
  218. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal" onclick="rptSignatureHelper.removeSelectSignature()">取消</button>
  219. <a href="javascript:void(0);" onclick="rptSignatureHelper.setupAfterSelectSignature('eSignatureBodyDiv')" class="btn btn-primary btn-sm" data-dismiss="modal">确定</a>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. <div class="modal fade" id="batch-eSignature" data-backdrop="static">
  225. <div class="modal-dialog modal-xl" role="document">
  226. <div class="modal-content">
  227. <div class="modal-header">
  228. <h5 class="modal-title">批量设置签字</h5>
  229. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  230. <span aria-hidden="true">&times;</span>
  231. </button>
  232. </div>
  233. <div class="modal-body">
  234. <div class="row">
  235. <div class="col-5">
  236. <div class="modal-height-500" style="overflow-y:auto;">
  237. <table class="table table-hover table-bordered" id="batch_tenders_individual">
  238. </table>
  239. </div>
  240. </div>
  241. <div class="col-7">
  242. <div class="modal-height-500 ml-2" id="batch-eSignatureBodyDiv" style="overflow-y:auto;"></div>
  243. </div>
  244. </div>
  245. <% if (stg_id === -300) { %>
  246. <div class="alert alert-warning">批量操作会覆盖已设置好的签字,请谨慎操作;<b>已选签名的审核时间只对当前变更令有效</b></div>
  247. <% } else if ([-301, -302, -303].indexOf(stg_id) >= 0) { %>
  248. <div class="alert alert-warning">批量操作会覆盖已设置好的签字,请谨慎操作;<b>已选签名的审核时间只对当前<%- otherHintName %>有效</b></div>
  249. <% } else { %>
  250. <div class="alert alert-warning">批量操作会覆盖已设置好的签字,请谨慎操作。</div>
  251. <% } %>
  252. </div>
  253. <div class="modal-footer">
  254. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  255. <% if (stg_id === -300) { %>
  256. <a href="javascript:void(0);" onclick="rptSignatureHelper.setupAfterSelectMultiChanges(SELECTED_CHANGES, 'batch-eSignatureBodyDiv')" class="btn btn-sm btn-primary" data-dismiss="modal">确定</a>
  257. <% } else if ([-301, -302, -303].indexOf(stg_id) >= 0) { %>
  258. <a href="javascript:void(0);" onclick="rptSignatureHelper.setupAfterSelectMultiOther(SELECTED_OTHER, 'batch-eSignatureBodyDiv')" class="btn btn-sm btn-primary" data-dismiss="modal">确定</a>
  259. <% } else { %>
  260. <a href="javascript:void(0);" onclick="rptSignatureHelper.setupAfterSelectMultiTenders(SELECTED_TENDERS, 'batch-eSignatureBodyDiv')" class="btn btn-sm btn-primary" data-dismiss="modal">确定</a>
  261. <% } %>
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <!--弹出添加签名人-->
  267. <div class="modal fade" id="add-sign" data-backdrop="static">
  268. <div class="modal-dialog modal-sm" role="document">
  269. <div class="modal-content">
  270. <div class="modal-header">
  271. <h5 class="modal-title">添加签字</h5>
  272. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  273. <span aria-hidden="true">&times;</span>
  274. </button>
  275. </div>
  276. <div class="modal-body">
  277. <ul class="nav nav-tabs justify-content-center mb-1" role="tablist">
  278. <li class="nav-item">
  279. <a class="nav-link active px-3 p-1" data-toggle="tab" href="#adst-1" role="tab">项目</a>
  280. </li>
  281. <li class="nav-item">
  282. <a class="nav-link px-3 p-1" data-toggle="tab" href="#adst-2" role="tab"><i class="fa fa-user"></i> 角色</a>
  283. </li>
  284. <li class="nav-item">
  285. <a class="nav-link px-3 p-1" data-toggle="tab" href="#adst-3" role="tab">最近使用</a>
  286. </li>
  287. </ul>
  288. <div class="tab-content">
  289. <div class="tab-pane fade show active" id="adst-1" role="tabpanel" aria-labelledby="home-tab">
  290. <div class="input-group input-group-sm mt-1 mb-2">
  291. <div class="input-group-prepend">
  292. <span class="input-group-text" id="inputGroup-sizing-sm"><i class="fa fa-search" onclick="rptSignatureHelper.buildSelectableAccount(this);"></i></span>
  293. </div>
  294. <input type="text" id="search_account" class="form-control form-control-sm" placeholder="搜索..." onkeypress="searchAccount()">
  295. </div>
  296. <div class="modal-height-300" id="project_account_select_div">
  297. </div>
  298. </div>
  299. <div class="tab-pane fade" id="adst-2" role="tabpanel" aria-labelledby="profile-tab">
  300. <a href="javascript:void(0)" onclick="rptSignatureHelper.switchAddRoleDiv(this)" class="btn btn-sm btn-link">添加角色</a>
  301. <div class="modal-height-300">
  302. <!--添加角色-->
  303. <div class="card" id="role_select_acc_div" style="display:none">
  304. <div class="p-2">
  305. <div class="input-group input-group-sm mb-1">
  306. <div class="input-group-prepend">
  307. <span class="input-group-text" id="inputGroup-sizing-sm">角色名称</span>
  308. </div>
  309. <input type="text" class="form-control form-control-sm" id="acc_role_name" placeholder="最多10个字符">
  310. </div>
  311. <div class="input-group input-group-sm mb-1">
  312. <div class="input-group-prepend">
  313. <span class="input-group-text" id="inputGroup-sizing-sm">绑定成员</span>
  314. </div>
  315. <select class="form-control form-control-sm" id="project_account_select_dom">
  316. </select>
  317. </div>
  318. <a href="javascript:void(0)" onclick="rptSignatureHelper.createNewRole(this)" class="btn btn-sm btn-primary">添加角色</a>
  319. </div>
  320. </div>
  321. <ul class="list-group p-2" id="existed_roles_ul">
  322. </ul>
  323. </div>
  324. </div>
  325. <div class="tab-pane fade" id="adst-3" role="tabpanel" aria-labelledby="contact-tab">
  326. <div class="modal-height-300">
  327. <ul class="list-group" id="account_used_select_div"></ul>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. <!--选择个人章-->
  336. <div class="modal fade" id="chose-private-stamp-path" data-backdrop="static">
  337. <div class="modal-dialog modal-lg" role="document">
  338. <div class="modal-content">
  339. <div class="modal-header">
  340. <h5 class="modal-title" id="select-personal-signature-title">选择个人章</h5>
  341. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  342. <span aria-hidden="true">&times;</span>
  343. </button>
  344. </div>
  345. <div class="modal-body">
  346. </div>
  347. <div class="modal-footer">
  348. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  349. <button id="audit-select-ok" class="btn btn-primary btn-sm" onclick="rptSignatureHelper.setPrivateStamp(this)">确定</button>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <!--选择审批人-->
  355. <div class="modal fade" id="audit-select" data-backdrop="static">
  356. <div class="modal-dialog" role="document">
  357. <div class="modal-content">
  358. <div class="modal-header">
  359. <h5 class="modal-title" id="audit-select-title">重置</h5>
  360. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  361. <span aria-hidden="true">&times;</span>
  362. </button>
  363. </div>
  364. <div class="modal-body">
  365. <table class="table table-bordered">
  366. <tr><th style="width: 50%">报表数据</th><th>审批人</th></tr>
  367. <tbody id="audit-select-list">
  368. </tbody>
  369. </table>
  370. <div id="audit-select-hint" class="text-danger">
  371. </div>
  372. </div>
  373. <div class="modal-footer">
  374. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  375. <button id="audit-select-ok" class="btn btn-primary btn-sm" onclick="rptCustomObj.resetAuditSelect(this)">确定</button>
  376. </div>
  377. </div>
  378. </div>
  379. </div>
  380. <!--选择标段-->
  381. <div class="modal fade" id="gather-select" data-backdrop="static">
  382. <div class="modal-dialog modal-lgx" role="document">
  383. <div class="modal-content">
  384. <div class="modal-header">
  385. <h5 class="modal-title" id="gather-select-title">选择标段</h5>
  386. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  387. <span aria-hidden="true">&times;</span>
  388. </button>
  389. </div>
  390. <div class="modal-body">
  391. <div class="row">
  392. <div class="col-7">
  393. <h5>可选标段 </h5>
  394. <div class="modal-height-500" id="gather-source-spread">
  395. </div>
  396. </div>
  397. <div class="col-5">
  398. <h5>已选标段 </h5>
  399. <div class="modal-height-500" id="gather-result-spread">
  400. </div>
  401. <div class="mt-1" id="gather-by-month" style="width: 60%" name="gather-type">
  402. <div class="input-group input-group-sm">
  403. <div class="input-group-prepend">
  404. <span class="input-group-text">汇总年月</span>
  405. </div>
  406. <input id="gather-month" class="datepicker-here form-control form-control-sm" auto-close="true" autocomplete="off" placeholder="点击选择年月" data-view="months" data-min-view="months" data-date-format="yyyy-MM" data-language="zh" type="text" autocomplete="off">
  407. </div>
  408. </div>
  409. <div id="gather-by-zone" name="gather-type">
  410. <div class="input-group input-group-sm">
  411. <div class="input-group-prepend">
  412. <span class="input-group-text">汇总周期</span>
  413. </div>
  414. <input id="gather-zone" class="datepicker-here form-control mt-0" placeholder="点击选择周期" data-range="true" data-multiple-dates-separator=" - " data-min-view="months" data-view="months" data-date-format="yyyy-MM" data-language="zh" type="text" autocomplete="off">
  415. </div>
  416. </div>
  417. <div id="gather-by-custom-zone" name="gather-type">
  418. <div class="input-group input-group-sm">
  419. <div class="input-group-prepend">
  420. <span class="input-group-text">汇总周期</span>
  421. </div>
  422. <input id="gather-custom-zone" class="datepicker-here form-control mt-0" placeholder="点击选择周期" data-range="true" data-multiple-dates-separator=" - " data-min-view="days" data-view="days" data-date-format="yyyy-MM-dd" data-language="zh" type="text" autocomplete="off">
  423. </div>
  424. </div>
  425. <div id="gather-by-stage" name="gather-type">
  426. <div class="input-group input-group-sm">
  427. <div class="input-group-prepend">
  428. <span class="input-group-text">选择期</span>
  429. </div>
  430. <select class="form-control" id="gather-stage">
  431. <option>第1期</option>
  432. </select>
  433. </div>
  434. </div>
  435. <div id="gather-by-stage-zone" name="gather-type">
  436. <div class="input-group input-group-sm">
  437. <div class="input-group-prepend">
  438. <span class="input-group-text">汇总</span>
  439. </div>
  440. <select class="form-control" id="gather-stage-begin">
  441. <option>第1期</option>
  442. </select>
  443. <div class="input-group-prepend">
  444. <span class="input-group-text">至</span>
  445. </div>
  446. <select class="form-control" id="gather-stage-end">
  447. <option>第5期</option>
  448. </select>
  449. </div>
  450. </div>
  451. </div>
  452. <div class="text-danger text-center ml-3" id="gather-hint">我是提示呀</div>
  453. </div>
  454. </div>
  455. <div class="modal-footer">
  456. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  457. <button class="btn btn-sm btn-primary" id="gather-select-ok">确定</button>
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. <div class="modal fade" id="stage-select" data-backdrop="static">
  463. <div class="modal-dialog" role="document">
  464. <div class="modal-content">
  465. <div class="modal-header">
  466. <h5 class="modal-title" id="stage-select-title">选择期</h5>
  467. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  468. <span aria-hidden="true">&times;</span>
  469. </button>
  470. </div>
  471. <div class="modal-body">
  472. <div class="row">
  473. <% for (const s of stages) { %>
  474. <div class="col-3">
  475. <div class="custom-control custom-checkbox custom-control-inline">
  476. <input type="checkbox" id="stage-select-<%- s.order %>" name="stage-select-check" stage-order="<%- s.order %>" class="custom-control-input">
  477. <label class="custom-control-label" for="stage-select-<%- s.order %>">第<%- s.order %>期</label>
  478. </div>
  479. </div>
  480. <% } %>
  481. </div>
  482. <div class="alert alert-danger my-2 p-2" id="stage-select-hint">我是提示呀</div>
  483. </div>
  484. <div class="modal-footer">
  485. <div class="form-check form-check-inline mr-auto">
  486. <input class="form-check-input" type="checkbox" id="stage-select-all">
  487. <label class="form-check-label" for="stage-select-all">全选</label>
  488. </div>
  489. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  490. <button class="btn btn-sm btn-primary" id="stage-select-ok">确定</button>
  491. </div>
  492. </div>
  493. </div>
  494. </div>
  495. <div class="modal fade" id="material-sum-select" data-backdrop="static">
  496. <div class="modal-dialog" role="document">
  497. <div class="modal-content">
  498. <div class="modal-header">
  499. <h5 class="modal-title" id="material-sum-select-title">选择期(材料调差)</h5>
  500. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  501. <span aria-hidden="true">&times;</span>
  502. </button>
  503. </div>
  504. <div class="modal-body">
  505. <div class="row">
  506. <% for (const m of materialList) { %>
  507. <div class="col-3">
  508. <div class="custom-control custom-checkbox custom-control-inline">
  509. <input type="checkbox" id="material-sum-select-<%- m.order %>" name="material-sum-select-check" material-order="<%- m.order %>" class="custom-control-input">
  510. <label class="custom-control-label" for="material-sum-select-<%- m.order %>">第<%- m.order %>期</label>
  511. </div>
  512. </div>
  513. <% } %>
  514. </div>
  515. <div class="alert alert-danger my-2 p-2" id="material-sum-select-hint">我是提示呀</div>
  516. </div>
  517. <div class="modal-footer">
  518. <div class="form-check form-check-inline mr-auto">
  519. <input class="form-check-input" type="checkbox" id="material-sum-select-all">
  520. <label class="form-check-label" for="material-sum-select-all">全选</label>
  521. </div>
  522. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  523. <button class="btn btn-sm btn-primary" id="material-sum-select-ok">确定</button>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. <div class="modal" id="change-select" data-backdrop="static">
  529. <div class="modal-dialog modal-lg" role="document">
  530. <div class="modal-content">
  531. <div class="modal-header">
  532. <h5 class="modal-title" id="change-select-title">请选择变更令</h5>
  533. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  534. <span aria-hidden="true">&times;</span>
  535. </button>
  536. </div>
  537. <div class="modal-body">
  538. <div class="row">
  539. <div class="col-6">
  540. <h5>可选变更令 </h5>
  541. <table class="table table-bordered">
  542. <tr class="text-center"><th>选择</th><th>变更令号</th><th>工程名称</th></tr>
  543. <tbody id="change-select-list">
  544. </tbody>
  545. </table>
  546. </div>
  547. <div class="col-6">
  548. <h5>已选变更令 </h5>
  549. <table class="table table-bordered">
  550. <tr class="text-center"><th>序号</th><th>变更令号</th><th>工程名称</th></tr>
  551. <tbody id="change-select-result">
  552. </tbody>
  553. </table>
  554. </div>
  555. </div>
  556. <div class="alert alert-danger my-2 p-2" id="change-select-hint" style="display: none">我是提示呀</div>
  557. </div>
  558. <div class="modal-footer">
  559. <div class="form-check form-check-inline mr-auto">
  560. <input class="form-check-input" type="checkbox" id="change-select-all">
  561. <label class="form-check-label" for="change-select-all">全选</label>
  562. </div>
  563. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  564. <button class="btn btn-sm btn-primary" id="change-select-ok">确定</button>
  565. </div>
  566. </div>
  567. </div>
  568. </div>
  569. <div class="modal" id="select-change-rela" data-backdrop="static">
  570. <div class="modal-dialog" role="document">
  571. <div class="modal-content">
  572. <div class="modal-header">
  573. <h5 class="modal-title" id="scr-title">请选择变更令</h5>
  574. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  575. <span aria-hidden="true">&times;</span>
  576. </button>
  577. </div>
  578. <div class="modal-body" style="overflow-y: auto; height: 480px">
  579. <table class="table table-bordered">
  580. <thead id="scr-header"><tr class="text-center"><th>选择</th><th>变更令号</th><th>工程名称</th></tr></thead>
  581. <tbody id="scr-list">
  582. </tbody>
  583. </table>
  584. </div>
  585. <div class="modal-footer">
  586. <div class="form-check form-check-inline mr-auto">
  587. <input class="form-check-input" type="checkbox" id="scr-all">
  588. <label class="form-check-label" for="scr-all">全选</label>
  589. </div>
  590. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  591. <button class="btn btn-sm btn-primary" id="scr-ok" onclick="rptChangeRela.updateChangeRela();">确定</button>
  592. </div>
  593. </div>
  594. </div>
  595. </div>
  596. <div class="modal" id="select-other-stage" data-backdrop="static">
  597. <div class="modal-dialog" role="document">
  598. <div class="modal-content">
  599. <div class="modal-header">
  600. <h5 class="modal-title" id="sos-title">请选择预付款</h5>
  601. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  602. <span aria-hidden="true">&times;</span>
  603. </button>
  604. </div>
  605. <div class="modal-body" style="overflow-y: auto; height: 480px">
  606. <table class="table table-bordered">
  607. <thead id="sos-header"><tr class="text-center"><th>选择</th><th>变更令号</th><th>工程名称</th></tr></thead>
  608. <tbody id="sos-list">
  609. </tbody>
  610. </table>
  611. </div>
  612. <div class="modal-footer">
  613. <div class="form-check form-check-inline mr-auto">
  614. <input class="form-check-input" type="checkbox" id="sos-all">
  615. <label class="form-check-label" for="sos-all">全选</label>
  616. </div>
  617. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  618. <button class="btn btn-sm btn-primary" id="sos-ok" onclick="rptOtherStage.updateOtherStage();">确定</button>
  619. </div>
  620. </div>
  621. </div>
  622. </div>
  623. <div class="modal" id="select-show-level" data-backdrop="static">
  624. <div class="modal-dialog" role="document">
  625. <div class="modal-content">
  626. <div class="modal-header">
  627. <h5 class="modal-title" id="ssl-title">请选择显示层级</h5>
  628. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  629. <span aria-hidden="true">&times;</span>
  630. </button>
  631. </div>
  632. <div class="modal-body">
  633. <div class="form-group" id="ssl-list">
  634. </div>
  635. </div>
  636. <div class="modal-footer">
  637. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  638. <button class="btn btn-sm btn-primary" id="sos-ok" onclick="rptShowLevel.update();">确定</button>
  639. </div>
  640. </div>
  641. </div>
  642. </div>
  643. <!--管理推荐报表-->
  644. <div class="modal fade" id="man-c" data-backdrop="static">
  645. <div class="modal-dialog" role="document">
  646. <div class="modal-content">
  647. <div class="modal-header">
  648. <h5 class="modal-title">管理推荐报表</h5>
  649. </div>
  650. <div class="modal-body">
  651. <div class="modal-height-500" style="overflow: auto;">
  652. <table class="table table-sm table-bordered" id="report_cust_group_common">
  653. </table>
  654. </div>
  655. </div>
  656. <div class="modal-footer">
  657. <button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="revertCommonCustRptCfg();">关闭</button>
  658. <!--有结果出现添加-->
  659. <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="updateCustRptCfg()">确认</button>
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. <!--管理定制报表-->
  665. <div class="modal fade" id="man-i" data-backdrop="static">
  666. <div class="modal-dialog" role="document">
  667. <div class="modal-content">
  668. <div class="modal-header">
  669. <h5 class="modal-title">管理定制报表</h5>
  670. </div>
  671. <div class="modal-body">
  672. <div class="modal-height-500" style="overflow: auto;">
  673. <table class="table table-sm table-bordered" id="report_cust_group_individual">
  674. </table>
  675. </div>
  676. </div>
  677. <div class="modal-footer">
  678. <button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="revertIndividualCustRptCfg();">关闭</button>
  679. <!--有结果出现添加-->
  680. <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="updateCustRptCfg()">确认</button>
  681. </div>
  682. </div>
  683. </div>
  684. </div>
  685. <!--弹出归档-->
  686. <div class="modal fade" id="guidang" data-backdrop="static">
  687. <div class="modal-dialog" role="document">
  688. <div class="modal-content">
  689. <div class="modal-header">
  690. <h5 class="modal-title">归档本张报表</h5>
  691. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  692. <span aria-hidden="true">&times;</span>
  693. </button>
  694. </div>
  695. <div class="modal-body">
  696. <h6>归档后,本期报表将自动导出PDF格式,不再受新一期数据影响;</h6>
  697. <h6>请确认报表数据无误(正确添加签字、设置页面格式等),继续归档操作。</h6>
  698. <div class="card">
  699. <div class="card-body" id="cardArchiveInfo">
  700. </div>
  701. </div>
  702. </div>
  703. <div class="modal-footer">
  704. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  705. <a href="javascript: void(0);" class="btn btn-sm btn-primary" data-dismiss="modal" onclick="rptArchiveObj.archiveCurrentReport(zTreeOprObj.currentRptPageRst, zTreeOprObj.currentNode)">确定归档</a>
  706. </div>
  707. </div>
  708. </div>
  709. </div>
  710. <!--全屏显示报表-->
  711. <div class="modal fade" id="fullscreen" data-backdrop="static">
  712. <div class="modal-dialog modal-full" role="document">
  713. <div class="modal-content">
  714. <div class="modal-header d-flex justify-content-between">
  715. <h5 class="modal-title" id="fullScrTitle"></h5>
  716. <div class="print-toolsbar">
  717. <!--
  718. <div class="panel">
  719. <div class="panel-body">
  720. <div class="btn-group" role="group">
  721. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="缩小">-</button>
  722. <button class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="重置默认大小">1000%</button>
  723. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="放大">+</button>
  724. </div>
  725. </div>
  726. </div>
  727. -->
  728. <div class="panel">
  729. <div class="panel-body">
  730. <div class="input-group input-group-sm">
  731. <div class="btn-group" role="group">
  732. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="缩小" onclick="canvasOprObj.fullScreenChangeScale(-0.1, this)">-</button>
  733. <button id="fullScreenScaleBtn" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="重置默认大小" onclick="canvasOprObj.fullScreenChangeScale(0, this)">100%</button>
  734. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="放大" onclick="canvasOprObj.fullScreenChangeScale(0.1, this)">+</button>
  735. </div>
  736. <div class="input-group-prepend">
  737. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="首页" onclick="rptControlObj.firstPage(this)"><i class="fa fa-angle-double-left "></i></button>
  738. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上一页" onclick="rptControlObj.prePage(this)"><i class="fa fa-angle-left "></i></button>
  739. </div>
  740. <input id="rpt_fullscreen_page_num" class="form-control" value="1/10" style="width:60px" onKeydown="rptControlObj.onKeydown(event, this)" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="输入页码按回车键,快速跳转">
  741. <div class="input-group-append">
  742. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="下一页" onclick="rptControlObj.nextPage(this)"><i class="fa fa-angle-right"></i></button>
  743. <button type="button" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="尾页" onclick="rptControlObj.lastPage(this)"><i class="fa fa-angle-double-right"></i></button>
  744. </div>
  745. </div>
  746. </div>
  747. </div>
  748. <div class="panel">
  749. <div class="panel-body">
  750. <button type="button" class="btn btn-outline-primary btn-sm" data-dismiss="modal" ><i class="fa fa-window-close-o"></i> 退出全屏</button>
  751. </div>
  752. </div>
  753. </div>
  754. </div>
  755. <div class="modal-body">
  756. <div class="modal-fullscreen pageContainer">
  757. <canvas id="fullScrCanvas" height="100%" width="100%"></canvas>
  758. </div>
  759. </div>
  760. </div>
  761. </div>
  762. </div>
  763. <% if (![-100, -200, -300, -301, -302, -303].includes(stg_id)) { %>
  764. <% include ../stage/audit_modal.ejs %>
  765. <% } %>
  766. <script>
  767. zTreeOprObj.getCustomerCfg();
  768. zTreeOprObj.iniFontCfgDom(CUST_CFG);
  769. <% if (![-100, -300, -301, -302, -303].includes(stg_id)) { %>
  770. buildCustRptCommon('report_cust_group_common', ORG_TOP_TREE_NODES[1], CUST_TREE_NODES.common, 'true');
  771. buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
  772. <% } %>
  773. let SELECTED_TENDERS = [];
  774. function buildTendersTree() {
  775. let sortedCat = [];
  776. SELECTED_TENDERS = [];
  777. for (const cat of category) {
  778. if (cat.level > 0) {
  779. sortedCat.push(cat);
  780. }
  781. }
  782. for (const tender of tenders) {
  783. if (tender.lastStage !== undefined && tender.lastStage !== null && tender.category && tender.category.length === sortedCat.length) {
  784. for (let cat of tender.category) {
  785. for (let cIdx = 0; cIdx < sortedCat.length; cIdx++) {
  786. if (cat.cid === sortedCat[cIdx].id) {
  787. cat.level = sortedCat[cIdx].level;
  788. break;
  789. }
  790. }
  791. }
  792. tender.category.sort(function(i1, i2){
  793. return i1.level - i2.level;
  794. });
  795. }
  796. }
  797. let treeCache = [];
  798. //1. 选择用户已设置的分类
  799. if (sortedCat.length > 0) {
  800. sortedCat.sort(function(i1, i2){
  801. return i1.level - i2.level;
  802. });
  803. const _createItems = function (parentItems, grpLv) {
  804. if (grpLv < sortedCat.length) {
  805. let cat = sortedCat[grpLv];
  806. for (const nv of cat.value) {
  807. let item = {
  808. name: nv.value,
  809. id : nv.id,
  810. cid : nv.cid,
  811. items: [],
  812. isParent: true
  813. };
  814. parentItems.push(item);
  815. _createItems(item.items, grpLv + 1);
  816. }
  817. }
  818. }
  819. _createItems(treeCache, 0);
  820. }
  821. //2. 建立treeNodes
  822. let hasCat = false;
  823. for (const tender of tenders) {
  824. if (tender.category && tender.category.length > 0) {
  825. hasCat = true;
  826. break;
  827. }
  828. }
  829. //3. 把标段挂上去
  830. let tmpCacheArr = []; //这个临时用来储存相应标段节点挂接信息
  831. let _createTenderItem = function (tender) {
  832. let rst = {
  833. name: tender.name,
  834. id : -1,
  835. cid : -1,
  836. tender_id: tender.id,
  837. last_stage: tender.lastStage.order,
  838. last_stage_id: tender.lastStage.id,
  839. report_id: zTreeOprObj.currentNode.refId,
  840. signature: '',
  841. items: [],
  842. isParent: false
  843. }
  844. return rst;
  845. }
  846. let _putTender = function (catLv, tender, parentItems) {
  847. if (tender.lastStage !== undefined && tender.lastStage !== null) {
  848. if (hasCat) {
  849. let isSorted = false;
  850. for (let sCat of sortedCat) {
  851. if (sCat.level <= tender.category.length && sCat.level > 0 && sCat.id === tender.category[catLv].cid) {
  852. isSorted = true;
  853. break;
  854. }
  855. }
  856. if (isSorted) {
  857. for (const item of parentItems) {
  858. if (item.cid === tender.category[catLv].cid && item.id === tender.category[catLv].value) {
  859. if (item.items.length > 0 && tender.category.length > (catLv + 1)) {
  860. //递归循环
  861. _putTender(catLv + 1, tender, item.items);
  862. } else {
  863. //就是这个了
  864. let tdItem = _createTenderItem(tender); //标段节点
  865. tmpCacheArr.push([item, tdItem]);
  866. }
  867. }
  868. }
  869. } else {
  870. //超界了
  871. //let tdItem = _createTenderItem(tender); //标段节点
  872. //tmpCacheArr.push([item, tdItem]);
  873. }
  874. } else {
  875. // 没有设置category
  876. let tdItem = _createTenderItem(tender); //标段节点
  877. tmpCacheArr.push([null, tdItem]);
  878. }
  879. }
  880. }
  881. for (const tender of tenders) {
  882. //console.log('tender.name: ' + tender.name);
  883. _putTender(0, tender, treeCache);
  884. }
  885. if (hasCat) {
  886. for (const pairItem of tmpCacheArr) {
  887. pairItem[0].items.push(pairItem[1]);
  888. }
  889. }
  890. //4. 剔除空items的项
  891. if (hasCat) {
  892. let _removeEmptyItems = function (parentItem) {
  893. let rst = false;
  894. if (parentItem.items.length === 0) {
  895. if (parentItem.isParent) {
  896. rst = true;
  897. }
  898. } else {
  899. for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
  900. if (_removeEmptyItems(parentItem.items[idx])) {
  901. parentItem.items.splice(idx, 1);
  902. }
  903. }
  904. rst = parentItem.items.length === 0;
  905. }
  906. return rst;
  907. }
  908. for (let idx = treeCache.length - 1; idx >= 0; idx--) {
  909. if (hasCat) {
  910. if (_removeEmptyItems(treeCache[idx])) {
  911. treeCache.splice(idx, 1);
  912. }
  913. }
  914. }
  915. }
  916. //console.log(treeCache);
  917. //还要请求各标段的原签名数据
  918. let params = {};
  919. params.selectedTenders = [];
  920. let _getTenderRelatedInfos = function(parentItem, rstArr) {
  921. if (parentItem.items.length === 0) {
  922. if (!parentItem.isParent) {
  923. rstArr.push([parentItem.tender_id, parentItem.last_stage_id, parentItem.report_id]);
  924. }
  925. } else {
  926. for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
  927. _getTenderRelatedInfos(parentItem.items[idx], rstArr);
  928. }
  929. }
  930. };
  931. let _addHint = function(parentItem, relArr) {
  932. if (parentItem.items.length === 0) {
  933. if (!parentItem.isParent) {
  934. for (const rel of relArr) {
  935. if (rel.tender_id === parentItem.tender_id && rel.sid === parentItem.last_stage_id && rel.rpt_id === parentItem.report_id) {
  936. let hintStr = '';
  937. if (rel.rel_content instanceof Array) {
  938. for (let idx = 0; idx < rel.rel_content.length; idx++) {
  939. const dtlRel = rel.rel_content[idx];
  940. if (idx > 0) {
  941. hintStr = hintStr + '、';
  942. }
  943. hintStr = hintStr + '(' + dtlRel.signature_name + ')' + dtlRel.user_name;
  944. }
  945. }
  946. parentItem.signature = hintStr;
  947. break;
  948. }
  949. }
  950. }
  951. } else {
  952. for (let idx = parentItem.items.length - 1; idx >= 0; idx--) {
  953. _addHint(parentItem.items[idx], relArr);
  954. }
  955. }
  956. };
  957. if (hasCat) {
  958. for (let idx = treeCache.length - 1; idx >= 0; idx--) {
  959. _getTenderRelatedInfos(treeCache[idx], params.selectedTenders);
  960. }
  961. } else {
  962. for (let idx = tmpCacheArr.length - 1; idx >= 0; idx--) {
  963. _getTenderRelatedInfos(tmpCacheArr[idx][1], params.selectedTenders);
  964. treeCache.push(tmpCacheArr[idx][1]);
  965. }
  966. }
  967. $.bootstrapLoading.start();
  968. CommonAjax.postXsrfEx("/tender/report_api/getMultiRoleRelationships", params, 30000, true, getCookie('csrfToken_j'),
  969. function(result){
  970. $.bootstrapLoading.end();
  971. let relArr = result.data;
  972. for (const rel of relArr) {
  973. rel.rel_content = JSON.parse(rel.rel_content);
  974. }
  975. console.log(relArr);
  976. //5. 加hint
  977. for (let idx = treeCache.length - 1; idx >= 0; idx--) {
  978. _addHint(treeCache[idx], relArr);
  979. }
  980. //6. 建树
  981. _buildTenderTree('batch_tenders_individual', treeCache);
  982. }, function(err){
  983. $.bootstrapLoading.end();
  984. }, function(ex){
  985. $.bootstrapLoading.end();
  986. }
  987. );
  988. }
  989. let SELECTED_CHANGES = [];
  990. function buildChangeTree() {
  991. let tbDom = $("#batch_tenders_individual");
  992. tbDom.empty();
  993. let domStrs = [];
  994. SELECTED_CHANGES = [];
  995. domStrs.push('<thead><tr><th width="30%">变更令编号</th><th>变更令名称</th><th width="10%">选择</th></tr></thead>');
  996. domStrs.push('<tbody>');
  997. const report_id = zTreeOprObj.currentNode.refId;
  998. for (const dtlChange of ALL_CHANGES) {
  999. if (dtlChange.cid !== BUSINESS_ID && dtlChange.status === 3) {
  1000. domStrs.push(`<tr><td>${dtlChange.code}</td><td>${dtlChange.name}</td><td><input type="checkbox" onclick="amendChange(this, SELECTED_CHANGES, TENDER_ID, '${dtlChange.cid}', ${report_id})"></td></tr>`);
  1001. }
  1002. }
  1003. domStrs.push('</tbody>');
  1004. tbDom.append(domStrs.join(''));
  1005. $('[data-toggle="tooltip"]').tooltip();
  1006. }
  1007. let SELECTED_OTHER = [];
  1008. function buildOtherTree(source, keyField = 'id') {
  1009. let tbDom = $("#batch_tenders_individual");
  1010. tbDom.empty();
  1011. let domStrs = [];
  1012. SELECTED_OTHER = [];
  1013. domStrs.push('<thead><tr class="text-center"><th width="30%"><%- otherHintName %>编号</th><th><%- otherHintName %>名称</th><th width="10%">选择</th></tr></thead>');
  1014. domStrs.push('<tbody>');
  1015. const report_id = zTreeOprObj.currentNode.refId;
  1016. for (const s of source) {
  1017. if (s[keyField] !== BUSINESS_ID && s.status === 3) {
  1018. domStrs.push(`<tr><td>${s.code}</td><td>${s.name}</td><td><input type="checkbox" onclick="amendOther(this, SELECTED_OTHER, TENDER_ID, '${s[keyField]}', ${report_id})"></td></tr>`);
  1019. }
  1020. }
  1021. domStrs.push('</tbody>');
  1022. tbDom.append(domStrs.join(''));
  1023. $('[data-toggle="tooltip"]').tooltip();
  1024. }
  1025. function searchAccount() {
  1026. if (event.keyCode == 13) {
  1027. rptSignatureHelper.buildSelectableAccount(this);
  1028. }
  1029. }
  1030. function _buildTenderTree(tbDomId, tendersArr) {
  1031. let tbDom = $("#" + tbDomId);
  1032. tbDom.empty();
  1033. let domStrs = [];
  1034. domStrs.push('<thead><tr><th>名称</th><th width="50">计量期</th><th width="40">签名</th><th width="40">选择</th></tr></thead>');
  1035. domStrs.push('<tbody>');
  1036. const _createRow = function (rowItem, lv) {
  1037. let tdClassStr = 'in-' + lv;
  1038. if (rowItem.isParent) {
  1039. //tbDom.append('<tr><td class="' + tdClassStr + '"><i class="fa fa-folder-o"></i>&nbsp;&nbsp;' + rowItem.name + '</td><td></td><td></td><td></td></tr>');
  1040. domStrs.push('<tr><td class="' + tdClassStr + '"><i class="fa fa-folder-o"></i>&nbsp;&nbsp;' + rowItem.name + '</td><td></td><td></td><td></td></tr>');
  1041. } else {
  1042. let hrefStr = '/tender/' + rowItem.tender_id;
  1043. //<a href="biaoduan-panel.html" target="_blank">WWUJ-1</a>
  1044. let lastStgStr = '';
  1045. if (rowItem.last_stage === -1) {
  1046. lastStgStr = '台账';
  1047. } else {
  1048. lastStgStr = '第' + rowItem.last_stage + '期';
  1049. }
  1050. if (rowItem.signature !== undefined && rowItem.signature !== null && rowItem.signature !== '') {
  1051. let hintStr = '<i class="fa fa-exclamation-circle text-primary" data-container="body" data-toggle="tooltip" data-placement="bottom" data-original-title="' + rowItem.signature + '"></i>';
  1052. domStrs.push('<tr><td class="' + tdClassStr + '"><a href="' + hrefStr + '" target="_blank">' + rowItem.name + '</a></td><td>' + lastStgStr + '</td><td>' + hintStr + '</td><td><input type="checkbox" onclick="changeCrossTender(this, SELECTED_TENDERS, ' + rowItem.tender_id + ', ' + rowItem.last_stage_id + ', ' + rowItem.report_id + ')' + '"></td></tr>');
  1053. } else {
  1054. domStrs.push('<tr><td class="' + tdClassStr + '"><a href="' + hrefStr + '" target="_blank">' + rowItem.name + '</a></td><td>' + lastStgStr + '</td><td></td><td><input type="checkbox" onclick="changeCrossTender(this, SELECTED_TENDERS, ' + rowItem.tender_id + ', ' + rowItem.last_stage_id + ', ' + rowItem.report_id + ')' + '"></td></tr>');
  1055. }
  1056. }
  1057. if (rowItem.items && rowItem.items.length > 0) {
  1058. for (const subItem of rowItem.items) {
  1059. _createRow(subItem, lv + 1);
  1060. }
  1061. }
  1062. }
  1063. let grpLv = 1;
  1064. for (const tItem of tendersArr) {
  1065. _createRow(tItem, grpLv);
  1066. }
  1067. domStrs.push('</tbody>');
  1068. tbDom.append(domStrs.join(''));
  1069. $('[data-toggle="tooltip"]').tooltip();
  1070. }
  1071. function buildCustRptCommon(tbDomId, topTreeNode, checkingArr, isCommonStr) {
  1072. const filterNames = ['01.支付审批报表'];
  1073. let tbDom = $("#" + tbDomId);
  1074. tbDom.empty();
  1075. tbDom.append('<tr><th>类别</th><th>包含报表</th><th>显示</th></tr>');
  1076. let _countAvailableTpls = function (tItem) {
  1077. let rst = 0;
  1078. if (tItem.nodeType === 1 && tItem.items && tItem.items.length > 0) {
  1079. for (const dItem of tItem.items) {
  1080. if (dItem.nodeType === 2) {
  1081. if (dItem.released) rst++;
  1082. } else {
  1083. rst += _countAvailableTpls(dItem);
  1084. }
  1085. }
  1086. }
  1087. return rst;
  1088. };
  1089. let _pushRptLine = function (parentItem, rptItem, level, needChk, parentNodeIdStr, thisItemSeq, pHiddenVal) {
  1090. if (rptItem.nodeType === 1) {
  1091. let amt = _countAvailableTpls(rptItem);
  1092. if (amt > 0) {
  1093. let padding_leftStr = '';
  1094. // classStr = '',
  1095. if (level > 0) {
  1096. // classStr = 'pl-' + (level + 3);
  1097. let rem = 1.5 * level;
  1098. padding_leftStr = 'padding-left: ' + rem + 'rem!important'; //不受层数限制
  1099. }
  1100. if (needChk) {
  1101. let chkName = pHiddenVal + parentItem.name + FOLDER_SEPERATER + rptItem.name;
  1102. let checkedStr = (checkingArr.indexOf(chkName) >= 0) ? ' checked' : '';
  1103. let sIdStr = parentNodeIdStr + '_sub_' + thisItemSeq;
  1104. // tbDom.append('<tr><td class="' + classStr + '">' + rptItem.name + '</td><td>' + amt + '</td><td><input id="' + sIdStr + '" onchange="changeFolder(this, ' + isCommonStr + ', \'' + parentNodeIdStr + '\' )" hiddenval="' + chkName + '" type="checkbox"' + checkedStr + '></td></tr>');
  1105. tbDom.append('<tr><td style="' + padding_leftStr + '">' + rptItem.name + '</td><td>' + amt + '</td><td><input id="' + sIdStr + '" onchange="changeFolder(this, ' + isCommonStr + ', \'' + parentNodeIdStr + '\' )" hiddenval="' + chkName + '" type="checkbox"' + checkedStr + '></td></tr>');
  1106. } else {
  1107. // tbDom.append('<tr><td class="' + classStr + '">' + rptItem.name + '</td><td>' + amt + '</td><td></td></tr>');
  1108. tbDom.append('<tr><td style="' + padding_leftStr + '">' + rptItem.name + '</td><td>' + amt + '</td><td></td></tr>');
  1109. }
  1110. if (rptItem.items && rptItem.items.length > 0) {
  1111. let subDtlSeq = 0;
  1112. for (const subItem of rptItem.items) {
  1113. _pushRptLine(rptItem, subItem, level + 1, true, '', subDtlSeq, parentItem.name + FOLDER_SEPERATER);
  1114. subDtlSeq++;
  1115. }
  1116. }
  1117. }
  1118. }
  1119. }
  1120. let TplAmts = [];
  1121. let parentIdx = 0;
  1122. let subCnt = topTreeNode.items.length;
  1123. for (const topItem of topTreeNode.items) {
  1124. if (!filterNames.includes(topItem.name)) {
  1125. const avRpts = _countAvailableTpls(topItem);
  1126. if (avRpts > 0) {
  1127. TplAmts.push(avRpts);
  1128. let checkedStr = (checkingArr.indexOf(topItem.name) >= 0) ? ' checked' : '';
  1129. let pIdStr = tbDomId + '_' + parentIdx + '_' + subCnt;
  1130. tbDom.append('<tr><td>' + topItem.name + '</td><td>' + TplAmts[TplAmts.length - 1] + '</td><td><input id="' + pIdStr + '" onchange="changeFolder(this, ' + isCommonStr + ', null)" hiddenval="' + topItem.name + '" type="checkbox"' + checkedStr + '></td></tr>');
  1131. if (topItem.items && topItem.items.length > 0) {
  1132. let subSeq = 0;
  1133. for (const subItem of topItem.items) {
  1134. _pushRptLine(topItem, subItem, 1, true, pIdStr, subSeq, '');
  1135. }
  1136. subSeq++;
  1137. }
  1138. parentIdx++;
  1139. }
  1140. }
  1141. }
  1142. }
  1143. function updateCustRptCfg(){
  1144. let params = {};
  1145. params.nodeItems = CUST_TREE_NODES;
  1146. params.custSelectKeys = CUST_SELECT_KEYS;
  1147. CommonAjax.postXsrfEx("/tender/report_api/updateCustNode", params, 60000, true, getCookie('csrfToken_j'),
  1148. function(result){
  1149. try {
  1150. // console.log(result);
  1151. ORG_CUST_TREE_NODES.common = JSON.parse(JSON.stringify(CUST_TREE_NODES.common));
  1152. ORG_CUST_TREE_NODES.customize = JSON.parse(JSON.stringify(CUST_TREE_NODES.customize));
  1153. //刷新报表模板树
  1154. TOP_TREE_NODES = JSON.parse(JSON.stringify(ORG_TOP_TREE_NODES));
  1155. // 移除未被选择的模板
  1156. filterUnchkTplTreeNode(TOP_TREE_NODES[0], CUST_TREE_NODES.customize);
  1157. filterUnchkTplTreeNode(TOP_TREE_NODES[1], CUST_TREE_NODES.common);
  1158. zTreeOprObj.getReportTemplateTree();
  1159. } catch(err) {
  1160. }
  1161. }, function(err){
  1162. // hintBox.unWaitBox();
  1163. }, function(ex){
  1164. // hintBox.unWaitBox();
  1165. }
  1166. );
  1167. }
  1168. function revertCommonCustRptCfg(){
  1169. CUST_TREE_NODES.common = JSON.parse(JSON.stringify(ORG_CUST_TREE_NODES.common));
  1170. buildCustRptCommon('report_cust_group_common', ORG_TOP_TREE_NODES[1], CUST_TREE_NODES.common, 'true');
  1171. }
  1172. function revertIndividualCustRptCfg(){
  1173. CUST_TREE_NODES.customize = JSON.parse(JSON.stringify(ORG_CUST_TREE_NODES.customize));
  1174. buildCustRptCommon('report_cust_group_individual', ORG_TOP_TREE_NODES[0], CUST_TREE_NODES.customize, 'false');
  1175. }
  1176. function amendChange(dom, rstArr, tenderId, changeCid, reportId) {
  1177. if (dom.checked) {
  1178. let item = [tenderId, '-300', changeCid, reportId];
  1179. rstArr.push(item);
  1180. } else {
  1181. for (let idx = rstArr.length - 1; idx >= 0; idx--) {
  1182. if (rstArr[idx][2] === changeCid) {
  1183. rstArr.splice(idx, 1); // 删除变更令选择(这里变更令cid一定是唯一的)
  1184. //这里不break,防止一些冗余数据
  1185. }
  1186. }
  1187. }
  1188. }
  1189. function amendOther(dom, rstArr, tenderId, changeCid, reportId) {
  1190. if (dom.checked) {
  1191. let item = [tenderId, STAGE_ID, changeCid, reportId];
  1192. rstArr.push(item);
  1193. } else {
  1194. for (let idx = rstArr.length - 1; idx >= 0; idx--) {
  1195. if (rstArr[idx][2] === changeCid) {
  1196. rstArr.splice(idx, 1); // 删除变更令选择(这里变更令cid一定是唯一的)
  1197. //这里不break,防止一些冗余数据
  1198. }
  1199. }
  1200. }
  1201. }
  1202. function changeCrossTender(dom, rstArr, tenderId, stageId, reportId) {
  1203. if (dom.checked) {
  1204. let item = [tenderId, stageId, reportId];
  1205. rstArr.push(item);
  1206. } else {
  1207. for (let idx = rstArr.length - 1; idx >= 0; idx--) {
  1208. if (rstArr[idx][0] === tenderId && rstArr[idx][1] === stageId && rstArr[idx][2] === reportId) {
  1209. rstArr.splice(idx, 1); //删除当前标段
  1210. //这里不break,防止一些冗余数据
  1211. }
  1212. }
  1213. }
  1214. }
  1215. function changeFolder(dom, isCommon, parentIdStr) {
  1216. let prop = null;
  1217. if (isCommon) {
  1218. prop = CUST_TREE_NODES.common;
  1219. } else {
  1220. prop = CUST_TREE_NODES.customize;
  1221. }
  1222. let idx = prop.indexOf(dom.attributes['hiddenval'].value);
  1223. if (dom.checked) {
  1224. if (idx < 0) {
  1225. prop.push(dom.attributes['hiddenval'].value);
  1226. if (parentIdStr === null) {
  1227. //这是父节点,需要把所有子节点都勾上
  1228. //后期补上
  1229. }
  1230. }
  1231. } else {
  1232. if (idx >= 0) {
  1233. prop.splice(idx, 1);
  1234. if (parentIdStr === null) {
  1235. //这是父节点,需要把所有子节点都uncheck
  1236. //后期补上
  1237. }
  1238. }
  1239. }
  1240. }
  1241. </script>