view.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style>
  4. html {
  5. background-color: #fff;
  6. }
  7. .log-timeline {
  8. position: relative;
  9. min-height: 600px;
  10. padding-left: 48px;
  11. background-color: #fff;
  12. }
  13. .log-timeline:after {
  14. content: "";
  15. position: absolute;
  16. top: 0;
  17. left: 24px;
  18. width: 1px;
  19. height: 100%;
  20. background: #e3e9ed;
  21. }
  22. .log-timeline dl {
  23. padding-bottom: 8px;
  24. position: relative;
  25. }
  26. .log-timeline dt {
  27. font-size: 16px;
  28. line-height: 2.4;
  29. color: #323232;
  30. font-weight: 600
  31. }
  32. .log-timeline dd {
  33. font-size: 14px;
  34. line-height: 1.6;
  35. padding: 5px 0
  36. }
  37. .log-timeline .date-second-point {
  38. width: 10px;
  39. height: 10px;
  40. display: block;
  41. border-radius: 50%;
  42. border: 3px solid #FBBC05;
  43. background: #fff;
  44. position: absolute;
  45. z-index: 99;
  46. left: -32px;
  47. top: 9px
  48. }
  49. .log-timeline .log-thumb {
  50. width: 24px;
  51. height: 24px;
  52. border-radius: 50%;
  53. margin-right: 4px;
  54. }
  55. .log-timeline .open-a {
  56. margin: 0 4px;
  57. }
  58. .log-item i {
  59. font-weight: 800;
  60. color: #323232
  61. }
  62. .log-content strong {
  63. margin: 0 4px;
  64. color: #323232
  65. }
  66. /*表格*/
  67. #tabniubi {
  68. width: 100%;
  69. margin: 10px 0;
  70. background-color: #fff;
  71. color: #5f5f5f;
  72. }
  73. #tabniubi th {
  74. padding: 7px 15px;
  75. min-height: 20px;
  76. height: 38px;
  77. line-height:38px;
  78. text-align: center;
  79. /* font-size: 14px; */
  80. border-width: 1px;
  81. border-style: solid;
  82. border-color: #e2e2e2;
  83. font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  84. }
  85. #tabniubi tr:first-child {
  86. padding: 0;
  87. min-height: 0;
  88. line-height: 0;
  89. border-width: 0;
  90. border-style: none;
  91. border-color: #fff;
  92. font-size: 0;
  93. }
  94. #tabniubi tr:first-child th {
  95. padding: 0;
  96. min-height: 0;
  97. line-height: 0;
  98. border-width: 0;
  99. border-style: none;
  100. border-color: #fff;
  101. font-size: 0;
  102. height: 0 !important;
  103. }
  104. .form-title {
  105. background-color: rgb(241, 241, 241);
  106. color: rgb(95, 95, 95);
  107. border-color: rgb(241, 241, 241);
  108. font-weight: 600;
  109. text-align: right !important;
  110. }
  111. #projectCard td{
  112. color: #5f5f5f;
  113. border: none;
  114. padding: 0;
  115. margin: 0;
  116. width: auto;
  117. background-color: #fff;
  118. }
  119. .project-del{
  120. height: 22px;
  121. line-height: 22px;
  122. padding: 0 4px;
  123. font-size: 12px;
  124. background-color: #ff5722;
  125. display: inline-block;
  126. vertical-align: middle;
  127. color: #fff;
  128. white-space: nowrap;
  129. text-align: center;
  130. border-radius: 2px;
  131. cursor: pointer;
  132. -moz-user-select: none;
  133. -webkit-user-select: none;
  134. -ms-user-select: none;
  135. }
  136. .annex li{
  137. padding: 0 1vw 0 1vw;
  138. border-right: 1px solid #e2e2e2;
  139. }
  140. .annex p{
  141. overflow: hidden;
  142. text-overflow: ellipsis;
  143. white-space: nowrap;
  144. width: 9vw;
  145. }
  146. </style>
  147. {/block}
  148. <!-- 主体 -->
  149. {block name="body"}
  150. <form class="layui-form px-4 pt-2" lay-filter="contract">
  151. <div class="layui-tab" style="margin:0;" lay-filter="contract" id="contractTab">
  152. <ul class="layui-tab-title">
  153. <li class="layui-this" data-load="true">合同详情</li>
  154. <li>操作记录</li>
  155. </ul>
  156. <div class="layui-tab-content">
  157. <div class="layui-tab-item layui-show">
  158. <table class="layui-table layui-table-form" id="tabniubi" cellpadding="1" cellspacing="1" style="margin:0">
  159. <tr>
  160. <th style="width: 10%;height: 0;"></th>
  161. <th style="width: 10%;height: 0;"></th>
  162. <th style="width: 10%;height: 0;"></th>
  163. <th style="width: 10%;height: 0;"></th>
  164. <th style="width: 10%;height: 0;"></th>
  165. <th style="width: 10%;height: 0;"></th>
  166. <th style="width: 10%;height: 0;"></th>
  167. <th style="width: 10%;height: 0;"></th>
  168. <th style="width: 10%;height: 0;"></th>
  169. </tr>
  170. <tr border="1">
  171. {gt name="$detail.pid" value="0"}
  172. <tr>
  173. <th class="form-title">母合同名称</th>
  174. <th colspan="8">{$detail.pname}</th>
  175. </tr>
  176. {/gt}
  177. <tr>
  178. <th class="form-title">合同名称</th>
  179. <th colspan="4">{$detail.name}</th>
  180. <th class="form-title">合同编号</th>
  181. <th colspan="3">{$detail.code}</th>
  182. </tr>
  183. <tr>
  184. <th class="form-title">签约主体(乙方)</th>
  185. <th colspan="2">
  186. {$detail.subject_name}
  187. </th>
  188. <th class="form-title">合同性质</th>
  189. <th colspan="2">
  190. {eq name="$detail.type" value="1" }普通合同{/eq}
  191. {eq name="$detail.type" value="2" }框架合同{/eq}
  192. {eq name="$detail.type" value="3" }补充协议{/eq}
  193. {eq name="$detail.type" value="4" }其他合同{/eq}
  194. </th>
  195. <th class="form-title">合同类别</th>
  196. <th colspan="2">
  197. {volist name=":contract_cate()" id="v"}
  198. {eq name="$v.id" value="$detail.cate_id" }{$v.title}{/eq}
  199. {/volist}
  200. </th>
  201. </tr>
  202. <tr>
  203. <th class="form-title">客户名称(甲方)</th>
  204. <th colspan="2">{$detail.customer}</th>
  205. <th class="form-title">签约客户代表</th>
  206. <th colspan="2">{$detail.customer_name}</th>
  207. <th class="form-title">客户联系电话</th>
  208. <th colspan="2">{$detail.customer_mobile}</th>
  209. </tr>
  210. <tr>
  211. <th class="form-title">客户联系地址</th>
  212. <th colspan="2">{$detail.customer_address}</th>
  213. <th class="form-title">合同开始日期</th>
  214. <th colspan="2">{$detail.start_time}</th>
  215. <th class="form-title">合同结束日期</th>
  216. <th colspan="2">{$detail.end_time}</th>
  217. </tr>
  218. {neq name="$detail.type" value="2"}
  219. <tr>
  220. <th class="form-title">合同金额</th>
  221. <th colspan="2">{$detail.cost}</th>
  222. {eq name="$detail.is_tax" value="1" }
  223. <th class="form-title">是否含税</th>
  224. <th colspan="2">是</th>
  225. <th class="form-title">税点(百分比)</th>
  226. <th colspan="2">{$detail.tax}%</th>
  227. {/eq}
  228. {eq name="$detail.is_tax" value="0" }
  229. <th class="form-title">是否含税</th>
  230. <th colspan="5">否</th>
  231. {/eq}
  232. </tr>
  233. {/neq}
  234. {notempty name="$detail.remark"}
  235. <tr>
  236. <th class="form-title">备注信息</th>
  237. <th colspan="8">{$detail.remark}</th>
  238. </tr>
  239. {/notempty}
  240. <tr>
  241. <th colspan="9" style="text-align:left;"><strong>关联项目</strong></th>
  242. </tr>
  243. <tr>
  244. <th class="form-title" style="text-align:center !important;">
  245. <button type="button" class="layui-btn layui-btn-sm" id="addProject"><i class="layui-icon"></i>关联项目</button>
  246. </th>
  247. <th id="projectCard" style="padding:5px;"></th>
  248. </tr>
  249. <tr>
  250. <th colspan="9" style="text-align:left;"><strong>补充附件</strong></th>
  251. </tr>
  252. <tr>
  253. <th class="form-title" style="text-align:center !important;">
  254. <button type="button" class="layui-btn layui-btn-sm" id="uploadBtn"><i
  255. class="layui-icon"></i>附件上传
  256. </button>
  257. </th>
  258. <th colspan="8" style="line-height:inherit">
  259. <div class="annex" style="display:flex;">
  260. {:fileCard($detail.file_array_other)}
  261. </div>
  262. </th>
  263. </tr>
  264. <tr>
  265. <th colspan="9" style="text-align:left;"><strong>签订信息</strong></th>
  266. </tr>
  267. <tr>
  268. <th class="form-title">合同制定人</th>
  269. <th colspan="2">{$detail.prepared_name}</th>
  270. <th class="form-title">合同签订人</th>
  271. <th colspan="2">{$detail.sign_name}</th>
  272. <th class="form-title">合同签订时间</th>
  273. <th colspan="2">{$detail.sign_time}</th>
  274. </tr>
  275. <tr>
  276. <th class="form-title">合同保管人</th>
  277. <th colspan="2">{$detail.keeper_name}<span id="keeper" data-ids="{$detail.keeper_uid}" data-names="{$detail.keeper_name}" class="layui-btn layui-btn-xs layui-btn-normal ml-1">更改</span>
  278. </th>
  279. <th class="form-title">合同共享人员</th>
  280. <th colspan="5">{$detail.share_names}<span id="shares" data-ids="{$detail.share_ids}" data-names="{$detail.share_names}" class="layui-btn layui-btn-xs layui-btn-normal ml-1">更改</span>
  281. </th>
  282. </tr>
  283. <tr>
  284. <th colspan="9" style="text-align:left;"><strong>审核信息</strong></th>
  285. </tr>
  286. <tr>
  287. <th class="form-title">合同状态</th>
  288. <th colspan="2"><span class="layui-color-{$detail.check_status}">{$detail.status_name}</span></th>
  289. <th class="form-title">录入人</th>
  290. <th colspan="2">{$detail.admin_name}</th>
  291. <th class="form-title">录入时间</th>
  292. <th colspan="2">{$detail.create_time}</th>
  293. </tr>
  294. {notempty name="$check_record"}
  295. <tr>
  296. <th class="form-title">历史审批记录</th>
  297. <th colspan="7">
  298. <ul class="layui-timeline flow-record pt-2">
  299. {volist name="$check_record" id="vo"}
  300. <li class="layui-timeline-item delete-{$vo.delete_time}">
  301. <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
  302. <p style="padding-left:24px">{$vo.check_time_str}<span
  303. class="black ml-2">{$vo.name}</span><span
  304. class="mx-2 layui-color-{$vo.status}">{$vo.status_str}</span>了此申请。操作意见:<span
  305. class="green">{$vo.content}</span></p>
  306. </li>
  307. {/volist}
  308. </ul>
  309. </th>
  310. </tr>
  311. {/notempty}
  312. </table>
  313. {if ($detail.check_status == 1&& $view_auth==0) }
  314. {include file="/contract/index/view_step" /}
  315. {elseif ($detail.check_status == 0) OR ($detail.check_status == 4) OR ($detail.check_status == 7)}
  316. {if $view_auth==0}
  317. {include file="/contract/index/view_set" /}
  318. {/if}
  319. {else /}
  320. <table class="layui-table layui-table-form" id="tabniubi" cellpadding="1" cellspacing="1" style="margin:0">
  321. <tr>
  322. <th style="width: 10%;height: 0;"></th>
  323. <th style="width: 10%;height: 0;"></th>
  324. <th style="width: 10%;height: 0;"></th>
  325. <th style="width: 10%;height: 0;"></th>
  326. <th style="width: 10%;height: 0;"></th>
  327. <th style="width: 10%;height: 0;"></th>
  328. <th style="width: 10%;height: 0;"></th>
  329. <th style="width: 10%;height: 0;"></th>
  330. <th style="width: 10%;height: 0;"></th>
  331. </tr>
  332. <tr border="1">
  333. {eq name="$detail.check_status" value="2" }
  334. <tr>
  335. <th class="form-title">归档状态</th>
  336. {eq name="$detail.archive_status" value="0" }
  337. <th colspan="2"><span
  338. class="layui-color-{$detail.archive_status}">{$detail.archive_status_name}</span></th>
  339. {else/}
  340. <th colspan="2"><span class="layui-color-{$detail.archive_status}">{$detail.archive_status_name}</span></th>
  341. <th class="form-title">归档人</th>
  342. <th colspan="2">{$detail.archive_name}</th>
  343. <th class="form-title">归档时间</th>
  344. <th colspan="2">{$detail.archive_time|date="y-m-d"}</th>
  345. {/eq}
  346. </tr>
  347. {/eq}
  348. {eq name="$detail.check_status" value="5" }
  349. <tr>
  350. <th class="form-title">中止人</th>
  351. <th colspan="2">{$detail.stop_name}</th>
  352. <th class="form-title">中止时间</th>
  353. <th colspan="5">{$detail.stop_time|date="y-m-d"}</th>
  354. </tr>
  355. <tr>
  356. <th class="form-title">中止备注</th>
  357. <th colspan="8" style="display:flex;">{$detail.stop_remark}</th>
  358. </tr>
  359. {/eq}
  360. {eq name="$detail.check_status" value="6" }
  361. <tr>
  362. <th class="form-title">作废人</th>
  363. <th colspan="2">{$detail.void_name}</th>
  364. <th class="form-title">作废时间</th>
  365. <th colspan="5">{$detail.void_time|date="y-m-d"}</th>
  366. </tr>
  367. <tr>
  368. <th class="form-title">作废备注</th>
  369. <th colspan="8">{$detail.void_remark}</th>
  370. </tr>
  371. {/eq}
  372. </table>
  373. {if ($detail.archive_status==0 && $view_auth==0)}
  374. <div class="pt-2">
  375. {gt name="auth" value="0"}
  376. {if $detail.check_status<4 AND $detail.check_status>1 AND $detail.archive_status==0}
  377. <textarea name="remark" placeholder="请输入备注信息" class="layui-textarea"></textarea>
  378. {/if}
  379. {eq name="$detail.check_status" value="2" }
  380. <span class="layui-btn layui-btn-normal" data-event="archive" data-status="1">合同归档</span>
  381. {/eq}
  382. {lt name="$detail.check_status" value="4" }
  383. <span class="layui-btn layui-btn-warm" data-event="check" data-status="5">中止合同</span>
  384. <span class="layui-btn layui-btn-danger" data-event="check" data-status="6">作废合同</span>
  385. {/lt}
  386. {/gt}
  387. {if ( $detail.check_status eq 3) AND ( $is_create_admin eq 1) }
  388. <span class="layui-btn layui-btn-normal check_back">修改</span>
  389. {/if}
  390. </div>
  391. {/if}
  392. {/if}
  393. </div>
  394. <div class="layui-tab-item">
  395. {include file="/contract/index/view_log" /}
  396. </div>
  397. </div>
  398. </div>
  399. </form>
  400. {/block}
  401. <!-- /主体 -->
  402. <!-- 脚本 -->
  403. {block name="script"}
  404. <script>
  405. const contract_id = '{$detail.id}';
  406. const contract_status = '{$detail.check_status}';
  407. const moduleInit = ['tool', 'employeepicker', 'oaTool'];
  408. const check_step_sort = '{$detail.check_step_sort}';
  409. function gouguInit() {
  410. var form = layui.form, tool = layui.tool, element = layui.element, employeepicker = layui.employeepicker,
  411. oaTool = layui.oaTool,table = layui.table;
  412. element.on('tab(contract)', function (data) {
  413. let index = data.index;
  414. if (index == 1) {
  415. log(layui);
  416. }
  417. });
  418. if (typeof init === 'function') {
  419. init(form, tool);
  420. }
  421. if (typeof (flowStep) == "function") {
  422. flowStep();
  423. }
  424. //选择合同保管人弹窗
  425. $('body').on('click', '#keeper', function () {
  426. var ids = $(this).data('ids') + '', names = $(this).data('names') + '';
  427. employeepicker.init({
  428. ids: ids,
  429. names: names,
  430. type: 0,
  431. department_url: "/admin/project.api/get_department_tree",
  432. employee_url: "/admin/project.api/get_employee",
  433. callback: function (ids, names, dids, departments) {
  434. let callback = function (e) {
  435. layer.msg(e.msg);
  436. if (e.code == 0) {
  437. location.reload();
  438. }
  439. }
  440. tool.post("/admin/contract.index/edit", {
  441. 'id': contract_id,
  442. 'keeper_uid': ids,
  443. 'scene': 'change'
  444. }, callback);
  445. }
  446. });
  447. });
  448. //选择共享成员弹窗
  449. $('body').on('click', '#shares', function () {
  450. var ids = $(this).data('ids') + '', names = $(this).data('names') + '', share_ids_array = [],
  451. share_names_array = [];
  452. if (ids.length > 0) {
  453. share_ids_array = ids.split(',');
  454. share_names_array = names.split(',');
  455. }
  456. employeepicker.init({
  457. ids: share_ids_array,
  458. names: share_names_array,
  459. type: 1,
  460. department_url: "/admin/project.api/get_department_tree",
  461. employee_url: "/admin/project.api/get_employee",
  462. callback: function (ids, names, dids, departments) {
  463. let callback = function (e) {
  464. layer.msg(e.msg);
  465. if (e.code == 0) {
  466. location.reload();
  467. }
  468. }
  469. tool.post("/admin/contract.index/edit", {
  470. 'id': contract_id,
  471. 'share_ids': ids.join(','),
  472. 'scene': 'change'
  473. }, callback);
  474. }
  475. });
  476. });
  477. $('body').on('click', '[data-event="check"]', function () {
  478. let status = $(this).data('status');
  479. let mark = $('[name="remark"]').val();
  480. let title = ''
  481. if (status == 5) {
  482. title = '确定要中止该合同?';
  483. }
  484. if (status == 6) {
  485. title = '确定要作废该合同?';
  486. }
  487. layer.confirm(title, {
  488. icon: 3,
  489. title: '提示'
  490. }, function (index) {
  491. let callback = function (e) {
  492. layer.msg(e.msg);
  493. parent.layui.pageTable.reload();
  494. setTimeout(function () {
  495. location.reload();
  496. }, 2000)
  497. }
  498. if (status == 5) {
  499. tool.post("/admin/contract.api/discontinue", {
  500. id: contract_id,
  501. check_status: status,
  502. mark: mark
  503. }, callback);
  504. } else if (status == 6) {
  505. tool.post("/admin/contract.api/obsolete", {
  506. id: contract_id,
  507. check_status: status,
  508. mark: mark
  509. }, callback);
  510. } else {
  511. tool.post("/admin/contract.api/check", {
  512. id: contract_id,
  513. check_status: status,
  514. mark: mark
  515. }, callback);
  516. }
  517. layer.close(index);
  518. });
  519. });
  520. $('body').on('click', '[data-event="archive"]', function () {
  521. let status = $(this).data('status');
  522. let mark = $('[name="remark"]').val();
  523. layer.confirm('合同归档后将不能进行任何数据操作,确定要提交归档?', {
  524. icon: 3,
  525. title: '提示'
  526. }, function (index) {
  527. let callback = function (e) {
  528. layer.msg(e.msg);
  529. parent.layui.pageTable.reload();
  530. setTimeout(function () {
  531. location.reload();
  532. }, 2000)
  533. }
  534. tool.post("/admin/contract.api/archive", {
  535. id: contract_id,
  536. archive_status: status,
  537. mark: mark
  538. }, callback);
  539. layer.close(index);
  540. });
  541. })
  542. $('body').on('click', '.check_back', function () {
  543. layer.confirm('是否确认进行修改?', {
  544. icon: 3,
  545. title: '提示'
  546. }, function (value, index, elem) {
  547. $.ajax({
  548. url: "/admin/contract.api/check_edit",
  549. type: 'post',
  550. data: {
  551. id: contract_id,
  552. check_status: contract_status,
  553. },
  554. success: function (e) {
  555. layer.msg(e.msg);
  556. if (e.code == 0) {
  557. parent.layui.pageTable.reload();
  558. location.reload();
  559. }
  560. }
  561. })
  562. layer.close(index);
  563. });
  564. })
  565. $("#addProject").click(function (){
  566. var projectTable;
  567. var pop = layer.open({
  568. title: '选择造价项目',
  569. area: ['600px', '580px'],
  570. type: 1,
  571. content: '<div class="picker-table">\
  572. <form class="layui-form pb-2">\
  573. <div class="layui-input-inline" style="width:480px;">\
  574. <input type="text" name="keywords" placeholder="造价项目" class="layui-input" autocomplete="off" />\
  575. </div>\
  576. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="search_customer">提交搜索</button>\
  577. </form>\
  578. <div id="customerTable"></div></div>',
  579. success: function () {
  580. projectTable = table.render({
  581. elem: '#customerTable'
  582. , url: '/admin/project.api/get_self_project'
  583. , page: true //开启分页
  584. , limit: 10
  585. , cols: [[
  586. {type: 'radio', title: '选择'},
  587. {field: 'id', width: 80, title: '编号', align: 'center'},
  588. {field: 'project_name', title: '项目名称', align: 'center'},
  589. {field: 'entrust_unit_name', title: '委托单位', align: 'center'},
  590. {field: 'review_unit_name', title: '评审单位', align: 'center'},
  591. ]]
  592. });
  593. //客户搜索提交
  594. form.on('submit(search_customer)', function (data) {
  595. projectTable.reload({where: {keywords: data.field.keywords}, page: {curr: 1}});
  596. return false;
  597. });
  598. },
  599. btn: ['确定'],
  600. btnAlign: 'c',
  601. yes: function () {
  602. var checkStatus = table.checkStatus(projectTable.config.id);
  603. var data = checkStatus.data;
  604. if (data.length > 0) {
  605. let callback = function (e){
  606. console.log(e)
  607. layer.msg(e.msg);
  608. layer.close(pop);
  609. projectCard()
  610. }
  611. tool.post("/admin/contract.api/relevancy",{uid:contract_id,uuid:data[0]["id"]},callback)
  612. } else {
  613. layer.msg('请先选择项目');
  614. return false;
  615. }
  616. }
  617. })
  618. })
  619. projectCard();
  620. function projectCard(e){
  621. $.ajax({
  622. url: "/admin/contract.api/relevancy_p",
  623. type: 'post',
  624. data: {
  625. id: contract_id,
  626. },
  627. success: function (e) {
  628. var h="";
  629. for (var i=0;i<e.length;i++){
  630. var point = e[i];
  631. h+=`<td class="layui-td-gray" >${point.project_name}<span class="project-del" data-id="${point.id}">删除</span></td>`
  632. }
  633. $("#projectCard").html(h)
  634. }
  635. })
  636. }
  637. $('body').on('click', '.project-del', function () {
  638. let id = $(this).attr('data-id');
  639. layer.confirm('是否确认删除?', {
  640. icon: 3,
  641. title: '提示'
  642. }, function () {
  643. let callback = function (e) {
  644. layer.msg(e.msg);
  645. if(e.code==0){
  646. $('span.project-del[data-id="'+id+'"]').parent().remove();
  647. }
  648. }
  649. tool.post("/admin/contract.api/relevancy_del", {
  650. id: id,
  651. }, callback);
  652. })
  653. })
  654. oaTool.addFile({
  655. type: 1,
  656. isSave: true,
  657. ajaxDelete: function (file_id) {
  658. let callback = function (e) {
  659. layer.msg(e.msg);
  660. if (e.code == 0) {
  661. $("#" + file_id + "").remove();
  662. }
  663. }
  664. tool.delete("/admin/contract.api/delete_file", {id: file_id}, callback);
  665. },
  666. ajaxSave: function (res) {
  667. let callback = function (e) {
  668. location.reload();
  669. }
  670. tool.post("/admin/contract.api/add_file", {
  671. 'contract_id': contract_id,
  672. 'file_id': res.data.id,
  673. 'file_name': res.data.name
  674. }, callback);
  675. }
  676. });
  677. //操作记录的审批流程
  678. $.ajax({
  679. url: "/admin/contract.api/check_node",
  680. type:'post',
  681. data:{id:contract_id,type:4},
  682. success: function (e) {
  683. if (e.code == 0) {
  684. let flowHtml='',list = e.data,record_list='',sort = check_step_sort;
  685. for(var f=0;f<list.length;f++){
  686. //审批流程
  687. let checkUser = '',
  688. iconRight ='<span class="layui-icon layui-icon-right"></span>',
  689. iconStatus ='<i class="layui-icon layui-icon-time"></i>',
  690. strStatus ='<div class="check-item-status">待审核</div>',
  691. sortClass ='';
  692. if(f == list.length-1){
  693. iconRight ='';
  694. }
  695. checkUser=list[f].check_admin;
  696. if(list[f].check_status == 1){
  697. iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
  698. strStatus ='<div class="check-item-status">通过</div>';
  699. }else {
  700. iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
  701. strStatus ='<div class="check-item-status">拒绝</div>';
  702. }
  703. if(sort == list[f].id){
  704. sortClass ='flow-this';
  705. iconStatus ='<i class="layui-icon layui-icon-time"></i>';
  706. strStatus ='<div class="check-item-status">当前审核</div>';
  707. }
  708. if(f<list.length&&list[f].check_status == 2){
  709. flowHtml+=
  710. '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
  711. <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
  712. </div>'+
  713. '<div class="flow-flexbox check-item flow-flex-row"><div class="check-item-name">{$detail.create_user}</div><div class="check-item-status">提交申请</div><span class="layui-icon layui-icon-right"></span></div>';
  714. }else {
  715. flowHtml+= '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
  716. <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
  717. </div>';
  718. }
  719. }
  720. $('#flowListLog').append(flowHtml);
  721. }
  722. }
  723. })
  724. }
  725. </script>
  726. {/block}
  727. <!-- /脚本 -->