bug修改

This commit is contained in:
fl 2024-09-11 09:03:03 +08:00
parent 8a84f9055f
commit c852a6a2f0
6 changed files with 711 additions and 608 deletions

View File

@ -90,7 +90,7 @@
</li> </li>
<li> <li>
<div><img src="../../image/tabIcon6.png" alt=""></div> <div><img src="../../image/tabIcon6.png" alt=""></div>
<div>考勤台账</div> <div>考勤台账</div>
</li> </li>
<li> <li>
<div><img src="../../image/tabIcon7.png" alt=""></div> <div><img src="../../image/tabIcon7.png" alt=""></div>

View File

@ -9,9 +9,12 @@ layui.use(['form','layer','table','laydate'], function () {
//初始化日期选择框 //初始化日期选择框
laydate.render({ laydate.render({
elem: '#dataTime', elem: '#makeMonth',
type: 'month', type: 'month',
value: getCurrentMonth() // 初始加载当前月
}); });
// 触发submit提交 按钮点击或者表单被执行提交时触发 // 触发submit提交 按钮点击或者表单被执行提交时触发
form.on('submit(query)', function (data) { form.on('submit(query)', function (data) {
console.log("搜索") console.log("搜索")
@ -170,6 +173,7 @@ var col = [
*/ */
function init(){ function init(){
var subComId = $(window.parent.document).find("select[id='subComId']").val(); var subComId = $(window.parent.document).find("select[id='subComId']").val();
let makeMonth = $('#makeMonth').val();
// 渲染表格 // 渲染表格
table.render({ table.render({
elem: '#table', elem: '#table',
@ -177,7 +181,8 @@ function init(){
page: true, page: true,
where:{ where:{
yjId:localStorage.getItem("selectyj"), yjId:localStorage.getItem("selectyj"),
subId:localStorage.getItem("selectSubCom") subId:localStorage.getItem("selectSubCom"),
makeMonth:makeMonth
}, },
method:'post', method:'post',
border: true, border: true,
@ -272,3 +277,11 @@ function exportData() {
+ "&subId=" + subId + "&subId=" + subId
+ "&yjId=" + yjId + "&yjId=" + yjId
} }
// 获取当前月份,格式为 YYYY-MM
function getCurrentMonth() {
var currentDate = new Date();
var year = currentDate.getFullYear();
var month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); // 月份补0
return year + '-' + month;
}

View File

@ -1,5 +1,5 @@
//系统请求路径 //系统请求路径
let PATH_URL="http://127.0.0.1:1917/line" let PATH_URL="http://127.0.0.1:2024/line"
// let PATH_URL="http://192.168.0.14:2024/line" // let PATH_URL="http://192.168.0.14:2024/line"
let FILE_URL="http://127.0.0.1:1909/file" let FILE_URL="http://127.0.0.1:1909/file"

View File

@ -172,15 +172,22 @@ function insertSpecial(obj){
$.each(ysUrls,function(index,item){ $.each(ysUrls,function(index,item){
ysurld=ysurld+item+","; ysurld=ysurld+item+",";
}) })
//上传月份总是与日期不对应,从选择的提起获取月份
let makeTime = $("#dataTime").val();
let formatYearMonth = makeTime.substring(0, 7);
$.ajax({ $.ajax({
type:"post", type:"post",
url : PATH_URL + "/makeInfo/insertSpecial", url : PATH_URL + "/makeInfo/insertSpecial",
async:false, async:false,
data:{ data:{
userId: localStorage.getItem("resultUserId"),proId:localStorage.getItem("resultProId"),makeMonth:localStorage.getItem("resultMakeMonth"), userId: localStorage.getItem("resultUserId"),
proId:localStorage.getItem("resultProId"),
makeMonth:formatYearMonth,
ysUrl:ysurld,url:urld, ysUrl:ysurld,url:urld,
remarks:$("#remark").val(), remarks:$("#remark").val(),
makeTime:$("#dataTime").val() makeTime:makeTime
}, },
dataType:"json", dataType:"json",
success:function(res){ success:function(res){

View File

@ -12,6 +12,7 @@ layui.use(['form','layer','table','laydate'], function () {
laydate.render({ laydate.render({
elem: '#makeMonth', elem: '#makeMonth',
type: 'month', type: 'month',
value: getCurrentMonth() // 初始加载当前月
}); });
// 触发submit提交 按钮点击或者表单被执行提交时触发 // 触发submit提交 按钮点击或者表单被执行提交时触发
form.on('submit(query)', function (data) { form.on('submit(query)', function (data) {
@ -36,7 +37,8 @@ layui.use(['form','layer','table','laydate'], function () {
userName:'', userName:'',
yjName:'', yjName:'',
proName:'', proName:'',
makeMonth:'',yjId:yjId makeMonth:'',
yjId:yjId
} }
// 对表格进行重载。id 即 table表格的id // 对表格进行重载。id 即 table表格的id
table.reload('table', { table.reload('table', {
@ -70,11 +72,13 @@ layui.use(['form','layer','table','laydate'], function () {
*/ */
function init(){ function init(){
yjId=localStorage.getItem("oneselectyj"); yjId=localStorage.getItem("oneselectyj");
let makeMonth = $('#makeMonth').val();
let obj = { let obj = {
userName:'', userName:'',
yjName:'', yjName:'',
proName:'', proName:'',
makeMonth:'',yjId:yjId makeMonth:makeMonth,
yjId:yjId
} }
// 渲染表格 // 渲染表格
table.render({ table.render({
@ -220,3 +224,11 @@ function exportData() {
+ "&makeMonth=" + makeMonth + "&makeMonth=" + makeMonth
+ "&yjId=" + yjId + "&yjId=" + yjId
} }
// 获取当前月份,格式为 YYYY-MM
function getCurrentMonth() {
var currentDate = new Date();
var year = currentDate.getFullYear();
var month = (currentDate.getMonth() + 1).toString().padStart(2, '0'); // 月份补0
return year + '-' + month;
}

View File

@ -3,9 +3,10 @@ var currentDate = new Date();
var tabList = []; var tabList = [];
var month = currentDate.getMonth() + 1; //当前第几月 var month = currentDate.getMonth() + 1; //当前第几月
var year = currentDate.getFullYear(); var year = currentDate.getFullYear();
var resultMonth = localStorage.getItem("resultMakeMonth");
var resultUserId; var resultUserId;
var resultProId; var resultProId;
var resultMonth;
layui.use(['form', 'layer', 'table', 'laydate', 'element'], function() { layui.use(['form', 'layer', 'table', 'laydate', 'element'], function() {
table = layui.table; table = layui.table;
form = layui.form; form = layui.form;
@ -25,16 +26,16 @@ layui.use(['form','layer','table','laydate','element'], function () {
value: formatCurrentMonth(), // 如果你想预设当前日期为选中状态 value: formatCurrentMonth(), // 如果你想预设当前日期为选中状态
done: function(value, date) { //时间回调 done: function(value, date) { //时间回调
console.log("date:", date); console.log("date:", date);
localStorage.setItem("resultMakeMonth",value);
resultMonth = value; resultMonth = value;
init(date.year, date.month); init(date.year, date.month);
} }
}); });
$("#month").val(localStorage.getItem("resultMakeMonth")); $("#month").val(resultMonth);
resultMonth=localStorage.getItem("resultMakeMonth")
setData() setData()
init(year,month) let result = getYearMonth(resultMonth);
init(result.oldYear, result.oldMonth);
}); });
function firstDayStr() { function firstDayStr() {
var today = new Date(); var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始 var thisMonth = today.getMonth(); // 获取当前月份从0开始
@ -50,27 +51,33 @@ function firstDayStr(){
console.log("First day of this month: " + firstDayString); console.log("First day of this month: " + firstDayString);
return firstDayString; return firstDayString;
} }
function lastDayStr() { function lastDayStr() {
var today = new Date(); var today = new Date();
var thisMonth = today.getMonth(); // 获取当前月份从0开始 var thisMonth = today.getMonth(); // 获取当前月份从0开始
var year = today.getFullYear(); // 获取当前年份 var year = today.getFullYear(); // 获取当前年份
// 当月的第一天 // 当月的第一天
var firstDay = new Date(year, thisMonth, 1); var firstDay = new Date(year, thisMonth, 1);
var firstDayString = firstDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式 var firstDayString = firstDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式
// 当月的最后一天 // 当月的最后一天
var lastDay = new Date(); var lastDay = new Date();
var lastDayString = lastDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式 var lastDayString = lastDay.toISOString().slice(0, 10); // 转换为YYYY-MM-DD格式
console.log("Last day of this month: " + lastDayString);
return lastDayString; return lastDayString;
} }
function currMonth() { function currMonth() {
var lastDay = new Date(); var lastDay = new Date();
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM-DD格式 var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM格式
console.log("Last day of this month: " + lastDayString);
return lastDayString; return lastDayString;
} }
function currUpdateMonth(update) {
var lastDay = new Date();
lastDay.setMonth(lastDay.getMonth() + update);
var lastDayString = lastDay.toISOString().slice(0, 7); // 转换为YYYY-MM格式
return lastDayString;
}
//工程切换 //工程切换
function projectTab(event, proId) { function projectTab(event, proId) {
resultProId = proId; resultProId = proId;
@ -80,7 +87,9 @@ function projectTab(event,proId){
$("#projects>div").removeClass("projectsStyle"); $("#projects>div").removeClass("projectsStyle");
$(event).addClass("projectsStyle") $(event).addClass("projectsStyle")
getView(); getView();
getSpecial(localStorage.getItem("resultMakeMonth").substring(0,4),localStorage.getItem("resultMakeMonth").substring(5,7)<10?localStorage.getItem("resultMakeMonth").substring(5,7).replace("0",""):localStorage.getItem("resultMakeMonth").substring(5,7)); let result = getYearMonth(resultMonth);
// init(result.oldYear,result.oldMonth);
getSpecial(result.oldYear, result.oldMonth);
} }
function formatCurrentMonth() { function formatCurrentMonth() {
@ -94,7 +103,7 @@ function formatCurrentMonth() {
function init(chosenYear, chosenMonth) { function init(chosenYear, chosenMonth) {
layui.use(['table'], function() { layui.use(['table'], function() {
getTab(chosenMonth) getTab(chosenMonth)
if(localStorage.getItem("resultMakeMonth")!=currMonth()){ if (resultMonth != currMonth() && resultMonth != currUpdateMonth(-1) ) {
$("#normalInspectionUpload").css("display", "none") $("#normalInspectionUpload").css("display", "none")
getViewc(); getViewc();
} else { } else {
@ -104,6 +113,7 @@ function init(chosenYear,chosenMonth){
getSpecial(chosenYear, chosenMonth) getSpecial(chosenYear, chosenMonth)
}) })
} }
function getSpecial(chosenYear, chosenMonth) { function getSpecial(chosenYear, chosenMonth) {
let table = layui.table; let table = layui.table;
let daysInMonth = new Date(chosenYear, chosenMonth, 0).getDate(); let daysInMonth = new Date(chosenYear, chosenMonth, 0).getDate();
@ -115,7 +125,9 @@ function getSpecial(chosenYear,chosenMonth){
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
userId: localStorage.getItem("resultUserId"),proId:localStorage.getItem("resultProId"),makeMonth:localStorage.getItem("resultMakeMonth") userId: localStorage.getItem("resultUserId"),
proId: localStorage.getItem("resultProId"),
makeMonth: resultMonth
}, },
success: function(data) { success: function(data) {
console.log(data, "resultSpecial"); console.log(data, "resultSpecial");
@ -134,14 +146,19 @@ function getSpecial(chosenYear,chosenMonth){
let cols = [] let cols = []
for (let k = 1; k <= daysInMonth; k++) { for (let k = 1; k <= daysInMonth; k++) {
let str = chosenMonth + '.' + k; let str = chosenMonth + '.' + k;
let obj = {field:'isWork', title: str,align: 'center',width:70, let obj = {
field: 'isWork',
title: str,
align: 'center',
width: 70,
templet: function(d) { templet: function(d) {
if (d.isWork.includes(d.LAY_COL.title)) { if (d.isWork.includes(d.LAY_COL.title)) {
return `<i class="layui-icon" style="color: red;">&#xe605;</i> ` return `<i class="layui-icon" style="color: red;">&#xe605;</i> `
} else { } else {
return `<apan></apan>` return `<apan></apan>`
} }
}} }
}
cols.push(obj) cols.push(obj)
} }
console.log(tableData, "tableData"); console.log(tableData, "tableData");
@ -156,7 +173,19 @@ function getSpecial(chosenYear,chosenMonth){
} }
function getTab(chosenMonth) { function getTab(chosenMonth) {
tabList = [{id:'1',projectName:'xxx工程1'},{id:'2',projectName:'xxx工程2'},{id:'3',projectName:'xxx工程3'},{id:'4',projectName:'xxx工程4'}] tabList = [{
id: '1',
projectName: 'xxx工程1'
}, {
id: '2',
projectName: 'xxx工程2'
}, {
id: '3',
projectName: 'xxx工程3'
}, {
id: '4',
projectName: 'xxx工程4'
}]
$.ajax({ //id获取详情打开弹窗传值子页面 $.ajax({ //id获取详情打开弹窗传值子页面
type: 'post', type: 'post',
url: PATH_URL + "/makeInfo/getProByUser", url: PATH_URL + "/makeInfo/getProByUser",
@ -200,7 +229,9 @@ function getView(){
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
userId: localStorage.getItem("resultUserId"),makeMonth:localStorage.getItem("resultMakeMonth"),proId:localStorage.getItem("resultProId") userId: localStorage.getItem("resultUserId"),
makeMonth: resultMonth,
proId: localStorage.getItem("resultProId")
}, },
success: function(data) { success: function(data) {
console.log(data, "result"); console.log(data, "result");
@ -210,7 +241,6 @@ function getView(){
photoList2 = data.vgtListtwo; photoList2 = data.vgtListtwo;
viewList3 = data.mgtListspe; viewList3 = data.mgtListspe;
photoList3 = data.mgtListspe; photoList3 = data.mgtListspe;
}, },
error: function(e) { error: function(e) {
@ -222,7 +252,8 @@ function getView(){
// 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'}, // 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'},
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}] // {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// //照片集合 // //照片集合
var filePath = 'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg'; var filePath =
'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg';
var sFilePath = '../../../image/viewImg.jpg'; var sFilePath = '../../../image/viewImg.jpg';
// photoList1 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}, // 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:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
@ -270,7 +301,8 @@ function getView(){
for (var j = 0; j < photoList1.length; j++) { for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) { if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -279,10 +311,12 @@ function getView(){
if (!flag) { if (!flag) {
//照片不存在,显示上传照片按钮 //照片不存在,显示上传照片按钮
if ("1" == viewList1[i].state) { 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 +=
`<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>` html += `<div style="color:#cccccc">上传图片</div>`
} else { } 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 +=
`<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="color:#cccccc">该杆塔不属于${usernamed}管辖</div>`
} }
} }
@ -356,7 +390,8 @@ function getView(){
for (var j = 0; j < photoList2.length; j++) { for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) { if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -365,10 +400,12 @@ function getView(){
if (!flag) { if (!flag) {
//照片不存在,显示上传照片按钮 //照片不存在,显示上传照片按钮
if ("1" == viewList2[i].state) { 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 +=
`<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>` html += `<div style="color:#cccccc">上传图片</div>`
} else { } 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 +=
`<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="color:#cccccc">该杆塔不属于${usernamed}管辖</div>`
} }
} }
@ -410,7 +447,8 @@ function getView(){
</div> </div>
<div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">` <div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
for (let i = 0; i < viewList3.length; i++) { for (let i = 0; i < viewList3.length; i++) {
var gtName = viewList3[i].gtName.length>11?viewList3[i].gtName.substring(0,11) + '...': viewList3[i].gtName; var gtName = viewList3[i].gtName.length > 11 ? viewList3[i].gtName.substring(0, 11) + '...' : viewList3[i]
.gtName;
html += `<div class="viewBox"> html += `<div class="viewBox">
<div style="width: 100%;height:100%"> <div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;"> <div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
@ -425,7 +463,8 @@ function getView(){
for (var j = 0; j < photoList3.length; j++) { for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) { if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -475,7 +514,9 @@ function getViewc(){
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
userId: localStorage.getItem("resultUserId"),makeMonth:localStorage.getItem("resultMakeMonth"),proId:localStorage.getItem("resultProId") userId: localStorage.getItem("resultUserId"),
makeMonth: resultMonth,
proId: localStorage.getItem("resultProId")
}, },
success: function(data) { success: function(data) {
console.log(data, "result"); console.log(data, "result");
@ -485,7 +526,6 @@ function getViewc(){
photoList2 = data.vgtListtwo; photoList2 = data.vgtListtwo;
viewList3 = data.mgtListspe; viewList3 = data.mgtListspe;
photoList3 = data.mgtListspe; photoList3 = data.mgtListspe;
}, },
error: function(e) { error: function(e) {
@ -497,7 +537,8 @@ function getViewc(){
// 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'}, // 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'},
// {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}] // {id:"7",name:'#7'},{id:"8",name:'#8'},{id:"9",name:'#9'}]
// //照片集合 // //照片集合
var filePath = 'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg'; var filePath =
'http://192.168.0.14:1909/file/ynRealName/violationBlack/2024/05/13/c0a62f0b51924a4584ec0c8f011fc2af0074P3wTgy1h3gtizuzvfj30zk0zg7ad.jpg';
var sFilePath = '../../../image/viewImg.jpg'; var sFilePath = '../../../image/viewImg.jpg';
// photoList1 = [{name:'#2', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#3', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'}, // 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:'#4', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},{name:'#5', filePath:filePath,sFilePath:sFilePath,makeTime:'2024-08-19'},
@ -539,7 +580,8 @@ function getViewc(){
for (var j = 0; j < photoList1.length; j++) { for (var j = 0; j < photoList1.length; j++) {
if (viewList1[i].gtId == photoList1[j].gtId) { if (viewList1[i].gtId == photoList1[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList1[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList1[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -612,7 +654,8 @@ function getViewc(){
for (var j = 0; j < photoList2.length; j++) { for (var j = 0; j < photoList2.length; j++) {
if (viewList2[i].gtId == photoList2[j].gtId) { if (viewList2[i].gtId == photoList2[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList2[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList2[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -660,7 +703,8 @@ function getViewc(){
</div> </div>
<div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">` <div id="specialViewBox" style="width: 100%;min-height: 200px;margin-bottom: 20px;display: flex;flex-wrap: wrap;">`
for (let i = 0; i < viewList3.length; i++) { for (let i = 0; i < viewList3.length; i++) {
var gtName = viewList3[i].gtName.length>11?viewList3[i].gtName.substring(0,11) + '...': viewList3[i].gtName; var gtName = viewList3[i].gtName.length > 11 ? viewList3[i].gtName.substring(0, 11) + '...' : viewList3[i]
.gtName;
html += `<div class="viewBox"> html += `<div class="viewBox">
<div style="width: 100%;height:100%"> <div style="width: 100%;height:100%">
<div class="viewHeader" style="font-size:12px;background-color: #73A0FA;"> <div class="viewHeader" style="font-size:12px;background-color: #73A0FA;">
@ -675,7 +719,8 @@ function getViewc(){
for (var j = 0; j < photoList3.length; j++) { for (var j = 0; j < photoList3.length; j++) {
if (viewList3[i].gtId == photoList3[j].gtId) { if (viewList3[i].gtId == photoList3[j].gtId) {
//照片存在,直接显示 //照片存在,直接显示
html += `<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">` html +=
`<img src="${IMG_URL+photoList3[j].sfilePath}" alt="" onclick="filePreView('${IMG_URL+photoList3[j].filePath}')">`
flag = true; flag = true;
break; break;
} }
@ -735,6 +780,7 @@ function towerSpeciaEdit(event,id,numTimes){
$(event).parent().next().children("div").css("display", "flex") $(event).parent().next().children("div").css("display", "flex")
} }
} }
function uploadSpecialPhoto(id) { function uploadSpecialPhoto(id) {
let height = '70%'; let height = '70%';
let width = '60%'; let width = '60%';
@ -746,7 +792,8 @@ function uploadSpecialPhoto(id){
maxmin: false, maxmin: false,
success: function(layero, index) { success: function(layero, index) {
var myIframe = parent.window[layero.find('iframe')[0]['name']]; var myIframe = parent.window[layero.find('iframe')[0]['name']];
myIframe.setGtId(id,localStorage.getItem("resultMakeMonth"),3,localStorage.getItem("resultUserId"),3,localStorage.getItem("resultProId")); myIframe.setGtId(id, resultMonth, 3, localStorage.getItem("resultUserId"), 3, localStorage
.getItem("resultProId"));
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法 // var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
}, },
@ -817,7 +864,10 @@ function towerDel(event,id,numTimes){
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
gtId:id,makeMonth:localStorage.getItem("resultMakeMonth"),numTimes:numTimes,userId:localStorage.getItem("resultUserId") gtId: id,
makeMonth: resultMonth,
numTimes: numTimes,
userId: localStorage.getItem("resultUserId")
}, },
success: function(data) { success: function(data) {
console.log(data, "确定删除"); console.log(data, "确定删除");
@ -826,7 +876,9 @@ function towerDel(event,id,numTimes){
} else { } else {
setData() setData()
getView() getView()
getSpecial(localStorage.getItem("resultMakeMonth").substring(0,4),localStorage.getItem("resultMakeMonth").substring(5,7)<10?localStorage.getItem("resultMakeMonth").substring(5,7).replace("0",""):localStorage.getItem("resultMakeMonth").substring(5,7)); getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ?
resultMonth.substring(5, 7).replace("0", "") : resultMonth.substring(5,
7));
layer.close(index); layer.close(index);
} }
}, },
@ -836,6 +888,7 @@ function towerDel(event,id,numTimes){
}) })
}) })
} }
function towerSpecialDel(event, id, numTimes) { function towerSpecialDel(event, id, numTimes) {
layer.confirm("确定删除吗?", function(index) { layer.confirm("确定删除吗?", function(index) {
$.ajax({ //id获取详情打开弹窗传值子页面 $.ajax({ //id获取详情打开弹窗传值子页面
@ -844,7 +897,8 @@ function towerSpecialDel(event,id,numTimes){
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
id:id,numTimes:numTimes id: id,
numTimes: numTimes
}, },
success: function(data) { success: function(data) {
console.log(data, "确定删除"); console.log(data, "确定删除");
@ -853,7 +907,9 @@ function towerSpecialDel(event,id,numTimes){
} else { } else {
setData() setData()
getView() getView()
getSpecial(localStorage.getItem("resultMakeMonth").substring(0,4),localStorage.getItem("resultMakeMonth").substring(5,7)<10?localStorage.getItem("resultMakeMonth").substring(5,7).replace("0",""):localStorage.getItem("resultMakeMonth").substring(5,7)); getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ?
resultMonth.substring(5, 7).replace("0", "") : resultMonth.substring(5,
7));
layer.close(index); layer.close(index);
} }
}, },
@ -863,10 +919,12 @@ function towerSpecialDel(event,id,numTimes){
}) })
}) })
} }
function reloadData() { function reloadData() {
setData(); setData();
getView(); getView();
getSpecial(localStorage.getItem("resultMakeMonth").substring(0,4),localStorage.getItem("resultMakeMonth").substring(5,7)<10?localStorage.getItem("resultMakeMonth").substring(5,7).replace("0",""):localStorage.getItem("resultMakeMonth").substring(5,7)); getSpecial(resultMonth.substring(0, 4), resultMonth.substring(5, 7) < 10 ? resultMonth.substring(5, 7).replace("0",
"") : resultMonth.substring(5, 7));
} }
//正常巡视照片导入 //正常巡视照片导入
function normalInspectionUpload() { function normalInspectionUpload() {
@ -938,7 +996,8 @@ function uploadPhoto(id,numTimes,makeType){
maxmin: false, maxmin: false,
success: function(layero, index) { success: function(layero, index) {
var myIframe = parent.window[layero.find('iframe')[0]['name']]; var myIframe = parent.window[layero.find('iframe')[0]['name']];
myIframe.setGtId(id,localStorage.getItem("resultMakeMonth"),numTimes,localStorage.getItem("resultUserId"),makeType,localStorage.getItem("resultProId")); myIframe.setGtId(id, resultMonth, numTimes, localStorage.getItem("resultUserId"), makeType,
localStorage.getItem("resultProId"));
// var fnc = myIframe.setData(data.data); //aaa()为子页面的方法 // var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
}, },
@ -947,14 +1006,15 @@ function uploadPhoto(id,numTimes,makeType){
//页面赋值 //页面赋值
function setData() { function setData() {
var id = localStorage.getItem("resultUserId"); var id = localStorage.getItem("resultUserId");
var makeMonth=localStorage.getItem("resultMakeMonth"); var makeMonth = resultMonth;
$.ajax({ //id获取详情打开弹窗传值子页面 $.ajax({ //id获取详情打开弹窗传值子页面
type: 'post', type: 'post',
url: PATH_URL + "/makeInfo/getUserDetail", url: PATH_URL + "/makeInfo/getUserDetail",
dataType: 'json', dataType: 'json',
async: false, async: false,
data: { data: {
id: id,makeMonth:makeMonth id: id,
makeMonth: makeMonth
}, },
success: function(data) { success: function(data) {
$("#username").text(data.data.userName); $("#username").text(data.data.userName);
@ -969,3 +1029,14 @@ function setData(){
} }
}) })
} }
function getYearMonth(yearMonth) {
let date = new Date(yearMonth);
let oldYear = date.getFullYear();
let oldMonth = date.getMonth() + 1;
return {
oldYear,
oldMonth
};
}