view_step.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <style>
  2. .footer{
  3. display: none;
  4. }
  5. #tabniubi {
  6. width: 100%;
  7. margin: 10px 0;
  8. background-color: #fff;
  9. color: #5f5f5f;
  10. }
  11. #tabniubi th {
  12. padding: 7px 15px;
  13. min-height: 20px;
  14. height: 38px;
  15. line-height:38px;
  16. text-align: center;
  17. /* font-size: 14px; */
  18. border-width: 1px;
  19. border-style: solid;
  20. border-color: #e2e2e2;
  21. font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
  22. }
  23. #tabniubi tr:first-child {
  24. padding: 0;
  25. min-height: 0;
  26. line-height: 0;
  27. border-width: 0;
  28. border-style: none;
  29. border-color: #fff;
  30. font-size: 0;
  31. }
  32. #tabniubi tr:first-child th {
  33. padding: 0;
  34. min-height: 0;
  35. line-height: 0;
  36. border-width: 0;
  37. border-style: none;
  38. border-color: #fff;
  39. font-size: 0;
  40. height: 0 !important;
  41. }
  42. .form-title {
  43. background-color: rgb(241, 241, 241);
  44. color: rgb(95, 95, 95);
  45. border-color: rgb(241, 241, 241);
  46. font-weight: 600;
  47. text-align: right !important;
  48. }
  49. </style>
  50. <table class="layui-table layui-table-form" style="margin-top:12px" id="tabniubi" cellpadding="1" cellspacing="1">
  51. <tr>
  52. <th style="width: 10%;height: 0;"></th>
  53. <th style="width: 10%;height: 0;"></th>
  54. <th style="width: 10%;height: 0;"></th>
  55. <th style="width: 10%;height: 0;"></th>
  56. <th style="width: 10%;height: 0;"></th>
  57. <th style="width: 10%;height: 0;"></th>
  58. <th style="width: 10%;height: 0;"></th>
  59. <th style="width: 10%;height: 0;"></th>
  60. <th style="width: 10%;height: 0;"></th>
  61. </tr>
  62. <tr border="1">
  63. <tr>
  64. <th class="form-title">当前审核人</th>
  65. <th colspan="8" style="text-align:left;">{$detail.check_user}</th>
  66. </tr>
  67. <tr>
  68. <th class="form-title">审批流程</th>
  69. <th colspan="8">
  70. <div class="flow-flexbox check-items flow-flex-row" id="flowList">
  71. <div class="flow-flexbox check-item flow-flex-row">
  72. <i class="layui-icon layui-icon-add-circle" data-ok=""></i>
  73. <div class="check-item-name">{$detail.create_user}</div>
  74. <div class="check-item-status">提交申请</div>
  75. <span class="layui-icon layui-icon-right"></span>
  76. </div>
  77. </div>
  78. </th>
  79. </tr>
  80. {if ( $is_check_admin eq 1) }
  81. <tr>
  82. <th class="form-title">审批节点 <font style="color:red;">*</font></th>
  83. <th colspan="8" style="text-align:left;">
  84. <input type="radio" name="check_node" lay-filter="check_node" value="1" title="审核结束" checked>
  85. <input type="radio" name="check_node" lay-filter="check_node" value="2" title="下一审批人">
  86. <div class="layui-inline">
  87. <input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择下一审批人" lay-verify="required" lay-reqText="请选择下一审批人" class="layui-input picker-one">
  88. <input type="hidden" name="check_admin_ids" value="">
  89. </div>
  90. </th>
  91. </tr>
  92. <tr>
  93. <th class="form-title">审批意见</th>
  94. <th colspan="8">
  95. <textarea name="content" placeholder="请输入审批意见" class="layui-textarea"></textarea>
  96. </th>
  97. </tr>
  98. {/if}
  99. </table>
  100. <input type="hidden" name="id" value="{$detail.id}">
  101. <input type="hidden" name="check_step_sort" value="{$detail.check_step_sort}">
  102. <input type="hidden" name="check_status" value="{$detail.check_status}">
  103. <div id="formBtn" style="padding: 10px 0">
  104. {eq name="$is_check_admin" value='1'}
  105. <span class="layui-btn layui-btn-normal" data-status="2"><i class="layui-icon layui-icon-ok"></i> 通过</span>
  106. <span class="layui-btn layui-btn-danger" data-status="3"><i class="layui-icon layui-icon-close"></i> 拒绝</span>
  107. {/eq}
  108. {eq name="$is_create_admin" value='1'}
  109. {/eq}
  110. </div>
  111. <script>
  112. function flowStep(){
  113. var form = layui.form,tool=layui.tool, dropdown = layui.dropdown,employeepicker = layui.employeepicker;
  114. //获取审核信息
  115. $.ajax({
  116. url: "/admin/contract.api/check_node",
  117. type:'get',
  118. data:{id:contract_id,type:4},
  119. success: function (e) {
  120. if (e.code == 0) {
  121. let flowHtml='',list = e.data,record_list='',sort = $('[name="check_step_sort"]').val();
  122. for(var f=0;f<list.length;f++){
  123. //审批流程
  124. let checkUser = '',
  125. iconRight ='<span class="layui-icon layui-icon-right"></span>',
  126. iconStatus ='<i class="layui-icon layui-icon-time"></i>',
  127. strStatus ='<div class="check-item-status">待审核</div>',
  128. sortClass ='';
  129. if(f == list.length-1){
  130. iconRight ='';
  131. }
  132. checkUser=list[f].check_admin;
  133. if(list[f].check_status == 1){
  134. iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
  135. strStatus ='<div class="check-item-status">通过</div>';
  136. }else {
  137. iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
  138. strStatus ='<div class="check-item-status">拒绝</div>';
  139. }
  140. if(sort == list[f].id){
  141. sortClass ='flow-this';
  142. iconStatus ='<i class="layui-icon layui-icon-time"></i>';
  143. strStatus ='<div class="check-item-status">当前审核</div>';
  144. }
  145. if(f<list.length&&list[f].check_status == 2){
  146. flowHtml+=
  147. '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
  148. <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
  149. </div>'+
  150. '<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>';
  151. }else {
  152. flowHtml+= '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
  153. <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
  154. </div>';
  155. }
  156. }
  157. $('#flowList').append(flowHtml);
  158. }
  159. }
  160. })
  161. $('#formBtn').on('click','span', function(data){
  162. let content=$('[name="content"]').val();
  163. let check_node=0,check_admin_ids=0,check_admin_name="";
  164. let check_status=$(this).data('status');
  165. if(check_status ==2 || check_status==3){
  166. check_node = $('input[name="check_node"]:checked').val();
  167. check_admin_ids = $('input[name="check_admin_ids"]').val();
  168. check_admin_name = $('input[name="check_admin_name"]').val();
  169. let url="/admin/contract.api/check_agree"
  170. let confirmTips='确定通过该审核?';
  171. if(check_status==3){
  172. if(content==''){
  173. layer.msg('请输入审批意见');
  174. return false;
  175. }
  176. url = "/admin/contract.api/check_disagree"
  177. confirmTips='确定拒绝该审核?';
  178. }
  179. layer.confirm(confirmTips, function(index){
  180. $.ajax({
  181. url: url,
  182. type:'post',
  183. data:{
  184. id:contract_id,
  185. check_node:check_node,
  186. check_admin_ids:check_admin_ids,
  187. check_status:check_status,
  188. check_admin_name:check_admin_name,
  189. content:content
  190. },
  191. success: function (e) {
  192. layer.msg(e.msg);
  193. if (e.code == 0) {
  194. parent.layui.pageTable.reload();
  195. location.reload();
  196. }
  197. }
  198. })
  199. // console.log(contract_id,check_status,content)
  200. layer.close(index);
  201. });
  202. }else if(check_status ==4){
  203. layer.prompt({
  204. formType: 2,
  205. title: '请输入撤回理由',
  206. area: ['500px', '120px'] //自定义文本域宽高
  207. }, function(value, index, elem){
  208. /*$.ajax({
  209. url: "/api/index/flow_check",
  210. type:'post',
  211. data:{
  212. id:contract_id,
  213. type:4,
  214. check_node:check_node,
  215. check_admin_ids:check_admin_ids,
  216. check_status:check_status,
  217. content:value
  218. },
  219. success: function (e) {
  220. layer.msg(e.msg);
  221. if (e.code == 0) {
  222. parent.layui.pageTable.reload();
  223. location.reload();
  224. }
  225. }
  226. })*/
  227. console.log(contract_id,check_status,value)
  228. layer.close(index);
  229. });
  230. }
  231. return false;
  232. });
  233. //监听提交
  234. }
  235. </script>