490 lines
17 KiB
HTML

{extend name="../../base/view/common/base" /}
{block name="style"}
<style>
html{background-color:#fff;}
.log-timeline{ position: relative; min-height:600px; padding-left: 48px; background-color:#fff;}
.log-timeline:after {content: ""; position: absolute; top: 0; left: 24px; width: 1px; height: 100%; background: #e3e9ed;}
.log-timeline dl{padding-bottom: 8px; position: relative;}
.log-timeline dt{font-size: 16px; line-height: 2.4; color: #323232; font-weight:600}
.log-timeline dd{font-size: 14px; line-height: 1.6; padding:5px 0}
.log-timeline .date-second-point{width: 10px; height: 10px; display: block; border-radius: 50%; border: 3px solid #FBBC05; background: #fff; position: absolute; z-index: 99; left:-32px; top:9px}
.log-timeline .log-thumb{width: 24px; height: 24px; border-radius: 50%; margin-right:4px;}
.log-timeline .open-a{margin:0 4px;}
.log-item i{font-weight:800; color:#323232}
.log-content strong{margin:0 4px; color:#323232}
.check-items{overflow-x: auto; padding: 2px 0;}
.flow-flex-row {box-direction: row;
box-orient: horizontal;
-webkit-box-orient: horizontal;
-ms-flex-direction: row;
flex-direction: row;
}
.flow-flexbox { width: 100%;text-align: left;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
display: -webkit-flex;
box-align: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
flex-wrap: wrap;
}
.check-item{width: auto; -ms-flex-negative: 0; flex-shrink: 0; padding:4px 0}
.check-item i{margin-right:3px; color:#646464;}
.check-item span{color:#999;margin:0 3px;}
.check-item .layui-icon {font-size:18px;}
.check-item .layui-icon.layui-icon-right{font-size:12px;}
.layui-icon[data-ok]{color:#34a853}
.layui-icon[data-no]{color:#FF5722;}
.check-item-status{color:#999; font-size:12px; margin-left:3px;}
.flow-tips{padding:6px 10px;}
.flow-tips li{padding:5px 0;}
.flow-tips li i{color:#4285f4;}
.flow-tips li span{color:#999; font-size:12px; margin-left:4px;}
.flow-record{padding:4px 4px 0;}
.flow-record .layui-timeline-item{text-decoration:line-through; color:#acacac; padding-bottom:10px;}
.flow-record .layui-timeline-item.delete-0{text-decoration:none; color:#323232;}
.layui-timeline-content ul{font-size:12px;}
.check-status{color:#999; margin-left:5px;}
.check-remark{padding:6px; margin-top:6px; margin-bottom:10px; border-radius:4px; background-color:#f5f5f5;}
.check-record{line-height:1.5; padding:4px 0}
.flow-this{font-weight:800;}
.flow-this i{color:#4285f4}
.layui-table-min th{font-size:13px; text-align:center; background-color:#f8f8f8;}
.layui-table-min td{font-size:13px; padding:6px;text-align:center;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form px-4 pt-2" lay-filter="contract">
<div class="layui-tab" style="margin:0;" lay-filter="contract" id="contractTab">
<ul class="layui-tab-title">
<li class="layui-this" data-load="true">合同详情</li>
<li>操作记录</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<table class="layui-table layui-table-form">
{gt name="$detail.pid" value="0"}
<tr>
<td class="layui-td-gray">母合同名称</td>
<td colspan="7">{$detail.pname}</td>
</tr>
{/gt}
<tr>
<td class="layui-td-gray">合同名称</td>
<td colspan="5">{$detail.name}</td>
<td class="layui-td-gray">合同编号</td>
<td>{$detail.code}</td>
</tr>
<tr>
<td class="layui-td-gray">签约主体(乙方)</td>
<td colspan="3">
{volist name=":contract_subject()" id="v"}
{eq name="$v.id" value="$detail.subject_id" }{$v.title}{/eq}
{/volist}
</td>
<td class="layui-td-gray">合同性质</td>
<td>
{eq name="$detail.type" value="1" }普通合同{/eq}
{eq name="$detail.type" value="2" }框架合同{/eq}
{eq name="$detail.type" value="3" }补充协议{/eq}
{eq name="$detail.type" value="4" }其他合同{/eq}
</td>
<td class="layui-td-gray">合同类别</td>
<td>
{volist name=":contract_cate()" id="v"}
{eq name="$v.id" value="$detail.cate_id" }{$v.title}{/eq}
{/volist}
</td>
</tr>
<tr>
<td class="layui-td-gray">客户名称(甲方)</td>
<td colspan="3">{$detail.customer}</td>
<td class="layui-td-gray">签约客户代表</td>
<td>{$detail.customer_name}</td>
<td class="layui-td-gray">客户联系电话</td>
<td>{$detail.customer_mobile}</td>
</tr>
<tr>
<td class="layui-td-gray-2">客户联系地址</td>
<td colspan="3">{$detail.customer_address}</td>
<td class="layui-td-gray-2">合同开始日期</td>
<td>{$detail.start_time}</td>
<td class="layui-td-gray-2">合同结束日期</td>
<td>{$detail.end_time}</td>
</tr>
{neq name="$detail.type" value="2"}
<tr>
<td class="layui-td-gray">合同金额</td>
<td>{$detail.cost}</td>
{eq name="$detail.is_tax" value="1" }
<td class="layui-td-gray">是否含税</td>
<td></td>
<td class="layui-td-gray">税点(百分比)</td>
<td colspan="3">{$detail.tax}%</td>
{/eq}
{eq name="$detail.is_tax" value="0" }
<td class="layui-td-gray">是否含税</td>
<td colspan="5"></td>
{/eq}
</tr>
{/neq}
{notempty name="$detail.remark"}
<tr>
<td class="layui-td-gray">备注信息</td>
<td colspan="7">{$detail.remark}</td>
</tr>
{/notempty}
<tr>
<td class="layui-td-gray">
<div class="layui-input-inline">合同附件</div>
{eq name="$detail.check_status" value="1" }<div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div>{/eq}
</td>
<td colspan="7" id="fileList">
{volist name="$detail.file_array" id="vo"}
<div class="layui-col-md4" id="file_{$vo.id}">
<div class="file-card">
<i class="file-icon layui-icon layui-icon-file"></i>
<div class="file-title">{$vo.name}</div>
<div class="file-tool">
<a href="{$vo.filepath}" download="{$vo.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
<i class="btn-delete layui-icon layui-icon-delete" data-id="{$vo.id}" style="color: #FF5722;" title="删除"></i>
</div>
</div>
</div>
{/volist}
</td>
</tr>
<tr>
<td colspan="8"><strong>签订信息</strong></td>
</tr>
<tr>
<td class="layui-td-gray-2">合同制定人</td>
<td>{$detail.prepared_name} </td>
<td class="layui-td-gray-2">合同签订人</td>
<td>{$detail.sign_name}</td>
<td class="layui-td-gray-2">合同签订时间</td>
<td>{$detail.sign_time}</td>
<td class="layui-td-gray-2">合同签订部门</td>
<td>{$detail.sign_department}</td>
</tr>
<tr>
<td class="layui-td-gray-2">合同保管人</td>
<td>{$detail.keeper_name}{gt name="$auth" value="0"}<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>{/gt}</td>
<td class="layui-td-gray">合同共享人员</td>
<td colspan="5">{$detail.share_names}{gt name="$auth" value="0"}<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>{/gt}</td>
</tr>
<tr>
<td colspan="8"><strong>审核信息</strong></td>
</tr>
<tr>
<td class="layui-td-gray-2">合同状态</td>
<td><span class="layui-color-{$detail.check_status}">{$detail.status_name}</span></td>
<td class="layui-td-gray-2">录入人</td>
<td>{$detail.admin_name} </td>
<td class="layui-td-gray-2">录入时间</td>
<td colspan="3">{$detail.create_time}</td>
</tr>
{notempty name="$check_record"}
<tr>
<td class="layui-td-gray">历史审批记录</td>
<td colspan="7">
<ul class="layui-timeline flow-record pt-2">
{volist name="$check_record" id="vo"}
<li class="layui-timeline-item delete-{$vo.delete_time}">
<i class="layui-icon layui-timeline-axis">&#xe63f;</i>
<p style="padding-left:24px">{$vo.check_time_str}<span class="black ml-2">{$vo.name}</span><span class="mx-2 layui-color-{$vo.status}">{$vo.status_str}</span>了此申请。操作意见:<span class="green">{$vo.content}</span></p>
</li>
{/volist}
</ul>
</td>
</tr>
{/notempty}
{eq name="$detail.check_status" value="3" }
<tr>
<td class="layui-td-gray-2">归档状态</td>
{eq name="$detail.archive_status" value="0" }
<td colspan="7"><span class="layui-color-{$detail.archive_status}">{$detail.archive_status_name}</span></td>
{else/}
<td><span class="layui-color-{$detail.archive_status}">{$detail.archive_status_name}</span></td>
<td class="layui-td-gray-2">归档人</td>
<td>{$detail.archive_name} </td>
<td class="layui-td-gray-2">归档时间</td>
<td colspan="3">{$detail.archive_time}</td>
{/eq}
</tr>
{/eq}
{eq name="$detail.check_status" value="4" }
<tr>
<td class="layui-td-gray-2">中止人</td>
<td>{$detail.stop_name} </td>
<td class="layui-td-gray-2">中止时间</td>
<td colspan="5">{$detail.stop_time}</td>
</tr>
<tr>
<td class="layui-td-gray-2">中止备注</td>
<td colspan="7">{$detail.stop_remark}</td>
</tr>
{/eq}
{eq name="$detail.check_status" value="5" }
<tr>
<td class="layui-td-gray-2">作废人</td>
<td>{$detail.void_name} </td>
<td class="layui-td-gray-2">作废时间</td>
<td colspan="5">{$detail.void_time}</td>
</tr>
<tr>
<td class="layui-td-gray-2">作废备注</td>
<td colspan="7">{$detail.void_remark}</td>
</tr>
{/eq}
</table>
{eq name="$detail.check_status" value="1" }
{include file="/index/view_step" /}
{/eq}
{gt name="$auth" value="0"}
{eq name="$detail.check_status" value="3" }
<div class="py-4">
{eq name="$detail.archive_status" value="1" }
<span class="layui-btn layui-btn-danger" data-event="archive" data-status="0">反确认归档</span>
{else/}
<span class="layui-btn layui-btn-normal" data-event="archive" data-status="1">合同归档</span>
<span class="layui-btn layui-btn-danger" data-event="check" data-status="0">反确认审核</span>
{/eq}
</div>
{/eq}
{eq name="$detail.check_status" value="5" }
<div class="p-4" style="text-align:center;">
<span class="layui-btn layui-btn-danger" data-event="check" data-status="0">反中止合同</span>
</div>
{/eq}
{eq name="$detail.check_status" value="6" }
<div class="p-4" style="text-align:center;">
<span class="layui-btn layui-btn-danger" data-event="check" data-status="0">反作废合同</span>
</div>
{/eq}
{/gt}
</div>
<div class="layui-tab-item">
{include file="/index/view_log" /}
</div>
</div>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const contract_id = '{$detail.id}';
const contract_status = '{$detail.check_status}';
const moduleInit = ['tool','employeepicker'];
function gouguInit() {
var form = layui.form,tool=layui.tool, upload = layui.upload,element = layui.element,employeepicker = layui.employeepicker;
element.on('tab(contract)', function(data){
let index = data.index;
if(index == 1){
log(layui);
}
});
if (typeof (flowStep) == "function") {
flowStep();
}
//选择合同保管人弹窗
$('body').on('click','#keeper',function () {
var ids=$(this).data('ids')+'',names = $(this).data('names')+'';
employeepicker.init({
ids:ids,
names:names,
type:0,
department_url: "/api/index/get_department_tree",
employee_url: "/api/index/get_employee",
callback:function(ids,names,dids,departments){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
location.reload();
}
}
tool.post("/contract/index/add", {'id':contract_id,'keeper_uid':ids,'scene':'change'}, callback);
}
});
});
//选择共享成员弹窗
$('body').on('click','#shares',function () {
var ids=$(this).data('ids')+'',names = $(this).data('names')+'',share_ids_array=[],share_names_array=[];
if(ids.length>0){
share_ids_array=ids.split(',');
share_names_array=names.split(',');
}
employeepicker.init({
ids:share_ids_array,
names:share_names_array,
type:1,
department_url: "/api/index/get_department_tree",
employee_url: "/api/index/get_employee",
callback:function(ids,names,dids,departments){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
location.reload();
}
}
tool.post("/contract/index/add", {'id':contract_id,'share_ids':ids.join(','),'scene':'change'}, callback);
}
});
});
$('body').on('click','[data-event="check"]',function(){
let status = $(this).data('status');
let action = '';
let title = ''
if(contract_status == 2 && status == 0){
title = '确定要反确认该合同的审核?';
action = 'check_refue';
}
if(contract_status == 0 && status == 3){
title = '确定要中止该合同?';
action = 'stop_ok';
}
if(contract_status == 3 && status == 0){
title = '确定要反中止该合同?';
action = 'stop_no';
}
if(contract_status == 0 && status == 4){
title = '确定要作废该合同?';
action = 'void_ok';
}
if(contract_status == 4 && status == 0){
title = '确定要反作废该合同?';
action = 'void_no';
}
layer.confirm(title, {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
parent.layui.pageTable.reload();
setTimeout(function(){
location.reload();
},2000)
}
if(status == 3 || status == 4){
layer.open({
type: 1,
title: '请输入原因或理由',
area: ['800px', '360px'],
content: '<div style="padding:5px;"><textarea class="layui-textarea" id="remarkTextarea" style="width: 100%; height: 240px;"></textarea></div>',
btnAlign: 'c',
btn: ['提交保存'],
yes: function () {
let remark = $("#remarkTextarea").val();
if (remark != '') {
tool.post("/contract/api/check", {id: contract_id,check_status:status,mark:remark}, callback);
} else {
layer.msg('请输入原因或理由');
}
}
})
}
else{
tool.post("/contract/api/check", {id: contract_id,check_status:status,mark:''}, callback);
}
layer.close(index);
});
});
$('body').on('click','[data-event="archive"]',function(){
let status = $(this).data('status');
let title = '合同归档后将不能进行任何数据操作,确定要提交归档?';
layer.confirm(title, {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
parent.layui.pageTable.reload();
setTimeout(function(){
location.reload();
},2000)
}
tool.post("/contract/api/archive", {id: contract_id,archive_status:status}, callback);
layer.close(index);
});
})
//删除附件
$('#fileList').on('click', '.btn-delete', function () {
var _id = $(this).data('id');
layer.confirm('确定要删除该附件吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
$('#file_' + _id).remove();
}
}
tool.delete("/contract/api/delete_file", {id: _id}, callback);
layer.close(index);
});
})
//多附件上传
upload.render({
elem: '#upFile'
,url: "/api/index/upload"
,multiple: true
,accept: 'file' //普通文件
,exts: 'png|jpg|gif|jpeg|doc|docx|ppt|pptx|xls|xlsx|pdf|txt|zip|rar|7z' //只允许上传文件格式
,done: function(res){
if (res.code == 0) {
let callback = function (e) {
layer.msg(e.msg);
let temp = `<div class="layui-col-md4" id="file_${e.data}">
<div class="file-card">
<i class="file-icon layui-icon layui-icon-file"></i>
<div class="file-title">${res.data.name}</div>
<div class="file-tool">
<a href="${res.data.filepath}" download="${res.data.name}" title="下载查看" target="_blank"><i class="layui-icon layui-icon-download-circle" style="color: #12bb37;"></i></a>
<i class="btn-delete layui-icon layui-icon-delete" data-id="${e.data}" style="color: #FF5722;" title="删除"></i>
</div>
</div>
</div>`;
$('#fileList').append(temp);
}
tool.post("/contract/api/add_file", {'contract_id':contract_id,'file_id':res.data.id,'file_name':res.data.name}, callback);
}
else{
layer.msg(res.msg);
}
}
});
}
</script>
{/block}
<!-- /脚本 -->