113 lines
3.7 KiB
JavaScript
113 lines
3.7 KiB
JavaScript
var photos = [];
|
||
var id = localStorage.getItem("id");
|
||
var idNumber = localStorage.getItem("idNumber");
|
||
var layer,form;
|
||
|
||
|
||
|
||
$(function() {
|
||
layui.use(['layer','form'], function () {
|
||
layer = layui.layer;
|
||
form = layui.form;
|
||
});
|
||
$.ajax({
|
||
type: 'POST',
|
||
url: smz_ht_url + '/contract/getPDF',
|
||
data: {id:id,idNumber:idNumber},
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
if(data !="null"){
|
||
getDisPhotoList(data);
|
||
}else{
|
||
getDisPhotoList(null);
|
||
}
|
||
}
|
||
})
|
||
});
|
||
|
||
// 加载图片
|
||
function getDisPhotoList(data) {
|
||
$("#dowebok").empty();
|
||
var jkcnsPath = data.jkcnsPath;
|
||
var urls = data.urls;
|
||
var aqcnsPath = data.aqcnsPath;
|
||
var aqgzsPath = data.aqgzsPath;
|
||
var uploadTime = data.uploadTime;
|
||
|
||
var html="";
|
||
|
||
if(jkcnsPath =="" || jkcnsPath =="null" || jkcnsPath ==null){
|
||
|
||
}else{
|
||
html+="<li class='disPhotoLi'>";
|
||
html += '<img src="../../../../img/fileIcon/pdf.png" style="width: 100%;" alt="" class="file-img" onclick="electronicContractView(\''+id+'\',\''+idNumber+'\',\''+jkcnsPath+'\')"/>';
|
||
html += "<span>施工人员健康承诺书</span> <br>";
|
||
html += "<span>"+uploadTime+"</span>";
|
||
html+=" </li>";
|
||
}
|
||
|
||
if(urls =="" || urls =="null" || urls ==null){
|
||
|
||
}else{
|
||
html+="<li class='disPhotoLi'>";
|
||
html += '<img src="../../../../img/fileIcon/pdf.png" style="width: 100%;" alt="" class="file-img" onclick="electronicContractView(\''+id+'\',\''+idNumber+'\',\''+urls+'\')"/>';
|
||
html += "<span>安全协议书</span> <br>";
|
||
html += "<span>"+uploadTime+"</span>";
|
||
html+=" </li>";
|
||
}
|
||
|
||
if(aqcnsPath =="" || aqcnsPath =="null" || aqcnsPath ==null){
|
||
|
||
}else{
|
||
html+="<li class='disPhotoLi'>";
|
||
html += '<img src="../../../../img/fileIcon/pdf.png" style="width: 100%;" alt="" class="file-img" onclick="electronicContractView(\''+id+'\',\''+idNumber+'\',\''+aqcnsPath+'\')"/>';
|
||
html += "<span>安全承诺书</span> <br>";
|
||
html += "<span>"+uploadTime+"</span>";
|
||
html+=" </li>";
|
||
}
|
||
|
||
if(aqgzsPath =="" || aqgzsPath =="null" || aqgzsPath ==null){
|
||
|
||
}else{
|
||
html+="<li class='disPhotoLi'>";
|
||
html += '<img src="../../../../img/fileIcon/pdf.png" style="width: 100%;" alt="" class="file-img" onclick="electronicContractView(\''+id+'\',\''+idNumber+'\',\''+aqgzsPath+'\')"/>';
|
||
html += "<span>施工人员安全告知书</span> <br>";
|
||
html += "<span>"+uploadTime+"</span>";
|
||
html+=" </li>";
|
||
}
|
||
|
||
|
||
$("#dowebok").append(html);
|
||
}
|
||
|
||
//查看电子合同详情
|
||
function electronicContractView(id,idNumber,url){
|
||
let height = "90%";
|
||
let width = "90%";
|
||
localStorage.setItem("idNumber", idNumber);
|
||
localStorage.setItem("url", url);
|
||
let layerIndex = layer.open({
|
||
id: 'layer-electronicContract',
|
||
title: ['详情', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||
type: 2,
|
||
content: 'contractView.html',
|
||
area: [width, height],
|
||
maxmin: false,
|
||
shadeClose: false, //开启遮罩关闭
|
||
shade: 0.3, //显示遮罩
|
||
move: false,
|
||
resize: false,
|
||
success:function(layero,index){
|
||
// let iframeWin = window["layui-layer-iframe" + layerIndex];
|
||
// iframeWin.setParam(url);
|
||
var iframeWin = window[layero.find('iframe')[0]['name']];//获得iframe页的窗口对象,执行iframe页的方法:
|
||
iframeWin.setParam(url);//调用子页面的方法,页面锁定
|
||
$(window).resize(function () {
|
||
if (autoResizeWidth) autoResizeWidth(index);
|
||
if (autoResizeHeight) autoResizeHeight(index);
|
||
})
|
||
},
|
||
});
|
||
}
|
||
|