information.ejs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <% include ../tender/tender_sub_menu.ejs %>
  2. <div class="panel-content">
  3. <div class="panel-title"><!--收起详解目录添加类名 fluid -->
  4. <div class="title-main d-flex"><!--工具-->
  5. <% include ../tender/tender_sub_mini_menu.ejs %>
  6. <div>
  7. <% if(auditStatus === auditConst.status.uncheck || auditStatus === auditConst.status.back) { %>
  8. <div class="d-inline-block">
  9. <a class="btn btn-sm btn-primary" href="#add-bj" data-toggle="modal" data-target="#add-bj">拷贝其他变更令数据</a>
  10. </div>
  11. <% } %>
  12. <% if (auditStatus === 1 || auditStatus === 2) { %>
  13. <div class="d-inline-block">
  14. <a href="#addlist" data-toggle="modal" class="btn btn-sm btn-light text-primary" id="open-list-modal" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="添加清单"><i class="fa fa-plus" aria-hidden="true"></i> 添加台账清单</a>
  15. </div>
  16. <div class="d-inline-block mr-3">
  17. <a href="javascript:void(0);" class="btn btn-sm btn-light text-primary" id="add-white-btn" data-original-title="添加清单"><i class="fa fa-plus" aria-hidden="true"></i> 添加空白清单</a>
  18. </div>
  19. <% } %>
  20. <div class="d-inline-block">
  21. <div class="custom-control custom-checkbox" style="line-height: normal;">
  22. <input type="checkbox" class="custom-control-input change-detail-checkbox" id="customCheck1">
  23. <label class="custom-control-label" for="customCheck1">变更详情</label>
  24. </div>
  25. </div>
  26. <% if (auditStatus === 3 || auditStatus === 4 || auditStatus === 5 || auditStatus === 7) { %>
  27. <div class="d-inline-block ml-3">
  28. <div class="custom-control custom-checkbox" style="line-height: normal;">
  29. <input type="checkbox" class="custom-control-input" id="show-table-detail">
  30. <label class="custom-control-label" for="show-table-detail">审批过程</label>
  31. </div>
  32. </div>
  33. <% } %>
  34. </div>
  35. <div class="ml-auto">
  36. <!--info状态区分-->
  37. <% if (auditStatus === 1) { %>
  38. <a href="#sub-ap" data-category="up_change" data-toggle="modal" data-target="#sub-ap" class="btn btn-primary btn-sm">上报审批</a>
  39. <% } else if (auditStatus === 2) { %>
  40. <a href="#sub-sp2" data-category="up_change" data-toggle="modal" data-target="#sub-sp2" class="btn btn-primary btn-sm">重新上报</a>
  41. <% } else if (auditStatus === 3) { %>
  42. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-warning btn-sm text-muted">审批退回</a>
  43. <% } else if (auditStatus === 4) { %>
  44. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-success btn-sm">审批完成</a>
  45. <% } else if (auditStatus === 5) { %>
  46. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-danger btn-sm">审批终止</a>
  47. <% } else if (auditStatus === 6) { %>
  48. <a href="#sp-done" data-toggle="modal" data-target="#sp-done" class="btn btn-success btn-sm">审批通过</a>
  49. <a href="#sp-back" data-toggle="modal" data-target="#sp-back" class="btn btn-warning btn-sm">审批退回</a>
  50. <% } else if (auditStatus === 7) { %>
  51. <a href="#sp-list" data-toggle="modal" data-target="#sp-list" class="btn btn-outline-secondary btn-sm">审批中</a>
  52. <% } %>
  53. <% if (auditStatus === 4 && ctx.session.sessionUser.accountId === auditList[auditList.length-1].uid) { %>
  54. <% if (stageChangeNum === 0) { %>
  55. <!--重新审批-->
  56. <a href="javascript: void(0);" data-toggle="modal" data-target="#sp-down-back" class="btn btn-warning btn-sm">重新审批</a>
  57. <% } else { %>
  58. <button class="btn btn-outline-secondary btn-sm" data-toggle="tooltip" data-placement="bottom" title="已被调用">重新审批</button>
  59. <% } %>
  60. <% } %>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="content-wrap">
  65. <div class="c-header p-0"></div>
  66. <div class="w-100 sub-content row">
  67. <div class="c-body col-4">
  68. <div class="sjs-bar-1">
  69. <ul class="nav nav-tabs">
  70. <li class="nav-item">
  71. <a class="nav-link active" data-toggle="tab" href="#bgxinxi" role="tab">变更信息</a>
  72. </li>
  73. <li class="nav-item">
  74. <a class="nav-link" data-toggle="tab" href="#bgfujian" role="tab">附件</a>
  75. </li>
  76. <li class="nav-item ml-auto pt-1" style="display:none;">
  77. <!--所有附件 翻页-->
  78. <a href="javascript: void(0);" data-toggle="modal" class="btn btn-sm btn-primary" id="bach-download"><i class="fa fa-download "></i> 批量下载</a>
  79. <a href="#" class=" ml-3"><i class="fa fa-chevron-left"></i></a> 1/10 <a href="#" class="mr-3"><i class="fa fa-chevron-right"></i></a>
  80. <a href="#addfujian" data-toggle="modal" class="btn btn-sm btn-light text-primary" data-placement="bottom" title="" data-original-title="上传附件"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 上传附件</a>
  81. </li>
  82. </ul>
  83. </div>
  84. <div class="tab-content">
  85. <div class="tab-pane active" id="bgxinxi">
  86. <div class="sjs-sh-1" style="overflow-y: auto;">
  87. <% if (auditStatus === 1 || auditStatus === 2) { %>
  88. <form class="p-2" action="/tender/<%- change.tid %>/change/save?_csrf=<%= ctx.csrf %>" method="post" id="change_form">
  89. <div class="form-group">
  90. <label><b class="text-danger">*&nbsp;</b>申请编号</label>
  91. <a href="javascript:void(0);" class="pull-right reduction-code" data-toggle="tooltip" data-placement="bottom" title="" data-code="<%- change.code %>" data-original-title="重置"><i class="fa fa-repeat"></i></a>
  92. <input class="form-control form-control-sm" name="code" value="<%- change.code %>" type="text">
  93. </div>
  94. <div class="form-group">
  95. <label><b class="text-danger">*&nbsp;</b>工程名称</label>
  96. <input class="form-control form-control-sm" name="name" value="<%- change.name %>" type="text">
  97. </div>
  98. <div class="form-group">
  99. <label>桩号</label>
  100. <input class="form-control form-control-sm" name="peg" value="<%- change.peg %>" type="text">
  101. </div>
  102. <div class="form-group">
  103. <label>原设计图名称</label>
  104. <input class="form-control form-control-sm" name="org_name" placeholder="" type="text" value="<%- change.org_name %>">
  105. </div>
  106. <div class="form-group">
  107. <label>原图号</label>
  108. <input class="form-control form-control-sm" name="org_code" placeholder="" type="text" value="<%- change.org_code %>">
  109. </div>
  110. <div class="form-group">
  111. <label>变更设计图名称</label>
  112. <input class="form-control form-control-sm" name="new_name" placeholder="" type="text" value="<%- change.new_name %>">
  113. </div>
  114. <div class="form-group">
  115. <label>变更图号</label>
  116. <input class="form-control form-control-sm" name="new_code" placeholder="" type="text" value="<%- change.new_code %>">
  117. </div>
  118. <div class="form-group">
  119. <label><b class="text-danger">*&nbsp;</b>工程变更理由及内容</label>
  120. <textarea class="form-control form-control-sm" name="content" rows="6"><%- change.content %></textarea>
  121. </div>
  122. <div class="form-group">
  123. <label>工程变更合同依据</label>
  124. <textarea class="form-control form-control-sm" name="basis" rows="6"><%- change.basis %></textarea>
  125. </div>
  126. <div class="form-group">
  127. <label>变更工程量数量计算式</label>
  128. <textarea class="form-control form-control-sm" name="expr" rows="2"><%- change.expr %></textarea>
  129. </div>
  130. <div class="form-group">
  131. <label>备注</label>
  132. <textarea class="form-control form-control-sm" name="memo" rows="3"><%- change.memo %></textarea>
  133. </div>
  134. <div class="form-group">
  135. <label>变更类型</label>
  136. <div class="checkbox">
  137. <% const changeType = change.type !== null && change.type !== '' ? change.type.split(',') : '' %>
  138. <% for (const t in changeConst.type) { %>
  139. <% const cType = changeConst.type[t] %>
  140. <label class="checkbox-inline">
  141. <input value="<%- cType.value %>" name="type[]"
  142. type="checkbox"<% if (changeType.indexOf(cType.value.toString()) !== -1) { %> checked<% } %>><%- cType.name %>
  143. </label>
  144. <% } %>
  145. </div>
  146. </div>
  147. <div class="form-group">
  148. <label>变更类别 </label>
  149. <select class="form-control form-control-sm" name="class">
  150. <% for (const c in changeConst.class) { %>
  151. <% const cClass = changeConst.class[c] %>
  152. <option value="<%- cClass.value %>"<% if (cClass.value === change.class) { %> selected<% } %>><%- cClass.name %></option>
  153. <% } %>
  154. </select>
  155. </div>
  156. <div class="form-group">
  157. <label>变更性质 </label>
  158. <select class="form-control form-control-sm" name="quality">
  159. <% for (const q in changeConst.quality) { %>
  160. <% const cQuality = changeConst.quality[q] %>
  161. <option value="<%- cQuality.value %>"<% if (cQuality.value === change.quality) { %> selected<% } %>><%- cQuality.name %></option>
  162. <% } %>
  163. </select>
  164. </div>
  165. <div class="form-group">
  166. <label>变更提出单位</label>
  167. <a href="#editcompany" style="float:right;" class="" data-toggle="modal">编辑</a>
  168. <select class="form-control form-control-sm" id="company" name="company">
  169. <% for (const company of companyList) { %>
  170. <option <% if (company.name === change.company) { %>selected<% } %>><%- company.name %></option>
  171. <% } %>
  172. </select>
  173. </div>
  174. <div class="form-group">
  175. <label>费用承担方</label>
  176. <div class="radio">
  177. <% for (const c in changeConst.charge) { %>
  178. <% const cCharge = changeConst.charge[c] %>
  179. <label class="radio-inline">
  180. <input value="<%- cCharge.value %>" name="charge" type="radio"<% if (cCharge.value === change.charge) { %> checked<% } %>> <%- cCharge.name %>
  181. </label>
  182. <% } %>
  183. </div>
  184. </div>
  185. </form>
  186. <% } else { %>
  187. <form class="p-2">
  188. <div class="form-group">
  189. <label>申请编号</label>
  190. <input class="form-control form-control-sm" value="<%- change.code %>" type="text" readonly>
  191. </div>
  192. <% if (auditStatus === 4) { %>
  193. <div class="form-group">
  194. <label>变更令号(批复编号)</label>
  195. <input class="form-control form-control-sm" value="<%- change.p_code %>" type="text" readonly>
  196. </div>
  197. <% } %>
  198. <div class="form-group">
  199. <label>工程名称</label>
  200. <input class="form-control form-control-sm" value="<%- change.name %>" type="text" readonly>
  201. </div>
  202. <div class="form-group">
  203. <label>桩号</label>
  204. <input class="form-control form-control-sm" value="<%- change.peg %>" type="text" readonly>
  205. </div>
  206. <div class="form-group">
  207. <label>原设计图名称</label>
  208. <input class="form-control form-control-sm" placeholder="" type="text" value="<%- change.org_name %>" readonly>
  209. </div>
  210. <div class="form-group">
  211. <label>原图号</label>
  212. <input class="form-control form-control-sm" placeholder="" type="text" value="<%- change.org_code %>" readonly>
  213. </div>
  214. <div class="form-group">
  215. <label>变更设计图名称</label>
  216. <input class="form-control form-control-sm" placeholder="" type="text" value="<%- change.new_name %>" readonly>
  217. </div>
  218. <div class="form-group">
  219. <label>变更图号</label>
  220. <input class="form-control form-control-sm" placeholder="" type="text" value="<%- change.new_code %>" readonly>
  221. </div>
  222. <div class="form-group">
  223. <label>工程变更理由及内容</label>
  224. <textarea class="form-control form-control-sm" rows="6" readonly><%- change.content %></textarea>
  225. </div>
  226. <div class="form-group">
  227. <label>工程变更合同依据</label>
  228. <textarea class="form-control form-control-sm" rows="6" readonly><%- change.basis %></textarea>
  229. </div>
  230. <div class="form-group">
  231. <label>变更工程量数量计算式</label>
  232. <textarea class="form-control form-control-sm" rows="2" readonly><%- change.expr %></textarea>
  233. </div>
  234. <div class="form-group">
  235. <label>备注</label>
  236. <textarea class="form-control form-control-sm" rows="3" readonly><%- change.memo %></textarea>
  237. </div>
  238. <div class="form-group">
  239. <label>变更类型</label>
  240. <div class="checkbox">
  241. <% const changeType = change.type !== null && change.type !== '' ? change.type.split(',') : '' %>
  242. <% for (const t in changeConst.type) { %>
  243. <% const cType = changeConst.type[t] %>
  244. <label class="checkbox-inline">
  245. <% if (changeType.indexOf(cType.value.toString()) !== -1) { %>
  246. <input value="<%- cType.value %>" type="checkbox" disabled checked><%- cType.name %>
  247. <% } %>
  248. </label>
  249. <% } %>
  250. </div>
  251. </div>
  252. <div class="form-group">
  253. <label>变更类别 </label>
  254. <select class="form-control form-control-sm" disabled>
  255. <% for (const c in changeConst.class) { %>
  256. <% const cClass = changeConst.class[c] %>
  257. <% if (cClass.value === change.class) { %>
  258. <option value="<%- cClass.value %>"><%- cClass.name %></option>
  259. <% } %>
  260. <% } %>
  261. </select>
  262. </div>
  263. <div class="form-group">
  264. <label>变更性质 </label>
  265. <select class="form-control form-control-sm" disabled>
  266. <% for (const q in changeConst.quality) { %>
  267. <% const cQuality = changeConst.quality[q] %>
  268. <% if (cQuality.value === change.quality) { %>
  269. <option value="<%- cQuality.value %>"><%- cQuality.name %></option>
  270. <% } %>
  271. <% } %>
  272. </select>
  273. </div>
  274. <div class="form-group">
  275. <label>变更提出单位</label>
  276. <select class="form-control form-control-sm" disabled>
  277. <option><%- change.company %></option>
  278. </select>
  279. </div>
  280. <div class="form-group">
  281. <label>费用承担方</label>
  282. <div class="radio">
  283. <% for (const c in changeConst.charge) { %>
  284. <% const cCharge = changeConst.charge[c] %>
  285. <label class="radio-inline">
  286. <% if (cCharge.value === change.charge) { %>
  287. <input value="<%- cCharge.value %>" type="radio" disabled checked> <%- cCharge.name %>
  288. <% } %>
  289. </label>
  290. <% } %>
  291. </div>
  292. </div>
  293. <div class="form-group">
  294. <label>批复文号</label>
  295. <input class="form-control form-control-sm" id="w_code" placeholder="" type="text" value="<%- change.w_code %>" <% if (auditStatus !== 6) { %>readonly<% } %>>
  296. </div>
  297. </form>
  298. <% } %>
  299. </div>
  300. </div>
  301. <div class="tab-pane" id="bgfujian">
  302. <div class="sjs-sh-1">
  303. <div class="p-2">
  304. <table class="table table-bordered">
  305. <thead>
  306. <tr>
  307. <td width="25" style="background-color: #e9ecef;"><input type="checkbox" id="check-all-file" ></td>
  308. <th width="50">序号</th>
  309. <th>名称</th>
  310. <th width="90">大小</th>
  311. <th width="100">上传时间</th>
  312. <th width="100">操作</th>
  313. </tr>
  314. </thead>
  315. <tbody id="attList">
  316. <% if (attList !== undefined && attList !== '') { %>
  317. <% for (const [index,att] of attList.entries()) { %>
  318. <tr>
  319. <td width="25"><input type="checkbox" class="check-file" file-id=<%- att.id %>></td>
  320. <td><%- index+1 %></td>
  321. <td><a href="javascript: void(0);" class="file-atn" f-id="<%- att.id %>"><%- att.filename %><%- att.fileext %></a></td>
  322. <td><%- ctx.helper.bytesToSize(att.filesize) %></td>
  323. <td><%- moment(att.in_time * 1000).format('YYYY-MM-DD') %></td>
  324. <td>
  325. <a href="/change/download/file/<%- att.id %>" class="btn btn-light btn-sm" title="下载"><span class="fa fa-download text-primary"></span></a>
  326. <% if (att.uid === uid && (auditStatus === 4 ? Boolean(att.extra_upload) : true )) { %>
  327. <a class="btn btn-light btn-sm delete-file" data-attid="<%- att.id %>" title="删除附件"><span class="fa fa-trash text-danger"></span></a>
  328. <% } %>
  329. </td>
  330. </tr>
  331. <% } %>
  332. <% } %>
  333. </tbody>
  334. </table>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. <div class="c-body col-8">
  341. <div class="sjs-height-0" id="change-spread">
  342. </div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. <script>
  348. let table = '';
  349. const totalPriceUnit = '<%- tpUnit %>';
  350. const unitPriceUnit = '<%- upUnit %>';
  351. const accountId = '<%- ctx.session.sessionUser.accountId %>';
  352. const ledgeStatus = '<%- tender.ledger_status %>';
  353. const ledgerConsts = JSON.parse('<%- JSON.stringify(ledgerConsts) %>');
  354. const auditStatus = '<%- auditStatus %>'
  355. const auditList = JSON.parse('<%- JSON.stringify(auditList) %>');
  356. autoFlashHeight();
  357. $('a[href="#sub-ap"').click(function() {
  358. if (parseInt(ledgeStatus) === ledgerConsts.uncheck) {
  359. $('#warning-ledger').modal('show');
  360. return false
  361. }
  362. });
  363. const readOnly = <%- change.readOnly %>;
  364. const changeSpread = SpreadJsObj.createNewSpread($('#change-spread')[0]);
  365. const changeSpreadSheet = changeSpread.getActiveSheet();
  366. </script>
  367. <script>
  368. const whiteList = JSON.parse('<%- JSON.stringify(whiteList) %>');
  369. </script>
  370. <% if (auditStatus === 1 || auditStatus === 2) { %>
  371. <script>
  372. let changeUnits = JSON.parse('<%- JSON.stringify(changeUnits) %>');
  373. const precision = JSON.parse('<%- JSON.stringify(precision) %>');
  374. changeUnits = _.map(changeUnits, 'unit');
  375. changeUnits.push('');
  376. const accountGroup = JSON.parse('<%- JSON.stringify(accountGroup) %>');
  377. const accountList = JSON.parse('<%- JSON.stringify(accountList) %>');
  378. const shenpi_status = <%- ctx.tender.info.shenpi.change %>;
  379. const shenpiConst = JSON.parse('<%- JSON.stringify(shenpiConst) %>');
  380. const changesUid = <%- change.uid %>;
  381. let back_changeInfo = {
  382. code: '<%- change.code %>',
  383. name: '<%- change.name %>',
  384. peg: '<%- change.peg %>',
  385. org_name: '<%- change.org_name %>',
  386. org_code: '<%- change.org_code %>',
  387. new_name: '<%- change.new_name %>',
  388. new_code: '<%- change.new_code %>',
  389. content: '<%- ctx.helper.replaceRntoBr(change.content) %>',
  390. basis: '<%- ctx.helper.replaceRntoBr(change.basis) %>',
  391. expr: '<%- ctx.helper.replaceRntoBr(change.expr) %>',
  392. memo: '<%- ctx.helper.replaceRntoBr(change.memo) %>',
  393. type: '<%- change.type %>',
  394. class: '<%- change.class %>',
  395. quality: '<%- change.quality %>',
  396. company: '<%- change.company %>',
  397. charge: '<%- change.charge %>',
  398. };
  399. let changeInfo = Object.assign({}, back_changeInfo);
  400. let changeList = JSON.parse('<%- JSON.stringify(changeList) %>');
  401. const changeSpreadSetting = {
  402. cols: [
  403. {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 80, formatter: '@', readOnly: 'readOnly.isEdit'},
  404. {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit'},
  405. {title: '变更部位', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit'},
  406. {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: false},
  407. {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', readOnly: 'readOnly.isEdit', cellType: 'unit', comboItems: changeUnits},
  408. {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.unit_price'},
  409. {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'oamount', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isEdit', getValue: 'getValue.oamount'},
  410. {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'oa_tp', hAlign: 2, width: 80, formatter: '@', type: 'Number', readOnly: true, getValue: 'getValue.oa_tp'},
  411. {title: '申请变更增(+)减(-)|数量', colSpan: '2|1', rowSpan: '1|1', field: 'camount', hAlign: 2, width: 60, type: 'Number', readOnly: false, getValue: 'getValue.camount'},
  412. {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'ca_tp', hAlign: 2, width: 80, formatter: '@', type: 'Number', readOnly: true, getValue: 'getValue.ca_tp'},
  413. {title: '操作', colSpan: '1', rowSpan: '2', field: 'del_list', hAlign: 1, width: 40, readOnly: true, cellType: 'mouseTouch', getValue: 'getValue.del_list'},
  414. ],
  415. emptyRows: 0,
  416. headRows: 2,
  417. headRowHeight: [25, 25],
  418. defaultRowHeight: 21,
  419. headerFont: '12px 微软雅黑',
  420. font: '12px 微软雅黑',
  421. readOnly: readOnly,
  422. };
  423. </script>
  424. <script src="/public/js/change_information_set.js"></script>
  425. <% } else if (auditStatus === 3 || auditStatus === 4 || auditStatus === 5 || auditStatus === 7) { %>
  426. <!--<script src="/public/js/change_show.js"></script>-->
  427. <% } else if (auditStatus === 6) { %>
  428. <!--<script src="/public/js/change_approval.js"></script>-->
  429. <% } %>
  430. <!--<script src="/public/js/change_detail.js"></script>-->