2025-11-27 16:55:35 +08:00
|
|
|
|
$(function() {
|
|
|
|
|
|
initTable();
|
|
|
|
|
|
})
|
|
|
|
|
|
function responseHandler(res) {
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
var datas=[];
|
|
|
|
|
|
console.log(res.total);
|
|
|
|
|
|
datas.push({total:res.total,rows:res.list});
|
|
|
|
|
|
return datas[0];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function initTable() {
|
|
|
|
|
|
//初始化Table
|
|
|
|
|
|
$("#table").bootstrapTable({
|
|
|
|
|
|
classes: 'table table-hover',
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'contract/getContractInfo',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
method: 'post',
|
|
|
|
|
|
responseHandler: responseHandler, //处理服务器返回的数据格式
|
|
|
|
|
|
height: $(window).height() - ($(window).height() * 0.13),
|
|
|
|
|
|
undefinedText: '', //当数据为 undefined 时显示的字符
|
|
|
|
|
|
queryParams: function(param) {
|
|
|
|
|
|
param = {
|
|
|
|
|
|
stauts: localStorage.getItem("ContractType"),
|
|
|
|
|
|
proId: localStorage.getItem("ContractProid"),
|
|
|
|
|
|
keyWord:$("#keyWord").val(),
|
|
|
|
|
|
pageSize: param.limit,
|
|
|
|
|
|
pageNum: param.offset / param.limit + 1,
|
|
|
|
|
|
sort: param.sort, //排序列名
|
|
|
|
|
|
sortOrder: param.order //排位命令(desc,asc)
|
|
|
|
|
|
}
|
|
|
|
|
|
return param;
|
|
|
|
|
|
},
|
|
|
|
|
|
sortable: true, //是否启用排序
|
|
|
|
|
|
sortOrder: "asc", //排序方式
|
|
|
|
|
|
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
|
|
pagination: true,
|
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
|
pageSize: 50,
|
|
|
|
|
|
pageList: [50, 100, 200, 300],
|
|
|
|
|
|
smartDisplay: false,
|
|
|
|
|
|
showColumns: false,
|
|
|
|
|
|
sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
|
|
minimumCountColumns: 2, //最少允许的列数
|
|
|
|
|
|
uniqueId: "no", //每一行的唯一标识,一般为主键列
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '序号',
|
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
|
return index + 1;
|
|
|
|
|
|
},
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
width: 50
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '姓名',
|
|
|
|
|
|
field: 'name',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 150
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '身份证',
|
|
|
|
|
|
field: 'idNumber',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 200
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '岗位',
|
|
|
|
|
|
field: 'postName',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '合同生效日期',
|
|
|
|
|
|
field: 'contractValidDate',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 180
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '合同编号',
|
|
|
|
|
|
field: 'contractCode',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 150
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '合同类型',
|
|
|
|
|
|
field: 'contractType',
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '合同文档',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
|
var content = '';
|
|
|
|
|
|
if(row.contractType != null && row.contractType != ''){
|
|
|
|
|
|
content += "<a style='color: dodgerblue;' onclick='showMiurInsurance(\"" + row.contractType +"\",\"" + row.idNumber +"\",\"" + row.url +"\")'>"+row.miurInsurance+"</a>";
|
|
|
|
|
|
}
|
|
|
|
|
|
return content;
|
|
|
|
|
|
},
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '合同签订状态',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
|
var stauts = row.stauts;
|
|
|
|
|
|
var miurInsurance = row.miurInsurance
|
|
|
|
|
|
var color;
|
|
|
|
|
|
// if(miurInsurance == "纸质合同"){
|
|
|
|
|
|
// stauts = "已签订";
|
|
|
|
|
|
// }
|
|
|
|
|
|
if(stauts == "已签订"){
|
|
|
|
|
|
color = '#9BCB6F';
|
|
|
|
|
|
}else if(stauts == "未签订"){
|
|
|
|
|
|
color = '#DD365D';
|
|
|
|
|
|
}else if(stauts == "待审核"){
|
|
|
|
|
|
color = '#F7B669';
|
|
|
|
|
|
}else if(stauts == "待签署"){
|
|
|
|
|
|
color = '#F7B669';
|
|
|
|
|
|
}else if(stauts== "无数据"){
|
|
|
|
|
|
color = '#F7001D';
|
|
|
|
|
|
}
|
|
|
|
|
|
var content = "<span style='color:" + color + "'>" + stauts + "</span>";
|
|
|
|
|
|
return content;
|
|
|
|
|
|
},
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '操作',
|
|
|
|
|
|
field: '',
|
|
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(row.contractType=="电子合同"){
|
|
|
|
|
|
var content = "<a title='合同签订信息' style='cursor:pointer;' class='layui-btn layui-btn-xs' onclick='showContractDetails(\"" + row.idNumber +
|
|
|
|
|
|
"\")'>合同签订信息</a>";
|
|
|
|
|
|
return content;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
rowspan: 1,
|
|
|
|
|
|
align: 'center',
|
|
|
|
|
|
valign: 'middle',
|
|
|
|
|
|
sortable: true,
|
|
|
|
|
|
width: 100
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
onLoadSuccess: function(data) {
|
|
|
|
|
|
top.layer.close(index);
|
|
|
|
|
|
$("#dataCount").html("数量:" + data.total);
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoadError: function() {
|
|
|
|
|
|
$("#dataCount").html("数量:0");
|
|
|
|
|
|
$("#table").bootstrapTable('removeAll');
|
|
|
|
|
|
top.layer.close(index);
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
var index;
|
|
|
|
|
|
// 模糊查询数据、重置查询
|
|
|
|
|
|
function query(type) {
|
|
|
|
|
|
index = top.layer.load(0, {
|
|
|
|
|
|
shade: false
|
|
|
|
|
|
}); // 0代表加载的风格,支持0-2
|
|
|
|
|
|
var keyWord = $("#keyWord").val();
|
|
|
|
|
|
$("#query").css("background-image", "url(../../img/info/queryClick.png)");
|
|
|
|
|
|
$("#reset").css("background-image", "url(../../img/info/resetQuery.png)");
|
|
|
|
|
|
var opt = {
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'contract/getContractInfo',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
silent: true,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
keyWord: keyWord
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
if (type == 2) {
|
|
|
|
|
|
$("#query").css("background-image", "url(../../img/info/query.png)");
|
|
|
|
|
|
$("#reset").css("background-image", "url(../../img/info/resetQueryClick.png)");
|
|
|
|
|
|
$("#keyWord").val("");
|
|
|
|
|
|
opt = {
|
2025-12-09 18:44:29 +08:00
|
|
|
|
url: smz_web_url + 'contract/getContractInfo',
|
2025-11-27 16:55:35 +08:00
|
|
|
|
silent: true,
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#table").bootstrapTable('refresh', opt);
|
|
|
|
|
|
initTable();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//电子合同详情
|
|
|
|
|
|
function showContractDetails(idNumber){
|
|
|
|
|
|
localStorage.setItem("idNumber", idNumber);
|
|
|
|
|
|
var index = top.layer.open({
|
|
|
|
|
|
title: false,
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: '../../page/contract/contractDetails.html',
|
|
|
|
|
|
area: ['80%', '80%'],
|
|
|
|
|
|
maxmin: false
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//PDF/Photo
|
|
|
|
|
|
function showMiurInsurance(contractType,idNumber,url){
|
|
|
|
|
|
console.log(idNumber);
|
|
|
|
|
|
localStorage.setItem("idNumber", idNumber);
|
2025-12-09 18:44:29 +08:00
|
|
|
|
localStorage.setItem("url", smz_web_url + url);
|
2025-11-27 16:55:35 +08:00
|
|
|
|
|
|
|
|
|
|
if(contractType=="电子合同"){
|
|
|
|
|
|
top.layer.open({
|
|
|
|
|
|
title: false,
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: '../../page/contract/contractView.html',
|
|
|
|
|
|
area: ['80%', '80%'],
|
|
|
|
|
|
maxmin: false
|
|
|
|
|
|
});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
top.layer.open({
|
|
|
|
|
|
title: false,
|
|
|
|
|
|
type: 2,
|
|
|
|
|
|
content: '../../page/contract/contractPhoto.html',
|
|
|
|
|
|
area: ['80%', '80%'],
|
|
|
|
|
|
maxmin: false
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|