123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <style>
- .footer{
- display: none;
- }
- #tabniubi {
- width: 100%;
- margin: 10px 0;
- background-color: #fff;
- color: #5f5f5f;
- }
-
- #tabniubi th {
- padding: 7px 15px;
- min-height: 20px;
- height: 38px;
- line-height:38px;
- text-align: center;
- /* font-size: 14px; */
- border-width: 1px;
- border-style: solid;
- border-color: #e2e2e2;
- font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
- }
-
- #tabniubi tr:first-child {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- }
-
- #tabniubi tr:first-child th {
- padding: 0;
- min-height: 0;
- line-height: 0;
- border-width: 0;
- border-style: none;
- border-color: #fff;
- font-size: 0;
- height: 0 !important;
- }
-
- .form-title {
- background-color: rgb(241, 241, 241);
- color: rgb(95, 95, 95);
- border-color: rgb(241, 241, 241);
- font-weight: 600;
- text-align: right !important;
- }
- </style>
-
- <table class="layui-table layui-table-form" style="margin-top:12px" id="tabniubi" cellpadding="1" cellspacing="1">
- <tr>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- <th style="width: 10%;height: 0;"></th>
- </tr>
- <tr border="1">
-
- <tr>
- <th class="form-title">当前审核人</th>
- <th colspan="8" style="text-align:left;">{$detail.check_user}</th>
- </tr>
- <tr>
- <th class="form-title">审批流程</th>
- <th colspan="8">
- <div class="flow-flexbox check-items flow-flex-row" id="flowList">
- <div class="flow-flexbox check-item flow-flex-row">
- <i class="layui-icon layui-icon-add-circle" data-ok=""></i>
- <div class="check-item-name">{$detail.create_user}</div>
- <div class="check-item-status">提交申请</div>
- <span class="layui-icon layui-icon-right"></span>
- </div>
- </div>
- </th>
- </tr>
- {if ( $is_check_admin eq 1) }
- <tr>
- <th class="form-title">审批节点 <font style="color:red;">*</font></th>
- <th colspan="8" style="text-align:left;">
- <input type="radio" name="check_node" lay-filter="check_node" value="1" title="审核结束" checked>
- <input type="radio" name="check_node" lay-filter="check_node" value="2" title="下一审批人">
- <div class="layui-inline">
- <input type="text" name="check_admin_name" value="" autocomplete="off" placeholder="请选择下一审批人" lay-verify="required" lay-reqText="请选择下一审批人" class="layui-input picker-one">
- <input type="hidden" name="check_admin_ids" value="">
- </div>
- </th>
- </tr>
- <tr>
- <th class="form-title">审批意见</th>
- <th colspan="8">
- <textarea name="content" placeholder="请输入审批意见" class="layui-textarea"></textarea>
- </th>
- </tr>
- {/if}
- </table>
- <input type="hidden" name="id" value="{$detail.id}">
- <input type="hidden" name="check_step_sort" value="{$detail.check_step_sort}">
- <input type="hidden" name="check_status" value="{$detail.check_status}">
- <div id="formBtn" style="padding: 10px 0">
- {eq name="$is_check_admin" value='1'}
- <span class="layui-btn layui-btn-normal" data-status="2"><i class="layui-icon layui-icon-ok"></i> 通过</span>
- <span class="layui-btn layui-btn-danger" data-status="3"><i class="layui-icon layui-icon-close"></i> 拒绝</span>
- {/eq}
- {eq name="$is_create_admin" value='1'}
-
- {/eq}
- </div>
- <script>
- function flowStep(){
- var form = layui.form,tool=layui.tool, dropdown = layui.dropdown,employeepicker = layui.employeepicker;
- //获取审核信息
- $.ajax({
- url: "/admin/contract.api/check_node",
- type:'get',
- data:{id:contract_id,type:4},
- success: function (e) {
- if (e.code == 0) {
- let flowHtml='',list = e.data,record_list='',sort = $('[name="check_step_sort"]').val();
- for(var f=0;f<list.length;f++){
- //审批流程
- let checkUser = '',
- iconRight ='<span class="layui-icon layui-icon-right"></span>',
- iconStatus ='<i class="layui-icon layui-icon-time"></i>',
- strStatus ='<div class="check-item-status">待审核</div>',
- sortClass ='';
- if(f == list.length-1){
- iconRight ='';
- }
- checkUser=list[f].check_admin;
- if(list[f].check_status == 1){
- iconStatus ='<i class="layui-icon layui-icon-ok-circle" data-ok=""></i>';
- strStatus ='<div class="check-item-status">通过</div>';
- }else {
- iconStatus ='<i class="layui-icon layui-icon-close" data-no=""></i>';
- strStatus ='<div class="check-item-status">拒绝</div>';
- }
-
- if(sort == list[f].id){
- sortClass ='flow-this';
- iconStatus ='<i class="layui-icon layui-icon-time"></i>';
- strStatus ='<div class="check-item-status">当前审核</div>';
- }
- if(f<list.length&&list[f].check_status == 2){
- flowHtml+=
- '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
- <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
- </div>'+
- '<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>';
- }else {
- flowHtml+= '<div class="flow-flexbox check-item flow-flex-row '+sortClass+'" id="flow'+f+'">'+iconStatus+'\
- <div class="check-item-name">'+checkUser+'</div>'+strStatus+iconRight+'\
- </div>';
- }
- }
-
- $('#flowList').append(flowHtml);
- }
- }
- })
- $('#formBtn').on('click','span', function(data){
- let content=$('[name="content"]').val();
- let check_node=0,check_admin_ids=0,check_admin_name="";
- let check_status=$(this).data('status');
- if(check_status ==2 || check_status==3){
- check_node = $('input[name="check_node"]:checked').val();
- check_admin_ids = $('input[name="check_admin_ids"]').val();
- check_admin_name = $('input[name="check_admin_name"]').val();
- let url="/admin/contract.api/check_agree"
- let confirmTips='确定通过该审核?';
- if(check_status==3){
- if(content==''){
- layer.msg('请输入审批意见');
- return false;
- }
- url = "/admin/contract.api/check_disagree"
- confirmTips='确定拒绝该审核?';
- }
- layer.confirm(confirmTips, function(index){
- $.ajax({
- url: url,
- type:'post',
- data:{
- id:contract_id,
- check_node:check_node,
- check_admin_ids:check_admin_ids,
- check_status:check_status,
- check_admin_name:check_admin_name,
- content:content
- },
- success: function (e) {
- layer.msg(e.msg);
- if (e.code == 0) {
- parent.layui.pageTable.reload();
- location.reload();
- }
- }
- })
- // console.log(contract_id,check_status,content)
- layer.close(index);
- });
- }else if(check_status ==4){
- layer.prompt({
- formType: 2,
- title: '请输入撤回理由',
- area: ['500px', '120px'] //自定义文本域宽高
- }, function(value, index, elem){
- /*$.ajax({
- url: "/api/index/flow_check",
- type:'post',
- data:{
- id:contract_id,
- type:4,
- check_node:check_node,
- check_admin_ids:check_admin_ids,
- check_status:check_status,
- content:value
- },
- success: function (e) {
- layer.msg(e.msg);
- if (e.code == 0) {
- parent.layui.pageTable.reload();
- location.reload();
- }
- }
- })*/
- console.log(contract_id,check_status,value)
- layer.close(index);
- });
- }
- return false;
- });
- //监听提交
-
- }
-
- </script>
|