yn_hxy_web/hxy-web/js/wireManager/viewResult/viewResultUpdate.js

1043 lines
38 KiB
JavaScript
Raw Normal View History

2024-09-11 09:03:03 +08:00
var table, form, layer, laydate, element;
var currentDate = new Date();
2024-09-11 09:03:03 +08:00
var tabList = [];
var month = currentDate.getMonth() + 1; //当前第几月
var year = currentDate.getFullYear();
2024-09-11 09:03:03 +08:00
var resultMonth = localStorage.getItem("resultMakeMonth");
2024-08-20 10:42:21 +08:00
var resultUserId;
var resultProId;
2024-09-11 09:03:03 +08:00
layui.use(['form', 'layer', 'table', 'laydate', 'element'], function() {
table = layui.table;
form = layui.form;
layer = layui.layer;
laydate = layui.laydate;
element = layui.element;
// 渲染时间选择器
laydate.render({
elem: '#month', //指定元素 元素选择器
type: 'month', //选择时间类型 可选值:year(年) month(年月) date(年月日) time(时分秒) datetime(年月日时分秒)
trigger: 'click',
min: firstDayStr(),
max: lastDayStr(),
format: 'yyyy-MM',
btns: ['now', 'confirm'], //选择框右下角显示的按钮 清除-现在-确定
value: formatCurrentMonth(), // 如果你想预设当前日期为选中状态
done: function(value, date) { //时间回调
console.log("date:", date);
resultMonth = value;
init(date.year, date.month);
}
});
$("#month").val(resultMonth);
2024-08-20 10:42:21 +08:00
setData()
2024-09-11 09:03:03 +08:00
let result = getYearMonth(resultMonth);
init(result.oldYear, result.oldMonth);
});
2024-09-11 09:03:03 +08:00
function firstDayStr() {
2024-08-26 09:00:01 +08:00
var today = new Date();
2024-09-11 09:03:03 +08:00
var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth - 1, 2);
var firstDayString = firstDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
// 当月的最后一天
var lastDay = new Date(year, thisMonth + 1, 1);
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
console.log("First day of this month: " + firstDayString);
return firstDayString;
2024-08-26 09:00:01 +08:00
}
2024-09-11 09:03:03 +08:00
function lastDayStr() {
2024-08-26 09:00:01 +08:00
var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份
// 当月的第一天
var firstDay = new Date(year, thisMonth, 1);
var firstDayString = firstDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
// 当月的最后一天
var lastDay = new Date();
var lastDayString = lastDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
2024-09-11 09:03:03 +08:00
return lastDayString;
2024-08-26 09:00:01 +08:00
}
2024-09-11 09:03:03 +08:00
function currMonth() {
2024-08-26 09:00:01 +08:00
var lastDay = new Date();
2024-09-11 09:03:03 +08:00
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM格式
return lastDayString;
2024-08-26 09:00:01 +08:00
}
2024-09-11 09:03:03 +08:00
function currUpdateMonth(update) {
var lastDay = new Date();
lastDay.setMonth(lastDay.getMonth() + update);
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM格式
return lastDayString;
}
//工程切换
2024-09-11 09:03:03 +08:00
function projectTab(event, proId) {
resultProId = proId;
localStorage.setItem("resultProId", resultProId);
console.log(resultProId, 'resultProId')
//修改所点工程样式
$("#projects>div").removeClass("projectsStyle");
$(event).addClass("projectsStyle")
getView();
let result = getYearMonth(resultMonth);
// init(result.oldYear,result.oldMonth);
getSpecial(result.oldYear, result.oldMonth);
}
function formatCurrentMonth() {
2024-09-11 09:03:03 +08:00
var date = new Date();
var month = date.getMonth() + 1; // 注意月份是从0开始的所以加1
return date.getFullYear() + '-' + (month < 10 ? '0' + month : month);
}
/**
* 初始化数据
*/
2024-09-11 09:03:03 +08:00
function init(chosenYear, chosenMonth) {
layui.use(['table'], function() {
2024-08-20 10:42:21 +08:00
getTab(chosenMonth)
2024-09-11 09:03:03 +08:00
if (resultMonth != currMonth() && resultMonth != currUpdateMonth(-1) ) {
$("#normalInspectionUpload").css("display", "none")
2024-08-26 09:00:01 +08:00
getViewc();
2024-09-11 09:03:03 +08:00
} else {
$("#normalInspectionUpload").css("display", "")
2024-08-26 09:00:01 +08:00
getView();
}
2024-09-11 09:03:03 +08:00
getSpecial(chosenYear, chosenMonth)
})
}
2024-09-11 09:03:03 +08:00
function getSpecial(chosenYear, chosenMonth) {
2024-08-20 10:42:21 +08:00
let table = layui.table;
let daysInMonth = new Date(chosenYear, chosenMonth, 0).getDate();
console.log(daysInMonth)
let tableData = []
2024-09-11 09:03:03 +08:00
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getSpecialData",
dataType: 'json',
async: false,
data: {
userId: localStorage.getItem("resultUserId"),
proId: localStorage.getItem("resultProId"),
makeMonth: resultMonth
},
success: function(data) {
console.log(data, "resultSpecial");
var isWorkData = [];
$.each(data.data, function(index, item) {
2024-08-20 10:42:21 +08:00
isWorkData.push(item.makeTime)
})
2024-09-11 09:03:03 +08:00
var isWork = {};
isWork.isWork = isWorkData;
2024-08-20 10:42:21 +08:00
tableData.push(isWork);
2024-09-11 09:03:03 +08:00
},
error: function(e) {
2024-08-20 10:42:21 +08:00
}
})
let cols = []
for (let k = 1; k <= daysInMonth; k++) {
2024-09-11 09:03:03 +08:00
let str = chosenMonth + '.' + k;
let obj = {
field: 'isWork',
title: str,
align: 'center',
width: 70,
templet: function(d) {
if (d.isWork.includes(d.LAY_COL.title)) {
return `<i class="layui-icon" style="color: red;">&#xe605;</i> `
} else {
return `<apan></apan>`
}
}
}
cols.push(obj)
2024-08-20 10:42:21 +08:00
}
2024-09-11 09:03:03 +08:00
console.log(tableData, "tableData");
2024-08-20 10:42:21 +08:00
table.render({
2024-09-11 09:03:03 +08:00
elem: '#isWorkList',
// url: "/sys/achievement",
// where: obj,
//skin: 'line', // 横向边框线
cols: [cols],
data: tableData
2024-08-20 10:42:21 +08:00
});
}
2024-09-11 09:03:03 +08:00
function getTab(chosenMonth) {
tabList = [{
id: '1',
projectName: 'xxx工程1'
}, {
id: '2',
projectName: 'xxx工程2'
}, {
id: '3',
projectName: 'xxx工程3'
}, {
id: '4',
projectName: 'xxx工程4'
}]
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getProByUser",
dataType: 'json',
async: false,
data: {
id: localStorage.getItem("resultUserId")
},
success: function(data) {
tabList = data.data;
},
error: function(e) {
2024-08-20 10:42:21 +08:00
}
})
2024-09-11 09:03:03 +08:00
// projectList
$("#projects").empty()
let html = ``
for (let i = 0; i < tabList.length; i++) {
var className = ""
2024-09-11 09:03:03 +08:00
if (i == 0) {
className = "projectsStyle";
2024-09-11 09:03:03 +08:00
localStorage.setItem("resultProId", tabList[i].id);
}
2024-08-20 10:42:21 +08:00
html += `<div class="${className}" onclick="projectTab(this,${tabList[i].id})">
<span id="${tabList[i].id}">${tabList[i].proName}</span>
</div>`
2024-09-11 09:03:03 +08:00
}
$("#projects").append(html);
}
2024-09-11 09:03:03 +08:00
function getView() {
// ①已上传:展示修改、删除图标,上传日期不可选择,照片信息,杆塔号;颜色为“#52C1F5”
// ②未上传:展示上传图标,上传日期可选择,杆塔号,颜色为“#F56C6C”
// ③巡护段外:展示修改、删除图标,上传日期不可选择,照片信息,工程名称,杆塔号;颜色为“#FF9900”
// ④特巡/值守:展示修改、删除图标,上传日期不可选择,照片信息,备注;颜色为“#73A0FA”
// ⑤正在编辑:修改图标绿色背景,可重新上传照片、重新选择日期,编辑即边框闪烁;
2024-09-11 09:03:03 +08:00
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getById",
dataType: 'json',
async: false,
data: {
userId: localStorage.getItem("resultUserId"),
makeMonth: resultMonth,
proId: localStorage.getItem("resultProId")
},
success: function(data) {
console.log(data, "result");
viewList1 = data.mgtListone;
photoList1 = data.vgtListone;
viewList2 = data.mgtListtwo;
photoList2 = data.vgtListtwo;
viewList3 = data.mgtListspe;
photoList3 = data.mgtListspe;
},
error: function(e) {
2024-08-20 10:42:21 +08:00
}
})
2024-09-11 09:03:03 +08:00
$("#inspectionTourContent").empty();
//杆塔集合
2024-09-11 09:03:03 +08:00
// viewList1 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-20 10:42:21 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// //照片集合
2024-09-11 09:03:03 +08:00
var filePath =
'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg';
var sFilePath = '../../../image/viewImg.jpg';
2024-08-20 10:42:21 +08:00
// photoList1 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
2024-09-11 09:03:03 +08:00
let html = ``;
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第一次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#999999">若需上传负责区域之外的杆塔请点击</span>
<span style="color:#0000FF;cursor: pointer;" onclick="patrolOutsideAdd()">巡护段外上传>></span>
</div>
<div id="firstViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList1.length; i++) {
var gtName = viewList1[i].gtName.length > 4 ? viewList1[i].gtName.substring(0, 4) + '...' : viewList1[i].gtName;
html += `<div class="viewBox">
2024-08-20 21:29:46 +08:00
<div style="width: 100%;height:100%">`
2024-09-11 09:03:03 +08:00
var ystate = 0;
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
ystate = 1;
break;
}
}
if ("1" == viewList1[i].makeType) {
html += `<div class="viewHeader" style="background-color: #FF9900;">`
} else if (ystate == 0) {
html += `<div class="viewHeader" style="background-color: #F56C6C;">`
} else {
html += `<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `<img src="../../../image/tower_white.png" alt="">
2024-08-27 21:11:57 +08:00
<span style="width: 33%;" title="${viewList1[i].gtName}">${gtName}</span> `
2024-09-11 09:03:03 +08:00
if ("1" == viewList1[i].state || "1" == viewList1[i].makeType) {
html += `
2024-08-27 21:11:57 +08:00
<img src="../../../image/edit_white.png" onclick="towerEdit(this,${viewList1[i].gtId},1)" style="cursor: pointer;width: 14px;height:16px" alt="">
<img src="../../../image/del_white.png" onclick="towerDel(this,${viewList1[i].gtId},1)" style="cursor: pointer;width: 14px;height:16px" alt="">
`
2024-09-11 09:03:03 +08:00
}
html += `</div>
<div class="viewContent">`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">`
flag = true;
break;
}
}
var usernamed = $("#username").text();
if (!flag) {
//照片不存在,显示上传照片按钮
if ("1" == viewList1[i].state) {
html +=
`<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">`
html += `<div style="color:#cccccc">上传图片</div>`
} else {
html +=
`<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" >`
html += `<div style="color:#cccccc">该杆塔不属于${usernamed}管辖</div>`
}
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
2024-08-20 21:29:46 +08:00
<button class="layui-btn" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
2024-08-20 10:42:21 +08:00
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
html += `${photoList1[j].makeTime}`
break;
}
}
html += `</div>
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
html += `</div>`;
2024-09-11 09:03:03 +08:00
// viewList2 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-20 10:42:21 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList2 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第二次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>
</div>
<div id="secondViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList2.length; i++) {
var gtName = viewList2[i].gtName.length > 4 ? viewList2[i].gtName.substring(0, 4) + '...' : viewList2[i].gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
2024-08-20 21:29:46 +08:00
`
2024-09-11 09:03:03 +08:00
var ystate = 0;
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
ystate = 1;
break;
}
}
if ("1" == viewList2[i].makeType) {
html += `<div class="viewHeader" style="background-color: #FF9900;">`
} else if (ystate == 0) {
html += `<div class="viewHeader" style="background-color: #F56C6C;">`
} else {
html += `<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `
<img src="../../../image/tower_white.png" alt="">
2024-08-20 10:42:21 +08:00
<span style="width: 33%;" title="${viewList2[i].gtName}">${gtName}</span>
2024-08-27 21:11:57 +08:00
`
2024-09-11 09:03:03 +08:00
if ("1" == viewList2[i].state || "1" == viewList2[i].makeType) {
html += `
<img src="../../../image/edit_white.png" onclick="towerEdit(this,${viewList2[i].gtId},1)" style="cursor: pointer;width: 14px;height:16px" alt="">
<img src="../../../image/del_white.png" onclick="towerDel(this,${viewList2[i].gtId},1)" style="cursor: pointer;width: 14px;height:16px" alt="">
2024-08-27 21:11:57 +08:00
`
2024-09-11 09:03:03 +08:00
}
html += `</div>
2024-08-20 10:42:21 +08:00
<div class="viewContent">`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">`
flag = true;
break;
}
}
var usernamed = $("#username").text();
if (!flag) {
//照片不存在,显示上传照片按钮
if ("1" == viewList2[i].state) {
html +=
`<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">`
html += `<div style="color:#cccccc">上传图片</div>`
} else {
html +=
`<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" >`
html += `<div style="color:#cccccc">该杆塔不属于${usernamed}管辖</div>`
}
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
2024-08-26 09:00:01 +08:00
<button class="layui-btn" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
2024-08-20 10:42:21 +08:00
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
html += `${photoList2[j].makeTime}`
break;
}
}
html += `
</div>
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
html += `</div>`;
2024-09-11 09:03:03 +08:00
// viewList3 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-20 10:42:21 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList3 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>特巡 / 值守
</div>
<div style="width: 94%;height: 150px;overflow: auto;margin-left: 1.8%;">
<table id="isWorkList" class="layui-table" lay-skin="row" style="width:100%;"></table>
</div>
<div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList3.length; i++) {
var gtName = viewList3[i].gtName.length > 11 ? viewList3[i].gtName.substring(0, 11) + '...' : viewList3[i]
.gtName;
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
2024-08-26 09:00:01 +08:00
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
<img src="../../../image/tower_white.png" alt="">
2024-08-20 10:42:21 +08:00
<span style="width: 33%;" title="${viewList3[i].gtName}">${gtName}</span>
2024-08-27 21:11:57 +08:00
<img src="../../../image/edit_white.png" onclick="towerSpeciaEdit(this,${viewList3[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
2024-08-20 21:29:46 +08:00
<img src="../../../image/del_white.png" onclick="towerSpecialDel(this,${viewList3[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
</div>
<div class="viewContent">
2024-08-20 10:42:21 +08:00
`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">`
flag = true;
break;
}
}
if (!flag) {
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" ">
2024-08-20 10:42:21 +08:00
<div style="color:#cccccc">上传图片</div>`
2024-09-11 09:03:03 +08:00
}
html += `
<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
2024-08-26 09:00:01 +08:00
<button class="layui-btn" onclick="uploadSpecialPhoto(${viewList3[i].gtId})">>
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;
2024-08-20 10:42:21 +08:00
`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示
html += `${photoList3[j].makeTime}`
break;
}
}
html += `
</div>
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
html += `</div>`;
2024-09-11 09:03:03 +08:00
$("#inspectionTourContent").append(html);
}
2024-09-11 09:03:03 +08:00
function getViewc() {
2024-08-26 09:00:01 +08:00
// ①已上传:展示修改、删除图标,上传日期不可选择,照片信息,杆塔号;颜色为“#52C1F5”
// ②未上传:展示上传图标,上传日期可选择,杆塔号,颜色为“#F56C6C”
// ③巡护段外:展示修改、删除图标,上传日期不可选择,照片信息,工程名称,杆塔号;颜色为“#FF9900”
// ④特巡/值守:展示修改、删除图标,上传日期不可选择,照片信息,备注;颜色为“#73A0FA”
// ⑤正在编辑:修改图标绿色背景,可重新上传照片、重新选择日期,编辑即边框闪烁;
2024-09-11 09:03:03 +08:00
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getById",
dataType: 'json',
async: false,
data: {
userId: localStorage.getItem("resultUserId"),
makeMonth: resultMonth,
proId: localStorage.getItem("resultProId")
},
success: function(data) {
console.log(data, "result");
viewList1 = data.mgtListone;
photoList1 = data.vgtListone;
viewList2 = data.mgtListtwo;
photoList2 = data.vgtListtwo;
viewList3 = data.mgtListspe;
photoList3 = data.mgtListspe;
},
error: function(e) {
2024-08-20 10:42:21 +08:00
}
})
2024-09-11 09:03:03 +08:00
2024-08-26 09:00:01 +08:00
$("#inspectionTourContent").empty();
//杆塔集合
2024-09-11 09:03:03 +08:00
// viewList1 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-26 09:00:01 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// //照片集合
2024-09-11 09:03:03 +08:00
var filePath =
'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg';
var sFilePath = '../../../image/viewImg.jpg';
2024-08-26 09:00:01 +08:00
// photoList1 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
2024-09-11 09:03:03 +08:00
let html = ``;
2024-08-26 09:00:01 +08:00
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第一次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#999999">若需上传负责区域之外的杆塔请点击</span>
<span style="color:#0000FF;cursor: pointer;" onclick="patrolOutsideAdd()">巡护段外上传>></span>
</div>
<div id="firstViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList1.length; i++) {
var gtName = viewList1[i].gtName.length > 4 ? viewList1[i].gtName.substring(0, 4) + '...' : viewList1[i].gtName;
2024-08-26 09:00:01 +08:00
html += `<div class="viewBox">
<div style="width: 100%;height:100%">`
2024-09-11 09:03:03 +08:00
var ystate = 0;
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
ystate = 1;
break;
}
}
if ("1" == viewList1[i].makeType) {
html += `<div class="viewHeader" style="background-color: #FF9900;">`
} else if (ystate == 0) {
html += `<div class="viewHeader" style="background-color: #F56C6C;">`
} else {
html += `<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `<img src="../../../image/tower_white.png" alt="">
2024-08-26 09:00:01 +08:00
<span style="width: 33%;" title="${viewList1[i].gtName}">${gtName}</span>
</div>
<div class="viewContent">`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">`
flag = true;
break;
}
}
if (!flag) {
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">
2024-08-26 09:00:01 +08:00
<div style="color:#cccccc">上传图片</div>`
2024-09-11 09:03:03 +08:00
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
2024-08-26 09:00:01 +08:00
<button class="layui-btn" onclick="uploadPhoto(${viewList1[i].gtId},1,${viewList1[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示
html += `${photoList1[j].makeTime}`
break;
}
}
html += `</div>
2024-08-26 09:00:01 +08:00
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
2024-08-26 09:00:01 +08:00
html += `</div>`;
2024-09-11 09:03:03 +08:00
// viewList2 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-26 09:00:01 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList2 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>
<span style="color:#666666">正常巡视-第二次巡视</span>
<span style="color:#F56C6C">(负责的巡护区段杆塔)</span>
</div>
<div id="secondViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList2.length; i++) {
var gtName = viewList2[i].gtName.length > 4 ? viewList2[i].gtName.substring(0, 4) + '...' : viewList2[i].gtName;
2024-08-26 09:00:01 +08:00
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
`
2024-09-11 09:03:03 +08:00
var ystate = 0;
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
ystate = 1;
break;
}
}
if ("1" == viewList2[i].makeType) {
html += `<div class="viewHeader" style="background-color: #FF9900;">`
} else if (ystate == 0) {
html += `<div class="viewHeader" style="background-color: #F56C6C;">`
} else {
html += `<div class="viewHeader" style="background-color: #52C1F5;">`
}
html += `
2024-08-26 09:00:01 +08:00
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList2[i].gtName}">${gtName}</span>
</div>
<div class="viewContent">`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">`
flag = true;
break;
}
}
if (!flag) {
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
2024-08-26 09:00:01 +08:00
<div style="color:#cccccc">上传图片</div>`
2024-09-11 09:03:03 +08:00
}
html += `<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
2024-08-26 09:00:01 +08:00
<button class="layui-btn" onclick="uploadPhoto(${viewList2[i].gtId},2,${viewList2[i].makeType})">
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示
html += `${photoList2[j].makeTime}`
break;
}
}
html += `
2024-08-26 09:00:01 +08:00
</div>
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
2024-08-26 09:00:01 +08:00
html += `</div>`;
2024-09-11 09:03:03 +08:00
// viewList3 = [{id:"1",name:"#1"},{id:"2",name:'#2'},{id:"3",name:'#3'},{id:"4",name:'#4'},{id:"5",name:'#5'},{id:"6",name:'#6'},
2024-08-26 09:00:01 +08:00
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// photoList3 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
// {name:'#6', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}]
html += `<div style="width: 90%;height: 30px;font-weight: bold;">
<span style="border: 3px solid #409EFF;width: 20px;height: 10px;margin-left: 2%;margin-right: 1%;"></span>特巡 / 值守
</div>
<div style="width: 94%;height: 150px;overflow: auto;margin-left: 1.8%;">
<table id="isWorkList" class="layui-table" lay-skin="row" style="width:100%;"></table>
</div>
<div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
2024-09-11 09:03:03 +08:00
for (let i = 0; i < viewList3.length; i++) {
var gtName = viewList3[i].gtName.length > 11 ? viewList3[i].gtName.substring(0, 11) + '...' : viewList3[i]
.gtName;
2024-08-26 09:00:01 +08:00
html += `<div class="viewBox">
<div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
<img src="../../../image/tower_white.png" alt="">
<span style="width: 33%;" title="${viewList3[i].gtName}">${gtName}</span>
<img src="../../../image/edit_white.png" onclick="towerSpeciaEdit(this,${viewList1[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
<img src="../../../image/del_white.png" onclick="towerSpecialDel(this,${viewList3[i].gtId},3)" style="cursor: pointer;width: 14px;height:16px" alt="">
</div>
<div class="viewContent">
`
2024-09-11 09:03:03 +08:00
var flag = false;
for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示
html +=
`<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">`
flag = true;
break;
}
}
if (!flag) {
//照片不存在,显示上传照片按钮
html += `<img src="../../../image/add2.png" style="width:150px;height:150px;border: 1px solid #E9E9E9;backgroubd:#F9F9F9;cursor: pointer;margin-top: 10px;" alt="" ">
2024-08-26 09:00:01 +08:00
<div style="color:#cccccc">上传图片</div>`
2024-09-11 09:03:03 +08:00
}
html += `
2024-08-26 09:00:01 +08:00
<div style="display: none;align-items: center;justify-content: center;position: relative;top:-100%;width:100%;height:100%;z-index:99;background-color: rgba(0,0,0,.2)">
<button class="layui-btn" onclick="uploadSpecialPhoto(${viewList3[i].gtId})">>
<i class="layui-icon layui-icon-refresh-3"></i>
重新上传
</button>
</div>
</div>
<div class="viewFooter">
<img src="../../../image/calendarIcon.png" width="18">&nbsp;&nbsp;
`
2024-09-11 09:03:03 +08:00
for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示
html += `${photoList3[j].makeTime}`
break;
}
}
html += `
2024-08-26 09:00:01 +08:00
</div>
</div>
</div>`
2024-09-11 09:03:03 +08:00
}
2024-08-26 09:00:01 +08:00
html += `</div>`;
2024-09-11 09:03:03 +08:00
$("#inspectionTourContent").append(html);
}
2024-08-26 09:00:01 +08:00
2024-09-11 09:03:03 +08:00
function towerSpeciaEdit(event, id, numTimes) {
2024-08-26 09:00:01 +08:00
var color = $(event).css("background-color");
//通过按钮样式判断按钮状态
2024-09-11 09:03:03 +08:00
if (color == "rgb(22, 186, 170)") {
2024-08-26 09:00:01 +08:00
//此为编辑状态
//呼吸灯效果
$(event).parent().parent().removeClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "");
//展示编辑按钮
2024-09-11 09:03:03 +08:00
$(event).parent().next().children("div").css("display", "none")
} else {
2024-08-26 09:00:01 +08:00
//常规状态
//呼吸灯效果
$(event).parent().parent().addClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "#16BAAA");
//展示编辑按钮
2024-09-11 09:03:03 +08:00
$(event).parent().next().children("div").css("display", "flex")
2024-08-26 09:00:01 +08:00
}
}
2024-09-11 09:03:03 +08:00
function uploadSpecialPhoto(id) {
2024-08-26 09:00:01 +08:00
let height = '70%';
let width = '60%';
var index = parent.layer.open({
2024-09-11 09:03:03 +08:00
title: ['上传特巡', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './uploadSpecialPhoto.html',
area: [width, height],
maxmin: false,
success: function(layero, index) {
var myIframe = parent.window[layero.find('iframe')[0]['name']];
myIframe.setGtId(id, resultMonth, 3, localStorage.getItem("resultUserId"), 3, localStorage
.getItem("resultProId"));
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
2024-08-26 09:00:01 +08:00
});
}
//文件查看
//查看附件详情
function filePreView(url) {
2024-09-11 09:03:03 +08:00
if (url != "" && url != null) {
var suffix = url.split(".")[1];
if (url.includes("mp4")) {
localStorage.setItem("filePath", url);
var height = '99%';
var width = '70%';
var index = parent.layer.open({
title: ["查看", 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: '../../videoPlay.html',
area: [width, height],
maxmin: false
});
} else {
localStorage.setItem("filePath", url);
// localStorage.setItem("fileName", fileName);
// localStorage.setItem("fileTime", time);
var height = '99%';
var width = '70%';
var index = parent.layer.open({
title: ["查看", 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: '../../photoView.html',
area: [width, height],
maxmin: false
});
}
}
}
//杆塔信息编辑
2024-09-11 09:03:03 +08:00
function towerEdit(event, id, numTimes) {
var color = $(event).css("background-color");
//通过按钮样式判断按钮状态
2024-09-11 09:03:03 +08:00
if (color == "rgb(22, 186, 170)") {
//此为编辑状态
//呼吸灯效果
$(event).parent().parent().removeClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "");
//展示编辑按钮
2024-09-11 09:03:03 +08:00
$(event).parent().next().children("div").css("display", "none")
} else {
//常规状态
//呼吸灯效果
$(event).parent().parent().addClass("arrow_box");
//修改按钮背景颜色
$(event).css("background-color", "#16BAAA");
//展示编辑按钮
2024-09-11 09:03:03 +08:00
$(event).parent().next().children("div").css("display", "flex")
}
2024-09-11 09:03:03 +08:00
}
//杆塔信息删除
2024-09-11 09:03:03 +08:00
function towerDel(event, id, numTimes) {
layer.confirm("确定删除吗?", function(index) {
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/delGtId",
dataType: 'json',
async: false,
data: {
gtId: id,
makeMonth: resultMonth,
numTimes: numTimes,
userId: localStorage.getItem("resultUserId")
},
success: function(data) {
console.log(data, "确定删除");
if (data.code == 500) {
2024-08-20 21:29:46 +08:00
layer.msg(data.msg)
2024-09-11 09:03:03 +08:00
} else {
2024-08-20 21:29:46 +08:00
setData()
getView()
2024-09-11 09:03:03 +08:00
getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ?
resultMonth.substring(5, 7).replace("0", "") : resultMonth.substring(5,
7));
2024-08-20 21:29:46 +08:00
layer.close(index);
}
2024-09-11 09:03:03 +08:00
},
error: function(e) {
2024-08-20 21:29:46 +08:00
}
})
})
}
2024-09-11 09:03:03 +08:00
function towerSpecialDel(event, id, numTimes) {
layer.confirm("确定删除吗?", function(index) {
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/delGtId",
dataType: 'json',
async: false,
data: {
id: id,
numTimes: numTimes
},
success: function(data) {
console.log(data, "确定删除");
if (data.code == 500) {
2024-08-20 21:29:46 +08:00
layer.msg(data.msg)
2024-09-11 09:03:03 +08:00
} else {
2024-08-20 21:29:46 +08:00
setData()
getView()
2024-09-11 09:03:03 +08:00
getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ?
resultMonth.substring(5, 7).replace("0", "") : resultMonth.substring(5,
7));
2024-08-20 21:29:46 +08:00
layer.close(index);
}
2024-09-11 09:03:03 +08:00
},
error: function(e) {
2024-08-20 10:42:21 +08:00
}
})
})
}
2024-09-11 09:03:03 +08:00
function reloadData() {
2024-08-20 21:29:46 +08:00
setData();
2024-08-20 10:42:21 +08:00
getView();
2024-09-11 09:03:03 +08:00
getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ? resultMonth.substring(5, 7).replace("0",
"") : resultMonth.substring(5, 7));
2024-08-20 10:42:21 +08:00
}
//正常巡视照片导入
2024-09-11 09:03:03 +08:00
function normalInspectionUpload() {
let height = '99%';
let width = '70%';
var index = parent.layer.open({
2024-09-11 09:03:03 +08:00
title: ['正常巡视照片导入', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './normalInspectionUpload.html',
area: [width, height],
maxmin: false,
success: function(layero, index) {
// var myIframe = window[layero.find('iframe')[0]['name']];
// myIframe.hideSubmit();
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
});
}
//新增特巡结果
2024-09-11 09:03:03 +08:00
function specialPatrolAdd() {
let height = '99%';
let width = '60%';
var index = parent.layer.open({
2024-09-11 09:03:03 +08:00
title: ['特巡结果上传', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './specialPatrolAdd.html',
area: [width, height],
maxmin: false,
success: function(layero, index) {
// var myIframe = window[layero.find('iframe')[0]['name']];
// myIframe.hideSubmit();
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
});
}
//巡护段外上传
2024-09-11 09:03:03 +08:00
function patrolOutsideAdd() {
localStorage.setItem("resultUserId", localStorage.getItem("resultUserId"));
let height = '99%';
let width = '60%';
var index = parent.layer.open({
2024-09-11 09:03:03 +08:00
title: ['巡视结果上传-巡护范围之外的杆塔', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './patrolOutsideAdd.html',
area: [width, height],
maxmin: false,
success: function(layero, index) {
// var myIframe = window[layero.find('iframe')[0]['name']];
// myIframe.hideSubmit();
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
});
}
//上传单张巡视图片
2024-09-11 09:03:03 +08:00
function uploadPhoto(id, numTimes, makeType) {
let height = '70%';
let width = '60%';
var index = parent.layer.open({
2024-09-11 09:03:03 +08:00
title: ['上传巡视图片', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
type: 2,
content: './uploadPhoto.html',
area: [width, height],
maxmin: false,
success: function(layero, index) {
var myIframe = parent.window[layero.find('iframe')[0]['name']];
myIframe.setGtId(id, resultMonth, numTimes, localStorage.getItem("resultUserId"), makeType,
localStorage.getItem("resultProId"));
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
},
});
2024-08-26 09:00:01 +08:00
}
//页面赋值
2024-09-11 09:03:03 +08:00
function setData() {
var id = localStorage.getItem("resultUserId");
var makeMonth = resultMonth;
$.ajax({ //id获取详情打开弹窗传值子页面
type: 'post',
url: PATH_URL + "/makeInfo/getUserDetail",
dataType: 'json',
async: false,
data: {
id: id,
makeMonth: makeMonth
},
success: function(data) {
$("#username").text(data.data.userName);
$("#phone").text(data.data.tel);
$("#num").text(data.data.powerNum);
$("#oneNum").text(data.data.oneMake);
$("#twoNum").text(data.data.twoMake);
$("#otherNum").text(data.data.special);
},
error: function(e) {
2024-08-26 09:00:01 +08:00
}
})
2024-09-11 09:03:03 +08:00
}
function getYearMonth(yearMonth) {
let date = new Date(yearMonth);
let oldYear = date.getFullYear();
let oldMonth = date.getMonth() + 1;
return {
oldYear,
oldMonth
};
}