2025-11-27 16:55:35 +08:00
|
|
|
|
var contractPreviewData = localStorage.getItem("contractPreviewData");
|
2025-12-05 15:39:43 +08:00
|
|
|
|
var token = localStorage.getItem("smz-token");
|
2025-11-27 16:55:35 +08:00
|
|
|
|
var form
|
|
|
|
|
|
var contractId;
|
|
|
|
|
|
function selectDetail(id){
|
|
|
|
|
|
contractId = id;
|
|
|
|
|
|
layui.use(['layer', 'laydate', 'form'], function () {
|
|
|
|
|
|
form = layui.form;
|
|
|
|
|
|
form.render();
|
|
|
|
|
|
form.verify();
|
|
|
|
|
|
pers = checkPermission();
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type: 'get',
|
|
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
|
|
url: ctxPath + '/teamSmallBagDryTreaty/getDataDetail',
|
|
|
|
|
|
data: {"contractId":id},
|
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
if (data.res === 1){
|
|
|
|
|
|
setData(data.obj)
|
|
|
|
|
|
layui.form.render();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
layer.msg("未查询到", { icon: 2, time: 2000 });
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
error: function (xhr, status, error) {
|
|
|
|
|
|
console.error("请求失败:", error);
|
|
|
|
|
|
layer.msg("网络异常,请重试", { icon: 5, time: 2000 });
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setData(data){
|
|
|
|
|
|
$("#contractCode").val(data.contractCode);
|
|
|
|
|
|
$("#proName").val(data.proName);
|
|
|
|
|
|
$("#proName1").val(data.proName);
|
|
|
|
|
|
$("#subName").val(data.subName);
|
|
|
|
|
|
$("#subName1").val(data.subName);
|
|
|
|
|
|
$("#partyUser").val(data.partyUser);
|
|
|
|
|
|
$("#partyUser1").val(data.partyUser);
|
|
|
|
|
|
|
|
|
|
|
|
$("#contractDate").val(data.contractDate);
|
|
|
|
|
|
$("#contractLocation").val(data.contractLocation);
|
|
|
|
|
|
$("#proLocation").val(data.proLocation);
|
|
|
|
|
|
$("#proScale").val(data.proScale);
|
|
|
|
|
|
|
|
|
|
|
|
$("#planStartTime").val(data.planStartTime);
|
|
|
|
|
|
$("#planEndTime").val(data.planEndTime);
|
|
|
|
|
|
$("#contractMoney").val(data.contractMoney);
|
|
|
|
|
|
$("#contractMoneyMax").val(data.contractMoneyMax);
|
|
|
|
|
|
|
|
|
|
|
|
if (data.partyaImage) {
|
|
|
|
|
|
$("#partyaImage").html(`<img src="${dataPath + '/' + data.partyaImage}" style="max-width:200px;">`);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (data.partybImage) {
|
|
|
|
|
|
$("#partybImage").html(`<img src="${dataPath + '/' + data.partybImage}" style="max-width:200px;">`);
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#partyaTime").val(data.partyaTime);
|
|
|
|
|
|
$("#partybTime").val(data.partybTime);
|
|
|
|
|
|
|
|
|
|
|
|
// 工序列表展示(gxList)
|
|
|
|
|
|
if (data.gxList && data.gxList.length > 0) {
|
|
|
|
|
|
let html = '';
|
|
|
|
|
|
data.gxList.forEach(gx => {
|
|
|
|
|
|
html += `${gx.gxName}工序${gx.gxZw}桩位<br>`;
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#selectedProcessAndPile").html(html);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$("#gxInfo").val(data.gxInfo)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function reloading() {
|
|
|
|
|
|
var index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
|
|
|
|
|
parent.layer.close(index); //再执行关闭
|
|
|
|
|
|
|
|
|
|
|
|
var index2 = parent.parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
|
|
|
|
|
parent.parent.layer.close(index2); //再执行关闭
|
|
|
|
|
|
window.parent.location.reload();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function downloadContract() {
|
|
|
|
|
|
var url = ctxPath + "/teamSmallBagDryTreaty/downloadContract?contractId=" + contractId + "&downloadType=1" + "&token=" + token;
|
|
|
|
|
|
var link = document.createElement("a");
|
|
|
|
|
|
link.href = url;
|
|
|
|
|
|
link.download ; // 设置文件名并指定为 .pdf
|
|
|
|
|
|
document.body.appendChild(link);
|
|
|
|
|
|
link.click();
|
|
|
|
|
|
document.body.removeChild(link);
|
|
|
|
|
|
}
|